- เครดิต
- 161
- เพื่อน
- ทักทาย
- บล็อก
- อัลบั้ม
- โพสต์
- กระทู้
- แชร์
- สำคัญ
- สิทธิ์อ่าน
- 10
- จำนวนผู้ติดตาม
- จำนวนผู้กำลังติดตาม
- เพศ
- ไม่บอก
|
แก้ไขล่าสุดโดย Saokim999 เมื่อ 2010-1-3 17:54
แก้ไขล่าสุดโดย Saokim999 เมื่อ 2010-1-3 17:52
Author yugiohhh - Discuz Viet Nam
Tested Discuz Version 7.2
Support Discuz Version 7.x
Source: http://dz.yugiohhh.com/yumods/me ... itedinthelastxhours
Demo: http://traitimyenbai.net/forum
Online Demo: http://thpthuongkhe.vn
This adds a simple display of all members who have visited the forum in the last X* hours.
* Option (you can edit in Config Zone)
Step 1: Open include/index_classics.inc.php or index.php (Discuz 7.0) (fixed version)
Find:- include template('discuz');
คัดลอกไปที่คลิปบอร์ด Add above (There are some configuration settings you can edit in Config Zone):- // Start - yugiohhh's Members who have visited in the last X hours - dz.yugiohhh.com
- // Start - Config zone (option)
- $yu_lasthours = 24; //last x hours
- $yu_maxlastxlist = 1000; // limit number of members listed
- $yu_boxtitle = 'Members who have visited in the last '.$yu_lasthours.' hours'; // title of visited box
- // End - Config zone (option)
- $yu_k = time() - ($yu_lasthours * 3600);
- $yu_wholastx = array();
- $yu_query = $db->query("SELECT s.uid, s.username, s.groupid, s.lastactivity, u.groupid, u.color FROM {$tablepre}members AS s, {$tablepre}usergroups AS u WHERE lastactivity >= ".$yu_k." AND s.groupid=u.groupid ORDER BY lastactivity DESC LIMIT ".$yu_maxlastxlist);
- while($yu_lastx = $db->fetch_array($yu_query)) {
- $yu_membercount ++;
- $yu_lastx['num'] = $yu_membercount;
- $yu_lastx['icon'] = isset($_DCACHE['onlinelist'][$yu_lastx['groupid']]) ? $_DCACHE['onlinelist'][$yu_lastx['groupid']] : $_DCACHE['onlinelist'][0];
- $yu_lastx['lastactivity'] = gmdate("$dateformat $timeformat", $yu_lastx['lastactivity'] + ($timeoffset * 3600));
- $yu_wholastx[] = $yu_lastx;
- }
- // End - yugiohhh's Members who have visited in the last X hours
คัดลอกไปที่คลิปบอร์ด Step 2: Open discuz.htm of your templates
Find:- $pluginhooks[index_bottom]
คัดลอกไปที่คลิปบอร์ด Add above:- <!-- Start - yugiohhh's Members who have visited in the last X hours - dz.yugiohhh.com --> <div class="mainbox list" id="online"> <span class="headactions"><img id="forumlinks_img" src="{IMGDIR}/$collapseimg[forumlinks].gif" alt="" onclick="toggle_collapse('yu_lasxlist');" /></span> <h3><strong><a href="http://dz.yugiohhh.com">$yu_boxtitle ({$yu_membercount})</a></strong></h3> <dl id="yu_lasxlist" style="padding: 1em; border-top: 1px solid {COMMONBORDER};"> <dd> <!--{if $yu_wholastx}--> <!--{loop $yu_wholastx $key $yu_lastx}--> <!--{if $yu_lastx['uid']}--> <a href="space.php?uid=$yu_lastx[uid]" target="_blank" title="{lang time}: $yu_lastx[lastactivity]{LF}"><img src="images/common/$yu_lastx['icon']" border="none"/> <font color=$yu_lastx[color]>$yu_lastx[username]</font></a><!--{if $yu_lastx['num'] < $yu_membercount}-->, <!--{/if}--> <!--{else}--> $yu_lastx[username] <!--{/if}--> <!--{/loop}--> <!--{else}--> Empty <!--{/if}--> </dd> </dl> </div> <!-- End - yugiohhh's Members who have visited in the last X hours - dz.yugiohhh.com -->
คัดลอกไปที่คลิปบอร์ด Final Step: Update cache!
Note: You can give me your Feedback, Comments & Suggestions about my products here
http://traitimyenbai.net/forum/viewthread.php?tid=33295 or http://dz.yugiohhh.com/home/contact |
คะแนน
-
ดูบันทึกคะแนน
|
|
|
|
|
|