Example #1
0
}
if ($found) {
    // Get the data we need to display the banner
    $row = array_merge($row, phpAds_getBannerDetails($row['bannerid']));
    // Log this impression
    if ($phpAds_config['block_adviews'] == 0 || $phpAds_config['block_adviews'] > 0 && (!isset($_COOKIE['phpAds_blockView'][$row['bannerid']]) || $_COOKIE['phpAds_blockView'][$row['bannerid']] <= time())) {
        if ($phpAds_config['log_adviews']) {
            phpAds_logImpression($row['bannerid'], $row['clientid'], $row['zoneid'], $source);
        }
        // Send block cookies
        if ($phpAds_config['block_adviews'] > 0) {
            phpAds_setCookie("phpAds_blockView[" . $row['bannerid'] . "]", time() + $phpAds_config['block_adviews'], time() + $phpAds_config['block_adviews'] + 43200);
        }
    }
    // Set delivery cookies
    phpAds_setDeliveryCookies($row);
    // Send bannerid headers
    $cookie = array();
    $cookie['bannerid'] = $row["bannerid"];
    // Send zoneid headers
    if ($row['zoneid'] != 0) {
        $cookie['zoneid'] = $row['zoneid'];
    }
    // Send source headers
    if (isset($source) && $source != '') {
        $cookie['source'] = $source;
    }
    switch ($row['storagetype']) {
        case 'url':
            $row['imageurl'] = str_replace('{timestamp}', time(), $row['imageurl']);
            $row['url'] = str_replace('{timestamp}', time(), $row['url']);
Example #2
0
phpAds_registerGlobal('bannerid', 'clientid', 'zoneid', 'source', 'block', 'capping');
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if (isset($bannerid) && isset($clientid) && isset($zoneid)) {
    if (!isset($source)) {
        $source = '';
    }
    if ($phpAds_config['block_adviews'] == 0 || $phpAds_config['block_adviews'] > 0 && (!isset($_COOKIE['phpAds_blockView'][$bannerid]) || $_COOKIE['phpAds_blockView'][$bannerid] <= time())) {
        if ($phpAds_config['log_beacon'] && $phpAds_config['log_adviews']) {
            phpAds_dbConnect();
            phpAds_logImpression($bannerid, $clientid, $zoneid, $source);
        }
        // Send block cookies
        if ($phpAds_config['block_adviews'] > 0) {
            phpAds_setCookie("phpAds_blockView[" . $bannerid . "]", time() + $phpAds_config['block_adviews'], time() + $phpAds_config['block_adviews'] + 43200);
        }
    }
    // Set delivery cookies
    phpAds_setDeliveryCookies(array('bannerid' => $bannerid, 'block' => isset($block) ? $block : 0, 'capping' => isset($capping) ? $capping : 0));
    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);
if ($phpAds_config['auto_maintenance']) {
    // Perform auto maintenance!
    require phpAds_path . '/libraries/lib-automaintenance.inc.php';
    phpAds_performAutoMaintenance();
}