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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] D4的图文混排-整理更新版,解决了存在的bug[2005.12.23 22:47]

[复制链接]
晶莹雪花 发表于 2005-12-23 22:48:35 | 显示全部楼层 |阅读模式
说明:
1、支持[img ]attach=2[/img]格式来引用图片附件,使用方法同D3
2、支持[div=left|right,width,border]内容[/div]代码,使用方法同D3
3、支持[block]、[hr ]代码,使用方法同D3
4、支持同一附件的多次引用,当附件不存在时,会用一个?来替换,而不是显示XX
5、目前仅支持图片附件,对于其它格式的文件,当用点击这里 [ /url]时无效
6、编辑贴子,再上传附件时,附件编号需要手动设置,不然会有重复
7、黑色部分为正常修改部分,绿色为可选部分蓝色部分是当安装过其它插件,不方便覆盖文件时的对应修改部分


演示地址:[url]http://bbs.snowcn.com/viewthread.php?tid=2392&extra=page%3D1

或者参见附件中的图


安装难度:一般
升级数据:有,其实本来是D3的表,升级到D4后自动删除了,我们再把它找回来


后台升级数据库
  1. ALTER TABLE `cdb_attachments` ADD `displayorder` TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `filename` ;
复制代码



继续:

viewthred.php
查找

  1. $attach['attachimg'] = $attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
  2.                                 $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach;
复制代码

替换为


  1.                                 /*$attach['attachimg'] = $attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp')) && (!$attach['readperm'] || $readaccess >= $attach['readperm']) ? 1 : 0;
  2.                                 $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach;*/
  3.                                
  4.                                 //图文混排删除上面内容,加入下面
  5.                                 $isimage = in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp'));
  6.                                
  7.                                 if ( $isimage && $attachimgpost && !$attach['permid'] ){
  8.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;
  9.                                 }else{
  10.                                         $postlist[$attach['pid']]['attachments'][$attach[aid]] = $attach;
  11.                                 }
  12.                                
  13.                                 if ( $attach['permid'] && $isimage && $attachimgpost && !isset($postlist[$attach['pid']]['attachimg'][$attach[aid]]) && ($disablepermscheck || checkperms( $attach['permid'],$attach['readperm'],'attach')==1)){
  14.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;

  15.                                 }

  16.                
  17.                 if (isset($postlist[$attach['pid']]['attachimg'][$attach[aid]]) && $forum['allowbbcode'] && $forum['allowimgcode'] && !$post['bbcodeoff']){
  18.                 $posmessage = str_replace( "images/common/attachnoperm.gif?{$attach[displayorder]}","$attachurl/$attach[attachment]",$postlist[$attach['pid']]['message']);
  19.                                 
  20.                 if($postlist[$attach['pid']]['message']!=$posmessage){
  21.                 $postlist[$attach['pid']]['message']=$posmessage;
  22.                 unset($posmessage,$postlist[$attach['pid']]['attachimg'][$attach[aid]]);
  23.                 }else{
  24.                     unset($posmessage,$postlist[$attach['pid']]['attachments'][$attach[aid]]);
  25.                 }
  26.                 }//结束
复制代码


查找

  1. $query = $db->query("SELECT aid, pid, dateline, readperm, filename, description, filetype, attachment, filesize, downloads
  2.                                         FROM {$tablepre}attachments WHERE pid IN ($attachpids) ORDER BY aid");
复制代码


替换为:

  1.                 //图文混排,删除上面内容,替换为下面内容
  2.                 $query = $db->query("SELECT aid, pid, displayorder, dateline, readperm, filename, description, filetype, attachment, filesize, downloads
  3.                                         FROM {$tablepre}attachments WHERE pid IN ($attachpids) ORDER BY displayorder");
  4.                 //图文混排结束
复制代码







templates\default\viewthread.htm



查找:
  1. <!--{loop $post['attachments'] $attach}-->
复制代码

改成:
  1. <!--{loop $post['attachimg'] $attach}-->
复制代码


查找:
  1. <!--{if $attach['attachimg']}-->
复制代码

删除

查找

  1. <img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);">
  2.                                         <!--{/if}-->
  3.                                 <!--{else}-->
复制代码

替换成

  1. <img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='{lang image_open_zoom}';}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);">
  2.                                         <!--{/if}-->
  3.                                 <!--{/loop}--><!--{if ($post['attachments'])}--><!--{loop $post['attachments'] $attach}--><br><br>$attach['attachicon']
复制代码


查找:
  1. $attach[dateline], $attach[attachsize]
复制代码

