แสดงรายชื่อสมาชิกที่ดาวน์โหลดไฟล์ในกระดานข่าวเรา
pole1010ตัวอย่างครับ
วิธีการ mod
1.นำเข้าฐานข้อมูล เครื่องมือ >> ฐานข้อมูล >> รันคิวรี่
**** Hidden Message *****
2.เปิดไฟล์ {bbs}/attachment.php
ค้นหา$db->query("UPDATE {$tablepre}attachments SET downloads=downloads+'1' WHERE aid='$aid'", 'UNBUFFERED');แทนที่ด้วย $query2 = $db->query("SELECT dl_users FROM {$tablepre}attachments WHERE aid='$aid' AND dl_users like '%$discuz_user,%'");
if($db->result($query2, 0)) {
} else {
$db->query("UPDATE {$tablepre}attachments SET downloads=downloads+1 WHERE aid='$aid'", 'UNBUFFERED');
$dl_user = $attach.''.$discuz_user.', ';
$dl_user = addslashes($dl_user);
$db->query("UPDATE {$tablepre}attachments SET dl_users='$dl_user' WHERE aid='$aid'");
}3.เปิดไฟล์ {bbs}/misc.php
ค้นหา} elseif($action == 'customtopics') {เพิ่มโค๊ดนี้ด้านบน} elseif($action == 'viewdluser') {
if(empty($forum['allowview'])) {
if(!$forum['viewperm'] && !$readaccess) {
showmessage('group_nopermission', NULL, 'NOPERM');
} elseif($forum['viewperm'] && !forumperm($forum['viewperm'])) {
showmessage('forum_nopermission', NULL, 'NOPERM');
}
}
if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
showmessage('thread_nopermission', NULL, 'NOPERM');
}
if($forum['password'] && $forum['password'] != $_DCOOKIE['fidpw'.$fid]) {
dheader("Location: {$boardurl}forumdisplay.php?fid=$fid&sid=$sid");
}
$dllistpp = 180; //每頁顯示名單數量
$page = $_GET['page'];
$dl_user = '';
$query = $db->query("SELECT dl_users FROM {$tablepre}attachments WHERE tid=$tid AND aid='$aid'");
$dl_user = $db->result($query, 0);
$dlusername = explode(",", trim($dl_user));
$num = count($dlusername)-1;
$page = max(1, intval($page));
$start_limit = ($page - 1) * $dllistpp;
$multipage = multi($num, $dllistpp, $page, "misc.php?action=viewdluser&tid=$tid&aid=$aid");
$dlusername = @array_slice($dlusername, $start_limit, $dllistpp);
if($dlusername) {
$dllist = $dlid = array();
foreach($dlusername as $dlid) {
$dlid = '<a href="space.php?action=viewpro&username='.rawurlencode(trim($dlid)).'" target="_blank">'.$dlid.'</a>';
$dllist[] = $dlid;
}
}
include template('dluserlist');4.เปิดไฟล์{bbs}/templates/default/discuzcode.htm
ค้นหา<dl class="t_attachlist">เพิ่มโค๊ดนี้ด้านบน<script type="text/javascript">
function showdllist(aid) {
var obj = document.getElementById('viewdluserframe'+aid);
var url = 'misc.php?action=viewdluser&tid=$attach&aid='+aid;
showframe(obj, url);
}
function showframe(obj, url) {
if(!obj.innerHTML) {
obj.innerHTML = '<iframe width="100%" align="center" height="30" onload="setframeheight(this)" frameborder="0" scrolling="no" src="'+url+'"></iframe>';
}
if(obj.innerHTML) {
obj.style.display = obj.style.display == '' ? 'none' : '';
}
}
function setframeheight(obj) {
obj.height = obj.contentDocument ? obj.contentDocument.body.scrollHeight + 14 : obj.Document.body.scrollHeight;
}
</script>ค้นหา (เจออันที่ 1) <p>{lang downloads}:$attach</p>
<p>$attach</p>เพิ่มโค๊ดนี้ต่อไป <!--{if$attach > 0}-->
<a href="###" onclick="showdllist($attach)"><span style="color:{LIGHTTEXT}; font-weight:normal">[รายชื่อดาวน์โหลด]</span></a>
<!--{/if}-->ค้นหา (เจออันที่ 2) <p>{lang downloads}:$attach</p>
<p>$attach</p>เพิ่มโค๊ดนี้ต่อไป <!--{if$attach > 0}-->
<a href="###" onclick="showdllist($attach)"><span style="color:{LIGHTTEXT}; font-weight:normal">[รายชื่อดาวน์โหลด]</span></a>
<!--{/if}-->ค้นหา <!--{if $attach['description']}--><p>{$attach}</p><!--{/if}-->
</dd>
<!--{/if}-->
</dl>เพิ่มโค๊ดนี้ด้านล่าง<div id="viewdluserframe$attach" style="width:100%;clear:both;display:none; margin-top:5;"></div>5.ดาวน์โหลดไฟล์ แล้วนำไปไว้ที่ {bbs}/templates/default/
6.Update Cache เรียบร้อย ขอบคุณครับเดี๋ยวจะลองเอาไปใช้ ผลที่ได้ยังไงจะมาบอกทีหลังนะ {:18_772:} ขอบคุณมากอะครับ
เก่งมากเลยหาสิ่งใหม่ๆ
มาแบ่งปันตลอด เยี่ยมคับ ขอบคุณครับ 1# theerawut
thanks รับไปใช้หน่อยนะนายแบงค์ ขอบคุณสำหรับสิ่งดีๆครับ ขอบคุณครับผม เจ๋งค่ะ ขอบคุณ...^^ -ขอบคุณครับ