Exemplo n.º 1
0
function google_set_via_and_accept()
{
    $ua = read_global('HTTP_USER_AGENT');
    if ($ua == '') {
        $GLOBALS['google']['via'] = read_global('HTTP_VIA');
        $GLOBALS['google']['accept'] = read_global('HTTP_ACCEPT');
    }
}
Exemplo n.º 2
0
function google_set_muid()
{
    $muid = read_global('HTTP_X_DCMGUID');
    if ($muid != '') {
        $GLOBALS['google']['muid'] = $muid;
    }
    $muid = read_global('HTTP_X_UP_SUBNO');
    if ($muid != '') {
        $GLOBALS['google']['muid'] = $muid;
    }
    $muid = read_global('HTTP_X_EM_UID');
    if ($muid != '') {
        $GLOBALS['google']['muid'] = $muid;
    }
}
function wptouch_get_google_ad($adsense_id, $adsense_channel = false)
{
    $GLOBALS['google']['ad_type'] = 'text';
    $GLOBALS['google']['client'] = $adsense_id;
    if ($adsense_channel) {
        $GLOBALS['google']['channel'] = $adsense_channel;
    }
    $GLOBALS['google']['format'] = 'mobile_single';
    $GLOBALS['google']['https'] = wptouch_read_global('HTTPS');
    $GLOBALS['google']['ip'] = wptouch_read_global('REMOTE_ADDR');
    $GLOBALS['google']['markup'] = 'chtml';
    $GLOBALS['google']['oe'] = 'utf8';
    $GLOBALS['google']['output'] = 'chtml';
    $GLOBALS['google']['ref'] = wptouch_read_global('HTTP_REFERER');
    $GLOBALS['google']['url'] = wptouch_read_global('HTTP_HOST') . read_global('REQUEST_URI');
    $GLOBALS['google']['useragent'] = wptouch_read_global('HTTP_USER_AGENT');
    $google_dt = time();
    wptouch_google_set_screen_res();
    wptouch_google_set_muid();
    wptouch_google_set_via_and_accept();
    $advertisement = '';
    $google_ad_handle = @fopen(wptouch_google_get_ad_url(), 'r');
    if ($google_ad_handle) {
        while (!feof($google_ad_handle)) {
            $advertisement = $advertisement . fread($google_ad_handle, 8192);
        }
        fclose($google_ad_handle);
    }
    return $advertisement;
}