Not Found

The requested URL was not found on this server.

"; die; } require("dbconfig.php"); $con =mysql_connect ($db_host,$db_user,$db_pass) or die("Error connecting"); if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { ob_start("ob_gzhandler"); } else { ob_start(); } mysql_select_db($db_name,$con); $tem="select dir from template where active='1'"; $temr=mysql_query($tem,$con); $temn=mysql_num_rows($temr); if($temn==0) { echo "No Template Selected"; die(); } $dir=mysql_result($temr,0,"dir"); function logit($message='') { global $log; if(!empty($message)) { $log[] = $message; } else { return @ implode($log, '
'); } } function pagination($pages, $url) { global $page; if ($page > $pages) { $page = $pages; } function linkpage($page, $url, $active=0){ if ($active){ return ' ['.$page.'] '; }else{ return ''.$page.' '; } } if($page==1) { $pprev = ''; $prev = ''; $left=''; }elseif($page==2) { $pprev = ''; $prev = 1; $left=''; }else{ $pprev = $page-2; $prev = $page-1; $left = ($pprev>1?linkpage(1, $url):'').($pprev>2?linkpage(2, $url):'').($pprev>3?linkpage(3, $url):'').($pprev<5?'':' … '); } if($page==$pages) { $nnext = ''; $next = ''; $right = ''; } elseif($page==$pages-1) { $nnext = ''; $next = $page; $right = ''; }else{ $nnext = $page+2; $next = $page+1; $right = ($nnext>($pages-4)?'':' … ').($nnext<($pages-2)?linkpage($pages-2, $url):'').($nnext<($pages-1)?linkpage($pages-1, $url):'').($nnext<$pages?linkpage($pages, $url):''); } #$center = linkpage($prev, $url).linkpage($page, $url,1).linkpage($next, $url); $center = linkpage($pprev, $url).linkpage($prev, $url).linkpage($page, $url,1).linkpage($next, $url).linkpage($nnext, $url); $pagination = $left.$center.$right; if($pages > 1) { return $pagination; } } mysql_query("set names 'utf8'"); ################ Load Sites $modlo="select module from module where active='1'"; $modr=mysql_query($modlo,$con); $count=mysql_num_rows($modr); for($i=0;$i<$count;$i++) { if(file_exists('modules/'.mysql_result($modr,$i,"module").'.php')) { require_once('modules/'.mysql_result($modr,$i,"module").'.php'); $modules[] = mysql_result($modr,$i,"module"); } else { logit('Cannot load module '.mysql_result($modr,$i,"module").''); } } ################################Checking if plug active $plug="select module from module where module='plug' and active='1'"; $plugr=mysql_query($plug,$con); $c=mysql_num_rows($plugr); if($c==0) { $pluggin=false; } else { $pluggin=true; } ############## Getting which t if(isset($_GET['t'])) { $todo=$_GET['t']; } else { $todo='recent'; } ############# Current m if(isset($_GET['m'])) { $currentMod=$_GET['m']; } else { $currentMod=''; } ############# Page no if(isset($_GET['p'])) { $page=$_GET['p']; } else { $page=1; } ##############Search if(isset($_GET['s'])) { $sea=$_GET['s']; } else { $sea=''; } switch ($todo) { case 'recent':{ foreach($modules as $module) { if (function_exists($module.'_recent')){ $function = $module.'_recent'; $result = $function(); if (!empty($result)) { $mostrecent[$module] = $result; } } else { logit('Internal error in loding recent function in '.$module.''); } } # Template it! require_once("template/$dir/header.php"); require_once("template/$dir/left.php"); require_once("template/$dir/mostrecent.php"); #require_once("template$dir/right.php"); require_once("template$dir/footer.php"); };break; case 'search':{ $totalDisplay = 5*8-4; foreach($modules as $module) { $totalSearch += $mod[$module]['perpage']; $perpage[$key] = $mod[$module]['perpage']; } asort($perpage); $paginationMultipler = $totalSearch/$totalDisplay; # Fictive page number - for end-user $fictPage = $page; # Page number for search-engines $realPage = ceil($page/$paginationMultipler); # Local offset subpage $localPage = ceil($realPage*$paginationMultipler) - $fictPage - 1; # How much results from each module we must take foreach($perpage as $key => $value) { $permod[$key] = round($value/$paginationMultipler); $sum += $permod[$key]; } $permod[$key] = $totalDisplay - ($sum - $permod[$key]); $find = array('sources' => 0, 'results' => 0, 'items' => array()); /**/ $pages = 0; foreach($modules as $module) { if (function_exists($module.'_search')){ $function = $module.'_search'; $find['module'][$module] = $function(); if(! empty($find['module'][$module]['results'])) { $find['results'] += $find['module'][$module]['results']; $find['sources']++; } /**/ if(ceil($find['module'][$module]['results']/$mod[$module]['perpage'])>$pages) { /**/ $pages = ceil($find['module'][$module]['results']/$mod[$module]['perpage']); /**/ } } else { logit('There\'s not function for Search section in module '.$module.''); } } foreach($find['module'] as $key => $module) { if(isset($module['items'])) { @ $find['items'] = array_merge($find['items'], array_slice($module['items'],(sizeof($module['items'])>=$permod[$key]*($localPage+1))?(-$permod[$key]):($permod[$key]*$localPage),$permod[$key])); // @ $find['items'] = array_merge($find['items'], $module['items']); } } #$find['pagination'] = pagination(ceil($find['results']/$totalDisplay),'?t=search&s='.urlencode($sea).'&'); /**/ $find['pagination'] = pagination($pages,'?t=search&movietime='.$movietime.'&s='.urlencode($sea).'&'); # Template it! require_once("template$dir/header.php"); require_once("template$dir/left.php"); require_once("template$dir/search.php"); # require_once("template$dir/right.php"); require_once("template$dir/footer.php"); };break; case 'play':{ if (function_exists($currentMod.'_play')){ $function = $currentMod.'_play'; $play = $function(); } else { logit('Internal error in loding play function in '.$currentMod.''); } # Template it! // require_once("template$dir/header.php"); // require_once("template$dir/left.php"); require_once("template$dir/play.php"); #require_once("template$dir/right.php"); // require_once("template$dir/footer.php"); };break; case 'channel':{ if (function_exists($currentMod.'_channel')){ $function = $currentMod.'_channel'; $channel = $function(); } else { logit('Internal error in loding play function in '.$currentMod.''); } require_once("template$dir/header.php"); require_once("template$dir/left.php"); require_once("template$dir/channel.php"); #require_once("template$dir/right.php"); require_once("template$dir/footer.php"); };break; } if(FALSE) { echo '
'.logit().'
'; } ?>