2007-6-18 18:36
羽河
鼠標略過主題列表圖片附件即時預覽 D5.5 (後台自定義顯示版塊)完全繁化
=========================================
插件版本: Discuz! 5.5.0(0324) BIG5 繁體中文正式版
安裝難易: 中
數據升級: 2條
修改文件: 5個
增加文件: 2個
插件修改: BY 肯得基
插件繁化: by羽河
==========================================
插件說明: 在主題列表頁中如果主題内容中存在圖片附件的,當鼠標略過主題時將會顯示圖片,適合攝影和圖片網站。[此版本暫時不支持遠程附件圖片]
關於自定義顯示版塊安裝完畢後請到後台編輯版塊中自行設置。
5-2更新說明:讓論壇全部版塊顯示預覽圖片
Download附件解壓後按目錄格式上傳所有附件~~~~~~
\images\common\showbg.gif
\include\javascript\showimage.js
==================================
廢話少講,立刻開始!
文件修改開始:
1.後台升級數據庫
[code]ALTER TABLE cdb_forums ADD valueattach tinyint(1) NOT NULL default '0';
ALTER TABLE cdb_forumfields ADD valueattach tinyint(1) NOT NULL default '0';[/code]
2.修改 /forumdisplay.php
找
[code]while(($querysticky && $thread = $db->fetch_array($querysticky)) || ($query && $thread = $db->fetch_array($query))) {[/code]
上面加
[code]$querya = $db->query("SELECT tid, filetype, attachment FROM {$tablepre}attachments ORDER BY aid");
while($attach = $db->fetch_array($querya)){
$attachtid[] = $attach['tid'];
$attachment[] = $attach['attachment'];
$attachtype[] = $attach['filetype'];
}[/code]
找到
[code]$threadlist[] = $thread;[/code]
上面加
[code]if($thread['attachment']){
foreach($attachtid as $key => $value){
if($thread['tid'] == $value){
if($isimage = preg_match("/^image\/.+/", $attachtype[$key])){
$thread['attach'] = $attachment[$key];
}
}
}
}
[/code]
3. 修改模板 templates\default\forumdisplay.htm (如果你使用的不是默認DZ風格請根據個人情况修改)
找到
[code]<a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>[/code]
替換為
[code]<!=========主題列表圖片附件即時預覽 D5.5================>
<!--{if $thread['displayorder'] == 1 || $thread['displayorder'] == 2 || $thread['displayorder'] == 3 }-->
<!--{if $thread['attach']}-->
<div id="showimage" style="position:absolute; visibility:hidden; border:1px"></div>
<a onMouseOver="return enlarge('attachments/$thread[attach]',event)" onMouseOut="closepreview()" style="cursor:hand" href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>
<!--{else}-->
<a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>
<!--{/if}-->
<!--{else}-->
<!--{if $forum['valueattach']}-->
<!--{if $thread['attach']}-->
<div id="showimage" style="position:absolute; visibility:hidden; border:1px"></div>
<a onMouseOver="return enlarge('attachments/$thread[attach]',event)" onMouseOut="closepreview()" style="cursor:hand" href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>
<!--{else}-->
<a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>
<!--{/if}-->
<!--{else}-->
<a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]>$thread[subject]</a>
<!--{/if}-->
<!--{/if}-->
<!==========主題列表圖片附件即時預覽 D5.5===============>[/code]
4. 修改 template/default/admincp.lang.php
找到
[code]'forums_edit_description_comment' => '將顯示於論壇名稱的下面,提供對本論壇的簡短描述',[/code]
後面添加
[code] 'forums_edit_valueattach' => '選擇是否使用附件圖片主題預覽功能:',
'forums_edit_valueattach_comment' => '在版塊每個主題上顯示附件圖片預覽。',[/code]
5. 修改 templates\default\header.htm (如果你使用的不是默認DZ風格請根據個人情况修改)
尋找
[code]<script type="text/javascript">var IMGDIR = '{IMGDIR}';var SMDIR = '{SMDIR}';</script>[/code]
加上
[code]<script type="text/javascript" src="include/javascript/showimage.js"></script>[/code]
6. 修改 admin/forums.inc.php
找
[code]showsetting('forums_edit_display', 'statusnew', $forum['status'], 'radio');[/code]
下面添加
[code]showsetting('forums_edit_valueattach', 'valueattachnew', $forum['valueattach'], 'radio');[/code]
找到
[code]password='$passwordnew',[/code]
後面添加 (注意前後有空格,不然會出錯)
[code]valueattach='$valueattachnew',[/code]
附:反安裝語句:=]
[code]ALTER TABLE cdb_forums DROP valueattach;
ALTER TABLE cdb_forumfields DROP valueattach;[/code]
2007-6-18 18:41
你看不見我
有沒有演示阿~?:em36:
2007-6-18 18:42
1224
[quote]原帖由 [i]你看不見我[/i] 於 2007-6-18 18:41 發表 [url=http://www.alan888.com/Discuz/redirect.php?goto=findpost&pid=961442&ptid=115304][img=13,13]http://www.alan888.com/Discuz/images/common/back.gif[/img][/url]
有沒有演示阿~?:em36: [/quote]
佢個壇可能有
2007-6-18 19:27
johntom
俾個演示黎睇下啦!
2007-6-19 01:14
kyo2003
多謝分享~~~
呢個是一個好的插件
2007-6-19 07:36
andylis93
感謝分享囉
謝謝你
2007-6-19 08:02
靈魂0
Support!!! :em32:
2007-6-19 11:23
tht
only十卜
2007-6-19 19:54
totoromehk
如要在attachicon上顯示而不在標題上顯示的話
演示: [url]http://bbs.kazeas.net/forum-28-1.html[/url]
修改forumdisplay.htm 時改為
找
[code]<img src="images/attachicons/common.gif" alt="{lang attachment}" />[/code]
改為
[code]<!=========主題列表圖片附件即時預覽 D5.5================>
<!--{if $thread['displayorder'] == 1 || $thread['displayorder'] == 2 || $thread['displayorder'] == 3 }-->
<!--{if $thread['attach']}-->
<div id="showimage" style="position:absolute; visibility:hidden; border:1px"></div>
<a onMouseOver="return enlarge('attachments/$thread[attach]',event)" onMouseOut="closepreview()" style="cursor:hand" href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]><img src="images/attachicons/image.gif" /></a>
<!--{else}-->
<img src="images/attachicons/common.gif" alt="{lang attachment}" />
<!--{/if}-->
<!--{else}-->
<!--{if $forum['valueattach']}-->
<!--{if $thread['attach']}-->
<div id="showimage" style="position:absolute; visibility:hidden; border:1px"></div>
<a onMouseOver="return enlarge('attachments/$thread[attach]',event)" onMouseOut="closepreview()" style="cursor:hand" href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]><img src="images/attachicons/image.gif" /></a>
<!--{else}-->
<img src="images/attachicons/common.gif" alt="{lang attachment}" />
<!--{/if}-->
<!--{else}-->
<img src="images/attachicons/common.gif" alt="{lang attachment}" />
<!--{/if}-->
<!--{/if}-->
<!==========主題列表圖片附件即時預覽 D5.5===============>[/code]
[[i] 本帖最後由 totoromehk 於 2007-6-19 19:56 編輯 [/i]]
2007-8-24 21:56
jefflou
唔得ge>?
2007-8-25 00:34
timipip2636
支持......我不用....先支持一下:em49:
2007-8-25 03:14
千之豬
支持支持:em32:
2007-8-25 04:29
Only〞葵♂
[以解決]
[[i] 本帖最後由 Only〞葵♂ 於 2007-9-2 05:56 編輯 [/i]]
2007-8-26 15:08
Only〞葵♂
有人知嗎?我摟上的問題 有人知道嗎?[以解決]
[[i] 本帖最後由 Only〞葵♂ 於 2007-9-2 05:56 編輯 [/i]]
2008-2-21 00:02
allen1126
請問我全照上面的安裝後,圖片出現X的樣子,無法顯示出來,是哪裡出問題??
頁:
[1]
Powered by Discuz! Archiver 5.5.0
© 2001-2006 Comsenz Inc.