Exemple #1
0
 function Hot()
 {
     $title = '广场';
     $uid = MEMBER_ID;
     $member = $this->_member($uid);
     $per_page_num = $this->ShowConfig['topic_new']['topic'];
     if ($per_page_num < 1) {
         $per_page_num = 20;
     }
     $cache_time = max(0, (int) $this->CacheConfig['topic_new']["topic"]);
     $query_link = "index.php?mod=" . ($_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module) . ($this->Code ? "&amp;code={$this->Code}" : "");
     if ($per_page_num > 0) {
         $options = array('cache_time' => $cache_time, 'cache_key' => 'topic-newtopic-wap', 'page_url' => $query_link, 'perpage' => $per_page_num, 'order' => " dateline DESC ", 'type' => get_topic_type());
         if ($this->Get['type'] == 'recd') {
             $hb_type = 'recd';
             $info = jlogic('topic_list')->get_recd_list($options, 'wap');
         } else {
             $hb_type = 'topic_new';
             if ($this->Config['only_show_vip_topic']) {
                 $title = '最新V博';
                 $options['uid'] = jsg_get_vip_uids();
                 if ($options['uid']) {
                     $info = jlogic('topic_list')->get_data($options, 'wap');
                 } else {
                     $info = array();
                 }
             } else {
                 $info = jlogic('topic_list')->get_data($options, 'wap');
             }
         }
         $topics = array();
         $total_record = 0;
         if (!empty($info)) {
             $topics = wap_iconv($info['list']);
             $total_record = $info['count'];
             $page_arr = $info['page'];
         }
     }
     $parent_id_list = array();
     if ($topics) {
         foreach ($topics 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;
             }
         }
     }
     if ($parent_id_list) {
         $parent_list = $this->_topicLogicGet($parent_id_list);
     }
     $topic_new_hb = 'hb';
     $this->Title = $title;
     include template('topic_new');
 }
 private function _get($p)
 {
     $p['cache_time'] = max(0, (int) $p['cache_time']);
     if (isset($p['perpage'])) {
         $p['perpage'] = (int) $p['perpage'];
         if ($p['perpage'] < 1) {
             $p['perpage'] = 20;
         }
     }
     if ($GLOBALS['_J']['config']['only_show_vip_topic']) {
         $p['vip_uids'] = jsg_get_vip_uids();
         $p['where'] .= ' AND `uid` IN (' . $p['vip_uids'] . ') ';
     }
     $rets = jlogic('topic_list')->get_data($p);
     if (is_array($rets)) {
         $rets['params'] = array('pp_time' => $p['perpage'], 'c_time' => $p['cache_time'], 'uid' => base64_encode(serialize((array) $p['vip_uids'])));
         if ($rets['list']) {
             $rets['parent_list'] = jlogic('topic')->get_parent_list($rets['list']);
             $rets['relate_list'] = jlogic('topic')->get_relate_list($rets['list']);
             if ($GLOBALS['_J']['plugins']['func']['printtopic']) {
                 foreach ($rets['list'] as $row) {
                     jlogic('plugin')->hookscript('printtopic', 'funcs', $row, 'printtopic');
                 }
             }
         }
     }
     return $rets;
 }