UBB.Dev
Posted By: Soul Survivor Online/Offline mod assistance - 01/07/2002 9:24 AM
I had seen an Online/Offline indicator next to users posts on some older boards..so I tried to implement it myself using memberlist code that basically does the same thing (since you can setup your memberlist to include an 'Online' column)...

In public_memberlist.pl there is a


foreach (@ML_online_array) {
($ML_online_time, $ML_online_user, $ML_online_number, $ML_online_ip, $ML_online
_location) = split(/|^|/, $_); chomp($ML_online_location);
if ($ML_usernum eq $ML_online_number) {
print qq~~;
$ML_online_found++;
}
}
if (!$ML_online_found) {
print qq~ ~;
}


That is the code used to either display the Online .GIF or leave the 'Online' column blank; depending on their current status.

So I tried to copy that code over to my public_topic_page.pl and replace the print qq~... lines to $this_online = qq(... then just toss $this_online wherever I wanted the indicator to show...and this actually works; kinda.

In many other hacks, you would just define something like

if ($whatever = 'yes') {
$this_blah = "Status: Online";
} else {
$this_blah = "Status: Offline";
}

But when I do this here (using the if statement I took from public_memberlist.pl)...it doesn't seem to actually get evaluated properly. If I have the 'else', it will make everyone show as offline and if I don't have the 'else', it will make everyone online.. . so I thought maybe it needed to be reset each time or something (I'm no programmer, BTW) and I could just setup the variable with value "" (blank) before it really gets defined, but apparently there's more than meets the eye.

I had been tinkering with the code a little while with no luck, so I thought I'd get some help in doing this. I hope I've explained myself properly; if not, inquire and I will carify.

Thanks

% SS %

[ 01-07-2002 01:48 AM: Message edited by: Soul Survivor ]
Posted By: pumpkin Re: Online/Offline mod assistance - 01/07/2002 11:15 PM
iirc the memberlist takes its online/offline status from who's online...
you'd need to take a closer look at the code to see where it gets its info, and how it handles it
Posted By: Soul Survivor Re: Online/Offline mod assistance - 01/08/2002 3:05 PM
Oh well, I thought I was on the right track
Posted By: Morpheus Re: Online/Offline mod assistance - 01/27/2002 8:22 PM
I'm hoping someone will do this hack for the 6.1 series of ubb, because it is a good hack. One of the main ones I miss from 'another board' that my message board was previously on.
Posted By: WhiteBlade Re: Online/Offline mod assistance - 01/28/2002 3:32 AM
Well I'm going to try to do something for this
© UBB.Developers