说明:
1、后台管理设置横板显示的板块
可以两格或四个
2、无变形问题,可以使用窄版
3、版主显示支持下拉菜单
4、帖子标题显示全部及发表时间
5、显示版面说明
6、显示版面图片
需要修改的文件:
升级数据库
admin/settings.inc.php
templates/default/admincp.lang.php
templates/default/templates.lang.php
templates/default/css.htm
修改成功了2006.2.26,测试无误!
修改方法
1、升级数据库 (请在后台 数据升级中贴上以下代码,然后提交!)
[注:cdb_ 为您的论坛数据库表头,默认为 cdb_ 如果您有修改,请确认后修改 cdb_ 为您的表头,再进行执行!]
- INSERT INTO `cdb_settings` VALUES ('index_fcount', '2');
- INSERT INTO `cdb_settings` VALUES ('index_fwidth', '50%');
- INSERT INTO `cdb_settings` VALUES ('index_intabulae', '1,2,3');
- INSERT INTO `cdb_settings` VALUES ('index_fcount1', '4');
- INSERT INTO `cdb_settings` VALUES ('index_fwidth1', '25%');
- INSERT INTO `cdb_settings` VALUES ('index_intabulae1', '100');
复制代码
反安装SQL语句
- DELETE FROM `cdb_settings` WHERE variable = 'index_fcount';
- DELETE FROM `cdb_settings` WHERE variable = 'index_fwidth';
- DELETE FROM `cdb_settings` WHERE variable = 'index_intabulae';
- DELETE FROM `cdb_settings` WHERE variable = 'index_fcount1';
- DELETE FROM `cdb_settings` WHERE variable = 'index_fwidth1';
- DELETE FROM `cdb_settings` WHERE variable = 'index_intabulae1';
复制代码
2,修改 settings.inc.php,请打开 admin/settings.inc.php 文件,进行以下修改!
找到:
- showsetting('settings_modreasons', 'settingsnew[modreasons]', $settings['modreasons'], 'textarea');
复制代码
下面一行添加:
- // 论坛横板显示方式 by http://www.18i8.com
- showsetting('settings_index_fcount', 'settingsnew[index_fcount]', $settings['index_fcount'], 'text');
- showsetting('settings_index_fwidth', 'settingsnew[index_fwidth]', $settings['index_fwidth'], 'text');
- showsetting('settings_index_intabulae', 'settingsnew[index_intabulae]', $settings['index_intabulae'], 'text');
- showsetting('settings_index_fcount1', 'settingsnew[index_fcount1]', $settings['index_fcount1'], 'text');
- showsetting('settings_index_fwidth1', 'settingsnew[index_fwidth1]', $settings['index_fwidth1'], 'text');
- showsetting('settings_index_intabulae1', 'settingsnew[index_intabulae1]', $settings['index_intabulae1'], 'text');
- // 论坛横板显示方式 by http://www.18i8.com
复制代码
再找到:
- 'jscachelife', 'waptpp', 'wapppp', 'wapmps'
复制代码
后面添加:
- ,'index_fcount','index_fwidth','index_fcount1','index_fwidth1'
复制代码
3,修改 admincp.lang.php 语言包,请打开 templates/default/admincp.lang.php 文件,进行以下修改!
找到:
上面一行添加:
- 'settings_index_fcount' => '首页横板样式1显示数量:',
- 'settings_index_fcount_comment' => '需要横板显示多少个,如:2,4',
- 'settings_index_fwidth' => '首页横板样式1显示宽度:',
- 'settings_index_fwidth_comment' => '每个板块显示的宽度,如:2个就用50%,4个就用25%',
- 'settings_index_intabulae' => '使用横板样式1的分类ID:',
- 'settings_index_intabulae_comment' => '设置分类ID号码即可,多个用逗号隔开',
- 'settings_index_fcount1' => '首页横板样式2显示数量:',
- 'settings_index_fcount1_comment' => '需要横板显示多少个,如:2,4',
- 'settings_index_fwidth1' => '首页横板样式2显示宽度:',
- 'settings_index_fwidth1_comment' => '每个板块显示的宽度,如:2个就用50%,4个就用25%',
- 'settings_index_intabulae1' => '使用横板样式2的分类ID:',
- 'settings_index_intabulae1_comment' => '设置分类ID号码即可,多个用逗号隔开',
复制代码
4,修改 css.htm 文件,如果您想在默认风格中使用,请修改 templates/default/css.htm 文件,否则请修改对应风格模板之 css.htm 文件。
找到:
- a { text-decoration: none; color: {LINK} }
复制代码
上面一行添加:
5,index.htm 的对照与修改
index.htm 找到:
- <!--{loop $forumlist $key $forum}-->
- <!--{if $forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'}-->
- <!--{if $key}--></tbody></table><br></div><!--{/if}-->
- <div class="maintable">
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="7" class="header"><table cellspacing="0" cellpadding="0" width="100%">
- <tr class="smalltxt"><td class="bold"><a href="index.php?gid=$forum[fid]">$forum[name]</a></td><td align="right">
- <!--{if $forum['moderators']}--><font color="{HEADERTEXT}">{lang forum_category_modedby}: $forum[moderators]</font> <!--{/if}-->
- <a href="###" onclick="toggle_collapse('category_$forum[fid]');"><img id="category_$forum[fid]_img" src="{IMGDIR}/$forum[collapseimg]" border="0"></a>
- </td></tr></table></td></tr>
- <tr class="category" align="center">
- <td width="5%"> </td>
- <td width="51%">{lang forum_name}</td>
- <td width="5%">{lang forum_threads}</td>
- <td width="5%">{lang forum_posts}</td>
- <td width="5%">{lang forum_todayposts}</td>
- <td width="13%">{lang forum_lastpost}</td>
- <td width="16%">{lang forum_moderators}</td>
- </tr><tbody id="category_$forum[fid]" style="$collapse['category_'.$forum[fid]]">
- <!--{elseif $forum['permission']}-->
- <tr>
- <td class="altbg1" align="center">$forum[folder]</td>
- <td class="altbg2" align="left" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'">
- $forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
- <br><span class="smalltxt">$forum[description]<!--{if isset($forum['subforums'])}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}--></span></td>
- <td class="altbg1" align="center">$forum[threads]</td>
- <td class="altbg2" align="center">$forum[posts]</td>
- <td class="altbg1" align="center">$forum[todayposts]</td>
- <!--{if $forum['permission'] == 1}-->
- <td class="altbg2" align="center"><span class="smalltxt"></span>{lang private_forum}</span></td>
- <!--{else}-->
- <!--{if is_array($forum['lastpost'])}-->
- <td class="altbg2"><table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tr><td align="right" class="smalltxt" title="{lang forum_lastpost_in}: $forum[lastpost][subject]" nowrap>
- $forum[lastpost][dateline]<br>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--></td>
- <td nowrap> <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/lastpost.gif" border="0"></a></td>
- </tr></table></td>
- <!--{else}-->
- <td class="altbg2" align="center"><span class="smalltxt">{lang never}</span></td>
- <!--{/if}-->
- <!--{/if}-->
- <td class="altbg1" align="center" style="word-break: keep-all"><span class="smalltxt">$forum[moderators]</span></td></tr>
- <!--{/if}-->
- <!--{/loop}-->
- <!--{if empty($gid) && ($_DCACHE['forumlinks'] || $whosonlinestatus || $bdaystatus == 1 || $bdaystatus == 3)}-->
- <!--{if empty($forumlist)}--><br><br><!--{else}--></table><br></div><div class="maintable"><!--{/if}-->
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <!--{/if}-->
复制代码
替换为:
- {eval $incompact = explode(',', $index_intabulae);}
- {eval $incompact1= explode(',', $index_intabulae1);}
- <!--{loop $forumlist $key $forum}-->
- <!--{if $forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'}-->
- <!--{if $key}-->
- <!--{if $fcount}-->
- <td colspan="$fcount"> </td></tr></tbody></table><br></div>
- <!--{else}-->
- <!--{if in_array($forum[fid], array_merge($incompact,$incompact1))}-->
- </tbody></table><br></div>
- <!--{else}-->
- </tr></tbody></table><br></div>
- <!--{/if}-->
- <!--{/if}-->
- <!--{else}-->
- <!--{/if}-->
- <!--{if in_array($forum[fid], $incompact)}-->
- <div class="maintable">
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="$index_fcount" class="header"><table cellspacing="0" cellpadding="0" width="100%">
- <tr class="smalltxt"><td class="bold"><a href="index.php?gid=$forum[fid]">$forum[name]</a></td><td align="right">
- <!--{if $forum['moderators']}--><font color="{HEADERTEXT}">{lang forum_category_modedby}: $forum[moderators]</font> <!--{/if}-->
- <a href="###" onclick="toggle_collapse('category_$forum[fid]');"><img id="category_$forum[fid]_img" src="{IMGDIR}/$forum[collapseimg]" border="0"></a></td></tr></table></td></tr>
- <tbody id="category_$forum[fid]" style="$collapse['category_'.$forum[fid]]">
- <tr class="altbg2">
- {eval $fcount = $index_fcount;}
- <!--{elseif in_array($forum[fid], $incompact1)}--><div class="maintable">
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="$index_fcount1" class="header"><table cellspacing="0" cellpadding="0" width="100%">
- <tr class="smalltxt"><td class="bold"><a href="index.php?gid=$forum[fid]">$forum[name]</a></td><td align="right">
- <!--{if $forum['moderators']}--><font color="{HEADERTEXT}">{lang forum_category_modedby}: $forum[moderators]</font> <!--{/if}-->
- <a href="###" onclick="toggle_collapse('category_$forum[fid]');"><img id="category_$forum[fid]_img" src="{IMGDIR}/$forum[collapseimg]" border="0"></a>
- </td></tr></table></td></tr>
- <tbody id="category_$forum[fid]" style="$collapse['category_'.$forum[fid]]">
- <tr class="altbg2">
- {eval $fcount = $index_fcount1;}
- <!--{else}--><div class="maintable">
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="7" class="header"><table cellspacing="0" cellpadding="0" width="100%">
- <tr class="smalltxt"><td class="bold"><a href="index.php?gid=$forum[fid]">$forum[name]</a></td><td align="right">
- <!--{if $forum['moderators']}--><font color="{HEADERTEXT}">{lang forum_category_modedby}: $forum[moderators]</font> <!--{/if}-->
- <a href="###" onclick="toggle_collapse('category_$forum[fid]');"><img id="category_$forum[fid]_img" src="{IMGDIR}/$forum[collapseimg]" border="0"></a>
- </td></tr></table></td></tr>
- <tr class="category" align="center">
- <td width="5%"> </td>
- <td width="51%">{lang forum_name}</td>
- <td width="5%">{lang forum_threads}</td>
- <td width="5%">{lang forum_posts}</td>
- <td width="5%">{lang forum_todayposts}</td>
- <td width="13%">{lang forum_lastpost}</td>
- <td width="16%">{lang forum_moderators}</td>
- </tr><tbody id="category_$forum[fid]" style="$collapse['category_'.$forum[fid]]">
- {eval $fcount = 0;}
- <!--{/if}-->
- <!--{elseif $forum['permission']}-->
- <!--{if in_array($forum[fup],$incompact)}-->
- {eval $fcount--;}
- <!--{if $fcount == -1}--></tr><tr class="altbg2">{eval $fcount = $index_fcount-1;}<!--{/if}-->
- <td width="$index_fwidth%" class="altbg2">
- <table cellpadding="0" cellspacing="3" border="0" width="100%">
- <tr>
- <td colspan="2">
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tr>
- <td width="80%"> $forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
- <br><span class="smalltxt">$forum[description]</span></td>
- <td width="20%" align="left" class=smalltxt><b>{lang forum_moderators}:$forum[moderators]</b><br>{lang forum_threads}: $forum[threads] {lang forum_posts}: $forum[posts]<br>{lang forum_todayposts}:$forum[todayposts]</td></tr></table>
- </td></tr>
- <tr>
- <td align="left" class=smalltxt><!--{if $forum['permission'] == 1}-->{lang
- private_forum}<!--{else}--><!--{if is_array($forum['lastpost'])}--><div style="overflow: hidden; text-overflow: ellipsis; width: 180px"> <nobr><b>{lang subject}</b>:<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost" title="{lang title}:$forum['lastpost'][subject]{LF}{lang time}:$forum['lastpost'][dateline]">$forum['lastpost'][subject]</a></nobr></div><!--{else}-->{lang never}<!--{/if}--><!--{/if}--></td></tr>
- </table></td>
- <!--{elseif in_array($forum[fup],$incompact1)}-->
- {eval $fcount--;}
- <!--{if $fcount == -1}--></tr><tr class="altbg2">{eval $fcount = $index_fcount1-1;}<!--{/if}-->
- <td width="$index_fwidth1%" class="altbg2" align="left" onMouseOver ="this.style.backgroundColor='{ALTBG1}'" onMouseOut ="this.style.backgroundColor='{ALTBG2}'">
- <table cellpadding="3" cellspacing="0" border="0" width="100%">
- <tr>
- <td colspan="1" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tr>
- <td> $forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
- </td>
- </tr></table>
- </td></tr>
- <tr>
- <td align="left" class=smalltxt>{lang forum_moderators}:$forum[moderators]<!--{if $forum['permission'] == 1}-->{lang private_forum}<!--{else}--><span class="smalltxt">$forum[description]</span><!--{if is_array($forum['lastpost'])}--><div style="overflow: hidden; text-overflow: ellipsis; width: 100px"> <nobr><b>{lang subject}</b>:<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost" title="{lang title}:$forum['lastpost'][subject]{LF}{lang time}:$forum['lastpost'][dateline]">$forum['lastpost'][subject]</a></nobr></div><!--{else}-->{lang never}<!--{/if}--><!--{/if}--><br>{lang forum_threads}: $forum[threads]
- {lang forum_posts}: $forum[posts]
- {lang forum_todayposts}:$forum[todayposts]
- </td></tr>
- </table>
- </td>
- <!--{else}-->
- <tr>
- <td class="altbg1" align="center">$forum[folder]</td>
- <td class="altbg2" align="left" onMouseOver="this.className='altbg1'" onMouseOut="this.className='altbg2'">
- $forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
- <br><span class="smalltxt">$forum[description]<!--{if isset($forum['subforums'])}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}--></span></td>
- <td class="altbg1" align="center">$forum[threads]</td>
- <td class="altbg2" align="center">$forum[posts]</td>
- <td class="altbg1" align="center">$forum[todayposts]</td>
- <!--{if $forum['permission'] == 1}-->
- <td class="altbg2" align="center"><span class="smalltxt"></span>{lang private_forum}</span></td>
- <!--{else}-->
- <!--{if is_array($forum['lastpost'])}-->
- <td class="altbg2"><table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tr><td align="right" class="smalltxt" title="{lang forum_lastpost_in}: $forum[lastpost][subject]" nowrap>
- $forum[lastpost][dateline]<br>{lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}--></td>
- <td nowrap> <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/lastpost.gif" border="0"></a></td>
- </tr></table></td>
- <!--{else}-->
- <td class="altbg2" align="center"><span class="smalltxt">{lang never}</span></td>
- <!--{/if}-->
- <!--{/if}-->
- <td class="altbg1" align="center" style="word-break: keep-all"><span class="smalltxt">$forum[moderators]</span></td></tr>
- <!--{/if}-->
- <!--{/if}-->
- <!--{/loop}-->
- <!--{if empty($gid) && ($_DCACHE['forumlinks'] || $whosonlinestatus || $bdaystatus == 1 || $bdaystatus == 3)}-->
- <!--{if empty($forumlist)}--><br><br><!--{else}--><!--{if $fcount}--><td colspan="$fcount"> </td><!--{/if}--></tr></tbody></table></div><div class="maintable"><!--{/if}--><br>
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <!--{/if}-->
复制代码
6,更新缓存,完成!
设置请到其它设置里面调整
下面是截图:
[ 本帖最后由 aicainiao 于 2006-3-26 19:02 编辑 ] |