,
// infinte random number links (?q=randomnumber) (show random links only to Y/msn/ask)
// reads kws.txt
// cached is disabled
// -- if it is to avoid dupe content just insert some scraped searches form time to time
// -- or use only 40% of kws + scraped content
// get current character
$char = $_SERVER["SCRIPT_NAME"];
$break = Explode('/', $char);
$char = $break[count($break) - 1];
$char = Explode('.', $char);
$char = $char[0];
$char = substr ($char, 1, 2);
// if p1.html is called output all kws beginning with numbers
if ($char == 1) { $char = "1 2 3 4 5 6 7 8 9 0"; }
// function to gen content
function gen_content(){
global $char;
// check if UserAgent UA is Y/msn/ask and show random links only to those crawlers
$ua = $_SERVER[HTTP_USER_AGENT];
$ua=strtoupper($ua); // make all upper case
if(substr_count($ua, "TEOMA")>0 || substr_count($ua, "MSNBOT")>0 || substr_count($ua, "SLURP")>0 || substr_count($ua, "LIVE.COM")>0) // search text in ua - only upper case!
{ $allowlinks=1; }
$kw = file("kws.txt");
for ($i=0; $i$i; $i++){
srand ((double)microtime()*1000000);
$ran = rand(0, count($kw)-2);
$kw[$ran] = $kw[$ran].".
";
$kw[$ran+1] = ucwords($kw[$ran+1]);
}
// make tags , random number
$sen = rand(100, 200); // choose how many
for ($i=0; $sen>$i; $i++){
srand ((double)microtime()*1000000);
$ran = rand(0, count($kw)-2);
$kw[$ran] = "".$kw[$ran]."";
}
// make tags , random number
$sen = rand(10, 20); // choose how many
for ($i=0; $sen>$i; $i++){
srand ((double)microtime()*1000000);
$ran = rand(0, count($kw)-2);
$kw[$ran] = "".$kw[$ran]."
";
}
$kw_st = implode (" ", $kw);
include ("ads.php");
include ("footer.php");
// generate random links - only for Y/msn/ask
if ($allowlinks==1) {
for ($i=0; $i<10; $i++) {
$num = rand(9000, 9999999999);
$rnd = $rnd.' '.$num.''; }
}
// generating html
$content = '
'.$title.'
'.$rnd.'
'.$footer.'
';
// ********* disabled cache writing
// write cache
// $handle = fopen("index.content.txt", "w");
// fwrite($handle, $content);
echo $content;
// end content gen function
}
// ****** disabled cache-check - content is everytime generated new!
// if cache exists: echo it -- else: run function gen_content()
gen_content();
// $f = "index.content.txt";
// if (file_exists($f)){ echo file_get_contents($f).$rnd.""; } else { gen_content(); }
?>