/** * Override parent's hit method as we don't really want to * carefully increment it every time a photo is viewed. **/ public function hit() { $session =& JFactory::getSession(); //@rule: We need to test if the album for this photo also has the hits. // otherwise it would not tally when photo has large hits but not the album. // The album hit() will take care of the album hits session correctly. $album =& JTable::getInstance('Album', 'CTable'); $album->load($this->albumid); $album->hit(); if ($session->get('photo-view-' . $this->id, false) == false) { parent::hit(); $session->set('photo-view-' . $this->id, true); } }
/** * Make sure hits are user and session sensitive */ public function hit() { $session = JFactory::getSession(); if ($session->get('view-video-' . $this->id, false) == false) { parent::hit(); } $session->set('view-video-' . $this->id, true); }
/** * Override parent's hit method as we don't really want to * carefully increment it every time a photo is viewed. **/ public function hit() { $session =& JFactory::getSession(); if ($session->get('album-view-' . $this->id, false) == false) { parent::hit(); $session->set('album-view-' . $this->id, true); } }