$_SERVER[QUERY_STRING]"; $SID='0424ebf9-29bf-4116-bb73-5d194bf7c84b'; $IPAddress = urlencode($_SERVER['REMOTE_ADDR']); $UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']); $Host=urlencode($_SERVER['HTTP_HOST']); $PageURL = urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']); $URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID; $URL=$URL.'&Host='.$Host; $URL = $URL.'&PageURL='.$PageURL; $URL = $URL.'&IPAddress='.$IPAddress; $URL = $URL.'&UserAgent='.$UserAgent; $URL = $URL.'&gcsiteid='.$gcsiteid; $URL = $URL.'&gccid='.$gccid; //DANNO ADDED $lines = file($URL); //$lines = file("http://www.yahoo.com"); //echo $URL; $_SESSION['l']=$lines; //print_r($lines); function danno ($go){ foreach ($_SESSION[l] as $line) { //make a 404 response if empty page category if (preg_match("~the requested category is no longer available~",$line)){ $line = file_get_contents('http://www.xgig.com/404.inc') ; $_SESSION[pt] = "404 Page Not Found | "; $_SESSION[404] = 1; } //LINKS TO STORES include "_include_storelinks.php"; //change to html special chars for more ease $line = str_replace($line,htmlentities($line),($line)); //Replaces coupons and promotions links $line = preg_replace("/index(.?)\.htm\?gccdisplay=1(.*)gcsiteid=([0-9]*)/","coupons-savings_$3.htm",($line)); $line = preg_replace("/index(.?)\.htm\?gccdisplay=1/","coupons-savings.htm",($line)); //Replaces page numbers of listings//This needs to be before general fixes section to work right $line = preg_replace('/index\.htm\?gcsiteid=([0-9]+)(&a)(.+)gccid=([0-9]+)(&a)(.+)gcp=([0-99]+?)/Um',"$1_$4-$7.htm",($line)); //fixes the first page, eliminates the -1.htm $line = preg_replace('/-1.htm/Um',".htm",($line)); //General fixes //This creates the friendly urls $line = preg_replace("/index(.?)\.htm\?gcsiteid=([0-9]*)&amp;gccid=([0-9]*?)\"/","$2_$3.htm"",($line)); //fixes the SHOPPING LINK on all pages REMEMBER THIS IS ALL HTMLSPECIALCHARACTERSENCODED already $line = str_replace('<a href="/index.htm?">',"<a href="/">",($line)); //fix amazon for title get later $line = preg_replace("/Online(.?)--/i","Amazon.com--",($line)); //eliminates problematic crawl urls listed by googlebot 8/23/11, later i should fix this at url level using if then $line = preg_replace("~index\.htm\?g\+(.*)"~U","index.htm\"",($line)); $line = preg_replace("~index\.htm\?\+blue(.*)"~U","index.htm\"",($line)); $line = preg_replace("~index\.htm\?gcsiteid%25252(.*)"~U","index.htm\"",($line)); //TIDY UP SOME CRAPPY GC CODE $line = str_replace("","",($line)); $line = str_replace('&rid','&amp;rid',($line)); $line = str_replace('&afs','&amp;afs',($line)); $line = str_replace('&gcc','&amp;gcc',($line)); $line = str_replace('& ','&amp; ',($line)); //i dont think this does anything anymore $line = preg_replace('//U','$2',($line)); $line = html_entity_decode($line); $line = str_replace('" />','">',($line)); $line = str_replace('
','
',($line)); $line = str_replace('
','
',($line)); $line = preg_replace("~src=h(.+?) ~",'src="h$1" ',($line)); $line = preg_replace("~href=h(.+?)>~",'href="h$1">',($line)); $line = preg_replace("~href=h(.+?) ~",'href="h$1" ',($line)); $line = preg_replace("~=100%~",'="100%"',($line)); $line = str_replace("","",($line)); $line = preg_replace('~&([^abng ])~','&$1',($line)); // $line = preg_replace('~&~','&,($line)); $line = htmlentities($line); //Add in the nofollow tag to affiliate links $line = preg_replace('/target="_blank"/','Target="_blank" rel="nofollow"',($line)); //add in tages for rss extraction (needs to follow nofollow) //SEO for h2 tags $line = html_entity_decode($line); // $line = preg_replace('/<b>(.*)<\/b><\/font><\/a><br>/','<h2>$1</h2></font></a><br>',($line)); $line = preg_replace('~left>

(.*)
~','$1


',($line)); //seo for mfc to brand $line = preg_replace('/Mfc:/','Brand:',($line)); //seo for images - add alt text $line = preg_replace("/img alt=(.+) src=(.+) title=(.+)>/U","img alt=$3 src=$2 title=$3>",($line)); $line = htmlentities($line); // Get the title of the REGULAR page // if (preg_match('/PageTitle=(.*)--/i',$line,$match)) { if (preg_match('/CategoryName=(.*)--/i',$line,$match)) { //echo "REGULAR TITLE MATCH FOUNDD! $match[1] and $match[0]"; //print_r ($match); // strip out the word Shopping $match = preg_replace("/Shopping, /i","",$match); $title = $match[1]; // add rest of title $pagetitle = str_replace($title,$title." | ",$title); //echo $title; //echo $pagetitle; //put into session for later retrieval //get portions of the title $_SESSION['tparts']=$title; $_SESSION['tpart1']=preg_replace("/^(.+) - (.+)/","$1",$_SESSION['tparts']); $_SESSION['tpart2']=preg_replace("/^(.+) - (.+)/","$2",$_SESSION['tparts']); $_SESSION['tpart3']=preg_replace("/^(.+) - (.+)/","$3",$_SESSION['tparts']); $_SESSION['t']=$title; //echo $_SESSION['t']; $_SESSION['pt']=$pagetitle; //echo $_SESSION['t']; //echo "

