作者:别问我是谁
简体化:5025488.net(西门不败)
演示见 2 楼
====================================================================
主题分类 可设定颜色 ( 见演示 )
后台编辑 主题分类 将说明改为显示颜色 ( 见演示 )
关联论坛 下拉形式显示 ( 见演示 )
编辑论坛 改为每行显示 5 个分类 (见演示 )
====================================================================
修改文件:
forumdisplay.php
include/global.func.php
templates/default/admincp.lang.php
admin/forums.inc.php
----------------------------------------------------------------
修改设定完成后 紧记 更新缓存
并要到每个版区提交一次 颜色显示才会生产
====================================================================
include/global.func.php 找:
- $html .= '<option value="'.$typeid.'" '.($curtypeid == $typeid ? 'selected' : '').'>'.strip_tags($name).'</option>';
复制代码
改为:
- $html .= '<option '.($threadtypes['description'][$typeid] ? 'style="color:'.$threadtypes['description'][$typeid].'" ' : '').'value="'.$typeid.'" '.($curtypeid == $typeid ? 'selected' : '').'>'.strip_tags($name).'</option>';
复制代码
====================================================================
templates/default/admincp.lang.php 找:
- 'forums_threadtypes_use_cols' => '使用(平板显示)',
- 'forums_threadtypes_use_choice' => '使用(下拉显示)',
复制代码
改为:
- 'forums_threadtypes_use_cols' => '平板显示',
- 'forums_threadtypes_use_choice' => '下拉显示',
复制代码
====================================================================
forumdisplay.php 找:
- $thread['typeid'] = $thread['typeid'] && !empty($forum['threadtypes']['prefix']) && isset($forum['threadtypes']['types'][$thread['typeid']]) ?
- '['.$forum['threadtypes']['types'][$thread['typeid']].'] ' : '';
复制代码
改为:
- $thread['typeid'] = $thread['typeid'] && !empty($forum['threadtypes']['prefix']) && isset($forum['threadtypes']['types'][$thread['typeid']]) ?
- '['.($forum['threadtypes']['description'][$thread['typeid']] ? '<font color="'.$forum['threadtypes']['description'][$thread['typeid']].'">'.$forum['threadtypes']['types'][$thread['typeid']].'</font>' : ''.$forum['threadtypes']['types'][$thread['typeid']].'').'] ' : '';
复制代码
====================================================================
admin/forums.inc.php 找:
- $typeselect = '';
- $query = $db->query("SELECT * FROM {$tablepre}threadtypes ORDER BY displayorder");
- while($type = $db->fetch_array($query)) {
- $typeselected = array();
- if(isset($forum['threadtypes']['flat'][$type['typeid']])) {
- $typeselected[1] = 'checked';
- } elseif(isset($forum['threadtypes']['selectbox'][$type['typeid']])) {
- $typeselected[2] = 'checked';
- } else {
- $typeselected[0] = 'checked';
- }
- $typeselect .= "<tr align="center"><td class="altbg1">$type[name]</td>".
- "<td class="altbg2">$type[description]</td>".
- "<td class="altbg1"><input class="radio" type="radio" name="threadtypesnew[options][{$type[typeid]}]" value="0" $typeselected[0]></td>".
- "<td class="altbg2"><input class="radio" type="radio" name="threadtypesnew[options][{$type[typeid]}]" value="1" $typeselected[1]></td>".
- "<td class="altbg1"><input class="radio" type="radio" name="threadtypesnew[options][{$type[typeid]}]" value="2" $typeselected[2]></td>".
- "</tr>";
- }
复制代码
改为:
- $typeselect = '';
- $num=0;
- $query = $db->query("SELECT * FROM {$tablepre}threadtypes ORDER BY displayorder");
- while($type = $db->fetch_array($query)) {
- $typeselected = array();
- if(isset($forum['threadtypes']['flat'][$type['typeid']])) {
- $typeselected[1] = 'selected';
- } elseif(isset($forum['threadtypes']['selectbox'][$type['typeid']])) {
- $typeselected[2] = 'selected';
- } else {
- $typeselected[0] = 'selected';
- }
- $typeselect .= "<td><input type="hidden" name="threadtypesnew[description][$type[typeid]]" value="$type[description]"><select name="threadtypesnew[options][{$type[typeid]}]">\n".
- "<option value="0" style="color:#aaaaaa" $typeselected[0]>".$lang['not_use']."</option>\n".
- "<option value="1" style="color:green" $typeselected[1]>".$lang['forums_threadtypes_use_cols']."</option>\n".
- "<option value="2" style="color:blue" $typeselected[2]>".$lang['forums_threadtypes_use_choice']."</option>\n".
- "</select> ".($type[description] ? "<font color="$type[description]">$type[name]</font>" : $type[name])."</td>\n";
- $num ++;
- if($num%5==0) $typeselect.="</tr><tr>\n";
- }
复制代码
再找:
- showtype('forums_edit_threadtypes');
- showsetting('forums_edit_threadtypes_status', 'threadtypesnew[status]', $forum['threadtypes']['status'], 'radio');
- 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');
- echo '</table><br><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
- '<tr class="header"><td>'.$lang['forums_cat_name'].'</td><td>'.$lang['forums_sort_note'].'</td><td width="20%">'.$lang['not_use'].'</td><td width="20%">'.$lang['forums_threadtypes_use_cols'].'</td><td width="20%">'.$lang['forums_threadtypes_use_choice'].'</td></tr>'.
- $typeselect.'<tr><td colspan=5>'.$lang['add_new'].'<a href="###" onclick="addtype()">[+]</a></td></tr><tbody id="type_0"><tr align="center"><td class="altbg1"><input type="text" name="newname[0]" size="15"></td><td class="altbg2"><input type="text" name="newdescription[0]" size="15"></td><td class="altbg1"><input class="radio" type="radio" name="newoptions[0]" value="0"></td><td class="altbg2"><input class="radio" type="radio" name="newoptions[0]" value="1" checked></td><td class="altbg1"><input class="radio" type="radio" name="newoptions[0]" value="2"></td></tr></tbody>';
复制代码
改为:
- //--------------------------------------------------------------
- showtype('forums_edit_threadtypes');
- showsetting('forums_edit_threadtypes_status', 'threadtypesnew[status]', $forum['threadtypes']['status'], 'radio');
- 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');
- echo '</table><br><table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">'.
- '<tr class="header"><td colspan="5">'.$lang['forums_edit_threadtypes'].'</td></tr>'.
- '<tr><td class="altbg2" colspan="5"><table width="99%" border="0" cellpadding="0" cellspacing="0"><tr>'.
- $typeselect.'</td></tr></table></td></tr>'.
- '<tr class="altbg2"><td>'.$lang['forums_cat_name'].' '.$lang['add_new'].'<a href="###" onclick="addtype()">[+]</a></td><td>显示颜色</td><td width="20%">'.$lang['not_use'].'</td><td width="20%">'.$lang['forums_threadtypes_use_cols'].'</td><td width="20%">'.$lang['forums_threadtypes_use_choice'].'</td></tr>'.
- '<tbody id="type_0"><tr align="center"><td class="altbg1"><input type="text" name="newname[0]" size="15"></td><td class="altbg2"><input type="text" name="newdescription[0]" size="15"></td><td class="altbg1"><input class="radio" type="radio" name="newoptions[0]" value="0"></td><td class="altbg2"><input class="radio" type="radio" name="newoptions[0]" value="1" checked></td><td class="altbg1"><input class="radio" type="radio" name="newoptions[0]" value="2"></td></tr></tbody>';
- //--------------------------------------------------------------
复制代码
再找:
- 'prefix' => (bool)$threadtypesnew['prefix'],
- 'types' => $threadtypesnew['types'],
复制代码
改为:
- 'prefix' => (bool)$threadtypesnew['prefix'],
- 'types' => $threadtypesnew['types'],
- 'description' => $threadtypesnew['description'],
复制代码
再找:
- $forumsarray[$typeid][] = '<a href="forumdisplay.php?fid='.$forum['fid'].'" target="_blank">'.$forum['name'].'</a> [<a href="admincp.php?action=forumdetail&fid='.$forum['fid'].'">'.$lang['edit'].'</a>]';
- $fidsarray[$typeid][] = $forum['fid'];
复制代码
改为:
- $forumsarrayforum[$typeid][] = '<option value="forumdisplay.php?fid='.$forum['fid'].'">'.$forum['name'].'</option>';
- $forumsarrayedit[$typeid][] = '<option value="admincp.php?action=forumdetail&fid='.$forum['fid'].'">'.$forum['name'].'</option>';
复制代码
再找:
- $threadtypes .= "<tr align="center"><td class="altbg1"><input class="checkbox" type="checkbox" name="delete[]" value="$type[typeid]"></td>\n".
- "<td class="altbg2"><input type="text" size="15" name="namenew[$type[typeid]]" value="".dhtmlspecialchars($type['name']).""></td>\n".
- "<td class="altbg1"><input type="text" size="2" name="displayordernew[$type[typeid]]" value="$type[displayorder]"></td>\n".
- "<td class="altbg2"><input type="text" size="30" name="descriptionnew[$type[typeid]]" value="$type[description]"></td>\n".
- "<td class="altbg1">".(is_array($forumsarray[$type['typeid']]) ? implode(', ', $forumsarray[$type['typeid']])."<input type="hidden" name="fids[$type[typeid]]" value="".implode(', ', $fidsarray[$type['typeid']])."">" : '')."</td></tr>\n";
复制代码
改为:
- $threadtypes .= "<tr align="center"><td class="altbg1"><input class="checkbox" type="checkbox" name="delete[]" value="$type[typeid]"></td>\n".
- "<td class="altbg2"><input type="text" size="15" name="namenew[$type[typeid]]" value="".dhtmlspecialchars($type['name']).""></td>\n".
- "<td class="altbg1"><input type="text" size="6" name="displayordernew[$type[typeid]]" value="$type[displayorder]"></td>\n".
- "<td class="altbg2"><input type="text" size="15" name="descriptionnew[$type[typeid]]" value="$type[description]"></td>\n".
- "<td bgcolor="".ALTBG1.""><select style="width: 120px" onChange="admin_goto(this)"><option value="">== 进入版区 ==</option>".(is_array($forumsarrayforum[$type['typeid']]) ? implode('', $forumsarrayforum[$type['typeid']]) : '')."</select></td>\n".
- "<td bgcolor="".ALTBG1.""><select style="width: 120px" onchange="window.location=(''+this.options[this.selectedIndex].value)"><option value="">== 编辑版区 ==</option>".(is_array($forumsarrayedit[$type['typeid']]) ? implode('', $forumsarrayedit[$type['typeid']]) : '')."</select></td>\n";
复制代码
再找:
- <form method="post" action="admincp.php?action=threadtypes">
- <input type="hidden" name="formhash" value="<?=FORMHASH?>">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
- <tr class="header"><td colspan="5"><?=$lang['forums_threadtypes']?></td></tr>
- <tr align="center" class="category"><td><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td><td><?=$lang['forums_threadtypes']?></td><td><?=$lang['display_order']?></td><td><?=$lang['description']?></td><td><?=$lang['forums_threadtypes_forums']?></td></tr>
- <?=$threadtypes?>
- <tr align="center" class="altbg1"><td><?=$lang['add_new']?></td><td><input type='text' name="newname" size="15"></td><td><input type="text" name="newdisplayorder" size="2" value="0"></td><td><input type="text" name="newdescription" size="30" value=""></td><td> </td></tr>
- </table><br>
- <center><input class="button" type="submit" name="typesubmit" value="<?=$lang['submit']?>"></center>
- </form>
复制代码
改为:
- <script language="JavaScript">
- function admin_goto(selObj){
- window.open(selObj.options[selObj.selectedIndex].value);
- }
- </script>
- <form method="post" action="admincp.php?action=threadtypes">
- <input type="hidden" name="formhash" value="<?=FORMHASH?>">
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
- <tr class="header"><td colspan="6"><?=$lang['forums_threadtypes']?></td></tr>
- <tr align="center" class="category"><td><input class="checkbox" type="checkbox" name="chkall" class="category" onclick="checkall(this.form)"><?=$lang['del']?></td>
- <td><?=$lang['forums_threadtypes']?></td>
- <td><?=$lang['display_order']?></td>
- <td>显示颜色</td>
- <td><?=$lang['forums_threadtypes_forums']?></td>
- <td><?=$lang['forums_threadtypes_forums']?></td></tr>
- <?=$threadtypes?>
- <tr align="center" class="altbg1"><td><?=$lang['add_new']?></td><td><input type='text' name="newname" size="15"></td>
- <td><input type="text" name="newdisplayorder" size="6" value="0"></td>
- <td><input type="text" name="newdescription" size="15" value=""></td><td> </td><td> </td></tr>
- </table><br>
- <center><input class="button" type="submit" name="typesubmit" value="<?=$lang['submit']?>"></center>
- </form>
复制代码
再找:
- 'prefix' => (bool)$forum['threadtypes']['prefix'],
- 'types' => $forum['threadtypes']['types'],
复制代码
改为:
- 'prefix' => (bool)$forum['threadtypes']['prefix'],
- 'types' => $forum['threadtypes']['types'],
- 'description' => $threadtypesnew['description'],
复制代码
====================================================================
~ 完 ~
====================================================================
[ 本帖最后由 5025488.net 于 2006-9-18 22:44 编辑 ] |