一共有两处,全部
替换成
  1. $attach[dateline], $attach[attachsize], 编号: $attach[displayorder]
复制代码

查找:

  1. <!--{/if}-->
  2.                         <!--{/loop}-->
  3.                 <!--{/if}-->
  4.                 <!--{if $post['signature']}-->
复制代码

替换成
  1.                         <!--{/loop}--><!--{/if}-->
  2.                 <!--{/if}-->
  3.                 <!--{if $post['signature']}-->
复制代码



include\post.func.php
查找
  1. $attachdesc, $attachsave, $attachdir,
复制代码

在后面添加
  1. $attachordernew,
复制代码

查找
  1. $attach['perm'] = $allowsetattachperm ? $attachperm[$key] : 0;
复制代码

在上面一行加入
  1. $attach['order'] = intval($attachordernew[$key]);//图文混排加入这句
复制代码


include\newthread.inc.php
查找

  1.         if($attachment) {
  2.                 foreach($attachments as $attach) {
  3.                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  4.                                 VALUES ('$tid', '$pid', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  5.                 }
  6.                 updatecredits($discuz_uid, $creditspolicy['postattach'], count($attachments));
  7.         }
复制代码

替换为

  1.         /*if($attachment) {
  2.                 foreach($attachments as $attach) {
  3.                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  4.                                 VALUES ('$tid', '$pid', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  5.                 }
  6.                 updatecredits($discuz_uid, $creditspolicy['postattach'], count($attachments));
  7.         }*/
  8.         //图文混排删除上面一段,加入下面
  9.         if($attachment) {
  10.                 foreach($attachments as $attach) {
  11.                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, displayorder, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  12.                                 VALUES ('$tid', '$pid', '$attach[order]', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  13.                 }
  14.                 updatecredits($discuz_uid, $creditspolicy['postattach'], count($attachments));
  15.         }//结束
复制代码



include\newreply.inc.php
查找

  1.         if($attachment) {
  2.                 foreach($attachments as $attach) {
  3.                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  4.                                 VALUES ('$tid', '$pid', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  5.                 }
  6.                 updatecredits($discuz_uid, $creditspolicy['postattach'], count($attachments));
  7.         }
复制代码

替换为

  1.         /*if($attachment) {
  2.                 foreach($attachments as $attach) {
  3.                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  4.                                 VALUES ('$tid', '$pid', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  5.                 }
  6.                 updatecredits($discuz_uid, $creditspolicy['postattach'], count($attachments));
  7.         }*/
  8.         //图文混排删除上面内容,添加下面
  9.         if($attachment) {
  10.                 foreach($attachments as $attach) {
  11.                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid,displayorder, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  12.                                 VALUES ('$tid', '$pid','$attach[order]', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  13.                 }
  14.                 updatecredits($discuz_uid, $creditspolicy['postattach'], count($attachments));
  15.         }//结束
复制代码





include\editpost.inc.php
查找

  1.                                
  2.                                 foreach($attachments as $attach) {
  3.                                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  4.                                                 VALUES ('$tid', '$pid', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  5.                                 }
复制代码

替换为

  1.                                 /*foreach($attachments as $attach) {
  2.                                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  3.                                                 VALUES ('$tid', '$pid', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  4.                                 }*/
  5.                                 foreach($attachments as $attach) {
  6.                                         $db->query("INSERT INTO {$tablepre}attachments (tid, pid,displayorder, dateline, readperm, filename, description, filetype, filesize, attachment, downloads)
  7.                                                 VALUES ('$tid', '$pid', '$attach[order]', '$timestamp', '$attach[perm]', '$attach[name]', '$attach[description]', '$attach[type]', '$attach[size]', '$attach[attachment]', '0')");
  8.                                 }//图文混排,加入了    ,displayorder    和    , '$attach[order]'
复制代码


查找

  1.                 while($attach = $db->fetch_array($query)) {
  2.                         if(($attachpermadd = $allowsetattachperm && $attach['readperm'] != $attachpermnew[$attach['aid']] ? ", readperm='{$attachpermnew[$attach['aid']]}'": '') || $attach['description'] != ($attachdescnew[$attach['aid']] = cutstr(dhtmlspecialchars($attachdescnew[$attach['aid']]), 100))) {
  3.                                 $db->query("UPDATE {$tablepre}attachments SET description='{$attachdescnew[$attach['aid']]}' $attachpermadd WHERE aid='$attach[aid]'");
  4.                         }
  5.                 }
复制代码

替换为

  1.                 /*while($attach = $db->fetch_array($query)) {
  2.                         if(($attachpermadd = $allowsetattachperm && $attach['readperm'] != $attachpermnew[$attach['aid']] ? ", readperm='{$attachpermnew[$attach['aid']]}'": '') || $attach['description'] != ($attachdescnew[$attach['aid']] = cutstr(dhtmlspecialchars($attachdescnew[$attach['aid']]), 100))) {
  3.                                 $db->query("UPDATE {$tablepre}attachments SET description='{$attachdescnew[$attach['aid']]}' $attachpermadd WHERE aid='$attach[aid]'");
  4.                         }
  5.                 }*/
  6.                 //附件混排删除上面一段,加入下面               
  7.                
  8.                 while($attach = $db->fetch_array($query)) {

  9.                         $orderadd = $attachorder[$attach['aid']] != (int)$attach['displayorder'] ? ", displayorder='{$attachorder[$attach[aid]]}'":'';
  10.                         if(($attachpermadd = $allowsetattachperm && $attach['readperm'] != $attachpermnew[$attach['aid']] ? ", readperm='{$attachpermnew[$attach['aid']]}'": '') || $attach['description'] != ($attachdescnew[$attach['aid']] = cutstr(dhtmlspecialchars($attachdescnew[$attach['aid']]), 100)) || $orderadd) {
  11.                                
  12.                                 $db->query("UPDATE {$tablepre}attachments SET description='{$attachdescnew[$attach['aid']]}' $attachpermadd $orderadd WHERE aid='$attach[aid]'");
  13.                         }
  14.                 }//结束
复制代码









将附件中的discuzcode.func.php放到include目录下,覆盖原来的;post_editpost.htm和post_attachments.htm放到templates\default下,覆盖原来的; attachnoperm.gif放到images\common目录下,完成

如果安装了其它插件修改过这几个文件,请参考下面的修改方法进行修改

include\discuzcode.func.php
查找
  1. "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is",
复制代码

下面添加:

  1.                                 "/\s*\[block\][\n\r]*(.+?)[\n\r]*\[\/block\]\s*/is",
  2.                                 "/\s*\[block=([^\[\n\r]+?)\][\n\r]*(.+?)[\n\r]*\[\/block\]\s*/is",
  3.                                 "/\s*\[div=(left|right|none)[\,](\d{1,3})[\,](\d{1})\][\n\r]*(.+?)[\n\r]*\[\/div\]\s*/is",
  4.                                 "/\s*\[div=(left|right|none)\][\n\r]*(.+?)[\n\r]*\[\/div\]\s*/is",
复制代码

查找

  1. "<br><br><div class="smalltxt" style="margin-left: 2em; font-weight: bold">QUOTE:</div><div class="altbg2" style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px solid ".BORDERCOLOR."; word-break: break-all">\\1</div>",
复制代码

下面添加

  1.                                 "<br><br><blockquote class="altbg2" style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px dashed ".BORDERCOLOR."; word-break: break-all">\\1</blockquote>",
  2.                                 "<br><br><div class="smalltxt" style="margin-left: 2em; font-weight: bold">\\1 :</div><blockquote class="altbg2" style="margin: 2em; margin-top: 3px; padding: 10px; border: ".INNERBORDERWIDTH."px dashed ".BORDERCOLOR."; word-break: break-all">\\2</blockquote>",
  3.                                 "<div style="float: \\1 ;margin: 1px; margin-top: 1px; padding: 2px;word-break: break-all;width:\\2 ;border: \\3"."px solid ".BORDERCOLOR.";">\\4</div>",
  4.                                 "<div style="float: \\1 ;margin: 1px; margin-top: 1px; padding: 2px;word-break: break-all;border:1px solid ".BORDERCOLOR.";">\\2</div>",
复制代码



/*12.23 23:20添加了这句,不然
代码没有用,没有大的影响,呵呵*/查找
  1. '[*]', '[/list]'
复制代码
后面添加
  1. ,'[hr]'
复制代码

查找
  1. '</ul></ol>'
复制代码
后面添加
  1. ,'<hr size="1">'
复制代码

查找

  1. function bbcodeurl($url, $tags) {
  2.         if(!preg_match("/<.+?>/s", $url)) {
  3.                 if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'ftp://', 'rtsp:/', 'mms://'))) {
  4.                         $url = 'http://'.$url;
  5.                 }
  6.                 return str_replace('submit', '', sprintf($tags, $url, addslashes($url)));
  7.         } else {
  8.                 return ' '.$url;
  9.         }
  10. }
复制代码

替换为

  1. function bbcodeurl($url, $tags) {
  2.         if(!preg_match("/<.+?>/s", $url)) {
  3.                 if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'ftp://', 'rtsp:/', 'mms://'))) {
  4.                         $url = 'http://'.$url;
  5.                 }
  6.                 return str_replace(array('submit','action=logout','http://attach=',),array('', '', 'images/common/attachnoperm.gif?'), sprintf($tags, $url, $url));
  7.                 //return str_replace('submit', '', sprintf($tags, $url, addslashes($url)));
  8.         } else {
  9.                 return ' '.$url;
  10.         }
  11. }
