<?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	
	$checksetup = file_get_contents("script/url.txt", true);
	
	if ( $checksetup == "" ){
		header('Location: setup.php');
	}
	
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
  $pageURL = str_replace("admin/index.php", "fanpage.php", $pageURL);
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
  $pageURL = str_replace("admin/index.php", "fanpage.php", $pageURL);
 }
 return $pageURL;
 
}
	
?>
<!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); ?> - View Pages For CurrentFanPage</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/jquery.min.js"></script>
	<script>
		!window.jQuery && document.write('<script src="jquery-1.4.3.min.js"><\/script>');
	</script>
	<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
   
     <script type="text/javascript">
		$(document).ready(function() {
			
			
		
			
		});
	</script>

</head>

<body>

<div id="mainWrapper">

	<div id="mainTopArea">
    
    	<div id="LogoArea">
        	<img src="rr/logo.png" style="margin-left:-9px;" />
        </div>
        
        <div id="NavArea">
        
        	<span><a href="">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="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>Dashboard</strong></span>
        
        </div>
    
    
<div id="createdVersions">
        	
            <div id="cvTitle">
            	<span><strong style="">Pages Inside Your Account:</strong></span>
        </div>
            
            <div id="cvCreatedList">
            
            <div class='ListITEM' id='optinpage'>
                
                	<div class='cvName' style="margin-left:15px; ">
                	<span><img src='images/like.png' style='margin-right:15px; margin-bottom:-3px;' /><strong style='font-size:14px;'><?php echo file_get_contents("pages/likepage/title.txt", true); ?></strong> (&quot;like&quot; this page)</span>
                </div>
                    
                  <div class='cvType'  >
                	<span><strong style='font-size:12px;'>Total Views:</strong> <?php echo file_get_contents("pages/likepage/views.txt", true); ?></span>
                  </div>
                  
            
                    
                    <div class='cvAction'>
					<span><a href='../view.php?p=likepage&amp;sp=0' target="_blank" ><img src='images/view.png' style='margin-bottom:0px; margin-right:15px;' border='0' /></a></span>
                    <span><a href='edit.php?p=likepage' ><img src='images/editpage.png' style='margin-bottom:-3px; margin-right:15px;' border='0' /></a></span>
                    
   	    </div>
                    
                    <br clear='left' />
                
              </div>
                
                      <div class='ListITEM' id='page_1'>
                
                	<div class='cvName' style="margin-left:15px;">
                	<span><img src='images/reveal.png' style='margin-right:15px; margin-bottom:-3px;' /><strong style='font-size:14px;'><?php echo file_get_contents("pages/reveal/title.txt", true); ?></strong> (reveal page)</span>
                    </div>
                    
                  <div class='cvType'  >
                	<span><strong style='font-size:12px;'>Total Views:</strong>  <?php echo file_get_contents("pages/reveal/views.txt", true); ?></span>
                  </div>
                  
            
                    
                    <div class='cvAction'>
                    <span><a href='../view.php?p=reveal&amp;sp=1' target="_blank" ><img src='images/view.png' style='margin-bottom:0px; margin-right:15px;' border='0' /></a></span>
					<span><a href='edit.php?p=reveal' ><img src='images/editpage.png' style='margin-bottom:-3px; margin-right:15px;' border='0' /></a></span>
                	</div>
                    
                    <br clear='left' />
                
                </div>
            
            		
                    <?php
				
 			$dirname = "pages";
			$images = scandir($dirname);
			$ignore = Array(".", "..", "likepage", "reveal");

				
			foreach($images as $curimg){
		
			if(!in_array($curimg, $ignore)) {
		
			$getTitle = file_get_contents("pages/$curimg/title.txt", true);
			$getViews = file_get_contents("pages/$curimg/views.txt", true);
				
			echo "
				<div class='ListITEM' id='page_1'>
                
                	<div class='cvName' style='margin-left:15px;'>
                	<span><img src='images/document-text.png' style='margin-right:15px; margin-bottom:-3px;' /><strong style='font-size:14px;'>$getTitle</strong> (custom page)</span>
                    </div>
                    
                  <div class='cvType'  >
                	<span><strong style='font-size:12px;'>Total Views:</strong>  $getViews</span>
                  </div>
                  
            
                    
                    <div class='cvAction'>
                    <span><a href='../view.php?p=$curimg&amp;sp=1' target='_blank' ><img src='images/view.png' style='margin-bottom:0px; margin-right:15px;' border='0' /></a></span>
					<span><a href='edit.php?p=$curimg' ><img src='images/editpage.png' style='margin-bottom:-3px; margin-right:15px;' border='0' /></a></span>
                	</div>
                    
                    <br clear='left' />
                
                </div>
			";
			
			
			};
	
			}
								
			?>
            
            
            <div class='ListITEM ListITEM2' id='privacypolicy' style="padding-left:40px; padding-right:40px;">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250"><p><img src='images/link.png' style='margin-right:15px; margin-bottom:-3px; padding-bottom:10px;' align="left" /><strong>FB Canvas URL:</strong><br />
                  paste this into facebook...</p></td>
                <td><input type="text" class="textinputCreate" name="fbSecret" style="width:600px;" value="<?php echo curPageURL(); ?>"  /></td>
              </tr>
            </table>
                
              </div>
                
                      
      
          </div>
        
        
        </div>
        
<div id="shadow" align="center" style="margin-top:1px;">
        	<img src="images/shadow.png" />
      </div>
        
        
        <div id="createNewVersion">
        
       	  <div id="createNew">
            
            	<div id="createNewTitle">
     	     	<span><strong style="">Create A New Page</strong></span>
      </div>
                
                <div id="createButtons" style="margin-top:25px; color:#666;" > 
                  <p><a href="create.php"><img src="images/createpage.png" border="0"  /></a></p>
                  <p>* You can create as many pages as you want, but you can only have 4 navigation menu items...</p>
          </div>
              
              <div id="cLower"></div>
                
                
                
                
       	  </div>
            
             <div id="videoTutorial">
                	
                    <div id="supportTitle">
                    <span><strong style=" color:#143458">Need Some Help?</strong> Get Support!</span>      	
           			</div>
                    
                    <div id="supportTalk">
                    
                    <span>Looking for help creating your fanpage site? Well you we have a few options for you! You can look through our <a href="support.php"> tutorials</a> or you can <a href="support.php">contact support</a> to get the answers your looking for, fast!</span>
                    
          </div>
                    
                    <div id="supportLegend">
                    
                    	<div id="legendTitle">
                        	<span>Email Support: <?php echo file_get_contents("rr/supportemail.txt", true); ?> </span>
                        </div>
                    
                    	<div id="legendBox"></div>
                    
                    
                    </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>


</div>

<div style="display: none;">
		<div id="showCode" style="width:400px; height:100px;">
			here would be the code...<br /> 
            <input type="text" class="textinputCreate" value="replace this" id="siteCode"  />
		</div>
</div>

</body>
</html>
