Mời bạn đăng ký để giao lưu kết bạn nhé <3
Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký
x
Original Post: http://dz.yugiohhh.com/yumods/memberswhohavevisitedinthelastxhours
Online Demo: http://thpthuongkhe.vn
Note: You can give me your Feedback, Comments & Suggestions about my products here
| Author | yugiohhh | | Tested Discuz Version | 7.x | | Support Discuz Version | 7.x |
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');
Sao chép mã
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
Sao chép mã
Step 2: Open discuz.htm of your templates
Find:
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 -->
Sao chép mã |