插件作者的标准出来了!Manyou诚邀开发者加盟!
“互联网平台开发者”特刊 有奖征集开发者
立即免费下载 Discuz!6.1.0正式版
Discuz! 6.1.0 使用说明
Discuz!NT2.5正式版发布
开放源码下载
UCenter Home 1.2 正式版发布
官方站 | 帮助文档
基于ECShop的网店托管-卖否
PHP就业培训直通车 | LAMP培训大连
Discuz!收费服务内容及价格
《站长》杂志读者调查表
Discuz!/ECShop 专用官方虚拟主机
Insenz最新活动精美礼品大派送!
Comsenz 招聘信息
网店系统ECShop v2.6.0正式版火热发布
基于Discuz!的免费论坛空间5D6D
《站长》第七期:2008SNS进行时
返回列表 发新话题

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

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

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

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

5.0找到[更新]
document.write("<style type='text/css'id='defaultPopStyle'>");
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)}");

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

function showPopupText(event) {
        if(event.srcElement) o = event.srcElement; else o = event.target;
        if(!o) {
                return;
        }
        MouseX = event.clientX;
        MouseY = event.clientY;
        if(o.alt != null && o.alt != '') {
                o.pop = o.alt;
                o.alt = '';
        }
        if(o.title != null && o.title != '') {
                o.pop = o.title;
                o.title = '';
        }
        if(o.pop != sPop) {
                sPop = o.pop;
                if(sPop == null || sPop == '') {
                        $('popLayer').style.visibility = "hidden";
                } else {
                        popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
                        $('popLayer').style.visibility = "visible";
                        showIt();
                }
        }
}

function showIt() {
        $('popLayer').className = popStyle;
        $('popLayer').innerHTML = sPop.replace(/<(.*)>/g,"&lt;$1&gt;").replace(/\n/g,"
");
        var popWidth = $('popLayer').clientWidth;
        var popHeight = $('popLayer').clientHeight;
        var popLeftAdjust = MouseX + 12 + popWidth > document.body.clientWidth ? -popWidth - 24 : 0;
        var popTopAdjust = MouseY + 12 + popHeight > document.body.clientHeight ? -popHeight - 24 : 0;
        $('popLayer').style.left = (MouseX + 12 + document.body.scrollLeft + popLeftAdjust) + 'px';
        $('popLayer').style.top = (MouseY + 12 + document.body.scrollTop + popTopAdjust) + 'px';
}
复制代码
用下面代码替换
document.write("<style type='text/css'>");
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;}");

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

function showPopupText(event) {
if(event.srcElement) o = event.srcElement; else o = event.target;
if(!o) {
return;
}
MouseX = event.clientX;
MouseY = event.clientY;
if(o.alt != null && o.alt != '') {
o.pop = o.alt;
o.alt = '';
}
if(o.title != null && o.title != '') {
o.pop = o.title;
o.title = '';
}
if(o.pop != sPop) {
sPop = o.pop;
if(sPop == null || sPop == '') {
$('popLayer').style.visibility = "hidden";
} else {
popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
$('popLayer').style.visibility = "visible";
showIt();
}
}
}

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

var bodySL, bodyST;
if(window.pageXOffset){
bodySL=window.pageXOffset;
}else if(document.documentElement&&document.documentElement.scrollLeft){
bodySL=document.documentElement.scrollLeft;
}else if(document.body){
bodySL=document.body.scrollLeft; //author: meizz
}

if(window.pageYOffset){
bodyST=window.pageYOffset;
}else if(document.documentElement&&document.documentElement.scrollTop){
bodyST=document.documentElement.scrollTop;
}else if(document.body){
bodyST=document.body.scrollTop;
}

var bodyCW, bodyCH;
if(window.innerWidth){
bodyCW=window.innerWidth;
}else if(document.documentElement&&document.documentElement.clientWidth){
bodyCW=document.documentElement.clientWidth;
}else if(document.body){
bodyCW=document.body.clientWidth; //author: meizz
}

if(window.innerHeight){
bodyCH=window.innerHeight;
}else if(document.documentElement&&document.documentElement.clientHeight){
bodyCH=document.documentElement.clientHeight;
}else if(document.body){
bodyCH=document.body.clientHeight;
}

if($('popLayer').clientWidth>300){
var popWidth = 300;
}else{
var popWidth = $('popLayer').clientWidth;
}

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

if(!document.onmouseover) {
document.onmouseover = function(e) {
var event = e ? e : window.event;
showPopupText(event);
};
}
复制代码
5.5、6.0在最底加入(5.0如果没有也需加上)[修正 for foxfire]
document.write("<style type='text/css'>");
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;}");

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

function showPopupText(event) {
if(event.srcElement) o = event.srcElement; else o = event.target;
if(!o) {
return;
}
MouseX = event.clientX;
MouseY = event.clientY;
if(o.alt != null && o.alt != '') {
o.pop = o.alt;
o.alt = '';
}
if(o.title != null && o.title != '') {
o.pop = o.title;
o.title = '';
}
if(o.pop != sPop) {
sPop = o.pop;
if(sPop == null || sPop == '') {
$('popLayer').style.visibility = "hidden";
} else {
popStyle = o.dyclass != null ? o.dyclass : 'cPopText';
$('popLayer').style.visibility = "visible";
showIt();
}
}
}

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

var bodySL, bodyST;
if(window.pageXOffset){
bodySL=window.pageXOffset;
}else if(document.documentElement&&document.documentElement.scrollLeft){
bodySL=document.documentElement.scrollLeft;
}else if(document.body){
bodySL=document.body.scrollLeft; //author: meizz
}

if(window.pageYOffset){
bodyST=window.pageYOffset;
}else if(document.documentElement&&document.documentElement.scrollTop){
bodyST=document.documentElement.scrollTop;
}else if(document.body){
bodyST=document.body.scrollTop;
}

var bodyCW, bodyCH;
if(window.innerWidth){
bodyCW=window.innerWidth;
}else if(document.documentElement&&document.documentElement.clientWidth){
bodyCW=document.documentElement.clientWidth;
}else if(document.body){
bodyCW=document.body.clientWidth; //author: meizz
}

if(window.innerHeight){
bodyCH=window.innerHeight;
}else if(document.documentElement&&document.documentElement.clientHeight){
bodyCH=document.documentElement.clientHeight;
}else if(document.body){
bodyCH=document.body.clientHeight;
}

if($('popLayer').clientWidth>300){
var popWidth = 300;
}else{
var popWidth = $('popLayer').clientWidth;
}

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

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

5.0查找:
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" class="row" onMouseOver="this.className='row1'" onMouseOut="this.className='row'"复制代码
5.5查找:
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" class="row" onMouseOver="this.style.backgroundColor='{ALTBG1}'" onMouseOut="this.style.backgroundColor='{ALTBG2}'"复制代码
6.0查找:
<table summary="forum_$fid" id="forum_$fid" cellspacing="0" cellpadding="0"复制代码
添加:
  title="$thread[shortmsg]"复制代码
[ 本帖最后由 e_zailai 于 2007-11-27 22:07 编辑 ]
111.png
1

评分次数

  • sw08

欢迎光临 玫瑰天空个人综合网站
http://www.rosesky.name/bbs/[收藏有大量风格及插件]
5.5可以用吗?

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

如果有安装 “正确的主题列表显示详细评分For Dz 6.0”这个插件请按以下方法修改
http://www.discuz.net/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都查找(此步骤与一楼所提到的修改不一样)
$query = $db->query("SELECT t.* FROM {$tablepre}threads t 复制代码
修改为
/*$query = $db->query("SELECT t.* FROM {$tablepre}threads t*/
        $query = $db->query("SELECT $dotadd1 t.*, p.rate,p.pid FROM {$tablepre}threads t $dotadd2
                 LEFT JOIN {$tablepre}posts p USING(tid, dateline)
复制代码
“正确的主题列表显示详细评分For Dz 6.0”这个插件其他步骤按此帖修改http://www.discuz.net/thread-764630-1-3.html

[ 本帖最后由 e_zailai 于 2007-11-27 22:38 编辑 ]
欢迎光临 玫瑰天空个人综合网站
http://www.rosesky.name/bbs/[收藏有大量风格及插件]
晕,第一个就找不到相关的代码了啊.

forumdisplay.txt (14.76 KB)

common.js
里也没有相应的代码,麻烦帮忙改改哦.

common.txt (13.86 KB)

回复 #5 xuewuyaya 的帖子

已更新5.5的修改方法!!!
欢迎光临 玫瑰天空个人综合网站
http://www.rosesky.name/bbs/[收藏有大量风格及插件]
楼主,麻烦你把5.5和5.0都相对应分开好不,这样我都不知道怎么改了 眼睛都花了

回复 #7 reitg 的帖子

已采纳你的建议了,说明一点:上面没有标明的5.0和5.5都要修改
欢迎光临 玫瑰天空个人综合网站
http://www.rosesky.name/bbs/[收藏有大量风格及插件]
提示: 作者被禁止或删除 内容自动屏蔽

查找时出现三次

查找时出现三次:    $query = $db->query("SELECT t.* FROM {$tablepre}threads t
同时喜欢上了实验室和网站,于是白天实验室晚上网站¥越城学府
返回列表