Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

鼠标移动到主题显示最后回复内容 for dz5.x、6.0[2007-11-27更新]

[复制链接]
e_zailai 发表于 2007-5-2 09:47:31 | 显示全部楼层 |阅读模式
鼠标移动到主题显示最后回复内容 for dz5.x、dz6.0[更新适合 foxfire]

请大家根据自己的情况更改

名称:鼠标指向主题表格时显示最后回复等内容
功能:与权限挂钩,扩大鼠标反应区域至表格
修改:forumdisplay.php、forumdisplay.htm
演示:http://www.rosesky.name/bbs/(5.0)
      5.5、6.0演示效果与5.0一样!!!!

请大家多多支持,送个IP!!!

说明一点:下面没有标明5.0、5.5与6.0的三个版本都要修改


1.修改forumdisplay.php

5.0查找(此步查找不到请按5.5的方法)
  1. $dotadd1 = $dotadd2 = '';
  2. if($dotfolders && $discuz_uid) {
  3.         $dotadd1 = 'DISTINCT p.authorid AS dotauthor, ';
  4.         $dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND p.authorid='$discuz_uid')";
  5. }
复制代码
改为:
  1. //e_zailai----鼠标指向主题表格时显示最后回复等内容--------开始
  2. $dotadd1 = $dotadd2 = '';
  3. if($dotfolders && $discuz_uid) {
  4.     $dotadd1 = "DISTINCT p.authorid AS dotauthor, p.subject AS re_subject, p.message, ";
  5.     $dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND p.authorid='$discuz_uid')";
  6. }else {
  7.     $dotadd1 = "p.subject AS re_subject, p.message, ";
  8.     $dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND t.lastpost=p.dateline)";
  9. }
  10. //e_zailai----鼠标指向主题表格时显示最后回复等内容--------结束
复制代码
5.5 与 6.0查找:
  1. if($whosonlinestatus == 2 || $whosonlinestatus == 3) {
复制代码
上面添加:
  1. //e_zailai----鼠标指向主题表格时显示最后回复等内容--------开始
  2. $dotadd1 = $dotadd2 = '';
  3. if($dotfolders && $discuz_uid) {
  4.     $dotadd1 = "DISTINCT p.authorid AS dotauthor, p.subject AS re_subject, p.message, ";
  5.     $dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND p.authorid='$discuz_uid')";
  6. }else {
  7.     $dotadd1 = "p.subject AS re_subject, p.message, ";
  8.     $dotadd2 = "LEFT JOIN {$tablepre}posts p ON (t.tid=p.tid AND t.lastpost=p.dateline)";
  9. }
  10. //e_zailai----鼠标指向主题表格时显示最后回复等内容--------结束
复制代码
查找:
  1. $thread['lastpost'] = gmdate("$dateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600);
复制代码
添加:
  1. //e_zailai----鼠标指向主题表格时显示最后回复等内容--------开始
  2. if($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) {
  3.         $thread['message'] = "谢谢您的访问!由于权限不够,您仅可浏览本版主题标题。";
  4.     } elseif($thread['creditsrequire'] && $thread['creditsrequire'] > $credit && !$ismoderator) {
  5.         include language('messages');
  6.         eval("\$show_message = "".$language[thread_nopermission]."";");
  7.         $thread['message'] =  $show_message;
  8.     } else {
  9.         $thread['message']  = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "**** 回复后才可查看信息 *****", $thread['message'] );
  10.         $thread['message']  = preg_replace("/\[sell=?\d*\](.+?)\[\/sell\]/is", "**** 付費信息,已經隱藏 *****", $thread['message'] );
  11.         $thread['message']  = preg_replace("/\[php](.+?)\[\/php\]/is", "**** 内容为PHP代码 *****", $thread['message'] );
  12.         $thread['message']  = preg_replace("/\[code](.+?)\[\/code\]/is", "**** 内容为普通代码 *****", $thread['message'] );
  13.         $thread['message']  = preg_replace("/\[quote](.+?)\[\/quote\]/is", "**** 内容为引用信息 *****", $thread['message'] );
  14.         $thread['message']  = preg_replace("/\[url=?(.+?)\](.+?)\[\/url\]/is", "**** 此处为超级链接 *****", $thread['message'] );
  15.         $thread['message']  = preg_replace("/\[img](.+?)\[\/img\]/is", "**** 此处为图片链接 *****", $thread['message'] );
  16.         $thread['message'] = str_replace('"', '"', $thread['message']);
  17.         $thread['message'] = str_replace('<', '&lt;', $thread['message']);
  18.         $thread['message'] = str_replace('>', '&gt;', $thread['message']);
  19.         $thread['message'] = str_replace("\r\n", " ◇ ", $thread['message']);    //去掉回车,紧凑显示
  20.         $thread['message'] = cutstr($thread['message'],60);        //内容截断
  21.         }
  22.     if($thread[replies]) {
  23.         $thread['shortmsg'] = '<b>主题:'.$thread[subject].'</b>
  24. <b>回复:</b>'.$thread[re_subject].'
  25. <font color=red>'.$thread[message].'</font>'.'
  26. <font class=numtxt>最后发表:'.$thread[lastposter].'
  27. 主题作者:'.$thread[author].'  发表时间:'.$thread[dateline].'</font>';
  28.     } else {
  29.         $thread['shortmsg'] = '<b>主题:'.$thread[subject].'</b>
  30. <font color=red>'.$thread[message].'</font>'.'
  31. 主题作者:'.$thread[author].'  发表时间:'.$thread[dateline].'</font>';
  32.     }
  33. //e_zailai----鼠标指向主题表格时显示最后回复等内容--------结束
