Example #1
0
/*********************************************************/
phpAds_registerGlobal('bannerid', 'clientid', 'zoneid', 'source', 'block', 'capping', 'session_capping');
/*********************************************************/
/* Main code                                             */
/*********************************************************/
// Determine the user ID
$userid = phpAds_getUniqueUserID();
// Send the user ID
phpAds_setCookie("phpAds_id", $userid, time() + 365 * 24 * 60 * 60);
if (isset($bannerid) && isset($clientid) && isset($zoneid)) {
    $source = phpAds_deriveSource($source);
    if (!phpAds_isViewBlocked($bannerid)) {
        if ($phpAds_config['log_beacon'] && $phpAds_config['log_adviews']) {
            phpAds_dbConnect();
            phpAds_logImpression($userid, $bannerid, $zoneid, $source);
        }
        // Send block cookies
        phpAds_updateViewBlockTime($bannerid);
    }
    // Update the time which this ad can be seen again
    phpAds_updateAdBlockTime($bannerid, $block);
    // Update Capping information for this banner.
    phpAds_updateAdCapping($bannerid, $capping, $session_capping);
    // Update Geotracking information
    phpAds_updateGeoTracking($phpAds_geo);
    phpAds_flushCookie();
}
header("Content-Type: image/gif");
header("Content-Length: 43");
// 1 x 1 gif
echo chr(0x47) . chr(0x49) . chr(0x46) . chr(0x38) . chr(0x39) . chr(0x61) . chr(0x1) . chr(0x0) . chr(0x1) . chr(0x0) . chr(0x80) . chr(0x0) . chr(0x0) . chr(0x4) . chr(0x2) . chr(0x4) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x21) . chr(0xf9) . chr(0x4) . chr(0x1) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x2c) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x1) . chr(0x0) . chr(0x1) . chr(0x0) . chr(0x0) . chr(0x2) . chr(0x2) . chr(0x44) . chr(0x1) . chr(0x0) . chr(0x3b);
Example #2
0
            $found = true;
        } else {
            $what = $row;
        }
    }
} else {
    $found = false;
}
if ($found) {
    // Log this impression
    if (!phpAds_isViewBlocked($row['bannerid'])) {
        if ($phpAds_config['log_adviews']) {
            phpAds_logImpression($userid, $row['bannerid'], $row['zoneid'], $source);
        }
        // Send block cookies
        phpAds_updateViewBlockTime($row['bannerid']);
    }
    // Block
    phpAds_updateAdBlockTime($row['bannerid'], $row['block']);
    // Set capping
    phpAds_updateAdCapping($row['bannerid'], $row['capping'], $row['session_capping']);
    // Set geotracking
    phpAds_updateGeoTracking($phpAds_geo);
    // Send bannerid headers
    $cookie = array();
    $cookie['bannerid'] = $row["bannerid"];
    // Send zoneid headers
    if ($row['zoneid'] != 0) {
        $cookie['zoneid'] = $row['zoneid'];
    }
    // Send source headers