复制代码


templates\default\post_attachments.htm
这个修改比较麻烦,因为是每行两个附件,所没法用loop语法,修改方法:
查找
  1. <td width="50%">
复制代码

文件中一共有10处,在每一处后面依次添加:
  1. 编号: <input type="text" name="attachordernew[]" value="1" size='1'>
复制代码
其中
  1. value="1"
复制代码
的值从1到10,即第一个<td width="50%">后面是
  1. 编号: <input type="text" name="attachordernew[]" value="1" size='1'>
复制代码
第二个<td width="50%">后面是
  1. 编号: <input type="text" name="attachordernew[]" value="2" size='1'>
复制代码


....
第10个<td width="50%">后面是
  1. 编号: <input type="text" name="attachordernew[]" value="10" size='1'>
复制代码




templates\default\post_editpost.htm
查找
  1. <td>aid</td>
复制代码

后面添加
  1. <td>编号</td>
复制代码

查找
  1. <td class="altbg1">$attach[aid]</td>
复制代码

下面添加
  1. <td class="altbg2"><input type="text" name="attachorder[{$attach[aid]}]" size="3" value="$attach[displayorder]" ></td>
复制代码

查找
  1. colspan="8"
复制代码
共有三处,全部改成
  1. colspan="9"
复制代码

