Untuk memasang banner buzzcity di xtgem dalam bentuk text, pertama kita masuk dulu ke :docs.buzzcity.net
$keyname_ua_arr = array( 'HTTP_X_ORIGINAL_USER_AGENT', 'HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA', 'HTTP_X_OPERAMINI_PHONE', 'HTTP_X_BOLT_PHONE_UA', 'HTTP_X_MOBILE_UA', 'HTTP_X_SKYFIRE_PHONE', '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 $browser = ''; if ((!empty($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) || !empty($_SERVER['HTTP_X_OPERAMINI_PHONE'] ) || !empty($_SERVER['HTTP_X_MXIT_PROFILE'])) && strpos($_SERVER['HTTP_USER_AGENT'], 'OperaMini') !== false ) { $browser = 'OPERAMINI'; } else if (!empty($_SERVER['HTTP_X_BOLT_PHONE_UA']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Bolt') ! == false ) { $browser = 'BOLT'; } else if (strpos($_SERVER['HTTP_USER_AGENT'], 'UCWEB') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'UCBrowser') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'UC Browser') !== false ) { $browser = 'UCWEB'; } else if (strpos($_SERVER['HTTP_USER_AGENT'], 'OviBrowser') !== false || strpos($_SERVER['HTTP_HOST'], 'browser.ovi.com') !== false ) { $browser = 'OVI'; } $url = 'http://' . BZ_ADS_DOMAIN . '/show.php? get=text&partnerid=' . BZ_PARTNERID . '&i=' . $ip . '&browser=' . $browser . '&a=' . $ua; // # Use this if curl is not installed on 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); $hasAd = FALSE; if (!empty($contents)) { $link = explode(" ", $contents); if (isset($link) && !empty($link)) { // display BuzzCity TextAd $text = $link[0]; $cid = $link[1]; echo '' . $text . ''; $hasAd = TRUE; } } if (!$hasAd) { // No BuzzCity Ad, display alternate link echo '' . $alternate_ text . ''; }
Lalu copy tulisan 'http:// . BZ_ADS_DOMAIN . '/show.php?get=text&partnerid=' . partner id' dan jadinya akan seperti ini :
Setelah itu letakkan di footer atau header xtgem dan maka hasilnya akan seperti ini