列印

主題列表圖片附件即時預覽 FOR6.0

主題列表圖片附件即時預覽 FOR6.0

作者肯得基
修改袭月弄影
1.後台升級數據庫
複製內容到剪貼簿
代碼:
ALTER TABLE cdb_forums ADD valueattach tinyint(1) NOT NULL default '0';
ALTER TABLE cdb_forumfields ADD valueattach tinyint(1) NOT NULL default '0';
2.修改 /forumdisplay.php
複製內容到剪貼簿
代碼:
while(($querysticky && $thread = $db->fetch_array($querysticky)) || ($query && $thread = $db->fetch_array($query)) || ($queryfloat && $thread = $db->fetch_array($queryfloat))) {
上面加
複製內容到剪貼簿
代碼:
$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'];
}
找:
複製內容到剪貼簿
代碼:
$threadlist[] = $thread;
上面加:
複製內容到剪貼簿
代碼:
if($thread['attachment']){
foreach($attachtid as $key => $value){
if($thread['tid'] == $value){
if($isimage = preg_match("/^image\/.+/", $attachtype[$key])){
$thread['attach'] = $attachment[$key];
}
}
}
}
3. 修改模板 templates\default\forumdisplay.htm  (如果你使用的不是默認DZ風格請根據個人情況修改)
找到
複製內容到剪貼簿
代碼:
<a href="viewthread.php?tid=$thread[tid]&amp;extra=$extra"$thread[highlight]>$thread[subject]</a>
替換為:
複製內容到剪貼簿
代碼:
<!=========主題列表圖片附件即時預覽 D6.0 開始================>
<!--{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}-->
<!==========主題列表圖片附件即時預覽 D6.0 結束===============>
4. 修改 template/default/admincp.lang.php
找到
複製內容到剪貼簿
代碼:
'forums_edit_description_comment' => '將顯示於版塊名稱的下面,提供對本版塊的簡短描述',
下面添加:
複製內容到剪貼簿
代碼:
'forums_edit_valueattach' => '選擇是否使用附件圖片主題預覽功能:',
'forums_edit_valueattach_comment' => '在版塊每個主題上顯示附件圖片預覽。',
5. 修改 templates\default\header.htm (如果你使用的不是默認DZ風格請根據個人情況修改)
尋找
複製內容到剪貼簿
代碼:
<script type="text/javascript" src="include/javascript/ajax.js"></script>
下面添加:
複製內容到剪貼簿
代碼:
<script type="text/javascript" src="include/javascript/showimage.js"></script>
6. 修改 admin/forums.inc.php
複製內容到剪貼簿
代碼:
showsetting('forums_edit_display', 'statusnew', $forum['status'], 'radio');
下面添加:
複製內容到剪貼簿
代碼:
showsetting('forums_edit_valueattach', 'valueattachnew', $forum['valueattach'], 'radio');
找到:
複製內容到剪貼簿
代碼:
password='$passwordnew',
後面添加(注意前後有空格,不然會出錯):
複製內容到剪貼簿
代碼:
valueattach='$valueattachnew',
附:反安裝語句:
複製內容到剪貼簿
代碼:
ALTER TABLE cdb_forums DROP valueattach;
ALTER TABLE cdb_forumfields DROP valueattach;


[ 本帖最後由 kazo 於 2007-9-27 09:05 PM 編輯 ]
附件: 您所在的用戶組無法下載或查看附件
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

沒演示喔



Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

剛還沒弄好= =

修正好了
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

主題列表圖片附件即時預覽

安裝完畢! 不知道功能是什麼? 沒演示
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

演示:http://myth.servegame.com

論壇規章

[ 本帖最後由 kazo 於 2007-11-28 12:39 AM 編輯 ]
神話戰場娛樂論壇
http://myth.servegame.com
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

js under FF not work ...pls fix it
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

回覆 6# totoromehk 的帖子

此插件不錯唷
都不用進帖看附件的圖
就可以直接外面滑鼠點看主題跳出附件第一張秀圖了
謝謝分享
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP

回覆 1# kazo 的帖子

謝謝大大的 分享
此插件用了後移除
很不好用.....>"<
圖片有的是因為主題名稱過多
而顯示時會一閃一閃的
就連反安裝的語句怪怪
複製內容到剪貼簿
代碼:
ALTER TABLE cdb_forums DROP valueattach;
ALTER TABLE cdb_forumfields DROP valueattach;
哪裡怪:就是反安裝完了
再進去後台的論壇管理→編輯論壇→隨便進去一區
還是可以看得到可選項"是"或"否"
複製內容到剪貼簿
代碼:
'forums_edit_valueattach' => '選擇是否使用附件圖片主題預覽功能:',
'forums_edit_valueattach_comment' => '在版塊每個主題上顯示附件圖片預覽。',
>"<請各位大大幫忙
我做插件前都會先再備份一個複製檔
就算我把沒改的那個檔放回去
一樣還在
Linux0911 Forum © 2004-2009 All Rights Reserved.

TOP



論壇聲明
  • 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
    如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
    請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!
最佳瀏覽解析度:不低於 1024 (最佳 1280 以上).(支援 IE 7, Mozilla Firefox, Safari, Chrome)
The Best Surfing Resolution: No Lower than 1024 (Best: above 1280).(IE 7, Mozilla Firefox, Safari, Chrome Supported)