|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Modification Name: User Online Author(s): Brett Description: Adds a picture in each post to indicate whether the user is active on the forum at the moment or not. Recent Visitors must be enabled. Demo: http://www.pavioni.com/ubb/ultimatebb.php/topic/4/8.asp#000011 Download Link: https://www.ubbdev.com/ubb/upload/00006378/Online6.7.zip Credits: LK(for the idea of javascript from the hit hack) This works in much of the same way as the hit hack, so the cache is safe. After install, clear the 'Topic Pages' cache.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Cool, good job! Going straight into my board. By looking at the code, though, I think it also shows online state for invisible users, which don't want to appear online... you might try (untested) if($r->{$uniq}->{login}->[1] == 1) { before the last part of online.cgi.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
It looks like it might be the 2nd(3rd technically ) placement in the login array $r->{$uniq}->{logins}->{$uniq} = [$user_number, $nologin, $hidden, $daysprune]; as the hidden variable? At least i'm pretty sure it is. Updated online.cgi.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Just installed... and it works I think it'd be cool though that if the user is online it'd say "Online" or something like that when you hover the image, and if they're offline it'd say "Offline/Invisible". I'm not sure if it's possible in JS, but I think just instead of "src" you should put "alt".
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
I am working in mozilla 1.6, and the .alt did work, but it didn't mouseover anything. .title does tho. jic, i left both alt and title in, since they both don't have any errors. Figuring 2 is better than 1, maybe there's a browser who will only accept alt, i dunno.
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
i use those for my irc indicators heh
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
in Mozilla, ALT is when the image isn't available and title is when it is... In IE ALT is when the image is available and near the [x] when it isn't.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
hmm, never noticed that. Sweet, so it should be safe on all fronts.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
"ultimatebb.php/topic/4/8.asp" lol
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
ultimatebb.php/topic/33/162.brett
:x
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
Using it on my forums and it looks great. You should use Gizzy's images in the zip cause Jelsoft might get pissed
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Originally posted by Ian Spence:
Using it on my forums and it looks great. You should use Gizzy's images in the zip cause Jelsoft might get pissed
IAN! Watch your language! I'm going to tell mom :x...
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Oh BTW, feel free to use my images, I give you complete rights to do so (at least i think I'm the one who made them, I've been so busy that I don't even recall lol, i've been using them for like 2 years now, and their crappy, so i'm pretty sure i made them)...
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
I wonder how much it'd slow down your board having it in the directory...
|
|
|
|
Joined: Mar 2002
Posts: 64
Member
|
Member
Joined: Mar 2002
Posts: 64 |
this hack with VIPHTML and recicle bin rocks! Brett #1 !
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
I'm semi curious how this works with deleted members posts...
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
it doesn't show at all. no image whatsoever
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Designed Behaviorâ„¢
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Nice nice nice... I plan on upgrading soon, so be prepaired...
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
OK, so I get the "Offline" image, but never the online.
Where should I start looking?
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
user_online.gif and user_offline.gif are located in the noncgi directory of the zip and should be uploaded into the respective directory on your webserver.
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
That isn't the issue, the image shows up for offline, but I'm having a functionality issue in that it doesn't ever change to "online"...
I'm just not sure what file/part of code toggles that feature.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
For one, you do need recent visitors enabled. Also check to make sure you've uploaded online.cgi in ascii format and with 755 permissions.
If that doesn't work, can i get a link to your board?
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
Originally posted by Brett:
For one, you do need recent visitors enabled. Also check to make sure you've uploaded online.cgi in ascii format and with 755 permissions.
If that doesn't work, can i get a link to your board?
These files are on my local disk, so there is no upload and chmod issue to deal with.
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
according to his online.cgi, it can't locate vars_config.
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
Originally posted by Ian Spence:
according to his online.cgi, it can't locate vars_config.
Do I need to modify online.cgi? I placed it in the cgi-bin folder, along with all the other cgi's.
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
is it in the same folder as vars_config?
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
Yes, it is in the came folder as vars_config.cgi (which is 701 bytes)
|
|
|
|
Joined: Jan 2003
Posts: 118
Member
|
Member
Joined: Jan 2003
Posts: 118 |
Found a couple of status gifs for this if anyone else would like to use them. Just did a random search on google for gifs of the same name.
-GATOR
"Pain is temporary, Pride is forever"
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
shh, brett is sleeping... :x...
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
Could there be something wrong with Vars_Config.cgi?
I even tried pointing to it directly (URL) within online.cgi, and it still didn't work although I can access the file via IE.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
did you have to change the location of vars_config.cgi in your ultimatebb.cgi and cp.cgi? Also you can't do url path to your config file, it's gotta be the full path. e.g. /usr/bin/local/path/file/ubbcgi/vars_config.cgi. Originally posted by Gizzy:
shh, brett is sleeping... :x...
No, i wish. I work from 2 to 11 on thursday, had a very important project due today, couldn't mess around. :x
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
I haven't changed the location of vars_config.cgi since the install. It is still in cgi-bin, the same folder that online.cgi is in.
I have returned the file online.cgi to it's original state, having altered it playing with paths.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Ok, open up your ultimatebb.cgi, about line 122 it will have something like eval { do "vars_config.cgi"; }; This is the exact same way in the upload file on line 72. They should be exactly the same, since their in the same directory.
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
eval { do "vars_config.cgi"; };
Is how it looks in both now.
Same problem :tired and confused:
Software error: Can't locate vars_config.cgi in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib .) at E:inetpubwwwroottin_benderscgi-binonline.cgi line 9.
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
ubb_upload.cgi? I assume you mean online.cgi? This is what I get making that change to online.cgi because I don't have a ubb_upload.cgi
Software error: Can't locate E:inetpubwwwroot in_bendersi-binvars_config.cgi in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib .) at E:inetpubwwwroottin_benderscgi-binonline.cgi line 9.
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Whoops, thinking about the wrong hack. okay, replace: require "vars_config.cgi";
with
eval { do "vars_config.cgi"; };
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
Ok, so I did that, and then I got the Error for the lext line of code, where it looks for vars_pntf. So I went and replaced it also. Now I get this if I try and run online.cgi by itself... var AllImgs = document.body.getElementsByTagName("img"); function ChangeAll(img) { for(var i=0; i <= AllImgs.length; i++) { if(AllImgs[i] && AllImgs[i].id == img) { AllImgs[i].src = '/user_online.gif'; AllImgs[i].alt = 'Online'; AllImgs[i].title = 'Online'; } // end if } // end for } And the image doesn't change.
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
That is a standard message when you run online.cgi by itself.
|
|
|
|
Joined: Nov 2003
Posts: 156
Member
|
Member
Joined: Nov 2003
Posts: 156 |
Ok, so I replaced the standard "Require" code with eval { do "vars_config.cgi"; }; eval { do "vars_pntf.cgi"; }; ofcourse I get no errors, but it still doesn't work
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
online.cgi doesn't log you. You/or another registered user needs to be on the boards. Also, the user must have hide pntf off.
n/m please check your private messages, phillip.
|
|
|
|
Joined: Jan 2003
Posts: 118
Member
|
Member
Joined: Jan 2003
Posts: 118 |
OK, I just tried to install this one and it semi-appears to work except for the big error I get when I click on a topic. Rehacked 3 times now. "A Runtime Error has occured. Do you wish to debug? Line:1 Error: Syntax error" A picture does show up though and says I am offline. Help?
-GATOR
"Pain is temporary, Pride is forever"
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
it can't find vars_config
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Al, it's in the JS code, not the Perl code... Also it's not surely line 1, IE's not so accurate when it comes to line numbers...
|
|
|
|
Joined: Jan 2003
Posts: 118
Member
|
Member
Joined: Jan 2003
Posts: 118 |
After going back over the thread I had to do what Phillip had to do in online.cgi. Wasn't exactly clear, but I figured it out. Replace
require "vars_config.cgi"; require "$vars_config {VariablesPath}/vars_pntf.cgi";
with
eval { do "vars_config.cgi"; }; eval { do "vars_pntf.cgi"; };
What's really interesting is that I replaced images, cleared cache, and it's still showing the old image for me being offline... How is that happening? I searched my entire www root directory for images of the same name and the one I want is the only one there???
-GATOR
"Pain is temporary, Pride is forever"
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
Originally posted by LK:
Al, it's in the JS code, not the Perl code... Also it's not surely line 1, IE's not so accurate when it comes to line numbers...
the javascript is made by the perl, and Firefox gives you great javascript errors.
|
|
|
|
Joined: Jan 2003
Posts: 118
Member
|
Member
Joined: Jan 2003
Posts: 118 |
Hmm... I still can't get this to change status though. I always see offline also. Had another person register just to test and ask if they see me online which they don't, and I didn't see their online status change either. Any ideas?
-GATOR
"Pain is temporary, Pride is forever"
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Looks like the same thing from Phillip's server. The way i fixed it was, okay do this. Download a fresh copy of the cgi file. replace: use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser set_message);
with: BEGIN { ($0 =~ m!(.*)(\|/)[^/\]+!) && unshift(@INC, $1, "$1$2Modules"); $| = 1; }; use lib("./Modules", "."); use UBBCGI qw(:cgi); use UBBCGI::Carp qw(fatalsToBrowser set_message);
|
|
|
|
Joined: Jan 2003
Posts: 118
Member
|
Member
Joined: Jan 2003
Posts: 118 |
Whoo Hoo! It worked! :::does a little dance::: Thanks for your help Brett.
-GATOR
"Pain is temporary, Pride is forever"
|
|
|
|
Joined: Aug 2000
Posts: 178
Member
|
Member
Joined: Aug 2000
Posts: 178 |
Here are a couple of Status .gifs you are free to use if you like. Enjoy!
|
|
|
|
Joined: Sep 2001
Posts: 672
Member
|
Member
Joined: Sep 2001
Posts: 672 |
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
very kewl Is it possible to change the location of the offline/online images to show under the avatar or next to where it says " IP: Logged" at the bottom?
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
Yes, you could put the image anywhere. All in /non-cgi/Templates/public_topic_page.pl
If you want it under the avatar: Replace: $AvatarBits
with: $AvatarBits
$OnlineBits
Or next to ip logged, just add the variable $OnlineBits after $ip_wording
|
|
|
|
Joined: Mar 2004
Posts: 58
Member
|
Member
Joined: Mar 2004
Posts: 58 |
Thanks
|
|
|
|
Joined: Jan 2007
Posts: 3
Lurker
|
Lurker
Joined: Jan 2007
Posts: 3 |
I have added this hack to my UBB 6.7.2. The online status never changes from offline to online. I do not receive any error messages. I am certain that the required files are located in the correct directories. My website is www.termpro.com (Click on Audio Forum). I really, really want this feature. Any suggestions would be greatly appreciated. Sincerely, Wayne Harris
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
I'd re-check your changes to the base script files.
|
|
|
|
Joined: Jan 2007
Posts: 3
Lurker
|
Lurker
Joined: Jan 2007
Posts: 3 |
When checking my server logs I am receiving an error "502 - Bad Gateway" whenever the online.cgi file is referenced. My server is Win 2003 Enterprise Edition with IIS.
The online.cgi script is as follows ...
#!/usr/bin/perl
# load modules use strict;
BEGIN { ($0 =~ m!(.*)(\|/)[^/\]+!) && unshift(@INC, $1, "$1$2Modules"); $| = 1; }; use lib("./Modules", "."); use UBBCGI qw(:cgi); use UBBCGI::Carp qw(fatalsToBrowser set_message);
use vars qw(%vars_config %vars_pntf); require "vars_config.cgi"; require "$vars_config{VariablesPath}/vars_pntf.cgi";
print qq~Content-type: text/html\n\n var AllImgs = document.body.getElementsByTagName("img"); function ChangeAll(img) { for(var i=0; i <= AllImgs.length; i++) { if(AllImgs[i] && AllImgs[i].id == img) { AllImgs[i].src = '$vars_config{NonCGIURL}/user_online.gif'; AllImgs[i].alt = 'Online'; AllImgs[i].title = 'Online'; } // end if } // end for } ~;
if($vars_pntf{Enabled} eq "yes" && -e "$vars_config{CachePath}/pntf/now.cgi") { do "$vars_config{CachePath}/pntf/now.cgi"; my $load = UBB::PNTF::_load();
foreach my $uniq (keys %{ $load->{uniq}->{logins} }) { my $user = $load->{uniq}->{logins}->{$uniq}->[0];
# check to see if actual user or if hidden next if $user eq '' || $load->{uniq}->{logins}->{$uniq}->[2] eq 1;
print qq~ChangeAll('online$user');\n~; } # end if } # end if
exit(0); 1;
|
|
|
|
Joined: Jan 2007
Posts: 3
Lurker
|
Lurker
Joined: Jan 2007
Posts: 3 |
I am pretty sure that all of the security settings are correct. The requested url in the log file is /cgi-bin/ubb/online.cgi.
This is where all of my cgi scripts are located. This is also where the online.cgi file resides.
The offline graphic is showing up correctly on my pages and the online.cgi script is being called.
Your suggestions are appreciated.
Last edited by Wayne Harris; 01/19/2007 2:07 PM.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Did you update the path to perl to match that of your ultimatebb.cgi file? I used to run ubbdev on a windows server for a few years and I believe the path to perl has to be set (usually something like c:\perl\perl.exe - it's been a while )
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|