PALMisLIFE 討論區

搜索
鹹魚爸魅力四射舞蹈教室
查看: 2400|回復: 0
打印 上一主題 下一主題

[Discuz! Hack]簡單觀看下載付件名單 for 2.0(繁體)

[複製鏈接]

139

主題

1

好友

783

積分

詹姆士‧阿喃

該用戶從未簽到

文章
555
跳轉到指定樓層
1#
發表於 2003-9-14 01:53 |只看該作者 |倒序瀏覽
適用版本: Discuz! 2.0 COML
作  者: auntieyi, AndyGod
修改文件: /attachment.php
修改模板: viewthread

  1. # (繁)
  2. # 在 系統設置面板 > 數據庫升級
  3. # 打上 SQL 語法 :

  4. ALTER TABLE `cdb_attachments` ADD `dl_users` TEXT NOT NULL ;

  5. # (1)
  6. # attachment.php
  7. # 在

  8. $discuz_action = 14;

  9. # 下一行加入

  10. if($action == "showdl" && $aid) {
  11.         $query = $db->query("SELECT dl_users FROM $table_attachments WHERE aid='$aid'");
  12.         $dl_users = $db->result($query, 0);
  13.         showmessage("下載名單:".$dl_users);
  14. }

  15. # 再找

  16. $db->query("UPDATE $table_attachments SET downloads=downloads+1 WHERE aid='$aid'");

  17. # 下一行加入

  18. // hack dl users by auntieyi
  19. $dl_user=$attach[dl_users]."\ ".$discuz_user.",";
  20. $db->query("UPDATE $table_attachments SET dl_users='$dl_user' WHERE aid='$aid'");

  21. # OK! Save attachment.php

  22. # (2)
  23. # 在 viewthread 模版
  24. # 找

  25. <!--{if $post['attachimg'] == 0}-->

  26. # 在適當的位置加入

  27. <a href="attachment.php?action=showdl&aid=$post[aaid]" target=new>[ 按此觀看下載名單 ]</a>

  28. # 完成了 ^^ 去 更新緩存 一次!
複製代碼
分享淘帖0 分享分享0 收藏收藏0 頂0 踩0
您需要登錄後才可以回帖 登錄 | 免費註冊

與站長聯繫| PALMisLIFE 掌上生活      下載:更快、更棒、更好玩

GMT+8, 2024-4-23 19:38 , Processed in 0.044788 second(s), 30 queries , Gzip On.

Powered by Discuz!

© 2001-2012 Comsenz Inc. style by eisdl

回頂部