Пример #1
0
 function index()
 {
     $per_page_num = min(500, max(20, (int) (isset($_GET['pn']) ? $_GET['pn'] : $_GET['per_page_num'])));
     $gets = array('mod' => 'recdtopic', 'pn' => $this->Get['pn'], 'per_page_num' => $this->Get['per_page_num'], 'keyword' => $this->Get['keyword'], 'nickname' => $this->Get['nickname']);
     $page_url = 'admin.php?' . url_implode($gets);
     $where_sql = ' 1 AND tr.tid>0 ';
     $keyword = trim($this->Get['keyword']);
     if ($keyword) {
         $_GET['highlight'] = $keyword;
         $where_sql .= " AND " . build_like_query('t.content,t.content2', $keyword) . " ";
     }
     $nickname = trim($this->Get['nickname']);
     if ($nickname) {
         $sql = "select `username`,`nickname` from `" . TABLE_PREFIX . "members` where `nickname`='{$nickname}' limit 0,1";
         $query = $this->DatabaseHandler->Query($sql);
         $members = $query->GetRow();
         $where_sql .= " AND `username`='{$members['username']}' ";
     }
     $count = DB::result_first("SELECT COUNT(*)\r\n\t\t\t\t\t\t\t\t   FROM " . DB::table('topic') . " AS t\r\n\t\t\t\t\t\t\t\t   LEFT JOIN " . DB::table('topic_recommend') . " AS tr\r\n\t\t\t\t\t\t\t\t   ON t.tid=tr.tid\r\n\t\t\t\t\t\t\t\t   WHERE {$where_sql}");
     $topic_list = array();
     if ($count) {
         $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'));
         $query = DB::query("SELECT t.*,tr.dateline AS recd_time,tr.expiration,tr.r_nickname\r\n\t\t\t\t\t\t\t\tFROM  " . DB::table('topic') . " AS t\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table('topic_recommend') . " AS tr\r\n\t\t\t\t\t\t\t\tON t.tid=tr.tid\r\n\t\t\t\t\t\t\t\tWHERE {$where_sql}\r\n\t\t\t\t\t\t\t\tORDER BY tr.dateline DESC\r\n\t\t\t\t\t\t\t\t{$page_arr['limit']} ");
         while ($value = DB::fetch($query)) {
             $value['recd_time'] = my_date_format2($value['recd_time']);
             $topic_list[] = $value;
         }
         $topic_list = $this->TopicLogic->MakeAll($topic_list);
     }
     include template('admin/recdtopic');
 }
Пример #2
0
 function Viewimg()
 {
     $imgid = jget('pid');
     $infos = jlogic('image')->get_uploadimg_byid($imgid);
     $imginfo = $infos[$imgid];
     if (!$imginfo) {
         $this->Messager("不存在该图片", null);
     }
     if ($imginfo['albumid'] > 0 && !jlogic('image')->checkalbumbyid($imginfo['albumid'])) {
         $this->Messager("您没有权限浏览该图片", null);
     }
     $imginfo['photo'] = $imginfo['site_url'] . '/' . str_replace('./', '', $imginfo['photo']);
     $albumname = $imginfo['albumid'] > 0 ? jlogic('image')->get_albumname_byid($imginfo['albumid']) : '默认相册';
     $imgname = $imginfo['description'] ? cut_str($imginfo['description'], 18) : $imginfo['name'];
     $imgwidth = $imginfo['width'] > 800 ? 800 : $imginfo['width'];
     $imgheight = $imginfo['width'] > 800 ? ceil($imginfo['height'] / $imginfo['width'] * 800) : $imginfo['height'];
     $imgsize = $imginfo['filesize'] > 0 ? $imginfo['filesize'] < 1024 * 100 ? round($imginfo['filesize'] / 1024, 1) . 'K' : round($imginfo['filesize'] / (1024 * 1024), 1) . 'M' : '未知';
     $imgtime = my_date_format($imginfo['dateline']);
     if ($imginfo['uid'] == MEMBER_ID) {
         $myclass = 'curr';
         $allclass = '';
         $navtitle = '<a href="' . jurl('index.php?mod=album') . '">我的相册</a> >> ' . '<a href="' . jurl('index.php?mod=album&aid=' . $imginfo['albumid']) . '">' . $albumname . '</a> >> ' . $imgname;
     } else {
         $myclass = '';
         $allclass = 'curr';
         $navtitle = '<a href="' . jurl('index.php?mod=album&code=list') . '">全部相册</a> >> ' . '<a href="' . jurl('index.php?mod=album&code=list&uid=' . $imginfo['uid']) . '">' . $imginfo['username'] . '的相册</a> >> ' . '<a href="' . jurl('index.php?mod=album&code=list&aid=' . $imginfo['albumid']) . '">' . $albumname . '</a> >> ' . $imgname;
     }
     $imgfrom = $imginfo['tid'] > 0 ? '<a href="' . jurl('index.php?mod=topic&code=' . $imginfo['tid']) . '">微博</a>' : ($imginfo['tid'] < 0 ? '私信' : '相册');
     $this->item = 'topic_image';
     $this->item_id = $imgid;
     $albumid = $imginfo['albumid'];
     $h_key = 'album';
     $gets = array('mod' => 'album', 'code' => 'viewimg', 'pid' => $imgid);
     $page_url = 'index.php?' . url_implode($gets);
     $tids = jlogic('image')->get_topic_by_imageid($imgid);
     $options = array('tid' => $tids, 'perpage' => 5, 'page_url' => $page_url);
     $topic_info = jlogic('topic_list')->get_data($options);
     $topic_list = array();
     if (!empty($topic_info)) {
         $topic_list = $topic_info['list'];
         $page_arr['html'] = $topic_info['page']['html'];
     }
     $this->Title = '查看相册图片 - ' . $imginfo['name'];
     $albums = jlogic('image')->getalbum();
     include template("album_img");
 }
Пример #3
0
 function index()
 {
     $per_page_num = min(500, max(20, (int) (isset($_GET['pn']) ? $_GET['pn'] : $_GET['per_page_num'])));
     $gets = array('mod' => 'vote', 'pn' => $this->Get['pn'], 'vid' => $this->Get['vid'], 'subject' => $this->Get['subject']);
     $page_url = 'admin.php?' . url_implode($gets);
     $where_sql = " 1 ";
     $vid = $this->Get['vid'];
     if (!empty($vid)) {
         if (strpos($vid, ',') !== false) {
             $vids = explode(',', $vid);
             foreach ($vids as $key => $val) {
                 $vids[$key] = intval($val);
             }
             $where_sql .= " AND v.vid IN(" . jimplode($vids) . ") ";
         } else {
             $where_sql .= " AND v.vid=" . intval($vid) . " ";
         }
     }
     $subject = $this->Get['subject'];
     if (!empty($subject)) {
         $subject_sql = addcslashes($subject, '_%');
         $where_sql .= " AND v.subject like('%{$subject_sql}%') ";
         $subject = jstripslashes($subject);
     }
     if ($this->Code == 'verify') {
         $action = "admin.php?mod=vote&code=doverify";
         $where_sql .= " AND v.verify = 0 ";
     } elseif ($this->Code == 'index') {
         $action = "admin.php?mod=vote&code=batch";
         $where_sql .= " AND v.verify = 1 ";
     }
     $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table("vote") . " v WHERE {$where_sql}");
     $list = array();
     if ($count) {
         $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'), '20 50 100 200,500');
         $query = DB::query("SELECT *,m.nickname\r\n\t\t\t\t\t\t\t\tFROM " . DB::table("vote") . " v\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table("members") . " m ON m.uid = v.uid\r\n\t\t\t\t\t\t\t\tWHERE {$where_sql}\r\n\t\t\t\t\t\t\t\tORDER BY v.dateline DESC\r\n\t\t\t\t\t\t\t\t{$page_arr['limit']}");
         while ($value = DB::fetch($query)) {
             if ($value['recd']) {
                 $value['recd_checked'] = 'checked="checked"';
             }
             $list[] = $value;
         }
     }
     include template('admin/vote');
 }
Пример #4
0
    }
    $result = get_xindai_list($money, $month, $data, $page);
    $num = $result['count'];
    $items = array();
    foreach ($result['items'] as $value) {
        $value['year_rate'] = round($value['year_rate'], 2);
        $value['more'] = count(explode(',', $value['profession'])) > 3 ? 1 : 0;
        $value['professions'] = reset(array_chunk(explode(',', $value['profession']), 3));
        $items[] = $value;
    }
    $theurl = 'plugin.php?' . url_implode($_GET);
    $sort_get = $_GET;
    unset($sort_get['grade']);
    unset($sort_get['total_interest']);
    unset($sort_get['month_repay']);
    $theurl_without_sort = 'plugin.php?' . url_implode($sort_get);
    $start_limit = ($page - 1) * 10;
    $multipage = multi($num, 10, $page, $theurl);
    $maxpage = ceil($num / 10);
    $seodata = array('bbname' => $_G['setting']['bbname'], 'xd_type' => lang('plugin/dzapp_haodai', 'xd_type_' . $_GET['xd_type']));
    list($navtitle, $metadescription, $metakeywords) = get_seosetting('', $seodata, $dzapp_haodai_seo['search']);
    include template('dzapp_haodai:search');
} elseif ($action == 'news') {
    if (!$_GET['aid']) {
        showmessage('dzapp_haodai:param_wrong');
    }
    $id = intval($_GET['aid']);
    $result = get_article_detail($id);
    if (!@(include_once DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkzx_' . $city . '.php' || TIMESTAMP - filemtime(DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkzx_' . $city . '.php') > $var['refreshtime'])) {
        $dkzx_article = get_article_dkzx_list();
        writetocache('dzapp_haodai_dkzx_' . $city, getcachevars(array('dkzx_article' => $dkzx_article)));
Пример #5
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;
 }
Пример #6
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");
 }