复制代码
[如果您安装过全论坛置顶HACK直接进行第二步]

5.x与6.0都查找
  1. $query = $db->query("SELECT t.* FROM {$tablepre}threads t
复制代码
修改为
  1. /*$query = $db->query("SELECT t.* FROM {$tablepre}threads t*/
  2.         $query = $db->query("SELECT $dotadd1 t.* FROM {$tablepre}threads t $dotadd2
复制代码
2.修改forumdisplay.htm

5.x查找:
  1. <a href="viewthread.php?tid=$thread[tid]&extra=$extra"
复制代码
6.0查找:
  1. <a href="viewthread.php?tid=$thread[tid]&extra=$extra"
复制代码
添加:
  1. title="$thread[shortmsg]"
复制代码
3.修改common.js

5.0找到[更新]
  1. document.write("<style type='text/css'id='defaultPopStyle'>");
  2. document.write(".cPopText { font-family: Tahoma, Verdana; background-color: #FFFFCC; border: 1px #000000 solid; font-size: 12px; padding-right: 4px; padding-left: 4px; line-height: 18px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80)}");

  3. document.write("</style>");
  4. document.write("<div id='popLayer' style='position:absolute;z-index:1000' class='cPopText'></div>");

  5. function showPopupText(event) {
  6.         if(event.srcElement) o = event.srcElement; else o = event.target;
  7.         if(!o) {
  8.                 return;
  9.         }
  10.         MouseX = event.clientX;
  11.         MouseY = event.clientY;
  12.         if(o.alt != null && o.alt != '') {
  13.                 o.pop = o.alt;
  14.                 o.alt = '';
  15.         }
  16.         if(o.title != null && o.title != '') {
  17.                 o.pop = o.title;
  18.                 o.title = '';
  19.         }
  20.         if(o.pop != sPop) {
  21.                 sPop = o.pop;
  22.                 if(sPop == null || sPop == '') {
  23.                         $('popLayer').style.visibility = "hidden";
  24.                 } else {
  25.                         popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
  26.                         $('popLayer').style.visibility = "visible";
  27.                         showIt();
  28.                 }
  29.         }
  30. }

  31. function showIt() {
  32.         $('popLayer').className = popStyle;
  33.         $('popLayer').innerHTML = sPop.replace(/<(.*)>/g,"&lt;$1&gt;").replace(/\n/g,"
  34. ");
  35.         var popWidth = $('popLayer').clientWidth;
  36.         var popHeight = $('popLayer').clientHeight;
  37.         var popLeftAdjust = MouseX + 12 + popWidth > document.body.clientWidth ? -popWidth - 24 : 0;
  38.         var popTopAdjust = MouseY + 12 + popHeight > document.body.clientHeight ? -popHeight - 24 : 0;
  39.         $('popLayer').style.left = (MouseX + 12 + document.body.scrollLeft + popLeftAdjust) + 'px';
  40.         $('popLayer').style.top = (MouseY + 12 + document.body.scrollTop + popTopAdjust) + 'px';
  41. }
复制代码
用下面代码替换
  1. document.write("<style type='text/css'>");
  2. document.write(".cPopText { font-family: Tahoma, Verdana; background-color: #FFFFFF; border: 1px #666666 dotted; font-size: 12px; padding-right: 4px; padding-left: 4px; line-height: 18px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80); opacity: 0.8;}");

  3. document.write("</style>");
  4. document.write("<div id='popLayer' style='position:absolute;z-index:1000' class='cPopText'></div>")

  5. function showPopupText(event) {
  6. if(event.srcElement) o = event.srcElement; else o = event.target;
  7. if(!o) {
  8. return;
  9. }
  10. MouseX = event.clientX;
  11. MouseY = event.clientY;
  12. if(o.alt != null && o.alt != '') {
  13. o.pop = o.alt;
  14. o.alt = '';
  15. }
  16. if(o.title != null && o.title != '') {
  17. o.pop = o.title;
  18. o.title = '';
  19. }
  20. if(o.pop != sPop) {
  21. sPop = o.pop;
  22. if(sPop == null || sPop == '') {
  23. $('popLayer').style.visibility = "hidden";
  24. } else {
  25. popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
  26. $('popLayer').style.visibility = "visible";
  27. showIt();
  28. }
  29. }
  30. }

  31. function showIt() {
  32. $('popLayer').className = popStyle;
  33. $('popLayer').innerHTML = sPop.replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"
  34. ");

  35. var bodySL, bodyST;
  36. if(window.pageXOffset){
  37. bodySL=window.pageXOffset;
  38. }else if(document.documentElement&&document.documentElement.scrollLeft){
  39. bodySL=document.documentElement.scrollLeft;
  40. }else if(document.body){
  41. bodySL=document.body.scrollLeft; //author: meizz
  42. }

  43. if(window.pageYOffset){
  44. bodyST=window.pageYOffset;
  45. }else if(document.documentElement&&document.documentElement.scrollTop){
  46. bodyST=document.documentElement.scrollTop;
  47. }else if(document.body){
  48. bodyST=document.body.scrollTop;
  49. }

  50. var bodyCW, bodyCH;
  51. if(window.innerWidth){
  52. bodyCW=window.innerWidth;
  53. }else if(document.documentElement&&document.documentElement.clientWidth){
  54. bodyCW=document.documentElement.clientWidth;
  55. }else if(document.body){
  56. bodyCW=document.body.clientWidth; //author: meizz
  57. }

  58. if(window.innerHeight){
  59. bodyCH=window.innerHeight;
  60. }else if(document.documentElement&&document.documentElement.clientHeight){
  61. bodyCH=document.documentElement.clientHeight;
  62. }else if(document.body){
  63. bodyCH=document.body.clientHeight;
  64. }

  65. if($('popLayer').clientWidth>300){
  66. var popWidth = 300;
  67. }else{
  68. var popWidth = $('popLayer').clientWidth;
  69. }

  70. var popWidth = $('popLayer').clientWidth;
  71. var popHeight = $('popLayer').clientHeight;
  72. var popLeftAdjust = MouseX + 12 + popWidth > bodyCW ? -popWidth - 24 : 0;
  73. var popTopAdjust = MouseY + 12 + popHeight > bodyCH ? -popHeight - 24 : 0;
  74. $('popLayer').style.left = (MouseX + 12 + bodySL + popLeftAdjust) + 'px';
  75. $('popLayer').style.top = (MouseY + 12 + bodyST + popTopAdjust) + 'px';
  76. }

  77. if(!document.onmouseover) {
  78. document.onmouseover = function(e) {
  79. var event = e ? e : window.event;
  80. showPopupText(event);
  81. };
  82. }
复制代码
5.5、6.0在最底加入(5.0如果没有也需加上)[修正 for foxfire]
  1. document.write("<style type='text/css'>");
  2. document.write(".cPopText { font-family: Tahoma, Verdana; background-color:  #DDEEFF; border: 1px #8899AA dashed; font-size: 12px; padding-right: 4px; padding-left: 4px; line-height: 18px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80); opacity: 0.8;}");

  3. document.write("</style>");
  4. document.write("<div id='popLayer' style='position:absolute;z-index:1000' class='cPopText'></div>")

  5. function showPopupText(event) {
  6. if(event.srcElement) o = event.srcElement; else o = event.target;
  7. if(!o) {
  8. return;
  9. }
  10. MouseX = event.clientX;
  11. MouseY = event.clientY;
  12. if(o.alt != null && o.alt != '') {
  13. o.pop = o.alt;
  14. o.alt = '';
  15. }
  16. if(o.title != null && o.title != '') {
  17. o.pop = o.title;
  18. o.title = '';
  19. }
  20. if(o.pop != sPop) {
  21. sPop = o.pop;
  22. if(sPop == null || sPop == '') {
  23. $('popLayer').style.visibility = "hidden";
  24. } else {
  25. popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
  26. $('popLayer').style.visibility = "visible";
  27. showIt();
  28. }
  29. }
  30. }

  31. function showIt() {
  32. $('popLayer').className = popStyle;
  33. $('popLayer').innerHTML = sPop.replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"
  34. ");

  35. var bodySL, bodyST;
  36. if(window.pageXOffset){
  37. bodySL=window.pageXOffset;
  38. }else if(document.documentElement&&document.documentElement.scrollLeft){
  39. bodySL=document.documentElement.scrollLeft;
  40. }else if(document.body){
  41. bodySL=document.body.scrollLeft; //author: meizz
  42. }

  43. if(window.pageYOffset){
  44. bodyST=window.pageYOffset;
  45. }else if(document.documentElement&&document.documentElement.scrollTop){
  46. bodyST=document.documentElement.scrollTop;
  47. }else if(document.body){
  48. bodyST=document.body.scrollTop;
  49. }

  50. var bodyCW, bodyCH;
  51. if(window.innerWidth){
  52. bodyCW=window.innerWidth;
  53. }else if(document.documentElement&&document.documentElement.clientWidth){
  54. bodyCW=document.documentElement.clientWidth;
  55. }else if(document.body){
  56. bodyCW=document.body.clientWidth; //author: meizz
  57. }

  58. if(window.innerHeight){
  59. bodyCH=window.innerHeight;
  60. }else if(document.documentElement&&document.documentElement.clientHeight){
  61. bodyCH=document.documentElement.clientHeight;
  62. }else if(document.body){
  63. bodyCH=document.body.clientHeight;
  64. }

  65. if($('popLayer').clientWidth>300){
  66. var popWidth = 300;
  67. }else{
  68. var popWidth = $('popLayer').clientWidth;
  69. }

  70. var popWidth = $('popLayer').clientWidth;
  71. var popHeight = $('popLayer').clientHeight;
  72. var popLeftAdjust = MouseX + 12 + popWidth > bodyCW ? -popWidth - 24 : 0;
  73. var popTopAdjust = MouseY + 12 + popHeight > bodyCH ? -popHeight - 24 : 0;
  74. $('popLayer').style.left = (MouseX + 12 + bodySL + popLeftAdjust) + 'px';
  75. $('popLayer').style.top = (MouseY + 12 + bodyST + popTopAdjust) + 'px';
  76. }

  77. if(!document.onmouseover) {
  78. document.onmouseover = function(e) {
  79. var event = e ? e : window.event;
  80. showPopupText(event);
  81. };
  82. }
复制代码
以下内容看情况再修改(扩大鼠标反应区域至表格)
1、修改forumdisplay.htm

5.0查找:
  1. <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'"
复制代码
5.5查找:
  1. <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" class="row" onMouseOver="this.style.backgroundColor='{ALTBG1}'" onMouseOut="this.style.backgroundColor='{ALTBG2}'"
复制代码
6.0查找:
  1. <table summary="forum_$fid" id="forum_$fid" cellspacing="0" cellpadding="0"
复制代码
添加:
  1.   title="$thread[shortmsg]"
复制代码

[ 本帖最后由 e_zailai 于 2007-11-27 22:07 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x

评分

1

查看全部评分

xuewuyaya 发表于 2007-5-2 09:52:48 | 显示全部楼层
5.5可以用吗?
回复

使用道具 举报

 楼主| e_zailai 发表于 2007-5-2 10:06:00 | 显示全部楼层

解决正确的主题列表显示详细评分For Dz 6.0”这个插件的冲突

如果有安装 “正确的主题列表显示详细评分For Dz 6.0”这个插件请按以下方法修改
https://discuz.dismall.com/thread-764630-1-3.html

插件名称:主题列表显示详细评分For Dz 6.0
适用版本:Discuz 6.0
修改档案: forumdisplay.php
修改模版: forumdisplay.htm

一、修改 forumdisplay.php

查找:

$querysticky = '';
$query = $db->query("SELECT t.* FROM {$tablepre}threads t
  WHERE t.fid='$fid' $filteradd AND $displayorderadd
  ORDER BY t.displayorder DESC, t.$orderby $ascdesc
  LIMIT ".($filterbool ? $start_limit : $start_limit - $stickycount).", $tpp");
} else {
$querysticky = $db->query("SELECT t.* FROM {$tablepre}threads t
  WHERE t.tid IN ($stickytids) AND t.displayorder IN (2, 3)
  ORDER BY displayorder DESC, $orderby $ascdesc
  LIMIT $start_limit, ".($stickycount - $start_limit < $tpp ? $stickycount - $start_limit : $tpp));
if($tpp - $stickycount + $start_limit > 0) {
  $query = $db->query("SELECT t.* FROM {$tablepre}threads t
   WHERE t.fid='$fid' $filteradd AND $displayorderadd
   ORDER BY displayorder DESC, $orderby $ascdesc
   LIMIT ".($tpp - $stickycount + $start_limit));
} else {
  $query = '';
替换为:

$querysticky = '';
        $query = $db->query("SELECT t.*, p.rate, p.pid FROM {$tablepre}threads t
                LEFT JOIN {$tablepre}posts p USING(tid, dateline)
                WHERE t.fid='$fid' $filteradd AND $displayorderadd
                ORDER BY t.displayorder DESC, t.$orderby $ascdesc
                LIMIT ".($filterbool ? $start_limit : $start_limit - $stickycount).", $tpp");

} else {

        $querysticky = $db->query("SELECT t.*, p.rate,p.pid FROM {$tablepre}threads t
                LEFT JOIN {$tablepre}posts p USING(tid, dateline)
                WHERE t.tid IN ($stickytids) AND t.displayorder IN (2, 3)
                ORDER BY displayorder DESC, $orderby $ascdesc
                LIMIT $start_limit, ".($stickycount - $start_limit < $tpp ? $stickycount - $start_limit : $tpp));

        if($tpp - $stickycount + $start_limit > 0) {
                $query = $db->query("SELECT t.*, p.rate,p.pid FROM {$tablepre}threads t
                      LEFT JOIN {$tablepre}posts p USING(tid, dateline)
                        WHERE t.fid='$fid' $filteradd AND $displayorderadd
                        ORDER BY displayorder DESC, $orderby $ascdesc
                        LIMIT ".($tpp - $stickycount + $start_limit));
        } else {
                $query = '';



5.x与6.0都查找(此步骤与一楼所提到的修改不一样)
  1. $query = $db->query("SELECT t.* FROM {$tablepre}threads t
复制代码
修改为
  1. /*$query = $db->query("SELECT t.* FROM {$tablepre}threads t*/
  2.         $query = $db->query("SELECT $dotadd1 t.*, p.rate,p.pid FROM {$tablepre}threads t $dotadd2
  3.                  LEFT JOIN {$tablepre}posts p USING(tid, dateline)
复制代码
“正确的主题列表显示详细评分For Dz 6.0”这个插件其他步骤按此帖修改https://discuz.dismall.com/thread-764630-1-3.html

[ 本帖最后由 e_zailai 于 2007-11-27 22:38 编辑 ]
回复

使用道具 举报

xuewuyaya 发表于 2007-5-2 10:16:59 | 显示全部楼层
晕,第一个就找不到相关的代码了啊.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

xuewuyaya 发表于 2007-5-2 10:18:56 | 显示全部楼层
common.js
里也没有相应的代码,麻烦帮忙改改哦.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

 楼主| e_zailai 发表于 2007-5-2 10:50:39 | 显示全部楼层

回复 #5 xuewuyaya 的帖子

已更新5.5的修改方法!!!
回复

使用道具 举报

reitg 发表于 2007-5-2 10:58:22 | 显示全部楼层
楼主,麻烦你把5.5和5.0都相对应分开好不,这样我都不知道怎么改了 眼睛都花了
回复

使用道具 举报

 楼主| e_zailai 发表于 2007-5-2 11:10:59 | 显示全部楼层

回复 #7 reitg 的帖子

已采纳你的建议了,说明一点:上面没有标明的5.0和5.5都要修改
回复

使用道具 举报

tyiweb 发表于 2007-5-2 11:47:39 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

heanyu 发表于 2007-5-2 12:13:20 | 显示全部楼层

查找时出现三次

查找时出现三次:    $query = $db->query("SELECT t.* FROM {$tablepre}threads t
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-12-22 20:09 , Processed in 0.036409 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表