Alternate URL Ads: Make more money with Google AdSense
Don't waste your lost AdSense impressions
on PSA's. Integrate Alternate URL Ads into your
web-site in less then 5 minutes and start making more money with Google AdSense today!
$vals[$i]['tag']) { // Restart Index j on Unique Tag $j = 0; $prevtag = $vals[$i]['tag']; } $children[ $vals[$i]['tag'] ][$j] = GetChildren($vals,$i); break; case 'close': return($children); default: if ($xd) { echo "unhandled ".$vals[$i]['type']."
"; } break; } } } function GetXMLTree($file) { global $xd; if ($xd) { echo $file; } // If it is a local xml file, just open it if (file_exists($file)) { if($xd) { echo "couldn't open file ".$file; } $data = @implode('', file($file)); } else { if($xd) { echo "remote"; } $r = new HTTPRequest($file); $data = $r->DownloadToString(); } $xml_parser = xml_parser_create(); xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($xml_parser, $data, &$vals, &$index); if($xd) { print_r($vals); } xml_parser_free($xml_parser); $tree = array(); $i = 0; $tree = GetChildren($vals, $i); if($xd) { print_r($tree); } return($tree); } } $sf = $_GET['sf']; if (!$sf) $sf = "54343"; $sfr = $_GET['r']; $ui = $_GET['ui']; $w = $_GET['w']; $h = $_GET['h']; $bg= $_GET['bg']; $bo= $_GET['bo']; $l = $_GET['l']; $u = $_GET['u']; $t = $_GET['t']; $kw= $_GET['kw']; $kws = explode(",", $kw); shuffle($kws); reset($kws); define('OAR', (dirname(__FILE__))); include_once(OAR . "/adodb/adodb.inc.php"); $ADODB_CACHE_DIR = OAR . "/data"; $db = &ADONewConnection('mysql'); $db->Connect($DBhostname, $DBusername, $DBpassword, $DBdatabase); include(dirname(__FILE__) . "/render.php"); if (is_dark_hex($bo)) { $sbg = "FFFFFF"; } else { $sbg = "000000"; } ?> DownloadToString(); preg_match_all("/(.*)<\/gml:name>/", $data, $matches); if ($matches[1][1]) { file_put_contents($fn, trim($matches[1][1])); return trim($matches[1][1]); } } } $this_city = ip_to_location(getenv("REMOTE_ADDR")); } else $this_city = ""; $ads = search_feed($kws, 5, $this_city); echo render_ad($ads, $w, $h); ?> 5)) $_sf = "54343"; $city = trim($city); if (strlen($city) == 0) unset($city); $r = array(); $x = 0; while ($x < sizeof($kwsArr)) { list($kw_id, $search) = explode("|", $kwsArr[$x]); $url = "http://www.searchfeed.com/rd/feed/XMLFeed.jsp?trackID=F5783585520&pID=".$_sf."&cat=".urlencode(ucwords(trim($search." ".$city)))."&num=".$max; $r = GetXMLTree($url); $x++; if (sizeof($r['Listing'])) break; if (!$city) { $sql = "update words set is_ok='0' where word='".$search."'"; $db->Execute($sql); } } return array($kw_id, $search, $r); } function search_feed($kwsArr, $max, $city) { global $db; global $l, $t, $u, $w, $h; global $sf; $rRaw = get_results($kwsArr, $max); $kw_id = $rRaw[0]; $search = $rRaw[1]; $r = $rRaw[2]; $sql = "select id from last_detected_bid where w_id='".$kw_id."'"; $bId = (int)$db->CacheGetOne($sql); if (!$bId) { $bId = (int)$db->GetOne($sql); } if (!sizeof($r['Listing'])) { include("psas.php"); shuffle($psaArray); reset($psaArray); return $psaArray; } for ($x = 0; $x < sizeof($r['Listing']); $x++) { $_t = summarize($r['Listing'][$x]['Title'], 30); $_d = summarize($r['Listing'][$x]['Description'], 60); $_l = $r['Listing'][$x]['URI']; $bid = $r['Listing'][$x]['Bid']; if ($x == 0) { if (!$bId) { $db->Execute("insert into last_detected_bid (id, w_id, bid) values ('', '$kw_id', '$bid')"); $db->CacheFlush($sql); } else { $db->Execute("update last_detected_bid set bid='".$bid."' where id='".$bId."'"); } } $db->Close(); $_l = "http://".$adserver.".alternate-url-ads.com/t.php?w=$kw_id&l=".urlencode($_l); $_up = parse_url("http://".$r['Listing'][$x]['URL']); $_u = $_up['host']; $disp[] = ""; } return $disp; } function summarize($string, $limit) { $words = preg_split("/\s+/", $string); for ($x = 0; $x < sizeof($words); $x++) { if (strlen($buf) + strlen($words[$x]) > $limit) break; $buf .= $words[$x]. " "; } $buf = trim($buf) . "..."; return $buf; } function _summarize($paragraph, $limit,$link="") { $tok = strtok($paragraph, " "); while($tok) { $text .= " $tok"; $words++; if(($words >= $limit) && ((substr($tok, -1) == "!")||(substr($tok, -1) == "."))) break; $tok = strtok(" "); } $text .= ' '.$link; return ltrim($text); }

Powered by Odin Assemble