Exemplo n.º 1
0
 private function _getResult($res, $aid, $page)
 {
     require_once DISCUZ_ROOT . './source/function/function_home.php';
     require_once DISCUZ_ROOT . './source/function/function_portal.php';
     loadcache('portalcategory');
     global $_G;
     // 在DISCUZ_ROOT/source/module/portal/portal_view.php基础上二次开发
     if (empty($aid)) {
         return $this->makeErrorInfo($res, lang('message', 'view_no_article_id'));
     }
     $article = C::t('portal_article_title')->fetch($aid);
     require_once libfile('function/portalcp');
     $categoryperm = getallowcategory($_G['uid']);
     if (empty($article) || $article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($categoryperm[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_GET['modarticlekey'] != modauthkey($article['aid'])) {
         return $this->makeErrorInfo($res, lang('message', 'view_article_no_exist'));
     }
     // if(!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['article']) && empty($_G['cache']['portalcategory'][$article['catid']]['noantitheft'])) {
     //     helper_antitheft::check($aid, 'aid');
     // }
     $res['body']['newsInfo'] = $this->_getNewsInfo($article, $page);
     return $res;
 }
Exemplo n.º 2
0
function loadforum()
{
    global $_G;
    $tid = intval(getgpc('tid'));
    $fid = getgpc('fid');
    if (!$fid && getgpc('gid')) {
        $fid = intval(getgpc('gid'));
    }
    /*vot*/
    if (!empty($_G['gp_archiver'])) {
        //Archiver X1.5 compatible
        if ($fid) {
            dheader('location: archiver/?fid-' . $fid . '.html');
        } elseif ($tid) {
            dheader('location: archiver/?tid-' . $tid . '.html');
        } else {
            dheader('location: archiver/');
        }
    }
    if (defined('IN_ARCHIVER') && $_G['setting']['archiverredirect'] && !IS_ROBOT) {
        dheader('location: ../forum.php' . ($_G['mod'] ? '?mod=' . $_G['mod'] . (!empty($_GET['fid']) ? '&fid=' . $_GET['fid'] : (!empty($_GET['tid']) ? '&tid=' . $_GET['tid'] : '')) : ''));
    }
    if ($_G['setting']['forumpicstyle']) {
        $_G['setting']['forumpicstyle'] = unserialize($_G['setting']['forumpicstyle']);
        empty($_G['setting']['forumpicstyle']['thumbwidth']) && ($_G['setting']['forumpicstyle']['thumbwidth'] = 214);
        empty($_G['setting']['forumpicstyle']['thumbheight']) && ($_G['setting']['forumpicstyle']['thumbheight'] = 160);
    } else {
        $_G['setting']['forumpicstyle'] = array('thumbwidth' => 214, 'thumbheight' => 160);
    }
    if ($fid) {
        $fid = is_numeric($fid) ? intval($fid) : (!empty($_G['setting']['forumfids'][$fid]) ? $_G['setting']['forumfids'][$fid] : 0);
    }
    $modthreadkey = isset($_G['gp_modthreadkey']) && $_G['gp_modthreadkey'] == modauthkey($tid) ? $_G['gp_modthreadkey'] : '';
    $_G['forum_auditstatuson'] = $modthreadkey ? true : false;
    $accessadd1 = $accessadd2 = $modadd1 = $modadd2 = $metadescription = $hookscriptmessage = '';
    $adminid = $_G['adminid'];
    if ($_G['uid']) {
        if ($_G['member']['accessmasks']) {
            $accessadd1 = ', a.allowview, a.allowpost, a.allowreply, a.allowgetattach, a.allowgetimage, a.allowpostattach, a.allowpostimage';
            /*vot*/
            $accessadd2 = "LEFT JOIN " . DB::table('forum_access') . " a ON (a.uid='{$_G['uid']}' AND a.fid=f.fid)";
        }
        if ($adminid == 3) {
            $modadd1 = ', m.uid AS ismoderator';
            /*vot*/
            $modadd2 = "LEFT JOIN " . DB::table('forum_moderator') . " m ON (m.uid='{$_G['uid']}' AND m.fid=f.fid)";
        }
    }
    if (!empty($tid) || !empty($fid)) {
        if (!empty($tid)) {
            $archiveid = !empty($_G['gp_archiveid']) ? intval($_G['gp_archiveid']) : null;
            $_G['thread'] = get_thread_by_tid($tid, '*', '', $archiveid);
            if (!$_G['forum_auditstatuson'] && !empty($_G['thread']) && !($_G['thread']['displayorder'] >= 0 || in_array($_G['thread']['displayorder'], array(-4, -3, -2)) && $_G['thread']['authorid'] == $_G['uid'])) {
                $_G['thread'] = null;
            }
            $_G['forum_thread'] =& $_G['thread'];
            if (empty($_G['thread'])) {
                $fid = $tid = 0;
            } else {
                $fid = $_G['thread']['fid'];
                $tid = $_G['thread']['tid'];
            }
        }
        if ($fid) {
            $forum = DB::fetch_first("SELECT f.fid, f.*, ff.* {$accessadd1} {$modadd1}, f.fid AS fid\r\n\t\t\tFROM " . DB::table('forum_forum') . " f\r\n\t\t\tLEFT JOIN " . DB::table("forum_forumfield") . " ff ON ff.fid=f.fid {$accessadd2} {$modadd2}\r\n\t\t\tWHERE f.fid='{$fid}'");
        }
        if ($forum) {
            $forum['ismoderator'] = !empty($forum['ismoderator']) || $adminid == 1 || $adminid == 2 ? 1 : 0;
            $fid = $forum['fid'];
            $gorup_admingroupids = $_G['setting']['group_admingroupids'] ? unserialize($_G['setting']['group_admingroupids']) : array('1' => '1');
            if ($forum['status'] == 3) {
                if (!$_G['setting']['groupstatus']) {
                    showmessage('group_status_off');
                }
                if (!empty($forum['moderators'])) {
                    $forum['moderators'] = unserialize($forum['moderators']);
                } else {
                    require_once libfile('function/group');
                    $forum['moderators'] = update_groupmoderators($fid);
                }
                if ($_G['uid'] && $_G['adminid'] != 1) {
                    $forum['ismoderator'] = !empty($forum['moderators'][$_G['uid']]) ? 1 : 0;
                    $_G['adminid'] = 0;
                    if ($forum['ismoderator'] || $gorup_admingroupids[$_G['groupid']]) {
                        $_G['adminid'] = $_G['adminid'] ? $_G['adminid'] : 3;
                        if (!empty($gorup_admingroupids[$_G['groupid']])) {
                            $forum['ismoderator'] = 1;
                            $_G['adminid'] = 2;
                        }
                        $group_userperm = unserialize($_G['setting']['group_userperm']);
                        if (is_array($group_userperm)) {
                            $_G['group'] = array_merge($_G['group'], $group_userperm);
                            $_G['group']['allowmovethread'] = $_G['group']['allowcopythread'] = $_G['group']['allowedittypethread'] = 0;
                        }
                    }
                }
            }
            foreach (array('threadtypes', 'threadsorts', 'creditspolicy', 'modrecommend') as $key) {
                $forum[$key] = !empty($forum[$key]) ? unserialize($forum[$key]) : array();
                if (!is_array($forum[$key])) {
                    $forum[$key] = array();
                }
            }
            if ($forum['status'] == 3) {
                $_G['isgroupuser'] = 0;
                $_G['basescript'] = 'group';
                if (empty($forum['level'])) {
                    $levelid = DB::result_first("SELECT levelid FROM " . DB::table('forum_grouplevel') . " WHERE creditshigher<='{$forum['commoncredits']}' AND '{$forum['commoncredits']}'<creditslower LIMIT 1");
                    $forum['level'] = $levelid;
                    DB::query("UPDATE " . DB::table('forum_forum') . " SET level='{$levelid}' WHERE fid='{$fid}'");
                }
                loadcache('grouplevels');
                $grouplevel = $_G['grouplevels'][$forum['level']];
                if (!empty($grouplevel['icon'])) {
                    $valueparse = parse_url($grouplevel['icon']);
                    if (!isset($valueparse['host'])) {
                        $grouplevel['icon'] = $_G['setting']['attachurl'] . 'common/' . $grouplevel['icon'];
                    }
                }
                $group_postpolicy = $grouplevel['postpolicy'];
                if (is_array($group_postpolicy)) {
                    $forum = array_merge($forum, $group_postpolicy);
                }
                $forum['allowfeed'] = $_G['setting']['group_allowfeed'];
                if ($_G['uid']) {
                    if (!empty($forum['moderators'][$_G['uid']])) {
                        $_G['isgroupuser'] = 1;
                    } else {
                        $_G['isgroupuser'] = DB::result_first("SELECT level FROM " . DB::table('forum_groupuser') . " WHERE fid='{$fid}' AND uid='{$_G['uid']}' LIMIT 1");
                        if ($_G['isgroupuser'] <= 0 && empty($forum['ismoderator'])) {
                            $_G['group']['allowrecommend'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowrecommend'] = 0;
                            $_G['group']['allowcommentpost'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowcommentpost'] = 0;
                            $_G['group']['allowcommentitem'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowcommentitem'] = 0;
                            $_G['group']['raterange'] = $_G['cache']['usergroup_' . $_G['groupid']]['raterange'] = array();
                            $_G['group']['allowvote'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowvote'] = 0;
                        } else {
                            $_G['isgroupuser'] = 1;
                        }
                    }
                }
            }
        } else {
            $fid = 0;
        }
    }
    $_G['fid'] = $fid;
    $_G['tid'] = $tid;
    $_G['forum'] =& $forum;
    $_G['current_grouplevel'] =& $grouplevel;
    if (isset($_G['cookie']['widthauto']) && $_G['setting']['switchwidthauto'] && empty($_G['forum']['widthauto'])) {
        $_G['forum_widthauto'] = $_G['cookie']['widthauto'] > 0;
    } else {
        $_G['forum_widthauto'] = empty($_G['forum']['widthauto']) ? !$_G['setting']['allowwidthauto'] : $_G['forum']['widthauto'] > 0;
        if (!empty($_G['forum']['widthauto'])) {
            $_G['setting']['switchwidthauto'] = 0;
        }
    }
}
Exemplo n.º 3
0
 require_once libfile('function/misc');
 while ($comment = DB::fetch($query)) {
     $comment['dateline'] = dgmdate($comment['dateline']);
     $short_desc = cutstr($comment['message'], 75);
     if ($showcensor) {
         $censor->check($short_desc);
         $censor->check($comment['message']);
     }
     $comment_censor_words = $censor->words_found;
     if (count($comment_censor_words) > 3) {
         $comment_censor_words = array_slice($comment_censor_words, 0, 3);
     }
     $comment['censorwords'] = implode(', ', $comment_censor_words);
     $comment['ip'] = $comment['ip'] . ' - ' . convertip($comment['ip']);
     $comment['modkey'] = modauthkey($comment['id']);
     $comment['modcommentkey'] = modauthkey($comment['cid']);
     if (count($comment_censor_words)) {
         $comment_censor_text = "<span style=\"color: red;\">({$comment['censorwords']})</span>";
     } else {
         $comment_censor_text = lang('admincp', 'no_censor_word');
     }
     $viewurl = '';
     $commenttype = '';
     $editurl = "home.php?mod=spacecp&ac=comment&op=edit&cid={$comment['cid']}&modcommentkey={$comment['modcommentkey']}";
     switch ($comment['idtype']) {
         case 'uid':
             $commenttype = lang('admincp', 'comment_uid');
             $viewurl = "home.php?mod=space&uid={$comment['uid']}&do=wall#comment_anchor_{$comment['cid']}";
             break;
         case 'blogid':
             $commenttype = lang('admincp', 'comment_blogid');
Exemplo n.º 4
0
    $message = getstr($_POST['message'], 0, 0, 0, 2);
    $cid = empty($_POST['cid']) ? 0 : intval($_POST['cid']);
    if (strlen($message) < 2) {
        showmessage('content_is_too_short', '', array(), array());
    }
    require_once libfile('function/comment');
    $cidarr = add_comment($message, $id, $idtype, $cid);
    if ($cidarr['cid'] != 0) {
        showmessage($cidarr['msg'], dreferer(), $cidarr['magvalues'], $_GET['quickcomment'] ? array('msgtype' => 3, 'showmsg' => true) : array('showdialog' => 3, 'showmsg' => true, 'closetime' => true));
    } else {
        showmessage('no_privilege_comment', '', array(), array('return' => true));
    }
}
$cid = empty($_GET['cid']) ? 0 : intval($_GET['cid']);
if ($_GET['op'] == 'edit') {
    if ($_G['adminid'] != 1 && $_GET['modcommentkey'] != modauthkey($_GET['cid'])) {
        $authorid = intval($_G['uid']);
    } else {
        $authorid = '';
    }
    if (!($comment = C::t('home_comment')->fetch($cid, $authorid))) {
        showmessage('no_privilege_comment_edit');
    }
    if (submitcheck('editsubmit')) {
        $message = getstr($_POST['message'], 0, 0, 0, 2);
        if (strlen($message) < 2) {
            showmessage('content_is_too_short');
        }
        $message = censor($message);
        if (censormod($message)) {
            $comment_status = 1;
Exemplo n.º 5
0
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: portal_view.php 33660 2013-07-29 07:51:05Z nemohou $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
if (empty($aid)) {
    showmessage('view_no_article_id');
}
$article = C::t('portal_article_title')->fetch($aid);
require_once libfile('function/portalcp');
$categoryperm = getallowcategory($_G['uid']);
if (empty($article) || $article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($categoryperm[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_GET['modarticlekey'] != modauthkey($article['aid'])) {
    showmessage('view_article_no_exist');
}
if (!empty($_G['setting']['antitheft']['allow']) && empty($_G['setting']['antitheft']['disable']['article']) && empty($_G['cache']['portalcategory'][$article['catid']]['noantitheft'])) {
    helper_antitheft::check($aid, 'aid');
}
if (!empty($_G['setting']['makehtml']['flag']) && $article['htmlmade'] && !isset($_G['makehtml']) && empty($_GET['diy']) && empty($article['url'])) {
    dheader('location:' . fetch_article_url($article));
}
$article_count = C::t('portal_article_count')->fetch($aid);
if ($article_count) {
    $article = array_merge($article_count, $article);
}
if ($article_count) {
    C::t('portal_article_count')->increase($aid, array('viewnum' => 1));
    unset($article_count);
Exemplo n.º 6
0
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$minhot = $_G['setting']['feedhotmin'] < 1 ? 3 : $_G['setting']['feedhotmin'];
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
if ($page < 1) {
    $page = 1;
}
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
$_G['colorarray'] = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282');
if ($id) {
    $blog = array_merge(C::t('home_blog')->fetch($id), C::t('home_blogfield')->fetch($id));
    if ($blog['uid'] != $space['uid']) {
        $blog = null;
    }
    if (!(!empty($blog) && ($blog['status'] == 0 || $blog['uid'] == $_G['uid'] || $_G['adminid'] == 1 || $_GET['modblogkey'] == modauthkey($blog['blogid'])))) {
        showmessage('view_to_info_did_not_exist');
    }
    if (!ckfriend($blog['uid'], $blog['friend'], $blog['target_ids'])) {
        require_once libfile('function/friend');
        $isfriend = friend_check($blog['uid']);
        space_merge($space, 'count');
        space_merge($space, 'profile');
        $_G['privacy'] = 1;
        require_once libfile('space/profile', 'include');
        include template('home/space_privacy');
        exit;
    } elseif (!$space['self'] && $blog['friend'] == 4 && $_G['adminid'] != 1) {
        $cookiename = "view_pwd_blog_{$blog['blogid']}";
        $cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
        if ($cookievalue != md5(md5($blog['password']))) {
Exemplo n.º 7
0
    $query = DB::query("SELECT * FROM " . DB::table('portal_comment') . " WHERE cid='{$cid}'");
    $comment = DB::fetch($query);
}
if ($_GET['op'] == 'requote') {
    if (!empty($comment['message'])) {
        include_once libfile('class/bbcode');
        $bbcode =& bbcode::instance();
        $comment['message'] = $bbcode->html2bbcode($comment['message']);
        $comment['message'] = preg_replace("/\\[quote\\].*?\\[\\/quote\\]/is", '', $comment['message']);
        $comment['message'] = getstr($comment['message'], 150, 0, 0, 2, -1);
    }
} elseif ($_GET['op'] == 'edit') {
    if (empty($comment)) {
        showmessage('comment_edit_noexist');
    }
    if (!$_G['group']['allowmanagearticle'] && $_G['uid'] != $comment['uid'] && $_G['adminid'] != 1 && $_G['gp_modarticlecommentkey'] != modauthkey($comment['cid']) || $_G['groupid'] == '7') {
        showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
    }
    if (submitcheck('editsubmit')) {
        $message = getstr($_POST['message'], 0, 1, 1, 2);
        if (strlen($message) < 2) {
            showmessage('content_is_too_short');
        }
        $message = censor($message);
        if (censormod($message)) {
            $comment_status = 1;
        } else {
            $comment_status = 0;
        }
        DB::update('portal_comment', array('message' => $message, 'status' => $comment_status), array('cid' => $comment['cid']));
        showmessage('do_success', dreferer());
Exemplo n.º 8
0
function loadforum()
{
    global $_G;
    $tid = intval(getgpc('tid'));
    $fid = getgpc('fid');
    if ($fid) {
        $fid = is_numeric($fid) ? intval($fid) : (!empty($_G['setting']['forumfids'][$fid]) ? $_G['setting']['forumfids'][$fid] : 0);
    }
    $modthreadkey = isset($_G['gp_modthreadkey']) && $_G['gp_modthreadkey'] == modauthkey($tid) ? $_G['gp_modthreadkey'] : '';
    $_G['forum_auditstatuson'] = $modthreadkey ? true : false;
    $accessadd1 = $accessadd2 = $modadd1 = $modadd2 = $metadescription = $hookscriptmessage = '';
    $adminid = $_G['adminid'];
    if ($_G['uid']) {
        if ($_G['member']['accessmasks']) {
            $accessadd1 = ', a.allowview, a.allowpost, a.allowreply, a.allowgetattach, a.allowpostattach, a.allowpostimage';
            $accessadd2 = "LEFT JOIN " . DB::table('forum_access') . " a ON a.uid='{$_G['uid']}' AND a.fid=f.fid";
        }
        if ($adminid == 3) {
            $modadd1 = ', m.uid AS ismoderator';
            $modadd2 = "LEFT JOIN " . DB::table('forum_moderator') . " m ON m.uid='{$_G['uid']}' AND m.fid=f.fid";
        }
    }
    if (!empty($tid) || !empty($fid)) {
        if (empty($tid)) {
            $forum = DB::fetch_first("SELECT f.fid, f.*, ff.* {$accessadd1} {$modadd1}, f.fid AS fid\r\n\t\t\tFROM " . DB::table('forum_forum') . " f\r\n\t\t\tLEFT JOIN " . DB::table("forum_forumfield") . " ff ON ff.fid=f.fid {$accessadd2} {$modadd2}\r\n\t\t\tWHERE f.fid='{$fid}'");
        } else {
            loadcache('threadtableids');
            $threadtableids = array(0);
            if (!empty($_G['cache']['threadtableids'])) {
                $threadtableids = array_merge($threadtableids, $_G['cache']['threadtableids']);
            }
            $archiveid = intval($_REQUEST['archiveid']);
            if (!empty($archiveid) && in_array($archiveid, $threadtableids)) {
                $threadtable = $archiveid ? "forum_thread_{$archiveid}" : 'forum_thread';
                $forum = DB::fetch_first("SELECT t.tid, t.closed," . (defined('SQL_ADD_THREAD') ? SQL_ADD_THREAD : '') . " f.*, ff.* {$accessadd1} {$modadd1}, f.fid AS fid\r\n\t\t\t\t\tFROM " . DB::table($threadtable) . " t\r\n\t\t\t\t\tINNER JOIN " . DB::table('forum_forum') . " f ON f.fid=t.fid\r\n\t\t\t\t\tLEFT JOIN " . DB::table('forum_forumfield') . " ff ON ff.fid=f.fid {$accessadd2} {$modadd2}\r\n\t\t\t\t\tWHERE t.tid='{$tid}'" . ($_G['forum_auditstatuson'] ? '' : " AND (t.displayorder>='0' OR (t.displayorder IN ('-4', '-3', '-2') AND t.authorid='{$_G['uid']}'))") . " LIMIT 1");
                $forum['threadtableid'] = $archiveid;
            } else {
                foreach ($threadtableids as $tableid) {
                    $threadtable = $tableid ? "forum_thread_{$tableid}" : 'forum_thread';
                    $forum = DB::fetch_first("SELECT t.tid, t.closed," . (defined('SQL_ADD_THREAD') ? SQL_ADD_THREAD : '') . " f.*, ff.* {$accessadd1} {$modadd1}, f.fid AS fid\r\n\t\t\t\t\tFROM " . DB::table($threadtable) . " t\r\n\t\t\t\t\tINNER JOIN " . DB::table('forum_forum') . " f ON f.fid=t.fid\r\n\t\t\t\t\tLEFT JOIN " . DB::table('forum_forumfield') . " ff ON ff.fid=f.fid {$accessadd2} {$modadd2}\r\n\t\t\t\t\tWHERE t.tid='{$tid}'" . ($_G['forum_auditstatuson'] ? '' : " AND (t.displayorder>='0' OR (t.displayorder IN ('-4', '-3', '-2') AND t.authorid='{$_G['uid']}'))") . " LIMIT 1");
                    if (!empty($forum)) {
                        $forum['threadtableid'] = $tableid;
                        break;
                    }
                }
            }
            $tid = $forum['tid'];
        }
        if ($forum) {
            $forum['ismoderator'] = !empty($forum['ismoderator']) || $adminid == 1 || $adminid == 2 ? 1 : 0;
            $fid = $forum['fid'];
            $gorup_admingroupids = $_G['setting']['group_admingroupids'] ? unserialize($_G['setting']['group_admingroupids']) : array('1' => '1');
            if ($forum['status'] == 3) {
                if (!$_G['setting']['groupstatus']) {
                    showmessage('group_status_off');
                }
                if (!empty($forum['moderators'])) {
                    $forum['moderators'] = unserialize($forum['moderators']);
                } else {
                    require_once libfile('function/group');
                    $forum['moderators'] = update_groupmoderators($fid);
                }
                if ($_G['uid'] && $_G['adminid'] != 1) {
                    $forum['ismoderator'] = !empty($forum['moderators'][$_G['uid']]) ? 1 : 0;
                    $_G['adminid'] = 0;
                    if ($forum['ismoderator'] || $gorup_admingroupids[$_G['groupid']]) {
                        $_G['adminid'] = $_G['adminid'] ? $_G['adminid'] : 3;
                        if (!empty($gorup_admingroupids[$_G['groupid']])) {
                            $forum['ismoderator'] = 1;
                            $_G['adminid'] = 2;
                        }
                        $group_userperm = unserialize($_G['setting']['group_userperm']);
                        if (is_array($group_userperm)) {
                            $_G['group'] = array_merge($_G['group'], $group_userperm);
                            $_G['group']['allowmovethread'] = $_G['group']['allowcopythread'] = $_G['group']['allowedittypethread'] = 0;
                        }
                    }
                }
            }
            foreach (array('threadtypes', 'threadsorts', 'creditspolicy', 'modrecommend') as $key) {
                $forum[$key] = !empty($forum[$key]) ? unserialize($forum[$key]) : array();
            }
            if ($forum['status'] == 3) {
                $_G['isgroupuser'] = 0;
                $_G['basescript'] = 'group';
                $_G['group']['allowstickthread'] = 1;
                if (empty($forum['level'])) {
                    $levelid = DB::result_first("SELECT levelid FROM " . DB::table('forum_grouplevel') . " WHERE creditshigher<='{$forum['commoncredits']}' AND '{$forum['commoncredits']}'<creditslower LIMIT 1");
                    $forum['level'] = $levelid;
                    DB::query("UPDATE " . DB::table('forum_forum') . " SET level='{$levelid}' WHERE fid='{$fid}'");
                }
                loadcache('grouplevels');
                $grouplevel = $_G['grouplevels'][$forum['level']];
                if (!empty($grouplevel['icon'])) {
                    $valueparse = parse_url($grouplevel['icon']);
                    if (!isset($valueparse['host'])) {
                        $grouplevel['icon'] = $_G['setting']['attachurl'] . 'common/' . $grouplevel['icon'];
                    }
                }
                $group_postpolicy = $grouplevel['postpolicy'];
                if (is_array($group_postpolicy)) {
                    $forum = array_merge($forum, $group_postpolicy);
                }
                $forum['allowfeed'] = $_G['setting']['group_allowfeed'];
                if ($_G['uid']) {
                    if (!empty($forum['moderators'][$_G['uid']])) {
                        $_G['isgroupuser'] = 1;
                    } else {
                        $_G['isgroupuser'] = DB::result_first("SELECT level FROM " . DB::table('forum_groupuser') . " WHERE fid='{$fid}' AND uid='{$_G['uid']}' LIMIT 1");
                        if ($_G['isgroupuser'] <= 0 && empty($forum['ismoderator'])) {
                            $_G['group']['allowrecommend'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowrecommend'] = 0;
                            $_G['group']['allowcommentpost'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowcommentpost'] = 0;
                            $_G['group']['allowcommentitem'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowcommentitem'] = 0;
                            $_G['group']['raterange'] = $_G['cache']['usergroup_' . $_G['groupid']]['raterange'] = array();
                            $_G['group']['allowvote'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowvote'] = 0;
                        } else {
                            $_G['isgroupuser'] = 1;
                        }
                    }
                }
            }
        } else {
            $fid = 0;
        }
    }
    $_G['fid'] = $fid;
    $_G['tid'] = $tid;
    $_G['forum'] =& $forum;
    $_G['current_grouplevel'] =& $grouplevel;
}
Exemplo n.º 9
0
 $censor =& discuz_censor::instance();
 $censor->highlight = '#FF0000';
 require_once libfile('function/misc');
 while ($blog = DB::fetch($query)) {
     $blog['dateline'] = dgmdate($blog['dateline']);
     $blog['subject'] = $blog['subject'] ? '<b>' . $blog['subject'] . '</b>' : '<i>' . $lang['nosubject'] . '</i>';
     if ($showcensor) {
         $censor->check($blog['subject']);
         $censor->check($blog['message']);
     }
     $blog_censor_words = $censor->words_found;
     if (count($post_censor_words) > 3) {
         $blog_censor_words = array_slice($blog_censor_words, 0, 3);
     }
     $blog['censorwords'] = implode(', ', $blog_censor_words);
     $blog['modblogkey'] = modauthkey($blog['blogid']);
     $blog['postip'] = $blog['postip'] . '-' . convertip($blog['postip']);
     if (count($blog_censor_words)) {
         $blog_censor_text = "<span style=\"color: red;\">({$blog['censorwords']})</span>";
     } else {
         $blog_censor_text = '';
     }
     showtagheader('tbody', '', true, 'hover');
     showtablerow("id=\"mod_{$blog['blogid']}_row1\"", array("id=\"mod_{$blog['blogid']}_row1_op\" rowspan=\"3\" class=\"rowform threadopt\" style=\"width:80px;\"", '', 'width="120"', 'width="120"', 'width="55"'), array("<ul class=\"nofloat\"><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$blog['blogid']}]\" id=\"mod_{$blog['blogid']}_1\" value=\"validate\" onclick=\"mod_setbg({$blog['blogid']}, 'validate');\"><label for=\"mod_{$blog['blogid']}_1\">{$lang['validate']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$blog['blogid']}]\" id=\"mod_{$blog['blogid']}_2\" value=\"delete\" onclick=\"mod_setbg({$blog['blogid']}, 'delete');\"><label for=\"mod_{$blog['blogid']}_2\">{$lang['delete']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$blog['blogid']}]\" id=\"mod_{$blog['blogid']}_3\" value=\"ignore\" onclick=\"mod_setbg({$blog['blogid']}, 'ignore');\"><label for=\"mod_{$blog['blogid']}_3\">{$lang['ignore']}</label></li></ul>", "<h3><a href=\"javascript:;\" onclick=\"display_toggle('{$blog['blogid']}');\">{$blog['subject']}</a> {$blog_censor_text}</h3><p>{$blog['postip']}</p>", $blog[classname], "<p><a target=\"_blank\" href=\"" . ADMINSCRIPT . "?action=members&operation=search&uid={$blog['uid']}&submit=yes\">{$blog['username']}</a></p> <p>{$blog['dateline']}</p>", "<a href=\"home.php?mod=space&uid={$blog['uid']}&do=blog&id={$blog['blogid']}&modblogkey={$blog['modblogkey']}\" target=\"_blank\">{$lang['view']}</a>&nbsp;<a href=\"home.php?mod=spacecp&ac=blog&blogid={$blog['blogid']}&modblogkey={$blog['modblogkey']}\" target=\"_blank\">{$lang['edit']}</a>"));
     showtablerow("id=\"mod_{$blog['blogid']}_row2\"", 'colspan="4" style="padding: 10px; line-height: 180%;"', '<div style="overflow: auto; overflow-x: hidden; max-height:120px; height:auto !important; height:100px; word-break: break-all;">' . $blog['message'] . '</div>');
     showtablerow("id=\"mod_{$blog['blogid']}_row3\"", 'class="threadopt threadtitle" colspan="4"', "<a href=\"?action=moderate&operation=blogs&fast=1&blogid={$blog['blogid']}&moderate[{$blog['blogid']}]=validate&page={$page}&frame=no\" target=\"fasthandle\">{$lang['validate']}</a> | <a href=\"?action=moderate&operation=blogs&fast=1&blogid={$blog['blogid']}&moderate[{$blog['blogid']}]=delete&page={$page}&frame=no\" target=\"fasthandle\">{$lang['delete']}</a> | <a href=\"?action=moderate&operation=blogs&fast=1&blogid={$blog['blogid']}&moderate[{$blog['blogid']}]=ignore&page={$page}&frame=no\" target=\"fasthandle\">{$lang['ignore']}</a>");
     showtagfooter('tbody');
 }
 showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="mod_setbg_all(\'validate\')">' . cplang('moderate_all_validate') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'delete\')">' . cplang('moderate_all_delete') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'ignore\')">' . cplang('moderate_all_ignore') . '</a> &nbsp;<a href="#all" onclick="mod_cancel_all();">' . cplang('moderate_all_cancel') . '</a>', $multipage, false);
 showtablefooter();
 showformfooter();
Exemplo n.º 10
0
    require_once libfile('class/censor');
    $censor =& discuz_censor::instance();
    $censor->highlight = '#FF0000';
    require_once libfile('function/misc');
    while ($article = DB::fetch($query)) {
        $article['dateline'] = dgmdate($article['dateline']);
        if ($showcensor) {
            $censor->check($article['title']);
            $censor->check($article['summary']);
        }
        $article_censor_words = $censor->words_found;
        if (count($article_censor_words) > 3) {
            $article_censor_words = array_slice($article_censor_words, 0, 3);
        }
        $article['censorwords'] = implode(', ', $article_censor_words);
        $article['modarticlekey'] = modauthkey($article['aid']);
        if (count($article_censor_words)) {
            $article_censor_text = "<span style=\"color: red;\">({$article['censorwords']})</span>";
        } else {
            $article_censor_text = '';
        }
        showtagheader('tbody', '', true, 'hover');
        showtablerow("id=\"mod_{$article['aid']}_row1\"", array("id=\"mod_{$article['aid']}_row1_op\" rowspan=\"3\" class=\"rowform threadopt\" style=\"width:80px;\"", '', 'width="120"', 'width="55"'), array("<ul class=\"nofloat\"><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$article['aid']}]\" id=\"mod_{$article['aid']}_1\" value=\"validate\" onclick=\"mod_setbg({$article['aid']}, 'validate');\"><label for=\"mod_{$article['aid']}_1\">{$lang['validate']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$article['aid']}]\" id=\"mod_{$article['aid']}_2\" value=\"delete\" onclick=\"mod_setbg({$article['aid']}, 'delete');\"><label for=\"mod_{$article['aid']}_2\">{$lang['delete']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$article['aid']}]\" id=\"mod_{$article['aid']}_3\" value=\"ignore\" onclick=\"mod_setbg({$article['aid']}, 'ignore');\"><label for=\"mod_{$article['aid']}_3\">{$lang['ignore']}</label></li></ul>", "<h3><a href=\"javascript:;\" onclick=\"display_toggle({$article[aid]});\">{$article['title']} {$article_censor_text}</a></h3>", "<p><a target=\"_blank\" href=\"" . ADMINSCRIPT . "?action=members&operation=search&uid={$article['uid']}&submit=yes\">{$article['username']}</a></p> <p>{$article['dateline']}</p>", "<a target=\"_blank\" href=\"portal.php?mod=view&aid={$article['aid']}&modarticlekey={$article['modarticlekey']}\">{$lang['view']}</a>&nbsp;<a href=\"portal.php?mod=portalcp&ac=article&op=edit&aid={$article['aid']}&modarticlekey={$article['modarticlekey']}\" target=\"_blank\">{$lang['edit']}</a>"));
        showtablerow("id=\"mod_{$article['aid']}_row2\"", 'colspan="4" style="padding: 10px; line-height: 180%;"', '<div style="overflow: auto; overflow-x: hidden; max-height:120px; height:auto !important; height:100px; word-break: break-all;">' . $article['summary'] . '</div>');
        showtablerow("id=\"mod_{$article['aid']}_row3\"", 'class="threadopt threadtitle" colspan="4"', "<a href=\"?action=moderate&operation=articles&fast=1&aid={$article['aid']}&moderate[{$article['aid']}]=validate&page={$page}&frame=no\" target=\"fasthandle\">{$lang['validate']}</a> | <a href=\"?action=moderate&operation=articles&fast=1&aid={$article['aid']}&moderate[{$article['aid']}]=delete&page={$page}&frame=no\" target=\"fasthandle\">{$lang['delete']}</a> | <a href=\"?action=moderate&operation=articles&fast=1&aid={$article['aid']}&moderate[{$article['aid']}]=ignore&page={$page}&frame=no\" target=\"fasthandle\">{$lang['ignore']}</a>");
        showtagfooter('tbody');
    }
    showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="mod_setbg_all(\'validate\')">' . cplang('moderate_all_validate') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'delete\')">' . cplang('moderate_all_delete') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'ignore\')">' . cplang('moderate_all_ignore') . '</a> &nbsp;<a href="#all" onclick="mod_cancel_all();">' . cplang('moderate_all_cancel') . '</a>', $multipage, false);
    showtablefooter();
    showformfooter();
} else {
Exemplo n.º 11
0
        }
        updatecreditbyaction($action, 0, array(), $needle);
        if ($becomment) {
            if ($_POST['idtype'] == 'uid') {
                $needle = $_G['uid'];
            }
            updatecreditbyaction($becomment, $tospace['uid'], array(), $needle);
        }
    }
    DB::update('common_member_status', array('lastpost' => $_G['timestamp']), array('uid' => $_G['uid']));
    $magvalues['cid'] = $cid;
    showmessage($msg, dreferer(), $magvalues, $_G['gp_quickcomment'] ? array('msgtype' => 3, 'showmsg' => true) : array('showdialog' => 3, 'showmsg' => true, 'closetime' => true));
}
$cid = empty($_GET['cid']) ? 0 : intval($_GET['cid']);
if ($_GET['op'] == 'edit') {
    if ($_G['adminid'] != 1 && $_G['gp_modcommentkey'] != modauthkey($_G['gp_cid'])) {
        $sqladd = "AND authorid='{$_G['uid']}'";
    } else {
        $sqladd = '';
    }
    $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE cid='{$cid}' {$sqladd}");
    if (!($comment = DB::fetch($query))) {
        showmessage('no_privilege');
    }
    if (submitcheck('editsubmit')) {
        $message = getstr($_POST['message'], 0, 1, 1, 2);
        if (strlen($message) < 2) {
            showmessage('content_is_too_short');
        }
        $message = censor($message);
        if (censormod($message)) {
Exemplo n.º 12
0
    }
    if ($ordertype != 1) {
        $page = ceil($curpostnum / $_G['ppp']);
    } elseif ($curpostnum > 1) {
        $page = ceil(($thread['replies'] - $curpostnum + 3) / $_G['ppp']);
    } else {
        $page = 1;
    }
    if ($thread['special'] == 2 && C::t('forum_trade')->check_goods($pid)) {
        header("HTTP/1.1 301 Moved Permanently");
        dheader("Location: forum.php?mod=viewthread&do=tradeinfo&tid={$tid}&pid={$pid}");
    }
    $authoridurl = $authorid ? '&authorid=' . $authorid : '';
    $ordertypeurl = $ordertype ? '&ordertype=' . $ordertype : '';
    header("HTTP/1.1 301 Moved Permanently");
    dheader("Location: forum.php?mod=viewthread&tid={$tid}&page={$page}{$authoridurl}{$ordertypeurl}" . (isset($_GET['modthreadkey']) && ($modthreadkey = modauthkey($tid)) ? "&modthreadkey={$modthreadkey}" : '') . "#pid{$pid}");
}
if (empty($_G['thread'])) {
    showmessage('thread_nonexistence');
}
if ($_GET['goto'] == 'lastpost') {
    $pageadd = '';
    if (!getstatus($_G['thread'], 4)) {
        $page = ceil(($_G['thread']['special'] ? $_G['thread']['replies'] : $_G['thread']['replies'] + 1) / $_G['ppp']);
        $pageadd = $page > 1 ? '&page=' . $page : '';
    }
    dheader('Location: forum.php?mod=viewthread&tid=' . $_G['tid'] . $pageadd . '#lastpost');
} elseif ($_GET['goto'] == 'nextnewset' || $_GET['goto'] == 'nextoldset') {
    $lastpost = $_G['thread']['lastpost'];
    $glue = '<';
    $sort = 'DESC';
Exemplo n.º 13
0
 $censor =& discuz_censor::instance();
 $censor->highlight = '#FF0000';
 require_once libfile('function/misc');
 require_once libfile('function/home');
 while ($pic = DB::fetch($query)) {
     $pic['dateline'] = dgmdate($pic['dateline']);
     $pic['title'] = $pic['title'] ? '<b>' . $pic['title'] . '</b>' : '<i>' . $lang['nosubject'] . '</i>';
     if ($showcensor) {
         $censor->check($pic['title']);
     }
     $pic_censor_words = $censor->words_found;
     if (count($pic_censor_words) > 3) {
         $pic_censor_words = array_slice($pic_censor_words, 0, 3);
     }
     $pic['censorwords'] = implode(', ', $pic_censor_words);
     $pic['modpickey'] = modauthkey($pic['picid']);
     $pic['postip'] = $pic['postip'] . '-' . convertip($pic['postip']);
     $pic['url'] = pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote']);
     if (count($pic_censor_words)) {
         $pic_censor_text = "<span style=\"color: red;\">({$pic['censorwords']})</span>";
     } else {
         $pic_censor_text = '';
     }
     showtagheader('tbody', '', true, 'hover');
     showtablerow("id=\"mod_{$pic['picid']}_row1\"", array("id=\"mod_{$pic['picid']}_row1_op\" rowspan=\"3\" class=\"rowform threadopt\" style=\"width:80px;\"", '', 'width="120"', 'width="120"', 'width="55"'), array("<ul class=\"nofloat\"><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$pic['picid']}]\" id=\"mod_{$pic['picid']}_1\" value=\"validate\" onclick=\"mod_setbg({$pic['picid']}, 'validate');\"><label for=\"mod_{$pic['picid']}_1\">{$lang['validate']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$pic['picid']}]\" id=\"mod_{$pic['picid']}_2\" value=\"delete\" onclick=\"mod_setbg({$pic['picid']}, 'delete');\"><label for=\"mod_{$pic['picid']}_2\">{$lang['delete']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$pic['picid']}]\" id=\"mod_{$pic['picid']}_3\" value=\"ignore\" onclick=\"mod_setbg({$pic['picid']}, 'ignore');\"><label for=\"mod_{$pic['picid']}_3\">{$lang['ignore']}</label></li></ul>", "<h3><a href=\"javascript:;\" onclick=\"display_toggle('{$pic['picid']}');\">{$pic['title']}</a> {$pic_censor_text}</h3><p>{$pic['postip']}</p>", "<a target=\"_blank\" href=\"home.php?mod=space&uid={$pic['uid']}&do=album&id={$pic['albumid']}\">{$pic['albumname']}</a>", "<p><a target=\"_blank\" href=\"" . ADMINSCRIPT . "?action=members&operation=search&uid={$pic['uid']}&submit=yes\">{$pic['username']}</a></p> <p>{$pic['dateline']}</p>", "<a target=\"_blank\" href=\"home.php?mod=space&uid={$pic['uid']}&do=album&picid={$pic['picid']}&modpickey={$pic['modpickey']}\">{$lang['view']}</a>"));
     showtablerow("id=\"mod_{$pic['picid']}_row2\"", 'colspan="4" style="padding: 10px; line-height: 180%;"', '<div style="overflow: auto; overflow-x: hidden; max-height:120px; height:auto !important; height:100px; word-break: break-all;"><img src="' . $pic['url'] . '" /></div>');
     showtablerow("id=\"mod_{$pic['picid']}_row3\"", 'class="threadopt threadtitle" colspan="4"', "<a href=\"?action=moderate&operation=pictures&fast=1&picid={$pic['picid']}&moderate[{$pic['picid']}]=validate&page={$page}&frame=no\" target=\"fasthandle\">{$lang['validate']}</a> | <a href=\"?action=moderate&operation=pictures&fast=1&picid={$pic['picid']}&moderate[{$pic['picid']}]=delete&page={$page}&frame=no\" target=\"fasthandle\">{$lang['delete']}</a> | <a href=\"?action=moderate&operation=pictures&fast=1&picid={$pic['picid']}&moderate[{$pic['picid']}]=ignore&page={$page}&frame=no\" target=\"fasthandle\">{$lang['ignore']}</a>");
     showtagfooter('tbody');
 }
 showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="mod_setbg_all(\'validate\')">' . cplang('moderate_all_validate') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'delete\')">' . cplang('moderate_all_delete') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'ignore\')">' . cplang('moderate_all_ignore') . '</a> &nbsp;<a href="#all" onclick="mod_cancel_all();">' . cplang('moderate_all_cancel') . '</a>', $multipage, false);
 showtablefooter();
Exemplo n.º 14
0
        $navtitle = $album['albumname'] . ' - ' . lang('space', 'sb_album', array('who' => $album['username']));
        $nobbname = false;
    } else {
        $nobbname = true;
    }
    if (empty($metakeywords)) {
        $metakeywords = $album['albumname'];
    }
    if (empty($metadescription)) {
        $metadescription = $album['albumname'];
    }
    include_once template("diy:home/space_album_view");
} elseif ($picid) {
    $query = C::t('home_pic')->fetch_all_by_uid($space['uid'], 0, 1, $picid);
    $pic = $query[0];
    if (!$pic || $pic['status'] == 1 && $pic['uid'] != $_G['uid'] && $_G['adminid'] != 1 && $_GET['modpickey'] != modauthkey($pic['picid'])) {
        showmessage('view_images_do_not_exist');
    }
    $picid = $pic['picid'];
    $theurl = "home.php?mod=space&uid={$pic['uid']}&do={$do}&picid={$picid}";
    $album = array();
    if ($pic['albumid']) {
        $album = C::t('home_album')->fetch($pic['albumid']);
        if (!$album) {
            C::t('home_pic')->update_for_albumid($pic['albumid'], array('albumid' => 0));
        }
    }
    if ($album) {
        ckfriend_album($album);
    } else {
        $album['picnum'] = C::t('home_pic')->check_albumpic(0, NULL, $pic['uid']);
Exemplo n.º 15
0
         $fids[] = $thread['fid'];
         if ($thread['isgroup']) {
             $groupsfid[$thread[fid]] = $thread['fid'];
         }
         $thread['lastpost'] = dgmdate($thread['lastpost']);
         $threadlist[] = $thread;
     }
     if ($groupsfid) {
         $query = DB::query("SELECT fid, name FROM " . DB::table('forum_forum') . " WHERE fid IN(" . dimplode($groupsfid) . ")");
         while ($row = DB::fetch($query)) {
             $groupsname[$row[fid]] = $row['name'];
         }
     }
     if ($threadlist) {
         foreach ($threadlist as $thread) {
             $threads .= showtablerow('', array('class="td25"', '', '', '', 'class="td25"', 'class="td25"'), array("<input class=\"checkbox\" type=\"checkbox\" name=\"tidarray[]\" value=\"{$thread['tid']}\" />", "<a href=\"forum.php?mod=viewthread&tid={$thread['tid']}" . ($thread['displayorder'] != -4 ? '' : '&modthreadkey=' . modauthkey($thread['tid'])) . "\" target=\"_blank\">{$thread['subject']}</a>" . ($thread['readperm'] ? " - [{$lang['threads_readperm']} {$thread['readperm']}]" : '') . ($thread['price'] ? " - [{$lang['threads_price']} {$thread['price']}]" : ''), "<a href=\"forum.php?mod=forumdisplay&fid={$thread['fid']}\" target=\"_blank\">" . (empty($thread['isgroup']) ? $_G['cache']['forums'][$thread[fid]]['name'] : $groupsname[$thread[fid]]) . "</a>", "<a href=\"home.php?mod=space&uid={$thread['authorid']}\" target=\"_blank\">{$thread['author']}</a>", $thread['replies'], $thread['views'], $thread['lastpost']), TRUE);
         }
     }
     $threadcount = DB::result_first("SELECT count(*) FROM " . DB::table('forum_thread') . " WHERE {$sql}");
     $multi = multi($threadcount, $perpage, $page, ADMINSCRIPT . "?action=threads");
     $multi = preg_replace("/href=\"" . ADMINSCRIPT . "\\?action=threads&amp;page=(\\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
     $multi = str_replace("window.location='" . ADMINSCRIPT . "?action=threads&amp;page='+this.value", "page(this.value)", $multi);
 } else {
     $query = DB::query("SELECT fid, tid FROM " . DB::table('forum_thread') . " WHERE {$sql}");
     while ($thread = DB::fetch($query)) {
         $fids[] = $thread['fid'];
         $tids .= ',' . $thread['tid'];
     }
     $threadcount = DB::result_first("SELECT count(*) FROM " . DB::table('forum_thread') . " WHERE {$sql}");
     $multi = '';
 }
Exemplo n.º 16
0
                            $newpids .= $comma . $v;
                            $comma = ',';
                        }
                    }
                    $result['count'] = $newcount;
                    $result['pids'] = $newpids;
                    $modsession->set($cachekey, $result, true);
                }
            }
            $total = $result['count'];
            $tpage = ceil($total / $_G['tpp']);
            $page = min($tpage, $page);
            $multipage = multi($total, $_G['tpp'], $page, "{$cpscript}?mod=modcp&action={$action}&amp;op={$op}&amp;fid={$_G['fid']}&amp;do={$do}");
            if ($total) {
                $start = ($page - 1) * $_G['tpp'];
                $postlist = C::t('forum_post')->fetch_all_by_pid($posttableid, explode(',', $result['pids']), true, 'DESC', $start, $_G['tpp'], $_G['fid'], -5);
            }
        }
    }
    if ($postlist) {
        require_once libfile('function/misc');
        require_once libfile('function/post');
        require_once libfile('function/discuzcode');
        foreach ($postlist as $key => $post) {
            $post['modthreadkey'] = modauthkey($post['tid']);
            $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'], $_G['forum']['allowhtml']);
            $post['dateline'] = dgmdate($post['dateline'], 'Y-m-d H:i:s');
            $postlist[$key] = $post;
        }
    }
}
Exemplo n.º 17
0
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: portal_view.php 19121 2010-12-16 08:06:35Z zhangguosheng $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
if (empty($aid)) {
    showmessage("view_no_article_id");
}
$article = DB::fetch_first("SELECT * FROM " . DB::table('portal_article_title') . " WHERE aid='{$aid}'");
require_once libfile('function/portalcp');
$permission = getallowcategory($_G['uid']);
if (empty($article) || $article['status'] > 0 && $article['uid'] != $_G['uid'] && !$_G['group']['allowmanagearticle'] && empty($permission[$article['catid']]['allowmanage']) && $_G['adminid'] != 1 && $_G['gp_modarticlekey'] != modauthkey($article['aid'])) {
    showmessage("view_article_no_exist");
}
$article_count = DB::fetch_first("SELECT * FROM " . DB::table('portal_article_count') . " WHERE aid='{$aid}'");
if ($article_count) {
    $article = array_merge($article_count, $article);
}
if ($article_count) {
    DB::query("UPDATE " . DB::table('portal_article_count') . " SET catid='{$article['catid']}', dateline='{$article['dateline']}', viewnum=viewnum+1 WHERE aid='{$aid}'");
} else {
    DB::insert('portal_article_count', array('aid' => $aid, 'catid' => $article['catid'], 'dateline' => $article['dateline'], 'viewnum' => 1));
}
if ($article['url']) {
    dheader("location:{$article['url']}");
    exit;
}
Exemplo n.º 18
0
function check_articleperm($catid, $aid = 0, $article = array(), $isverify = false, $return = false)
{
    global $_G;
    if (empty($catid)) {
        if (!$return) {
            showmessage('article_category_empty');
        } else {
            return 'article_category_empty';
        }
    }
    if ($_G['group']['allowmanagearticle'] || empty($aid) && $_G['group']['allowpostarticle'] || $_GET['modarticlekey'] == modauthkey($aid)) {
        return true;
    }
    $permission = getallowcategory($_G['uid']);
    if (isset($permission[$catid])) {
        if ($permission[$catid]['allowmanage'] || empty($aid) && $permission[$catid]['allowpublish']) {
            return true;
        }
    }
    if (!$isverify && $aid && !empty($article['uid']) && $article['uid'] == $_G['uid'] && ($article['status'] == 1 && $_G['group']['allowpostarticlemod'] || empty($_G['group']['allowpostarticlemod']))) {
        return true;
    }
    if (!$return) {
        showmessage('article_edit_nopermission');
    } else {
        return 'article_edit_nopermission';
    }
}
Exemplo n.º 19
0
        $blog['tag'] = implode(',', $blogtag_array);
    }
}
if (empty($blog)) {
    if (!helper_access::check_module('blog') || !checkperm('allowblog')) {
        showmessage('no_authority_to_add_log', '', array(), array('return' => true));
    }
    cknewuser();
    $waittime = interval_check('post');
    if ($waittime > 0) {
        showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true));
    }
    $blog['subject'] = empty($_GET['subject']) ? '' : getstr($_GET['subject'], 80);
    $blog['message'] = empty($_GET['message']) ? '' : getstr($_GET['message'], 5000);
} else {
    if ($_G['uid'] != $blog['uid'] && !checkperm('manageblog') && $_GET['modblogkey'] != modauthkey($blog['blogid'])) {
        showmessage('no_authority_operation_of_the_log');
    }
}
if (submitcheck('blogsubmit', 0, $seccodecheck, $secqaacheck) && helper_access::check_module('blog')) {
    if (empty($blog['blogid'])) {
        $blog = array();
    } else {
        if (!checkperm('allowblog')) {
            showmessage('no_privilege_blog');
        }
    }
    if ($_G['setting']['blogcategorystat'] && $_G['setting']['blogcategoryrequired'] && !$_POST['catid']) {
        showmessage('blog_choose_system_category');
    }
    require_once libfile('function/blog');
Exemplo n.º 20
0
function loadforum($fid = null, $tid = null)
{
    global $_G;
    $tid = intval(isset($tid) ? $tid : getgpc('tid'));
    if (isset($fid)) {
        $fid = intval($fid);
    } else {
        $fid = getgpc('fid');
        if (!$fid && getgpc('gid')) {
            $fid = intval(getgpc('gid'));
        }
    }
    if (isset($_G['forum']['fid']) && $_G['forum']['fid'] == $fid || isset($_G['thread']['tid']) && $_G['thread']['tid'] == $tid) {
        return null;
    }
    if (!empty($_GET['archiver'])) {
        //X1.5的Archiver兼容
        if ($fid) {
            dheader('location: archiver/?fid-' . $fid . '.html');
        } elseif ($tid) {
            dheader('location: archiver/?tid-' . $tid . '.html');
        } else {
            dheader('location: archiver/');
        }
    }
    if (defined('IN_ARCHIVER') && $_G['setting']['archiverredirect'] && !IS_ROBOT) {
        dheader('location: ../forum.php' . ($_G['mod'] ? '?mod=' . $_G['mod'] . (!empty($_GET['fid']) ? '&fid=' . $_GET['fid'] : (!empty($_GET['tid']) ? '&tid=' . $_GET['tid'] : '')) : ''));
    }
    if ($_G['setting']['forumpicstyle']) {
        $_G['setting']['forumpicstyle'] = dunserialize($_G['setting']['forumpicstyle']);
        empty($_G['setting']['forumpicstyle']['thumbwidth']) && ($_G['setting']['forumpicstyle']['thumbwidth'] = 203);
        empty($_G['setting']['forumpicstyle']['thumbheight']) && ($_G['setting']['forumpicstyle']['thumbheight'] = 999);
    } else {
        $_G['setting']['forumpicstyle'] = array('thumbwidth' => 203, 'thumbheight' => 999);
    }
    if ($fid) {
        $fid = is_numeric($fid) ? intval($fid) : (!empty($_G['setting']['forumfids'][$fid]) ? $_G['setting']['forumfids'][$fid] : 0);
    }
    $modthreadkey = isset($_GET['modthreadkey']) && $_GET['modthreadkey'] == modauthkey($tid) ? $_GET['modthreadkey'] : '';
    $_G['forum_auditstatuson'] = $modthreadkey ? true : false;
    $metadescription = $hookscriptmessage = '';
    $adminid = $_G['adminid'];
    if (!empty($tid) || !empty($fid)) {
        if (!empty($tid)) {
            $archiveid = !empty($_GET['archiveid']) ? intval($_GET['archiveid']) : null;
            $_G['thread'] = get_thread_by_tid($tid, $archiveid);
            $_G['thread']['allreplies'] = $_G['thread']['replies'] + $_G['thread']['comments'];
            if (!$_G['forum_auditstatuson'] && !empty($_G['thread']) && !($_G['thread']['displayorder'] >= 0 || in_array($_G['thread']['displayorder'], array(-4, -3, -2)) && $_G['uid'] && $_G['thread']['authorid'] == $_G['uid'])) {
                $_G['thread'] = null;
            }
            $_G['forum_thread'] =& $_G['thread'];
            if (empty($_G['thread'])) {
                $fid = $tid = 0;
            } else {
                $fid = $_G['thread']['fid'];
                $tid = $_G['thread']['tid'];
            }
        }
        if ($fid) {
            $forum = C::t('forum_forum')->fetch_info_by_fid($fid);
        }
        if ($forum) {
            if ($_G['uid']) {
                if ($_G['member']['accessmasks']) {
                    $query = C::t('forum_access')->fetch_all_by_fid_uid($fid, $_G['uid']);
                    $forum['allowview'] = $query[0]['allowview'];
                    $forum['allowpost'] = $query[0]['allowpost'];
                    $forum['allowreply'] = $query[0]['allowreply'];
                    $forum['allowgetattach'] = $query[0]['allowgetattach'];
                    $forum['allowgetimage'] = $query[0]['allowgetimage'];
                    $forum['allowpostattach'] = $query[0]['allowpostattach'];
                    $forum['allowpostimage'] = $query[0]['allowpostimage'];
                }
                if ($adminid == 3) {
                    $forum['ismoderator'] = C::t('forum_moderator')->fetch_uid_by_fid_uid($fid, $_G['uid']);
                }
            }
            $forum['ismoderator'] = !empty($forum['ismoderator']) || $adminid == 1 || $adminid == 2 ? 1 : 0;
            $fid = $forum['fid'];
            $gorup_admingroupids = $_G['setting']['group_admingroupids'] ? dunserialize($_G['setting']['group_admingroupids']) : array('1' => '1');
            if ($forum['status'] == 3) {
                if (!empty($forum['moderators'])) {
                    $forum['moderators'] = dunserialize($forum['moderators']);
                } else {
                    require_once libfile('function/group');
                    $forum['moderators'] = update_groupmoderators($fid);
                }
                if ($_G['uid'] && $_G['adminid'] != 1) {
                    $forum['ismoderator'] = !empty($forum['moderators'][$_G['uid']]) ? 1 : 0;
                    $_G['adminid'] = 0;
                    if ($forum['ismoderator'] || $gorup_admingroupids[$_G['groupid']]) {
                        $_G['adminid'] = $_G['adminid'] ? $_G['adminid'] : 3;
                        if (!empty($gorup_admingroupids[$_G['groupid']])) {
                            $forum['ismoderator'] = 1;
                            $_G['adminid'] = 2;
                        }
                        $group_userperm = dunserialize($_G['setting']['group_userperm']);
                        if (is_array($group_userperm)) {
                            $_G['group'] = array_merge($_G['group'], $group_userperm);
                            $_G['group']['allowmovethread'] = $_G['group']['allowcopythread'] = $_G['group']['allowedittypethread'] = 0;
                        }
                    }
                }
            }
            foreach (array('threadtypes', 'threadsorts', 'creditspolicy', 'modrecommend') as $key) {
                $forum[$key] = !empty($forum[$key]) ? dunserialize($forum[$key]) : array();
                if (!is_array($forum[$key])) {
                    $forum[$key] = array();
                }
            }
            if ($forum['status'] == 3) {
                $_G['isgroupuser'] = 0;
                $_G['basescript'] = 'group';
                if ($forum['level'] == 0) {
                    $levelinfo = C::t('forum_grouplevel')->fetch_by_credits($forum['commoncredits']);
                    $levelid = $levelinfo['levelid'];
                    $forum['level'] = $levelid;
                    C::t('forum_forum')->update_group_level($levelid, $fid);
                }
                if ($forum['level'] != -1) {
                    loadcache('grouplevels');
                    $grouplevel = $_G['grouplevels'][$forum['level']];
                    if (!empty($grouplevel['icon'])) {
                        $valueparse = parse_url($grouplevel['icon']);
                        if (!isset($valueparse['host'])) {
                            $grouplevel['icon'] = $_G['setting']['attachurl'] . 'common/' . $grouplevel['icon'];
                        }
                    }
                }
                $group_postpolicy = $grouplevel['postpolicy'];
                if (is_array($group_postpolicy)) {
                    $forum = array_merge($forum, $group_postpolicy);
                }
                $forum['allowfeed'] = $_G['setting']['group_allowfeed'];
                if ($_G['uid']) {
                    if (!empty($forum['moderators'][$_G['uid']])) {
                        $_G['isgroupuser'] = 1;
                    } else {
                        $groupuserinfo = C::t('forum_groupuser')->fetch_userinfo($_G['uid'], $fid);
                        $_G['isgroupuser'] = $groupuserinfo['level'];
                        if ($_G['isgroupuser'] <= 0 && empty($forum['ismoderator'])) {
                            $_G['group']['allowrecommend'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowrecommend'] = 0;
                            $_G['group']['allowcommentpost'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowcommentpost'] = 0;
                            $_G['group']['allowcommentitem'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowcommentitem'] = 0;
                            $_G['group']['raterange'] = $_G['cache']['usergroup_' . $_G['groupid']]['raterange'] = array();
                            $_G['group']['allowvote'] = $_G['cache']['usergroup_' . $_G['groupid']]['allowvote'] = 0;
                        } else {
                            $_G['isgroupuser'] = 1;
                        }
                    }
                }
            }
        } else {
            $fid = 0;
        }
    }
    $_G['fid'] = $fid;
    $_G['tid'] = $tid;
    $_G['forum'] =& $forum;
    $_G['current_grouplevel'] =& $grouplevel;
    if (empty($_G['uid'])) {
        $_G['group']['allowpostactivity'] = $_G['group']['allowpostpoll'] = $_G['group']['allowvote'] = $_G['group']['allowpostreward'] = $_G['group']['allowposttrade'] = $_G['group']['allowpostdebate'] = $_G['group']['allowpostrushreply'] = 0;
    }
    if (!empty($_G['forum']['widthauto'])) {
        $_G['widthauto'] = $_G['forum']['widthauto'];
    }
}
Exemplo n.º 21
0
    showtablefooter();
} elseif ($_G['gp_anchor'] == 'post') {
    $count = DB::result_first("SELECT count(*) FROM " . DB::table('security_evilpost') . " WHERE type = '0'");
    $multipage = multi($count, $tpp, $page, ADMINSCRIPT . '?action=cloud&operation=security&anchor=post');
    list($datas, $evilPids) = getEvilList('post', $start_limit, $tpp);
    echo "<p><a href='{$adminscript}?action=recyclebinpost&operation=search&formhash=" . formhash() . "&security=1&searchsubmit=1' target='_blank'>{$lang['security_recyclebin_post']}</a></p>";
    showtableheader('', '', 'id = "security_list"');
    showsubtitle(array('security_subject', 'security_forum', 'security_author', 'security_post_status'));
    foreach ($datas as $key => $value) {
        if (!$value['message']) {
            $subjectstyle = 'class = "threadopt"';
        } else {
            $subjectstyle = '';
        }
        $value['message'] = convertMessage($value);
        $modthreadkey = modauthkey($value['tid']);
        $thread = array(convertSubjectandIP($value), getNamebyFid($value['fid']), convertAuthorAndDate($value), convertIdtoStr($value['invisible'], 'adminoperate'), $viewlink);
        showtagheader('tbody', '', true, 'hover');
        showtablerow($subjectstyle, array('width = "400px"'), $thread);
        $value['message'] ? showtablerow('class="threadopt" style="display: none;" id = "mod_' . $value['tid'] . '_row_' . $key . '"', 'colspan = "6"', $value['message']) : '';
        showtagfooter('tbody');
    }
    if ($multipage) {
        showtablerow('', 'colspan = "6"', $multipage);
    }
    showtablefooter();
} elseif ($_G['gp_anchor'] == 'member') {
    $memberperpage = $_G['setting']['memberperpage'];
    $start_limit = ($page - 1) * $memberperpage;
    $count = DB::result_first('SELECT count(*) FROM ' . DB::table('security_eviluser'));
    $multipage = multi($count, $memberperpage, $page, ADMINSCRIPT . '?action=cloud&operation=security&anchor=member');
Exemplo n.º 22
0
 $censor =& discuz_censor::instance();
 $censor->highlight = '#FF0000';
 require_once libfile('function/misc');
 foreach ($sharearr as $share) {
     $short_desc = cutstr($share['body_general'], 30);
     $share['dateline'] = dgmdate($share['dateline']);
     if ($showcensor) {
         $censor->check($short_desc);
         $censor->check($share['body_general']);
     }
     $share_censor_words = $censor->words_found;
     if (count($share_censor_words) > 3) {
         $share_censor_words = array_slice($share_censor_words, 0, 3);
     }
     $share['censorwords'] = implode(', ', $share_censor_words);
     $share['modkey'] = modauthkey($share['itemid']);
     if (count($share_censor_words)) {
         $share_censor_text = "<span style=\"color: red;\">({$share['censorwords']})</span>";
     } else {
         $share_censor_text = '';
     }
     $shareurl = '';
     switch ($share['type']) {
         case 'thread':
             $shareurl = "forum.php?mod=viewthread&tid={$share['itemid']}&modthreadkey={$share['modkey']}";
             $sharetitle = lang('admincp', 'share_type_thread');
             break;
         case 'pic':
             $shareurl = "home.php?mod=space&uid={$share['fromuid']}&do=album&picid={$share['itemid']}&modpickey={$share['modkey']}";
             $sharetitle = lang('admincp', 'share_type_pic');
             break;
Exemplo n.º 23
0
    $censor =& discuz_censor::instance();
    $censor->highlight = '#FF0000';
    require_once libfile('function/misc');
    foreach ($query as $articlecomment) {
        $articlecomment['dateline'] = dgmdate($articlecomment['dateline']);
        if ($showcensor) {
            $censor->check($articlecomment['title']);
            $censor->check($articlecomment['message']);
        }
        $articlecomment_censor_words = $censor->words_found;
        if (count($articlecomment_censor_words) > 3) {
            $articlecomment_censor_words = array_slice($articlecomment_censor_words, 0, 3);
        }
        $articlecomment['censorwords'] = implode(', ', $articlecomment_censor_words);
        $articlecomment['modarticlekey'] = modauthkey($articlecomment['aid']);
        $articlecomment['modarticlecommentkey'] = modauthkey($articlecomment['cid']);
        if (count($articlecomment_censor_words)) {
            $articlecomment_censor_text = "<span style=\"color: red;\">({$articlecomment['censorwords']})</span>";
        } else {
            $articlecomment_censor_text = '';
        }
        showtagheader('tbody', '', true, 'hover');
        showtablerow("id=\"mod_{$articlecomment['cid']}_row1\"", array("id=\"mod_{$articlecomment['cid']}_row1_op\" rowspan=\"3\" class=\"rowform threadopt\" style=\"width:80px;\"", '', 'width="120"', 'width="55"'), array("<ul class=\"nofloat\"><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$articlecomment['cid']}]\" id=\"mod_{$articlecomment['cid']}_1\" value=\"validate\" onclick=\"mod_setbg({$articlecomment['cid']}, 'validate');\"><label for=\"mod_{$articlecomment['cid']}_1\">{$lang['validate']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$articlecomment['cid']}]\" id=\"mod_{$articlecomment['cid']}_2\" value=\"delete\" onclick=\"mod_setbg({$articlecomment['cid']}, 'delete');\"><label for=\"mod_{$articlecomment['cid']}_2\">{$lang['delete']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$articlecomment['cid']}]\" id=\"mod_{$articlecomment['cid']}_3\" value=\"ignore\" onclick=\"mod_setbg({$articlecomment['cid']}, 'ignore');\"><label for=\"mod_{$articlecomment['cid']}_3\">{$lang['ignore']}</label></li></ul>", "<h3><a href=\"javascript:;\" onclick=\"display_toggle({$articlecomment[cid]});\">{$articlecomment['title']} {$articlecomment_censor_text}</a></h3>", "<p><a target=\"_blank\" href=\"" . ADMINSCRIPT . "?action=members&operation=search&uid={$articlecomment['uid']}&submit=yes\">{$articlecomment['username']}</a></p> <p>{$articlecomment['dateline']}</p>", "<a target=\"_blank\" href=\"portal.php?mod={$mod}&{$idtype}={$articlecomment['id']}&modarticlekey={$articlecomment['modarticlekey']}#comment_anchor_{$articlecomment[cid]}\">{$lang['view']}</a>&nbsp;<a href=\"portal.php?mod=portalcp&ac=comment&op=edit&cid={$articlecomment['cid']}&modarticlecommentkey={$articlecomment['modarticlecommentkey']}\" target=\"_blank\">{$lang['edit']}</a>"));
        showtablerow("id=\"mod_{$articlecomment['cid']}_row2\"", 'colspan="4" style="padding: 10px; line-height: 180%;"', '<div style="overflow: auto; overflow-x: hidden; max-height:120px; height:auto !important; height:100px; word-break: break-all;">' . $articlecomment['message'] . '</div>');
        showtablerow("id=\"mod_{$articlecomment['cid']}_row3\"", 'class="threadopt threadtitle" colspan="4"', "<a href=\"?action=moderate&operation={$operation}&fast=1&cid={$articlecomment['cid']}&moderate[{$articlecomment['cid']}]=validate&page={$page}&frame=no\" target=\"fasthandle\">{$lang['validate']}</a> | <a href=\"?action=moderate&operation={$operation}&fast=1&cid={$articlecomment['cid']}&moderate[{$articlecomment['cid']}]=delete&page={$page}&frame=no\" target=\"fasthandle\">{$lang['delete']}</a> | <a href=\"?action=moderate&operation={$operation}&fast=1&cid={$articlecomment['cid']}&moderate[{$articlecomment['cid']}]=ignore&page={$page}&frame=no\" target=\"fasthandle\">{$lang['ignore']}</a>");
        showtagfooter('tbody');
    }
    showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="mod_setbg_all(\'validate\')">' . cplang('moderate_all_validate') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'delete\')">' . cplang('moderate_all_delete') . '</a> &nbsp;<a href="#all" onclick="mod_setbg_all(\'ignore\')">' . cplang('moderate_all_ignore') . '</a> &nbsp;<a href="#all" onclick="mod_cancel_all();">' . cplang('moderate_all_cancel') . '</a>', $multipage, false);
    showtablefooter();
    showformfooter();
} else {
Exemplo n.º 24
0
        $checklpp = array();
        $checklpp[$lpp] = 'selected="selected"';
        showformheader('recyclebin');
        showtableheader($lang['recyclebin_list'] . '&nbsp<select onchange="if(this.options[this.selectedIndex].value != \'\') {window.location=\'' . ADMINSCRIPT . '?action=recyclebin&lpp=\'+this.options[this.selectedIndex].value }">
				<option value="20" ' . $checklpp[20] . '> ' . $lang[perpage_20] . ' </option><option value="50" ' . $checklpp[50] . '>' . $lang[perpage_50] . '</option><option value="100" ' . $checklpp[100] . '>' . $lang[perpage_100] . '</option></select>');
        showsubtitle(array('', 'thread', 'recyclebin_list_thread', 'recyclebin_list_author', 'recyclebin_list_status', 'recyclebin_list_lastpost', 'recyclebin_list_operation', 'reason'));
        $fids = $threadlist = array();
        $threads = C::t('forum_thread')->fetch_all_by_tid_fid_displayorder(0, 0, -1, 'dateline', $start_limit, $lpp, '=');
        foreach ($threads as $tid => $value) {
            $fids[$value['fid']] = $value['fid'];
        }
        if ($fids) {
            $forums = C::t('forum_forum')->fetch_all_name_by_fid($fids);
            foreach ($threads as $tid => $thread) {
                $thread['forumname'] = $forums[$thread['fid']]['name'];
                $thread['modthreadkey'] = modauthkey($thread['tid']);
                $threadlist[$thread['tid']] = $thread;
            }
        }
        if ($threadlist) {
            $tids = array_keys($threadlist);
            foreach (C::t('forum_threadmod')->fetch_all_by_tid($tids) as $row) {
                if (empty($threadlist[$row['tid']]['moduid'])) {
                    $threadlist[$row['tid']]['moduid'] = $row['uid'];
                    $threadlist[$row['tid']]['modusername'] = $row['username'];
                    $threadlist[$row['tid']]['moddateline'] = $row['dateline'];
                    $threadlist[$row['tid']]['modaction'] = $row['action'];
                    $threadlist[$row['tid']]['reason'] = $row['reason'];
                }
            }
            foreach ($threadlist as $tid => $thread) {
Exemplo n.º 25
0
    exit('Access Denied');
}
require_once libfile('function/trade');
$language = lang('forum/misc');
cpheader();
$ppp = 20;
$start_limit = ($page - 1) * $ppp;
$filter = !isset($_G['gp_filter']) ? -1 : $_G['gp_filter'];
$sqlfilter = $filter >= 0 ? "WHERE status='{$filter}'" : '';
$count = DB::fetch_first("SELECT SUM(price) AS pricesum, SUM(credit) AS creditsum, sum(tax) AS taxsum FROM " . DB::table('forum_tradelog') . " {$sqlfilter}");
$num = DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_tradelog') . " {$sqlfilter}");
$multipage = multi($num, $ppp, $page, ADMINSCRIPT . "?action=tradelog&filter={$filter}");
$query = DB::query("SELECT * FROM " . DB::table('forum_tradelog') . " {$sqlfilter} ORDER BY lastupdate DESC LIMIT {$start_limit}, {$ppp}");
shownav('extended', 'nav_ec');
showsubmenu('nav_ec', array(array('nav_ec_config', 'setting&operation=ec&mod=forum', 0), array('nav_ec_tenpay', 'ec&operation=tenpay&mod=forum', 0), array('nav_ec_alipay', 'ec&operation=alipay&mod=forum', 0), array('nav_ec_credit', 'ec&operation=credit&mod=forum', 0), array('nav_ec_orders', 'ec&operation=orders&mod=forum', 0), array('nav_ec_tradelog', 'tradelog&mod=forum', 1), array('nav_ec_inviteorders', 'ec&operation=inviteorders', 0)));
showtableheader();
showsubtitle(array('tradelog_trade_no', 'tradelog_trade_name', 'tradelog_buyer', 'tradelog_seller', 'tradelog_money', $lang['tradelog_credit'] . "({$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]})", 'tradelog_fee', 'tradelog_order_status'));
while ($tradelog = DB::fetch($query)) {
    $tradelog['status'] = trade_getstatus($tradelog['status']);
    $tradelog['lastupdate'] = dgmdate($tradelog['lastupdate']);
    $tradelog['tradeno'] = $tradelog['offline'] ? $lang['tradelog_offline'] : $tradelog['tradeno'];
    showtablerow('', '', array($tradelog['tradeno'], '<a target="_blank" href="forum.php?mod=viewthread&do=tradeinfo&tid=' . $tradelog['tid'] . '&pid=' . $tradelog['pid'] . '">' . $tradelog['subject'] . '</a>', '<a target="_blank" href="home.php?mod=space&uid=' . $tradelog['buyerid'] . '">' . $tradelog['buyer'] . '</a>', '<a target="_blank" href="home.php?mod=space&uid=' . $tradelog['sellerid'] . '">' . $tradelog['seller'] . '</a>', $tradelog['price'], $tradelog['credit'], $tradelog['tax'], '<a target="_blank" href="forum.php?mod=trade&orderid=' . $tradelog['orderid'] . '&tid=' . $tradelog['tid'] . '&modthreadkey=' . modauthkey($tradelog['tid']) . '">' . $tradelog['status'] . '<br />' . $tradelog['lastupdate']));
}
$statusselect = $lang['tradelog_order_status'] . ': <select onchange="location.href=\'' . ADMINSCRIPT . '?action=tradelog&filter=\' + this.value"><option value="-1">' . $lang['tradelog_all_order'] . '</option>';
$statuss = trade_getstatus(0, -1);
foreach ($statuss as $key => $value) {
    $statusselect .= "<option value=\"{$key}\" " . ($filter == $key ? 'selected' : '') . ">{$value}</option>";
}
$statusselect .= '</select>';
showsubmit('', '', "{$lang['tradelog_order_count']} {$num}, {$lang['tradelog_trade_total']} " . intval($count['pricesum']) . " {$lang['rmb_yuan']}, {$lang['tradelog_trade_totalcredit']} {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][title]} {$count['creditsum']} {$_G[setting][extcredits][$_G['setting']['creditstransextra'][5]][unit]}, {$lang['tradelog_fee_total']} " . intval($count['taxsum']) . " {$lang['rmb_yuan']}", '', $multipage . $statusselect);
showtablefooter();