Esempio n. 1
0
 function eventDetail()
 {
     $id = intval($this->Get['id']);
     load::logic('event');
     $EventLogic = new EventLogic();
     $param = array('where' => " a.id = '{$id}' ");
     $return = $EventLogic->getEventInfo($param);
     $rs = $return['event_list'][$id];
     if (!$rs) {
         $this->Messager("活动不存在或已删除", -1);
     }
     if (!$rs['verify'] || $rs['verify'] == 0) {
         if ($rs['postman'] != MEMBER_ID) {
             $this->Messager("活动还在审核中", -1);
         }
     }
     $from = array();
     if ($rs['item'] == 'qun' && $rs['item_id'] > 0) {
         load::logic('qun');
         $qun_logic = new QunLogic();
         $qunInfo = $qun_logic->get_qun_info($rs['item_id']);
         $rs['qunname'] = $qunInfo['name'];
         $from['name'] = $this->Config[changeword][weiqun] . '--' . $rs['qunname'];
         $from['url'] = get_full_url('', 'index.php?mod=qun&qid=' . $rs['item_id']);
     } else {
         #if NEDU
         if (defined('NEDU_MOYO')) {
             if ($rs['item'] && $rs['item_id']) {
                 $app = nlogic('com.object')->get_info($rs['item'], $rs['item_id']);
                 if ($app) {
                     $from = array('name' => $app['object_name'], 'url' => $app['object_url']);
                 }
             }
         }
         #endif
     }
     $app_member_arr = $EventLogic->getAllUser(array('where' => " a.id = '{$id}' and a.app = 1 and a.play = 0 ", 'order' => " order by a.app_time ", 'limit' => " limit 6 "), 'app');
     $app_count = $app_member_arr['count'];
     $app_member = $app_member_arr['member'];
     $play_member_arr = $EventLogic->getAllUser(array('where' => " a.id = '{$id}' and a.play = 1  ", 'order' => " order by a.play_time ", 'limit' => " limit 6 "), 'play');
     $play_count = $play_member_arr['count'];
     $play_member = $play_member_arr['member'];
     $member = $this->Member;
     if ($member['medal_id']) {
         $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     jfunc('app');
     $gets = array('mod' => 'event', 'code' => "detail", 'id' => $id);
     $page_url = 'index.php?' . url_implode($gets);
     $options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url);
     $topic_info = app_get_topic_list('event', $id, $options);
     $topic_list = array();
     if (!empty($topic_info)) {
         $topic_list = $topic_info['list'];
         $page_arr['html'] = $topic_info['page']['html'];
         $no_from = true;
     }
     $this->item = 'event';
     $this->item_id = $id;
     $set_qun_closed = 1;
     $set_event_closed = 1;
     $set_fenlei_closed = 1;
     $this->Title = $rs['title'];
     include template('event/event_dateil');
 }
Esempio n. 2
0
 function view()
 {
     $uid = MEMBER_ID;
     $vid = empty($this->Get['vid']) ? 0 : intval($this->Get['vid']);
     $newpoll = $hotpoll = $poll = $option = array();
     $vote = $this->VoteLogic->id2voteinfo($vid);
     if (empty($vote) || $vote['verify'] == 0 && MEMBER_ROLE_TYPE != 'admin') {
         $this->Messager('当前投票不存在或正在审核中!');
     }
     $this->item_id = $vid;
     $ret = $this->VoteLogic->process_detail($vote, MEMBER_ID);
     extract($ret);
     $member = jsg_member_info($vote['uid']);
     if ($member['uid'] != MEMBER_ID) {
         $fllow = chk_follow(MEMBER_ID, $member['uid']);
         $follow_html = follow_html($member['uid'], $fllow);
         $all_vote_btn = "他的全部投票";
     } else {
         $follow_html = '';
         $all_vote_btn = "我的全部投票";
     }
     if ($member['uid'] == MEMBER_ID || MEMBER_ROLE_TYPE == 'admin') {
         $exp_info = $this->VoteLogic->get_publish_form_param();
         extract($exp_info);
     }
     $recd_list = $this->VoteLogic->get_recd_list();
     jfunc('app');
     $gets = array('mod' => 'vote', 'code' => 'view', 'vid' => $vid);
     $page_url = 'index.php?' . url_implode($gets);
     $options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url);
     $topic_info = app_get_topic_list($this->item, $vid, $options);
     $topic_list = array();
     if (!empty($topic_info)) {
         $topic_list = $topic_info['list'];
         $page_arr['html'] = $topic_info['page']['html'];
     }
     $params = array('item' => $this->item, 'item_id' => $vid, 'oc' => 'view');
     $no_from = true;
     $this->item = 'vote';
     $this->item_id = $vid;
     $set_qun_closed = 1;
     $set_vote_closed = 1;
     $expiration = FALSE;
     if ($vote['expiration'] < TIMESTAMP) {
         $expiration = true;
     }
     $this->Title = '投票 - ' . $vote['subject'];
     include template("vote/vote_view");
 }
Esempio n. 3
0
 function GetRewardList()
 {
     jfunc('app');
     $item = "reward";
     $item_id = intval(trim($this->Get['item_id']));
     if ($item_id < 1) {
         exit;
     }
     $gets = array('mod' => $item, 'code' => "detail", 'id' => $item_id);
     $page_url = 'index.php?' . url_implode($gets);
     $where = '';
     $options = array('where' => $where, 'page' => true, 'perpage' => 5, 'page_url' => $page_url);
     $topic_info = app_get_topic_list($item, $item_id, $options);
     $topic_list = array();
     if (!empty($topic_info)) {
         $topic_list = $topic_info['list'];
         $page_arr['html'] = $topic_info['page']['html'];
         $no_from = true;
         include template('topic_list_ajax');
     }
     exit;
 }
Esempio n. 4
0
 function iframe_recommend()
 {
     $ids = (int) (jget('ids') ? jget('ids') : jget('id'));
     if ($ids < 1) {
         exit('ids is empty');
     }
     $sql = " select * from `" . TABLE_PREFIX . "share` where `id` = '{$ids}' ";
     $query = $this->DatabaseHandler->Query($sql);
     $sharelist = $query->GetRow();
     if (!$sharelist) {
         exit('ids is invalid');
     }
     $share = @unserialize($sharelist['show_style']);
     $topic_charset = $share['topic_charset'];
     $share['limit'] = max(0, (int) $share['limit']);
     if ($share['limit'] < 1 || $share['limit'] > 200) {
         $share['limit'] = 20;
     }
     $share['string'] = max(0, (int) $share['string']);
     $order = ' `dateline` DESC ';
     $condition = '';
     $rets = $topic_list = array();
     if ('live' == $sharelist['type']) {
         $rr = jlogic('live')->get_script_out_list(1, $share['limit'], $share['string']);
         $rets = $live_list = $rr;
     } else {
         $user_topic_list = '';
         if ('topic' == $sharelist['type']) {
             $nickname = '';
             if ($sharelist['nickname']) {
                 $nickname = $sharelist['nickname'];
             } else {
                 $nickname = get_safe_code(jget('nickname'));
             }
             if ($nickname) {
                 $ns = explode('|', $nickname);
                 $uids = jtable('members')->get_ids(array('nickname' => $ns, 'result_count' => count($ns)), 'uid');
                 if (!$uids) {
                     exit('nickname is invalid');
                 }
                 $user_topic_list = " `uid` IN (" . jimplode($uids) . ") ";
             }
         }
         $tag_condition = '';
         if ('tag' == $sharelist['type']) {
             $tag = '';
             if ($sharelist['tag']) {
                 $tag = $sharelist['tag'];
             } else {
                 $tag = get_safe_code(jget('tag'));
             }
             if ($tag) {
                 $ts = explode('|', $tag);
                 $tagids = jtable('tag')->get_ids(array('name' => $ts, 'result_count' => count($ts)), 'id');
                 if (!$tagids) {
                     exit('tag is invalid');
                 }
                 $tids = jtable('topic_tag')->get_ids(array('tag_id' => $tagids, 'result_count' => $share['limit'], 'sql_order' => ' `dateline` DESC '), 'item_id');
                 if ($tids) {
                     $tag_condition = " `tid` IN (" . jimplode($tids) . ") ";
                     $topic_list = jlogic('topic')->Get($tids);
                 }
             }
         }
         $channel_condition = '';
         if ('channel' == $sharelist['type']) {
             $cids = array();
             if ($share['channel']['name']) {
                 $cname = $share['channel']['name'];
             } else {
                 $channel_id = jget('channel_id', 'int');
                 if ($channel_id > 0) {
                     $cids[$channel_id] = $channel_id;
                 } else {
                     $cname = jget('channel') ? jget('channel') : (jget('channel_name') ? jget('channel_name') : jget('ch_name'));
                 }
             }
             if ($cname) {
                 $ns = explode('|', $cname);
                 $cids = jtable('channel')->get_ids(array('ch_name' => $ns, 'result_count' => count($ns)), 'ch_id');
                 if (!$cids) {
                     exit('channel is invalid');
                 }
             }
             if ($cids) {
                 $condition = " `item`='channel' AND `item_id` IN(" . jimplode($cids) . ") ";
             }
         }
         if ('recommend' == $sharelist['type']) {
             $p = array('sql_order' => ' `dateline` DESC ', 'result_count' => $share['limit']);
             $its = array();
             $item = $share['recommend']['item'];
             if ($item) {
                 $its = $share['recommend']['item_id'];
             } else {
                 $item = jget('item', 'txt');
                 $its = jget('item_id', 'txt');
             }
             if (in_array($item, array('qun', 'channel')) && $its) {
                 ${$item_id . '_id'} = $its;
                 $p['item_id'] = explode('|', $its);
                 $p['item'] = $item;
             }
             $tids = jtable('topic_recommend')->get_ids($p, 'tid');
             if ($tids) {
                 $topic_list = jlogic('topic')->Get($tids);
             }
             foreach ($topic_list as $key_one => $topic_one) {
                 $sql = " select r_title from `" . TABLE_PREFIX . "topic_recommend` where tid = " . $topic_one['tid'];
                 $topic_list[$key_one]['recd_title'] = DB::result_first($sql);
             }
         }
         if ('live_weibo' == $sharelist['type']) {
             $live_id = (int) $share['live_weibo']['item_id'];
             $live_item = $share['live_weibo']['item'];
             if ($live_id > 0) {
                 $live_info = jlogic('live')->id2liveinfo($live_id);
                 $live_uids = array();
                 foreach ($live_info['all'] as $k => $v) {
                     $live_uids[$k] = $k;
                 }
                 $p = array('limit' => $share['limit']);
                 if ('live_all' == $live_item) {
                 } elseif ('live_other' == $live_item) {
                     $p['where'] = ' `uid` NOT IN (' . jimplode($live_uids) . ') ';
                 } else {
                     $p['where'] = " `uid` IN (" . jimplode($live_uids) . ") ";
                 }
                 jfunc('app');
                 $rets = app_get_topic_list('live', $live_id, $p);
                 $topic_list = $rets['list'];
             }
         }
         if ($tag_condition) {
             $condition = " {$tag_condition} AND `type` = 'first' ";
         } elseif ($user_topic_list) {
             $condition = " {$user_topic_list} AND `type` = 'first' ";
         }
         if (!$condition) {
             $condition = " `type` = 'first' ";
         }
         $gorder = jget('order');
         $where = " WHERE {$condition} ORDER BY {$order} LIMIT {$share['limit']} ";
         if (!$topic_list) {
             $topic_list = $this->TopicLogic->Get($where);
         }
         if ($topic_list) {
             if (!$share['hold_tags']) {
                 foreach ($topic_list as $k => $v) {
                     $topic_list[$k]['content'] = stripslashes($topic_list[$k]['content']);
                     $topic_list[$k]['content'] = strip_tags($topic_list[$k]['content']);
                     if ($share['string'] > 0) {
                         $topic_list[$k]['content'] = cut_str($topic_list[$k]['content'], $share['string']);
                         $topic_list[$k]['recd_title'] = cut_str($topic_list[$k]['recd_title'], $share['string']);
                     }
                 }
             }
         }
         $rets = $topic_list;
     }
     $output = jget('output');
     if ('json' == $output) {
         $rets = array_values($rets);
         $rets = array_iconv($this->Config['charset'], 'utf-8', $rets);
         echo json_encode($rets);
     } else {
         ob_start();
         include template('share/sharetemp_' . $ids);
         $content = ob_get_contents();
         ob_clean();
         $content = str_replace(array("\r\n", "\n", "\r"), "", $content);
         $content = str_replace("'", "\\'", $content);
         $content = str_replace("/http", "http", $content);
         $content = str_replace("index.php?", $this->Config['site_url'] . '/index.php?', $content);
         $content = str_replace($this->Config['site_url'] . "/" . $this->Config['site_url'], $this->Config['site_url'], $content);
         #开启伪静态以后加网址
         $content = str_replace('href="/', 'href="' . $this->Config['site_url'] . '/', $content);
         $content = str_replace('target="_blank"', "", $content);
         $content = str_replace('<a ', '<a target="_blank" ', $content);
         $content = preg_replace(array("/[\r\n]+/s", "/\\>\\s+\\</", "/\\>\\s+/", "/\\s+\\</"), array("", "><", ">", "<"), $content);
         if (strtoupper($this->Config['charset']) != strtoupper($share['topic_charset'])) {
             @header('Content-Type: text/html; charset=' . $share['topic_charset']);
             $content = array_iconv($this->Config['charset'], $share['topic_charset'], $content);
         }
         if ('iframe' == $output) {
             echo $content;
         } else {
             echo "document.write('{$content}');";
         }
     }
     exit;
 }
