######################################################## ## ## Hack Title: Today's Active Users ## Hack Version: 1.0.0 ## Author: Christoph "Toxic" Hellings (toxic@freenet.de) ## Date Created: 09-03-02 ## Thread Location: http://www.tforumhacks.com/tforum/viewtopic.php?TopicID=1092 ## Working Example: ## Description: Below "Active Users" a line "Today's active users" is added ## ## ## Installation Level: Easy ## Installation Time: 5 Minutes ## Files To Edit: 4 ## Edit Database: no ## Included Files: none ## ######################################################## ## ## Installation/Author Notes: ## ## I think it works but no warranty... ## ######################################################## # #-----[ ACTION: BACKUP ]------------------------------------------ # Every time you edit your files, you should always back them up first. Although all of these hacks have been tested on various systems, they may not work with your configuration or you may not like what it does. Backing up protects yourself and your users from downtime. # #-----[ ACTION: OPEN ]------------------------------------------- # functions.php # #-----[ ACTION: ADD ]-------------------------------------------- # function GrabTodayActiveList() { global $txt; $limit = mktime(0,0,0,date("m",time()),date("d",time()),date("Y",time())); $query = "SELECT UserName FROM t_users WHERE LastActive > $limit order by UserName ASC"; $result = mysql_query($query); $UserList = ""; if ($row = mysql_fetch_array($result)) { do { if ($UserList != '') $UserList .= ', '; $UserList .= "".htmlspecialchars($row["UserName"]).""; }while ($row = mysql_fetch_array($result)); } else $UserList = 0; return $UserList; } # #-----[ ACTION: OPEN ]------------------------------------------- # index.php # #-----[ ACTION: FIND ]------------------------------------------- # $ent["UsersActive"] = $ActiveUsers['Users']; # #-----[ ACTION: ADD AFTER ]-------------------------------------- # $ent["UsersActiveToday"] = GrabTodayActiveList(); # #-----[ ACTION: OPEN ]------------------------------------------- # templates/index.html # #-----[ ACTION: FIND ]------------------------------------------- # : # #-----[ ACTION: ADD AFTER ]-------------------------------------- #
: # #-----[ ACTION: OPEN ]------------------------------------------- # english_lg.php # #-----[ ACTION: ADD ]-------------------------------------------- # $txt['numUsersToday'] = "Users Active Today"; # #-----[ ACTION: SAVE & UPLOAD ]----------------------------------- # functions.php index.php index.html english_lg.php # #----------------------------------------------------------------- # EOF