示例#1
0
文件: photo.php 项目: bizanto/Hooked
 /**
  * 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);
     }
 }
示例#2
0
文件: video.php 项目: bizanto/Hooked
 /**
  * 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);
 }
示例#3
0
 /**
  * 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);
     }
 }