1、此插件版权for oytktk
2、仅去除了表格显示,附件显示方式同D4
3、增加了网页显示flash
4、增加asf显示(使用media player播放)
5、这个修改稍微懂点html的都会,只是叫大家省点事而已,感谢oytktk老大的无私帮忙,做为你的粉丝,希望多出一些好的hack!
6、此修改手工过于粗糙,期待大虾完善。
安装方法:
VIEWTHREAD.PHP
查找:
- $attach['attachimg'] = $attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp')) ? 1 : 0;
复制代码
下面加
第一种,swf使用windows media player播放,加入asf格式在线显示。
- $attach['attachmp3'] = $attachimgpost && in_array($extension, array('wav', 'wma', 'mp3', 'mid')) ? 1 : 0;
- $attach['attachwmv'] = $attachimgpost && in_array($extension, array('avi', 'wmv', 'mpg',‘swf’, 'asf')) ? 1 : 0;
- $attach['attachrm'] = $attachimgpost && in_array($extension, array('rm', 'rmvb')) ? 1 : 0;
复制代码
第二种,swf使用网页播放,加入asf格式在线显示。
- $attach['attachmp3'] = $attachimgpost && in_array($extension, array('wav', 'wma', 'mp3', 'mid')) ? 1 : 0;
- $attach['attachwmv'] = $attachimgpost && in_array($extension, array('avi', 'wmv', 'mpg','asf')) ? 1 : 0;
- $attach['attachswf'] = $attachimgpost && in_array($extension, array('swf')) ? 1 : 0;
- $attach['attachrm'] = $attachimgpost && in_array($extension, array('rm', 'rmvb')) ? 1 : 0;
复制代码
模板: VIEWTHREAD.HTM
查找:
- <!--{loop $post['attachments'] $attach}-->
- <br><br>$attach[attachicon]
- <!--{if $attach['attachimg']}-->
- <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>:
- <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}-->
- <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br><br>
- <!--{if $attachrefcheck}-->
- <img src="attachment.php?aid=$attach[aid]&noupdate=yes" 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('attachment.php?aid=$attach[aid]');}" onmousewheel="return imgzoom(this);">
- <!--{else}-->
- <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);">
- <!--{/if}-->
- <!--{else}-->
- <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
- <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
- <span class="smalltxt">{lang attach_download_count} $attach[downloads]
- <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
- <!--{/if}-->
- <!--{/loop}-->
复制代码
替换为
第一种,使用windows media player播放swf附件,D4附件方式。
- <!--{loop $post['attachments'] $attach}-->
- <br><br>
- <!--{if $attach['attachimg']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
- <span class="smalltxt">{lang attach_download_count} $attach[downloads] <!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$credits</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><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 true;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);"><!--{/if}-->
- <!--{elseif $attach['attachmp3']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['description']}--><!--{/if}--><!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="69" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
- <embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="$attachurl/$attach[attachment]" width="380" height="69"></embed></object><!--{/if}-->
- <!--{elseif $attach['attachwmv']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="300" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
- <embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="$attachurl/$attach[attachment]" width="380" height="300"></embed></object><!--{/if}-->
- <!--{elseif $attach['attachrm']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="$attachurl/$attach[attachment]" controls="ControlPanel,StatusBar" width=380 height=68 border=0 autostart=true loop=true></embed><!--{/if}-->
- <!--{else}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
- <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
- <span class="smalltxt">{lang attach_download_count} $attach[downloads]
- <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
- <!--{/if}-->
- <!--{/loop}-->
复制代码
第二种,使用网页方式播放swf,D4附件方式。
- <!--{loop $post['attachments'] $attach}-->
- <br><br>
- <!--{if $attach['attachimg']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attach_img}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
- <span class="smalltxt">{lang attach_download_count} $attach[downloads] <!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$credits</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><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 true;} else {window.open('$attachurl/$attach[attachment]');}" onmousewheel="return imgzoom(this);"><!--{/if}-->
- <!--{elseif $attach['attachmp3']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['description']}--><!--{/if}--><!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="69" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
- <embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="$attachurl/$attach[attachment]" width="380" height="69"></embed></object><!--{/if}-->
- <!--{elseif $attach['attachwmv']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="380" height="300" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="$attachurl/$attach[attachment]">
- <embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="$attachurl/$attach[attachment]" width="380" height="300"></embed></object><!--{/if}-->
- <!--{elseif $attach['attachswf']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="544" height="404"><param name="movie" value="$attachurl/$attach[attachment]"><param name="quality" value="high"><param name="menu" value="false"><embed src="$attachurl/$attach[attachment]" width="544" height="404" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object><!--{/if}-->
- <!--{elseif $attach['attachrm']}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>{lang attach_download_count} $attach[downloads]<!--{if $attach['readperm'] > $readaccess && !$adminid}--><blockquote style="margin-left:20px; margin-right:20px; border:#DDE3EC dashed 1px; padding:5px;background-color: white ;">对不起, 您的阅读权限(<font color="#FF0000"><b>$readaccess</b></font>), 没有达到附件浏览所需的阅读权限(<b><font color="#FF0000">$attach['readperm']</font></b>)的要求, 所以不能查看附件资源!</blockquote><!--{else}--><br><br><embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="$attachurl/$attach[attachment]" controls="ControlPanel,StatusBar" width=380 height=68 border=0 autostart=true loop=true></embed><!--{/if}-->
- <!--{else}-->
- $attach[attachicon] <a href="member.php?action=credits&view=getattach" title="{lang credits_policy_view}" target="_blank">{lang attachment}</a>:
- <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <a href="attachment.php?aid=$attach[aid]" target="_blank" class="bold">$attach[filename]</a> ($attach[dateline], $attach[attachsize])<br>
- <span class="smalltxt">{lang attach_download_count} $attach[downloads]
- <!--{if $attach['readperm']}-->, {lang readperm} $attach[readperm]<!--{/if}--></span><br>
- <!--{/if}-->
- <!--{/loop}-->
复制代码
完成!
演示图片(含限制及正常演示)
[ 本帖最后由 青春E族 于 2005-12-26 23:27 编辑 ] |