Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1.     function _get_stats($param) {  
  2.         if (!isset($param['type'])) { $param['type'] = ''; }
  3.        
  4.         switch ($param['type']) {
  5.             case 'comments':
  6.                 $this->db->where('timestamp >', time()-86400);
  7.                 $this->db->where('type', 'entertain');
  8.             break;
  9.        
  10.             case 'forum_posts':
  11.                 $this->db->where('timestamp >', time()-86400);
  12.                 $this->db->where('parent_post != id');
  13.             break;
  14.        
  15.             case 'forum_threads':
  16.                 $this->db->where('timestamp >', time()-86400);
  17.                 $this->db->where('parent_post = id');
  18.             break;
  19.            
  20.             case 'photos':
  21.                 $this->db->where('date', date('Y-m-d'));
  22.             break;
  23.            
  24.             case 'photo_comments':
  25.             case 'guestbook_posts':
  26.                 $this->db->where('timestamp >', time()-86400);
  27.             break;
  28.         }
  29.        
  30.         return $this->db->count_all_results($param['table']);
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement