template('body','/ajax/pf_goods'); $db = Database::instance(); $user = User::instance(); require_once($_SERVER['DOCUMENT_ROOT'].'/controllers/good.php'); list($comments,$goods_names) = Good::get_votes_profile($user_id,$user,$page_n); self::$keywords = $goods_names; $page->assign('user_id',$user_id); $page->assign('page_type',$page_type); $page->assign('comments', $comments); return $page->get_html(); } private function view_shops($page_type,$user_id,$page_n) { $page = new AjaxPage; $page->template('body','/ajax/pf_goods'); $db = Database::instance(); $user = User::instance(); require_once($_SERVER['DOCUMENT_ROOT'].'/controllers/shop.php'); list($comments,$shops_names) = Shop::get_votes_profile($user_id,$user,$page_n); self::$keywords = $shops_names; $page->assign('user_id',$user_id); $page->assign('page_type',$page_type); $page->assign('comments', $comments); return $page->get_html(); } private function view_questions($user_id,$page_n) { $on_page = 5; $page = new AjaxPage; $page->template('body','/ajax/pf_questions'); $db = Database::instance(); $user = User::instance(); require_once($_SERVER['DOCUMENT_ROOT'].'/controllers/askansw.php'); $ask = Askansw::profile_q($user_id,$on_page,$page_n); return $ask; } private function view_answers($user_id,$page_n) { $on_page = 5; $page = new AjaxPage; $page->template('body','/ajax/pf_answers'); $db = Database::instance(); $user = User::instance(); require_once($_SERVER['DOCUMENT_ROOT'].'/controllers/askansw.php'); $answ = Askansw::profile_a($user_id,$on_page,$page_n); return $answ; } private function view_wishlist($user_id,$page_n) { $page = new AjaxPage; $page->template('body','/ajax/pf_wishlist'); $db = Database::instance(); $user = User::instance(); $list = intval(Input::instance()->get('list')); $current = false; $lists = array(); // Собираем полный список $sql = 'SELECT `wl`.`id`,`name`,COUNT(`w`.`good_id`) AS `cnt`,`default` FROM `wishes_lists` `wl` LEFT JOIN `wishes` `w` ON(`w`.`list_id`=`wl`.`id`) WHERE `wl`.`user_id`='.$user_id.' AND `public`=1 GROUP BY `wl`.`id`'; $res = $db->query($sql); while($row=$db->fetch_assoc($res)) { if($row['id']==$list || (!$list && $row['default']==1)) { $current = $row; } $lists[] = $row; } if(count($lists)==0) $lists = false; if(!$current && count($lists>0)) { $current = $lists[0]; } $list = $current['id']; if($current) { $goods = array(); $sql = 'SELECT `g`.*,`c`.`name` AS `class_name` FROM `wishes` `w` LEFT JOIN `wishes_lists` `wl` ON(`wl`.`id`=`w`.`list_id`) LEFT JOIN `goods` `g` ON(`g`.`id`=`w`.`good_id`) LEFT JOIN `good_classes` `c` ON(`c`.`id`=`g`.`class`) WHERE `wl`.`id`='.$current['id'].' AND `wl`.`user_id`='.$user_id.' ORDER BY `g`.`name`'; $res = $db->query($sql); if($db->num_rows($res)==0) { $goods = false; } else { while($row=$db->fetch_assoc($res)) { $row['price'] = round(Helper::get_price_uah($row['price'])); $row['url_name'] = str_replace("'", '', Text::translit($row['name'])); $row['picture'] = Helper::make_pic_url($row,'small'); $row['class_urlname'] = str_replace("'", '', Text::translit($row['class_name'])); $goods[] = $row; } } } else $goods = array(); $page->assign('goods', $goods); $page->assign('lists', $lists); if($current['default']==1) { self::$nofollow = true; } $page->assign('current', $current); return $page->get_html(); } private function get_user_status($value) { $rangs = array(); $rangs[100] = 'гуру'; $rangs[50] = 'знаток'; $rangs[15] = 'в теме'; $rangs[5] = 'любитель'; $rangs[0] = 'новичок'; foreach($rangs as $num=>$status) if($value>=$num) return $status; } public function view() { $user_id = intval(Input::instance()->get('user_id')); $this->user_id = $user_id; $page_type = Input::instance()->get('page_type'); if(empty($page_type)) $page_type = 'goods'; $page_n = intval(Input::instance()->get('page_n'));// Номер страницы if(empty($page_n)) $page_n = 1; $user = User::instance(); $db = Database::instance(); $closed = false; $votes_num = false; $questions_num = false; $answers_num = false; $wishes_num = false; $wishes_only = false; $sql = 'SELECT `u`.`publish`,`u`.`fio` AS `name`,`u`.`id`,`u`.`gender`,`fio`,`image`,`u`.`login` FROM `user` `u` WHERE `u`.`id`='.$user_id; $res = $db->query($sql); if($db->num_rows($res)==0) { $content = 'Пользователь не найден'; $closed = true; } else { $data = $db->fetch_assoc($res); if(!empty($data['fio'])) $username = $data['fio']; else $username = $data['login']; if($data['publish']==0) { if($page_type=='wishlist') { $content = $this->view_wishlist($user_id,$page_n); $wishes_only = true; } else { $content = 'Пользователь запретил просмотр профиля'; } $data = array('id'=>$user_id); $closed = true; } else { if(empty($data['image'])) $data['image'] = '/images/default/defaults100user.jpg'; else $data['image'] = '/images/users/s100/'.$data['image']; $sql = 'SELECT ((SELECT COUNT(`g`.`id`) FROM `vote_goods_comments` `c` LEFT JOIN `votes_goods` `v` ON(`v`.`id`=`c`.`vote_id`) LEFT JOIN `goods` `g` ON(`g`.`id`=`v`.`good_id`) WHERE `c`.`user_id`='.$user_id.' AND `c`.`published`=1 AND `c`.`parent_id`=0) + (SELECT COUNT(*) FROM `vote_comments` WHERE `user_id`='.$user_id.' AND `published`=1 AND `parent_id`=0)) AS `votes`, (SELECT COUNT(*) FROM `ask` WHERE `user_id`='.$user_id.' AND `published`=1) AS `questions` , (SELECT COUNT(*) FROM `ask_answers` WHERE `user_id`='.$user_id.' AND `published`=1) AS `answers` , (SELECT COUNT(*) FROM `wishes_lists` WHERE `user_id`='.$user_id.' AND `public`=1) AS `wishes_num` '; $res = $db->query($sql); $row = $db->fetch_assoc($res); $num = $row['votes'] + $row['answers']; $data['status'] = $this->get_user_status($num); $votes_num = $row['votes']; $questions_num = $row['questions']; $answers_num = $row['answers']; $wishes_num = $row['wishes_num']; if($page_type=='goods') { $content = $this->view_goods($page_type,$user_id,$page_n); } elseif($page_type=='shops') { $content = $this->view_shops($page_type,$user_id,$page_n); } elseif($page_type=='q') { $content = $this->view_questions($user_id,$page_n); } elseif($page_type=='a') { $content = $this->view_answers($user_id,$page_n); } elseif($page_type=='wishlist') { $content = $this->view_wishlist($user_id,$page_n); } // $page->assign('content',$content); } }// closed $page = new BasePage; // if(strpos($_SERVER['REQUEST_URIvar_dump(self::$nofollow); $is_list = Input::instance()->get('list'); if(!empty($is_list)) { $page->set_nofollow(self::$nofollow); } $page->template('body','/main/profile'); if($page_type=='goods' || $page_type=='shops') { if(count(self::$keywords)>0) { $k_names = ', '.join(', ',array_slice(self::$keywords,0,3)); } else $k_names = ''; $page->set_title($username.' - отзывы пользователя о '.($page_type=='goods'?'товарах':'магазинах').' | UkrShops.com.ua', $username.$k_names.', товары, отзывы о '.($page_type=='goods'?'товарах':'магазинах'), 'Отзывы пользователя '.$username.' на UkrShops.com.ua' ); } elseif($page_type=='q' || $page_type=='a') { $page->set_title($username.' - '.($page_type=='q'?'вопросы':'ответы').' пользователя о товарах | UkrShops.com.ua', $username.', '.($page_type=='q'?'вопросы':'ответы').', обсуждение товаров, характеристики', ($page_type=='q'?'Вопросы':'Ответы').' пользователя '.$username.' на UkrShops.com.ua' ); } elseif($page_type=='wishlist') { $page->set_title($username.' - список желаний | UkrShops.com.ua', $username.', список желаний', 'Список желаний пользователя '.$username.' на UkrShops.com.ua' ); } $page->build_headers(); $page->assign('votes_num',$votes_num); $page->assign('questions_num',$questions_num); $page->assign('answers_num',$answers_num); $page->assign('wishes_num',$wishes_num); $page->assign('wishes_only',$wishes_only); $page->assign('user_data',$data); $page->assign('page_type',$page_type); $helper = Helper::instance(); $rightblock = $helper->rightblock(); $page->assign('rightblock', $rightblock); $page->assign('closed',$closed); $page->assign('c_user_id', $user->id); $page->assign('user_id', $user_id); $page->assign('user_level', $user->level); $page->assign('content',$content); $page->html(); } } Fatal error: Class 'Userview' not found in /home/ukrshops/web/ukrshops.com.ua/public_html/index.php on line 209