Esempio n. 5
0
 function view()
 {
     $uid = MEMBER_ID;
     $qid = intval(trim($this->Get['qid']));
     $tag = get_safe_code($this->Get['tag']);
     $view = trim($this->Get['view']);
     $qun_info = $this->QunLogic->get_qun_info($qid);
     if ($qun_info['qun_theme_id']) {
         $this->Config['qun_theme_id'] = $qun_info['qun_theme_id'];
         $this->Config['theme_id'] = '';
         $this->Config['theme_bg_image'] = '';
         $this->Config['theme_bg_color'] = '';
         $this->Config['theme_text_color'] = '';
         $this->Config['theme_link_color'] = '';
         $this->Config['theme_bg_image_type'] = '';
         $this->Config['theme_bg_repeat'] = '';
         $this->Config['theme_bg_fixed'] = '';
     }
     if (empty($qun_info)) {
         $this->Messager("当前" . $this->Config[changeword][weiqun] . "不存在或者已经被删除了", 'index.php?mod=qun');
     }
     if (!empty($tag)) {
         $qun_info['icon'] = $this->QunLogic->qun_avatar($qun_info['qid'], 's');
     } else {
         $qun_info['icon'] = $this->QunLogic->qun_avatar($qun_info['qid'], 'b');
     }
     $active = array();
     $topic_list = array();
     $get_topic_flg = true;
     $this->item_id = $qid;
     $params['code'] = $this->item;
     $cat_ary = $this->QunLogic->get_category();
     $top_cat = array();
     $sub_cat = array();
     if ($cat_ary['second'][$qun_info['cat_id']]) {
         $sub_cat = array('cat_name' => $cat_ary['second'][$qun_info['cat_id']]['cat_name'], 'cat_id' => $qun_info['cat_id']);
         $parent_id = $cat_ary['second'][$qun_info['cat_id']]['parent_id'];
         $top_cat = array('cat_name' => $cat_ary['first'][$parent_id]['cat_name'], 'cat_id' => $parent_id);
     } else {
         $top_cat = array('cat_name' => $cat_ary['first'][$qun_info['cat_id']]['cat_name'], 'cat_id' => $qun_info['cat_id']);
     }
     $founder_info = $this->TopicLogic->GetMember($qun_info['founderuid']);
     $qun_admin_list = $this->QunLogic->get_admin_list($qid);
     $tag_ary = $this->QunLogic->get_qun_tag($qid);
     $recd_event_list = $this->QunLogic->getRecdEventList($qid);
     $recd_vote_list = $this->QunLogic->getRecdVoteList($qid);
     $followme_nums = $this->QunLogic->followme_nums($qid, MEMBER_ID);
     $perm = $this->QunLogic->chk_perm($qid, MEMBER_ID);
     $status = '';
     $allow_list_manage = false;
     if (in_array($perm, array(1, 2, 4)) || MEMBER_ROLE_TYPE == 'admin') {
         $status = 'isgroupuser';
         $allow_list_manage = true;
     }
     jfunc('app');
     $gets = array('mod' => 'qun', 'type' => $this->Get['type'], 'qid' => $qid, 'tag' => $this->Get['tag'], 'code' => $this->Code);
     $page_url = 'index.php?' . url_implode($gets);
     $where = " type!='reply' ";
     if ($this->Get['type']) {
         if ('pic' == $this->Get['type']) {
             $where = " `imageid` > 0 ";
         } else {
             if ('video' == $this->Get['type']) {
                 $where = " `videoid` > 0 ";
             } else {
                 if ('music' == $this->Get['type']) {
                     $where = " `musicid` > 0 ";
                 } else {
                     $this->Get['type'] = '';
                 }
             }
         }
     }
     if (!empty($tag)) {
         $sql = "SELECT * FROM  " . DB::table('tag') . " WHERE name='" . addslashes($tag) . "'";
         $tag_info = DB::fetch_first($sql);
         $tag_id = $tag_info['id'];
         $sql = "SELECT item_id FROM " . DB::table('topic_tag') . " WHERE tag_id='{$tag_id}' ";
         $query = DB::query($sql);
         $topic_ids = array();
         while ($row = DB::fetch($query)) {
             $topic_ids[$row['item_id']] = $row['item_id'];
         }
         if (!empty($topic_ids)) {
             $where .= " AND tid IN(" . jimplode($topic_ids) . ") ";
         }
         $content = "#{$tag}#";
         $view = 'tag';
     } else {
         if ($view == "newreply") {
             $type_where = ' AND ' . $where;
             $per_page_num = $this->ShowConfig['qun']['topic_reply'] ? $this->ShowConfig['qun']['topic_reply'] : 10;
             $count = DB::result_first("SELECT COUNT(*)\r\n\t\t\t\t\t\t\t\t\t\t\tFROM " . DB::table('topic') . "\r\n\t\t\t\t\t\t\t\t\t\t\tWhere `replys` > 0 AND item='qun' AND item_id='{$qid}' {$type_where}");
             if ($count > 0) {
                 $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'));
                 $condition = " WHERE  `replys` > 0 AND item='qun' AND item_id='{$qid}' {$type_where} ORDER BY `lastupdate` DESC {$page_arr['limit']}";
                 $topic_list = $this->TopicLogic->Get($condition);
             }
             $get_topic_flg = false;
         } else {
             if ($view == 'recd') {
                 Load::logic('topic_list');
                 $TopicListLogic = new TopicListLogic();
                 $p = array('where' => " tr.recd <= 2 AND tr.item='qun' AND tr.item_id='{$qid}' ", 'perpage' => $per_page_num, 'filter' => $this->Get['type']);
                 $info = $TopicListLogic->get_recd_list($p);
                 if (!empty($info)) {
                     $count = $info['count'];
                     $topic_list = $info['list'];
                     $page_arr = $info['page'];
                 }
                 $get_topic_flg = false;
             } elseif ($view == 'event') {
                 $param = array('qid' => $qid, 'where' => " a.item = 'qun' and a.item_id = '{$qid}' ", 'page' => true, 'perpage' => 10, 'page_url' => 'index.php?mod=qun&view=event&qid=' . $qid);
                 load::logic('event');
                 $EventLogic = new EventLogic();
                 $return = $EventLogic->getEventInfo($param);
                 $count = $return['count'] ? $return['count'] : 0;
                 $event = $return['event_list'];
                 $page_arr = $return['page'];
                 $get_topic_flg = false;
             } elseif ($view == 'vote') {
                 load::logic('vote');
                 $VoteLogic = new VoteLogic();
                 $param = array('where' => " v.item = 'qun' and v.item_id = '{$qid}' ", 'order' => " order by v.dateline ", 'page' => true, 'perpage' => 10, 'page_url' => 'index.php?mod=qun&view=vote&qid=' . $qid);
                 $return = $VoteLogic->find($param);
                 $count = $return['count'] ? $return['count'] : 0;
                 if (!empty($return)) {
                     $vote_list = $return['vote_list'];
                     $page_arr['html'] = $return['page']['html'];
                     $uid_ary = $return['uids'];
                 }
                 if (!empty($uid_ary)) {
                     $members = $this->TopicLogic->GetMember($uid_ary);
                 }
                 $get_topic_flg = false;
             } elseif ($view == 'image') {
                 $param = array('item' => 'qun', 'itemid' => $qid, 'page' => true, 'per_page_num' => 20, 'page_url' => 'index.php?mod=qun&view=image&qid=' . $qid);
                 $return = jlogic('image')->get($param);
                 $count = $return['count'] ? $return['count'] : 0;
                 $image_list = $return['list'];
                 $page_arr['html'] = $return['page']['html'];
                 $get_topic_flg = false;
             } elseif ($view == 'attach' && $this->Config['qun_attach_enable']) {
                 global $attach_list;
                 $type = $this->Get['type'];
                 load::logic('attach');
                 $AttachLogic = new AttachLogic();
                 $param = array('item' => 'qun', 'itemid' => $qid, 'page' => true, 'per_page_num' => 20, 'page_url' => 'index.php?mod=qun&view=attach&qid=' . $qid . '&type=' . $type);
                 if ($type) {
                     if ('hot' == $type) {
                         $param['order'] = " order by download DESC ";
                     } else {
                         if ('new' == $type) {
                             $param['order'] = " order by id DESC ";
                         }
                     }
                 }
                 $return = $AttachLogic->get($param);
                 $count = $return['count'] ? $return['count'] : 0;
                 $attach_list = $return['list'];
                 $page_arr['html'] = $return['page']['html'];
                 $get_topic_flg = false;
             } else {
                 $view = 'newtopic';
             }
         }
         $active[$view] = "class='current'";
     }
     if ($get_topic_flg) {
         $options = array('where' => $where, 'page' => true, 'perpage' => $this->ShowConfig['qun']['topic_new'] ? $this->ShowConfig['qun']['topic_new'] : 10, 'page_url' => $page_url);
         $topic_info = app_get_topic_list($this->item, $qid, $options);
         if (!empty($topic_info)) {
             $topic_list = $topic_info['list'];
             $page_arr['html'] = $topic_info['page']['html'];
         }
     }
     $topic_list_count = count($topic_list);
     $parent_list = $this->_get_parent_topic($topic_list);
     $gets = array('item' => $this->item, 'item_id' => $qid);
     $member =& $this->my;
     if (!$this->Config['acceleration_mode'] && $member['medal_id']) {
         $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     $set_qun_closed = 1;
     if (empty($tag)) {
         $new_members = $this->QunLogic->get_new_member_list($qid);
         $this->Title = $this->Config[changeword][weiqun] . ' - ' . $qun_info['name'];
         include template('qun/view');
     } else {
         $this->Title = $this->Config[changeword][weiqun] . ' - ' . $qun_info['name'] . ' - ' . $tag;
         include template('qun/tag_view');
     }
 }
Esempio n. 6
0
 function view()
 {
     $lid = jget('id', 'int', 'G');
     if (!$this->TalkLogic->is_exists($lid)) {
         return false;
     }
     $list = $this->TalkLogic->Getguest($lid);
     $this->item = 'talk';
     $this->item_id = $item_id = $lid;
     $talk = $this->TalkLogic->id2talkinfo($lid, $list);
     $uids = array();
     $gets = array('mod' => 'talk', 'code' => 'view', 'id' => $lid);
     $page_url = 'index.php?' . url_implode($gets);
     $perpage = $talk['status_css'] == 'ico_ongoing' ? 1000 : 20;
     $options = array('page' => true, 'perpage' => $perpage, 'page_url' => $page_url, 'order' => ' dateline DESC ');
     if (empty($talk)) {
         $this->Messager('当前访谈不存在!');
     } elseif ($talk['all']) {
         $defaust_value = '&nbsp;<font color="#0080c7">我有一个想法和大家分享</font>';
         foreach ($talk['all'] as $key => $val) {
             $uids[$key] = $key;
         }
     }
     if ($talk['status_css'] == 'ico_ongoing') {
         $talklistcss = ' talk-list';
         $asklistcss = ' ask-list';
     }
     $is_talk_hosts = in_array(MEMBER_ID, $uids) ? true : false;
     $talkvisit_str = $this->Config['site_url'] . '/index.php?mod=talk&code=view&id=' . $lid;
     $cat = $this->TalkLogic->get_category($talk['cat_id'], 'second');
     $catp = $this->TalkLogic->get_category($cat['parent_id'], 'first');
     $talk_config = jconf::get('talk');
     if (MEMBER_STYLE_THREE_TOL) {
         $member = $this->TopicLogic->GetMember(MEMBER_ID);
     }
     $param = array('limit' => '5');
     $talk_info = $this->TalkLogic->get_list($param);
     if (!empty($talk_info)) {
         $talk_count = $talk_info['count'];
         $talk_list = $talk_info['list'];
     }
     jfunc('app');
     $options['talkwhere'] = ' uid NOT IN (' . jimplode($uids) . ')';
     $topic_info = app_get_topic_list('talk', $lid, $options);
     $options['talkwhere'] = ' totid > 0';
     $answer_info = app_get_topic_list('talk', $lid, $options);
     $options['talkwhere'] = ' istop = 1';
     $options['order'] = ' lastupdate DESC ';
     $question_info = app_get_topic_list('talk', $lid, $options);
     $myanswerids = app_getmyanswerid($lid);
     if (!empty($topic_info['list'])) {
         $topic_list = $topic_info['list'];
         foreach ($topic_list as $key => $val) {
             if (in_array($val['tid'], $myanswerids) && $talk[status_css] == 'ico_ongoing') {
                 $topic_list[$key]['reply_ok'] = true;
             }
         }
         $topic_count = $topic_info['count'];
         $topic_page_arr = $topic_info['page'];
     }
     if (!empty($question_info['list'])) {
         $question_list = $question_info['list'];
         $ask_count = $question_info['count'];
         $ask_page_arr = $question_info['page'];
         foreach ($question_list as $key => $val) {
             $ask_info = array();
             $u_t = $this->TalkLogic->id2usertype($lid, $val['uid'], $list);
             if ($u_t == 'guest') {
                 $question_list[$key]['user_str'] = '本期嘉宾';
             } else {
                 $question_list[$key]['user_str'] = '&nbsp;';
             }
             $question_list[$key]['user_css'] = 'talk' . $u_t;
             if (empty($question_list[$key]['touid'])) {
                 $question_list[$key]['biank_css'] = 'talk_view_ping';
                 $question_list[$key]['tubiao_css'] = 'talk_view_pin';
             } else {
                 $question_list[$key]['biank_css'] = 'talk_view_wenda';
                 $question_list[$key]['tubiao_css'] = 'talk_view_wen';
                 if (!empty($answer_info['list'])) {
                     foreach ($answer_info['list'] as $k => $v) {
                         if ($v['totid'] == $val['tid']) {
                             $ask_info['list'][$k] = $v;
                         }
                     }
                 }
                 if (!empty($ask_info)) {
                     $question_list[$key]['ask_list'] = $ask_info['list'];
                     foreach ($question_list[$key]['ask_list'] as $k => $v) {
                         $u_ta = $this->TalkLogic->id2usertype($lid, $v['uid'], $list);
                         if ($u_ta == 'guest') {
                             $question_list[$key]['ask_list'][$k]['user_str'] = '本期嘉宾';
                         } else {
                             $question_list[$key]['ask_list'][$k]['user_str'] = '&nbsp;';
                         }
                         $question_list[$key]['ask_list'][$k]['tubiao_css'] = 'talk_view_da';
                         $question_list[$key]['ask_list'][$k]['user_css'] = 'talk' . $u_ta;
                     }
                 }
             }
         }
     }
     $this->Title = '访谈 - ' . $talk['talkname'];
     $albums = jlogic('image')->getalbum();
     include template("talk/talk");
 }
Esempio n. 7
0
 function GetRewardDetail()
 {
     $id = (int) get_param('id');
     if ($id < 1) {
         $this->Messager('你查看的有奖转发信息不存在或已删除', -1);
     }
     $reward = jlogic('reward')->getRewardInfo($id);
     if (!$reward) {
         $this->Messager('你查看的有奖转发信息不存在或已删除', -1);
     }
     if ($reward['rules']['tag']) {
         $content = '#' . implode('##', $reward['rules']['tag']) . '#';
     }
     #有奖转发活动的参与者(显示N个)
     $param = array('rid' => $id, 'limit' => 9);
     $ret = jlogic('reward')->getRewardUser($param);
     $play_member = $ret['user'];
     $play_num = $ret['count'];
     jfunc('app');
     $gets = array('mod' => 'reward', 'code' => "detail", 'id' => $id);
     $page_url = 'index.php?' . url_implode($gets);
     $options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url);
     $topic_info = app_get_topic_list('reward', $id, $options);
     $topic_list = array();
     if (!empty($topic_info)) {
         $topic_list = $topic_info['list'];
         $page_arr['html'] = $topic_info['page']['html'];
         $no_from = true;
     }
     $this->item = 'reward';
     $this->item_id = $id;
     $set_qun_closed = 1;
     $set_event_closed = 1;
     $set_fenlei_closed = 1;
     $set_vote_closed = 1;
     if (DB::result_first("select id from `" . TABLE_PREFIX . "reward_user` where uid = '" . MEMBER_ID . "' and rid='" . $this->item_id . "' and`on` = 1")) {
         $isReward = true;
     }
     $member = jsg_member_info(MEMBER_ID);
     $this->Title = cut_str($reward['title'], 10);
     include_once template('reward/reward_datail');
 }
