$value) { $debug['$_GET:'.$key] = $value; } foreach ($_POST as $key => $value) { $debug['$_POST:'.$key] = $value; } } pageTimer(); include($basepath.'/includes/inc.seo.php'); pageTimer(); $cacheName = $_SERVER['REQUEST_URI']; if ( in_array(getRealIpAddr(), $admin_allowed_ips) ) { #$cacheName .= time(); } $cacheResult = getCache($cacheName); $cacheTotalPages = getCache("total_pages$cacheName"); $cacheTotalResults = getCache("total_results$cacheName"); if($cacheResult && $cacheTotalPages ) { $array = $cacheResult; $total_pages = $cacheTotalPages; if ( $cacheTotalResults ) { $total_results = $cacheTotalResults; } } else { include($basepath.'/includes/inc.index_queries.php'); if ($result) { while($row = mysql_fetch_assoc($result)) { $cat = mysql_query("SELECT niches.name FROM content_niches JOIN niches ON niches.record_num = content_niches.niche AND content_niches.content = {$row['record_num']} WHERE content_niches.content = {$row['record_num']} LIMIT 1"); $cat = mysql_fetch_array($cat); $row['category'] = $cat['name']; $array[] = $row; } } if($thispage != 'favorites' && $_GET[mode] != 'my_uploads') { setCache($cacheName,$array,$overall_cache_time); setCache("total_pages$cacheName",$total_pages,$overall_cache_time); setCache("total_results$cacheName",$total_results,$overall_cache_time); } } pageTimer(); $thisfile = 'index'; $webpage="index"; if($isMobile) { include($basepath.'/templates/mobile.overall_header.php'); } else { if($_GET[channel]){ include($basepath.'/templates/template.overall_header-channel.php'); } elseif($_GET[mode]=='photos') { include($basepath.'/templates/template.overall_header-photos.php'); } else { include($basepath.'/templates/template.overall_header.php'); } } if(empty($_GET[mode]) && !$_GET[page]) { include($basepath.'/templates/template.home.php'); } unset($i); if(is_array($array)) { foreach($array as $row) { $i++; if($row[photos] == 1) { if($isMobile) { include($basepath.'/templates/mobile.content_item_photo.php'); } else { include($basepath.'/templates/template.content_item_photo.php'); } } else { if($isMobile) { include($basepath.'/templates/mobile.content_item.php'); } else { if($_GET[channel] && $i == 11){ include($basepath.'/templates/template.adv-channel.php');} include($basepath.'/templates/template.content_item.php'); } } } } else { if($thispage != 'favorites' && $_GET[mode] != 'my_uploads') { $notfound = ($mode == 'photos') ? 'photos' : 'videos'; echo "

Sorry, no results were found.
We're sorry, but the requested {$notfound} cannot be found. Return to Home Page.
Or try our popular videos:

"; //$cacheName = $_SERVER[REQUEST_URI]; # /fpdu/new/random/ $cacheName = '/random/'; $cacheResult = getCache($cacheName); if($cacheResult) { $array = $cacheResult; } else { $results_per_page = intval(floor($results_per_page / 2)); $result = mysql_query("SELECT content.*, (SELECT content_views.views FROM content_views WHERE content_views.content = content.record_num) as views FROM content WHERE enabled = 1 AND photos = 0 ORDER BY RAND() LIMIT 0,$results_per_page") or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { $cat = mysql_query("SELECT niches.name FROM content_niches JOIN niches ON niches.record_num = content_niches.niche AND content_niches.content = {$row['record_num']} WHERE content_niches.content = {$row['record_num']} LIMIT 1"); $cat = mysql_fetch_array($cat); $row['category'] = $cat['name']; $array[] = $row; } setCache($cacheName,$array,10); #$overall_cache_time } if($array) { foreach($array as $row) { $i++; if($row[photos] == 1) { if($isMobile) { include($basepath.'/templates/mobile.content_item_photo.php'); } else { include($basepath.'/templates/template.content_item_photo.php'); } } else { if($isMobile) { include($basepath.'/templates/mobile.content_item.php'); } else { include($basepath.'/templates/template.content_item.php'); } } } } } else { echo "

Nothing here for now.

"; } } pageTimer(); if($isMobile) { include($basepath.'/templates/mobile.overall_footer.php'); } else { if($_GET[channel]) { include($basepath.'/templates/template.overall_footer-channel.php'); } elseif($_GET[mode]=='photos') { include($basepath.'/templates/template.overall_footer-photos.php'); } else { include($basepath.'/templates/template.overall_footer.php'); } }