如果你安装过其它插件,这里可能不是8,是9或者其它数字,只要在原来的基础上加1就行了,比如:如果是9,就改成10



此处为可选部分,是对附件的一些显示美化,与插件本身没有多大关系,如果喜欢可以安装,此处美化已经结合了本插件
viewthread.htm
  1.                         <br><br><img src="images/attachicons/common.gif"> {lang attachment}: <i>{lang attach_nopermission}</i>
  2.                 <!--{else}-->
复制代码
  1. <!--{if $post['signature']}--><br><br>[/color]之间的内容替换为

  2. [code]
  3.                                 <!--{loop $post['attachimg'] $attach}-->
  4.                                         <br><br>
  5.                                         <!--{if $attach['attachimg']}--><div style="text-align:center">
  6.                                                 <!--{if $attachrefcheck}-->
  7.                                                         <img title="$attach[filename] ($attach[dateline], $attach[attachsize]) <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm]<!--{/if}--> ({$attach[description]})" src="attachment.php?aid=$attach[aid]&noupdate=yes" border="0" onload="if(this.width>800) {this.resized=true; this.width=800;}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachment.php?aid=$attach[aid]');}" onmousewheel="return imgzoom(this);" style="border:1px dashed {BORDERCOLOR};padding:4px;">
  8.                                                 <!--{else}-->
  9.                                                         <img title="$attach[filename] ($attach[dateline], $attach[attachsize]) <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm]<!--{/if}--> ({$attach[description]})" src="$attachurl/$attach[attachment]" border="0" onload="if(this.width>800) {this.resized=true; this.width=800;}" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);" style="border:1px dashed {BORDERCOLOR};padding:4px;">
  10.                                                 <!--{/if}--></div>
  11.                                         <!--{/if}-->
  12.                                 <!--{/loop}-->
  13.                         <!--{if ($post['attachments'])}--><br><br>
  14.                                 <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">

  15.                                 <tr align="center"><td colspan="7">本贴包含附件</td></tr>

  16.                                 <tr class="category" align="center"><td width="5%">NO.<td width="40%">附件<td width="15%">更新时间<td width="10%">文件大小<td width="5%">下载<td width="10%">附件限制<td width="15%">描述</td></tr>

  17.                                         <!--{loop $post['attachments'] $attach}-->
  18.                                                 <!--{if !$attach['attachimg']}-->
  19.                                                 <tr class="altbg1" align="center" ><td>$attach[displayorder]</td><td align="left">                                               
  20.                                                         $attach[attachicon] <!--{if !$discuz_uid}-->$attach[filename](<a href="logging.php?action=login">登录</a>后下载)<!--{else}--><a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a><!--{/if}-->{template att_video}<td>
  21.                                                         $attach[dateline]<td>
  22.                                                         $attach[attachsize]<td>
  23.                                                         <span class="smalltxt">$attach[downloads]</span><td>
  24.                                                         <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm]<!--{/if}--><td align="left">
  25.                                                         {$attach[description]}</tr>
  26.                                                 <!--{/if}-->
  27.                                 <!--{/loop}--></table>
  28.                         <!--{/if}-->
