<?php if(!defined('AUTHACCESS')){echo "Not Allowed";exit();}
?>
<?php global $themestyle,$stripchat_id;?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<?php
	if (!empty($clean_req['camfeed'])) {
		$checkfeed = cleanname_replace($clean_req['camfeed']);

	}
	if (!empty($clean_req['moviefeed'])) {
		$checkfeed = cleanname_replace($clean_req['moviefeed']);

	}
?>

<?php
 	$thisrqrul = $_SERVER['REQUEST_URI'];
 	$thndex = stripos($thisrqrul, "/theme");
	$canonical = substr($thisrqrul,0,$thndex);
	echo "<link rel=\"canonical\" href=\"https://" . $_SERVER['SERVER_NAME']. $canonical . "\"/>\n";
?>
<?php $page_title = $site_title; 
$page_description = !empty($page_description ) ? $page_description  : "";
$page_keywords = !empty($page_keywords ) ? $page_keywords  : "";
?>
<title><?php echo $page_title . " " . $page_description; ?><?php if($doingsearch){echo " Search " . " " . $clean_req['search'];}else{echo " "; }  ?></title>
<meta name="description" content="<?php echo $page_description; ?>">
<meta name="keywords" content="<?php echo $page_keywords; ?>">
<link rel="stylesheet" href="<?php echo $site_directory."/themes/".$template; ?>/green_style.css">
<script src="<?php echo $site_directory."/themes/".$template; ?>/site.js"></script>
</head>
<body>

<!-- script type="application/javascript" src="https://go.cam/static/js/app/avsHosted.js?p=882&key=XjtN1QAUqHBi54BmVLUPryok5U8BF1hBmC0tRG1rcYU&background=ffffff&foreground=000000&buttonBackground=9acd1f&buttonForeground=ffffff&language=en&autoStart=1"></script -->


<div class="header_container">
	<div class="mainlogocontainer"><a class=textlogo href="<?php echo $site_directory.$theme; ?>/"><span><?php echo $site_title; ?></span></a></div>
	<div>
		<div id=toplinkscont>
<a href="<?php echo $site_directory;?>/video/allmovies<?php if(!empty($clean_req['themestyle'])) {echo "/theme/" . $clean_req['themestyle'];}?>" class='allmovieslink' >Allmovies</a>
<a href="<?php echo $site_directory;?>/cams/allcams<?php if(!empty($clean_req['themestyle'])) {echo "/theme/" . $clean_req['themestyle'];}?>" class='allmovieslink' >Allcams</a>

			<span onclick="showmoretoplinks();" class="suggested_search_links showmore">Search &#9662;</span>
		</div><!-- toplinkscont -->
		<span class=mobilenav onclick="togmobilenav()">&#9776;</span>
	</div>
	
<?php	
	if( ($run_test_themes == "yes") && (strpos($_SERVER['REQUEST_URI'], "search1.php") === false ) )  {
?>
	<span style="position:fixed;bottom:10px;right:20px;z-index:4;width:100px;"><?php include(__DIR__ . "../../../available_themes.php"); ?>
<?php }	?>


</div><!-- header_container -->


<?php
	if (!empty($clean_req['camfeed'])) {
		$checkfeed = cleanname_replace($clean_req['camfeed']);
	}
	if (!empty($clean_req['moviefeed'])) {
		$checkfeed = cleanname_replace($clean_req['moviefeed']);
	}
?>

<div id=mobilemenucont></div>

		
<div class="searchform_container dropdown">
	<form  method=post action="<?php echo $site_directory; ?>/search1.php">
		<input type=hidden name=db value="<?php echo !empty($clean_req['db']) ?  $clean_req['db'] :  $checkfeed ?>">
		<input class="searchbox" id=searchinput onclick="clearsearch()" type=text name=search value="<?php echo empty($clean_req['search']) ? 'search' : $clean_req['search'] ?>">
		<input type=hidden name=media_type value="<?php echo  $media_type; ?>">
		<input type=hidden name=searchedform value="searchedform">
		<input type=hidden name=page value="1">
		
		<?php if($run_test_themes == "yes"){echo "<input type=hidden name=themestyle value=\"$themestyle\">";} ?>
		
		
		<?php if( (!empty($clean_req['themestyle'])) && ($run_test_themes == "yes") ) {
			if(in_array($clean_req['themestyle'], $allowed_themes)){
				$template = $clean_req['themestyle'];
				$theme = "/theme/$template";
		?>
				<input type=hidden name=themestyle value="<?php echo $template; ?>">
		<?php
			}else{
				echo "ERROR! Not allowed.";exit();
			}
			
		}
		 ?>
		 
		 
		<input class="searchsubmit" type=submit value="search">
	</form>
</div><!-- searchform_container -->


<div class="page_title_heading">
<?php 
	if (!empty($movie_page_title[$checkfeed]) ) {
		echo "<a class=\"topTextSponsorLink\" href=\"" . $movie_join_link[$checkfeed] . "\">Click here to join " . $movie_page_title[$checkfeed] . "</a>"; 
	} 
	if (!empty($cam_site_names[$checkfeed]) ) {
		echo "<a style=\"color:white;border:solid white 1px;padding:5px;border-radius:8px;\" href=" . $site_directory . "/" . $media_type . "/" . strtolower($cam_site_names[$checkfeed]) . $theme . ">$cam_site_names[$checkfeed]</a>"; 
		if($doingsearch){echo "<span style=\"color:white;\">  : " . ucwords($clean_req['search']) . "</span>";}
	} 
?>

</div>

<?php
	if ($use_sidebar == "yes") {
		require(__DIR__ . "/sidebar.php");
	}
	
	echo "<div class=\"content_main\">";
?>
