* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBStatistic'); /** * Statistic module for page and content views * * Simple interface to save page statistic * * @version 0.2.0 * @package WB * @subpackage base */ class WBStatistic_LinkTracker extends WBStatistic { /** * name of page view table */ const TABLE = 'linktracking'; /** * constructor * * Init user and request object. * */ public function __construct() { parent::__construct(); if (!$this->enabled) { return; } // see if feature is turned OFF if (!WBParam::get('wb/statistic/linktracking/use', 0)) { $this->enabled = false; return; } } /** * add path to page views * * Save path in statistic table * * @param string $path */ public function add() { if (!$this->enabled) { return; } $id = ''; $req = $this->req->export(); foreach ($req as $t => $v) { if (!empty($v)) { continue; } if (!is_numeric($t)) { continue; } $id = $t; break; } if (empty($id)) { return; } $save = array( 'trackid' => $this->getTrackingId(), 'linkid' => $id ); $this->table->save(self::TABLE, '__new', $save); } }