<?php
error_reporting(0);
require_once "login/quickprotect.class.php";
$quickprotect = new quickprotect();
$quickprotect->checkLoginAndDirect(); //This checks if the user is logged in, and if not, directs him to login.php
?>

<?php

$pageTitle = $_GET['p'];

// get stats...

$getHTML = file_get_contents("pages/$pageTitle/html.txt", true);
$getTitle = file_get_contents("pages/$pageTitle/title.txt", true);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo file_get_contents("rr/productname.txt", true); ?> - Editing Fanpage</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>


<script type="text/javascript">
	$().ready(function() {
	
	$('input[name=header]:eq(<?php echo file_get_contents("pages/$pageTitle/header.txt", true); ?>)').attr('checked', 'checked');
	$('input[name=nav]:eq(<?php echo file_get_contents("pages/$pageTitle/nav.txt", true); ?>)').attr('checked', 'checked');
	$('input[name=tmp]:eq(<?php echo file_get_contents("pages/$pageTitle/tmp.txt", true); ?>)').attr('checked', 'checked');
	$('input[name=reveal]:eq(<?php echo file_get_contents("pages/$pageTitle/reveal.txt", true); ?>)').attr('checked', 'checked');
	
		$("#likepageArea").hide();

	});
</script>

</head>

<body>

<div id="mainWrapper">

	<form action="script/edit_test_2.php" method="post" >
    <input type="hidden" class="textinputCreate" name="testName" value="<?php echo $pageTitle; ?>"  />
    
    
  <div id="mainTopArea">
    
    	<div id="LogoArea">
        	<img src="rr/logo.png" style="margin-left:-9px;" />
        </div>
        
        <div id="NavArea">
        
        	<span><a href="index.php">View Pages</a></span>
            <span style="margin-right:45px; margin-left:45px;"><a href="settings.php">Settings</a></span>
            <span><a href="support.php">Support</a></span>
        
</div>
        
        <br clear="left" />
    
    </div>
    
    <div id="mainSection">
    
    	<div id="createdVersions">
        	
             	<div id="cookieCrumb" style=" margin-top:17px;">
        
        	<span><a href="index.php" class="viewall">view all pages</a></span> <span style="margin-left:10px; margin-right:10px;">-</span> <span><strong>Editing A Page</strong></span>
        
        </div>
            
            <div id="cvTitle">
       	  <span><strong >Edit</strong> - <?php echo $getTitle ; ?></span></div>
            
            
        
        
        </div>
        
         <div id="cvCreatedList">
            
            	<div class="ListITEM_create">
                
                	<div class="ctTitle" >
                	<span><img src="images/bullet_go.png" style="margin-right:15px; margin-left:15px; margin-bottom:-3px;" /><strong style="font-size:14px;">Basic Page Information:</strong> A few options for your fanpage...</span></div>
                    
                    
                                   
                </div>
  
        
        
        </div>
        
<div id="shadow" align="center" style="margin-top:1px;">
        	<img src="images/shadow.png" />
      </div>
       
        
        <div id="templateChooser" style="margin-left:47px; margin-right:47px;">
        
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>FanPage Name:</strong><br />
                  make it memberable...</p></td>
                <td><input type="text" class="textinputCreate" name="pageName" value="<?php echo $getTitle ; ?>"  /></td>
              </tr>
            </table>
            
     		<div class="splitterest"></div>
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>Show Header:</strong><br />
                  display header image on this page...</p></td>
                <td><input type="radio" class="headerRadio" name="header" value="0"><strong style="margin-right:20px;">Hide </strong>  <input class="headerRadio" type="radio" name="header" value="1"> <strong>Show</strong> </td>
              </tr>
            </table>
            
     		<div class="splitterest"></div>
            
             <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>Show Navigation:</strong><br />
                  display header image on this page...</p></td>
                <td><input type="radio" name="nav" value="0">
                  <strong style="margin-right:20px;">Hide </strong>
                  <input type="radio" name="nav" value="1">
                  <strong>Show</strong></td>
              </tr>
            </table>
            
     		<div class="splitterest"></div>
            
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>No Template:</strong><br />
                  disable template structure...</p></td>
                <td><input type="radio" name="tmp" value="0">
                  <strong style="margin-right:20px;">Yes Template </strong><span style="margin-right:20px;">(recommended)</span>
                  <input type="radio" name="tmp" value="1">
                  <strong style="margin-right:20px;">No Template</strong> (adv users only)</td>
              </tr>
            </table>
            
     		<div class="splitterest"></div>
            
            <div id="likepageArea">
            
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><strong>Fans Only:</strong><br />
                  require "like" to view page...</p></td>
                <td>
                <input name="reveal" class="revealRadio" id="revealYes" type="radio" value="0" checked="checked">
                <strong style="margin-right:20px;">                Viewable By Anyone</strong>
                <input type="radio" class="revealRadio" id="revealNo" name="reveal" value="1">
                <strong>                Fans Only - Require &quot;Like&quot;</strong></td>
              </tr>
            </table>
               	<div class="splitterest"></div>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><p style="color:#666;">* if your viewer is required to be a fan to view this page, it will revert to "Like Page" if they are not a fan or have liked the page...</p></td>
             
              </tr>
            </table>
        
        	<div class="splitterest"></div>
            
        	</div>
           	
        </div>
         <br clear="right" />
    </div>

<br clear="right" />
        <div id="cvCreatedList">
            
            	<div class="ListITEM_create">
                
                	<div class="ctTitle2" style="padding-top:10px;">
                	<span><img src="images/bullet_go.png" style="margin-right:15px; margin-left:15px; margin-bottom:-3px;" /><strong style="font-size:14px;">HTML Area:</strong> Add any html here... you can add anything you like here...</span>
                </div>
                    
                    <textarea name="htmlHere" class="ckeditor" style="outline:none; height:500px; " ><?php echo $getHTML; ?></textarea>
               
                </div>
      </div>
         <div id="shadow" align="center" style="margin-top:1px;">
        	<img src="images/shadow.png" />
        </div>
        
        
   
        
          	

        
        
        <div id="createNewVersion">
          <div id="videoTutorial2">
                	
                 <div id="supportTitle" align="center" >
                    <span><strong>All Done? Save These Changes...</strong></span>      	
    </div>
                    
                    <div id="supportTalk" align="center" >
                    
                    <span><input type="image" src="images/savechanges.png"  /></span>
                    
                    </div>
          </div>
        
        	<br clear="left" />
           
          
  </div>
        
        <div id="FooterArea" align="center">
        
        	<span><strong><?php echo file_get_contents("rr/productname.txt", true); ?></strong> - All Rights Reserved - This was made in 2010 - <?php echo file_get_contents("rr/producttag.txt", true); ?> |  <a href="login/login.php?do=logout"><strong>LOGOUT</strong></a ></span>
        
        </div>
    
    
</div>

</form>

</div>

</body>
</html>
