Posted on Tuesday 10th June 2008 at 06:33 PM | |
Adam981 Junior Member |
Looking to display if a user is online or offline in there profile like we have here at RMB |
Posted on Wednesday 11th June 2008 at 11:29 AM | |
ilyas-shezad Junior Member |
Okay this is oging to take some looking at the RMB user system... 1 second Its because i dnot use the member system and the db etc is different to mine. |
Posted on Wednesday 11th June 2008 at 11:42 AM | |
ilyas-shezad Junior Member |
Okay on your database run this SQL query... Code ALTER TABLE `members` ADD `online` VARCHAR( 25 ) NOT NULL AFTER `lastonline` ; then when in your login.php script when your processing th form and after the $_SESSION have been set put this in... PHP Code
1 2 3
$timestamp= time();
now on the profile page some where on the page put... PHP Code
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
Well that should work... phew i shoulda made it a tutorial... Oh well, anyway tell e if the code works for you i just made it right now lol but im pretty sure it'll work if you do it right. |
Posted on Wednesday 11th June 2008 at 11:47 AM | |
ilyas-shezad Junior Member |
forgot to mention that you will need to add PHP Code
1 2 3 4 5
<?
to config.php so that the suers online status is always updated and not just when he logs in. |
Posted on Wednesday 11th June 2008 at 12:58 PM | |
ilyas-shezad Junior Member |
p.s. this one is just a test... |
Posted on Wednesday 11th June 2008 at 03:38 PM | |
Adam981 Junior Member |
Erm when im loged in it displays "no" |
Posted on Wednesday 11th June 2008 at 03:42 PM | |
ilyas-shezad Junior Member |
try changing... PHP Code
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
to PHP Code
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
|
Posted on Wednesday 11th June 2008 at 03:43 PM | |
Adam981 Junior Member |
I'm thinking maybe im doing the $varusername= wrong? |
Posted on Wednesday 11th June 2008 at 03:45 PM | |
Adam981 Junior Member |
Now it keeps saying im online when im not |
Posted on Wednesday 11th June 2008 at 03:52 PM | |
Adam981 Junior Member |
maybe the tutorial display users online is messing it up? because i use that also |