Пример #1
0
 public function route($action)
 {
     switch ($action) {
         case 'click':
         case 'view':
             /* Counter update stats */
             $this->core->stats($action);
             break;
         case 'position':
             /* Notes:
              *  Accurate ad views does not work when linking to this file to show the ads.
              *  The URL should look something like:
              *   http://bb3.mobi/ads/position?p=position_id&f=forum_id&u=user_id
              *  The Javascript code should look like this:
              *	<script src="http://bb3.mobi/ads/position?display=js&p=position_id&f=forum_id&u=user_id"></script>
              *
              * Be warned that this won't work with certain advertisements (like ones that already output via javascript such as Adsense).
              */
             $this->core->viewlink();
             break;
         case 'my':
             $this->core->my();
             break;
     }
 }
Пример #2
0
 public function setup_ads($event)
 {
     global $forum_id;
     if (!isset($this->config['ads_version'])) {
         return;
     }
     if (!$this->config['ads_enable']) {
         return;
     }
     $forum_id = $forum_id ? $forum_id : request_var('f', 0);
     $this->ads = $this->core->get_ads($this->user->data['user_id'], $forum_id);
     if (sizeof($this->ads)) {
         foreach ($this->ads as $position_id => $code) {
             $this->template->assign_vars(array('ADS_ID_' . $position_id => $position_id, 'ADS_' . $position_id => $code));
         }
     }
 }