不想更新6.0的朋友,又想拥有DZ6.0的图片效果的朋友可以试下~~~
已经更新好了JS文件,效果和目前6.0RC1一样~7月25日更新 以前修改过的朋友重新下载覆盖dzbox.js文件既可达到官方现在的效果~
下面开始修改
第一步:
修改templates/default/header.htm模版
查找
<script type="text/javascript" src="include/javascript/ajax.js"></script>复制代码
下面加
<script type="text/javascript" src="include/javascript/dzbox.js"></script>复制代码
第二步:
接着在templates/default/header.htm模版搜索
<body onkeydown="if(event.keyCode==27) return false;">复制代码
后面加
<div id="append_parent"></div>复制代码
第三步:
在templates/default/CSS.htm的最后加入
.viewthread { padding-bottom: 1px; }
.viewthread ins { display: block; text-align: center; text-decoration: none; margin-bottom: 1px; background: #F7F7F7; border-bottom: 1px solid #CAD9EA; line-height: 26px; }
.viewthread ins, .viewthread ins a { color: #090; }
.viewthread td.postcontent, .viewthread td.postauthor { vertical-align: top; padding: 0 1px; border: none; overflow: hidden; background: #FFF; }
.postinfo { color: #666; border-bottom: 1px solid #CAD9EA; padding: 8px 5px 3px 10px; }
.postinfo strong, .postinfo em { float: right; cursor: pointer; padding: 0 5px; color: #069; }
.postinfo strong { margin-left: 5px; border: solid #CAD9EA; border-width: 1px 1px 0; line-height: 22px; height: 22px; color: #090; background: #FFF; font-weight: bold; }
.postinfo strong sup { font-weight: normal; color: #999; }
.postinfo a { color: #069; }
.postinfo label { color:#090; cursor: pointer; }
.postmessage { padding: 10px; overflow: hidden; min-height: 240px; }
* html .postmessage { height: 240px; overflow: visible; }
.postmessage h2 {font-size: 1.17em; margin-bottom: 0.5em; }
.t_msgfont, .t_msgfont td { font-size: 14px; line-height: 1.6em; }
.t_smallfont, .t_smallfont td { font-size: 12px; line-height: 1.6em; }
.t_bigfont, .t_bigfont td { font-size: 16px; line-height: 1.6em; }
.t_msgfont *, .t_smallfont *, .t_bigfont * { line-height: normal; }
.t_msgfont a, .t_smallfont a, .t_bigfont a { color: #069; }
.postratings { float: right; }
.signatues { background: url(../../images/default/sigline.gif) no-repeat 0 0; margin: 10px; padding-top: 20px; }
* html .signature { height: expression(signature(this)); }
.postactions { border-top: 1px solid #E8E8E8; background: #F7F7F7; line-height: 30px; height: 30px; padding: 0 10px; }
.postactions strong { float: right; padding: 0 5px 0 10px; font-size: 0.83em; line-height: 28px; cursor: pointer; }
.postactions p { float: right; }
.postmessage .box { border-width: 1px 0 0; margin: 5px 0; }
.postmessage .typeoption { width: 500px; }
.postmessage .box tbody th, .postmessage .box tbody td { border-bottom-color: #E8E8E8; }
.postmessage fieldset { font-size: 12px; width: 500px; padding: 10px; border: 1px solid #CAD9EA; margin-top: 2em; }
.postmessage fieldset li { color: #999; }
.t_msgfont li, .t_bigfont li, .t_smallfont li { margin-left: 2em; }
.postattach { width: 500px; margin: 10px 0; }
.postattachlist { width: 500px; font-size: 12px; margin-top: 2em; }
.t_attach { border: 1px solid #E8E8E8; background: #FFF; }
.t_attach em { color: #999; }
.t_attachlist { border-bottom: 1px solid #E8E8E8; padding: 5px 0; }
.t_attachlist dt { font-weight: bold; }
.t_attachlist dt img { margin-bottom: -4px; }
.t_attachlist dd { padding-left: 20px; color: #999; }
.t_attachinsert { margin: 1em 0; font-size: 12px; }
.t_attachinsert p img { margin-bottom: -4px; }
.t_table { border: 1px solid #CAD9EA; empty-cells: show; border-collapse: collapse; width: inherit !important; }
.t_table td { padding: 4px; border: 1px solid #CAD9EA; }复制代码
第四步:
让附件框内的图片有效果
打开templates/default/viewthread_attachlist.htm模版
查找:
<!--{if !$attach['price'] || $attach['payed']}-->
..............
<!--{/if}-->
<!--{/if}-->
<!--{/if}-->复制代码
上面的"
............."为省略的代码
用下面的替换
<!--{if !$attach['price'] || $attach['payed']}-->
<!--{if $thumbstatus && $attach['thumb']}-->
<!--{if ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) == 'ftp' && !$ftp['hideurl'])}-->
<a href="#zoom"><img onclick="zoom(this,'$attach[url]/$attach[attachment]')" src="attachment.php?aid=$attach[aid]" border="0" onload="javascript:if(this.width>550)this.width=550" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\\nCTRL+Mouse wheel to zoom in/out';}" onmousewheel="return imgzoom(this);" alt="{lang image_thumb}"/></a>
<!--{else}-->
<a href="#zoom"><img onclick="zoom(this,'$attach[url]/$attach[attachment]')" src="$attach[url]/$attach[attachment].thumb.jpg" border="0" onload="javascript:if(this.width>550)this.width=550" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\\nCTRL+Mouse wheel to zoom in/out';}" onmousewheel="return imgzoom(this);" alt="{lang image_thumb}"/></a>
<!--{/if}-->
<!--{else}-->
<!--{if ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) == 'ftp' && !$ftp['hideurl'])}-->
<a href="#zoom"><img onclick="zoom(this,'$attach[url]/$attach[attachment]')" src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="javascript:if(this.width>550)this.width=550" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\\nCTRL+Mouse wheel to zoom in/out';}" onmousewheel="return imgzoom(this);" alt="{lang image_thumb}"/></a>
<!--{else}-->
<a href="#zoom"><img onclick="zoom(this,'$attach[url]/$attach[attachment]')" src="$attach[url]/$attach[attachment]" border="0" onload="javascript:if(this.width>550)this.width=550" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\\nCTRL+Mouse wheel to zoom in/out';}" onmousewheel="return imgzoom(this);" alt="{lang image_thumb}" /></a>
<!--{/if}-->
<!--{/if}-->
<!--{/if}-->复制代码
第5步:
让附件的图片插入到帖子中有效果
打开include\discuzcode.func.php文件(重要文件,修改前备份!)
查找:
$replacement .= ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) == 'ftp' && !$ftp['hideurl']) ? '<a href="attachment.php?aid='.$attach['aid'].'&noupdate=yes¬humb=yes" target="_blank"><img src="attachment.php?aid='.$attach['aid'].'" border="0" alt="'.$language['attach_img_thumb'].'" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1)" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" /></a>' :
'<a href="'.$attach['url'].'/'.$attach['attachment'].'" target="_blank"><img src="'.$attach['url'].'/'.$attach['attachment'].'.thumb.jpg" border="0" alt="'.$language['attach_img_thumb'].'" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1)" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" /></a>';
} else {
$replacement .= ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) == 'ftp' && !$ftp['hideurl']) ? '<img src="attachment.php?aid='.$attach['aid'].'&noupdate=yes" border="0" onload="attachimg(this, \'load\', \''.$language['attach_img_zoom'].'\')" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1);attachimg(this, \'mouseover\')" onclick="attachimg(this, \'click\', \'attachment.php?aid='.$attach['aid'].'\')" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" onmousewheel="return imgzoom(this)" alt="" />' :
'<img src="'.$attach['url'].'/'.$attach['attachment'].'" border="0" onload="attachimg(this, \'load\', \''.$language['attach_img_zoom'].'\')" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1);attachimg(this, \'mouseover\')" onclick="attachimg(this, \'click\', \''.addslashes("$attach[url]/$attach[attachment]").'\')" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" onmousewheel="return imgzoom(this)" alt="" />';复制代码
这里一定要注意~~~
替换成
$replacement .= ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) == 'ftp' && !$ftp['hideurl']) ? '<a href="#zoom"><img onclick="zoom(this, \'attachment.php?aid='.$attach['aid'].'\')" src="attachment.php?aid='.$attach['aid'].'" onload="javascript:if(this.width>550)this.width=550" border="0" alt="'.$language['attach_img_thumb'].'" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1)" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" /></a>' :
'<a href="#zoom"><img onclick="zoom(this, \''.$attach['url'].'/'.$attach['attachment'].'.thumb.jpg\')" src="'.$attach['url'].'/'.$attach['attachment'].'.thumb.jpg" onload="javascript:if(this.width>550)this.width=550" border="0" alt="'.$language['attach_img_thumb'].'" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1)" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" /></a>';
} else {
$replacement .= ($attachrefcheck || $attach['remote']) && !($attach['remote'] && substr($ftp['attachurl'], 0, 3) == 'ftp' && !$ftp['hideurl']) ? '<a href="#zoom"><img src="attachment.php?aid='.$attach['aid'].'&noupdate=yes" border="0" onload="javascript:if(this.width>550)this.width=550" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1);attachimg(this, \'mouseover\')" onclick="zoom(this, \'attachment.php?aid='.$attach['aid'].'&noupdate=yes\')" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" onmousewheel="return imgzoom(this)" alt="" /></a>' :
'<a href="#zoom"><img src="'.$attach['url'].'/'.$attach['attachment'].'" border="0" onload="javascript:if(this.width>550)this.width=550" onmouseover="attachimginfo(this, \'attach_'.$attach['aid'].'\', 1);attachimg(this, \'mouseover\')" onclick="zoom(this, \''.$attach['url'].'/'.$attach['attachment'].'\')" onmouseout="attachimginfo(this, \'attach_'.$attach['aid'].'\', 0, event)" onmousewheel="return imgzoom(this)" alt="" /></a>';复制代码
修改[IMG]标签
打开include\discuzcode.func.php文件(此文件修改前最好先备份,以免出错!)
查找(如果查找不到,找到类似的即可)
<img src=\"%s\" border=\"0\" onload=\"if
(this.width>screen.width*0.7) {this.resized=true;
this.width=screen.width*0.7; this.alt=\'Click here to open new
window\\nCTRL+Mouse wheel to zoom in/out\';}\" onmouseover=\"if
(this.width>screen.width*0.7) {this.resized=true;
this.width=screen.width*0.7; this.style.cursor=\'hand\';
this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom
in/out\';}\" onclick=\"if(!this.resized) {return true;} else
{window.open(\'%s\');}\" onmousewheel=\"return imgzoom(this);\"
alt=\"\" />复制代码
替换为
<a href=\"#zoom\"><img src=\"%s\" border=\"0\" onload=\"javascript:if(this.width>550)this.width=550\" onmouseover=\"if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}\" onmousewheel=\"return imgzoom(this);\" onclick=\"zoom(this, \'%s\')\" alt=\"\" /></a>复制代码
上传附件到相应位置 修改完毕!!
效果察看地址:
http://www.tong-xun.com/viewthread.php?tid=228&extra=page%3D1
dzbox.rar (2.74 KB)
已经更新~
[
本帖最后由 qiji0554 于 2007-7-30 01:35 编辑 ]