Пример #7
0
 function manage()
 {
     $op = trim($this->Get['op']);
     if ($op == 'edit') {
         $qid = intval(trim($this->Get['qid']));
         if (empty($qid)) {
             $this->Messager('请指定要编辑的微群');
         }
         $qun_info = $this->QunLogic->get_qun_info($qid);
         if (empty($qun_info)) {
             $this->Messager('当前群不存在或者已经被删除了');
         }
         $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "common_district where `upid` = '0' order by list");
         while ($rsdb = $query->GetRow()) {
             $province[$rsdb['id']]['value'] = $rsdb['id'];
             $province[$rsdb['id']]['name'] = $rsdb['name'];
             if ($qun_info['province'] == $rsdb['name']) {
                 $province_id = $rsdb['id'];
             }
         }
         $province_list = $this->jishigou_form->Select("province", $province, $province_id, "onchange=\"changeProvince();\"");
         if ($province_id) {
             if ($qun_info['city']) {
                 $hid_city = DB::result_first("select id from " . TABLE_PREFIX . "common_district where name = '{$qun_info['city']}' and upid = '{$province_id}'");
             }
         }
         Load::logic("qun");
         $qunLogic = new QunLogic();
         $themelist = $qunLogic->getQunThemeList();
         if (empty($cat_ary['second'][$qun_info['cat_id']])) {
             $catselect = $this->QunLogic->get_catselect($qun_info['cat_id'], 0);
         } else {
             $catselect = $this->QunLogic->get_catselect(0, $qun_info['cat_id']);
         }
         $tag = $this->QunLogic->get_qun_strtag($qid);
         $icon = $this->QunLogic->qun_avatar($qid);
         $checked = array();
         $checked['gview_perm'][$qun_info['gview_perm']] = 'checked="checked"';
         $checked['join_type'][$qun_info['join_type']] = 'checked="checked"';
         $checked['recd'] = $qun_info['recd'] == 1 ? 'checked="checked"' : '';
         $u_tips = $this->QunLogic->upload_tips();
         $actions = "admin.php?mod=qun&code=domanage&op=edit";
         include template('admin/qun_edit');
     } else {
         $perpage = 20;
         $gets = array('mod' => 'qun', 'code' => 'manage');
         $page_url = 'admin.php?' . url_implode($gets);
         $level_ary = jconf::get('qun_level');
         $where_sql = ' 1 ';
         $qun_level = $this->Get['qun_level'];
         if ($qun_level > 0) {
             $cur_level = $level_ary[$qun_level];
             $credits_higher = $cur_level['credits_higher'];
             $credits_lower = $cur_level['credits_lower'];
             $where_sql .= " AND q.credits<{$credits_lower} AND q.credits>={$credits_higher} ";
         }
         $qun_name = trim($this->Get['qun_name']);
         if (!empty($qun_name)) {
             $key_qun_name = jstripslashes($qun_name);
             $q_sql = addcslashes($qun_name, '_%');
             $where_sql .= " AND q.name LIKE('%{$q_sql}%') ";
         }
         $nickname = trim($this->Get['nickname']);
         if (!empty($nickname)) {
             $key_nickname = jstripslashes($nickname);
             $n_sql = addcslashes($nickname, '_%');
             $where_sql .= " AND m.nickname LIKE('%{$n_sql}%') ";
         }
         $timefrom = $this->Get['timefrom'];
         if ($timefrom) {
             $str_time_from = strtotime($timefrom);
             $where_sql .= " and `dateline`>'{$str_time_from}'";
         }
         $timeto = $this->Get['timeto'];
         if ($timeto) {
             $str_time_to = strtotime($timeto);
             $where_sql .= " and `dateline`<'{$str_time_to}'";
         }
         $count = DB::result_first("SELECT COUNT(*)\r\n\t\t\t\t\t\t\t\t\t   FROM " . DB::table('qun') . " AS q\r\n\t\t\t\t\t\t\t\t\t   LEFT JOIN " . DB::table('members') . " AS m\r\n\t\t\t\t\t\t\t\t\t   ON q.founderuid=m.uid\r\n\t\t\t\t\t\t\t\t  \t   WHERE {$where_sql}");
         $qun_list = array();
         if ($count) {
             $_config = array('return' => 'array');
             $page_arr = page($count, $perpage, $page_url, $_config);
             $cat_ary = jconf::get('qun_category');
             $query = DB::query("SELECT q.*, m.nickname\r\n\t\t\t\t\t\t\t\t\tFROM " . DB::table('qun') . " AS q\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table('members') . " AS m ON q.founderuid=m.uid\r\n\t\t\t\t\t\t\t\t\tWHERE {$where_sql}\r\n\t\t\t\t\t\t\t\t\tORDER BY dateline DESC\r\n\t\t\t\t\t\t\t\t\t{$page_arr['limit']}");
             while ($value = DB::fetch($query)) {
                 $level = $this->QunLogic->qun_level($value['qid'], $value['credits']);
                 $value['level'] = $level['level_name'];
                 if ($parent_id = $cat_ary['second'][$value['cat_id']]['parent_id']) {
                     $value['top_cat'] = $cat_ary['first'][$parent_id]['cat_name'];
                     $value['top_cat_id'] = $parent_id;
                     $value['sub_cat'] = $cat_ary['second'][$value['cat_id']]['cat_name'];
                 } else {
                     $parent_id = $value['cat_id'];
                     $value['top_cat'] = $cat_ary['first'][$parent_id]['cat_name'];
                     $value['top_cat_id'] = $parent_id;
                 }
                 $value['dateline'] = my_date_format($value['dateline'], 'Y-m-d');
                 if ($value['recd']) {
                     $value['recd_checked'] = 'checked="checked"';
                 }
                 if ($value['closed']) {
                     $value['closed_checked'] = 'checked="checked"';
                 }
                 $tag_name_arr = array();
                 $tag_name = DB::query("select tag_name from " . DB::table('qun_tag_fields') . " where qid = '{$value['qid']}' ");
                 while ($rs = DB::fetch($tag_name)) {
                     $tag_name_arr[] = $rs['tag_name'];
                 }
                 $value['tagname'] = implode(",", $tag_name_arr);
                 $qun_list[] = $value;
             }
         }
         include template('admin/qun_manage');
     }
 }
Пример #8
0
    exit('Access Denied');
}
define('DZZSCRIPT', 'index.php');
$sharestatus = array('-4' => '已屏蔽', '-3' => '文件已删除', '-2' => '次数用尽', '-1' => '已过期', '0' => '正常');
$typearr = array('folder' => '目录', 'image' => '图片', 'document' => '文档', 'dzzdoc' => 'Dzz文档', 'video' => '视频', 'attach' => '附件', 'link' => '网址', 'url' => '其他');
$type = trim($_GET['type']);
$keyword = trim($_GET['keyword']);
$username = trim($_GET['username']);
$asc = isset($_GET['asc']) ? intval($_GET['asc']) : 1;
$uid = intval($_GET['uid']);
$order = in_array($_GET['order'], array('title', 'dateline', 'type', 'size', 'count')) ? trim($_GET['order']) : 'dateline';
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
$perpage = 20;
$start = ($page - 1) * $perpage;
$gets = array('mod' => 'share', 'type' => $type, 'keyword' => $keyword, 'order' => $order, 'asc' => $asc, 'uid' => $uid, 'username' => $username);
$theurl = BASESCRIPT . "?" . url_implode($gets);
$orderby = " order by {$order} " . ($asc ? 'DESC' : '');
$sql = "1";
$param = array('share');
if ($type) {
    $sql .= " and type=%s";
    $param[] = $type;
}
if ($keyword) {
    $sql .= " and title LIKE %s";
    $param[] = '%' . $keyword . '%';
}
if ($username) {
    $sql .= " and username=%s";
    $param[] = $username;
}
Пример #9
0
if (empty($_GET['view'])) {
    $_GET['view'] = 'me';
}
$_GET['order'] = empty($_GET['order']) ? 'dateline' : $_GET['order'];
$allowviewuserthread = $_G['setting']['allowviewuserthread'];
$perpage = 20;
$start = ($page - 1) * $perpage;
ckstart($start, $perpage);
$list = array();
$userlist = array();
$hiddennum = $count = $pricount = 0;
$_GET['from'] = dhtmlspecialchars(preg_replace("/[^\\[A-Za-z0-9_\\]]/", '', $_GET['from']));
$gets = array('mod' => 'space', 'uid' => $space['uid'], 'do' => 'thread', 'fid' => $_GET['fid'], 'view' => $_GET['view'], 'type' => $_GET['type'], 'order' => $_GET['order'], 'fuid' => $_GET['fuid'], 'searchkey' => $_GET['searchkey'], 'from' => $_GET['from'], 'filter' => $_GET['filter']);
$theurl = 'home.php?' . url_implode($gets);
unset($gets['fid']);
$forumurl = 'home.php?' . url_implode($gets);
$multi = '';
$authorid = 0;
$replies = $closed = $displayorder = null;
$dglue = '=';
$vfid = $_GET['fid'] ? intval($_GET['fid']) : null;
require_once libfile('function/misc');
require_once libfile('function/forum');
loadcache(array('forums'));
$fids = $comma = '';
if ($_GET['view'] != 'me') {
    $displayorder = 0;
    $dglue = '>=';
}
$f_index = '';
$ordersql = 't.dateline DESC';
Пример #10
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');
 }
Пример #11
0
 * @Author http://www.jishigou.net $
 *
 * @Date 2014-01-03 17:38:36 107822614 926104608 1443 $
 */
if (!defined('IN_JISHIGOU')) {
    exit('invalid request');
}
if ($ids = jimplode($this->Post['delete'])) {
    $query = DB::query("SELECT `imageid` FROM " . DB::table('topic_shop') . " WHERE id IN ({$ids})");
    while ($value = DB::fetch($query)) {
        if ($value['imageid'] > 0) {
            DB::query("DELETE FROM " . DB::table('topic_image') . " WHERE id = '" . $value['imageid'] . "'");
        }
    }
    DB::query("DELETE FROM " . DB::table('topic_shop') . " WHERE id IN ({$ids})");
    $this->Messager("商品删除成功", 'admin.php?mod=plugin&code=manage&identifier=shop&pmod=admincp');
}
$action = 'admin.php?mod=plugin&code=manage&identifier=shop&pmod=admincp';
$count = DB::result_first("SELECT count(*) FROM " . DB::table('topic_shop'));
$gets = array('mod' => 'plugin', 'code' => 'manage', 'identifier' => 'shop', 'pmod' => 'admincp');
$page_url = 'admin.php?' . url_implode($gets);
$per_page_num = 50;
$shops = array();
if ($count > 0) {
    $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'));
    $query = DB::query("SELECT * FROM " . DB::table('topic_shop') . " ORDER BY id DESC {$page_arr['limit']}");
    while ($value = DB::fetch($query)) {
        $value['dateline'] = date('Y-m-d H:i:s', $value['dateline']);
        $shops[] = $value;
    }
}
Пример #12
0
 function login()
 {
     $t = (int) get_param('time');
     $t = $t > 0 ? $t : 24;
     $t_str = $t * 60 * 60;
     $t_str = TIMESTAMP - $t_str;
     $where = ' where ' . " `lastactivity` >= '{$t_str}' ";
     $nickname = get_param('nickname');
     if ($nickname) {
         $where .= " and `nickname` = '{$nickname}' ";
     }
     $param = array('mod' => $this->Get['mod'], 'code' => 'login', 'time' => $t, 'nickname' => $nickname);
     $url = 'admin.php?' . url_implode($param);
     $members = array();
     $count = DB::result_first("  select count(*) from `" . TABLE_PREFIX . "members` {$where} ");
     if ($count > 0) {
         $page = page($count, 50, $url, array('return' => 'array'));
         $query = DB::query(" select `uid`,`username`,`nickname`,`lastactivity`,`lastip`,`last_ip_port`,`topic_count`,`province`,`city` from `" . TABLE_PREFIX . "members` {$where} order by `lastactivity` desc {$page['limit']} ");
         while ($rs = DB::fetch($query)) {
             $members[$rs['uid']] = $rs;
         }
     }
     include template('admin/user_login');
 }
