function showmagic() { global $tid, $lang; require_once DISCUZ_ROOT . './include/forum.func.php'; magicshowtype($lang['option'], 'top'); magicshowsetting($lang['target_tid'], 'tid', $tid, 'text'); magicshowsetting($lang['MVK_target'], '', '', '<select name="moveto">' . forumselect() . '</select>'); magicshowtype('', 'bottom'); }
function virtualdata_set() { global $head_url, $header_config; if (!submitcheck('submit')) { require_once libfile('function/forumlist'); $info = pick_common_get(); $info['vir_cache_time'] = $info['vir_cache_time'] ? $info['vir_cache_time'] : 10; $info['vir_data_forum'] = unserialize($info['vir_data_forum']); $info['vir_data_usergroup'] = unserialize($info['vir_data_usergroup']); $info['forumselect'] = '<select name="set[vir_data_forum][]" size="10" multiple="multiple"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $info['vir_data_forum'], TRUE) . '</select>'; return $info; } else { $set = $_GET['set']; if (!$set['vir_data_forum'][0] && count($set['vir_data_forum']) == 1) { $set['vir_data_forum'] = ''; } pick_common_set($set); save_syscache('milu_pick_vir_postdata', ''); save_syscache('milu_pick_vir_data', ''); save_syscache('milu_pick_vir_online', ''); cpmsg(milu_lang('op_success'), PICK_GO . "virtual_data", 'succeed'); } }
function forumleftside() { global $_G; $leftside = array('favorites' => array(), 'forums' => array()); $leftside['forums'] = forumselect(FALSE, 1); if ($_G['uid']) { foreach (C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], 'fid') as $id => $forum) { if ($_G['fid'] == $forum['id']) { $_G['forum_fidinfav'] = $forum['favid']; } $leftside['favorites'][$forum['id']] = array($forum['title'], $forum['favid']); } } $_G['leftsidewidth_mwidth'] = $_G['setting']['leftsidewidth'] + 15; return $leftside; }
*/ if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) { exit('Access Denied'); } cpheader(); if (!submitcheck('deletesubmit')) { require_once DISCUZ_ROOT . './include/forum.func.php'; $anchor = in_array($anchor, array('search', 'admin')) ? $anchor : 'search'; shownav('topic', 'nav_attaches'); showsubmenusteps('nav_attaches', array(array('search', !$searchsubmit), array('admin', $searchsubmit))); showtips('attach_tips', 'attach_tips', $searchsubmit); showtagheader('div', 'search', !$searchsubmit); showformheader('attach'); showtableheader(); showsetting('attach_nomatched', 'nomatched', 0, 'radio'); showsetting('attach_forum', '', '', '<select name="inforum"><option value="all"> >' . lang('all') . '</option><option value=""> </option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'); showsetting('attach_sizerange', array('sizeless', 'sizemore'), array('', ''), 'range'); showsetting('attach_dlcountrange', array('dlcountless', 'dlcountmore'), array('', ''), 'range'); showsetting('attach_daysold', 'daysold', '', 'text'); showsetting('filename', 'filename', '', 'text'); showsetting('attach_keyword', 'keywords', '', 'text'); showsetting('attach_author', 'author', '', 'text'); showsubmit('searchsubmit', 'search'); showtablefooter(); showformfooter(); showtagfooter('div'); if (submitcheck('searchsubmit')) { require_once DISCUZ_ROOT . './include/attachment.func.php'; $sql = "a.pid=p.pid"; $ppp = 100; if ($inforum != 'all') {
$settings = array('mobilewechat' => serialize($setting)); C::t('common_setting')->update_batch($settings); } if (!submitcheck('settingsubmit')) { if ($setting['wsq_siteid']) { if (in_array('plugin', $_G['setting']['rewritestatus'])) { $url = $_G['siteurl'] . rewriteoutput('plugin', 1, 'wechat', 'access'); } else { $url = $_G['siteurl'] . 'plugin.php?id=wechat:access'; } } $apilisturl = ADMINSCRIPT . '?action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=wsq_setting&viewapi=yes'; $setting['wsq_siteurl'] = $setting['wsq_siteurl'] ? $setting['wsq_siteurl'] : $_G['siteurl']; $setting['wsq_sitename'] = $setting['wsq_sitename'] ? $setting['wsq_sitename'] : $_G['setting']['bbname']; require_once libfile('function/forumlist'); $forums = '<select name="setting[wsq_fid]"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $setting['wsq_fid'], TRUE) . '</select>'; $sitelogo = $setting['wsq_sitelogo'] ? '<img src="' . $setting['wsq_sitelogo'] . '" width="150" />' : ''; $qrcode = $setting['wechat_qrcode'] ? '<img src="' . $_G['setting']['attachurl'] . 'common/' . $setting['wechat_qrcode'] . '" width="150" />' : ''; showtips(lang('plugin/wechat', 'wsq_tips', array('ADMINSCRIPT' => ADMINSCRIPT . '?action=', 'apiurl' => $apilisturl))); showformheader('plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=wsq_setting', 'enctype'); showtableheader(lang('plugin/wechat', 'wechat_wsq_setting') . ' ' . ($setting['wsq_status'] ? ' (' . lang('plugin/wechat', 'wsq_status_open') . ')' : ($setting['wsq_siteid'] ? ' (' . lang('plugin/wechat', 'wsq_status_ing') . (TIMESTAMP - $setting['wsq_lastrequest'] > 3600 ? ' <a href="' . ADMINSCRIPT . '?action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=wsq_setting&recheck=yes">[' . lang('plugin/wechat', 'wsq_status_try') . ']</a>)' : ')') : ' (' . lang('plugin/wechat', 'wsq_status_close') . ')'))); showsetting(lang('plugin/wechat', 'wsq_allow'), 'setting[wsq_allow]', $setting['wsq_allow'], 'radio', 0, 0, lang('plugin/wechat', 'wsq_allow_comment')); if ($setting['wsq_allow'] && $setting['wsq_siteid']) { showtablefooter(); showtableheader(); showsetting(lang('plugin/wechat', 'wsq_url'), '', '', '<span style="white-space:nowrap">' . $url . '</span>'); showtablefooter(); showtableheader(); showsetting(lang('plugin/wechat', 'wsq_siteid'), '', '', $setting['wsq_siteid']); showsetting(lang('plugin/wechat', 'wsq_sitetoken'), '', '', $setting['wsq_sitetoken']); }
} if (!empty($gids)) { $gforumnames = C::t('forum_forum')->fetch_all_name_by_fid(array_keys($gids)); foreach ($gids as $fid => $tid) { $list[$tid]['forumname'] = $gforumnames[$fid]['name']; $forums[$fid] = $gforumnames[$fid]['name']; } } $threads =& $list; if ($_GET['view'] != 'all') { $listcount = count($list) + $hiddennum; $multi = simplepage($listcount, $perpage, $page, $theurl); } } require_once libfile('function/forumlist'); $forumlist = forumselect(FALSE, 0, intval($_GET['fid'])); dsetcookie('home_diymode', $diymode); if ($_G['uid']) { $_GET['view'] = !$_GET['view'] ? 'we' : $_GET['view']; $navtitle = lang('core', 'title_' . $_GET['view'] . '_thread'); } else { $navtitle = lang('core', 'title_thread'); } if ($space['username']) { $navtitle = lang('space', 'sb_thread', array('who' => $space['username'])); } $metakeywords = $navtitle; $metadescription = $navtitle; if (!$_G['follow']) { include_once template("diy:home/space_thread"); }
function jsforumselect($function) { global $parameter, $lang, $db, $tablepre; if (empty($function) || in_array($function, array('forums', 'threads', 'images'))) { $forumselect = '<select name="parameter[' . $function . '_forums][]" size="5" multiple="multiple">' . '<option value="all" ' . (is_array($parameter[$function . '_forums']) && in_array('all', $parameter[$function . '_forums']) ? 'selected="selected"' : '') . '> ' . $lang['jswizard_all_forums'] . '</option>' . '<option value=""> </option>'; if ($function == 'forums') { $query = $db->query("SELECT fid, name FROM {$tablepre}forums WHERE type='group' AND status>0 ORDER BY displayorder"); while ($category = $db->fetch_array($query)) { $forumselect .= '<option value="' . $category['fid'] . '">' . strip_tags($category['name']) . '</option>'; } } else { require_once DISCUZ_ROOT . './include/forum.func.php'; $forumselect .= forumselect(); } $forumselect .= '</select>'; if (is_array($parameter[$function . '_forums'])) { foreach ($parameter[$function . '_forums'] as $key => $value) { if (!$value) { unset($parameter[$function . '_forums'][$key]); } } if (!in_array('all', $parameter[$function . '_forums'])) { $forumselect = preg_replace("/(\\<option value=\"(" . implode('|', $parameter[$function . '_forums']) . ")\")(\\>)/", "\\1 selected=\"selected\"\\3", $forumselect); } } return $forumselect; } }
} updatemembercount($_G['uid'], array($fromcredits => -$netamount), 1, 'ECU', $_G['uid']); $netamount = $amount; $amount = $tocredits = 0; } showmessage('credits_transaction_succeed', 'home.php?mod=spacecp&ac=credit&op=exchange', array(), array('showdialog' => 1, 'showmsg' => true, 'locationtime' => true)); } } else { $wheresql = ''; $list = array(); $rid = intval($_GET['rid']); if ($_GET['rid']) { $wheresql = " AND rid='{$rid}'"; } require_once libfile('function/forumlist'); $select = forumselect(false, 0, $_GET['fid']); $keys = array_keys($_G['setting']['extcredits']); foreach (C::t('common_credit_rule')->fetch_all_by_rid($rid) as $value) { if (!helper_access::check_module('doing') && $value['action'] == 'doing') { continue; } elseif (!helper_access::check_module('blog') && $value['action'] == 'publishblog') { continue; } elseif (!helper_access::check_module('wall') && in_array($value['action'], array('guestbook', 'getguestbook'))) { continue; } if (empty($_GET['fid']) || in_array($value['action'], array('digest', 'post', 'reply', 'getattach', 'postattach'))) { if (checkvalue($value, $keys)) { $list[$value['action']] = $value; } } }
showformfooter(); } elseif ($ac == 'del') { if (submitcheck('submit')) { foreach ($_GET['delete'] as $delete) { unset($setting['showactivity']['tids'][$delete]); C::t('forum_thread')->delete($delete); } $settings = array('mobilewechat' => serialize($setting)); C::t('common_setting')->update_batch($settings); updatecache(array('plugin', 'setting')); cpmsg(lang('plugin/wechat', 'show_delthread_succeed'), 'action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=showactivity_setting', 'succeed'); } } elseif ($ac == 'add') { if (!submitcheck('submit')) { echo '<script type="text/javascript" src="static/js/calendar.js"></script>'; $forumselect = "<select name=\"fid\">\n<option value=\"\"> > " . cplang('select') . "</option><option value=\"\"> </option>" . str_replace('%', '%%', forumselect(FALSE, 0, 0, TRUE)) . '</select>'; showformheader('plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=showactivity_setting&ac=add', 'enctype'); showtableheader(); showsetting(lang('plugin/wechat', 'show_title'), 'subject', '', 'text'); showsetting(lang('plugin/wechat', 'show_starttime'), 'starttimefrom', '', 'calendar', '', 0, '', 1); showsetting(lang('plugin/wechat', 'show_expiration'), 'activityexpiration', '', 'calendar', '', 0, '', 1); showsetting(lang('plugin/wechat', 'show_endtime'), 'starttimeto', '', 'calendar', '', 0, '', 1); showsetting(lang('plugin/wechat', 'show_memo'), 'message', '', 'textarea'); showsetting(lang('plugin/wechat', 'show_forum'), '', '', $forumselect); showsubmit('submit'); showtablefooter(); showformfooter(); } else { $_GET['activityclass'] = lang('plugin/wechat', 'show_thread_class'); $_GET['activityplace'] = lang('plugin/wechat', 'show_thread_place'); if (!$_GET['subject'] || !$_GET['starttimefrom'] || !$_GET['activityexpiration'] || !$_GET['message'] || !$_GET['fid']) {
foreach ($_G['setting']['extcredits'] as $key => $value) { if ($value['allowexchangein'] || $value['allowexchangeout']) { $extcredits_exchange['extcredits' . $key] = array('title' => $value['title'], 'unit' => $value['unit']); } } } $navtitle = lang('core', 'title_credit'); } else { $wheresql = ''; $list = array(); if ($_G['gp_rid']) { $rid = intval($_G['gp_rid']); $wheresql = " WHERE rid='{$rid}'"; } require_once libfile('function/forumlist'); $select = forumselect(false, 0, $_G['gp_fid']); $query = DB::query("SELECT * FROM " . DB::table('common_credit_rule') . " {$wheresql} ORDER BY rid DESC"); while ($value = DB::fetch($query)) { if (empty($_G['gp_fid']) || in_array($value['action'], array('digest', 'post', 'reply', 'getattach', 'postattach'))) { $list[$value['action']] = $value; } } if (!empty($_G['gp_fid'])) { $_G['gp_fid'] = intval($_G['gp_fid']); $flist = unserialize(DB::result_first("SELECT creditspolicy FROM " . DB::table('forum_forumfield') . " WHERE fid='{$_G['gp_fid']}'")); foreach ($flist as $action => $value) { $list[$value['action']] = $value; } } } include_once template("home/spacecp_credit_base");
private function _adminTopic($fid, $tid, $pid, $act, $type) { global $_G; $errorMsg = ''; $_GET['topiclist'] = array($_GET['pid']); // 在DISCUZ_ROOT/source/module/forum/forum_topicadmin.php基础上进行二次开发 $_GET['topiclist'] = !empty($_GET['topiclist']) ? is_array($_GET['topiclist']) ? array_unique($_GET['topiclist']) : $_GET['topiclist'] : array(); loadcache(array('modreasons', 'stamptypeid', 'threadtableids')); require_once libfile('function/post'); require_once libfile('function/misc'); $modpostsnum = 0; $resultarray = $thread = array(); if ($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3 || !empty($_GET['sendreasonpm'])) { $forumname = strip_tags($_G['forum']['name']); $sendreasonpm = 1; } else { $sendreasonpm = 0; } if ($type == 'topic') { if ($act == 'band') { $resultarray = $this->_topicAdmin_band($fid, $tid, $pid, $act, $type, array('sendreasonpm' => $sendreasonpm, 'thread' => $_G['forum_thread'])); } else { // 在DISCUZ_ROOT/source/include/topicadmin/topicadmin_moderate.php基础上进行二次开发 $thread = $_G['forum_thread']; $thread['dblastpost'] = $thread['lastpost']; $threadlist[$thread['tid']] = $thread; $modpostsnum = count($threadlist); $stickcheck = $closecheck = $digestcheck = array('', '', '', '', ''); empty($threadlist[$_G['tid']]['displayorder']) ? $stickcheck[0] = 'selected="selected"' : ($stickcheck[$threadlist[$_G['tid']]['displayorder']] = 'selected="selected"'); empty($threadlist[$_G['tid']]['digest']) ? $digestcheck[0] = 'selected="selected"' : ($digestcheck[$threadlist[$_G['tid']]['digest']] = 'selected="selected"'); empty($threadlist[$_G['tid']]['closed']) ? $closecheck[0] = 'checked="checked"' : ($closecheck[1] = 'checked="checked"'); if (!empty($_POST)) { $tidsarr = array_keys($threadlist); $moderatetids = dimplode($tidsarr); $reason = checkreasonpm(); $stampstatus = 0; $stampaction = 'SPA'; $operationMap = array('top' => 'stick', 'marrow' => 'digest', 'delete' => 'delete'); $operation = $operationMap[$act]; $updatemodlog = TRUE; switch ($act) { case 'top': $sticklevel = intval($_GET['sticklevel']); if ($sticklevel < 0 || $sticklevel > 3 || $sticklevel > $_G['group']['allowstickthread']) { // showmessage('no_privilege_stickthread'); $this->_exitWithHtmlAlert('no_privilege_stickthread'); } $expiration = checkexpiration($_GET['expirationstick'], $operation); $expirationstick = $sticklevel ? $_GET['expirationstick'] : 0; $forumstickthreads = $_G['setting']['forumstickthreads']; $forumstickthreads = isset($forumstickthreads) ? dunserialize($forumstickthreads) : array(); C::t('forum_thread')->update($tidsarr, array('displayorder' => $sticklevel, 'moderated' => 1), true); $delkeys = array_keys($threadlist); foreach ($delkeys as $k) { unset($forumstickthreads[$k]); } C::t('common_setting')->update('forumstickthreads', $forumstickthreads); $stickmodify = 0; foreach ($threadlist as $thread) { $stickmodify = (in_array($thread['displayorder'], array(2, 3)) || in_array($sticklevel, array(2, 3))) && $sticklevel != $thread['displayorder'] ? 1 : $stickmodify; } if ($_G['setting']['globalstick'] && $stickmodify) { require_once libfile('function/cache'); updatecache('globalstick'); } $modaction = $sticklevel ? $expiration ? 'EST' : 'STK' : 'UST'; C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('STK', 'UST', 'EST', 'UES'), array('status' => 0)); if (!$sticklevel) { $stampaction = 'SPD'; } $stampstatus = 1; break; case 'marrow': $digestlevel = intval($_GET['digestlevel']); if ($digestlevel < 0 || $digestlevel > 3 || $digestlevel > $_G['group']['allowdigestthread']) { // showmessage('no_privilege_digestthread'); $this->_exitWithHtmlAlert('no_privilege_digestthread'); } $expiration = checkexpiration($_GET['expirationdigest'], $operation); $expirationdigest = $digestlevel ? $expirationdigest : 0; C::t('forum_thread')->update($tidsarr, array('digest' => $digestlevel, 'moderated' => 1), true); foreach ($threadlist as $thread) { if ($thread['digest'] != $digestlevel) { if ($digestlevel == $thread['digest']) { continue; } $extsql = array(); if ($digestlevel > 0 && $thread['digest'] == 0) { $extsql = array('digestposts' => 1); } if ($digestlevel == 0 && $thread['digest'] > 0) { $extsql = array('digestposts' => -1); } if ($digestlevel == 0) { $stampaction = 'SPD'; } updatecreditbyaction('digest', $thread['authorid'], $extsql, '', $digestlevel - $thread['digest']); } } $modaction = $digestlevel ? $expiration ? 'EDI' : 'DIG' : 'UDG'; C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('DIG', 'UDI', 'EDI', 'UED'), array('status' => 0)); $stampstatus = 2; break; case 'delete': if (!$_G['group']['allowdelpost']) { // showmessage('no_privilege_delpost'); $this->_exitWithHtmlAlert('no_privilege_delpost'); } loadcache('threadtableids'); $stickmodify = 0; $deleteredirect = $remarkclosed = array(); foreach ($threadlist as $thread) { if ($thread['digest']) { updatecreditbyaction('digest', $thread['authorid'], array('digestposts' => -1), '', -$thread['digest']); } if (in_array($thread['displayorder'], array(2, 3))) { $stickmodify = 1; } if ($_G['forum']['status'] == 3 && $thread['closed'] > 1) { $deleteredirect[] = $thread['closed']; } if ($thread['isgroup'] == 1 && $thread['closed'] > 1) { $remarkclosed[] = $thread['closed']; } } $modaction = 'DEL'; require_once libfile('function/delete'); $tids = array_keys($threadlist); if ($_G['forum']['recyclebin']) { deletethread($tids, true, true, true); manage_addnotify('verifyrecycle', $modpostsnum); } else { deletethread($tids, true, true); $updatemodlog = FALSE; } $forumstickthreads = $_G['setting']['forumstickthreads']; $forumstickthreads = !empty($forumstickthreads) ? dunserialize($forumstickthreads) : array(); $delkeys = array_keys($threadlist); foreach ($delkeys as $k) { unset($forumstickthreads[$k]); } C::t('common_setting')->update('forumstickthreads', $forumstickthreads); C::t('forum_forum_threadtable')->delete_none_threads(); if (!empty($deleteredirect)) { deletethread($deleteredirect); } if (!empty($remarkclosed)) { C::t('forum_thread')->update($remarkclosed, array('closed' => 0)); } if ($_G['setting']['globalstick'] && $stickmodify) { require_once libfile('function/cache'); updatecache('globalstick'); } updateforumcount($_G['fid']); if ($_GET['crimerecord']) { include_once libfile('function/member'); foreach ($threadlist as $thread) { crime('recordaction', $thread['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $thread['tid'], 'pid' => 0))); } } break; case 'close': if (!$_G['group']['allowclosethread']) { $this->_exitWithHtmlAlert('no_privilege_closethread'); } $expiration = checkexpiration($_GET['expirationclose'], $operation); $modaction = $expiration ? 'ECL' : 'CLS'; C::t('forum_thread')->update($tidsarr, array('closed' => 1, 'moderated' => 1), true); C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('CLS', 'OPN', 'ECL', 'UCL', 'EOP', 'UEO'), array('status' => 0)); break; case 'open': if (!$_G['group']['allowclosethread']) { $this->_exitWithHtmlAlert('no_privilege_openthread'); } $expiration = checkexpiration($_GET['expirationclose'], $operation); $modaction = $expiration ? 'EOP' : 'OPN'; C::t('forum_thread')->update($tidsarr, array('closed' => 0, 'moderated' => 1), true); C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('CLS', 'OPN', 'ECL', 'UCL', 'EOP', 'UEO'), array('status' => 0)); break; case 'move': if (!$_G['group']['allowmovethread']) { $this->_exitWithHtmlAlert('no_privilege_movethread'); } $moveto = $_GET['moveto']; $toforum = C::t('forum_forum')->fetch_info_by_fid($moveto); if (!$toforum || $_G['adminid'] != 1 && $toforum['status'] != 1 || $toforum['type'] == 'group') { // showmessage('admin_move_invalid'); $this->_exitWithHtmlAlert('admin_move_invalid'); } elseif ($_G['fid'] == $toforum['fid']) { continue; } else { $moveto = $toforum['fid']; $modnewthreads = (!$_G['group']['allowdirectpost'] || $_G['group']['allowdirectpost'] == 1) && $toforum['modnewposts'] ? 1 : 0; $modnewreplies = (!$_G['group']['allowdirectpost'] || $_G['group']['allowdirectpost'] == 2) && $toforum['modnewposts'] ? 1 : 0; if ($modnewthreads || $modnewreplies) { // showmessage('admin_move_have_mod'); $this->_exitWithHtmlAlert('admin_move_have_mod'); } } if ($_G['adminid'] == 3) { $priv = C::t('forum_forumfield')->check_moderator_for_uid($moveto, $_G['uid'], $_G['member']['accessmasks']); if (($priv['postperm'] && !in_array($_G['groupid'], explode("\t", $priv['postperm'])) || $_G['member']['accessmasks'] && ($priv['allowview'] || $priv['allowreply'] || $priv['allowgetattach'] || $priv['allowpostattach']) && !$priv['allowpost']) && !$priv['istargetmod']) { // showmessage('admin_move_nopermission'); $this->_exitWithHtmlAlert('admin_move_nopermission'); } } $moderate = array(); $stickmodify = 0; $toforumallowspecial = array(1 => $toforum['allowpostspecial'] & 1, 2 => $toforum['allowpostspecial'] & 2, 3 => isset($_G['setting']['extcredits'][$_G['setting']['creditstransextra'][2]]) && $toforum['allowpostspecial'] & 4, 4 => $toforum['allowpostspecial'] & 8, 5 => $toforum['allowpostspecial'] & 16, 127 => $_G['setting']['threadplugins'] ? dunserialize($toforum['threadplugin']) : array()); foreach ($threadlist as $tid => $thread) { $allowmove = 0; if (!$thread['special']) { $allowmove = 1; } else { if ($thread['special'] != 127) { $allowmove = $toforum['allowpostspecial'] ? $toforumallowspecial[$thread['special']] : 0; } else { if ($toforumallowspecial[127]) { $posttable = getposttablebytid($thread['tid']); $message = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']); $message = $message['message']; $sppos = strrpos($message, chr(0) . chr(0) . chr(0)); $specialextra = substr($message, $sppos + 3); $allowmove = in_array($specialextra, $toforumallowspecial[127]); } else { $allowmove = 0; } } } if ($allowmove) { $moderate[] = $tid; if (in_array($thread['displayorder'], array(2, 3))) { $stickmodify = 1; } if ($_GET['appbyme_movetype'] == 'redirect') { // if($_GET['type'] == 'redirect') { $insertdata = array('fid' => $thread['fid'], 'readperm' => $thread['readperm'], 'author' => $thread['author'], 'authorid' => $thread['authorid'], 'subject' => $thread['subject'], 'dateline' => $thread['dateline'], 'lastpost' => $thread['dblastpost'], 'lastposter' => $thread['lastposter'], 'views' => 0, 'replies' => 0, 'displayorder' => 0, 'digest' => 0, 'closed' => $thread['tid'], 'special' => 0, 'attachment' => 0, 'typeid' => $_GET['threadtypeid']); $newtid = C::t('forum_thread')->insert($insertdata, true); if ($newtid) { C::t('forum_threadclosed')->insert(array('tid' => $thread['tid'], 'redirect' => $newtid), true, true); } } } } if (!($moderatetids = implode(',', $moderate))) { showmessage('admin_moderate_invalid'); } $fieldarr = array('fid' => $moveto, 'isgroup' => 0, 'typeid' => $_GET['threadtypeid'], 'moderated' => 1); if ($_G['adminid'] == 3) { $fieldarr['displayorder'] = 0; } C::t('forum_thread')->update($tidsarr, $fieldarr, true); C::t('forum_forumrecommend')->update($tidsarr, array('fid' => $moveto)); loadcache('posttableids'); $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0'); foreach ($posttableids as $id) { C::t('forum_post')->update_by_tid($id, $tidsarr, array('fid' => $moveto)); } $typeoptionvars = C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tidsarr); foreach ($typeoptionvars as $typeoptionvar) { C::t('forum_typeoptionvar')->update_by_tid($typeoptionvar['tid'], array('fid' => $moveto)); C::t('forum_optionvalue')->update($typeoptionvar['sortid'], $typeoptionvar['tid'], $_G['fid'], "fid='{$moveto}'"); } if ($_G['setting']['globalstick'] && $stickmodify) { require_once libfile('function/cache'); updatecache('globalstick'); } $modaction = 'MOV'; $_G['toforum'] = $toforum; updateforumcount($moveto); updateforumcount($_G['fid']); break; default: $errorMsg = '错误的动作参数'; break; } if ($errorMsg == '') { if ($updatemodlog) { if ($operation != 'delete') { updatemodlog($moderatetids, $modaction, $expiration); } else { updatemodlog($moderatetids, $modaction, $expiration, 0, $reason); } } updatemodworks($modaction, $modpostsnum); foreach ($threadlist as $thread) { modlog($thread, $modaction); } if ($sendreasonpm) { $modactioncode = lang('forum/modaction'); $modtype = $modaction; $modaction = $modactioncode[$modaction]; foreach ($threadlist as $thread) { if ($operation == 'move') { sendreasonpm($thread, 'reason_move', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'tofid' => $toforum['fid'], 'toname' => $toforum['name'], 'from_id' => 0, 'from_idtype' => 'movethread')); } else { sendreasonpm($thread, 'reason_moderate', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'moderate_' . $modtype)); } } } if ($stampstatus) { set_stamp($stampstatus, $stampaction, $threadlist, $expiration); } $this->getController()->redirect(WebUtils::createUrl_oldVersion('index/returnmobileview')); } } else { if ($act == 'move') { require_once libfile('function/forumlist'); $forumselect = forumselect(FALSE, 0, $threadlist[$_G['tid']]['fid'], $_G['adminid'] == 1 ? TRUE : FALSE); } } } } else { if ($type == 'post') { if ($act == 'band') { $resultarray = $this->_topicAdmin_band($fid, $tid, $pid, $act, $type, array('sendreasonpm' => $sendreasonpm, 'thread' => $_G['forum_thread'])); } else { // 在DISCUZ_ROOT/source/include/topicadmin/topicadmin_delpost.php基础上进行二次开发 $resultarray = array(); $thread = $_G['forum_thread']; $topiclist = array($pid); $modpostsnum = 1; $pids = $posts = $authors = array(); $posttable = getposttablebytid($_G['tid']); foreach (C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $topiclist, false) as $post) { if ($post['tid'] != $_G['tid']) { continue; } if ($post['first'] == 1) { dheader("location: {$_G['siteurl']}forum.php?mod=topicadmin&action=moderate&operation=delete&optgroup=3&fid={$_G['fid']}&moderate[]={$thread['tid']}&inajax=yes" . ($_GET['infloat'] ? "&infloat=yes&handlekey={$_GET['handlekey']}" : '')); } else { $authors[$post['authorid']] = 1; $pids[] = $post['pid']; $posts[] = $post; } } if (!empty($_POST)) { $reason = checkreasonpm(); $uidarray = $puidarray = $auidarray = array(); $losslessdel = $_G['setting']['losslessdel'] > 0 ? TIMESTAMP - $_G['setting']['losslessdel'] * 86400 : 0; if ($pids) { require_once libfile('function/delete'); if ($_G['forum']['recyclebin']) { deletepost($pids, 'pid', true, false, true); manage_addnotify('verifyrecyclepost', $modpostsnum); } else { $logs = array(); $ratelog = C::t('forum_ratelog')->fetch_all_by_pid($pids); $rposts = C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $pids, false); foreach (C::t('forum_ratelog')->fetch_all_by_pid($pids) as $rpid => $author) { if ($author['score'] > 0) { $rpost = $rposts[$rpid]; updatemembercount($rpost['authorid'], array($author['extcredits'] => -$author['score'])); $author['score'] = $_G['setting']['extcredits'][$id]['title'] . ' ' . -$author['score'] . ' ' . $_G['setting']['extcredits'][$id]['unit']; $logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['adminid']}\t{$rpost['author']}\t{$author['extcredits']}\t{$author['score']}\t{$thread['tid']}\t{$thread['subject']}\t{$delpostsubmit}"); } } if (!empty($logs)) { writelog('ratelog', $logs); unset($logs); } deletepost($pids, 'pid', true); } if ($_GET['crimerecord']) { include_once libfile('function/member'); foreach ($posts as $post) { crime('recordaction', $post['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $post['tid'], 'pid' => $post['pid']))); } } } updatethreadcount($_G['tid'], 1); updateforumcount($_G['fid']); $_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']); $modaction = 'DLP'; $resultarray = array('redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_delete_post', 'notictype' => 'post') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), 'modtids' => 0, 'modlog' => $thread); } } } } // 在DISCUZ_ROOT/source/module/forum/forum_topicadmin.php基础上进行二次开发 if ($resultarray) { if ($resultarray['modtids']) { updatemodlog($resultarray['modtids'], $modaction, $resultarray['expiration']); } updatemodworks($modaction, $modpostsnum); if (is_array($resultarray['modlog'])) { if (isset($resultarray['modlog']['tid'])) { modlog($resultarray['modlog'], $modaction); } else { foreach ($resultarray['modlog'] as $thread) { modlog($thread, $modaction); } } } if ($resultarray['reasonpm']) { $modactioncode = lang('forum/modaction'); $modaction = $modactioncode[$modaction]; foreach ($resultarray['reasonpm']['data'] as $var) { sendreasonpm($var, $resultarray['reasonpm']['item'], $resultarray['reasonvar'], $resultarray['reasonpm']['notictype']); } } // showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']); $this->getController()->redirect(WebUtils::createUrl_oldVersion('index/returnmobileview')); } $this->getController()->renderPartial('topicAdmin', array('formUrl' => WebUtils::createUrl_oldVersion('forum/topicadminview', array('fid' => $fid, 'tid' => $tid, 'pid' => $pid, 'act' => $act, 'type' => $type)), 'errorMsg' => $errorMsg, 'action' => $act, '_G' => $_G, 'stickcheck' => $stickcheck, 'digestcheck' => $digestcheck, 'closecheck' => $closecheck, 'forumselect' => WebUtils::u($forumselect))); }
<?php /** * [Discuz!] (C)2001-2099 Comsenz Inc. * This is NOT a freeware, use is subject to license terms * * $Id: modcp_forumaccess.php 7421 2010-04-07 07:16:34Z monkey $ */ if (!defined('IN_DISCUZ') || !defined('IN_MODCP')) { exit('Access Denied'); } $list = $logids = array(); include_once libfile('function/forumlist'); $forumlistall = forumselect(false, false, $_G['fid']); $adderror = $successed = 0; $new_user = isset($_G['gp_new_user']) ? trim($_G['gp_new_user']) : ''; if ($_G['fid'] && $_G['forum']['ismoderator'] && $new_user != '' && submitcheck('addsubmit')) { $deleteaccess = isset($_G['gp_deleteaccess']) ? 1 : 0; foreach (array('view', 'post', 'reply', 'getattach', 'postattach', 'postimage') as $key) { ${'new_' . $key} = isset($_G['gp_new_' . $key]) ? intval($_G['gp_new_' . $key]) : ''; } if ($new_user != '') { $user = DB::fetch_first("SELECT uid, adminid FROM " . DB::table('common_member') . " WHERE username='******'"); $uid = $user['uid']; if (empty($user)) { $adderror = 1; } elseif ($user['adminid'] && $_G['adminid'] != 1) { $adderror = 2; } else { $access = DB::fetch_first("SELECT * FROM " . DB::table('forum_access') . " WHERE fid='{$_G['fid']}' AND uid='{$uid}'"); if ($deleteaccess) {
showsetting('settings_functions_other_pwdsafety', 'settingsnew[pwdsafety]', $settings['pwdsafety'], 'radio'); showsetting('settings_functions_other_rssstatus', 'settingsnew[rssstatus]', $settings['rssstatus'], 'radio'); showsetting('settings_functions_other_rssttl', 'settingsnew[rssttl]', $settings['rssttl'], 'text'); showsetting('settings_functions_other_send_birthday', 'settingsnew[bdaystatus]', $settings['bdaystatus'], 'radio'); showsetting('settings_functions_other_debug', 'settingsnew[debug]', $settings['debug'], 'radio'); showsetting('settings_functions_other_activity_type', 'settingsnew[activitytype]', $settings['activitytype'], 'textarea'); showtablefooter(); showtableheader('', 'notop'); showsubmit('settingsubmit'); showtablefooter(); showformfooter(); cpfooter(); exit; } elseif ($operation == 'permissions') { include_once DISCUZ_ROOT . './include/forum.func.php'; $forumselect = '<select name="settingsnew[allowviewuserthread][fids][]" multiple="multiple" size="10">' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; $settings['allowviewuserthread'] = unserialize($settings['allowviewuserthread']); if ($settings['allowviewuserthread']['fids']) { foreach ($settings['allowviewuserthread']['fids'] as $v) { $forumselect = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $forumselect); } } showtableheader(); showsetting('settings_permissions_allowviewuserthread', 'settingsnew[allowviewuserthread][allow]', $settings['allowviewuserthread']['allow'], 'radio', 0, 1); showsetting('settings_permissions_allowviewuserthread_fids', '', '', $forumselect); showtagfooter('tbody'); showsetting('settings_permissions_memliststatus', 'settingsnew[memliststatus]', $settings['memliststatus'], 'radio'); showsetting('settings_permissions_reportpost', 'settingsnew[reportpost]', $settings['reportpost'], 'radio'); showsetting('settings_permissions_minpostsize', 'settingsnew[minpostsize]', $settings['minpostsize'], 'text'); showsetting('settings_permissions_maxpostsize', 'settingsnew[maxpostsize]', $settings['maxpostsize'], 'text'); showsetting('settings_permissions_favorite_storage', 'settingsnew[maxfavorites]', $settings['maxfavorites'], 'text');
* This is NOT a freeware, use is subject to license terms * * $Id: admincp_prune.php 20479 2011-02-24 09:06:10Z congyushuai $ */ if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) { exit('Access Denied'); } cpheader(); $searchsubmit = $_G['gp_searchsubmit']; $fromumanage = $_G['gp_fromumanage'] ? 1 : 0; require_once libfile('function/misc'); loadcache('forums'); if (!submitcheck('prunesubmit')) { require_once libfile('function/forumlist'); if ($_G['adminid'] == 1 || $_G['adminid'] == 2) { $forumselect = '<select name="forums"><option value=""> > ' . $lang['select'] . '</option>' . '<option value=""> </option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; if ($_G['gp_forums']) { $forumselect = preg_replace("/(\\<option value=\"{$_G['gp_forums']}\")(\\>)/", "\\1 selected=\"selected\" \\2", $forumselect); } } else { $forumselect = $comma = ''; $query = DB::query("SELECT f.name FROM " . DB::table('forum_moderator') . " m, " . DB::table('forum_forum') . " f WHERE m.uid='{$_G['uid']}' AND m.fid=f.fid"); while ($forum = DB::fetch($query)) { $forumselect .= $comma . $forum['name']; $comma = ', '; } $forumselect = $forumselect ? $forumselect : $lang['none']; } if ($fromumanage) { $starttime = !preg_match("/^(0|\\d{4}\\-\\d{1,2}\\-\\d{1,2})\$/", $_G['gp_starttime']) ? '' : $_G['gp_starttime']; $endtime = $_G['adminid'] == 3 || !preg_match("/^(0|\\d{4}\\-\\d{1,2}\\-\\d{1,2})\$/", $_G['gp_endtime']) ? '' : $_G['gp_endtime'];
showtableheader('add', 'fixpadding'); showsetting('threads_forumstick_threadurl', 'forumstick_url', '', 'text'); $targetsselect = '<select name="forumsticktargets[]" size="10" multiple="multiple">' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; require_once libfile('function/group'); $groupselect = '<select name="forumsticktargets[]" size="10" multiple="multiple">' . get_groupselect(0, 0, 0) . '</select>'; showsetting('threads_forumstick_targets', '', '', $targetsselect); showsetting('threads_forumstick_targetgroups', '', '', $groupselect); echo '<input type="hidden" value="add" name="do" />'; showsubmit('forumsticksubmit', 'submit'); showtablefooter(); showformfooter(); } elseif ($do == 'edit') { require_once libfile('function/forumlist'); showformheader("threads&operation=forumstick&do=edit&id={$_G['gp_id']}"); showtableheader('edit', 'fixpadding'); $targetsselect = '<select name="forumsticktargets[]" size="10" multiple="multiple">' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; require_once libfile('function/group'); $groupselect = '<select name="forumsticktargets[]" size="10" multiple="multiple">' . get_groupselect(0, 0, 0) . '</select>'; foreach ($forumstickthreads[$_G['gp_id']]['forums'] as $target) { $targetsselect = preg_replace("/(\\<option value=\"{$target}\")([^\\>]*)(\\>)/", "\\1 \\2 selected=\"selected\" \\3", $targetsselect); $groupselect = preg_replace("/(\\<option value=\"{$target}\")([^\\>]*)(\\>)/", "\\1 \\2 selected=\"selected\" \\3", $groupselect); } showsetting('threads_forumstick_targets', '', '', $targetsselect); showsetting('threads_forumstick_targetgroups', '', '', $groupselect); echo '<input type="hidden" value="edit" name="do" />'; echo "<input type=\"hidden\" value=\"{$_G['gp_id']}\" name=\"id\" />"; showsubmit('forumsticksubmit', 'submit'); showtablefooter(); showformfooter(); } } else {
$allowpost = $forum['allowpost'] != -1 ? $allowpost : false; $addfeedcheck = $customaddfeed & 1 ? 'checked="checked"': ''; $showpoll = $showtrade = $showreward = $showactivity = $showdebate = 0; if($forum['allowpostspecial']) { $showpoll = $forum['allowpostspecial'] & 1; $showtrade = $forum['allowpostspecial'] & 2; $showreward = isset($extcredits[$creditstransextra[2]]) && ($forum['allowpostspecial'] & 4); $showactivity = $forum['allowpostspecial'] & 8; $showdebate = $forum['allowpostspecial'] & 16; } if($allowpost) { $allowpostpoll = $allowpostpoll && $showpoll; $allowposttrade = $allowposttrade && $showtrade; $allowpostreward = $allowpostreward && $showreward; $allowpostactivity = $allowpostactivity && $showactivity; $allowpostdebate = $allowpostdebate && $showdebate; } $forum['threadplugin'] = $allowpost && $threadplugins ? unserialize($forum['threadplugin']) : array(); if($forumjump) { $forummenu = forumselect(FALSE, 1); } $template = $sortid ? 'forumdisplay_sort' : 'forumdisplay'; include template($template); ?>
showsetting('tasks_add_limit_forumid', '', '', '<SELECT name="forumid"><option value="">' . lang('nolimit') . '</option>' . forumselect(FALSE, 0, $taskvars['complete']['forumid']['value']) . '</select>'); showtagfooter('tbody'); showtagheader('tbody', 'speciallimit', $taskvars['complete']['act']['value'] == 'newreply'); showsetting('tasks_add_limit_threadid', 'threadid', $taskvars['complete']['threadid']['value'] ? $taskvars['complete']['threadid']['value'] : '', 'text'); $author = $taskvars['complete']['authorid']['value'] && ($author = $db->result_first("SELECT username FROM {$tablepre}members WHERE uid='{$taskvars[complete][authorid][value]}'")) ? $author : ''; showsetting('tasks_add_limit_authorid', 'author', $author, 'text'); showtagfooter('tbody'); showsetting('tasks_add_limit_num', 'num', $taskvars['complete']['num']['value'], 'text'); showsetting('tasks_add_limit_time', 'time', $taskvars['complete']['time']['value'], 'text'); } else { if ($taskvars['complete']) { foreach ($taskvars['complete'] as $taskvar) { if ($taskvar['variable']) { if ($taskvar['variable'] == 'forumid') { require_once DISCUZ_ROOT . './include/forum.func.php'; showsetting($taskvar['name'], '', '', '<SELECT name="forumid"><option value="">' . lang('nolimit') . '</option>' . forumselect(FALSE, 0, $taskvars['complete']['forumid']['value']) . '</select>'); } elseif ($taskvar['variable'] == 'authorid') { $author = $taskvars['complete']['authorid']['value'] && ($author = $db->result_first("SELECT username FROM {$tablepre}members WHERE uid='{$taskvars[complete][authorid][value]}'")) ? $author : ''; showsetting($taskvar['name'], 'author', $author, 'text', '', 0, $taskvar['description']); } else { showsetting($taskvar['name'], !empty($task_condition_variable[$taskvar['variable']]) ? $task_condition_variable[$taskvar['variable']] : $taskvar['variable'], $taskvar['value'], $taskvar['type'], '', 0, $taskvar['description']); } } else { showsetting($taskvar['name'], $taskvar['variable'], $taskvar['value'], $taskvar['description']); } } } else { showtablerow('', 'class="td27" colspan="2"', lang('nolimit')); } if ($taskvars['setting']) { showtitle('tasks_add_settings');
} } $specialfollow = C::t('home_follow')->fetch_all_following_by_uid($uid, 1, 10); } if ($viewself) { if (!isset($_G['cache']['forums'])) { loadcache('forums'); } $fields = C::t('forum_forumfield')->fetch_all_by_fid(array_keys($_G['cache']['forums'])); foreach ($fields as $fid => $field) { if (!empty($field['threadsorts'])) { unset($_G['cache']['forums'][$fid]); } } require_once libfile('function/forumlist'); $forumlist = forumselect(); $defaultforum = $_G['setting']['followforumid'] ? $_G['cache']['forums'][$_G['setting']['followforumid']] : array(); require_once libfile('function/upload'); $swfconfig = getuploadconfig($_G['uid']); } if ($do == 'feed') { $navigation = ' <em>›</em> <a href="home.php?mod=follow&view=' . $view . '">' . lang('space', 'follow_view_' . $view) . '</a>'; $navtitle = lang('space', 'follow_view_' . $view); } elseif ($do == 'view') { $navigation = ' <em>›</em> <a href="home.php?mod=space&uid=' . $uid . '">' . $space['username'] . '</a>'; if ($type != 'feed') { $navigation .= ' <em>›</em> ' . lang('space', 'follow_view_type_feed') . '</a>'; } $navtitle = lang('space', 'follow_view_feed', array('who' => $space['username'])); } else { $navigation = ' <em>›</em> <a href="home.php?mod=space&uid=' . $uid . '">' . $space['username'] . '</a> <em>›</em> ' . lang('space', 'follow_view_' . ($viewself ? 'my' : 'do') . '_' . $do);
} DB::query("UPDATE " . DB::table('forum_forumfield') . " SET founderuid='{$suid}', foundername='{$user['username']}' WHERE fid='{$_G['fid']}'"); DB::query("UPDATE " . DB::table('forum_groupuser') . " SET level='1' WHERE fid='{$_G['fid']}' AND uid='{$suid}'"); update_groupmoderators($_G['fid']); sendpm($suid, lang('group/misc', 'group_demise_message_title', array('forum' => $_G['forum']['name'])), lang('group/misc', 'group_demise_message_body', array('forum' => $_G['forum']['name'], 'siteurl' => $_G['siteurl'], 'fid' => $_G['fid'])), $_G['uid']); showmessage('group_demise_succeed', 'forum.php?mod=group&action=manage&fid=' . $_G['fid']); } } else { showmessage('group_demise_founder_only'); } } else { showmessage('undefined_action'); } include template('diy:group/group:' . $_G['fid']); } elseif ($action == 'recommend') { if (!$_G['forum']['ismoderator'] || !in_array($_G['adminid'], array(1, 2))) { showmessage('group_admin_noallowed'); } if (submitcheck('grouprecommend')) { if ($_G['gp_recommend'] != $_G['forum']['recommend']) { DB::query("UPDATE " . DB::table('forum_forum') . " SET recommend='" . intval($_G['gp_recommend']) . "' WHERE fid='{$_G['fid']}'"); require_once libfile('function/cache'); updatecache('forumrecommend'); } showmessage('grouprecommend_succeed', '', array(), array('closetime' => true, 'showdialog' => 1)); } else { require_once libfile('function/forumlist'); $forumselect = forumselect(FALSE, 0, $_G['forum']['recommend']); } include template('group/group_recommend'); }
if (!submitcheck('modsubmit')) { $stickcheck = $closecheck = $digestcheck = array('', '', '', '', ''); $expirationdigest = $expirationhighlight = $expirationclose = ''; if ($_G['gp_optgroup'] == 1 && $single) { empty($threadlist[$_G['tid']]['displayorder']) ? $stickcheck[0] = 'selected="selected"' : ($stickcheck[$threadlist[$_G['tid']]['displayorder']] = 'selected="selected"'); empty($threadlist[$_G['tid']]['digest']) ? $digestcheck[0] = 'selected="selected"' : ($digestcheck[$threadlist[$_G['tid']]['digest']] = 'selected="selected"'); $string = sprintf('%02d', $threadlist[$_G['tid']]['highlight']); $stylestr = sprintf('%03b', $string[0]); for ($i = 1; $i <= 3; $i++) { $stylecheck[$i] = $stylestr[$i - 1] ? 1 : 0; } $colorcheck = $string[1]; $_G['forum']['modrecommend'] = is_array($_G['forum']['modrecommend']) ? $_G['forum']['modrecommend'] : array(); } elseif ($_G['gp_optgroup'] == 2 || $_G['gp_optgroup'] == 5) { require_once libfile('function/forumlist'); $forumselect = forumselect(FALSE, 0, $threadlist[$_G['tid']]['fid']); $typeselect = typeselect($single ? $threadlist[$_G['tid']]['typeid'] : 0); } elseif ($_G['gp_optgroup'] == 4 && $single) { empty($threadlist[$_G['tid']]['closed']) ? $closecheck[0] = 'checked="checked"' : ($closecheck[1] = 'checked="checked"'); } $imgattach = array(); if (count($threadlist) == 1 && $operation == 'recommend') { $query = DB::query("SELECT * FROM " . DB::table(getattachtablebytid($_G['tid'])) . " WHERE tid='{$_G['tid']}' AND isimage IN ('1', '-1')"); while ($row = DB::fetch($query)) { $imgattach[] = $row; } $query = DB::query("SELECT * FROM " . DB::table('forum_forumrecommend') . " WHERE tid='{$_G['tid']}'"); if ($oldthread = DB::fetch($query)) { $threadlist[$_G['tid']]['subject'] = $oldthread['subject']; $selectposition[$oldthread['position']] = ' selected="selected"'; $selectattach = $oldthread['aid'];
$postcomment_cache_pid[$postcomment['pid']] = $postcomment['pid']; } C::t('forum_postcomment')->delete_by_authorid($member['uid']); if ($postcomment_cache_pid) { C::t('forum_postcache')->delete($postcomment_cache_pid); } } if ($membercount) { DB::update('common_member_count' . $tableext, $membercount, "uid='{$member['uid']}'"); } } cpmsg('members_edit_succeed', 'action=members&operation=ban&uid=' . $member['uid'], 'succeed'); } } elseif ($operation == 'access') { require_once libfile('function/forumlist'); $forumlist = '<SELECT name="addfid">' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; loadcache('forums'); if (!submitcheck('accesssubmit')) { shownav('user', 'members_access_edit'); showsubmenu('members_access_edit'); showtips('members_access_tips'); showtableheader(cplang('members_access_now') . ' - ' . $member['username'], 'nobottom fixpadding'); showsubtitle(array('forum', 'members_access_view', 'members_access_post', 'members_access_reply', 'members_access_getattach', 'members_access_getimage', 'members_access_postattach', 'members_access_postimage', 'members_access_adminuser', 'members_access_dateline')); $accessmasks = C::t('forum_access')->fetch_all_by_uid($_GET['uid']); foreach ($accessmasks as $id => $access) { $adminuser = C::t('common_member' . $tableext)->fetch($access['adminuser']); $access['dateline'] = $access['dateline'] ? dgmdate($access['dateline']) : ''; $forum = $_G['cache']['forums'][$id]; showtablerow('', '', array(($forum['type'] == 'forum' ? '' : '|-----') . " <a href=\"" . ADMINSCRIPT . "?action=forums&operation=edit&fid={$forum['fid']}&anchor=perm\">{$forum['name']}</a>", accessimg($access['allowview']), accessimg($access['allowpost']), accessimg($access['allowreply']), accessimg($access['allowgetattach']), accessimg($access['allowgetimage']), accessimg($access['allowpostattach']), accessimg($access['allowpostimage']), $adminuser['username'], $access['dateline'])); } if (empty($accessmasks)) {
$evilthreads = DB::result_first("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey = 'cloud_security_stats_thread'"); $evilposts = DB::result_first("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey = 'cloud_security_stats_post'"); $evilmembers = DB::result_first("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey = 'cloud_security_stats_member'"); $usergroupswhitelist = unserialize($_G['setting']['security_usergroups_white_list']); $groupselect = array(); $usergroupid = isset($_G['gp_usergroupid']) && is_array($_G['gp_usergroupid']) ? $_G['gp_usergroupid'] : array(); $query = DB::query("SELECT type, groupid, grouptitle, radminid FROM " . DB::table('common_usergroup') . " WHERE groupid NOT IN ('6', '7') ORDER BY (creditshigher<>'0' || creditslower<>'0'), creditslower, groupid"); while ($group = DB::fetch($query)) { $group['type'] = $group['type'] == 'special' && $group['radminid'] ? 'specialadmin' : $group['type']; $groupselect[$group['type']] .= "<option value=\"{$group['groupid']}\" " . (in_array($group['groupid'], $usergroupswhitelist) ? 'selected' : '') . ">{$group['grouptitle']}</option>\n"; } $groupselect = '<optgroup label="' . $lang['usergroups_member'] . '">' . $groupselect['member'] . '</optgroup>' . ($groupselect['special'] ? '<optgroup label="' . $lang['usergroups_special'] . '">' . $groupselect['special'] . '</optgroup>' : '') . ($groupselect['specialadmin'] ? '<optgroup label="' . $lang['usergroups_specialadmin'] . '">' . $groupselect['specialadmin'] . '</optgroup>' : '') . '<optgroup label="' . $lang['usergroups_system'] . '">' . $groupselect['system'] . '</optgroup>'; $forumswhitelist = unserialize($_G['setting']['security_forums_white_list']); require_once libfile('function/forumlist'); loadcache('forums'); $forumselect = str_replace('%', '%%', forumselect(FALSE, 0, $forumswhitelist, TRUE)); showformheader('cloud&operation=security&anchor=setting'); showtableheader('security_white_list_setting', '', '', 2); showsetting('security_usergroup_white_list', '', '', '<select name="groupid[]" multiple="multiple" size="10">' . $groupselect . '</select>'); showsetting('security_forum_white_list', '', '', '<select name="fid[]" multiple="multiple" size="10">' . $forumselect . '</select>'); showsubmit('settingsubmit'); showtablefooter(); showformfooter(); } else { $usergroups = $_POST['groupid']; $forums = $_POST['fid']; DB::query("REPLACE INTO " . DB::table('common_setting') . " (`skey`, `svalue`) VALUES ('security_usergroups_white_list', '" . serialize($usergroups) . "'), ('security_forums_white_list', '" . serialize($forums) . "')"); updatecache('setting'); cpmsg('setting_update_succeed', 'action=cloud&operation=security&anchor=' . $_G['gp_anchor'], 'succeed'); } } elseif ($_G['gp_anchor'] == 'thread') {
$var['type'] = 'calendar'; $extra['date'] = '<script type="text/javascript" src="static/js/calendar.js"></script>'; } elseif ($var['type'] == 'datetime') { $var['type'] = 'calendar'; $var['extra'] = 1; $extra['date'] = '<script type="text/javascript" src="static/js/calendar.js"></script>'; } elseif ($var['type'] == 'forum') { require_once libfile('function/forumlist'); $var['type'] = '<select name="' . $var['variable'] . '"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $var['value'], TRUE) . '</select>'; $var['variable'] = $var['value'] = ''; } elseif ($var['type'] == 'forums') { $var['description'] = ($var['description'] ? (isset($lang[$var['description']]) ? $lang[$var['description']] : $var['description']) . '<br />' : '') . $lang['plugins_edit_vars_multiselect_comment'] . '<br />' . $var['comment']; $var['value'] = unserialize($var['value']); $var['value'] = is_array($var['value']) ? $var['value'] : array(); require_once libfile('function/forumlist'); $var['type'] = '<select name="' . $var['variable'] . '[]" size="10" multiple="multiple"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; foreach ($var['value'] as $v) { $var['type'] = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $var['type']); } $var['variable'] = $var['value'] = ''; } elseif (substr($var['type'], 0, 5) == 'group') { if ($var['type'] == 'groups') { $var['description'] = ($var['description'] ? (isset($lang[$var['description']]) ? $lang[$var['description']] : $var['description']) . '<br />' : '') . $lang['plugins_edit_vars_multiselect_comment'] . '<br />' . $var['comment']; $var['value'] = unserialize($var['value']); $var['type'] = '<select name="' . $var['variable'] . '[]" size="10" multiple="multiple"><option value=""' . (@in_array('', $var['value']) ? ' selected' : '') . '>' . cplang('plugins_empty') . '</option>'; } else { $var['type'] = '<select name="' . $var['variable'] . '"><option value="">' . cplang('plugins_empty') . '</option>'; } $var['value'] = is_array($var['value']) ? $var['value'] : array($var['value']); $query = DB::query("SELECT type, groupid, grouptitle, radminid FROM " . DB::table('common_usergroup') . " ORDER BY (creditshigher<>'0' || creditslower<>'0'), creditslower, groupid"); $groupselect = array();
$positionchecked = array(0 => ' selected="selected"'); } } $type = $adv['type']; } else { $title = cutstr($title, 50); $style = in_array($style, array('text', 'image', 'flash')) ? $style : 'code'; $adv = array('type' => $type, 'title' => $title, 'parameters' => array('style' => $style), 'starttime' => $timestamp); $positionchecked = $type == 'intercat' ? array(0 => ' selected="selected"') : array(1 => 'checked'); $dispchecked = array(0 => ' selected="selected"'); } $adv['targets'] = $adv['targets'] != '' && $adv['targets'] != 'forum' ? explode("\t", $adv['targets']) : array('all'); if ($type == 'intercat') { $targetsselect = '<select name="advnew[targets][]" selected="selected"><option value="0"> > ' . $lang['home'] . '</option></select>'; } else { $targetsselect = '<select name="advnew[targets][]" size="10" multiple="multiple"><option value="all"> > ' . $lang['all'] . '</option>' . '<option value=""> </option>' . (in_array($type, array('thread', 'interthread')) ? '' : '<option value="0"> > ' . $lang['home'] . '</option>') . (in_array($type, array('headerbanner', 'footerbanner')) ? '</option><option value="register"> > ' . $lang['advertisements_register'] . '</option>' . '</option><option value="redirect"> > ' . $lang['advertisements_jump'] . '</option>' . '</option><option value="archiver"> > Archiver</option>' : '') . '</option>' . forumselect() . '</select>'; foreach ($adv['targets'] as $target) { $targetsselect = preg_replace("/(\\<option value=\"{$target}\")(\\>)/", "\\1 selected=\"selected\" \\2", $targetsselect); } } if ($type == 'thread') { $dispselect = '<select name="advnew[displayorder][]" size="10" multiple="multiple"><option value="0"' . $dispchecked[0] . '> > ' . $lang['all'] . '</option><option value="0"> </option>'; for ($i = 1; $i <= $ppp; $i++) { $dispselect .= '<option value="' . $i . '"' . $dispchecked[$i] . '> > #' . $i . '</option>'; } $dispselect .= '</select>'; } elseif ($type == 'intercat') { require_once DISCUZ_ROOT . './forumdata/cache/cache_forums.php'; $positionselect = '<select name="advnew[position][]" size="10" multiple="multiple"><option value="0"' . $positionchecked[0] . '> > ' . $lang['all'] . '</option><option value=""> </option>'; foreach ($_DCACHE['forums'] as $fid => $forum) { if ($forum['type'] == 'group') {
} include template('common/header_ajax'); echo $threadclass; include template('common/footer_ajax'); exit; } elseif ($_GET['action'] == 'forumjump') { require_once libfile('function/forumlist'); $favforums = C::t('home_favorite')->fetch_all_by_uid_idtype($_G['uid'], 'fid'); $visitedforums = array(); if ($_G['cookie']['visitedfid']) { loadcache('forums'); foreach (explode('D', $_G['cookie']['visitedfid']) as $fid) { $visitedforums[$fid] = $_G['cache']['forums'][$fid]['name']; } } $forumlist = forumselect(FALSE, 1); include template('forum/ajax_forumlist'); } elseif ($_GET['action'] == 'quickreply') { $tid = intval($_GET['tid']); $fid = intval($_GET['fid']); if ($tid) { $thread = C::t('forum_thread')->fetch($tid); if ($thread && !getstatus($thread['status'], 2)) { $list = C::t('forum_post')->fetch_all_by_tid('tid:' . $tid, $tid, true, 'DESC', 0, 10, null, 0); loadcache('smilies'); foreach ($list as $pid => $post) { if ($post['first']) { unset($list[$pid]); } else { $post['message'] = preg_replace($_G['cache']['smilies']['searcharray'], '', $post['message']); $post['message'] = preg_replace("/\\{\\:soso_((e\\d+)|(_\\d+_\\d))\\:\\}/e", '', $post['message']);
for ($i = 0; $i <= 8; $i++) { $_G['setting']['creditstrans'] .= '<option value="' . $i . '" ' . ($i == $setting['activitycredit'] ? 'selected' : '') . '>' . ($i ? 'extcredits' . $i . ($setting['extcredits'][$i]['title'] ? '(' . $setting['extcredits'][$i]['title'] . ')' : '') : $lang['none']) . '</option>'; } showsetting('setting_functions_activity_credit', '', '', '<select name="settingnew[activitycredit]">' . $_G['setting']['creditstrans'] . '</select>'); showsetting('setting_functions_activity_pp', 'settingnew[activitypp]', $setting['activitypp'], 'text'); showtablefooter(); showtableheader('', 'notop'); showsubmit('settingsubmit'); showtablefooter(); showformfooter(); exit; } elseif ($operation == 'permissions') { include_once libfile('function/forumlist'); $setting['allowviewuserthread'] = unserialize($setting['allowviewuserthread']); $checkallselect = $setting['allowviewuserthread']['fids'] ? '' : ' selected'; $forumselect = '<select name="settingnew[allowviewuserthread][fids][]" multiple="multiple" size="10"><option value=""' . $checkallselect . '>' . cplang('setting_permissions_allowviewuserthread_forum_group') . '</option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; if ($setting['allowviewuserthread']['fids']) { foreach ($setting['allowviewuserthread']['fids'] as $v) { $forumselect = str_replace('<option value="' . $v . '">', '<option value="' . $v . '" selected>', $forumselect); } } showtableheader(); showsetting('setting_permissions_allowviewuserthread', 'settingnew[allowviewuserthread][allow]', $setting['allowviewuserthread']['allow'], 'radio', 0, 1); showsetting('setting_permissions_allowviewuserthread_fids', '', '', $forumselect); showtagfooter('tbody'); showsetting('setting_permissions_allowmoderatingthread', 'settingnew[allowmoderatingthread]', $setting['allowmoderatingthread'], 'radio'); showsetting('setting_permissions_memliststatus', 'settingnew[memliststatus]', $setting['memliststatus'], 'radio'); showsetting('setting_permissions_minpostsize', 'settingnew[minpostsize]', $setting['minpostsize'], 'text'); showsetting('setting_permissions_maxpostsize', 'settingnew[maxpostsize]', $setting['maxpostsize'], 'text'); showsetting('setting_permissions_alloweditpost', array('settingnew[alloweditpost]', array(cplang('thread_general'), cplang('thread_poll'), cplang('thread_trade'), cplang('thread_reward'), cplang('thread_activity'), cplang('thread_debate'))), $setting['alloweditpost'], 'binmcheckbox'); showsetting('setting_permissions_maxpolloptions', 'settingnew[maxpolloptions]', $setting['maxpolloptions'], 'text');
$showreward = isset($extcredits[$creditstrans]) && $forum['allowpostspecial'] & 4; $showactivity = $forum['allowpostspecial'] & 8; $showdebate = $forum['allowpostspecial'] & 16; $showvideo = $forum['allowpostspecial'] & 32 && $videoopen; } if ($allowpost) { $allowpostpoll = $allowpostpoll && $showpoll; $allowposttrade = $allowposttrade && $showtrade; $allowpostreward = $allowpostreward && $showreward; $allowpostactivity = $allowpostactivity && $showactivity; $allowpostdebate = $allowpostdebate && $showdebate; $allowpostvideo = $allowpostvideo && $showvideo; } $forumselect = $forummenu = ''; if ($forumjump) { if ($jsmenu[1]) { $forummenu = forumselect(FALSE, 1); } else { $forumselect = forumselect(); } } if ($iscircle) { require_once DISCUZ_ROOT . './include/supesite_circle.inc.php'; } $areaid = $forum['areaid']; if ($areaid == 2) { $siteurl = 'http://shy.jiaju001.com'; } else { $siteurl = 'http://www.jiaju001.com'; } include template('forumdisplay');
cpmsg('forums_delete_alarm', "action=forums&operation=delete&fid={$fid}&confirmed=1&formhash=" . FORMHASH, 'loadingform', '', '<div id="percent">0%</div>', FALSE); echo "\n\t\t\t<div id=\"statusid\" style=\"display:none\"></div>\n\t\t\t<script type=\"text/JavaScript\">\n\t\t\t\tvar xml_http_building_link = '" . cplang('xml_http_building_link') . "';\n\t\t\t\tvar xml_http_sending = '" . cplang('xml_http_sending') . "';\n\t\t\t\tvar xml_http_loading = '" . cplang('xml_http_loading') . "';\n\t\t\t\tvar xml_http_load_failed = '" . cplang('xml_http_load_failed') . "';\n\t\t\t\tvar xml_http_data_in_processed = '" . cplang('xml_http_data_in_processed') . "';\n\t\t\t\tvar adminfilename = '" . ADMINSCRIPT . "';\n\t\t\t\tfunction forumsdelete(url, total, pp, currow) {\n\n\t\t\t\t\tvar x = new Ajax('HTML', 'statusid');\n\t\t\t\t\tx.get(url+'&ajax=1&pp='+pp+'&total='+total+'&currow='+currow, function(s) {\n\t\t\t\t\t\tif(s != 'GO') {\n\t\t\t\t\t\t\tlocation.href = adminfilename + '?action=forums&operation=delete&finished=1&formhash=" . FORMHASH . "';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrow += pp;\n\t\t\t\t\t\tvar percent = ((currow / total) * 100).toFixed(0);\n\t\t\t\t\t\tpercent = percent > 100 ? 100 : percent;\n\t\t\t\t\t\tdocument.getElementById('percent').innerHTML = percent+'%';\n\t\t\t\t\t\tdocument.getElementById('percent').style.backgroundPosition = '-'+percent+'%';\n\n\t\t\t\t\t\tif(currow < total) {\n\t\t\t\t\t\t\tforumsdelete(url, total, pp, currow);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tforumsdelete(adminfilename + '?action=forums&operation=delete&fid={$fid}&confirmed=1&formhash=" . FORMHASH . "', {$threads}, 2000, 0);\n\t\t\t</script>\n\t\t\t"; } } } elseif ($operation == 'copy') { loadcache('forums'); $source = intval($_GET['source']); $sourceforum = $_G['cache']['forums'][$source]; if (empty($sourceforum) || $sourceforum['type'] == 'group') { cpmsg('forums_copy_source_invalid', '', 'error'); } $delfields = array('forums' => array('fid', 'fup', 'type', 'name', 'status', 'displayorder', 'threads', 'posts', 'todayposts', 'lastpost', 'modworks', 'icon', 'level', 'commoncredits', 'archive', 'recommend'), 'forumfields' => array('description', 'password', 'redirect', 'moderators', 'rules', 'threadtypes', 'threadsorts', 'threadplugin', 'jointype', 'gviewperm', 'membernum', 'dateline', 'lastupdate', 'founderuid', 'foundername', 'banner', 'groupnum', 'activity')); $fields = array('forums' => C::t('forum_forum')->fetch_table_struct('forum_forum'), 'forumfields' => C::t('forum_forum')->fetch_table_struct('forum_forumfield')); if (!submitcheck('copysubmit')) { require_once libfile('function/forumlist'); $forumselect = '<select name="target[]" size="10" multiple="multiple">' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; $optselect = '<select name="options[]" size="10" multiple="multiple">'; $fieldarray = array_merge($fields['forums'], $fields['forumfields']); $listfields = array_diff($fieldarray, array_merge($delfields['forums'], $delfields['forumfields'])); foreach ($listfields as $field) { if (isset($lang['project_option_forum_' . $field])) { $optselect .= '<option value="' . $field . '">' . $lang['project_option_forum_' . $field] . '</option>'; } } $optselect .= '</select>'; shownav('forum', 'forums_copy'); showsubmenu('forums_copy'); showtips('forums_copy_tips'); showformheader('forums&operation=copy'); showhiddenfields(array('source' => $source)); showtableheader();
$inforum = $_GET['inforum']; $authors = $_GET['authors']; $keywords = $_GET['keywords']; $admins = $_GET['admins']; $pstarttime = $_GET['pstarttime']; $pendtime = $_GET['pendtime']; $mstarttime = $_GET['mstarttime']; $mendtime = $_GET['mendtime']; $appService = Cloud::loadClass('Service_App'); $secStatus = $appService->getCloudAppStatus('security'); if ($secStatus) { $security = $_GET['security']; } $searchsubmit = $_GET['searchsubmit']; require_once libfile('function/forumlist'); $forumselect = '<select name="inforum"><option value=""> > ' . $lang['select'] . '</option>' . '<option value=""> </option><option value="groupthread">' . $lang['group_thread'] . '</option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; if ($inforum) { $forumselect = preg_replace("/(\\<option value=\"{$inforum}\")(\\>)/", "\\1 selected=\"selected\" \\2", $forumselect); } shownav('topic', 'nav_recyclebin'); showsubmenu('nav_recyclebin', array(array('recyclebin_list', 'recyclebin', 0), array('search', 'recyclebin&operation=search', 1), array('clean', 'recyclebin&operation=clean', 0))); echo <<<EOT <script type="text/javascript" src="static/js/calendar.js"></script> <script type="text/JavaScript"> function page(number) { \t\$('rbsearchform').page.value=number; \t\$('rbsearchform').searchsubmit.click(); } </script> EOT; showtagheader('div', 'threadsearch', !$searchsubmit);
C::t('common_setting')->update('threadtable_info', $threadtable_info); savecache('threadtable_info', $threadtable_info); updatecache('setting'); cpmsg('threadsplit_drop_table_succeed', 'action=threadsplit&operation=manage', 'succeed'); } elseif ($operation == 'move') { if (!$_G['setting']['bbclosed'] && !IN_DEBUG) { cpmsg('threadsplit_forum_must_be_closed', 'action=threadsplit&operation=manage', 'error'); } require_once libfile('function/forumlist'); $tableselect = '<select name="sourcetableid">'; foreach ($threadtableids as $tableid) { $selected = $_GET['sourcetableid'] == $tableid ? 'selected="selected"' : ''; $tableselect .= "<option value=\"{$tableid}\" {$selected}>" . C::t('forum_thread')->get_table_name($tableid) . "</option>"; } $tableselect .= '</select>'; $forumselect = '<select name="inforum"><option value="all"> > ' . $lang['all'] . '</option>' . '<option value=""> </option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; if (isset($_GET['inforum'])) { $forumselect = preg_replace("/(\\<option value=\"{$_GET['inforum']}\")(\\>)/", "\\1 selected=\"selected\" \\2", $forumselect); } $typeselect = $sortselect = ''; $query = C::t('forum_threadtype')->fetch_all_for_order(); foreach ($query as $type) { if ($type['special']) { $sortselect .= '<option value="' . $type['typeid'] . '"> > ' . $type['name'] . '</option>'; } else { $typeselect .= '<option value="' . $type['typeid'] . '"> > ' . $type['name'] . '</option>'; } } if (isset($_GET['insort'])) { $sortselect = preg_replace("/(\\<option value=\"{$_GET['insort']}\")(\\>)/", "\\1 selected=\"selected\" \\2", $sortselect); }