Esempio n. 8
0
 function view()
 {
     $lid = jget('id', 'int', 'G');
     if (!$this->LiveLogic->is_exists($lid)) {
         return false;
     }
     $list = $this->LiveLogic->Getguest($lid);
     $this->item = 'live';
     $this->item_id = $item_id = $lid;
     $ltype = $this->Get['list'] ? $this->Get['list'] : $this->Get['type'];
     $live = $this->LiveLogic->id2liveinfo($lid, $list);
     if (!in_array($ltype, array('g', 'h'))) {
         if ($live['status_css'] == 'ico_notyet') {
             $ltype = 'g';
         } else {
             $ltype = 'h';
         }
     }
     $params = array('item' => 'live', 'item_id' => $lid);
     $uids = array();
     $gets = array('mod' => 'live', 'code' => 'view', 'type' => $ltype, 'id' => $lid);
     $page_url = 'index.php?' . url_implode($gets);
     $options = array('page' => true, 'perpage' => 20, 'page_url' => $page_url);
     if (empty($live)) {
         $this->Messager('当前直播不存在!');
     } elseif ($live['all']) {
         $defaust_value = '&nbsp;一起来说说#' . $live['livename'] . '#吧';
         foreach ($live['all'] as $key => $val) {
             $uids[$key] = $key;
         }
         if ($ltype == 'h') {
             $options['where'] = " uid IN(" . jimplode($uids) . ") ";
         } else {
             $options['where'] = " uid NOT IN(" . jimplode($uids) . ") ";
         }
         $content = '#' . $live['livename'] . '#';
     }
     $is_live_hosts = in_array(MEMBER_ID, $uids) ? true : false;
     $live_config = jconf::get('live');
     if (MEMBER_STYLE_THREE_TOL) {
         $member = $this->TopicLogic->GetMember(MEMBER_ID);
     }
     $param = array('limit' => '5');
     $live_info = $this->LiveLogic->get_list($param);
     if (!empty($live_info)) {
         $live_count = $live_info['count'];
         $live_list = $live_info['list'];
     }
     jfunc('app');
     $topic_info = app_get_topic_list('live', $lid, $options);
     $topic_list = array();
     if (!empty($topic_info)) {
         $topic_list = $topic_info['list'];
         $page_arr['html'] = $topic_info['page']['html'];
         $no_from = false;
         if ($ltype == 'h' && !empty($topic_list)) {
             foreach ($topic_list as $key => $val) {
                 $topic_list[$key]['user_css'] = 'live' . $this->LiveLogic->id2usertype($lid, $val['uid'], $list);
                 $topic_list[$key]['user_str'] = '&nbsp;';
             }
         }
         $topic_count = $topic_info['count'];
     }
     $topic_count = $topic_count ? $topic_count : 0;
     $this->Title = '直播 - ' . $live['livename'];
     $albums = jlogic('image')->getalbum();
     include template("live/live");
 }