|
  
- 帖子
- 1861
- 积分
- 7473
- 威望
- 476
- 金币
- 683 个
- 体力
- 1775
- 注册时间
- 2004-5-21
|

Discuz!上下主题细节优化
演示:http://www.phpq.net/club/thread-4-1-1.html
您是否已经厌倦了主题贴中这样的显示方式?
其实搜索引擎也厌倦了这些内容,大家可以看看下自己的访问日志中,有多少搜索引擎还在GET redirect.php这个页面的!
现在只要2步将您的论坛修改成为第一步:
在论坛根目录的viewthread.php中(大概在25行左右)
查找- $query = $db->query("SELECT * FROM {$tablepre}threads t WHERE tid='$tid' AND displayorder>='0'");
- if(!$thread = $db->fetch_array($query)) {
复制代码 替换为- $lastthread = $thread = $nextthread = array();
- $lasttid = intval($tid - 1);
- $nexttid = intval($tid + 1);
- $query = $db->query("SELECT * FROM {$tablepre}threads t WHERE tid IN ('$lasttid', '$tid', '$nexttid') AND displayorder>='0'");
- while($threadt = $db->fetch_array($query)) {
- $lastthread = $threadt['tid'] == $lasttid ? $threadt : $lastthread;
- $thread = $threadt['tid'] == $tid ? $threadt : $thread;
- $nextthread = $threadt['tid'] == $nexttid ? $threadt : $nextthread;
- }
- if(!$thread) {
复制代码 第二步:
在templates/default/viewthread.htm中(大概34行 和350行都有)
查找- <div class="threadflow"><a href="redirect.php?fid=$fid&tid=$tid&goto=nextoldset"> ‹‹ {lang last_thread}</a> | <a href="redirect.php?fid=$fid&tid=$tid&goto=nextnewset">{lang next_thread} ››</a></div>
复制代码 替换为- <div class="threadflow"><!--{if $lastthread[tid]}--> ‹‹ <a href="viewthread.php?tid=$lasttid">$lastthread['subject']</a><!--{/if}--> <!--{if $lastthread[tid] && $nextthread[tid]}--> | <!--{/if}--> <!--{if $nextthread[tid]}--><a href="viewthread.php?tid=$nexttid">$nextthread['subject']</a> ››<!--{/if}--></div>
复制代码 顺便AD下Discuz!专业QQ群:45918770 这里不定期有一些专有插件群里高手众多。不欢迎潜水者和总问简单问题而不成长者,定期清理! [ 本帖最后由 小水水 于 2007-10-30 14:05 编辑 ]
[ 本帖最后由 习明 于 2007-11-8 21:37 编辑 ] |
-
2
评分次数
-
|