Easy Digg 完整版
http://www.discuz.net/thread-728565-1-1.html
Easy Digg
作 者:LuciferSheng
版 本:2.0 完整版
最後更新:20070831
技術支持:lucifersheng+easydigg[at]gmail.com
演示網站:http://www.vfans.cn
二樓為可選安裝內容
三樓為更新記錄
本插件使用ajax技術可以作為論壇評分功能的補充,也可以單獨試用。簡單的說就是「我頂」 「我挖」之類的
後台記錄每位用戶所頂的文章和時間,每位用戶對於每篇文章只能頂一次。
在firefox 2和ie 6之下通過測試。
更新歷史
精簡了程序代碼
將主體代碼分離,製作獨立文件
添加了頂過之後查看最近五位頂過本帖的用戶的功能
安裝說明
請確認你需要本插件之後再進行安裝。
本插件涉及數據庫的修改和多個文件的更改,請謹慎修改。
如因安裝錯誤、使用不當或者插件本身缺陷而造成的一切損失,責任由使用者自行承擔,插件作者概不負責。
上次的精簡版(http://www.discuz.net/viewthread.php?tid=712067)的安裝被很多人說複雜,這次改進了,主要文件全部獨立出來,方便大家安裝。
修改文件/數據庫
新增文件:easydigg_ajax.php easydigg.js easydigg_daily.inc.php easydigg_weekly.inc.php easydigg_monthly.inc.php
需要修改的模板:viewthread.htm css.htm header.htm
添加數據表cdb_digg,在cdb_threads添加4個新字段
添加表 cdb_diggCREATE TABLE `cdb_digg` (
`tid` MEDIUMINT( 8 ) NOT NULL ,
`uid` MEDIUMINT( 8 ) NOT NULL ,
`time` INT( 10 ) NOT NULL
) ENGINE = MYISAM ;[/sql]
cdb_threads添加字段
[sql]ALTER TABLE `cdb_threads` ADD `digg` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `cdb_threads` ADD `digg_d` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `cdb_threads` ADD `digg_w` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `cdb_threads` ADD `digg_m` MEDIUMINT( 8 ) NOT NULL ; 修改模板
header.htm
查找<script type="text/javascript" src="include/javascript/ajax.js"></script> 添加<script type="text/javascript" src="include/javascript/easydigg.js"></script> css.htm
修改完記得更新css緩存
末尾添加/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Easy Digg ~~~~ */
.digBtn{ display:block;width:50px;height:65px;text-align:center;background: url(上傳的附件圖片的地址) no-repeat center 0;float: right;margin: 10px;cursor: hand;}
.digBtn strong{ color:#fff;font-family:Georgia;font-size:16px;padding:3px 1px 0 0;height:45px;clear:both;display:block;text-shadow:1px 1px 3px #fff;font-weight: bold;}
.digBtn a {text-decoration:none !important;}
.digBtn a span{color:#f60;border-bottom:1px solid #f60;}viewthread.htm
查找<div id="ad_thread3_$post[count]"></div><div id="ad_thread4_$post[count]"></div> 添加 <!--{if $post[number] == 1}-->
<div id="digg" class="digBtn" onclick='easydigg("action=diggit&tid=$tid", $thread[digg], "digg", "$tid")'><strong>$thread[digg]</strong><span>頂它< /span></div>
<!--{/if}-->include/moderation.inc.php
修改此文件是為了刪除文章時同時刪除該貼的digg記錄
查找 foreach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debates', 'videos', 'debateposts', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars') as $value) {修改為 foreach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debates', 'videos', 'debateposts', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars', 'digg') as $value) {後台添加三個計劃任務,執行時間如下
easydigg_daily.inc.php 執行時間:每日零點
easydigg_weekly.inc.php 執行時間:每週日零點
easydigg_monthly.inc.php 執行時間:每月一日零點
 |