PDA

View Full Version : Impression tracking


KirbyDE
12-28-2005, 05:04 AM
function persist_impressions()
{
$impressions =& $this->impressions;
if ($impressions)
{
$m = date('m', TIMENOW);
$d = date('d', TIMENOW);
$y = date('y', TIMENOW);
$dateline = mktime(0, 0 , 0, $m, $d, $y);
$script = $this->db->escape_string(THIS_SCRIPT); // this constant should never-ever be unsafe anyway ...
$forumid = intval($this->forumid); // not sure if this is deemed necessary either
foreach ($impressions AS $key => $value)
{
if ($value)
{
$query[] = array($key, $m, $d, $y, $script, $forumid, $value, $dateline);
}
}
if (is_array($query) AND !emtpy($query))
{
$this->db->query_write("
INSERT INTO " . TABLE_PREFIX . "geek_autolink_stats
(galid, m, d, y, script, forum, count, dateline)
VALUES
" . explode(',', $query) . "
");
}
}
}


and scrap persist_postponed_impressions()?

The Geek
12-28-2005, 11:56 AM
Hey Kirb. I'm confused - what are you suggesting? ;)

KirbyDE
12-28-2005, 04:09 PM
I am suggesting to replace GAL_base::persist_impressions() with smth. like the code above, remove GAL_admin::persist_postponed_impressions() and the throttle setting :)

The Geek
12-28-2005, 11:22 PM
Ah - duh Should of looked a bit closer at the code :P

Fantastic suggestion. Will do.

Thanks