Beispiel #1
0
 function Province()
 {
     $pid = (int) $this->Get['pid'];
     if ($pid) {
         $province_ary = DB::fetch_first("SELECT *\r\n\t\t\t\t\t\tFROM " . DB::table('common_district') . "\r\n\t\t\t\t\t\twhere `id` = '{$pid}' ");
         $categoryname = $province_ary['name'];
         $province_where_list = "where `upid` = 0";
         $province_ary = $this->ValidateLogic->CategoryCityList($province_where_list);
         $city_where_list = "where `upid` = '{$pid}'";
         $is_check_user = 1;
         $city_ary = $this->ValidateLogic->CategoryCityList($city_where_list, $is_check_user);
         $config = jconf::get();
         $people_config = $config['validate_people_setting'];
         $where = "where `is_push` = 2";
         $limit = $people_config['proviect_user_limit'] ? $people_config['proviect_user_limit'] : 20;
         $members_arr = $this->ValidateLogic->CategoryUserList($where, $limit, $people_config['proviect_user_orderby']);
         $member_list = $members_arr['member'];
         $member_uids = $members_arr['uids'];
         Load::logic("topic_list");
         $TopicListLogic = new TopicListLogic($this);
         $per_page_num = $people_config['proviect_topic_limit'] ? $people_config['proviect_topic_limit'] : 10;
         $query_link = "index.php?mod=" . ($_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module) . ($this->Code ? "&code={$this->Code}&d={$d}" : "");
         $options = array('perpage' => $per_page_num, 'page_url' => $query_link, 'type' => 'first', 'where' => " `uid` in('" . implode("','", $member_uids) . "') ", 'order' => "`dateline` DESC ");
         $topic_list = $TopicListLogic->get_data($options);
         if (!empty($topic_list)) {
             $page_arr = $topic_list['page'];
             $topics = $topic_list['list'];
             $total_record = $topic_list['count'];
         }
         $limit = 9;
         if ($city_ary) {
             foreach ($city_ary as $row) {
                 $where_list['city'] = build_like_query('city', $row['name']);
                 $where = ' where ' . implode(' AND ', $where_list) . ' and `validate` !="" order by `fans_count` desc limit 0,9';
                 $_list = $this->TopicLogic->GetMember($where, "`uid`,`ucuid`,`city`,`username`,`aboutme`,`nickname`,`face_url`,`face`,`validate`,`validate_category`");
                 if ($_list) {
                     foreach ($_list as $row) {
                         $row['validate_html'] = $row['validate_html'];
                         $members[] = $row;
                     }
                 }
             }
         }
     }
     $this->Title = "名人堂";
     include template("people/people_province_view");
 }
