gosox116 Posted January 3, 2010 Report Share Posted January 3, 2010 I pasted the following code into my template for my homepage (www.swava.net), but it says 0 guests and 0 users, even when I'm logged in. Is there something else I need other than this? I'm using a template I built from scratch. <h1>Users Online</h1> <p><i>There have been <?php echo count($usersonline)?> user(s), and <?php echo count($guestsonline);?> guest(s) online in the past <?php echo Config::Get('USERS_ONLINE_TIME')?> minutes.</i></p> <?php /* $usersonline also has the list of users - really simple example Or if you're not on the frontpage: $usersonline = StatsData::UsersOnline(); foreach($usersonline as $pilot) { echo "{$pilot->firstname} {$pilot->lastname}<br />"; } */ ?> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 3, 2010 Administrators Report Share Posted January 3, 2010 You need to add this to the top of your template: $usersonline = StatsData::UsersOnline(); $guestsonline = StatsData::GuestsOnline(); Quote Link to comment Share on other sites More sharing options...
gosox116 Posted January 4, 2010 Author Report Share Posted January 4, 2010 Add that code at the top of my header.tpl? Where exactly? Thanks! Quote Link to comment Share on other sites More sharing options...
gosox116 Posted January 4, 2010 Author Report Share Posted January 4, 2010 Never mind, I figured it out. Is there a way to see the list of IP's? It seems to be adding more guests every time i refresh the page. Is there a way to limit one user showing up per IP? Thanks! Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 4, 2010 Administrators Report Share Posted January 4, 2010 If you look in the database, you'll see them Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.