Пример #13
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");
 }
Пример #14
0
    function Main()
    {
        $code_ary = array('myblog', 'myhome', 'tag', 'qun', 'recd', 'other', 'bbs', 'cms', 'department', 'company', 'channel', 'topicnew', 'bcj');
        if (!in_array($this->Code, $code_ary)) {
            $tos = array('new' => 'index.php?mod=plaza', 'tc' => 'index.php?mod=plaza&code=new_tc', 'hotreply' => 'index.php?mod=plaza&code=hot_reply', 'hotforward' => 'index.php?mod=plaza&code=hot_forward', 'newreply' => 'index.php?mod=plaza&code=new_reply', 'newforward' => 'index.php?mod=plaza&code=new_forward', 'top' => 'index.php?mod=top&code=member', 'channellogin' => 'index.php?mod=channel');
            if (isset($tos[$this->Code])) {
                $this->Messager(null, $tos[$this->Code]);
                exit;
            }
            unset($this->Code);
        }
        $channel_enable = jconf::get('channel') ? true : false;
        $content_dstr = $this->Config['in_publish_notice_str'];
        $content_ostr = $this->Config['on_publish_notice_str'];
        if ('topic' == trim($this->Get['mod']) && empty($this->Get['code']) && empty($this->Get['mod_original'])) {
            if (MEMBER_ID > 0) {
                if ($this->Config['topic_home_page']) {
                    $this->Messager(null, $this->Config['topic_home_page']);
                } else {
                    $this->Code = 'myhome';
                }
            } else {
                $this->Messager('请<a onclick="ShowLoginDialog();return false;" title="快捷登录" rel="nofollow" href="index.php?mod=login" >点此登录</a>,
					或<a href="index.php?mod=member">点此注册</a>一个帐号', null);
                return;
            }
        }
        $member = $this->_member();
        if (!$member) {
            $this->Messager('请<a onclick="ShowLoginDialog();return false;" title="快捷登录" rel="nofollow" href="index.php?mod=login" >点此登录</a>,
					或<a href="index.php?mod=member">点此注册</a>一个帐号', null);
            return false;
        }
        $title = '';
        $per_page_num = 20;
        $topic_uids = $topic_ids = $order_list = $where_list = $params = array();
        $where = $order = $limit = "";
        $cache_time = 0;
        $cache_key = '';
        $options = array();
        $gets = array('mod' => $_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module, 'code' => $this->Code, 'type' => $this->Get['type'], 'gid' => $this->Get['gid'], 'qid' => $this->Get['qid'], 'chid' => $this->Get['chid'], 'view' => $this->Get['view'], 'filter' => $this->Get['filter'], 'orderby' => $this->Get['orderby']);
        $options['page_url'] = "index.php?" . url_implode($gets);
        unset($gets['type']);
        $type_url = "index.php?" . url_implode($gets);
        $params['uid'] = $uid = $member['uid'];
        $is_personal = $uid == MEMBER_ID;
        $params['is_personal'] = $is_personal;
        $params['code'] = $this->Code;
        if (!in_array($params['code'], $code_ary)) {
            $params['code'] = 'myblog';
        }
        $page_str = $params['code'];
        if ($params['code'] == 'bbs' || $params['code'] == 'cms') {
            $page_str = 'myhome';
        }
        if (($show_topic_num = (int) $this->ShowConfig['topic'][$page_str]) > 0) {
            $per_page_num = $show_topic_num;
        }
        $options['perpage'] = $per_page_num;
        $groupname = '';
        $groupid = 0;
        $TopicListLogic = jlogic('topic_list');
        #if NEDU
        if (defined('NEDU_MOYO')) {
            nui('jsg')->cindex($this, $params, $topic_list_get);
        }
        #endif
        $sendMail = false;
        $checkUser = false;
        if ($this->Config['sendmailday'] > 0) {
            if (!jsg_getcookie('mail_cookie')) {
                jsg_setcookie('mail_cookie', TIMESTAMP, 300);
                $sendMail = true;
            }
            if (!jsg_getcookie('check_user')) {
                jsg_setcookie('check_user', TIMESTAMP, 86400);
                $checkUser = true;
            }
        }
        $tpl = 'topic_index';
        if ('myhome' == $params['code']) {
            $tpl = 'topic_myhome';
            $topic_selected = 'myhome';
            $type = get_param('type');
            if ($type && !in_array($type, array('pic', 'video', 'music', 'vote', 'event'))) {
                $type = '';
            }
            if ($type) {
                $params['type'] = $type;
            }
            $gid = max(0, (int) get_param('gid'));
            if ($gid) {
                $params['gid'] = $gid;
            }
            $topic_myhome_time_limit = 0;
            if ($this->Config['topic_myhome_time_limit'] > 0) {
                $topic_myhome_time_limit = TIMESTAMP - $this->Config['topic_myhome_time_limit'] * 86400;
                if ($topic_myhome_time_limit > 0) {
                    $options['dateline'] = $topic_myhome_time_limit;
                }
            }
            $options['uid'] = array($member['uid']);
            if ($member['uid'] == MEMBER_ID) {
                $cache_time = 600;
                $cache_key = "{$member['uid']}-topic-myhome-{$type}-{$gid}";
                $title = '我的首页';
                $refresh_time = max(30, (int) $this->Config['ajax_topic_time']);
                if (get_param('page') < 2 && $member['lastactivity'] + $refresh_time < TIMESTAMP) {
                    $new_topic = jlogic('buddy')->check_new_topic($uid, 1);
                    if ($new_topic > 0) {
                        cache_db('rm', "{$uid}-topic-%", 1);
                    }
                }
                if ($gid) {
                    $group_info = jtable('buddy_follow_group')->info($gid);
                    if (empty($group_info) || MEMBER_ID != $group_info['uid']) {
                        $this->Messager("当前分组不存在", 'index.php?mod=myhome');
                    }
                    $query_link = "index.php?mod=" . ($_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module) . ($this->Code ? "&code={$this->Code}&type={$this->Get['type']}&gid={$this->Get['gid']}" : "");
                    if ($group_info['count'] > 0) {
                        $g_view_uids = jtable('buddy_follow_group_relation')->get_my_group_uids(MEMBER_ID, $gid);
                    }
                    $groupid = $gid;
                    $groupname = $group_info['name'];
                    if ($g_view_uids) {
                        $options['uid'] = $g_view_uids;
                    } else {
                        $this->Messager("没有设置用户,无法查看这个组的微博", 'index.php?mod=topic&code=group&gid=' . $gid);
                    }
                    $active[$gid] = "current";
                } else {
                    if ($type || false === cache_db('get', $cache_key)) {
                        $buddyids = get_buddyids($params['uid'], $this->Config['topic_myhome_time_limit']);
                        if ($buddyids) {
                            $options['uid'] = array_merge($options['uid'], $buddyids);
                        }
                    }
                    $active['all'] = "current";
                }
            } else {
                $title = "{$member['nickname']}的微博";
                $this->_initTheme($member);
            }
            if ($type) {
                $getTypeTidReturn = $TopicListLogic->GetTypeTid($type, $options['uid'], $options);
                $options['tid'] = $getTypeTidReturn['tid'];
                $options['count'] = $getTypeTidReturn['count'];
                $options['limit'] = $per_page_num;
            }
        } else {
            if ('channel' == $params['code'] && $this->Channel_enable && $this->Config['channel_enable']) {
                $viewtype = jget('view');
                $ch_id = jget('cid');
                $title = '我的频道微博';
                if ($member['uid'] != MEMBER_ID) {
                    $this->Messager("您无权查看该页面", null);
                }
                jlogic('member')->clean_new_remind('channel_new', MEMBER_ID);
                $orderby = in_array($this->Get['orderby'], array('post', 'dig', 'mark', 'ldig', 'top')) ? $this->Get['orderby'] : 'dig';
                $ChannelLogic = jlogic('channel');
                $my_buddy_channel = $ChannelLogic->mychannel();
                $cachefile = jconf::get('channel');
                $channel_channels = $cachefile['channels'];
                $channel_ids = array();
                if (empty($my_buddy_channel)) {
                    $channel_ids = array(0);
                } else {
                    $my_chs = array_keys($my_buddy_channel);
                    foreach ($my_chs as $val) {
                        $channel_ids = array_merge($channel_ids, (array) $channel_channels[$val]);
                    }
                    if (is_array($channel_ids)) {
                        $channel_ids = array_unique($channel_ids);
                    }
                }
                $my_cannot_view_chids = jlogic('channel')->get_my_cannot_view_chids();
                if ($my_cannot_view_chids) {
                    foreach ($channel_ids as $key => $val) {
                        if (in_array($val, $my_cannot_view_chids)) {
                            unset($channel_ids[$key]);
                        }
                    }
                }
                $options['item'] = 'channel';
                $options['item_id'] = $channel_ids;
                $options['type'] = array('first', 'channel');
                if ($orderby == 'mark') {
                    $order = ' lastupdate DESC';
                } elseif ($orderby == 'dig') {
                    $order = ' lastdigtime DESC';
                } elseif ($orderby == 'ldig') {
                    $order = ' digcounts DESC,lastdigtime DESC';
                } else {
                    $order = ' dateline DESC';
                }
                $options['order'] = $order;
                if ($orderby == 'top') {
                    $where = $channel_ids ? "tr.item = 'channel' AND tr.item_id IN(" . implode(",", $channel_ids) . ")" : "tr.item = 'channel'";
                    $options = array('where' => $where, 'perpage' => $per_page_num);
                    $info = $TopicListLogic->get_recd_list($options);
                    if (!empty($info)) {
                        $total_record = $info['count'];
                        $topic_list = $info['list'];
                        $page_arr = $info['page'];
                    }
                    $topic_list_get = true;
                }
            } else {
                if ('company' == $params['code'] && $this->Config['company_enable'] && @is_file(ROOT_PATH . 'include/logic/cp.logic.php')) {
                    $title = '我的单位微博';
                    if ($member['companyid'] < 1) {
                        $this->Messager("您还不属于任何" . $d_c_name . ",请先加入某个" . $d_c_name . "!", 'index.php?mod=settings&code=base');
                    }
                    jlogic('member')->clean_new_remind('company_new', MEMBER_ID);
                    $viewtype = jget('view');
                    $options['uid'] = jlogic('cp')->getcpuids('company', $member['companyid']);
                    if ($viewtype == 'secret') {
                        $options['type'] = 'company';
                    }
                } else {
                    if ('bcj' == $params['code'] && $this->Channel_enable && $this->Config['channel_enable']) {
                        $ch_id = jget('cid', 'int');
                        $featureid = jget('view', 'int');
                        if ($ch_id == 3) {
                            $title = '建议';
                        } elseif ($ch_id == 2) {
                            $title = '提问';
                        } else {
                            $title = '资讯';
                            if (!in_array($ch_id, array('4', '6'))) {
                                $ch_id = 5;
                            }
                        }
                        if (!in_array($featureid, array('1', '2', '3'))) {
                            $featureid = 0;
                        }
                        $options['item'] = 'channel';
                        $options['item_id'] = $ch_id;
                        $my_cannot_view_chids = jlogic('channel')->get_my_cannot_view_chids();
                        if ($my_cannot_view_chids && in_array($ch_id, $my_cannot_view_chids)) {
                            $forbidden_view = true;
                            $options['tid'] = 0;
                        }
                        if (isset($_GET['view'])) {
                            $options['where'] = " featureid = '{$featureid}' ";
                        }
                        $options['page_url'] .= "&cid={$ch_id}";
                    } else {
                        if ('department' == $params['code']) {
                            $tpl = 'topic_department';
                            $title = ($this->Config['default_department'] ? $this->Config['default_department'] : '部门') . '微博';
                            if ($member['uid'] != MEMBER_ID) {
                                $this->Messager("您无权查看该页面", null);
                            }
                            if (!($this->Config['department_enable'] && @is_file(ROOT_PATH . 'include/logic/cp.logic.php'))) {
                                $this->Messager("网站没有开启该功能", null);
                            }
                            $views = array('all', 'my', 'other');
                            $view = trim($this->Get['view']);
                            if (!in_array($view, $views)) {
                                $view = 'other';
                            }
                            $active[$view] = 'current';
                            $dids = array();
                            if ($member['departmentid'] > 0) {
                                if ($view == 'my') {
                                    $dids[] = $member['departmentid'];
                                } else {
                                    $sql = "select did\tfrom `" . TABLE_PREFIX . "buddy_department` where `uid`='" . MEMBER_ID . "'";
                                    $query = $this->DatabaseHandler->Query($sql);
                                    while (false != ($row = $query->GetRow())) {
                                        $dids[] = $row['did'];
                                    }
                                    if ($view == 'all') {
                                        $dids[] = $member['departmentid'];
                                    }
                                }
                            }
                            if ($dids) {
                                $sql = "select `uid` from `" . TABLE_PREFIX . "members` where  `departmentid` in(" . jimplode($dids) . ")";
                                $query = $this->DatabaseHandler->Query($sql);
                                $options['uid'] = array();
                                while (false != ($row = $query->GetRow())) {
                                    $options['uid'][] = $row['uid'];
                                }
                                if (false != ($type = $this->Get['type']) && 'all' != $type) {
                                    $options['tid'] = $TopicListLogic->GetTypeTid($type, $options['uid']);
                                }
                            } else {
                                $options['tid'] = array();
                            }
                            if ($member['departmentid']) {
                                $department = DB::fetch_first("SELECT * FROM " . DB::table('department') . " WHERE id='" . $member['departmentid'] . "'");
                            }
                            $user_lp = $this->TopicLogic->GetMember(array($department['leaderid'], $department['managerid']), "`uid`,`ucuid`,`username`,`nickname`,`face`,`face_url`,`validate`,`validate_category`,`aboutme`");
                            $mybuddys = (array) get_buddyids(MEMBER_ID);
                            $user_l = $user_lp[$department['leaderid']];
                            if ($user_l) {
                                $user_l['here_name'] = $department['leadername'];
                                $user_l['follow_html'] = follow_html2($department['leaderid'], in_array($department['leaderid'], $mybuddys));
                                $leader_list[] = $user_l;
                            }
                            $user_m = $user_lp[$department['managerid']];
                            if ($user_m) {
                                $user_m['here_name'] = $department['managername'];
                                $user_m['follow_html'] = follow_html2($department['managerid'], in_array($department['managerid'], $mybuddys));
                                $manager_list[] = $user_m;
                            }
                            $CpLogic = jlogic('cp');
                            $department_list = $CpLogic->Getdepartment($member['companyid'], $member['departmentid']);
                        } else {
                            if ('tag' == $params['code']) {
                                $tpl = 'topic_tag';
                                $title = '我关注的话题';
                                if ($member['uid'] != MEMBER_ID) {
                                    $this->Messager("您无权查看该页面", null);
                                }
                                $views = array('new', 'new_reply', 'my_reply', 'recd');
                                $view = trim($this->Get['view']);
                                if (!in_array($view, $views)) {
                                    $view = 'new';
                                }
                                $active[$view] = 'current';
                                $tag_ids = jlogic('tag_favorite')->my_favorite_tag_ids(MEMBER_ID);
                                if ($tag_ids) {
                                    if ('new' == $view) {
                                        $p = $options;
                                        $p['tag_id'] = $tag_ids;
                                        $p['sql_order'] = ' `item_id` DESC ';
                                        $rets = jtable('topic_tag')->get_ids($p, 'item_id', 1);
                                        $topic_list_get = true;
                                        $total_record = $rets['count'];
                                        $page_arr = $rets['page'];
                                        $topic_list = $total_record > 0 && $rets['ids'] ? $this->TopicLogic->Get($rets['ids']) : array();
                                    } else {
                                        $sql = "select `item_id` from `" . TABLE_PREFIX . "topic_tag` where  `tag_id` in('" . implode("','", $tag_ids) . "') 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;
                                        unset($topic_ids);
                                    }
                                    if ($this->Get['type']) {
                                        $options['filter'] = $this->Get['type'];
                                    }
                                    if ($view == 'new_reply') {
                                        $options['where'] = " replys>0 ";
                                        $options['order'] = " lastupdate DESC ";
                                    } else {
                                        if ($view == 'recd') {
                                            $p = array('where' => " tr.recd >= 1 AND tr.item='tag' AND tr.item_id IN(" . jimplode($tag_ids) . ") ", 'perpage' => 10, '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'];
                                            }
                                            $topic_list_get = true;
                                        }
                                    }
                                } else {
                                    $topic_list_get = true;
                                }
                                if ($GLOBALS['_J']['member']['topic_new']) {
                                    jlogic('member')->clean_new_remind('topic_new', MEMBER_ID);
                                }
                            } else {
                                if ('myblog' == $params['code']) {
                                    $this->myblog_no_recommend = TRUE;
                                    $tpl = 'topic_myblog';
                                    $where = " 1 ";
                                    $options['uid'] = array($member['uid']);
                                    if ($this->Get['type']) {
                                        if ('profile' == $this->Get['type']) {
                                            $title = $member['gender_ta'] . '的资料';
                                            $type = 'profile';
                                            #用户填写的自定义添加项
                                            $member_profile = jlogic('member_profile')->getMemberProfileInfo($member['uid']);
                                            if ($member_profile) {
                                                $member = array_merge($member, $member_profile);
                                            }
                                            #用户自定义添加项的可见度
                                            $memberProfileSet = jlogic('member_profile')->getMemberProfileSet($member['uid']);
                                            $member_info = $member;
                                            if ($member_info['gender']) {
                                                if ($member_info['gender'] == 1) {
                                                    $member_info['gender'] = '男';
                                                } elseif ($member_info['gender'] == 2) {
                                                    $member_info['gender'] = '女';
                                                }
                                            }
                                            if ($member_info['bday']) {
                                                $bdayInt = strtotime($member_info['bday']);
                                                if (!$bdayInt) {
                                                    unset($member_info['bday']);
                                                }
                                            }
                                            $member_info = array_filter($member_info);
                                            $groupProfile = jconf::get('groupprofile');
                                            foreach ($groupProfile as $key_p => $group_p) {
                                                $keys_p = array_keys($group_p['list']);
                                                foreach ($keys_p as $key_one) {
                                                    if ($member_info[$key_one]) {
                                                        $groupProfile[$key_p]['isProfile'] = true;
                                                    }
                                                    continue;
                                                }
                                            }
                                        }
                                        if ('album' == $this->Get['type']) {
                                            $this->Title = ($member['uid'] == MEMBER_ID ? '我' : $member['nickname']) . '的相册';
                                            $nav_url = $this->Title;
                                            $uid = $member['uid'];
                                            $imgid = jget('pid');
                                            if (isset($_GET['aid'])) {
                                                $albumid = jget('aid');
                                                $list_type = 'image';
                                                $albumname = jlogic('image')->getalbumname($albumid, 0, 0, $uid);
                                                if ($albumid > 0 && $albumname) {
                                                    if (!jlogic('image')->checkalbumbyid($albumid)) {
                                                        $this->Messager("您没有权限浏览该相册", null);
                                                    }
                                                    $count = jlogic('image')->albumimgnums($albumid, 1);
                                                    $albuminfo = jlogic('image')->getalbumbyid('album', $albumid);
                                                    if ($count != $albuminfo['picnum']) {
                                                        jlogic('image')->update_album_picnum($albumid, $count);
                                                    }
                                                } else {
                                                    $count = jlogic('image')->albumimgnums(0, 0, $uid);
                                                }
                                                $albumname = $albumname ? $albumname : ($albumid > 0 ? '错误页面' : '默认相册');
                                                $pernum = 9;
                                                $pagehtml = page($count, $pernum, 'index.php?mod=' . $member['username'] . '&type=album&aid=' . $albumid, array('return' => 'array'));
                                                $limit_sql = $pagehtml['limit'];
                                                if ($albumid > 0) {
                                                    $myalbums = jlogic('image')->getallalbumimg($albumid, $limit_sql, 1);
                                                } else {
                                                    $myalbums = jlogic('image')->getallalbumimg(0, $limit_sql, 0, $uid);
                                                }
                                                foreach ($myalbums as $key => $val) {
                                                    $myalbums[$key]['pic'] = $val['site_url'] . str_replace('./', '/', str_replace('_o.jpg', '_s.jpg', $val['photo']));
                                                    $myalbums[$key]['albumname'] = $val['description'] ? cut_str($val['description'], 18) : '';
                                                    $myalbums[$key]['title'] = $val['description'];
                                                    $myalbums[$key]['url'] = jurl('index.php?mod=' . $member['username'] . '&type=album&pid=' . $val['id']);
                                                    $myalbums[$key]['rel'] = $val['photo'] ? $val['site_url'] . '/' . str_replace('./', '', $val['photo']) : '';
                                                }
                                                $nav_url = '<a href="index.php?mod=' . $member['username'] . '&type=album">' . $this->Title . '</a> >> ' . $albumname;
                                            } elseif ($imgid > 0) {
                                                $content_ostr = '';
                                                $type = 'album';
                                                $infos = jlogic('image')->get_uploadimg_byid($imgid, $uid);
                                                $imginfo = $infos[$imgid];
                                                if (!$imginfo) {
                                                    $this->Messager("不存在该图片", null);
                                                }
                                                if ($imginfo['albumid'] > 0 && !jlogic('image')->checkalbumbyid($imginfo['albumid'])) {
                                                    $this->Messager("您没有权限浏览该图片", null);
                                                }
                                                $imginfo['photo'] = $imginfo['site_url'] . '/' . str_replace('./', '', $imginfo['photo']);
                                                $albumname = $imginfo['albumid'] > 0 ? jlogic('image')->get_albumname_byid($imginfo['albumid']) : '默认相册';
                                                $imgname = $imginfo['description'] ? cut_str($imginfo['description'], 18) : $imginfo['name'];
                                                $imgwidth = $imginfo['width'] > 580 ? 580 : $imginfo['width'];
                                                $imgheight = $imginfo['width'] > 580 ? ceil($imginfo['height'] / $imginfo['width'] * 580) : $imginfo['height'];
                                                $imgsize = $imginfo['filesize'] > 0 ? $imginfo['filesize'] < 1024 * 100 ? round($imginfo['filesize'] / 1024, 1) . 'K' : round($imginfo['filesize'] / (1024 * 1024), 1) . 'M' : '未知';
                                                $imgtime = my_date_format($imginfo['dateline']);
                                                $imgfrom = $imginfo['tid'] > 0 ? '<a href="' . jurl('index.php?mod=topic&code=' . $imginfo['tid']) . '">微博</a>' : ($imginfo['tid'] < 0 ? '私信' : '相册');
                                                $this->item = 'topic_image';
                                                $this->item_id = $imgid;
                                                $albumid = $imginfo['albumid'];
                                                $h_key = 'album';
                                                $gets = array('mod' => $member['username'], 'type' => 'album', 'pid' => $imgid);
                                                $page_url = 'index.php?' . url_implode($gets);
                                                $tids = jlogic('image')->get_topic_by_imageid($imgid);
                                                $options = array('tid' => $tids, 'perpage' => 5, 'page_url' => $page_url);
                                                $topic_info = jlogic('topic_list')->get_data($options);
                                                $topic_list = array();
                                                if (!empty($topic_info)) {
                                                    $topic_list = $topic_info['list'];
                                                    $page_arr['html'] = $topic_info['page']['html'];
                                                }
                                                $albums = jlogic('image')->getalbum();
                                                $nav_url = '<a href="index.php?mod=' . $member['username'] . '&type=album">' . $this->Title . '</a> >> <a href="index.php?mod=' . $member['username'] . '&type=album&aid=' . ($imginfo['albumid'] > 0 ? $imginfo['albumid'] : 0) . '">' . $albumname . '</a> >> ' . ($imgname ? $imgname : '图片浏览');
                                            } else {
                                                $list_type = 'album';
                                                $count = jlogic('image')->albumnums(1, $uid);
                                                $pernum = 8;
                                                $pagehtml = page($count, $pernum, 'index.php?mod=' . $member['username'] . '&type=album', array('return' => 'array'));
                                                $limit_sql = $pagehtml['limit'];
                                                $myalbums = jlogic('image')->getalbum($limit_sql, 1, $uid);
                                                $myalbums[0] = array('albumid' => 0, 'albumname' => '默认相册');
                                                $purview_name = $member['uid'] == MEMBER_ID ? '我' : $member['gender_ta'];
                                                $purviewtext = array(0 => '所有人可见', 1 => '仅' . $purview_name . '关注的人可见', 2 => '仅' . $purview_name . '的粉丝可见', 3 => '仅' . $purview_name . '自己可见');
                                                foreach ($myalbums as $key => $val) {
                                                    $myalbums[$key]['pic'] = $val['pic'] ? str_replace('_o.jpg', '_s.jpg', $val['pic']) : 'images/noavatar.gif';
                                                    $myalbums[$key]['albumname'] = cut_str($val['albumname'], 18);
                                                    $myalbums[$key]['title'] = $val['depict'] ? $val['depict'] : $val['albumname'];
                                                    $myalbums[$key]['url'] = jurl('index.php?mod=' . $member['username'] . '&type=album&aid=' . $val['albumid']);
                                                    $myalbums[$key]['id'] = $val['albumid'];
                                                    $myalbums[$key]['purview'] = $purviewtext[$val['purview']];
                                                }
                                            }
                                        }
                                        if ('mycomment' == $this->Get['type']) {
                                            $title = '评论' . $member['gender_ta'] . '的';
                                            if ($member['uid'] < 1) {
                                                $this->Messager("您无权查看该页面", null);
                                            }
                                            if ($member['comment_new']) {
                                                jlogic('member')->clean_new_remind('comment_new', $member['uid']);
                                            }
                                            $topic_selected = 'mycomment';
                                            $_rets = jtable('member_relation')->get_tids($member['uid'], array('perpage' => $per_page_num), 1);
                                            if ($_rets) {
                                                $topic_list = $this->TopicLogic->Get($_rets['ids']);
                                                $total_record = $_rets['count'];
                                                $page_arr = $_rets['page'];
                                                unset($_rets);
                                            }
                                            $topic_list_get = true;
                                        }
                                        if ('tocomment' == $this->Get['type']) {
                                            $tpl = 'topic_myblog';
                                            $title = $member['gender_ta'] . '评论的';
                                            $topic_selected = 'mycomment';
                                            unset($options['uid']);
                                            $options['where'] = "`uid` = '{$member['uid']}' and `type` in ('both','reply')";
                                        }
                                        if ('vote' == $this->Get['type']) {
                                            $type = 'vote';
                                            $tpl = 'topic_vote';
                                            $perpage = $this->ShowConfig['vote']['list'];
                                            $perpage = empty($perpage) ? 20 : $perpage;
                                            $vote_where = ' 1 ';
                                            $filter = get_param('filter');
                                            if ($filter == 'joined') {
                                                $vids = jlogic('vote')->get_joined($member['uid']);
                                                if (!empty($vids)) {
                                                    $vote_where .= " AND `v`.`vid` IN(" . jimplode($vids) . ") ";
                                                } else {
                                                    $vote_where = ' 0 ';
                                                }
                                            } else {
                                                if ($filter == 'new_update') {
                                                    jlogic('member')->clean_new_remind('vote_new', $uid);
                                                    $vids = jlogic('vote')->get_joined($uid);
                                                    if (!empty($vids)) {
                                                        $vote_where .= " AND `v`.`vid` IN(" . jimplode($vids) . ") ";
                                                    }
                                                    $vote_where .= " OR `v`.`uid`='{$uid}' ";
                                                } else {
                                                    $vote_where .= " AND `v`.`uid`='{$uid}' ";
                                                    $filter = 'created';
                                                }
                                            }
                                            $vote_order_sql = ' ORDER BY lastvote DESC ';
                                            $vote_where .= " AND v.verify = 1";
                                            $param = array('where' => $vote_where, 'order' => $vote_order_sql, 'page' => true, 'perpage' => $perpage, 'page_url' => $options['page_url']);
                                            $vote_info = jlogic('vote')->find($param);
                                            $count = 0;
                                            $vote_list = array();
                                            $page_arr['html'] = '';
                                            $uid_ary = array();
                                            if (!empty($vote_info)) {
                                                $count = $vote_info['count'];
                                                $vote_list = $vote_info['vote_list'];
                                                $page_arr['html'] = $vote_info['page']['html'];
                                                $uid_ary = $vote_info['uids'];
                                            }
                                            if (!empty($uid_ary)) {
                                                $members = $this->TopicLogic->GetMember($uid_ary);
                                            }
                                            $topic_list_get = true;
                                        }
                                        if ('event' == $this->Get['type']) {
                                            $type = 'event';
                                            $tpl = 'topic_event';
                                            $filter = get_param('filter');
                                            $param = array('perpage' => "10", 'page' => true);
                                            $return = array();
                                            if ($filter == 'joined') {
                                                $this->Title = $member['nickname'] . "参与的活动";
                                                $param['where'] = " m.play = 1 and m.fid = '{$uid}' ";
                                                $param['order'] = " order by a.lasttime desc,a.app_num desc,a.posttime desc ";
                                                $param['page_url'] = $options['page_url'];
                                                $return = jlogic('event')->getEvents($param);
                                            } else {
                                                if ($filter == 'new_update') {
                                                    jlogic('member')->clean_new_remind('event_new', $uid);
                                                    $this->Title = "最近更新的活动";
                                                    $param['uid'] = $uid;
                                                    $param['page_url'] = $options['page_url'];
                                                    $return = jlogic('event')->getNewEvent($param);
                                                } else {
                                                    $filter = 'created';
                                                    $this->Title = $member['nickname'] . "的活动";
                                                    $param['where'] = " a.postman = '{$uid}' and a.verify = 1 ";
                                                    $param['order'] = " order by a.lasttime desc,a.app_num desc,a.posttime desc ";
                                                    $param['page_url'] = $options['page_url'];
                                                    $return = jlogic('event')->getEventInfo($param);
                                                }
                                            }
                                            $rs = $return['event_list'];
                                            $count = $return['count'];
                                            $page_arr = $return['page'];
                                            $topic_list_get = true;
                                        }
                                        if ('my_reply' == $this->Get['type']) {
                                            $title = $member['gender_ta'] . '评论的';
                                            if ($member['uid'] != MEMBER_ID) {
                                                $this->Messager("您无权查看该页面", null);
                                            }
                                        }
                                        if ('mydig' == $this->Get['type']) {
                                            if ($member['dig_new']) {
                                                jlogic('member')->clean_new_remind('dig_new', $member['uid']);
                                            }
                                        }
                                        if (in_array($this->Get['type'], array('pic', 'video', 'music', 'attach', 'mydig', 'mydigout', 'my_reply'))) {
                                            if ($this->Get['follow'] && 'my_reply' != $this->Get['type']) {
                                                $buddyids = get_buddyids($params['uid'], $this->Config['topic_myhome_time_limit']);
                                                if ($buddyids) {
                                                    $options['uid'] = $buddyids;
                                                }
                                            }
                                            $type = $dtype = $this->Get['type'];
                                            $options['get_list'] = 1;
                                            $getTypeTidReturn = $TopicListLogic->GetTypeTid($dtype, $options['uid'], $options);
                                            if (isset($getTypeTidReturn['list'])) {
                                                $topic_list = $getTypeTidReturn['list'];
                                                $total_record = $getTypeTidReturn['count'];
                                                $page_arr = $getTypeTidReturn['page'];
                                                $topic_list_get = true;
                                            } else {
                                                $options['tid'] = $getTypeTidReturn['tid'];
                                                $options['count'] = $getTypeTidReturn['count'];
                                                $options['limit'] = $per_page_num;
                                                if ($type == 'mydigout') {
                                                    $options['uid'] = array();
                                                }
                                                if ($type == 'mydig' || $type == 'mydigout') {
                                                    $options['order'] = ' lastdigtime DESC ';
                                                }
                                            }
                                        }
                                        if ('forward' == $this->Get['type'] || 'first' == $this->Get['type']) {
                                            $p = $options;
                                            $p['type'] = 'forward';
                                            if ('first' == $this->Get['type']) {
                                                $p['type'] = 'first';
                                            }
                                            $p['sql_order'] = ' `forwards` DESC, `dateline` DESC ';
                                            if (!$p['sql_order']) {
                                                $p['sql_order'] = ' `dateline` DESC ';
                                            }
                                            $_rets = jtable('member_topic')->get_tids($member['uid'], $p, 1);
                                            $total_record = $_rets['count'];
                                            $page_arr = $_rets['page'];
                                            $topic_list = $this->TopicLogic->Get($_rets['ids']);
                                            $topic_list_get = true;
                                        }
                                        if ('my_verify' == $this->Get['type']) {
                                            $title = '审核中的微博';
                                            if ('admin' != MEMBER_ROLE_TYPE) {
                                                if ($member['uid'] != MEMBER_ID) {
                                                    $this->Messager("您无权查看该页面", -1);
                                                }
                                            }
                                            $sql = "select count(*) as `total_record` from `" . TABLE_PREFIX . "topic_verify` where managetype = 0";
                                            $total_record = DB::result_first($sql);
                                            $page_arr = page($total_record, $per_page_num, $query_link, array('return' => "Array"));
                                            $sql = "select v.*\r\n\t\t\t\t\t\t\tfrom `" . TABLE_PREFIX . "topic_verify` v\r\n\r\n\t\t\t\t\t\t\twhere v.uid='{$uid}'\r\n\t\t\t\t\t\t\tand v.managetype = 0\r\n\t\t\t\t\t\t\torder by v.lastupdate desc {$page_arr['limit']}";
                                            $query = $this->DatabaseHandler->Query($sql);
                                            while (false != ($row = $query->GetRow())) {
                                                if ($row['id'] < 1) {
                                                    continue;
                                                }
                                                $row['tid'] = $row['id'];
                                                if ($row['longtextid']) {
                                                    $row['content'] = jlogic('longtext')->longtext($row['longtextid']);
                                                    unset($row['content2'], $row['longtextid']);
                                                }
                                                $topic_list[$row['id']] = $row;
                                            }
                                            $topic_list = $this->TopicLogic->MakeAll($topic_list);
                                            $topic_list_get = true;
                                        }
                                    }
                                    if ($this->Config['channel_enable']) {
                                        $myBuddyChannel = jlogic('channel')->mychannel($member['uid']);
                                    }
                                    $dateline = TIMESTAMP - 2592000;
                                    if (empty($this->Get['type']) || in_array($this->Get['type'], array('hot_reply', 'hot_forward', 'hot_dig'))) {
                                        $p = $options;
                                        $p['type'] = array('first', 'forward', 'both');
                                        if ($this->Get['type']) {
                                            if ('hot_reply' == $this->Get['type']) {
                                                $p['>@replys'] = 0;
                                                $p['>@dateline'] = $dateline;
                                                $p['sql_order'] = ' `replys` DESC, `dateline` DESC ';
                                            } elseif ('hot_forward' == $this->Get['type']) {
                                                $p['>@forwards'] = 0;
                                                $p['>@dateline'] = $dateline;
                                                $p['sql_order'] = ' `forwards` DESC, `dateline` DESC ';
                                            } elseif ('hot_dig' == $this->Get['type']) {
                                                $p['>@digcounts'] = 0;
                                                $p['>@dateline'] = $dateline;
                                                $p['sql_order'] = ' `digcounts` DESC, `dateline` DESC ';
                                            }
                                        }
                                        if (!$p['sql_order']) {
                                            $p['sql_order'] = ' `dateline` DESC ';
                                        }
                                        $_rets = jtable('member_topic')->get_tids($member['uid'], $p, 1);
                                        $total_record = $_rets['count'];
                                        $page_arr = $_rets['page'];
                                        $topic_list = $this->TopicLogic->Get($_rets['ids']);
                                        $topic_list_get = true;
                                        $credit = jconf::get('credits');
                                        foreach ($credit['ext'] as $key => $value) {
                                            $member['jifen'] .= $value['name'] . ':' . $member[$key] . ' ';
                                        }
                                        $title = '个人主页';
                                        foreach ($topic_list as $key => $val) {
                                            if ($val[uid] == 0 && $val['anonymous_data'][uid] != MEMBER_ID) {
                                                unset($topic_list[$key]);
                                            }
                                        }
                                    } elseif ($this->Get['type'] == 'search' && trim($this->Get['q'])) {
                                        $_rets = jtable('topic')->get_ids(array('uid' => $member['uid'], 'like@content' => '%' . trim(jget('q')) . '%', 'sql_order' => '`dateline` desc', 'page_num' => 10), 'tid', 1);
                                        $total_record = $_rets['count'];
                                        $page_arr = $_rets['page'];
                                        $topic_list = $this->TopicLogic->Get($_rets['ids']);
                                        $topic_list_get = true;
                                    }
                                    if ($member['uid'] != MEMBER_ID) {
                                        $title = "{$member['nickname']}的微博";
                                        $list_blacklist = is_blacklist($member['uid'], MEMBER_ID);
                                        $fg_code = 'hisblog';
                                        $this->_initTheme($member);
                                    } else {
                                        $title = '我的微博';
                                        $this->MetaKeywords = "{$member['nickname']}的微博";
                                    }
                                    $buddys = array();
                                    if (MEMBER_ID > 0 && $member['uid'] != MEMBER_ID) {
                                        $buddys = jlogic('buddy')->info($member['uid'], MEMBER_ID);
                                        $buddys['id'] = $buddys['touid'];
                                    }
                                } else {
                                    if ('qun' == $params['code']) {
                                        $tpl = 'topic_qun';
                                        $title = "我的" . $this->Config[changeword][weiqun];
                                        $qun_setting = $this->Config['qun_setting'];
                                        if (!$qun_setting['qun_open']) {
                                            $this->Messager("当前站点没有开放" . $this->Config[changeword][weiqun] . "功能", null);
                                        }
                                        if (0 != $GLOBALS['_J']['member']['qun_new']) {
                                            jlogic('member')->clean_new_remind('qun_new', MEMBER_ID);
                                        }
                                        $views = array('new', 'new_reply', 'my_reply', 'recd');
                                        $view = trim($this->Get['view']);
                                        if (!in_array($view, $views)) {
                                            $view = 'new';
                                        }
                                        $active[$view] = "current";
                                        $u = MEMBER_ID;
                                        if (false === ($my_qun_ids = cache_db('get', $cache_id = 'topic/' . $u . '-my_qun_ids'))) {
                                            $my_qun_ids = jtable('qun_user')->get_ids(array('uid' => $u), 'qid', 1);
                                            cache_db('set', $cache_id, $my_qun_ids, 300);
                                        }
                                        $qid_ary = $my_qun_ids['ids'];
                                        $join_qun_count = $my_qun_ids['count'];
                                        $qun_name = '';
                                        if (!empty($qid_ary) && $join_qun_count > 0) {
                                            $where_sql = " 1 ";
                                            $order_sql = " t.dateline DESC ";
                                            $jget_type = jget('type', 'txt');
                                            $jget_type = in_array($type, array('pic', 'video', 'music', 'vote')) ? $jget_type : '';
                                            if ($jget_type) {
                                                if ('pic' == $jget_type) {
                                                    $where_sql .= " AND t.`imageid` > 0 ";
                                                } else {
                                                    if ('video' == $jget_type) {
                                                        $where_sql .= " AND t.`videoid` > 0 ";
                                                    } else {
                                                        if ('music' == $jget_type) {
                                                            $where_sql .= " AND t.`musicid` > 0 ";
                                                        } else {
                                                            if ('vote' == $jget_type) {
                                                                $where_sql .= " AND t.item='vote' ";
                                                            } else {
                                                                $jget_type = '';
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            $topic_get_flg = false;
                                            if ($view == 'new') {
                                                $where_sql .= " AND tq.item_id IN(" . jimplode($qid_ary) . ") ";
                                            } else {
                                                if ($view == 'new_reply') {
                                                    $where_sql .= " AND tq.item_id IN(" . jimplode($qid_ary) . ") AND t.replys>0 ";
                                                    $order_sql = " t.lastupdate DESC ";
                                                } else {
                                                    if ($view == 'recd') {
                                                        $p = array('where' => " tr.recd >= 1 AND tr.item='qun' AND tr.item_id IN(" . jimplode($qid_ary) . ") ", 'perpage' => $options['perpage'], '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'];
                                                        }
                                                        $topic_get_flg = true;
                                                    }
                                                }
                                            }
                                            if (!$topic_get_flg) {
                                                $total_record = DB::result_first("SELECT COUNT(*)\r\n\t\t\t\t\t\t\t\t\t\t\t   FROM " . DB::table('topic') . " AS t\r\n\t\t\t\t\t\t\t\t\t\t\t   LEFT JOIN " . DB::table('topic_qun') . " AS tq\r\n\t\t\t\t\t\t\t\t\t\t\t   USING(tid)\r\n\t\t\t\t\t\t\t\t\t\t\t   WHERE {$where_sql}");
                                                if ($total_record > 0) {
                                                    $page_arr = page($total_record, $options['perpage'], $options['page_url'], array('return' => 'array'));
                                                    $query = DB::query("SELECT t.*\r\n\t\t\t\t\t\t\t\t\t\t\tFROM " . DB::table('topic') . " AS t\r\n\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table('topic_qun') . " AS tq\r\n\t\t\t\t\t\t\t\t\t\t\tUSING(tid)\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE {$where_sql}\r\n\t\t\t\t\t\t\t\t\t\t\tORDER BY {$order_sql}\r\n\t\t\t\t\t\t\t\t\t\t\t{$page_arr['limit']} ");
                                                    $topic_list = array();
                                                    while ($row = DB::fetch($query)) {
                                                        $topic_list[$row['tid']] = $row;
                                                    }
                                                    $topic_list = $this->TopicLogic->MakeAll($topic_list);
                                                }
                                            }
                                            if (0 != $GLOBALS['_J']['member']['qun_new']) {
                                                jlogic('member')->clean_new_remind('qun_new', MEMBER_ID);
                                            }
                                        }
                                        $showConfig = $this->ShowConfig;
                                        $recd_qun_limit = (int) $showConfig['page_r']['recd_qun'];
                                        if ($recd_qun_limit) {
                                            $cache_id = 'topic/hot_qun-' . $recd_qun_limit;
                                            if (false === ($hot_qun = cache_file('get', $cache_id))) {
                                                $sql = "select * from `" . TABLE_PREFIX . "qun`  where `recd` = 1 order by `member_num` desc limit {$recd_qun_limit}  ";
                                                $query = $this->DatabaseHandler->Query($sql);
                                                $hot_qun = array();
                                                $qunLogic = jlogic('qun');
                                                while (false != ($row = $query->GetRow())) {
                                                    $row['icon'] = $qunLogic->qun_avatar($row['qid'], 's');
                                                    $hot_qun[] = $row;
                                                }
                                                cache_file('set', $cache_id, $hot_qun, 3600);
                                            }
                                        }
                                        $topic_list_get = true;
                                    } else {
                                        if ('recd' == $params['code']) {
                                            $title = "官方推荐";
                                            $view = trim($this->Get['view']);
                                            $where_sql = '';
                                            if ($view == 'new_reply') {
                                                $where_sql = ' AND t.replys>0 ';
                                            } else {
                                                $view = 'all';
                                            }
                                            $active[$view] = 'current';
                                            $p = array('where' => ' tr.recd > 0 ' . $where_sql, 'perpage' => $options['perpage'], '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'];
                                            }
                                            $topic_list_get = true;
                                        } else {
                                            if ('cms' == $params['code']) {
                                                $title = "网站资讯";
                                                $param = array('perpage' => $options['perpage'], 'page_url' => $options['page_url']);
                                                $view = 'all';
                                                $active[$view] = 'current';
                                                $info = array();
                                                if ($this->Config['dedecms_enable'] && jconf::get('dedecms')) {
                                                    Load::logic("topic_cms");
                                                    $TopicCmsLogic = new TopicCmsLogic();
                                                    $info = $TopicCmsLogic->get_cms($param);
                                                    $cms_url = CMS_API_URL;
                                                }
                                                if (!empty($info)) {
                                                    $total_record = $info['count'];
                                                    $topic_list = $info['list'];
                                                    $page_arr = $info['page'];
                                                }
                                                $topic_list_get = true;
                                            } else {
                                                if ('bbs' == $params['code']) {
                                                    $title = "我的论坛";
                                                    $view = trim($this->Get['view']);
                                                    $where_sql = '';
                                                    if ($view == 'favorites') {
                                                        $where_sql = 'favorites';
                                                    } else {
                                                        if ($view == 'favorite') {
                                                            $where_sql = 'favorite';
                                                        } else {
                                                            if ($view == 'thread') {
                                                                $where_sql = 'thread';
                                                            } else {
                                                                if ($view == 'reply') {
                                                                    $where_sql = 'reply';
                                                                } else {
                                                                    if ($view == 'all') {
                                                                        $where_sql = 'all';
                                                                    } else {
                                                                        if ($this->Config['dzbbs_enable']) {
                                                                            $view = 'favorites';
                                                                            $where_sql = 'favorites';
                                                                        } else {
                                                                            $view = 'all';
                                                                            $where_sql = 'all';
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    $active[$view] = 'current';
                                                    $info = array();
                                                    $param = array('where' => $where_sql, 'perpage' => $options['perpage'], 'page_url' => $options['page_url']);
                                                    if ($this->Config['dzbbs_enable'] && jconf::get('dzbbs') || $this->Config['phpwind_enable'] && $this->Config['pwbbs_enable'] && jconf::get('phpwind')) {
                                                        Load::logic("topic_bbs");
                                                        $TopicBbsLogic = new TopicBbsLogic();
                                                        $info = $TopicBbsLogic->get_bbs($param);
                                                        $bbs_url = BBS_API_URL;
                                                    }
                                                    if (!empty($info)) {
                                                        $total_record = $info['count'];
                                                        $topic_list = $info['list'];
                                                        $page_arr = $info['page'];
                                                    }
                                                    $topic_list_get = true;
                                                } else {
                                                    if ('topicnew' == $params['code']) {
                                                        $title = '最新内容';
                                                        $options['where'] = '';
                                                        $params['orderby'] = $orderby = in_array($this->Get['orderby'], array('post', 'dig', 'mark')) ? $this->Get['orderby'] : 'dig';
                                                        if ($orderby == 'mark') {
                                                            $order = ' `lastupdate` DESC';
                                                        } elseif ($orderby == 'dig') {
                                                            $order = ' `lastdigtime` DESC';
                                                        } else {
                                                            $options['type'] = array('first', 'forward', 'both');
                                                            $order = ' `dateline` DESC';
                                                        }
                                                        $options['order'] = $order;
                                                        if ($this->Get["date"] && strtotime($this->Get["date"]) > 0) {
                                                            $dateline = strtotime($this->Get["date"]);
                                                            $options['where'] .= " `dateline` > '" . $dateline . "' and `dateline`<'" . ($dateline + 86400) . "'";
                                                        } else {
                                                            $this->Get["date"] = date("Y-m-d", TIMESTAMP);
                                                        }
                                                        if (empty($options['type'])) {
                                                            $options['type'] = get_topic_type();
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (!$topic_list_get) {
            if ($cache_time > 0 && !$options['tid']) {
                $cache_key = $cache_key ? $cache_key : "{$member['uid']}-topic-{$params['code']}-{$params['type']}-{$params['gid']}-{$params['qid']}-{$params['view']}";
                $options = $TopicListLogic->get_options($options, $cache_time, $cache_key);
            }
            $info = $TopicListLogic->get_data($options);
            $topic_list = array();
            $total_record = 0;
            if (!empty($info)) {
                $topic_list = $info['list'];
                $total_record = $info['count'];
                if ($info['page']) {
                    $page_arr = $info['page'];
                } else {
                    $page_arr = $getTypeTidReturn['page'];
                }
            }
        }
        $topic_list_count = 0;
        if ($topic_list) {
            if ($GLOBALS['_J']['config']['is_topic_user_follow'] && !$GLOBALS['_J']['disable_user_follow']) {
                $topic_list = jlogic('buddy')->follow_html2($topic_list);
            }
            $topic_list_count = count($topic_list);
            if (!$topic_parent_disable && ('bbs' != $this->Code || 'cms' != $this->Code)) {
                $parent_list = $this->TopicLogic->GetParentTopic($topic_list, 'mycomment' == $this->Code);
            }
            $relate_list = $this->TopicLogic->GetRelateTopic($topic_list);
        }
        if (!in_array($params['code'], array('bbs', 'cms'))) {
            $ajaxkey = array();
            $ajaxnum = 10;
            if (count($topic_list) > $ajaxnum) {
                $topic_keys = array_keys($topic_list);
                $topic_list = array_slice($topic_list, 0, $ajaxnum);
                array_splice($topic_keys, 0, $ajaxnum);
                $num = ceil(count($topic_keys) / $ajaxnum);
                for ($i = 0; $i < $num; $i++) {
                    if (count($topic_keys) > $ajaxnum) {
                        $topic_key = array_splice($topic_keys, 0, $ajaxnum);
                    } else {
                        $topic_key = $topic_keys;
                    }
                    $ajaxkey[] = base64_encode(serialize($topic_key));
                }
                $isloading = true;
            }
        }
        $group_list = $grouplist2 = array();
        $group_list = $this->_myGroup($member['uid']);
        $cut_num = 5;
        if ($group_list) {
            $group_count = count($group_list);
            if ($group_count > $cut_num) {
                $grouplist2 = array_slice($group_list, 0, $cut_num);
                $grouplist_more = array_slice($group_list, $cut_num);
                foreach ($grouplist_more as $key => $value) {
                    if ($value['id'] == $gid) {
                        $tmp = $grouplist2[$cut_num - 1];
                        $grouplist2[$cut_num - 1] = $value;
                        $grouplist_more[] = $tmp;
                        unset($grouplist_more[$key]);
                        break;
                    }
                }
                $group_list = $grouplist_more;
            } else {
                $grouplist2 = $group_list;
                $group_list = array();
            }
        }
        if (!$this->Config['acceleration_mode']) {
            $member_medal = $my_member ? $my_member : $member;
            if ($member_medal['medal_id']) {
                $medal_list = $this->_Medal($member_medal['medal_id'], $member_medal['uid']);
            }
        }
        $exp_return = user_exp($member_medal['level'], $member_medal['credits']);
        if ($exp_return['exp_width'] >= 1) {
            $exp_width = $exp_return['exp_width'];
        } else {
            $exp_width = 0;
        }
        $nex_exp_credit = $exp_return['nex_exp_credit'];
        $nex_level = $exp_return['nex_exp_level'];
        $this->Title || ($this->Title = $title);
        $tpl = $tpl ? $tpl : 'topic_index';
        if (in_array($tpl, array('topic_index', 'topic_myhome'))) {
            $tid = jlogic('buddy')->check_new_recd_topic(MEMBER_ID);
            if ($tid && $topic_list) {
                foreach ($topic_list as $key => $val) {
                    if ($tid == $val['tid']) {
                        unset($topic_list[$key]);
                    }
                }
            }
        }
        $albums = jlogic('image')->getalbum();
        include template($tpl);
    }
Пример #15
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');
 }
Пример #16
0
 function QunSearch()
 {
     $qun_setting = $this->Config['qun_setting'];
     if (!$qun_setting['qun_open']) {
         $this->Messager("当前站点没有开放" . $this->Config[changeword][weiqun] . "功能");
     }
     $perpage = 10;
     $q = trim($this->Get['q']);
     $q = get_safe_code($q);
     $gets = array('mod' => 'search', 'code' => 'qun', 'q' => $this->Get['q']);
     $page_url = 'index.php?' . url_implode($gets);
     $count = 0;
     if (!empty($q)) {
         $q = $this->_filterKeyword($q);
         $search_keyword = $q;
         $QunLogic = jlogic('qun');
         $where = ' gview_perm=0 AND ' . build_like_query('name', $q) . ' ';
         $order = " ORDER BY dateline DESC ";
         $cache_time = 3600;
         if ($cache_time > 0) {
             $cache_key = "qun-search-{$q}";
             if (false === ($qids = cache_db('mget', $cache_key))) {
                 $query = DB::query("SELECT `qid` FROM " . DB::table('qun') . " WHERE {$where} {$order} LIMIT {$this->cache_ids_limit} ");
                 $qids = array();
                 while (false != ($row = DB::fetch($query))) {
                     $qids[$row['qid']] = $row['qid'];
                 }
                 cache_db('mset', $cache_key, $qids, $cache_time);
             }
             $where = $qids ? " `gview_perm`='0' AND `qid` IN ('" . implode("','", $qids) . "') " : "";
         }
         $qun_list = array();
         if ($where) {
             $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('qun') . " WHERE {$where}");
             if ($count > 0) {
                 $page_arr = page($count, $perpage, $page_url, array('return' => 'array'));
                 $query = DB::query("SELECT * FROM " . DB::table('qun') . " WHERE {$where} {$order} {$page_arr['limit']}");
                 while ($value = DB::fetch($query)) {
                     if (empty($value['icon'])) {
                         $value['icon'] = $QunLogic->qun_avatar($value['qid'], 's');
                     }
                     $value['dateline'] = my_date_format2($value['dateline']);
                     $qun_list[] = $value;
                 }
             }
         }
     }
     $member = jsg_member_info(MEMBER_ID);
     if ($member['medal_id']) {
         $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     $this->Title = $this->Config[changeword][weiqun] . '搜索';
     include template('social/search_list');
 }
Пример #17
0
 function index()
 {
     $config = jconf::get('talk');
     if (!$config) {
         $setting = true;
         include template('admin/talk');
     } else {
         $per_page_num = min(500, max(20, (int) (isset($_GET['pn']) ? $_GET['pn'] : $_GET['per_page_num'])));
         $gets = array('mod' => 'talk', 'pn' => $this->Get['pn']);
         $page_url = 'admin.php?' . url_implode($gets);
         $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table("talk"));
         $list = array();
         if ($count) {
             $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array'), '20 50 100 200,500');
             $query = DB::query("SELECT *\r\n\t\t\t\t\t\t\t\tFROM " . DB::table("talk") . "\r\n\t\t\t\t\t\t\t\tORDER BY lid DESC\r\n\t\t\t\t\t\t\t\t{$page_arr['limit']}");
             $lids = array();
             while ($value = DB::fetch($query)) {
                 $value['datetime'] = date('Y-m-d H:i', $value['starttime']) . ':' . date('Y-m-d H:i', $value['endtime']);
                 $lids[] = $value['lid'];
                 $list[$value['lid']] = $value;
             }
             $guestall = $this->TalkLogic->Getguest($lids);
             foreach ($guestall as $key => $val) {
                 $h = '';
                 foreach ($val['guest'] as $k => $v) {
                     $h .= $v['nickname'] . ' ';
                 }
                 $list[$key]['guests'] = $h;
             }
         }
         include template('admin/talk_index');
     }
 }
Пример #18
0
    if (C::t('user_field')->update($_G['uid'], array('applist' => implode(',', $applist)))) {
        echo json_encode_gbk(array('msg' => 'success'));
        exit;
    } else {
        echo json_encode_gbk(array('error' => '应用安装失败'));
        exit;
    }
}
//获取所有标签top10;
$tags = DB::fetch_all("SELECT * FROM %t WHERE hot>0 ORDER BY HOT DESC limit 100", array('app_tag'));
$keyword = trim($_GET['keyword']);
$tagid = intval($_GET['tagid']);
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
$perpage = 20;
$gets = array('mod' => 'market', 'keyword' => $keyword, 'tagid' => $tagid);
$theurl = DZZSCRIPT . "?" . url_implode($gets);
$refer = urlencode($theurl . '&page=' . $page);
$order = 'ORDER BY disp';
$start = ($page - 1) * $perpage;
$apps = array();
$sql = 'isshow>0 and available>0 and hideInMarket<1';
if ($keyword) {
    $sql .= " and appname like '%{$keyword}%' or vendor like '%{$keyword}%'";
} elseif ($tagid) {
    $appids = C::t('app_relative')->fetch_appids_by_tagid($tagid);
    $sql .= " and appid IN (" . dimplode($appids) . ")";
}
//获取用户所在组的应用
if (!$_G['uid']) {
    //游客
    $sql .= " and (`group`='-1' OR `group`='0')";
Пример #19
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");
 }
Пример #20
0
 function goodsinfo()
 {
     $id = jget('id');
     $info = jlogic('mall')->get_info($id);
     if ($info) {
         $config = jconf::get('mall');
         $member = jsg_member_info(MEMBER_ID);
         if ($info['expire'] < TIMESTAMP) {
             $info['exp'] = '商品已过期';
         } elseif ($info['price'] > $member[$config['credits']]) {
             $info['exp'] = '您的' . $config['credits_name'] . '不够';
         } elseif ($info['credit'] > $member['credits']) {
             $info['exp'] = '您的总积分不够';
         } else {
             $info['exp'] = '';
         }
         $info['expire'] = my_date_format($info['expire']);
         $info['desc'] = nl2br($info['desc']);
         $this->Title = '商品详情 —— ' . $info['name'];
         $this->MetaKeywords = '积分兑换,商品详情';
         $this->MetaDescription = $info['name'];
         $top_credit_members = jlogic('mall')->get_top_member_credits();
         $feeds = jlogic('feed')->get_feed(5, "`action`='兑换了'");
         $css['mall'] = ' class="current"';
         $this->item = 'mall';
         $this->item_id = $id;
         $h_key = 'mall';
         $gets = array('mod' => 'mall', 'code' => 'goodsinfo', 'id' => $id);
         $page_url = 'index.php?' . url_implode($gets);
         $tids = jlogic('mall')->get_topic_by_goodsid($id);
         $options = array('tid' => $tids, 'perpage' => 5, 'page_url' => $page_url);
         $topic_info = jlogic('topic_list')->get_data($options);
         $topic_list = array();
         if (!empty($topic_info)) {
             $topic_list = $topic_info['list'];
             $page_arr['html'] = $topic_info['page']['html'];
         }
         $albums = jlogic('image')->getalbum();
         include template('mall_info');
     } else {
         header('Location: ' . jurl('index.php?mod=mall'));
     }
 }
Пример #21
0
 function tag()
 {
     $sort = intval(trim($this->Get['sort']));
     $tag_id = intval(trim($this->Get['tag_id']));
     if (empty($tag_id)) {
         $this->Messager("当前标签不存在或者已经被删除了");
     }
     $tag_info = $this->QunLogic->get_tag_info($tag_id);
     if (empty($tag_info)) {
         $this->Messager("当前标签不存在或者已经被删除了");
     }
     $perpage = 10;
     $gets = array('mod' => 'qun', 'code' => 'tag', 'tag_id' => $tag_id, 'sort' => $this->Get['sort']);
     $page_url = 'index.php?' . url_implode($gets);
     $where_sql = " tag_id='{$tag_id}' AND gview_perm=0 ";
     $order_sql = ' ';
     if ($sort == 2) {
         $order_sql = ' q.thread_num DESC ';
     } else {
         if ($sort == 3) {
             $order_sql = ' q.dateline DESC ';
         } else {
             $sort = 1;
             $order_sql = ' q.member_num DESC ';
         }
     }
     $active_sort[$sort] = 'class="on"';
     $count = DB::result_first("SELECT COUNT(*)\r\n\t\t\t\t\t\t\t\t   FROM " . DB::table('qun') . " AS q\r\n\t\t\t\t\t\t\t\t   LEFT JOIN " . DB::table('qun_tag_fields') . " AS qtf\r\n\t\t\t\t\t\t\t\t   USING(qid)\r\n\t\t\t\t\t\t\t\t   WHERE {$where_sql} ");
     $qun_list = array();
     if ($count) {
         $_config = array('return' => 'array');
         $page_arr = page($count, $perpage, $page_url, $_config);
         $query = DB::query("SELECT q.*\r\n\t\t\t\t\t\t\t\tFROM " . DB::table('qun') . " AS q\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table('qun_tag_fields') . " AS qtf\r\n\t\t\t\t\t\t\t\tUSING(qid)\r\n\t\t\t\t\t\t\t\tWHERE {$where_sql} ");
         while ($value = DB::fetch($query)) {
             $value['icon'] = $this->QunLogic->qun_avatar($value['qid'], 's');
             $value['dateline'] = my_date_format($value['dateline'], 'Y-m-d H:i');
             $qun_list[] = $value;
         }
         $this->_get_ql_tag($qun_list);
     }
     $member =& $this->my;
     $joined_nums = $this->QunLogic->joined_nums(MEMBER_ID);
     $title = "所有使用“{$tag_info['tag_name']}”标签的" . $this->Config[changeword][weiqun] . "列表";
     $this->Title = $title;
     include_once template('qun/tag_list');
 }
Пример #22
0
    $page = 1;
}
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
$_G['gp_order'] = in_array($_G['gp_order'], array('dateline', 'hot')) ? $_G['gp_order'] : 'dateline';
if (empty($_GET['view'])) {
    $_GET['view'] = 'we';
}
$perpage = 20;
$perpage = mob_perpage($perpage);
$start = ($page - 1) * $perpage;
ckstart($start, $perpage);
$list = array();
$userlist = array();
$count = $pricount = 0;
$gets = array('mod' => 'space', 'uid' => $space['uid'], 'do' => 'poll', 'view' => $_GET['view'], 'order' => $_G['gp_order'], 'fuid' => $_GET['fuid'], 'filter' => $_G['gp_filter'], 'searchkey' => $_GET['searchkey']);
$theurl = 'home.php?' . url_implode($gets);
$multi = '';
$wheresql = '1';
$f_index = '';
$ordersql = 't.dateline DESC';
$need_count = true;
if ($_GET['view'] == 'all') {
    if ($_G['gp_order'] == 'hot') {
        $wheresql .= " AND t.replies>='{$minhot}'";
        $orderactives = array('hot' => ' class="a"');
    } else {
        $orderactives = array('dateline' => ' class="a"');
    }
} elseif ($_GET['view'] == 'me') {
    $filter = in_array($_G['gp_filter'], array('publish', 'join')) ? $_G['gp_filter'] : 'publish';
    if ($filter == 'join') {
Пример #23
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');
 }