Beispiel #2
0
 function View()
 {
     $uid = MEMBER_ID;
     $member = $this->_topicLogicGetMember($uid);
     $params = array();
     $tag = get_safe_code($this->Code);
     if (!$tag) {
         $this->Messager("请输入正确的链接地址", null);
     }
     $f_rets = filter($tag, 0, 0);
     if ($f_rets && $f_rets['error']) {
         $this->Messager("输入的话题  " . $f_rets['msg'], null);
     }
     $sql = "select * from `" . TABLE_PREFIX . "tag` where `name`='" . addslashes($tag) . "'";
     $query = $this->DatabaseHandler->Query($sql);
     $tag_info = $query->GetRow();
     $tag_id = $tag_info['id'];
     $total_record = $tag_info['topic_count'];
     $this->TopicLogic = jlogic('topic');
     if ($total_record > 0) {
         $params['tag_id'] = $tag_id;
         $query_link = "index.php?mod=" . ($_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module) . ($tag ? "&code=" . urlencode($tag) : "");
         $per_page_num = 10;
         $page_arr = wap_page($total_record, $per_page_num, $query_link, array('return' => "Array"));
         $sql = "select `item_id` from `" . TABLE_PREFIX . "topic_tag` where `tag_id`='{$tag_id}' order by `item_id` desc {$page_arr['limit']}";
         $query = $this->DatabaseHandler->Query($sql);
         $topic_ids = array();
         while (false != ($row = $query->GetRow())) {
             $topic_ids[$row['item_id']] = $row['item_id'];
         }
         Load::logic("topic_list");
         $TopicListLogic = new TopicListLogic();
         $options = array('limit' => $per_page_num, 'order' => " dateline DESC ", 'type' => get_topic_type(), 'tid' => $topic_ids);
         $info = $TopicListLogic->get_data($options, 'wap');
         $topic_list = array();
         if (!empty($info)) {
             $topic_list = wap_iconv($info['list']);
         }
         $topic_list_count = 0;
         if ($topic_list) {
             $parent_id_list = array();
             foreach ($topic_list as $row) {
                 if (0 < ($p = (int) $row['parent_id'])) {
                     $parent_id_list[$p] = $p;
                 }
                 if (0 < ($p = (int) $row['top_parent_id'])) {
                     $parent_id_list[$p] = $p;
                 }
                 unset($topic_ids[$row['tid']]);
                 $topic_list_count++;
             }
             if ($topic_ids) {
                 $topic_ids_count = count($topic_ids);
                 $total_record = $total_record - $topic_ids_count;
                 $sql = "delete from `" . TABLE_PREFIX . "topic_tag` where `item_id` in('" . implode("','", $topic_ids) . "')";
                 $this->DatabaseHandler->Query($sql);
                 $sql = "update `" . TABLE_PREFIX . "tag` set `topic_count`=`topic_count`-{$topic_ids_count} where `id`='{$tag_info['id']}'";
                 if ($total_record >= 0 && $tag_info) {
                     $this->DatabaseHandler->Query($sql);
                 }
             }
             if ($parent_id_list) {
                 $parent_list = $this->_topicLogicGet($parent_id_list);
             }
         }
     }
     $show_config = jconf::get('show');
     $is_favorite = false;
     if ($tag_info) {
         if (MEMBER_ID > 0) {
             $is_favorite = jlogic('tag_favorite')->info($tag, MEMBER_ID);
         }
         $tag_favorite_list = jlogic('tag_favorite')->favorite_users($tag, 12, '`uid`, `username`, `nickname`, `face_url`, `face`, `ucuid`');
     }
     $tag = wap_iconv($tag);
     $tag_value = '#' . $tag . '#';
     $topic_count = $tag_info['topic_count'];
     $this->Title = $tag;
     include template('tag_list_topic_box');
 }
