Advertisement
abushyk

getViewOptions

May 4th, 2014
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. public function getViewOptions($user_id){
  2.         $options=array('mode'=>'closed');
  3.         $wl=array();
  4.         $DBC=DBC::getInstance();
  5.         $query='SELECT * FROM '.DB_PREFIX.'_watchlist_1 WHERE watch_time_end<>0 AND watch_time_end>'.time().' AND user_id='.(int)$user_id;
  6.         $this->db->exec($query);
  7.         if($this->db->success){
  8.             while($this->db->fetch_assoc()){
  9.                 $wl[]=$this->db->row;
  10.             }
  11.         }
  12.         if(count($wl)>0){
  13.             $options['mode']='opened';
  14.         }
  15.         return $options;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement