コード例 #1
0
ファイル: adlog.php プロジェクト: miller-tamil/openads-plus
require phpAds_path . "/libraries/lib-log.inc.php";
require phpAds_path . "/libraries/lib-cache.inc.php";
/*********************************************************/
/* Register input variables                              */
/*********************************************************/
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();
}
コード例 #2
0
ファイル: adview.php プロジェクト: miller-tamil/openads-plus
                require phpAds_path . '/libraries/lib-view-direct.inc.php';
            }
            $row = phpAds_fetchBannerDirect($what, $clientid, $campaignid, '', $source, false);
        }
        if (is_array($row)) {
            $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"];