isMobile()) { $ismobile=1; } else { $ismobile=0; } $ty = mysql_real_escape_string($ty); $p = mysql_real_escape_string($p); $q = mysql_real_escape_string($q); $cat = mysql_real_escape_string($cat); $category = mysql_real_escape_string($category); $site = mysql_real_escape_string($site); $id = mysql_real_escape_string($id); $pagefile = curPageURL(); $pagefile = md5($pagefile); $tg="_blank"; $cachetime = $cachetimevideos; $cachefile = "cache/$pagefile.cache"; $cachefile_created = ((@file_exists($cachefile))) ? @filemtime($cachefile) : 0; if(time() - $cachetime < $cachefile_created) { $html = file_get_contents($cachefile); echo $html; } else { $result = mysql_query("SELECT site from sites where featured = '1';",$lnk); while ($myrow = mysql_fetch_row($result)) { $bestpay[] = $myrow[0]; } $result = mysql_query("SELECT category,count,featured,country,thumb from categories order by views;",$lnk); while ($myrow = mysql_fetch_row($result)) { $categoryz = $myrow[0]; $count = $myrow[1]; $featured = $myrow[2]; $ccountry = $myrow[3]; $thumb = $myrow[4]; if(!$ccountry) { $catarray[] = $categoryz; } } sort($catarray); foreach($catarray as $categoryz) { $categoryz2 = preg_replace("/\s/si","-",$categoryz); $biglist .= "
  • $categoryz
  • \n"; $biglistmobile .= "
    $categoryz
    "; } $result = mysql_query("SELECT pornstar,videos from pornstars where videos >= $minvidpornstars order by pornstar;",$lnk); while ($myrow = mysql_fetch_row($result)) { $pornstarz = $myrow[0]; $count = $myrow[1]; $pornstararray[] = $pornstarz; } $break = count($pornstararray) / 6; $cnt = 0;$column = 1; $pornstarlist = ""; $category3 = $cat; $catoo = preg_replace("/-/si"," ", $cat); $result = mysql_query("SELECT tags,cattitle from categories where category = '$catoo';",$lnk); while ($myrow = mysql_fetch_row($result)) { $tags2 = $myrow[0]; $cattitle = $myrow[1]; } if($tags2) { $tags20 = explode(",",$tags2); $tags2=""; foreach($tags20 as $tag2) { $tag2=trim($tag2); $tags2 .= "".ucwords($tag2)." "; } $tags2 = trim($tags2); } else { $result = mysql_query("SELECT keyword from keywords where MATCH(keyword) AGAINST ('$catoo') limit $limitsearchtags;",$lnk); while ($myrow = mysql_fetch_row($result)) { $rel = $myrow[0]; $tags2 .= "".ucwords(strtolower($rel))." "; } $tags2 = trim($tags2,", "); if(!$rel) { $result = mysql_query("SELECT keyword from keywords order by rand() limit $limitsearchtags;",$lnk); while ($myrow = mysql_fetch_row($result)) { $rel = $myrow[0]; $tags2 .= "".ucwords(strtolower($rel))." "; } $tags2 = trim($tags2,", "); } } $total = $rows * $cols * $blocks; $split = $total / $blocks; if(!$p){$p=1;} $page = ($p-1) * $total; $table = preg_replace("/\s/si","", $cat); $table = preg_replace("/-/si","", $cat); $table = "norma_".strtolower($table); $cat = preg_replace("/-/si"," ",$cat); $cat = ucwords($cat); $cat2 = $cat; $query = "SELECT count(*) FROM $table where category2 = '$cat';";$query = mysql_query($query,$lnk);$query = mysql_fetch_array($query);$tresults = $query[0]; mysql_query("update categories set views = views + 1 where category = '$cat';",$lnk) or die(mysql_error()); if($tresults < $total) { $result = mysql_query("SELECT id,title,site,thumbs,url,dateadded,orientation,length,tags,category from $table order by id desc limit $total;",$lnk); } else { $result = mysql_query("SELECT id,title,site,thumbs,url,dateadded,orientation,length,tags,category from $table where category2 = '$cat' order by id desc limit $total;",$lnk); } $cnt=0;$tot=0;$blk=1;$brk=$cols-1;$split=$split-1; while ($myrow = mysql_fetch_row($result)) { $id = $myrow[0]; $title = $myrow[1]; $site = $myrow[2]; $thumbs = $myrow[3]; $url = $myrow[4]; $date = $myrow[5]; $orientation = $myrow[6]; $length = $myrow[7]; $tags = $myrow[8]; $category = $myrow[9]; $tags = explode(",",$tags); shuffle($tags); foreach($tags as $tag) { $tag = trim($tag); $tag2 = urlencode(strtolower($tag)); $tag = ucwords($tag); if(strlen($tag) > 2) { $alltags .= "$tag, "; } } $alltags = trim($alltags,", "); $starttime=time(); $endtime=strtotime($date); $timediff = $starttime-$endtime; $days=intval($timediff/86400); $remain=$timediff%86400; $hours=intval($remain/3600); $remain=$remain%3600; $mins=intval($remain/60); $secs=$remain%60; if($days < 1){if($hours < 1){$dc = "$mins Minutes Ago";}else{if($hours == 1){$dc = "$hours Hour Ago";}else{$dc = "$hours Hours Ago";}}} else if($days < 7 && $days > 0){$dc = "$days Days Ago";} else if($days < 30 && $days >=7){$dc = floor($days/7);if($dc == 1){$dc = "$dc Week Ago";}else{$dc = "$dc Weeks Ago";}} else if($days >= 30){$dc = floor($days/30);if($dc == 1){$dc = "$dc Month Ago";}else{$dc = "$dc Months Ago";}} else if($days >= 365){$dc = floor($days/365);if($dc == 1){$dc = "$dc Year Ago";}else{$dc = "$dc2 Years Ago";}} $length = explode(":",$length); $length = "$length[1]:$length[2]"; $ftitle = $title; if(strlen($title)>$maxtitle) { $title = substr($title, 0, $maxtitle); $title = trim($title); $title = $title . "..."; } $content[$blk] .= "
    $title$title
    $dc
    $alltags
    "; $contentmobile[$blk] .= "
    $title

    $dc
    "; if($cnt == $brk && $tot != $split){$content[$blk] .= "";$cnt=0;}else{$cnt++;} if($tot == $split){$blk++;$tot=0;$cnt=0;}else{$tot++;} $alltags = ""; } $split = $split + 1; if($tresults < $total) { $result = mysql_query("SELECT id,title,site,thumbs,url,dateadded,orientation,length,tags,category from $table order by views desc limit $split;",$lnk); } else { $result = mysql_query("SELECT id,title,site,thumbs,url,dateadded,orientation,length,tags,category from $table where category2 = '$cat' order by views desc limit $split;",$lnk); } $cnt=0;$tot=0;$blk=0;$brk=$cols-1;$split=$split-1;$cc=0;$cc2=0; while ($myrow = mysql_fetch_row($result)) { $id = $myrow[0]; $title = $myrow[1]; $site = $myrow[2]; $thumbs = $myrow[3]; $url = $myrow[4]; $date = $myrow[5]; $orientation = $myrow[6]; $length = $myrow[7]; $tags = $myrow[8]; $category = $myrow[9]; if($cc == 2 && $thumbs){mysql_query("update categories set thumb = '$thumbs' where category = '$cat';",$lnk) or die(mysql_error());} if($cc2 == 2){$backupthumbs = $thumbs;} $tags = explode(",",$tags); shuffle($tags); foreach($tags as $tag) { $tag = trim($tag); $tag2 = urlencode(strtolower($tag)); $tag = ucwords($tag); if(strlen($tag) > 2) { $alltags .= "$tag, "; } } $alltags = trim($alltags,", "); $starttime=time(); $endtime=strtotime($date); $timediff = $starttime-$endtime; $days=intval($timediff/86400); $remain=$timediff%86400; $hours=intval($remain/3600); $remain=$remain%3600; $mins=intval($remain/60); $secs=$remain%60; if($days < 1){if($hours < 1){$dc = "$mins Minutes Ago";}else{if($hours == 1){$dc = "$hours Hour Ago";}else{$dc = "$hours Hours Ago";}}} else if($days < 7 && $days > 0){$dc = "$days Days Ago";} else if($days < 30 && $days >=7){$dc = floor($days/7);if($dc == 1){$dc = "$dc Week Ago";}else{$dc = "$dc Weeks Ago";}} else if($days >= 30){$dc = floor($days/30);if($dc == 1){$dc = "$dc Month Ago";}else{$dc = "$dc Months Ago";}} else if($days >= 365){$dc = floor($days/365);if($dc == 1){$dc = "$dc Year Ago";}else{$dc = "$dc2 Years Ago";}} $length = explode(":",$length); if($length[0] > 0) { $length = "$length[0]:$length[1]:$length[2]"; } else { $length = "$length[1]:$length[2]"; } $ftitle = $title; if(strlen($title)>20) { $title = substr($title, 0, 20); $title = trim($title); $title = $title . "..."; } if(in_array($site,$bestpay) && !in_array($site,$bestpay2)) { $content11 .= "
    $title$title
    $dc
    $alltags
    "; $contentmobile11 .= "
    $title

    $dc
    "; $bestpay2[] = $site; $cc++; } else { $content12 .= "
    $title$title
    $dc
    $alltags
    "; $contentmobile12 .= "
    $title

    $dc
    "; $cc2++; } if($cnt == $brk && $tot != $split){$content[$blk] .= "";$cnt=0;}else{$cnt++;} if($tot == $split){$blk++;$tot=0;$cnt=0;}else{$tot++;} $alltags = ""; } if($cc < 2 && $backupthumbs){mysql_query("update categories set thumb = '$backupthumbs' where category = '$cat';",$lnk);} $content[0] = $content11 . $content12; $contentmobile[0] = $contentmobile11 . $contentmobile12; $query = "SELECT count(*) FROM $table;";$query = mysql_query($query,$lnk);$query = mysql_fetch_array($query);$tresults = $query[0]; if($tresults >= $total) { if($ismobile) { $html = file_get_contents("templatemobile2.html", "r"); } else { $html = file_get_contents("template7.html", "r"); } } else { if($ismobile) { $html = file_get_contents("templatemobile2.html", "r"); } else { $html = file_get_contents("template7.html", "r"); } } preg_match_all ("/--include:(.*?)--/si", $html, &$matches2); $matches2 = $matches2[1]; foreach($matches2 as $var) { $inc = file_get_contents("$var", "r"); $var = preg_replace("/\//si","\/",$var); $html = preg_replace("/--include:$var--/i", "$inc", $html); } for($x=0;$x<$blocks;$x++) { $y=$x+1; if($ismobile) { $html = preg_replace("/--block$y--/i", "$contentmobile[$x]", $html); $biglist=$biglistmobile; } else { $html = preg_replace("/--block$y--/i", "$content[$x]", $html); } } $hardlinks = file_get_contents("http://fooxy.com/hlfiles/hardlinks.php?category=$cat2&domain=amateurpornx.com", "r"); $html = preg_replace("/--hardlinks--/i", $hardlinks, $html); $html = preg_replace("/--category3--/i", $category3, $html); $html = preg_replace("/--category2--/i", ucwords($cat2), $html); $html = preg_replace("/--category--/i", $cat2, $html); $html = preg_replace("/--category4--/i", strtolower(urldecode($cat2)), $html); $html = preg_replace("/--ty2--/i", "Featured", $html); $html = preg_replace("/--tags--/i", "$tags2", $html); $html = preg_replace("/--allcats--/i", "$allcats", $html); $html = preg_replace("/--cattitle--/i", "$cattitle", $html); $html = preg_replace("/--biglist--/i", "$biglist", $html); $html = preg_replace("/--pornstarlist--/i", "$pornstarlist", $html); $html = preg_replace("/--navbar--/i", "$navbar", $html); $xix = "[an error occurred while processing this directive]"; $html = preg_replace("/--script--/i", "$xix", $html); $fp = @fopen($cachefile, 'w'); @fwrite($fp, $html); @fclose($fp); echo $html; } 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"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?>