DOWNLOAD
'ce232553c76c3f3c28b22d2d6668cfee', // Required to request ads. To find your Publisher ID, log in to your MobFox account and click on the "Sites & Apps" tab.
'AD_REQUEST' => true, // To request an ad, set to TRUE.
'TEST_MODE' => true, // While testing, set to TRUE. When you are ready to make live requests, set to FALSE.
// Additional optional parameters are available at: http://developers.mobfox.com/index.php/Ad_Requests
'OPTIONAL' => array()
);
// Optional parameters for Contextual Targeting (not in use yet)
$pcl_params['OPTIONAL']['title'] = ""; // ENTER PAGE TITLE
$pcl_params['OPTIONAL']['spot_id'] = ""; // INTERNAL AD SPOT IT - CONTACT US FOR MORE INFO
$pcl_params['OPTIONAL']['int_cat'] = ""; // INTERNAL CATEGORY OVERRIDE - CONTACT US FOR MORE INFO
/* This code supports the ability for your website to set a cookie on behalf of MobFox
* To set an MobFox cookie, simply call pcl_setcookie() on any page that you call pcl_request()
* The call to pcl_setcookie() must occur before any output has been written to the page (http://www.php.net/setcookie)
* If your mobile site uses multiple subdomains (e.g. "a.example.com" and "b.example.com"), then pass the root domain of your mobile site (e.g. "example.com") as a parameter to pcl_setcookie().
* This will allow the MobFox cookie to be visible across subdomains
*/
//pcl_setcookie();
/* MobFox strongly recommends using cookies as it allows us to better uniquely identify users on your website.
* This benefits your mobile site by providing:
* - Improved ad targeting = higher click through rates = more revenue!
*/
// Send request to MobFox. To make additional ad requests per page, copy and paste this function call elsewhere on your page.
echo pcl_request($pcl_params);
/////////////////////////////////
// Do not edit below this line //
/////////////////////////////////
// This section defines MobFox functions and should be used AS IS.
// We recommend placing the following code in a separate file that is included where needed.
function pcl_request($pcl_params) {
static $pixel_sent = false;
$ad_mode = false;
if (!empty($pcl_params['AD_REQUEST']) && !empty($pcl_params['PUBLISHER_ID'])) $ad_mode = true;
$protocol = 'http';
if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') $protocol = 'https';
$rt = 1;
list($usec, $sec) = explode(' ', microtime());
$params = array('rt=' . $rt,
'z=' . ($sec + $usec),
'u=' . urlencode($_SERVER['HTTP_USER_AGENT']),
'i=' . urlencode($_SERVER['REMOTE_ADDR']),
'p=' . urlencode("$protocol://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']),
'v=' . urlencode('20081105-PHPCURL-acda0040bcdea222'));
$sid = empty($pcl_params['SID']) ? session_id() : $pcl_params['SID'];
if (!empty($sid)) $params[] = 't=' . md5($sid);
if ($ad_mode) $params[] = 's=' . $pcl_params['PUBLISHER_ID'];
if (!empty($_COOKIE['pclcookie'])) $params[] = 'o=' . $_COOKIE['pclcookie'];
if (!empty($pcl_params['TEST_MODE'])) $params[] = 'm=test';
if (!empty($pcl_params['OPTIONAL'])) {
foreach ($pcl_params['OPTIONAL'] as $k => $v) {
$params[] = urlencode($k) . '=' . urlencode($v);
}
}
$ignore = array('HTTP_PRAGMA' => true, 'HTTP_CACHE_CONTROL' => true, 'HTTP_CONNECTION' => true, 'HTTP_USER_AGENT' => true, 'HTTP_COOKIE' => true);
foreach ($_SERVER as $k => $v) {
if (substr($k, 0, 4) == 'HTTP' && empty($ignore[$k]) && isset($v)) {
$params[] = urlencode('h[' . $k . ']') . '=' . urlencode($v);
}
}
$post = implode('&', $params);
$request = curl_init();
$request_timeout = 1; // 1 second timeout
curl_setopt($request, CURLOPT_URL, 'http://my.mobfox.com/request.php');
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_TIMEOUT, $request_timeout);
curl_setopt($request, CURLOPT_CONNECTTIMEOUT, $request_timeout);
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Connection: Close'));
curl_setopt($request, CURLOPT_POSTFIELDS, $post);
list($usec_start, $sec_start) = explode(' ', microtime());
$contents = curl_exec($request);
list($usec_end, $sec_end) = explode(' ', microtime());
curl_close($request);
if ($contents === true || $contents === false) $contents = '';
if (preg_match('', $contents)){
global $no_ad_availible;
$no_ad_availible=true;
}
else
{
global $no_ad_availible;
$no_ad_availible=false;
}
/*if (!$pixel_sent) {
$pixel_sent = true;
$contents .= "
';
}*/
return $contents;
}
function pcl_setcookie($domain = '', $path = '/') {
if (empty($_COOKIE['pclcookie'])) {
$value = md5(uniqid(rand(), true));
if (!empty($domain) && $domain[0] != '.') $domain = ".$domain";
if (setcookie('pclcookie', $value, mktime(0, 0, 0, 1, 1, 2038), $path, $domain)) {
$_COOKIE['pclcookie'] = $value; // make it visible to pcl_request()
}
}
}
?>?php
>
Tampilkan postingan dengan label Crot Indo. Tampilkan semua postingan
Tampilkan postingan dengan label Crot Indo. Tampilkan semua postingan
Rabu, 26 Oktober 2011
Rabu, 12 Oktober 2011
Selasa, 11 Oktober 2011
Langganan:
Postingan (Atom)