shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 do you both have an IRC client such as mIRC? Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237553 Share on other sites More sharing options...
MadTechie Posted April 24, 2007 Share Posted April 24, 2007 na, would be easier if i did Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237554 Share on other sites More sharing options...
shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 dload it mirc.com Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237555 Share on other sites More sharing options...
alohatofu Posted April 24, 2007 Author Share Posted April 24, 2007 this is so much easier working directly ok updated (again) <?php $id = $_SESSION['tznUserId']; $time=time(); $timeout=time()+(60*60); #now+1hour mysql_query("UPDATE `surv_member` SET timestamp='$timeout' WHERE memberId='$id' LIMIT 1"); $query=mysql_query("SELECT * FROM `surv_member` WHERE `timestamp`>='$time'") or die(mysql_error()); $display = array(); while($row=mysql_fetch_array($query)) { $display[] = $row['username']; } //spit out the results mysql_close(); foreach($display as $d) { print "$d<br />"; } ?> Still did not output any message =/ btw. I appreciate it Shaun and TEchie Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237556 Share on other sites More sharing options...
alohatofu Posted April 24, 2007 Author Share Posted April 24, 2007 do you both have an IRC client such as mIRC? I have GAIM which can handle irc Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237558 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 join #php-coding on irc.freenode.net Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237559 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 madtech u dloadin mIRC? Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237560 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 ok na don't use mIRC or any IRc's <?php $id = $_SESSION['tznUserId']; mysql_query("UPDATE `surv_member` SET timestamp=NOW() WHERE memberId='$id' LIMIT 1"); $query=mysql_query("SELECT * FROM `surv_member` WHERE (`timestamp`+60*60) >= NOW()") or die(mysql_error()); $display = array(); while($row=mysql_fetch_array($query)) { $display[] = $row['username']; } //spit out the results mysql_close(); foreach($display as $d) { print "$d<br />"; } ?> Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237572 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 Holy crap!! Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237578 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 After all of that lol, please rem,ember to set your thread as resolved, TA Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237580 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 Thank you so much guys!! AWSOME! it's like magic Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237583 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 i had to re-work the dates, they can be a pain sometimes Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237584 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 ok 1:21am i'm out night i hope its truly working. Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237588 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 yes it's working!!! btw, I don't need the online and timestamp column righgt? Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237590 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 Ok, when I logged out it's still showing my username =/ Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237593 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 correct, runs by time alone if they are inactive for an hour then they are off the list, $query=mysql_query("SELECT * FROM `surv_member` WHERE (`timestamp`+60*60) >= NOW()") or die(mysql_error()); change (`timestamp`+60*60) to (`timestamp`+30*60) for 30 minutes etc Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237596 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 cool. that will work. thanks Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237597 Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 Oh this is used for active members for in the last hour, if you want then to be removed from the list on logout add this to the logout $id = $_SESSION['tznUserId']; mysql_query("UPDATE `surv_member` SET timestamp=NOW() WHERE memberId='$id' LIMIT 1"); Oh this would work better <?php $query=mysql_query("SELECT * FROM `surv_member` WHERE `timestamp` <= (NOW()-60*60)") or die(mysql_error()); ?> OK well i am drained, i need sleep, catch ya later Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-237602 Share on other sites More sharing options...
otuatail Posted April 25, 2007 Share Posted April 25, 2007 this means then that you have not got a field in your table surv_member called 'timestamp' don't forget case sensitive. In phpmyadmin there is an export button on the top click this and click the bottom button Go. You will have the text for creating the database table. show it to us. Desmond. Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-238037 Share on other sites More sharing options...
alohatofu Posted April 25, 2007 Author Share Posted April 25, 2007 This issue is resolved thanks Link to comment https://forums.phpfreaks.com/topic/48444-solved-show-users-online/page/4/#findComment-238043 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.