复制代码





[ 本帖最后由 晶莹雪花 于 2005-12-23 23:20 编辑 ]

本帖子中包含更多资源

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

x
 楼主| 晶莹雪花 发表于 2005-12-23 22:49:35 | 显示全部楼层
一些问题修正:
1、hr代码不能用(1楼已经修正)
discuzcode.func.php
查找
  1. '[*]', '[/list]'
复制代码
后面添加
  1. ,'[hr]'
复制代码



2、安装了https://discuz.dismall.com/viewthread.php?tid=208423中2楼的仿D3附件排列

viewthred.php

查找
  1.                                 //仿D3附件--www.snowcn.com
  2.                                 $isimage = in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp'));//图片判断
  3.                                 if ( $isimage && $attachimgpost && !$attach['permid'] ){
  4.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;
  5.                                 }else{
  6.                                         $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach;
  7.                                 }//结束--www.snowcn.com
复制代码

下面添加
  1.                                 if ( $attach['permid'] && $isimage && $attachimgpost && !isset($postlist[$attach['pid']]['attachimg'][$attach[aid]]) && ($disablepermscheck || checkperms( $attach['permid'],$attach['readperm'],'attach')==1)){
  2.                                         $postlist[$attach['pid']]['attachimg'][$attach[aid]] = $attach;

  3.                                 }

  4.                
  5.                 if (isset($postlist[$attach['pid']]['attachimg'][$attach[aid]]) && isset($postlist[$attach['pid']]['attachments'][$attach[aid]]) && $forum['allowbbcode'] && $forum['allowimgcode'] && !$post['bbcodeoff']){
  6.                 $posmessage = str_replace( "images/common/attachnoperm.gif?{$attach[displayorder]}","$attachurl/$attach[attachment]",$postlist[$attach['pid']]['message']);
  7.                                 
  8.                 if($postlist[$attach['pid']]['message']!=$posmessage){
  9.                 $postlist[$attach['pid']]['message']=$posmessage;
  10.                 unset($posmessage,$postlist[$attach['pid']]['attachimg'][$attach[aid]]);
  11.                 }else{
  12.                     unset($posmessage,$postlist[$attach['pid']]['attachments'][$attach[aid]]);
  13.                 }
  14.                 }//图文混排结束
复制代码




3、安装了https://discuz.dismall.com/viewthread.php?tid=208423中1楼的在线预览

viewthred.php
查找

  1.                                 require_once DISCUZ_ROOT.'./include/att_typeid.func.php';
  2.                                 $attach['$type'] = attachtypeid($attach['filetype']);
  3.                                 $attach['$idname'] = random(2);
复制代码

移动到
  1. $attach['dateline'] = gmdate("$dateformat $timeformat", $attach['dateline'] + $timeoffset * 3600);
复制代码
下面

viewthred.htm可以不用修改

[ 本帖最后由 晶莹雪花 于 2005-12-24 15:34 编辑 ]
回复

使用道具 举报

 楼主| 晶莹雪花 发表于 2005-12-23 22:50:05 | 显示全部楼层
重新安装了全新的D4,并安装过两次,都成功了,才发上来的,应该没有问题了
回复

使用道具 举报

freddy 发表于 2005-12-23 22:54:14 | 显示全部楼层
兄弟,您辛苦了!
回复

使用道具 举报

Eor 发表于 2005-12-23 22:56:43 | 显示全部楼层
楼主多谢了
回复

使用道具 举报

haohao036 发表于 2005-12-23 22:57:16 | 显示全部楼层
呵呵.支持啊.
回复

使用道具 举报

tsjs 发表于 2005-12-23 23:02:19 | 显示全部楼层
先支持,再试,楼主辛苦了!
谢谢~~~
回复

使用道具 举报

kazamatsuri 发表于 2005-12-23 23:33:08 | 显示全部楼层
沙发没了~~
回复

使用道具 举报

william0116 发表于 2005-12-23 23:44:21 | 显示全部楼层
雪花真是辛苦了.支持
回复

使用道具 举报

quan01559 发表于 2005-12-24 00:11:45 | 显示全部楼层
为什么我发
   不能显示一条横线

[/hr]就会显示一条横线而后面还会显示[/hr]

[ 本帖最后由 quan01559 于 2005-12-24 00:14 编辑 ]

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 14:16 , Processed in 0.219651 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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