/source/admincp/admincp_forums.php
PHP | 2193 lines | 2099 code | 88 blank | 6 comment | 184 complexity | 9a7759d0d783f6ab1964a88742f59a74 MD5 | raw file
Possible License(s): BSD-3-Clause
Large files files are truncated, but you can click here to view the full file
- <?php
- /**
- * [Discuz!] (C)2001-2099 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- *
- * $Id: admincp_forums.php 33377 2013-06-04 04:03:30Z andyzheng $
- */
- if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
- exit('Access Denied');
- }
- cpheader();
- $operation = empty($operation) ? 'admin' : $operation;
- $fid = intval(getgpc('fid'));
- if($operation == 'admin') {
- if(!submitcheck('editsubmit')) {
- shownav('forum', 'forums_admin');
- showsubmenu('forums_admin');
- showtips('forums_admin_tips');
- require_once libfile('function/forumlist');
- $forums = str_replace("'", "\'", forumselect(false, 0, 0, 1));
- ?>
- <script type="text/JavaScript">
- var forumselect = '<?php echo $forums;?>';
- var rowtypedata = [
- [[1, ''], [1,'<input type="text" class="txt" name="newcatorder[]" value="0" />', 'td25'], [5, '<div><input name="newcat[]" value="<?php cplang('forums_admin_add_category_name', null, true);?>" size="20" type="text" class="txt" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)"><?php cplang('delete', null, true);?></a></div>']],
- [[1, ''], [1,'<input type="text" class="txt" name="neworder[{1}][]" value="0" />', 'td25'], [5, '<div class="board"><input name="newforum[{1}][]" value="<?php cplang('forums_admin_add_forum_name', null, true);?>" size="20" type="text" class="txt" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)"><?php cplang('delete', null, true);?></a><select name="newinherited[{1}][]"><option value=""><?php cplang('forums_edit_newinherited', null, true);?></option>' + forumselect + '</select></div>']],
- [[1, ''], [1,'<input type="text" class="txt" name="neworder[{1}][]" value="0" />', 'td25'], [5, '<div class="childboard"><input name="newforum[{1}][]" value="<?php cplang('forums_admin_add_forum_name', null, true);?>" size="20" type="text" class="txt" /><a href="javascript:;" class="deleterow" onClick="deleterow(this)"><?php cplang('delete', null, true);?></a> <label><input name="inherited[{1}][]" type="checkbox" class="checkbox" value="1"> <?php cplang('forums_edit_inherited', null, true);?></label></div>']],
- ];
- </script>
- <?php
- showformheader('forums');
- echo '<div style="height:30px;line-height:30px;"><a href="javascript:;" onclick="show_all()">'.cplang('show_all').'</a> | <a href="javascript:;" onclick="hide_all()">'.cplang('hide_all').'</a> <input type="text" id="srchforumipt" class="txt" /> <input type="submit" class="btn" value="'.cplang('search').'" onclick="return srchforum()" /></div>';
- showtableheader('');
- showsubtitle(array('', 'display_order', 'forums_admin_name', '', 'forums_moderators', '<a href="javascript:;" onclick="if(getmultiids()) location.href=\''.ADMINSCRIPT.'?action=forums&operation=edit&multi=\' + getmultiids();return false;">'.$lang['multiedit'].'</a>'));
- $forumcount = C::t('forum_forum')->fetch_forum_num();
- $query = C::t('forum_forum')->fetch_all_forum_for_sub_order();
- $groups = $forums = $subs = $fids = $showed = array();
- foreach($query as $forum) {
- if($forum['type'] == 'group') {
- $groups[$forum['fid']] = $forum;
- } elseif($forum['type'] == 'sub') {
- $subs[$forum['fup']][] = $forum;
- } else {
- $forums[$forum['fup']][] = $forum;
- }
- $fids[] = $forum['fid'];
- }
- foreach ($groups as $id => $gforum) {
- $toggle = $forumcount > 50 && count($forums[$id]) > 2;
- $showed[] = showforum($gforum, 'group', '', $toggle);
- if(!empty($forums[$id])) {
- foreach ($forums[$id] as $forum) {
- $showed[] = showforum($forum);
- $lastfid = 0;
- if(!empty($subs[$forum['fid']])) {
- foreach ($subs[$forum['fid']] as $sub) {
- $showed[] = showforum($sub, 'sub');
- $lastfid = $sub['fid'];
- }
- }
- showforum($forum, $lastfid, 'lastchildboard');
- }
- }
- showforum($gforum, '', 'lastboard');
- }
- if(count($fids) != count($showed)) {
- foreach($fids as $fid) {
- if(!in_array($fid, $showed)) {
- C::t('forum_forum')->update($fid, array('fup' => '0', 'type' => 'forum'));
- }
- }
- }
- showforum($gforum, '', 'last');
- showsubmit('editsubmit');
- showtablefooter();
- showformfooter();
- } else {
- $usergroups = array();
- $query = C::t('common_usergroup')->range();
- foreach($query as $group) {
- $usergroups[$group['groupid']] = $group;
- }
- if(is_array($_GET['order'])) {
- foreach($_GET['order'] as $fid => $value) {
- C::t('forum_forum')->update($fid, array('name' => $_GET['name'][$fid], 'displayorder' => $_GET['order'][$fid]));
- }
- }
- if(is_array($_GET['newcat'])) {
- foreach($_GET['newcat'] as $key => $forumname) {
- if(empty($forumname)) {
- continue;
- }
- $fid = C::t('forum_forum')->insert(array('type' => 'group', 'name' => $forumname, 'status' => 1, 'displayorder' => $_GET['newcatorder'][$key]), 1);
- C::t('forum_forumfield')->insert(array('fid' => $fid));
- }
- }
- $table_forum_columns = array('fup', 'type', 'name', 'status', 'displayorder', 'styleid', 'allowsmilies',
- 'allowhtml', 'allowbbcode', 'allowimgcode', 'allowanonymous', 'allowpostspecial', 'alloweditrules',
- 'alloweditpost', 'modnewposts', 'recyclebin', 'jammer', 'forumcolumns', 'threadcaches', 'disablewatermark', 'disablethumb',
- 'autoclose', 'simple', 'allowside', 'allowfeed');
- $table_forumfield_columns = array('fid', 'attachextensions', 'threadtypes', 'viewperm', 'postperm', 'replyperm',
- 'getattachperm', 'postattachperm', 'postimageperm');
- if(is_array($_GET['newforum'])) {
- foreach($_GET['newforum'] as $fup => $forums) {
- $fupforum = C::t('forum_forum')->get_forum_by_fid($fup);
- if(empty($fupforum)) continue;
- if($fupforum['fup']) {
- $groupforum = C::t('forum_forum')->get_forum_by_fid($fupforum['fup']);
- } else {
- $groupforum = $fupforum;
- }
- foreach($forums as $key => $forumname) {
- if(empty($forumname) || strlen($forumname) > 50) continue;
- $forum = $forumfields = array();
- $inheritedid = !empty($_GET['inherited'][$fup]) ? $fup : (!empty($_GET['newinherited'][$fup][$key]) ? $_GET['newinherited'][$fup][$key] : '');
- if(!empty($inheritedid)) {
- $forum = C::t('forum_forum')->get_forum_by_fid($inheritedid);
- $forumfield = C::t('forum_forum')->get_forum_by_fid($inheritedid, null, 'forumfield');
- foreach($table_forum_columns as $field) {
- $forumfields[$field] = $forum[$field];
- }
- foreach($table_forumfield_columns as $field) {
- $forumfields[$field] = $forumfield[$field];
- }
- } else {
- $forumfields['allowsmilies'] = $forumfields['allowbbcode'] = $forumfields['allowimgcode'] = 1;
- $forumfields['allowpostspecial'] = 1;
- $forumfields['allowside'] = 0;
- $forumfields['allowfeed'] = 0;
- $forumfields['recyclebin'] = 1;
- }
- $forumfields['fup'] = $fup ? $fup : 0;
- $forumfields['type'] = $fupforum['type'] == 'forum' ? 'sub' : 'forum';
- $forumfields['styleid'] = $groupforum['styleid'];
- $forumfields['name'] = $forumname;
- $forumfields['status'] = 1;
- $forumfields['displayorder'] = $_GET['neworder'][$fup][$key];
- $data = array();
- foreach($table_forum_columns as $field) {
- if(isset($forumfields[$field])) {
- $data[$field] = $forumfields[$field];
- }
- }
- $forumfields['fid'] = $fid = C::t('forum_forum')->insert($data, 1);
- $data = array();
- $forumfields['threadtypes'] = copy_threadclasses($forumfields['threadtypes'], $fid);
- foreach($table_forumfield_columns as $field) {
- if(isset($forumfields[$field])) {
- $data[$field] = $forumfields[$field];
- }
- }
- C::t('forum_forumfield')->insert($data);
- foreach(C::t('forum_moderator')->fetch_all_by_fid($fup, false) as $mod) {
- if($mod['inherited'] || $fupforum['inheritedmod']) {
- C::t('forum_moderator')->insert(array('uid' => $mod['uid'], 'fid' => $fid, 'inherited' => 1), false, true);
- }
- }
- }
- }
- }
- updatecache('forums');
- cpmsg('forums_update_succeed', 'action=forums', 'succeed');
- }
- } elseif($operation == 'moderators' && $fid) {
- if(!submitcheck('modsubmit')) {
- $forum = C::t('forum_forum')->fetch($fid);
- shownav('forum', 'forums_moderators_edit');
- showsubmenu(cplang('forums_moderators_edit').' - '.$forum['name']);
- showtips('forums_moderators_tips');
- showformheader("forums&operation=moderators&fid=$fid&");
- showtableheader('', 'fixpadding');
- showsubtitle(array('', 'display_order', 'username', 'usergroups', 'forums_moderators_inherited'));
- $modgroups = C::t('common_admingroup')->fetch_all_merge_usergroup(array_keys(C::t('common_usergroup')->fetch_all_by_radminid(0)));
- $groupselect = '<select name="newgroup">';
- foreach($modgroups as $modgroup) {
- if($modgroup['radminid'] == 3) {
- $groupselect .= '<option value="'.$modgroup['admingid'].'">'.$modgroup['grouptitle'].'</option>';
- }
- $modgroups[$modgroup['admingid']] = $modgroup['grouptitle'];
- }
- $groupselect .= '</select>';
- $moderators = C::t('forum_moderator')->fetch_all_by_fid($fid);
- $uids = array_keys($moderators);
- if($uids) {
- $users = C::t('common_member')->fetch_all($uids);
- }
- foreach($moderators as $mod) {
- showtablerow('', array('class="td25"', 'class="td28"'), array(
- '<input type="checkbox" class="checkbox" name="delete[]" value="'.$mod[uid].'"'.($mod['inherited'] ? ' disabled' : '').' />',
- '<input type="text" class="txt" name="displayordernew['.$mod[uid].']" value="'.$mod[displayorder].'" size="2" />',
- "<a href=\"".ADMINSCRIPT."?mod=forum&action=members&operation=group&uid=$mod[uid]\" target=\"_blank\">{$users[$mod['uid']]['username']}</a>",
- $modgroups[$users[$mod['uid']]['groupid']],
- cplang($mod['inherited'] ? 'yes' : 'no'),
- ));
- }
- if($forum['type'] == 'group' || $forum['type'] == 'sub') {
- $checked = $forum['type'] == 'group' ? 'checked' : '';
- $disabled = 'disabled';
- } else {
- $checked = $forum['inheritedmod'] ? 'checked' : '';
- $disabled = '';
- }
- showtablerow('', array('class="td25"', 'class="td28"'), array(
- cplang('add_new'),
- '<input type="text" class="txt" name="newdisplayorder" value="0" size="2" />',
- '<input type="text" class="txt" name="newmoderator" value="" size="20" />',
- $groupselect,
- ''
- ));
- showsubmit('modsubmit', 'submit', 'del', '<input class="checkbox" type="checkbox" name="inheritedmodnew" value="1" '.$checked.' '.$disabled.' id="inheritedmodnew" /><label for="inheritedmodnew">'.cplang('forums_moderators_inherit').'</label>');
- showtablefooter();
- showformfooter();
- } else {
- $forum = C::t('forum_forum')->fetch($fid);
- $inheritedmodnew = $_GET['inheritedmodnew'];
- if($forum['type'] == 'group') {
- $inheritedmodnew = 1;
- } elseif($forum['type'] == 'sub') {
- $inheritedmodnew = 0;
- }
- if(!empty($_GET['delete']) || $_GET['newmoderator'] || (bool)$forum['inheritedmod'] != (bool)$inheritedmodnew) {
- $fidarray = $newmodarray = $origmodarray = array();
- if($forum['type'] == 'group') {
- $query = C::t('forum_forum')->fetch_all_fids(1, 'forum', $fid);
- foreach($query as $sub) {
- $fidarray[] = $sub['fid'];
- }
- $query = C::t('forum_forum')->fetch_all_fids(1, 'sub', $fidarray);
- foreach($query as $sub) {
- $fidarray[] = $sub['fid'];
- }
- } elseif($forum['type'] == 'forum') {
- $query = C::t('forum_forum')->fetch_all_fids(1, 'sub', $fid);
- foreach($query as $sub) {
- $fidarray[] = $sub['fid'];
- }
- }
- if(is_array($_GET['delete'])) {
- foreach($_GET['delete'] as $uid) {
- C::t('forum_moderator')->delete_by_uid_fid_inherited($uid, $fid, $fidarray);
- }
- $excludeuids = array();
- $deleteuids = '\''.implode('\',\'', $_GET['delete']).'\'';
- foreach(C::t('forum_moderator')->fetch_all_by_uid($_GET['delete']) as $mod) {
- $excludeuids[] = $mod['uid'];
- }
- $usergroups = array();
- $query = C::t('common_usergroup')->range();
- foreach($query as $group) {
- $usergroups[$group['groupid']] = $group;
- }
- $members = C::t('common_member')->fetch_all($_GET['delete'], false, 0);
- foreach($members as $uid => $member) {
- if(!in_array($uid, $excludeuids) && !in_array($member['adminid'], array(1,2))) {
- if($usergroups[$member['groupid']]['type'] == 'special' && $usergroups[$member['groupid']]['radminid'] != 3) {
- $adminidnew = -1;
- $groupidnew = $member['groupid'];
- } else {
- $adminidnew = 0;
- foreach($usergroups as $group) {
- if($group['type'] == 'member' && $member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower']) {
- $groupidnew = $group['groupid'];
- break;
- }
- }
- }
- C::t('common_member')->update($member['uid'], array('adminid'=>$adminidnew, 'groupid'=>$groupidnew));
- }
- }
- }
- if($_GET['newmoderator']) {
- $member = C::t('common_member')->fetch_by_username($_GET['newmoderator']);
- if(!$member) {
- cpmsg_error('members_edit_nonexistence');
- } else {
- $newmodarray[] = $member['uid'];
- $membersetarr = array();
- if(!in_array($member['adminid'],array(1,2,3,4,5,6,7,8,-1))) {
- $membersetarr['groupid'] = $_GET['newgroup'];
- }
- if(!in_array($member['adminid'],array(1,2))) {
- $membersetarr['adminid'] = '3';
- }
- if(!empty($membersetarr)) {
- C::t('common_member')->update($member['uid'], $membersetarr);
- }
- C::t('forum_moderator')->insert(array(
- 'uid' => $member['uid'],
- 'fid' => $fid,
- 'displayorder' => $_GET['newdisplayorder'],
- 'inherited' => '0',
- ), false, true);
- }
- }
- if((bool)$forum['inheritedmod'] != (bool)$inheritedmodnew) {
- foreach(C::t('forum_moderator')->fetch_all_by_fid_inherited($fid) as $mod) {
- $origmodarray[] = $mod['uid'];
- if(!$forum['inheritedmod'] && $inheritedmodnew) {
- $newmodarray[] = $mod['uid'];
- }
- }
- if($forum['inheritedmod'] && !$inheritedmodnew) {
- C::t('forum_moderator')->delete_by_uid_fid($origmodarray, $fidarray);
- }
- }
- foreach($newmodarray as $uid) {
- C::t('forum_moderator')->insert(array(
- 'uid' => $uid,
- 'fid' => $fid,
- 'displayorder' => $_GET['newdisplayorder'],
- 'inherited' => '0',
- ), false, true);
- if($inheritedmodnew) {
- foreach($fidarray as $ifid) {
- C::t('forum_moderator')->insert(array(
- 'uid' => $uid,
- 'fid' => $ifid,
- 'inherited' => '1',
- ), false, true);
- }
- }
- }
- if($forum['type'] == 'group') {
- $inheritedmodnew = 1;
- } elseif($forum['type'] == 'sub') {
- $inheritedmodnew = 0;
- }
- C::t('forum_forum')->update($fid, array('inheritedmod' => $inheritedmodnew));
- }
- if(is_array($_GET['displayordernew'])) {
- foreach($_GET['displayordernew'] as $uid => $order) {
- C::t('forum_moderator')->update_by_fid_uid($fid, $uid, array(
- 'displayorder' => $order,
- ));
- }
- }
- $fidarray[] = $fid;
- foreach($fidarray as $fid) {
- $moderators = $tab = '';
- $modorder = array();
- $modmemberarray = C::t('forum_moderator')->fetch_all_no_inherited_by_fid($fid);
- foreach($modmemberarray as $moduid => $modmember) {
- $modorder[] = $moduid;
- }
- $members = C::t('common_member')->fetch_all_username_by_uid($modorder);
- foreach($modorder as $mod) {
- if(!$members[$mod]) {
- continue;
- }
- $moderators .= $tab.addslashes($members[$mod]);
- $tab = "\t";
- }
- C::t('forum_forumfield')->update($fid, array('moderators' => $moderators));
- }
- cpmsg('forums_moderators_update_succeed', "mod=forum&action=forums&operation=moderators&fid=$fid", 'succeed');
- }
- } elseif($operation == 'merge') {
- $source = $_GET['source'];
- $target = $_GET['target'];
- if(!submitcheck('mergesubmit') || $source == $target) {
- require_once libfile('function/forumlist');
- loadcache('forums');
- $forumselect = "<select name=\"%s\">\n<option value=\"\"> > ".cplang('select')."</option><option value=\"\"> </option>".str_replace('%', '%%', forumselect(FALSE, 0, 0, TRUE)).'</select>';
- shownav('forum', 'forums_merge');
- showsubmenu('forums_merge');
- showformheader('forums&operation=merge');
- showtableheader();
- showsetting('forums_merge_source', '', '', sprintf($forumselect, 'source'));
- showsetting('forums_merge_target', '', '', sprintf($forumselect, 'target'));
- showsubmit('mergesubmit');
- showtablefooter();
- showformfooter();
- } else {
- if(C::t('forum_forum')->check_forum_exists(array($source,$target)) != 2) {
- cpmsg_error('forums_nonexistence');
- }
- if(C::t('forum_forum')->fetch_forum_num('', $source)) {
- cpmsg_error('forums_merge_source_sub_notnull');
- }
- C::t('forum_thread')->update_by_fid($source, array('fid' => $target));
- loadcache('posttableids');
- $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0');
- foreach($posttableids as $id) {
- C::t('forum_post')->update_fid_by_fid($id, $source, $target);
- }
- $sourceforum = C::t('forum_forum')->fetch_info_by_fid($source);
- $targetforum = C::t('forum_forum')->fetch_info_by_fid($target);
- $sourcethreadtypes = (array)dunserialize($sourceforum['threadtypes']);
- $targethreadtypes = (array)dunserialize($targetforum['threadtypes']);
- $targethreadtypes['types'] = array_merge((array)$targethreadtypes['types'], (array)$sourcethreadtypes['types']);
- $targethreadtypes['icons'] = array_merge((array)$targethreadtypes['icons'], (array)$sourcethreadtypes['icons']);
- C::t('forum_forum')->update($target, array('threads' => $targetforum['threads'] + $sourceforum['threads'], 'posts' => $targetforum['posts'] + $sourceforum['posts']));
- C::t('forum_forumfield')->update($target, array('threadtypes' => serialize($targethreadtypes)));
- C::t('forum_threadclass')->update_by_fid($source, array('fid' => $target));
- C::t('forum_forum')->delete_by_fid($source);
- C::t('home_favorite')->delete_by_id_idtype($source, 'fid');
- C::t('forum_moderator')->delete_by_fid($source);
- C::t('common_member_forum_buylog')->delete_by_fid($target);
- $log_handler = Cloud::loadClass('Cloud_Service_SearchHelper');
- $log_handler->myThreadLog('mergeforum', array('fid' => $source, 'otherid' => $target));
- $query = C::t('forum_access')->fetch_all_by_fid_uid($source);
- foreach($query as $access) {
- C::t('forum_access')->insert(array('uid' => $access['uid'], 'fid' => $target, 'allowview' => $access['allowview'], 'allowpost' => $access['allowpost'], 'allowreply' => $access['allowreply'], 'allowgetattach' => $access['allowgetattach']), false, true);
- }
- C::t('forum_access')->delete_by_fid($source);
- C::t('forum_thread')->clear_cache(array($source,$target), 'forumdisplay_');
- updatecache('forums');
- cpmsg('forums_merge_succeed', 'action=forums', 'succeed');
- }
- } elseif($operation == 'edit') {
- require_once libfile('function/forumlist');
- require_once libfile('function/domain');
- $highlight = getgpc('highlight');
- $anchor = getgpc('anchor');
- list($pluginsetting, $pluginvalue) = get_pluginsetting('forums');
- $multiset = 0;
- if(empty($_GET['multi'])) {
- $fids = $fid;
- } else {
- $multiset = 1;
- if(is_array($_GET['multi'])) {
- $fids = $_GET['multi'];
- } else {
- $_GET['multi'] = explode(',', $_GET['multi']);
- $fids = &$_GET['multi'];
- }
- }
- if(count($_GET['multi']) == 1) {
- $fids = $_GET['multi'][0];
- $multiset = 0;
- }
- if(empty($fids)) {
- cpmsg('forums_edit_nonexistence', 'action=forums&operation=edit'.(!empty($highlight) ? "&highlight=$highlight" : '').(!empty($anchor) ? "&anchor=$anchor" : ''), 'form', array(), '<select name="fid">'.forumselect(FALSE, 0, 0, TRUE).'</select>');
- }
- $mforum = array();
- $perms = array('viewperm', 'postperm', 'replyperm', 'getattachperm', 'postattachperm', 'postimageperm');
- $query = C::t('forum_forum')->fetch_all_info_by_fids($fids);
- if(empty($query)) {
- cpmsg('forums_nonexistence', '', 'error');
- } else {
- foreach($query as $forum) {
- if(isset($pluginvalue[$forum['fid']])) {
- $forum['plugin'] = $pluginvalue[$forum['fid']];
- }
- $mforum[] = $forum;
- }
- }
- $dactionarray = array();
- $allowthreadtypes = !in_array('threadtypes', $dactionarray);
- $forumkeys = C::t('common_setting')->fetch('forumkeys', true);
- $rules = array();
- foreach(C::t('common_credit_rule')->fetch_all_by_action(array('reply', 'post', 'digest', 'postattach', 'getattach')) as $value) {
- $rules[$value['rid']] = $value;
- }
- $navs = array();
- foreach(C::t('common_nav')->fetch_all_by_navtype_type(0, 5) as $nav) {
- $navs[$nav['identifier']] = $nav['id'];
- }
- if(!submitcheck('detailsubmit')) {
- $anchor = in_array($_GET['anchor'], array('basic', 'extend', 'posts', 'attachtype', 'credits', 'threadtypes', 'threadsorts', 'perm', 'plugin')) ? $_GET['anchor'] : 'basic';
- shownav('forum', 'forums_edit');
- loadcache('forums');
- $forumselect = '';
- $sgid = 0;
- foreach($_G['cache']['forums'] as $forums) {
- $checked = $fid == $forums['fid'] || in_array($forums['fid'], $_GET['multi']);
- if($forums['type'] == 'group') {
- $sgid = $forums['fid'];
- $forumselect .= '</div><em class="cl">'.
- '<span class="right"><input name="checkall_'.$forums['fid'].'" onclick="checkAll(\'value\', this.form, '.$forums['fid'].', \'checkall_'.$forums['fid'].'\')" type="checkbox" class="vmiddle checkbox" /></span>'.
- '<span class="pointer" onclick="sdisplay(\'g_'.$forums['fid'].'\', this)"><img src="static/image/admincp/desc.gif" class="vmiddle" /></span> <span class="pointer" onclick="location.href=\''.ADMINSCRIPT.'?action=forums&operation=edit&switch=yes&fid='.$forums['fid'].'\'">'.$forums['name'].'</span></em><div id="g_'.$forums['fid'].'" style="display:">';
- } elseif($forums['type'] == 'forum') {
- $forumselect .= '<input class="left checkbox ck" chkvalue="'.$sgid.'" name="multi[]" value="'.$forums['fid'].'" type="checkbox" '.($checked ? 'checked="checked" ' : '').'/><a class="f'.($checked ? ' current"' : '').'" href="###" onclick="location.href=\''.ADMINSCRIPT.'?action=forums&operation=edit&switch=yes&fid='.$forums['fid'].($mforum[0]['type'] != 'group' ? '&anchor=\'+currentAnchor' : '\'').'+\'&scrolltop=\'+scrollTopBody()">'.$forums['name'].'</a>';
- } elseif($forums['type'] == 'sub') {
- $forumselect .= '<input class="left checkbox ck" chkvalue="'.$sgid.'" name="multi[]" value="'.$forums['fid'].'" type="checkbox" '.($checked ? 'checked="checked" ' : '').'/><a class="s'.($checked ? ' current"' : '').'" href="###" onclick="location.href=\''.ADMINSCRIPT.'?action=forums&operation=edit&switch=yes&fid='.$forums['fid'].($mforum[0]['type'] != 'group' ? '&anchor=\'+currentAnchor' : '\'').'+\'&scrolltop=\'+scrollTopBody()">'.$forums['name'].'</a>';
- }
- }
- $forumselect = '<span id="fselect" class="right popupmenu_dropmenu" onmouseover="showMenu({\'ctrlid\':this.id,\'pos\':\'34\'});$(\'fselect_menu\').style.top=(parseInt($(\'fselect_menu\').style.top)-scrollTopBody())+\'px\';$(\'fselect_menu\').style.left=(parseInt($(\'fselect_menu\').style.left)-document.documentElement.scrollLeft-20)+\'px\'">'.cplang('forums_edit_switch').'<em> </em></span>'.
- '<div id="fselect_menu" class="popupmenu_popup" style="display:none"><div class="fsel"><div>'.$forumselect.'</div></div><div class="cl"><input type="button" class="btn right" onclick="$(\'menuform\').submit()" value="'.cplang('forums_multiedit').'" /></div></div>';
- showformheader('', '', 'menuform', 'get');
- showhiddenfields(array('action' => 'forums', 'operation' => 'edit'));
- if(count($mforum) == 1 && $mforum[0]['type'] == 'group') {
- showsubmenu(cplang('forums_cat_detail').(count($mforum) == 1 ? ' - '.$mforum[0]['name'].'(gid:'.$mforum[0]['fid'].')' : ''), array(), $forumselect);
- } else {
- if($multiset && !in_array($anchor, array('basic', 'extend', 'posts', 'perm', 'plugin'))) {
- $anchor = 'basic';
- }
- showsubmenuanchors(cplang('forums_edit').(count($mforum) == 1 ? ' - '.$mforum[0]['name'].'(fid:'.$mforum[0]['fid'].')' : ''), array(
- array('forums_edit_basic', 'basic', $anchor == 'basic'),
- array('forums_edit_extend', 'extend', $anchor == 'extend'),
- array('forums_edit_posts', 'posts', $anchor == 'posts'),
- array('forums_edit_perm', 'perm', $anchor == 'perm'),
- !$multiset ? array('forums_edit_credits', 'credits', $anchor == 'credits') : array(),
- !$multiset ? array(array('menu' => 'usergroups_edit_other', 'submenu' => array(
- array('forums_edit_threadtypes', 'threadtypes', $anchor == 'threadtypes'),
- array('forums_edit_threadsorts', 'threadsorts', $anchor == 'threadsorts'),
- !$multiset ? array('forums_edit_attachtype', 'attachtype', $anchor == 'attachtype') : array(),
- !$pluginsetting ? array() : array('forums_edit_plugin', 'plugin', $anchor == 'plugin'),
- ))) : array(),
- $multiset && $pluginsetting ? array('forums_edit_plugin', 'plugin', $anchor == 'plugin') : array(),
- ), $forumselect);
- }
- showformfooter();
- $groups = array();
- $query = C::t('common_usergroup')->range_orderby_credit();
- foreach($query as $group) {
- $group['type'] = $group['type'] == 'special' && $group['radminid'] ? 'specialadmin' : $group['type'];
- $groups[$group['type']][] = $group;
- }
- $styleselect = "<select name=\"styleidnew\"><option value=\"0\">$lang[use_default]</option>";
- foreach(C::t('common_style')->fetch_all_data(false, false) as $style) {
- $styleselect .= "<option value=\"$style[styleid]\" ".
- ($style['styleid'] == $mforum[0]['styleid'] ? 'selected="selected"' : NULL).
- ">$style[name]</option>\n";
- }
- $styleselect .= '</select>';
- if(!$multiset) {
- $attachtypes = '';
- foreach(C::t('forum_attachtype')->fetch_all_by_fid($fid) as $type) {
- $type['maxsize'] = round($type['maxsize'] / 1024);
- $attachtypes .= showtablerow('', array('class="td25"', 'class="td24"'), array(
- "<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$type[id]\" />",
- "<input type=\"text\" class=\"txt\" size=\"10\" name=\"extension[$type[id]]\" value=\"$type[extension]\" />",
- "<input type=\"text\" class=\"txt\" size=\"15\" name=\"maxsize[$type[id]]\" value=\"$type[maxsize]\" />"
- ), TRUE);
- }
- } else {
- showtips('setting_multi_tips');
- }
- showformheader("forums&operation=edit&fid=$fid&", 'enctype');
- showhiddenfields(array('type' => $mforum[0]['type']));
- if(count($mforum) == 1 && $mforum[0]['type'] == 'group') {
- $mforum[0]['extra'] = dunserialize($mforum[0]['extra']);
- showtableheader();
- showsetting('forums_edit_basic_cat_name', 'namenew', $mforum[0]['name'], 'text');
- showsetting('forums_edit_basic_cat_name_color', 'extranew[namecolor]', $mforum[0]['extra']['namecolor'], 'color');
- showsetting('forums_edit_basic_cat_style', '', '', $styleselect);
- showsetting('forums_edit_extend_forum_horizontal', 'forumcolumnsnew', $mforum[0]['forumcolumns'], 'text');
- showsetting('forums_edit_extend_cat_sub_horizontal', 'catforumcolumnsnew', $mforum[0]['catforumcolumns'], 'text');
- if(!empty($_G['setting']['domain']['root']['forum'])) {
- showsetting('forums_edit_extend_domain', '', '', 'http://<input type="text" name="domainnew" class="txt" value="'.$mforum[0]['domain'].'" style="width:100px; margin-right:0px;" >.'.$_G['setting']['domain']['root']['forum']);
- } else {
- showsetting('forums_edit_extend_domain', 'domainnew', '', 'text', 'disabled');
- }
- showsetting('forums_cat_display', 'statusnew', $mforum[0]['status'], 'radio');
- showsetting('forums_edit_basic_shownav', 'shownavnew', array_key_exists($mforum[0]['fid'], $navs) ? 1 : 0, 'radio');
- showtablefooter();
- showtips('setting_seo_forum_tips', 'seo_tips', true, 'setseotips');
- showtableheader();
- showsetting('forums_edit_basic_seotitle', 'seotitlenew', dhtmlspecialchars($mforum[0]['seotitle']), 'text');
- showsetting('forums_edit_basic_keyword', 'keywordsnew', dhtmlspecialchars($mforum[0]['keywords']), 'text');
- showsetting('forums_edit_basic_seodescription', 'seodescriptionnew', dhtmlspecialchars($mforum[0]['seodescription']), 'textarea');
- showsubmit('detailsubmit');
- showtablefooter();
- } else {
- require_once libfile('function/editor');
- if($multiset) {
- $_G['showsetting_multi'] = 0;
- $_G['showsetting_multicount'] = count($mforum);
- foreach($mforum as $forum) {
- $_G['showtableheader_multi'][] = '<a href="javascript:;" onclick="location.href=\''.ADMINSCRIPT.'?action=forums&operation=edit&fid='.$forum['fid'].'&anchor=\'+$(\'cpform\').anchor.value;return false">'.$forum['name'].'(fid:'.$forum['fid'].')</a>';
- }
- }
- $mfids = array();
- foreach($mforum as $forum) {
- $fid = $forum['fid'];
- $mfids[] = $fid;
- if(!$multiset) {
- $fupselect = "<select name=\"fupnew\">\n";
- $query = C::t('forum_forum')->fetch_all_info_by_ignore_fid($fid);
- foreach($query as $fup) {
- $fups[] = $fup;
- }
- if(is_array($fups)) {
- foreach($fups as $forum1) {
- if($forum1['type'] == 'group') {
- $selected = $forum1['fid'] == $forum['fup'] ? "selected=\"selected\"" : NULL;
- $fupselect .= "<option value=\"$forum1[fid]\" $selected>$forum1[name]</option>\n";
- foreach($fups as $forum2) {
- if($forum2['type'] == 'forum' && $forum2['fup'] == $forum1['fid']) {
- $selected = $forum2['fid'] == $forum['fup'] ? "selected=\"selected\"" : NULL;
- $fupselect .= "<option value=\"$forum2[fid]\" $selected> > $forum2[name]</option>\n";
- }
- }
- }
- }
- foreach($fups as $forum0) {
- if($forum0['type'] == 'forum' && $forum0['fup'] == 0) {
- $selected = $forum0['fid'] == $forum['fup'] ? "selected=\"selected\"" : NULL;
- $fupselect .= "<option value=\"$forum0[fid]\" $selected>$forum0[name]</option>\n";
- }
- }
- }
- $fupselect .= '</select>';
- if($forum['threadtypes']) {
- $forum['threadtypes'] = dunserialize($forum['threadtypes']);
- $forum['threadtypes']['status'] = 1;
- } else {
- $forum['threadtypes'] = array('status' => 0, 'required' => 0, 'listable' => 0, 'prefix' => 0, 'options' => array());
- }
- if($forum['threadsorts']) {
- $forum['threadsorts'] = dunserialize($forum['threadsorts']);
- $forum['threadsorts']['status'] = 1;
- } else {
- $forum['threadsorts'] = array('status' => 0, 'required' => 0, 'listable' => 0, 'prefix' => 0, 'options' => array());
- }
- $typeselect = $sortselect = '';
- $query = C::t('forum_threadtype')->fetch_all_for_order();
- $typeselect = getthreadclasses_html($fid);
- foreach($query as $type) {
- $typeselected = array();
- $enablechecked = '';
- $keysort = $type['special'] ? 'threadsorts' : 'threadtypes';
- if(isset($forum[$keysort]['types'][$type['typeid']])) {
- $enablechecked = ' checked="checked"';
- }
- $showtype = TRUE;
- loadcache('threadsort_option_'.$type['typeid']);
- if($type['special'] && !$_G['cache']['threadsort_option_'.$type['typeid']]) {
- $showtype = FALSE;
- }
- if($type['special']) {
- $typeselected[3] = $forum['threadsorts']['show'][$type['typeid']] ? ' checked="checked"' : '';
- $sortselect .= $showtype ? showtablerow('', array('class="td25"'), array(
- '<input type="checkbox" name="threadsortsnew[options][enable]['.$type['typeid'].']" value="1" class="checkbox"'.$enablechecked.' />',
- $type['name'],
- $type['description'],
- "<input class=\"checkbox\" type=\"checkbox\" name=\"threadsortsnew[options][show][{$type[typeid]}]\" value=\"3\" $typeselected[3] />",
- "<input class=\"radio\" type=\"radio\" name=\"threadsortsnew[defaultshow]\" value=\"$type[typeid]\" ".($forum['threadsorts']['defaultshow'] == $type['typeid'] ? 'checked' : '')." />"
- ), TRUE) : '';
- }
- }
- $forum['creditspolicy'] = $forum['creditspolicy'] ? dunserialize($forum['creditspolicy']) : array();
- }
- if($forum['autoclose']) {
- $forum['autoclosetime'] = abs($forum['autoclose']);
- $forum['autoclose'] = $forum['autoclose'] / abs($forum['autoclose']);
- }
- if($forum['threadplugin']) {
- $forum['threadplugin'] = dunserialize($forum['threadplugin']);
- }
- $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'] ? dunserialize($forum['modrecommend']) : '';
- $forum['formulaperm'] = dunserialize($forum['formulaperm']);
- $forum['medal'] = $forum['formulaperm']['medal'];
- $forum['formulapermmessage'] = $forum['formulaperm']['message'];
- $forum['formulapermusers'] = $forum['formulaperm']['users'];
- $forum['formulaperm'] = $forum['formulaperm'][0];
- $forum['extra'] = dunserialize($forum['extra']);
- $forum['threadsorts']['default'] = $forum['threadsorts']['defaultshow'] ? 1 : 0;
- $_G['multisetting'] = $multiset ? 1 : 0;
- showmultititle();
- showtagheader('div', 'basic', $anchor == 'basic');
- if(!$multiset) {
- showtips('forums_edit_tips');
- }
- showtableheader('forums_edit_basic', 'nobottom');
- showsetting('forums_edit_basic_name', 'namenew', $forum['name'], 'text');
- showsetting('forums_edit_base_name_color', 'extranew[namecolor]', $forum['extra']['namecolor'], 'color');
- if(!$multiset) {
- if($forum['icon']) {
- $valueparse = parse_url($forum['icon']);
- if(isset($valueparse['host'])) {
- $forumicon = $forum['icon'];
- } else {
- $forumicon = $_G['setting']['attachurl'].'common/'.$forum['icon'].'?'.random(6);
- }
- $forumiconhtml = '<label><input type="checkbox" class="checkbox" name="deleteicon" value="yes" /> '.$lang['delete'].'</label><br /><img src="'.$forumicon.'" /><br />';
- }
- showsetting('forums_edit_basic_icon', 'iconnew', $forum['icon'], 'filetext', '', 0, $forumiconhtml);
- showsetting('forums_edit_basic_icon_width', 'extranew[iconwidth]', $forum['extra']['iconwidth'], 'text');
- if($forum['banner']) {
- $valueparse = parse_url($forum['banner']);
- if(isset($valueparse['host'])) {
- $forumbanner = $forum['banner'];
- } else {
- $forumbanner = $_G['setting']['attachurl'].'common/'.$forum['banner'].'?'.random(6);
- }
- $forumbannerhtml = '<label><input type="checkbox" class="checkbox" name="deletebanner" value="yes" /> '.$lang['delete'].'</label><br /><img src="'.$forumbanner.'" /><br />';
- }
- showsetting('forums_edit_basic_banner', 'bannernew', $forum['banner'], 'filetext', '', 0, $forumbannerhtml);
- }
- showsetting('forums_edit_basic_display', 'statusnew', $forum['status'], 'radio');
- showsetting('forums_edit_basic_shownav', 'shownavnew', array_key_exists($fid, $navs) ? 1 : 0, 'radio');
- if(!$multiset) {
- showsetting('forums_edit_basic_up', '', '', $fupselect);
- }
- showsetting('forums_edit_basic_redirect', 'redirectnew', $forum['redirect'], 'text');
- showsetting('forums_edit_basic_description', 'descriptionnew', htmlspecialchars_decode(html2bbcode($forum['description'])), 'textarea');
- showsetting('forums_edit_basic_rules', 'rulesnew', htmlspecialchars_decode(html2bbcode($forum['rules'])), 'textarea');
- showsetting('forums_edit_basic_keys', 'keysnew', $forumkeys[$fid], 'text');
- if(!empty($_G['setting']['domain']['root']['forum'])) {
- $iname = $multiset ? "multinew[{$_G[showsetting_multi]}][domainnew]" : 'domainnew';
- showsetting('forums_edit_extend_domain', '', '', 'http://<input type="text" name="'.$iname.'" class="txt" value="'.$forum['domain'].'" style="width:100px; margin-right:0px;" >.'.$_G['setting']['domain']['root']['forum']);
- } elseif(!$multiset) {
- showsetting('forums_edit_extend_domain', 'domainnew', '', 'text', 'disabled');
- }
- showtablefooter();
- if(!$multiset) {
- showtips('setting_seo_forum_tips', 'seo_tips', true, 'setseotips');
- }
- showtableheader();
- showsetting('forums_edit_basic_seotitle', 'seotitlenew', dhtmlspecialchars($forum['seotitle']), 'text');
- showsetting('forums_edit_basic_keyword', 'keywordsnew', dhtmlspecialchars($forum['keywords']), 'text');
- showsetting('forums_edit_basic_seodescription', 'seodescriptionnew', dhtmlspecialchars($forum['seodescription']), 'textarea');
- showtablefooter();
- showtagfooter('div');
- showtagheader('div', 'extend', $anchor == 'extend');
- if(!$multiset) {
- showtips('forums_edit_tips');
- }
- showtableheader('forums_edit_extend', 'nobottom');
- showsetting('forums_edit_extend_style', '', '', $styleselect);
- if($forum['type'] != 'sub') {
- showsetting('forums_edit_extend_sub_horizontal', 'forumcolumnsnew', $forum['forumcolumns'], 'text');
- showsetting('forums_edit_extend_subforumsindex', array('subforumsindexnew', array(
- array(-1, cplang('default')),
- array(1, cplang('yes')),
- array(0, cplang('no'))
- ), 1), $forum['subforumsindex'], 'mradio');
- showsetting('forums_edit_extend_simple', 'simplenew', $forum['simple'], 'radio');
- } else {
- if($_GET['multi']) {
- showsetting('forums_edit_extend_sub_horizontal', '', '', cplang('forums_edit_sub_multi_tips'));
- showsetting('forums_edit_extend_subforumsindex', '', '', cplang('forums_edit_sub_multi_tips'));
- showsetting('forums_edit_extend_simple', '', '', cplang('forums_edit_sub_multi_tips'));
- }
- }
- showsetting('forums_edit_extend_widthauto', array('widthautonew', array(
- array(0, cplang('default')),
- array(-1, cplang('forums_edit_extend_widthauto_-1')),
- array(1, cplang('forums_edit_extend_widthauto_1')),
- ), 1), $forum['widthauto'], 'mradio');
- showsetting('forums_edit_extend_picstyle', 'picstylenew', $forum['picstyle'], 'radio');
- showsetting('forums_edit_extend_allowside', 'allowsidenew', $forum['allowside'], 'radio');
- showsetting('forums_edit_extend_recommend_top', 'allowglobalsticknew', $forum['allowglobalstick'], 'radio');
- showsetting('forums_edit_extend_defaultorderfield', array('defaultorderfieldnew', array(
- array(0, cplang('forums_edit_extend_order_lastpost')),
- array(1, cplang('forums_edit_extend_order_starttime')),
- array(2, cplang('forums_edit_extend_order_replies')),
- array(3, cplang('forums_edit_extend_order_views'))
- )), $forum['defaultorderfield'], 'mradio');
- showsetting('forums_edit_extend_defaultorder', array('defaultordernew', array(
- array(0, cplang('forums_edit_extend_order_desc')),
- array(1, cplang('forums_edit_extend_order_asc'))
- )), $forum['defaultorder'], 'mradio');
- if($_G['setting']['allowreplybg']) {
- $replybghtml = '';
- if($forum['replybg']) {
- $replybghtml = '<label><input type="checkbox" class="checkbox" name="delreplybg" value="yes" /> '.$lang['delete'].'</label><br /><img src="'.$_G['setting']['attachurl'].'common/'.$forum['replybg'].'" width="200px" />';
- }
- if($forum['replybg']) {
- $replybgurl = parse_url($forum['replybg']);
- }
- showsetting('forums_edit_extend_reply_background', 'replybgnew', (!$replybgurl['host'] ? str_replace($_G['setting']['attachurl'].'common/', '', $forum['replybg']) : $forum['replybg']), 'filetext', '', 0, $replybghtml);
- }
- showsetting('forums_edit_extend_threadcache', 'threadcachesnew', $forum['threadcaches'], 'text');
- showsetting('forums_edit_extend_relatedgroup', 'relatedgroupnew', $forum['relatedgroup'], 'text');
- showsetting('forums_edit_extend_edit_rules', 'alloweditrulesnew', $forum['alloweditrules'], 'radio');
- showsetting('forums_edit_extend_disablecollect', 'disablecollectnew', $forum['disablecollect'], 'radio');
- showsetting('forums_edit_extend_recommend', 'modrecommendnew[open]', $forum['modrecommend']['open'], 'radio', '', 1);
- showsetting('forums_edit_extend_recommend_sort', array('modrecommendnew[sort]', array(
- array(1, cplang('forums_edit_extend_recommend_sort_auto')),
- array(0, cplang('forums_edit_extend_recommend_sort_manual')),
- array(2, cplang('forums_edit_extend_recommend_sort_mix')))), $forum['modrecommend']['sort'], 'mradio');
- showsetting('forums_edit_extend_recommend_orderby', array('modrecommendnew[orderby]', array(
- array(0, cplang('forums_edit_extend_recommend_orderby_dateline')),
- array(1, cplang('forums_edit_extend_recommend_orderby_lastpost')),
- array(2, cplang('forums_edit_extend_recommend_orderby_views')),
- array(3, cplang('forums_edit_extend_recommend_orderby_replies')),
- array(4, cplang('forums_edit_extend_recommend_orderby_digest')),
- array(5, cplang('forums_edit_extend_recommend_orderby_recommend')),
- array(6, cplang('forums_edit_extend_recommend_orderby_heats')),
- )), $forum['modrecommend']['orderby'], 'mradio');
- showsetting('forums_edit_extend_recommend_num', 'modrecommendnew[num]', $forum['modrecommend']['num'], 'text');
- showsetting('forums_edit_extend_recommend_imagenum', 'modrecommendnew[imagenum]', $forum['modrecommend']['imagenum'], 'text');
- showsetting('forums_edit_extend_recommend_imagesize', array('modrecommendnew[imagewidth]', 'modrecommendnew[imageheight]'), array(intval($forum['modrecommend']['imagewidth']), intval($forum['modrecommend']['imageheight'])), 'multiply');
- showsetting('forums_edit_extend_recommend_maxlength', 'modrecommendnew[maxlength]', $forum['modrecommend']['maxlength'], 'text');
- showsetting('forums_edit_extend_recommend_cachelife', 'modrecommendnew[cachelife]', $forum['modrecommend']['cachelife'], 'text');
- showsetting('forums_edit_extend_recommend_dateline', 'modrecommendnew[dateline]', $forum['modrecommend']['dateline'], 'text');
- showtablefooter();
- showtagfooter('div');
- showtagheader('div', 'posts', $anchor == 'posts');
- if(!$multiset) {
- showtips('forums_edit_tips');
- }
- showtableheader('forums_edit_posts', 'nobottom');
- showsetting('forums_edit_posts_modposts', array('modnewpostsnew', array(
- array(0, cplang('none')),
- array(1, cplang('forums_edit_posts_modposts_threads')),
- array(2, cplang('forums_edit_posts_modposts_posts'))
- )), $forum['modnewposts'], 'mradio');
- showsetting('forums_edit_posts_alloweditpost', 'alloweditpostnew', $forum['alloweditpost'], 'radio');
- showsetting('forums_edit_posts_recyclebin', 'recyclebinnew', $forum['recyclebin'], 'radio');
- showsetting('forums_edit_posts_html', 'allowhtmlnew', $forum['allowhtml'], 'radio');
- showsetting('forums_edit_posts_bbcode', 'allowbbcodenew', $forum['allowbbcode'], 'radio');
- showsetting('forums_edit_posts_imgcode', 'allowimgcodenew', $forum['allowimgcode'], 'radio');
- showsetting('forums_edit_posts_mediacode', 'allowmediacodenew', $forum['allowmediacode'], 'radio');
- showsetting('forums_edit_posts_smilies', 'allowsmiliesnew', $forum['allowsmilies'], 'radio');
- showsetting('forums_edit_posts_jammer', 'jammernew', $forum['jammer'], 'radio');
- showsetting('forums_edit_posts_anonymous', 'allowanonymousnew', $forum['allowanonymous'], 'radio');
- showsetting('forums_edit_posts_disablethumb', 'disablethumbnew', $forum['disablethumb'], 'radio');
- showsetting('forums_edit_posts_disablewatermark', 'disablewatermarknew', $forum['disablewatermark'], 'radio');
- showsetting('forums_edit_posts_allowpostspecial', array('allowpostspecialnew', array(
- cplang('thread_poll'),
- cplang('thread_trade'),
- cplang('thread_reward'),
- cplang('thread_activity'),
- cplang('thread_debate')
- )), $forum['allowpostspecial'], 'binmcheckbox');
- $threadpluginarray = '';
- if(is_array($_G['setting']['threadplugins'])) foreach($_G['setting']['threadplugins'] as $tpid => $data) {
- $threadpluginarray[] = array($tpid, $data['name']);
- }
- if($threadpluginarray) {
- showsetting('forums_edit_posts_threadplugin', array('threadpluginnew', $threadpluginarray), $forum['threadplugin'], 'mcheckbox');
- }
- showsetting('forums_edit_posts_allowspecialonly', 'allowspecialonlynew', $forum['allowspecialonly'], 'radio');
- showsetting('forums_edit_posts_autoclose', array('autoclosenew', array(
- array(0, cplang('forums_edit_posts_autoclose_none'), array('autoclose_time' => 'none')),
- array(1, cplang('forums_edit_posts_autoclose_dateline'), array('autoclose_time' => '')),
- array(-1, cplang('forums_edit_posts_autoclose_lastpost'), array('autoclose_time' => ''))
- )), $forum['autoclose'], 'mradio');
- showtagheader('tbody', 'autoclose_time', $forum['autoclose'], 'sub');
- showsetting('forums_edit_posts_autoclose_time', 'autoclosetimenew', $forum['autoclosetime'], 'text');
- showtagfooter('tbody');
- showsetting('forums_edit_posts_attach_ext', 'attachextensionsnew', $forum['attachextensions'], 'text');
- showsetting('forums_edit_posts_allowfeed', 'allowfeednew', $forum['allowfeed'], 'radio');
- showsetting('forums_edit_posts_commentitem', 'commentitemnew', $forum['commentitem'], 'textarea');
- showsetting('forums_edit_posts_noantitheft', 'noantitheftnew', $forum['noantitheft'], 'radio');
- showsetting('forums_edit_posts_noforumhidewater', 'noforumhidewaternew', $forum['noforumhidewater'], 'radio');
- showsetting('forums_edit_posts_noforumrecommend', 'noforumrecommendnew', $forum['noforumrecommend'], 'radio');
- showtablefooter();
- showtagfooter('div');
- if(!$multiset) {
- showtagheader('div', 'attachtype', $anchor == 'attachtype');
- showtips('forums_edit_attachtype_tips');
- showtableheader();
- showtablerow('class="partition"', array('class="td25"', 'class="td24"'), array(cplang('del'), cplang('misc_attachtype_ext'), cplang('misc_attachtype_maxsize')));
- echo $attachtypes;
- echo '<tr><td></td><td colspan="2"><div><a href="###" onclick="addrow(this, 1)" class="addtr">'.$lang['misc_attachtype_add'].'</a></div></tr>';
- showtablefooter();
- showtagfooter('div');
- showtagheader('div', 'credits', $anchor == 'credits');
- if(!$multiset) {
- showtips('forums_edit_tips');
- }
- showtableheader('forums_edit_credits_policy', 'fixpadding');
- echo '<tr class="header"><th>'.cplang('credits_id').'</th><th>'.cplang('setting_credits_policy_cycletype').'</th><th>'.cplang('setting_credits_policy_rewardnum').'</th><th class="td25">'.cplang('custom').'</th>';
- foreach($_G['setting']['extcredits'] as $i => $extcredit) {
- echo '<th>'.$extcredit['title'].'</th>';
- }
- echo '<th> </th></tr>';
- if(is_array($_G['setting']['extcredits'])) {
- foreach($rules as $rid => $rule) {
- $globalrule = $rule;
- $readonly = $checked = '';
- if(isset($forum['creditspolicy'][$rule['action']])) {
- $rule = $forum['creditspolicy'][$rule['action']];
- $checked = ' checked="checked"';
- } else {
- for($i = 1; $i <= 8; $i++) {
- $rule['extcredits'.$i] = '';
- }
- $readonly = ' readonly="readonly" style="display:none;"';
- }
- $usecustom = '<input type="checkbox" name="usecustom['.$rule['rid'].']" onclick="modifystate(this);" value="1" class="checkbox" '.$checked.' />';
- $tdarr = array($rule['rulename'], $rule['rid'] ? cplang('setting_credits_policy_cycletype_'.$rule['cycletype']) : 'N/A', $rule['rid'] && $rule['cycletype'] ? $rule['rewardnum'] : 'N/A', $usecustom);
- for($i = 1; $i <= 8; $i++) {
- if($_G['setting']['extcredits'][$i]) {
- array_push($tdarr, '<input type="text" name="creditnew['.$rule['rid'].']['.$i.']" class="txt smtxt" value="'.$rule['extcredits'.$i].'" '.$readonly.' /><span class="sml">('.($globalrule['extcredits'.$i]).')</span>');
- }
- }
- $opstr = '<a href="'.ADMINSCRIPT.'?action=credits&operation=edit&rid='.$rule['rid'].'&fid='.$fid.'" title="" class="act">'.cplang('edit').'</a>';
- array_push($tdarr, $opstr);
- showtablerow('', array_fill(4, count($_G['setting']['extcredits']) + 4, 'width="70"'), $tdarr);
- }
- }
- showtablerow('', 'class="lineheight" colspan="13"', cplang('forums_edit_credits_comment', array('fid' => $fid)));
- showtablefooter();
- print <<<EOF
- <script type="text/javascript">
- function modifystate(custom) {
- var trObj = custom.parentNode.parentNode;
- var inputsObj = trObj.getElementsByTagName('input');
- for(key in inputsObj) {
- var obj = inputsObj[key];
- if(typeof obj == 'object' && obj.type != 'checkbox') {
- obj.value = '';
- obj.readOnly = custom.checked ? false : true;
- obj.style.display = obj.readOnly ? 'none' : '';
- }
- }
- }
- </script>
- EOF;
- showtagfooter('div');
- }
- if($allowthreadtypes && !$multiset) {
- $lang_forums_edit_threadtypes_use_cols = cplang('forums_edit_threadtypes_use_cols');
- $lang_forums_edit_threadtypes_use_choice = cplang('forums_edit_threadtypes_use_choice');
- echo <<<EOT
- <script type="text/JavaScript">
- var rowtypedata = [
- [
- [1,'', 'td25'],
- [1,'<input type="text" size="2" name="newdisplayorder[]" value="0" />'],
- [1,'<input type="text" name="newname[]" />'],
- [1,'<input type="text" name="newicon[]" />'],
- [1,'<input type="hidden" name="newenable[]" value="1"><input type="checkbox" class="checkbox" checked="checked" disabled/>'],
- [1,'<input type="checkbox" class="checkbox" name="newmoderators[]" value="1" />'],
- [1,'']
- ],
- [
- [1,'', 'td25'],
- [1,'<input name="newextension[]" type="text" class="txt" size="10">', 'td24'],
- [1,'<input name="newmaxsize[]" type="text" class="txt" size="15">']
- ]
- ];
- </script>
- EOT;
- showtagheader('div', 'threadtypes', $anchor == 'threadtypes');
- if(!$multiset) {
- showtips('forums_edit_tips');
- }
- showtableheader('forums_edit_threadtypes_config', 'nobottom');
- showsetting('forums_edit_threadtypes_status', array('threadtypesnew[status]', array(
- array(1, cplang('yes'), array('threadtypes_config' => '', 'threadtypes_manage' => '')),
- array(0, cplang('no'), array('th…
Large files files are truncated, but you can click here to view the full file