Easy digg for discuz 6.0
Author: LuciferShengVersion: 3.0
Technical support: lucifersheng + easydigg gmail.com
Demonstration site: http://www.vfans.cn
เป็น mod เพิ่มออปชั่นการให้คะแนนอีกรูปแบบนึง
สามารถเรียงกระทู้ตามลำดับคะแนนได้
เครดิต : คุณเกิ้ลฝากผมมาปล่อยงับ ~(25)~
อัพโหลดไฟล์ขึ้นโฮสตามที่อยู่ ไฟล์รูปก้อเอาไว้ใน images
ก่อนอื่นเลยต้องทำการ
Add Table dis_diggCREATE TABLE `dis_digg` (
`tid` MEDIUMINT( 8 ) NOT NULL ,
`uid` MEDIUMINT( 8 ) NOT NULL ,
`time` INT( 10 ) NOT NULL
) ENGINE = MYISAM ;Add a field dis_threads
ALTER TABLE `dis_threads` ADD `digg` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `dis_threads` ADD `digg_d` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `dis_threads` ADD `digg_w` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `dis_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
เพิ่มไป/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Easy Digg ~~~~ */
.digBtn{ display:block;width:50px;height:65px;text-align:center;background: url('{IMGDIR}/digg_bg.gif') 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;}
.shareButton {background:url('{IMGDIR}/share.gif') no-repeat 5px 0;height:65px;width:80px;float: right;margin: 10px;}
.shareButton a {display:block;width:65px;padding-top:50px;margin-left:20px;color:#000;text-decoration:none;}
.shareButton a:hover{color:#000;text-decoration:underline;}viewthread.htm
ค้นหา<div id="ad_thread3_$post"></div><div id="ad_thread4_$post"></div>เพิ่ม<!--{if $post == 1}-->
<!--{if (!in_array($fid, $nodiggfid))}-->
<!--{if $easydigg['shareFriend']}-->
<div class="shareButton" id="share" style="display:none"><a href="misc.php?action=emailfriend&tid=$tid" id="emailfriend" onclick="ajaxmenu(event, this.id, 9000000, null, 0)">share with friends</a></div>
<!--{else}-->
<div id="share" style="display:none"></div>
<!--{/if}-->
<div id="digg" class="digBtn"><div onclick='easydigg("action=diggit&tid=$tid", $thread, "digg", "$tid")'><strong>$thread</strong><span>Top it< /span></div></div>
<!--{/if}-->
<!--{/if}-->viewthread.php
ค้นหาrequire_once './include/common.inc.php';
require_once DISCUZ_ROOT.'./include/forum.func.php';เพิ่มrequire_once './forumdata/cache/plugin_easydigg.php';
$easydigg = $_DPLUGIN['easydigg']['vars'];
$nodiggfid = explode(',', $easydigg['noShowFid']);include/moderation.inc.php
ค้นหาforeach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debates', 'videos', 'debateposts', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars', 'forumrecommend') as $value) {แก้เป็นforeach(array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'debates', 'videos', 'debateposts', 'attachments', 'favorites', 'mythreads', 'myposts', 'subscriptions', 'typeoptionvars', 'forumrecommend', 'digg') as $value) {forumdisplay.htm
ค้นหา<option value="views" $check>{lang order_views}</option>เพิ่ม<option value="digg" $check>ได้รับการ Vote สูงสุด</option>
<option value="digg_d" $check>ได้รับการ Vote สูงสุดในวันนี้</option>
<option value="digg_w" $check>ได้รับการ Vote สูงสุดในสัปดาห์นี้</option>
<option value="digg_m" $check>ได้รับการ Vote สูงสุดในเดือนนี้</option>forumdisplay.php
ค้นหาisset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $_DCACHE['forums'][$fid]['orderby'] ? $_DCACHE['forums'][$fid]['orderby'] : 'lastpost';แก้เป็นisset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views', 'digg', 'digg_d', 'digg_w', 'digg_m')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $_DCACHE['forums'][$fid]['orderby'] ? $_DCACHE['forums'][$fid]['orderby'] : 'lastpost';stat.php
ค้นหา$threadview = $threadreply = array();แก้เป็น$threadview = $threadreply = $threaddigg = array();ค้นหา$query = $db->query("SELECT replies, tid, subject FROM {$tablepre}threads WHERE displayorder>='0' ORDER BY replies DESC LIMIT 0, 20");
while($thread = $db->fetch_array($query)) {
$thread['subject'] = cutstr($thread['subject'], 50);
$threadreply[] = $thread;
}เพิ่ม// easy digg
$query = $db->query("SELECT digg, tid, subject FROM {$tablepre}threads WHERE displayorder>='0' ORDER BY digg DESC LIMIT 0, 20");
while($thread = $db->fetch_array($query)) {
$thread['subject'] = cutstr($thread['subject'], 45);
$threaddigg[] = $thread;
}
//ค้นหา"<td><a href=\"viewthread.php?tid={$threadreply[$i]['tid']}\">{$threadreply[$i]['subject']}</a><td align=\"right\">{$threadreply[$i]['replies']}</td></tr>\n";แก้เป็น"<td><a href=\"viewthread.php?tid={$threadreply[$i]['tid']}\">{$threadreply[$i]['subject']}</a><td align=\"right\">{$threadreply[$i]['replies']}</td>\n".
"<td><a href=\"viewthread.php?tid={$threaddigg[$i]['tid']}\">{$threaddigg[$i]['subject']}</a></td><td align=\"right\">{$threaddigg[$i]['digg']}</td></tr>\n";stat_misc.htm
ค้นหา<td colspan="2">{lang stats_threads_most_views}</td>
<td colspan="2">{lang stats_threads_most_replies}</td>เพิ่ม<td colspan="2">ได้รับการ Vote สูงสุด</td>อัพเดทแคชแล้วใช้งานดู
[ แก้ไขล่าสุด buachompoox เมื่อ 2008-5-23 02:52 ] ขอบคุณครับแต่ว่าCREATE TABLE `dis_digg` (
`tid` MEDIUMINT( 8 ) NOT NULL ,
`uid` MEDIUMINT( 8 ) NOT NULL ,
`time` INT( 10 ) NOT NULL
) ENGINE = MYISAM โค้ดนี้ไส่ที่ไหนหรอครับ อิมพอร์ตเข้าฐานข้อมูลครับ เข้า SQL ใช่ไหมครับ MOD เสร็ดเรียบร้อยทุกขั้นตอน ขอบคุณมากๆครับ (ต้องแก้เองนิดหน่อยนะ):victory: ต้นฉบับโพสโดย WhiteHack เมื่อ 2008-5-28 12:23 http://cazdesign.com/forums/images/common/back.gif
MOD เสร็ดเรียบร้อยทุกขั้นตอน ขอบคุณมากๆครับ (ต้องแก้เองนิดหน่อยนะ):victory:
เอ่อ แก้ตรงไหนหรอครับ
ของผมไม่ขึ้น
T^T ผมเพิ่มตาราง Table dis_diggเสร็จเรียบร้อยแล้ว
แต่ผมไม่รู้ในการทำตรงนี้ โค๊ดด้านล่างเอาไปเพิ่มที่ส่วนไหนอย่างไรครับ
ALTER TABLE `dis_threads` ADD `digg` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `dis_threads` ADD `digg_d` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `dis_threads` ADD `digg_w` MEDIUMINT( 8 ) NOT NULL ;
ALTER TABLE `dis_threads` ADD `digg_m` MEDIUMINT( 8 ) NOT NULL ;
ต้องทำอย่างไรครับ
ผมไม่รู้จริงๆๆ ช่วยด้วยครับ
ขอบคุณครับ ที่เดียวกันอะครับ ได้แล้วครับ
ขอบคุณครับ
[ แก้ไขล่าสุด oom เมื่อ 2008-8-27 09:46 ]
หน้า:
[1]