原创 oytktk(靖飒)
先说明一下功能吧~
个人感觉对略懂些HTML的人都没什么用...不过可能会有一点点方便吧~
只要功能就是在后台编辑论坛名称的时候,增加论坛名称的颜色显示功能...
演示:http://www.huasa.org/bbs
大家可以看看图:
==========================
=·········安装方法·································=
==========================
升级数据库:
- ALTER TABLE `cdb_forums` ADD `color` varchar(10) DEFAULT '';
复制代码
1.admin/global.php
查找:
- function showforum($forum, $id, $type = '') {
- $dot = array(1 => "<li>", 2 => "<li type="circle">", 3 => "<li type="square">");
- $url = $type == "group" ? "./index.php?gid=$forum[fid]" : "./forumdisplay.php?fid=$forum[fid]";
- $editforum = "<a href="admincp.php?action=forumdetail&fid=$forum[fid]">[".$GLOBALS['lang']['edit'].']</a> ';
- $hide = !$forum['status'] ? ' ('.$GLOBALS['lang']['forums_hidden'].')' : NULL;
- echo $dot[$id]."<a href="$url" target="_blank"><b>$forum[name]</b><span class="smalltxt">$hide</a> - ".$GLOBALS['lang']['display_order'].": <input type="text" name="order[{$forum[fid]}]" value="$forum[displayorder]" size="1">".
- ($forum['type'] != 'group' ? ' '.$GLOBALS['lang']['forums_moderator'].": <input type="text" name="moderator[{$forum[fid]}]" value="$forum[moderator]" size="15"> - " : ' - ').
- "$editforum<a href="admincp.php?action=forumdelete&fid=$forum[fid]">".
- '['.$GLOBALS['lang']['delete'].']</a></span><br></li>';
- }
复制代码
替换成:
- function showforum($forum, $id, $type = '') {
- $dot = array(1 => "<li>", 2 => "<li type="circle">", 3 => "<li type="square">");
- $url = $type == "group" ? "./index.php?gid=$forum[fid]" : "./forumdisplay.php?fid=$forum[fid]";
- $editforum = "<a href="admincp.php?action=forumdetail&fid=$forum[fid]">[".$GLOBALS['lang']['edit'].']</a> ';
- $hide = !$forum['status'] ? ' ('.$GLOBALS['lang']['forums_hidden'].')' : NULL;
- echo $dot[$id]."<a href="$url" target="_blank"><b>$forum[name]</b><span class="smalltxt">$hide</a> - ".$GLOBALS['lang']['display_order'].": <input type="text" name="order[{$forum[fid]}]" value="$forum[displayorder]" size="1">".
- ($forum['type'] != 'group' ? ' '.$GLOBALS['lang']['forums_moderator'].": <input type="text" name="moderator[{$forum[fid]}]" value="$forum[moderator]" size="15"> 颜色: <input type="text" name="coloer[{$forum[fid]}]" value="$forum[color]" size="8" onchange="this.form.colorsee".$forum[fid].".style.backgroundColor=this.value;"><input type="button" id="colorsee".$forum[fid]."" value=" " style="background-color: $forum[color]" disabled> - " : ' - ').
- "$editforum<a href="admincp.php?action=forumdelete&fid=$forum[fid]">".
- '['.$GLOBALS['lang']['delete'].']</a></span><br></li>';
- }
复制代码
2.admin/forums.php
查找:
- SELECT fid, type, status, name, fup, displayorder, moderator
复制代码
后面加:
查找:
上面(注意是上面)加:
- if(is_array($coloer)) {
- foreach($coloer as $fid => $value) {
- $db->query("UPDATE $table_forums SET color='$coloer[$fid]' WHERE fid='$fid'");
- }
- }
复制代码
3.include/cache.php
查找:
- $cols = "fid, type, name, fup, viewperm
复制代码
后面加:
4.index.php
查找:
- SELECT fid, fup, type, icon, name,
复制代码
后面加:
有两处.都加吧~
查找:
- $forumname[$forum['fid']] = strip_tags($forum['name']);
复制代码
下面(一定要在下面)加:
- $forum['name']="<font color='".$forum['color']."'>".$forum['name']."</font>";
复制代码
子论坛修改方法
include/forum.php
查找:
在上面加:
- $forum['name'] = "<font color='".$forum['color']."'>".$forum['name']."</font>";
复制代码
forumdisplay.php
- "SELECT fid, fup, type, icon, name, description, moderator, threads,
复制代码
后面加:
[ 本帖最后由 oytktk 于 2007-8-24 08:46 编辑 ] |