## ## ## Mod title: Members on line today ## ## Mod version: 1.1 ## Works on PunBB: All 1.2 Versions ## Release date: Released on PunRes.org on 6/09/2006 ## Author: Vincent Garnier a.k.a. vin100 (vin100@forx.fr) ## ## Description: This MOD makes it possible to post the lists of the members who connected themselves to the forums during the day. ## ## Affected files: Index.php ## lang/english/index.php ## style/imports/base.css ## ## Affects DB: No ## ## Notes: No Notes ## ## DISCLAIMER: Please note that "mods" are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ## ## ## # #-------------[ 2. Open File ]---------------- # Index.php # #-------------[ 3. Find (line: ~192)]---- # $num_users = count($users); # #-------------[ 4. Add After ]---------------- # // users on line today $date = getdate(time()); $todaystamp = mktime(0,0,0, $date['mon'], $date['mday'], $date['year']); $result = $db->query("SELECT username, id, last_visit from ".$db->prefix."users WHERE last_visit >= '".$todaystamp."' ORDER by last_visit DESC") or error("Impossible de retrouver la liste des utilisateurs en ligne aujourd'hui", __FILE__, __LINE__, $db->error()); $users_today = array(); while ($pun_user_online_today = $db->fetch_assoc($result)) $users_today[] .= "\n\t\t\t\t".'
'.$pun_user_online_today['username'].''; $num_users_today = count($users_today); # #-------------[ 5. Find (line: ~193)]---- # echo "\t\t\t\t".'
'. $lang_index['Users online'].': '.$num_users.'
'."\n\t\t\t\t".'
'.$lang_index['Guests online'].': '.$num_guests.'
'."\n\t\t\t".''."\n"; # #-------------[ 6. Replace With ]-------------- # echo "\t\t\t\t".'
'. $lang_index['Users online'].': '.$num_users.'
'."\n\t\t\t\t".'
'.$lang_index['Users today'].': '.$num_users_today.'
'."\n\t\t\t\t".'
'.$lang_index['Guests online'].': '.$num_guests.'
'."\n\t\t\t".''."\n"; # #-------------[ 7. Find (line: ~196-199)]---- # if ($num_users > 0) echo "\t\t\t".'
'."\n\t\t\t\t".'
'.$lang_index['Online'].': 
'."\t\t\t\t".implode(', ', $users).''."\n\t\t\t".'
'."\n"; else echo "\t\t\t".'
'."\n"; # #-------------[ 8. Add After ]---------------- # // list users on line today echo "\t\t\t".'
'."\n\t\t\t\t".'
'.$lang_index['Online today'].':
'; if ($num_users_today > 0) echo implode(', ', $users_today).''."\n\t\t\t".'
'."\n"; else echo '
'."\n\t\t\t".''."\n"; # #-------------[ 9. Open File ]---------------- # style/imports/base.css # #-------------[ 10. Find (line: ~223)]---- # #onlinelist DD, #onlinelist DT, #brdmenu LI, DIV.linkst LI, DIV.linksb LI, DIV.postlinksb LI, DIV.postfootright LI, UL.bblinks LI { DISPLAY: inline; HEIGHT: 0 } # #-------------[ 11. Replace With ]-------------- # #onlinelist DD, #onlinelist DT, #onlinetodaylist DD, #onlinetodaylist DT, #brdmenu LI, DIV.linkst LI, DIV.linksb LI, DIV.postlinksb LI, DIV.postfootright LI, UL.bblinks LI { DISPLAY: inline; HEIGHT: 0 } # #-------------[ 12. Open File ]---------------- # lang/english/index.php # #-------------[ 13. Find (line: ~4)]---- # $lang_index = array( # #-------------[ 14. Add After ]---------------- # 'Online today' => 'Online today', 'Users today' => 'Registered users today', # #-------------[ 15. Run ]----------------------- #