<?php

defined('COT_CODE') or die('Wrong URL.');

global $db, $db_ads, $sys, $cfg;

$id = cot_import('id', 'G', 'INT');
if($id > 0) {
  $ads = $db->query("SELECT * FROM $db_ads WHERE item_id = ".(int)$id." AND item_paused=0 AND item_expire>=".(int)$sys['now']." ".($usr['id'] > 0 ? " AND item_userid!=".$usr['id'] : '')." LIMIT 1")->fetch();
  if ($ads['item_id'] > 0)
  {
    ads_tracks($ads['item_id'], 'show');
  }
}
exit;