Beispiel #3
0
 function View()
 {
     $params = array();
     $content_dstr = $this->Config['in_publish_notice_str'];
     $content_ostr = $this->Config['on_publish_notice_str'];
     $tag = get_safe_code($this->Code);
     if (!$tag) {
         $this->Messager("请输入正确的链接地址", null);
     }
     $f_rets = filter($tag, 0, 0);
     if ($f_rets && $f_rets['error']) {
         $this->Messager("输入的话题  " . $f_rets['msg'], null);
     }
     $sql = "select * from `" . TABLE_PREFIX . "tag` where `name`='" . addslashes($tag) . "'";
     $query = $this->DatabaseHandler->Query($sql);
     $tag_info = $query->GetRow();
     $tag_id = $tag_info['id'];
     $total_record = $tag_info['topic_count'];
     $tag_count = $tag_info['tag_count'];
     $TopicLogic = jlogic('topic');
     Load::logic("topic_list");
     $TopicListLogic = new TopicListLogic();
     $params['tag_id'] = $tag_id;
     $this->Get['type'] = in_array($this->Get['type'], array('pic', 'video', 'music')) ? $this->Get['type'] : '';
     $gets = array('mod' => $_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module, 'code' => $this->Code ? $tag : "", 'type' => $this->Get['type'], 'view' => $this->Get['view']);
     $query_link = "index.php?" . url_implode($gets);
     unset($gets['type']);
     $type_url = "index.php?" . url_implode($gets);
     $per_page_num = max(0, (int) $this->ShowConfig['tag_view']['tag']);
     $options = array('type' => get_topic_type(), 'filter' => $this->Get['type']);
     $view = trim($this->Get['view']);
     if ($tag_id > 0 && $per_page_num > 0) {
         if ($view == 'recd') {
             $p = array('where' => " tr.recd <= 2 AND tr.item='tag' AND tr.item_id='{$tag_id}' ", 'perpage' => $per_page_num, 'filter' => $this->Get['type']);
             $info = $TopicListLogic->get_recd_list($p);
             if (!empty($info)) {
                 $total_record = $info['count'];
                 $topic_list = $info['list'];
                 $page_arr = $info['page'];
             }
         } else {
             if (empty($this->Get['type'])) {
                 $rets = jtable('topic_tag')->get_ids(array('tag_id' => $tag_id, 'sql_order' => ' `item_id` DESC ', 'result_count' => $total_record, 'per_page_num' => $per_page_num, 'page_url' => $query_link), 'item_id', 1);
                 $total_record = $rets['count'];
                 $page_arr = $rets['page'];
                 $topic_list = $total_record > 0 && $rets['ids'] ? $TopicLogic->Get($rets['ids']) : array();
             } else {
                 $sql = "select `item_id` from `" . TABLE_PREFIX . "topic_tag` where `tag_id`='{$tag_id}' order by `item_id` desc LIMIT 2000 ";
                 $query = $this->DatabaseHandler->Query($sql);
                 $topic_ids = array();
                 while (false != ($row = $query->GetRow())) {
                     $topic_ids[$row['item_id']] = $row['item_id'];
                 }
                 $options['tid'] = $topic_ids;
                 $options['filter'] = trim($this->Get['type']);
                 $options['page_url'] = $query_link;
                 $options['perpage'] = $per_page_num;
                 $info = $TopicListLogic->get_data($options);
                 $topic_list = array();
                 if (!empty($info)) {
                     $topic_list = $info['list'];
                     if (isset($info['page'])) {
                         $page_arr = $info['page'];
                         $total_record = $info['count'];
                     }
                 }
             }
         }
         if ($topic_list) {
             $parent_list = $TopicLogic->GetParentTopic($topic_list);
         }
     }
     if (!$topic_list) {
         $total_record = 0;
     }
     $show_config = jconf::get('show');
     $day1_r_tags = cache_file('get', "misc/recommendTopicTag-1-{$show_config['topic_index']['hot_tag']}");
     $day7_r_tags = cache_file('get', "misc/recommendTopicTag-7-{$show_config['topic_index']['hot_tag']}");
     $is_favorite = false;
     if ($tag_info) {
         if (MEMBER_ID > 0) {
             $is_favorite = jlogic('tag_favorite')->info($tag, MEMBER_ID);
         }
         $tag_favorite_count = jtable('tag_favorite')->count(array('tag' => $tag));
         if ($tag_favorite_count > 0) {
             $tag_favorite_list = jlogic('tag_favorite')->favorite_users($tag, 12);
         }
     }
     $my_favorite_tags = jlogic('tag_favorite')->my_favorite(MEMBER_ID, 12);
     $tag_extra = array();
     if ($tag_info && $tag_info['extra']) {
         Load::logic('tag_extra');
         $TagExtraLogic = new TagExtraLogic();
         $tag_extra_info = $TagExtraLogic->get_info($tag_info['id']);
         $tag_extra = $tag_extra_info['data'];
     }
     $_GET['searchKeyword'] = $this->Title = $tag;
     $this->MetaKeywords = $tag;
     $content = "#{$tag}#";
     if (MEMBER_ID > 0) {
         $member = jsg_member_info(MEMBER_ID);
         if ($member['medal_id']) {
             $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
         }
     }
     include template('tag/tag_list_topic_box');
 }