将index.htm模版中的
- <!--{loop $forumlist $key $forum}-->
- <!--{if $forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'}-->
- <!--{if $key}--></tbody></table><br><!--{else}--><br><!--{/if}-->
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="6" 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="49%">{lang forum_name}</td>
- <td width="8%">{lang forum_threads}</td>
- <td width="8%">{lang forum_posts}</td>
- <td width="15%">{lang forum_lastpost}</td>
- <td width="15%">{lang forum_moderators}</td>
- </tr><tbody id="category_$forum[fid]" style="$collapse['category_'.$forum[fid]]">
- <!--{elseif $forum['permission']}-->
- <tr>
- <td bgcolor="{ALTBG1}" align="center">$forum[folder]</td>
- <td bgcolor="{ALTBG2}" align="left" onMouseOver ="this.style.backgroundColor='{ALTBG1}'" onMouseOut ="this.style.backgroundColor='{ALTBG2}'">
- $forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
- <br><span class="smalltxt">$forum[description]<!--{if $forum['subforums']}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}--></span></td>
- <td bgcolor="{ALTBG1}" align="center">$forum[threads]</td>
- <td bgcolor="{ALTBG2}" align="center">$forum[posts]</td>
- <!--{if $forum['permission'] == 1}-->
- <td bgcolor="{ALTBG1}" align="center" class="smalltxt">{lang private_forum}</td>
- <!--{else}-->
- <!--{if is_array($forum['lastpost'])}-->
- <td bgcolor="{ALTBG1}"><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 guest}<!--{/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 bgcolor="{ALTBG1}" align="center" class="smalltxt">{lang never}</td>
- <!--{/if}-->
- <!--{/if}-->
- <td bgcolor="{ALTBG2}" align="center" class="smalltxt" style="word-break: keep-all">$forum[moderators]</td></tr>
- <!--{/if}-->
- <!--{/loop}-->
- <!--{if empty($gid) && ($_DCACHE['forumlinks'] || $whosonlinestatus)}-->
- <!--{if empty($forumlist)}--><br><br><!--{else}--></table><br><!--{/if}-->
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <!--{/if}-->
复制代码
替换为
================================================================================
显示最后发表内容
修改 ./include/forum.func.php
找到:
- $forum['lastpost'] = $lastpost;
复制代码
在后面添加:
- $forum['lastpost'][subject]=cutstr($forum['lastpost'][subject], 20);
复制代码
$forum['lastpost'][subject], 20
这里的20指的是最后发表的标题的长度
将index.htm模版中的
- <!--{loop $forumlist $key $forum}-->
- <!--{if $forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'}-->
- <!--{if $key}--></tbody></table><br><!--{else}--><br><!--{/if}-->
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr><td colspan="6" 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="49%">{lang forum_name}</td>
- <td width="8%">{lang forum_threads}</td>
- <td width="8%">{lang forum_posts}</td>
- <td width="15%">{lang forum_lastpost}</td>
- <td width="15%">{lang forum_moderators}</td>
- </tr><tbody id="category_$forum[fid]" style="$collapse['category_'.$forum[fid]]">
- <!--{elseif $forum['permission']}-->
- <tr>
- <td bgcolor="{ALTBG1}" align="center">$forum[folder]</td>
- <td bgcolor="{ALTBG2}" align="left" onMouseOver ="this.style.backgroundColor='{ALTBG1}'" onMouseOut ="this.style.backgroundColor='{ALTBG2}'">
- $forum[icon]<a href="forumdisplay.php?fid=$forum[fid]"><span class="bold">$forum[name]</span></a>
- <br><span class="smalltxt">$forum[description]<!--{if $forum['subforums']}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}--></span></td>
- <td bgcolor="{ALTBG1}" align="center">$forum[threads]</td>
- <td bgcolor="{ALTBG2}" align="center">$forum[posts]</td>
- <!--{if $forum['permission'] == 1}-->
- <td bgcolor="{ALTBG1}" align="center" class="smalltxt">{lang private_forum}</td>
- <!--{else}-->
- <!--{if is_array($forum['lastpost'])}-->
- <td bgcolor="{ALTBG1}"><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 guest}<!--{/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 bgcolor="{ALTBG1}" align="center" class="smalltxt">{lang never}</td>
- <!--{/if}-->
- <!--{/if}-->
- <td bgcolor="{ALTBG2}" align="center" class="smalltxt" style="word-break: keep-all">$forum[moderators]</td></tr>
- <!--{/if}-->
- <!--{/loop}-->
- <!--{if empty($gid) && ($_DCACHE['forumlinks'] || $whosonlinestatus)}-->
- <!--{if empty($forumlist)}--><br><br><!--{else}--></table><br><!--{/if}-->
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <!--{/if}-->
复制代码
改为:
其中的:
- {eval $count=4;}
- {eval $wid='25%';}
- {eval $incompact=array(20);}
复制代码
参数分别为:
{eval $count=4;}横版(表格)个数
{eval $wid='25%';}每个横版(表格)的宽度
{eval $incompact=array(20);}要以标准方式(非紧凑方式)显示的版面id
20是指的是gid
[ 本帖最后由 九天 于 2006-1-4 11:05 编辑 ] |