Buzzcity Banner Ad Code

Started on the old forum in June 2012 · view the original in the archive · old links redirect here

7 replies · 2,206 views · started 14 years ago · 1 min read

4 participants
amitdas333 Junior · 23 posts #1

Here is the buzzcity banner ad code with no free ads. So only paid ads will be shown & your clicks will not get wasted.

<?php
//Created by Adfresh.in
//Wapmasters join & earn at www.adfresh.in
//Use at your own Risk !!
///Customization Area///
$partnerid = "33530";
///End Customization Area///
$ip = '';
$ua = '';
$browser = '';
// Extract full IP info (including Opera Mini)
if (empty($ip)) {
$keyname_ip_arr = array('HTTP_X_FORWARDED_FOR', 'HTTP_REMOTE_ADDR_REAL', 'REMOTE_ADDR');
foreach ($keyname_ip_arr as$keyname_ip) {
if (!empty($_SERVER[$keyname_ip])) {
$ip = urlencode($_SERVER[$keyname_ip]);
break;
}
}
}
// extract full UA info
$keyname_ua_arr = array('HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA', 'HTTP_X_BOLT_PHONE_UA', 'HTTP_X_MOBILE_UA', 'HTTP_USER_AGENT');
foreach ($keyname_ua_arr as$keyname_ua) {
if (isset($_SERVER[$keyname_ua])&&!empty($_SERVER[$keyname_ua])) {
$ua = urlencode($_SERVER[$keyname_ua]);
break;
}
}
// extract browser info
$keyname_browser_arr = array('OPERAMINI', 'BOLT');
foreach ($keyname_browser_arr as $keyname_browser) {
if (isset($_SERVER['HTTP_X_'.$keyname_browser.'_PHONE_UA'])) {
$browser = $keyname_browser;
break;
}
}
$url = "http://show.buzzcity.net/showads.php?get=mweb&partnerid=$partnerid&ip=$ip&ua=$ua&browser=$browser";
// # Use this if curl is not installedon your server #
// $ad_serve = @fopen($url,'r');
// $contents = '';
// if ($ad_serve) {
// while (!feof($ad_serve))$contents .= fread($ad_serve,1024);
// fclose($ad_serve);
// }
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
$contents = curl_exec($ch);
curl_close($ch);
if (!empty($contents)) {
$link = explode("n", $contents);
if (isset($link) && !empty($link)) {
// display BuzzCity TextAd
$text = $link[0];
}
}
$output = preg_match_all('/{"cid":['"]([^'"]+)['"].*}]}]}/i',$text,$buzzads);
$cid = $buzzads[1] [0];
$output1 = preg_match_all('/"cntr":['"]([^'"]+)['"].*,/i', $text, $buzzads1);
$country = $buzzads1[1] [0];
$output2 = preg_match_all('/"ecpm":['"]([^'"]+)['"].*"/i',$text,$buzzads2);
$free = $buzzads2[1] [0];
if ($free=="0.0000") {
echo "<a href='http://adfresh.in/ads/2'><img src='http://adfresh.in/banner/2'></a>";
} else {
echo "<a href='http://click.buzzcity.net/click.php?partnerid=$partnerid&cid=$cid'><img src='http://show.buzzcity.net/img.php?partnerid=$partnerid&cid=$cid&cntr=$country'></a>";
}
?>
itseasy21 Junior · 25 posts #3

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

LINE: $output = preg_match_all('/{"cid":'"['"].*}]}]}/i',$text,$buzzads);

amitdas333 Junior · 23 posts #6

GumSlone When i last checked buzzcity it only gives cpd ads to disable. Are you sure that buzzcity offers free ads to disable. Please tell us how to do it.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close