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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 多媒体附件的在线预览forD4

[复制链接]
晶莹雪花 发表于 2005-12-20 15:11:10 | 显示全部楼层 |阅读模式
说明:支持flash、mediaplayer、realplayer格式的视频附件的在线预览

演示:http://bbs.snowcn.com/viewthread.php?tid=8394&extra=page%3D5
演示版本是for3.0的,由于对3.0的特殊感情,至今没有升级,呵呵,这里提供的是for4.0版本的


开始:


viewthread.php

查找:
  1. $attach['dateline'] = gmdate("$dateformat $timeformat", $attach['dateline'] + $timeoffset * 3600);
复制代码

在下面一行添加:
  1.                                 //加入多媒体附件的在线预览--www.snowcn.com
  2.                                         require_once DISCUZ_ROOT.'./include/att_typeid.func.php';
  3.                                         $attach['$type'] = attachtypeid($attach['filetype']);
  4.                                         $attach['$idname'] = random(2);
  5.                                 //结束--www.snowcn.com
复制代码



viewthread.htm
查找

  1. <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a>
复制代码


在后面添加
  1. {template att_video}
复制代码


将附件中的att_typeid.func.php上传到include目录下,att_video.htm上传到\templates\default目录下,完成

截一张图吧 插件支持firefox,这图就是在firefox下截取的

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

本帖子中包含更多资源

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

x
 楼主| 晶莹雪花 发表于 2005-12-20 15:11:33 | 显示全部楼层
附送一个


附件排列方法仿D3的表格方式,演示:看一楼

更新于2005.12.21
viewthread.php
查找

  1. $postlist[$attach['pid']]['attachments'][$attach['aid']] = $attach;
复制代码

替换为
  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
复制代码




viewthread.htm

查找:
  1. <br><br><img src="images/attachicons/common.gif"> {lang attachment}: <i>{lang attach_nopermission}</i>
复制代码


在下面一行添加:
  1. <!--仿d3附件排列-->
复制代码

查找:
  1. <!--{if $post['signature']}--><br><br><br></td></tr><tr><td valign="bottom" $maxsigrows>
复制代码

上面一行添加:
  1. <!--仿d3附件排列结束-->
复制代码


将<!--仿d3附件排列-->和<!--仿d3附件排列结束-->之间的内容用下面内容替换

  1. <!--{else}-->
  2.                                 <!--{loop $post['attachimg'] $attach}-->
  3.                                         <br><br>
  4.                                         <!--{if $attach['attachimg']}--><div style="text-align:center">
  5.                                                 <!--{if $attachrefcheck}-->
  6.                                                         <img title="$attach[filename] ($attach[dateline], $attach[attachsize], {$attach[description]}) <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm]<!--{/if}-->" 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);" id="imgatt">
  7.                                                 <!--{else}-->
  8.                                                         <img title="$attach[filename] ($attach[dateline], $attach[attachsize], {$attach[description]}) <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm]<!--{/if}--> " 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);" id="imgatt">
  9.                                                 <!--{/if}--></div>
  10.                                         <!--{/if}-->
  11.                                 <!--{/loop}-->
  12.                         <!--{if ($post['attachments'])}--><br><br>
  13.                                 <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">

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

  15.                                 <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>

  16.                                         <!--{loop $post['attachments'] $attach}-->
  17.                                                 <!--{if !$attach['attachimg']}-->
  18.                                                 <tr class="altbg1" align="center" ><td> </td><td align="left">                                               
  19.                                                         $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>
  20.                                                         $attach[dateline]<td>
  21.                                                         $attach[attachsize]<td>
  22.                                                         <span class="smalltxt">$attach[downloads]</span><td>
  23.                                                         <!--{if $attach['readperm']}-->{lang readperm} $attach[readperm]<!--{/if}--><td align="left">
  24.                                                         {$attach[description]}</tr>
  25.                                                 <!--{/if}-->
  26.                                 <!--{/loop}--></table>
  27.                         <!--{/if}--><!--{/if}-->
复制代码


如果没有安装一楼的插件,将替换内容中的{template att_video}删除

最后修改css.htm

在最后面的
  1. --></style>
复制代码
上面添加
  1. /*图片附件美化*/
  2. #imgatt                        {border:1px dashed {BORDERCOLOR};padding:4px;}
复制代码


完成

[ 本帖最后由 晶莹雪花 于 2005-12-21 10:02 编辑 ]
回复

使用道具 举报

william0116 发表于 2005-12-20 15:37:32 | 显示全部楼层
这个要顶.终於改到4.0上了.立刻本地试试先
回复

使用道具 举报

zhylsy99 发表于 2005-12-20 15:38:06 | 显示全部楼层
up
回复

使用道具 举报

haohao036 发表于 2005-12-20 15:41:18 | 显示全部楼层
不错。。用上。。谢了。。。
回复

使用道具 举报

freddy 发表于 2005-12-20 15:54:40 | 显示全部楼层
支持个
回复

使用道具 举报

cat0086 发表于 2005-12-20 15:56:05 | 显示全部楼层
这个原理可以做调用附件的图片吗????????????????
回复

使用道具 举报

william0116 发表于 2005-12-20 15:58:26 | 显示全部楼层
在D4上装了.但为什麽所有附件都多了个叉叉??如图

本帖子中包含更多资源

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

x
回复

使用道具 举报

 楼主| 晶莹雪花 发表于 2005-12-20 16:00:35 | 显示全部楼层
原帖由 william0116 于 2005-12-20 15:58 发表
在D4上装了.但为什麽所有附件都多了个叉叉??如图


给下地址看看
回复

使用道具 举报

fhg007 发表于 2005-12-20 16:01:41 | 显示全部楼层
回复

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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