More popular videos
More great porn
<?php
// get ready
define('IN_SCRIPT', 1);
require_once('library.php');
require_once('config.php');
// handle params
if(!isset($_GET['sites_key']) || $_GET['sites_key'] != sites_key){
die('ERROR');
}
$sites_except = array();
if(isset($_GET['sites_except'])){
$sites_except = explode(',', $_GET['sites_except']);
}
$limit_to_site = '';
if(isset($_GET['limit_to_site']) && $_GET['limit_to_site'] != ''){
$limit_to_site = $_GET['limit_to_site'];
}
// get list of cache files
$cachefiles = array();
foreach(scandir('cache') as $file){
$file_path = 'cache/'.$file;
if(is_file($file_path) && substr($file_path, -4) == '.htm'){
$sites = str_replace('.htm', '', $file);
if(strpos($file, '4') !== false){
$sites = explode('4', $sites);
$from_site = $sites[0];
$for_site = $sites[1];
}
else {
$from_site = $sites;
$for_site = '';
}
$cachefiles[] = array(
'file_path' => $file_path,
'from_site' => $from_site,
'for_site' => $for_site
);
}
}
// get contents
$included_cachefiles = array();
foreach($cachefiles as $cachefile){
$file_path_lower = strtolower($cachefile['file_path']);
$include = true;
if(in_array($cachefile['from_site'], $sites_except)){
$include = false;
}
if($cachefile['for_site'] != $limit_to_site){
$include = false;
}
if($include == true){
$included_cachefiles[] = $cachefile;
}
}
// get contents
$output = array();
foreach($included_cachefiles as $included_cachefile){
$file_path = $included_cachefile['file_path'];
$output[] = file_get_contents($file_path);
}
// output
shuffle($output);
$output = implode('', $output);
die($output);
?>