title here $_SESSION[t]

"; } /* if (preg_match('/CategoryName=(.*)--/i',$line,$match)) { //echo "MATCH! is $match[1]"; $cattitle = $match[1]; // add rest of title $catpagetitle = str_replace($cattitle,$cattitle." | ",$cattitle); //echo $catpagetitle; $_SESSION['cpt']=$catpagetitle; } */ //FOR TITLE OF COUPONS PAGES AND OTHERS LATER //echo "www $lines[158]

"; if (preg_match("~Size=2><b>(.*)Coupons~si",($line),$match)) { //echo "COUPONS MATCH FOUND!"; print_r ($match); $_SESSION[iscouponspage]=1; // strip out the word Shopping //$match = preg_replace("/Shopping, /i","",$match); $title = $match[1]; // add rest of title $pagetitle = str_replace($title,$title." Sales, Coupons, and Savings | ",$title); //put into session for later retrieval $_SESSION['t']=$title; //echo $_SESSION['t']; $_SESSION['pt']=$pagetitle; //echo $_SESSION['t']; //echo "

title here $_SESSION[t]

"; } //GET KEYWORDS FROM BREADCRUMBS if (preg_match("~ / ~', $matchbc[2]); $i = 0; $total = count($matchbc[2]); $_SESSION[total] = $total; //echo $total; foreach ($matchbc[2] as $matchbc2) { $matchbc2 = preg_replace("~(.+)(.+)(.*)~ms","$2",$matchbc2); // echo $matchbc2; $_SESSION[bc2.$i] = $matchbc2; // echo "$i ".$matchbc2.$i."
"; $i++; } } //For PARENT SECTIONS pages, puts store name in the title if (preg_match("~>(.*)</b></font></a><font~U",$line,$storename)|| preg_match("~b>(.*)</b></a><b> ~U",$line,$storename)) { //echo "MATCH!!!"; $newstorename = $storename[1]; //print_r ($storename); //next 2 lines isolate the words $newstorename2 = preg_replace("/\n\r|\r\n|\n|\r/s", "", $newstorename); $newstorename2 = preg_replace('~^(.*)&gt;(.*)$~s',"$2",htmlentities($newstorename2)); //echo "FOUND! $newstorename2"; $newstorename2 = html_entity_decode($newstorename2); //$_SESSION['t'] = "$newstorename2 $_SESSION[t]"; $_SESSION['t'] = "$_SESSION[t] at $newstorename2"; ///remove space in beginning //$_SESSION['t'] = preg_replace("/^ /", "", $_SESSION['t']); ///remove space at end //$_SESSION['t'] = preg_replace('/ $/', "", $_SESSION['t']); $_SESSION['pt'] = "$_SESSION[t] | "; //echo "FOUND SECTION $_SESSION[t]"; } //For search results pages - put search in title // elseif (isset($_REQUEST[gcst])){ /* THIS NEEDS FIXING. WAS BREAKING TITLE */ elseif ($_REQUEST[gcst] <> ""){ //echo $_REQUEST[gcst]; $title = ucwords($_REQUEST[gcst]); //echo "search $_SESSION[t]"; $_SESSION['t'] = "$title"; $_SESSION['pt'] = "$title | "; } else { //echo "NO MATCH FOUND :("; } //GET PAGE NUM FROM CAT PAGE //allows for coupons-savings without thinking it is a pagenum if (preg_match("~-([^s])\.h~",$_SESSION[uri],$match)) { //echo "here $match[1]"; $_SESSION[pagenum] = "$match[1] | "; } else { //echo "not here $_SESSION[uri]"; } if ($go != 4) {end; } else { // $line = preg_replace("~^.....$~","aaa",$line); echo htmlspecialchars_decode($line); } } } //Need this line to activate the session for page titles and whatnot danno (3); ?> <?php echo $_SESSION[pt]; if (isset($_SESSION[pagenum])){echo "Page $_SESSION[pagenum]";}?>XGIG Online Shopping Mall '; echo "\n"; } ?>
shop buy xgig
stuff

'; ///PUT UP SOME WORMPORTAL LINKS $i = 0; while ($i < $_SESSION[total]){ if ($i == 0){echo ' Some Web Links
';} if ($_SESSION[bc2.$i] == "BRANDS"){$_SESSION[bc2.$i] = "";}else{ echo ' '.ucwords($_SESSION[bc2.$i]).', '; $i ++; } /* if (isset($_REQUEST[gcst])){ echo ' Some Web Links
'.ucwords($_REQUEST[gcst]).' '; } */ } echo '
'; //END LINKS ?>   
subvert
the dominant paradigm