📄 forums.inc.php
字号:
$typeselected[1] = ' selected="selected"';
} elseif(isset($forum['threadtypes']['selectbox'][$type['typeid']])) {
$enablechecked = ' checked="checked"';
$typeselected[2] = ' selected="selected"';
} else {
$typeselected[1] = ' selected="selected"';
}
$typeselected[3] = $forum['threadtypes']['show'][$type['typeid']] ? ' checked="checked"' : '';
$showtype = TRUE;
if($type['special'] && !@include_once DISCUZ_ROOT.'./forumdata/cache/threadtype_'.$type['typeid'].'.php') {
$showtype = FALSE;
}
$typeselect .= $showtype ? showtablerow('', array('class="td25"'), array(
'<input type="checkbox" name="threadtypesnew[options][enable]['.$type[typeid].']" value="1" class="checkbox"'.$enablechecked.' />',
$type['name'],
$type['description'].($type['special'] ? ' '.$lang['nav_forums_types'] : ''),
"<select name=\"threadtypesnew[options][{$type[typeid]}]\"><option value=\"1\" $typeselected[1]>$lang[forums_threadtypes_use_cols]</option><option value=\"2\" $typeselected[2]>$lang[forums_threadtypes_use_choice]</option></select>",
"<input class=\"checkbox\" type=\"checkbox\" name=\"threadtypesnew[options][show][{$type[typeid]}]\" value=\"3\" $typeselected[3] ".(!$type['special'] ? 'disabled' : '')." />"
), TRUE) : '';
}
$num = 0;
$query = $db->query("SELECT * FROM {$tablepre}typemodels ORDER BY displayorder");
$typemodelselect = '<ul class="nofloat" onmouseover="altStyle(this);">';
while($model = $db->fetch_array($query)) {
$num++;
$modelchecked = $forum['typemodels'][$model['id']] ? 'checked' : '';
$typemodelselect .= in_array($model['id'], $typemodelid) ? "<li".($modelchecked ? ' class="checked"' : '')."><input class=\"checkbox\" type=\"checkbox\" name=\"typemodel[]\" value=\"$model[id]\" $modelchecked>$model[name]</li>" : '';
}
$typemodelselect .= '</ul>';
$forum['postcredits'] = $forum['postcredits'] ? unserialize($forum['postcredits']) : array();
$forum['replycredits'] = $forum['replycredits'] ? unserialize($forum['replycredits']) : array();
$forum['digestcredits'] = $forum['digestcredits'] ? unserialize($forum['digestcredits']) : array();
$forum['postattachcredits'] = $forum['postattachcredits'] ? unserialize($forum['postattachcredits']) : array();
$forum['getattachcredits'] = $forum['getattachcredits'] ? unserialize($forum['getattachcredits']) : array();
$simplebin = sprintf('%08b', $forum['simple']);
$forum['defaultorderfield'] = bindec(substr($simplebin, 0, 2));
$forum['defaultorder'] = ($forum['simple'] & 32) ? 1 : 0;
$forum['subforumsindex'] = bindec(substr($simplebin, 3, 2));
$forum['subforumsindex'] = $forum['subforumsindex'] == 0 ? -1 : ($forum['subforumsindex'] == 2 ? 0 : 1);
$forum['simple'] = $forum['simple'] & 1;
$forum['modrecommend'] = $forum['modrecommend'] ? unserialize($forum['modrecommend']) : '';
$forum['formulaperm'] = unserialize($forum['formulaperm']);$forum['formulaperm'] = $forum['formulaperm'][0];
$sideselect = array();
$infosidestatus[0] && $sideselect[0] = '<select name="foruminfosidestatus[0]"><option value=""></option>';
$infosidestatus[1] && $sideselect[1] = '<select name="foruminfosidestatus[1]"><option value=""></option>';
if($sideselect) {
$query = $db->query("SELECT variable FROM {$tablepre}request WHERE type=-2");
while($side = $db->fetch_array($query)) {
$infosidestatus[0] && $sideselect[0] .= "<option value=\"$side[variable]\" ".($infosidestatus['f'.$fid][0] == $side['variable'] ? 'selected="selected"' : NULL).">$side[variable]</option>\n";
$infosidestatus[1] && $sideselect[1] .= "<option value=\"$side[variable]\" ".($infosidestatus['f'.$fid][1] == $side['variable'] ? 'selected="selected"' : NULL).">$side[variable]</option>\n";
}
$infosidestatus[0] && $sideselect[0] .= '</select>';
$infosidestatus[1] && $sideselect[1] .= '</select>';
}
showtagheader('div', 'basic', $anchor == 'basic');
showtableheader('forums_edit_basic', 'nobottom');
showsetting('forums_edit_name', 'namenew', $forum['name'], 'text');
showsetting('forums_scheme', '', '', $projectselect);
showsetting('forums_edit_display', 'statusnew', $forum['status'], 'radio');
showsetting('forums_edit_perm_passwd', 'passwordnew', $forum['password'], 'text');
showsetting('forums_edit_up', '', '', $fupselect);
showsetting('forums_edit_redirect', 'redirectnew', $forum['redirect'], 'text');
showsetting('forums_edit_icon', 'iconnew', $forum['icon'], 'text');
showsetting('forums_edit_description', 'descriptionnew', html2bbcode($forum['description']), 'textarea');
showsetting('forums_edit_rules', 'rulesnew', html2bbcode($forum['rules']), 'textarea');
showsetting('forums_edit_keyword', 'keywordsnew', $forum['keywords'], 'text');
showtablefooter();
showtagfooter('div');
showtagheader('div', 'extend', $anchor == 'extend');
showtableheader('forums_edit_extend', 'nobottom');
showsetting('forums_edit_style', '', '', $styleselect);
showsetting('forums_sub_horizontal', 'forumcolumnsnew', $forum['forumcolumns'], 'text');
showsetting('forums_edit_subforumsindex', array('subforumsindexnew', array(
array(-1, $lang['default']),
array(1, $lang['yes']),
array(0, $lang['no'])
), 1), $forum['subforumsindex'], 'mradio');
showsetting('forums_edit_simple', 'simplenew', $forum['simple'], 'radio');
showsetting('forums_edit_defaultorderfield', array('defaultorderfieldnew', array(
array(0, $lang['forums_edit_order_lastpost']),
array(1, $lang['forums_edit_order_starttime']),
array(2, $lang['forums_edit_order_replies']),
array(3, $lang['forums_edit_order_views'])
)), $forum['defaultorderfield'], 'mradio');
showsetting('forums_edit_defaultorder', array('defaultordernew', array(
array(0, $lang['forums_edit_order_desc']),
array(1, $lang['forums_edit_order_asc'])
)), $forum['defaultorder'], 'mradio');
showsetting('forums_threadcache', 'threadcachesnew', $forum['threadcaches'], 'text');
showsetting('forums_edit_edit_rules', 'alloweditrulesnew', $forum['alloweditrules'], 'radio');
if($sideselect) {
showsetting('forums_edit_sideselect', '', '', '
<ul>
<li class="clear">'.$lang['settings_sideselect_0'].'</li>
<li class="clear">'.$sideselect[0].'</li>
<li class="clear">'.$lang['settings_sideselect_1'].'</li>
<li class="clear">'.$sideselect[1].'</li>
<li class="clear">'.$lang['settings_sideselect_replies_condition'].' <input name="foruminfosidestatus[posts]" value="'.$infosidestatus['f'.$fid]['posts'].'" style="width:50px;" /> '.$lang['settings_sideselect_replies_show'].'</li>
</ul>
');
}
showsetting('forums_edit_recommend', 'modrecommendnew[open]', $forum['modrecommend']['open'], 'radio', '', 1);
showsetting('forums_edit_recommend_sort', array('modrecommendnew[sort]', array(
array(1, $lang['forums_edit_recommend_sort_auto']),
array(0, $lang['forums_edit_recommend_sort_manual']),
array(2, $lang['forums_edit_recommend_sort_mix']))), $forum['modrecommend']['sort'], 'mradio');
showsetting('forums_edit_recommend_orderby', array('modrecommendnew[orderby]', array(
array(0, $lang['forums_edit_recommend_orderby_dateline']),
array(1, $lang['forums_edit_recommend_orderby_lastpost']),
array(2, $lang['forums_edit_recommend_orderby_views']),
array(3, $lang['forums_edit_recommend_orderby_replies']),
array(4, $lang['forums_edit_recommend_orderby_digest']))), $forum['modrecommend']['orderby'], 'mradio');
showsetting('forums_edit_recommend_num', 'modrecommendnew[num]', $forum['modrecommend']['num'], 'text');
showsetting('forums_edit_recommend_maxlength', 'modrecommendnew[maxlength]', $forum['modrecommend']['maxlength'], 'text');
showsetting('forums_edit_recommend_cachelife', 'modrecommendnew[cachelife]', $forum['modrecommend']['cachelife'], 'text');
showsetting('forums_edit_recommend_dateline', 'modrecommendnew[dateline]', $forum['modrecommend']['dateline'], 'text');
showtablefooter();
showtagfooter('div');
showtagheader('div', 'posts', $anchor == 'posts');
showtableheader('forums_edit_posts', 'nobottom');
showsetting('forums_edit_modposts', array('modnewpostsnew', array(
array(0, $lang['none']),
array(1, $lang['forums_edit_modposts_threads']),
array(2, $lang['forums_edit_modposts_posts'])
)), $forum['modnewposts'], 'mradio');
showsetting('forums_edit_alloweditpost', 'alloweditpostnew', $forum['alloweditpost'], 'radio');
showsetting('forums_edit_recyclebin', 'recyclebinnew', $forum['recyclebin'], 'radio');
showsetting('forums_edit_html', 'allowhtmlnew', $forum['allowhtml'], 'radio');
showsetting('forums_edit_bbcode', 'allowbbcodenew', $forum['allowbbcode'], 'radio');
showsetting('forums_edit_imgcode', 'allowimgcodenew', $forum['allowimgcode'], 'radio');
showsetting('forums_edit_mediacode', 'allowmediacodenew', $forum['allowmediacode'], 'radio');
showsetting('forums_edit_smilies', 'allowsmiliesnew', $forum['allowsmilies'], 'radio');
showsetting('forums_edit_jammer', 'jammernew', $forum['jammer'], 'radio');
showsetting('forums_edit_anonymous', 'allowanonymousnew', $forum['allowanonymous'], 'radio');
showsetting('forums_edit_disablewatermark', 'disablewatermarknew', $forum['disablewatermark'], 'radio');
if($tagstatus == 1) {
showsetting('forums_edit_tagstatus', array('allowtagnew', array(
array(0, $lang['settings_tagstatus_none']),
array(1, $lang['settings_tagstatus_use']),
array(2, $lang['settings_tagstatus_quired'])
)), $forum['allowtag'], 'mradio');
}
showsetting('forums_edit_allowpostspecial', array('allowpostspecialnew', array(
$lang['thread_poll'],
$lang['thread_trade'],
$lang['thread_reward'],
$lang['thread_activity'],
$lang['thread_debate'],
$lang['thread_video']
)), $forum['allowpostspecial'], 'binmcheckbox');
showsetting('forums_edit_allowspecialonly', 'allowspecialonlynew', $forum['allowspecialonly'], 'radio');
if(!empty($tradetypes) && is_array($tradetypes)) {
$forum['tradetypes'] = $forum['tradetypes'] == '' ? -1 : unserialize($forum['tradetypes']);
$tradetypeselect = '';
foreach($tradetypes as $typeid => $typename) {
$tradetypeselect .= '<input class="checkbox" type="checkbox" name="tradetypesnew[]" value="'.$typeid.'" '.($forum['tradetypes'] == -1 || @in_array($typeid, $forum['tradetypes']) ? 'checked' : '').'> '.$typename.'<br />';
}
showsetting('forums_edit_trade_type', '', '', $tradetypeselect);
}
showsetting('forums_edit_autoclose', array('autoclosenew', array(
array(0, $lang['forums_edit_autoclose_none'], array('autoclose_time' => 'none')),
array(1, $lang['forums_edit_autoclose_dateline'], array('autoclose_time' => '')),
array(-1, $lang['forums_edit_autoclose_lastpost'], array('autoclose_time' => ''))
)), $forum['autoclose'], 'mradio');
showtagheader('tbody', 'autoclose_time', $forum['autoclose'], 'sub');
showsetting('forums_edit_autoclose_time', 'autoclosetimenew', $forum['autoclosetime'], 'text');
showtagfooter('tbody');
showsetting('forums_edit_attach_ext', 'attachextensionsnew', $forum['attachextensions'], 'text');
showtablefooter();
showtagfooter('div');
showtagheader('div', 'credits', $anchor == 'credits');
showtableheader('forums_edit_credits', 'nobottom');
echo '<tr ><td>'.$lang['credits_id'].'</td><td>'.$lang['credits_title'].'</td><td>'.$lang['forums_edit_postcredits_add'].'</td><td>'.$lang['forums_edit_replycredits_add'].'</td><td>'.$lang['settings_credits_policy_digest'].'</td><td>'.$lang['settings_credits_policy_postattach'].'</td><td>'.$lang['settings_credits_policy_getattach'].'</td></tr>';
$customcreditspolicy = '';
if(is_array($extcredits)) {
foreach($extcredits as $i => $extcredit) {
$customcreditspolicy .= showtablerow('', '', array(
"extcredits$i",
$extcredit['title'],
"<input type=\"text\" class=\"txt\" size=\"2\" name=\"postcreditsnew[$i]\" value=\"".$forum['postcredits'][$i]."\" />",
"<input type=\"text\" class=\"txt\" size=\"2\" name=\"replycreditsnew[$i]\" value=\"".$forum['replycredits'][$i]."\" />",
"<input type=\"text\" class=\"txt\" size=\"2\" name=\"digestcreditsnew[$i]\" value=\"".$forum['digestcredits'][$i]."\" />",
"<input type=\"text\" class=\"txt\" size=\"2\" name=\"postattachcreditsnew[$i]\" value=\"".$forum['postattachcredits'][$i]."\" />",
"<input type=\"text\" class=\"txt\" size=\"2\" name=\"getattachcreditsnew[$i]\" value=\"".$forum['getattachcredits'][$i]."\" />"
), TRUE);
}
}
$customcreditspolicy .= '<tr><td colspan="7">'.$lang['forums_edit_credits_comment'].'</td></tr>';
echo $customcreditspolicy;
showtablefooter();
showtagfooter('div');
if($allowthreadtypes) {
echo <<<EOT
<script type="text/JavaScript">
var rowtypedata = [
[
[1,'<input type="checkbox" class="checkbox" name="newenable[]" checked="checked" />', 'td25'],
[1,'<input type="text" class="txt" name="newname[]" size="15" />'],
[1,'<input type="text" class="txt" name="newdescription[]" size="15" />'],
[1,'<select name="newoptions[]"><option value="1" selected="selected">$lang[forums_threadtypes_use_cols]</option><option value="2">$lang[forums_threadtypes_use_choice]</option></select>'],
[1,'']
],
];
</script>
EOT;
showtagheader('div', 'threadtypes', $anchor == 'threadtypes');
showtableheader('forums_edit_threadtypes', 'nobottom');
showsetting('forums_edit_threadtypes_status', array('threadtypesnew[status]', array(
array(1, $lang['yes'], array('threadtypes_config' => '', 'threadtypes_manage' => '')),
array(0, $lang['no'], array('threadtypes_config' => 'none', 'threadtypes_manage' => 'none'))
), TRUE), $forum['threadtypes']['status'], 'mradio');
showtagheader('tbody', 'threadtypes_config', $forum['threadtypes']['status']);
showsetting('forums_edit_threadtypes_required', 'threadtypesnew[required]', $forum['threadtypes']['required'], 'radio');
showsetting('forums_edit_threadtypes_listable', 'threadtypesnew[listable]', $forum['threadtypes']['listable'], 'radio');
showsetting('forums_edit_threadtypes_prefix', 'threadtypesnew[prefix]', $forum['threadtypes']['prefix'], 'radio');
showsetting('forums_edit_threadtypes_typemodel', '', '', $typemodelselect);
showtagfooter('tbody');
showtablefooter();
showtagheader('div', 'threadtypes_manage', $forum['threadtypes']['status']);
showtableheader('forums_threadtypes', 'noborder fixpadding');
showsubtitle(array('enable', 'forums_edit_cat_name', 'forums_sort_note', 'forums_threadtypes_showtype', 'forums_threadtypes_show'));
echo $typeselect;
echo '<tr><td colspan="6"><div><a href="###" onclick="addrow(this, 0)" class="addtr">'.lang('threadtype_infotypes_add').'</a></div></td></tr>';
echo '<tr><td class="lineheight" colspan="6">'.$lang['forums_edit_threadtypes_comment'].'</td></tr>';
showtablefooter();
showtagfooter('div');
showtagfooter('div');
}
showtagheader('div', 'perm', $anchor == 'perm');
showtableheader('forums_edit_forumperm', 'nobottom fixpadding');
showsubtitle(array(
'',
'<input class="checkbox" type="checkbox" name="chkall1" onclick="checkAll(\'prefix\', this.form, \'viewperm\', \'chkall1\')" id="chkall1" /><label for="chkall1"> '.$lang['forums_edit_perm_view'].'</label>',
'<input class="checkbox" type="checkbox" name="chkall2" onclick="checkAll(\'prefix\', this.form, \'postperm\', \'chkall2\')" id="chkall2" /><label for="chkall2"> '.$lang['forums_edit_perm_post'].'</label>',
'<input class="checkbox" type="checkbox" name="chkall3" onclick="checkAll(\'prefix\', this.form, \'replyperm\', \'chkall3\')" id="chkall3" /><label for="chkall3"> '.$lang['forums_edit_perm_reply'].'</label>',
'<input class="checkbox" type="checkbox" name="chkall4" onclick="checkAll(\'prefix\', this.form, \'getattachperm\', \'chkall4\')" id="chkall4" /><label for="chkall4"> '.$lang['forums_edit_perm_getattach'].'</label>',
'<input class="checkbox" type="checkbox" name="chkall5" onclick="checkAll(\'prefix\', this.form, \'postattachperm\', \'chkall5\')" id="chkall5" /><label for="chkall5"> '.$lang['forums_edit_perm_postattach'].'</label>'
));
foreach($groups as $group) {
$colums = array('<input class="checkbox" title="'.$lang['select_all'].'" type="checkbox" name="chkallv'.$group['groupid'].'" onclick="checkAll(\'value\', this.form, '.$group['groupid'].', \'chkallv'.$group['groupid'].'\')" id="chkallv_'.$group['groupid'].'" /><label for="chkallv_'.$group['groupid'].'"> '.$group[grouptitle].'</label>');
foreach($perms as $perm) {
$checked = strstr($forum[$perm], "\t$group[groupid]\t") ? 'checked="checked"' : NULL;
$colums[] = '<input class="checkbox" type="checkbox" name="'.$perm.'[]" value="'.$group['groupid'].'" '.$checked.'>';
}
showtablerow('', '', $colums);
}
showtablerow('', 'class="lineheight" colspan="6"', $lang['forums_edit_forumperm_comment']);
showtablefooter();
showtableheader('forums_edit_access_mask', 'noborder fixpadding');
showtablerow('', 'colspan="5"', array(lang('forums_edit_perm_view'), substr($viewaccess, 2)));
showtablerow('', 'colspan="5"', array(lang('forums_edit_perm_post'), substr($postaccess, 2)));
showtablerow('', 'colspan="5"', array(lang('forums_edit_perm_reply'), substr($replyaccess, 2)));
showtablerow('', 'colspan="5"', array(lang('forums_edit_perm_getattach'), substr($getattachaccess, 2)));
showtablerow('', 'colspan="5"', array(lang('forums_edit_perm_postattach'), substr($postattachaccess, 2)));
showtablefooter();
showtableheader('settings_formulaperm', 'noborder fixpadding');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -