Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
I'm using Who's Online 3.9Qa

I'd like to create a seperate CGI file that just simply prints the total number of all users currently online for an SSI call.

It seemed like an easy task, but im far from an expert and i've gotten no where.

I believe the variable would be '$tot'.

I'd like to use it to display a simple "588 Users online right now!" kinda thing.

http://www.wrestleworld.com/forums/
Any ideas?

Sponsored Links
Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
The variable for the total users online is "$totalonline" (Pretty sure of that).

I'm wondering where do you want to add the number of users? Which page?

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Thanks Lord,

If I can get it to work (HELP!), i'd like to call the CGI file that can hold and display that variable from my main page.. linking to the who's online page, or something like that.

Any ideas on how i can create a script that grabs that information?

Thanks!

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
If you want it on the WOL page, you don't need to link it since it's on the UBB. (I'm pretty sure). So just add $totalonline in the file where you want it.

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Nono, Im not interested in housing it within the forum cgi pages, but rather to call it from SHTML pages on my main website.

So, I am in need of someone to put together a seperate CGI file that will display just that one variable -- that i can call via SSI from my .shtml pages.

I tried to make a copy of the whos_online_ssi.cgi file to just print the variable I want, but it didn't work.. Im no expert at it, anyway.

Let me know! Thanks!
-matt

Sponsored Links
Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Just bumping this up for today. thanks

Joined: Sep 2001
Posts: 13
T
Junior Member
Offline
Junior Member
T
Joined: Sep 2001
Posts: 13
I understand what you mean. Just like the Recent Threadz hack, you want to have a SSI on a page of your website(not the forum itself), that will show visitors who is online.

That's a great idea, I wish someone could do that for 6.05

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
Ok Let me get this straight:

You want to create a seperate CGI file that will just display the number of users online? And then what?

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Dexter,

That's absolutley it. lol

For example, I have the ubb_whos_online_ssi.cgi.. when you call it up cold in a browser, it will display just the simple text "Username, there are 25 users and 12 guests on the forums in the last X minutes".

I want to create a file called.. say.. ubb_whos_online_ssi1.cgi, and JUST have the total count display.. in the above case, 37 users.. And i just want this CGI file to display "37"... nothing more.

I will then use that CGI file as an SSI call on my homepage in various advertisments for my forums area.

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
Well to get the users online the file uses a file called UBB6online.cgi which is in the members directory. So it looks like there needs to be a file that will call the number of people online. And then we can just copy and edit the ubb_whos_online_ssi.cgi.

Sponsored Links
Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Any idea on how to go about doing that? Would you know the steps necesary?

Thanks LDexter, you've been a big help with this project of mine! :-)

-matt

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
Post the code used in the file here. (If there is alot, tell me and I'll go into my forums FTP and get it myself).

And I'm glad to help. smile

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
ubb_whos_online_ssi.cgi
--------------------
#!/usr/local/bin/perl
### UBB Who's Online SSI CGI
### by qasic (06/07/2001)

# ubb libraries required
use strict;
use CGI::Carp qw(fatalsToBrowser carpout);
use CGI qw(:cgi-lib :standard);

# variables
use vars qw(%vars_config %vars_misc %in $masterCharset @ubber $invisble_pref $username $user_number @Ell_cookie $invisible_pref @people %vars_whos_online);

($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows /
($0 =~ m,(.*)\[^\]+,) && unshift (@INC, "$1"); # Get the script location: Windows

# get variables and wordlets
eval {
require "vars_config.cgi";
require "$vars_config{VariablesPath}/vars_display.cgi";
require "$vars_config{VariablesPath}/vars_misc.cgi";
require "$vars_config{VariablesPath}/vars_whos_online.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_mods.cgi";
require "ubb_lib.cgi";
require "ubb_lib_time.cgi";
};

# print header
print "Content-type: text/htmlnn";

# check files
if ([email protected]) {
print "
Error including required files: [email protected] $!n";
print "Make sure these files exist, permissions are set properly, and paths are set correctly.
";
exit;
}

# check for UBB closure
if ($vars_misc{BBStatus} ne 'ON') {
exit;
}

# retrieve cookies!
@ubber = cookie("ubber$vars_config{Cookie_Number}");
if ($ubber[0] ne '') { $username = $ubber[0]; }
if ($ubber[4] ne '') { $user_number = $ubber[4]; }
@Ell_cookie = cookie("Ell$vars_config{Cookie_Number}");
if ($Ell_cookie[0] ne '') { $invisible_pref = $Ell_cookie[0]; }
$invisible_pref = "" unless $vars_whos_online{allow_invisible};

#get who's online people
if (-e "$vars_config{MembersPath}/UBB6online.cgi") {
@people = &OpenFileAsArray("$vars_config{MembersPath}/UBB6online.cgi");
}

# now get ssi and output it
$in{ubb} = "whos_online_ssi";
require "$vars_config{CGIPath}/ubb_whos_online.cgi";
&whos_online_ssi($user_number, $invisible_pref);
exit;

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Now, with my novice experience with CGI, I did try slapping up a print tag in the mix at the last variable. In the print line, if it was JUST the $username tag, it displays properly, but adding in the $totalonline tag gives a software error, as if to think it needs to generate that information from somewhere Im not telling it to. (ex: http://www.wrestleworld.com/forums/cgi-bin/ubb_whos_online_ssi1.cgi)
----------

# now get ssi and output it
$in{ubb} = "whos_online_ssi";
require "$vars_config{CGIPath}/ubb_whos_online.cgi";
print "hello $username $totalonline";
exit;

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
No I meant UBB6Online.cgi, in the Members directory.

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
UBB6online.cgi
003224|^|205.188.197.187
1004495545|^|Kane&Undertaker261|^|00004235|^|24.187.109.185|^|Reading: "I NeEd A ReCiPe Of....................." in "Customizing Forum"
1004495561|^|guest|^||^|24.4.252.200|^|Browsing: "Classifieds Area"
1004495562|^|team extreme 2000|^|00004072|^|24.79.198.90|^|Reading: "Wants Please Reply!!!!!" in "Classifieds Area"
1004495569|^|JSWO|^|00000062|^|64.12.104.182|^|Browsing: "AFR Figure Discussion"
1004495572|^|guest|^||^|24.4.252.96|^|Reading: "I need every customizers site address...R+R!!!!!" in "Customizing Forum"
1004495576|^|jupiter417|^|00001515|^|152.163.204.79|^|Reading: "Who's your favorite lightweight wrestler?" in "Pro-Wrestling Hub"
1004495586|^|ThrasherM|^|00003822|^|152.163.201.178|^|Reading: "OMG! On-CUE EXCLUSIVE FIGURES! WHOOOOOO!!" in "AFR Figure Discussion"
1004495593|^|HBREAKID2K|^|00000430|^|216.189.14.52|^|Reading: "Posed Ankle Lock submission!!! **UPDATE ON PAGE 2**" in "Customizing Forum"
1004495600|^|linkinpark20|^|00004462|^|64.34.164.77|^|Reading: "MY BEST CUSTOM EVER... 90% done Grandmaster Sexay!!!! yea...." in "Customizing Forum"
1004495606|^|R V D is MR PPV|^|00005521|^|205.188.197.176|^|Browsing: "The Lounge"
1004495617|^|guest|^||^|64.12.97.13|^|Viewing: Main Page
1004495637|^|guest|^||^|64.12.107.53|^|Reading: "New Set Ideas (All Read, Kick Ass Ideas)" in "AFR Figure Discussion"
1004495638|^|ITS MY YARD|^|00006121|^|24.186.59.242|^|Browsing: "Classifieds Area"
1004495638|^|guest|^||^|12.25.29.210|^|Browsing: "AFR Figure Discussion"
1004495642|^|The Sleep|^|00006370|^|66.122.54.218|^|Reading: "Wrestlemania 14 customs---austin VS michaels..HBK PROTO ADDED!!!!!" in "Customizing Forum"
1004495649|^|guest|^||^|152.163.204.197|^|Reading: "Wrestlemania 14 customs---austin VS michaels..HBK PROTO ADDED!!!!!" in "Customizing Forum"
1004495651|^|The Hitman|^|00004380|^|63.39.111.48|^|Reading: "I Really Couldn't Care Less If You Find Me 'Cool' Or Not..." in "The Lounge"
1004495653|^|Kane2000|^|00004883|^|198.81.16.164|^|Reading: "WOW!!! A Supposed Rumored List for the Final Figures in ROTR 5, EVERYONE R & R!!!" in "AFR Figure Discussion"
1004495656|^|Bubba|^|00005893|^|65.129.60.182|^|Reading: "My new custom Entrance with pics!!!!!!!!!" in "Customizing Forum"
1004495659|^|Super Kafos|^|00006156|^|206.250.224.13|^|Browsing: "Entertainment Hub"
1004495671|^|guest|^||^|152.163.205.84|^|Reading: "Everyone WILL love Real Reaction" in "AFR Figure Discussion"
1004495675|^|nhbfighter4|^|00006256|^|198.81.17.54|^|Composing: New Topic in "Customizing Forum"
1004495680|^|guest|^||^|203.134.24.180|^|Browsing: "AFR Figure Discussion"
1004495684|^|Ace Punk|^|00005862|^|64.12.103.171|^|Reading: "can someone post the pix of ss2 that robhardy posted a while back please" in "AFR Figure Discussion"
1004495696|^|XtremepuNk|^|00004501|^|24.164.187.252|^|Replying: "gamecube pics 10/30/2001 sonic adventure 2 battle and 1080 snowboarding 2 shots " in "General Video Game Discussion"
1004495698|^|bLinD punK182|^|00005785|^|24.188.215.38|^|Browsing: "Figure Findings/Store Reports"
1004495699|^|Anticrombie Punk|^|00006282|^|63.28.89.65|^|Reading: "is there a promo....R+R" in "AFR Figure Discussion"
1004495710|^|stealth_fighter|^|00003492|^|24.53.98.63|^|Browsing: "The Lounge"
1004495716|^|Erik 'The Hex' Erna|^|00000693|^|65.31.245.150|^|Reading: "nWo Fed Episode 2..... The Fire Inside Builds!" in "Figure Fed/Storyline Board"
1004495726|^|The dogg|^|00000229|^|64.12.101.154|^|Reading: "LOL... Most Hilarious Day At School, EVER.." in "The Lounge"
1004495727|^|HHHandChyna18|^|00003635|^|12.89.131.100|^|Browsing: "AFR Figure Discussion"
1004495741|^|Nickistoocool|^|00001976|^|205.188.195.58|^|Reading: "I know Big Hits CuStOmS is running for mod But i want to too R&R" in "Classifieds Area"
1004495742|^|ecwrhino|^|00004279|^|63.64.70.204|^|Reading: "I Really Couldn't Care Less If You Find Me 'Cool' Or Not..." in "The Lounge"
1004495747|^|guest|^||^|63.16.100.20|^|Browsing: "The Lounge"
1004495748|^|STH2|^|00005877|^|216.176.150.231|^|Reading: "Way better pics of TTL13 Lita" in "AFR Figure Discussion"
1004495757|^|2xtreamkid|^|00005141|^|64.12.105.22|^|Reading: "NeW CuStom RavEN!!!!!!!" in "Customizing Forum"
1004495759|^|GordonAFR|^|00000590|^|205.188.192.28|^|Replying: "I Really Couldn't Care Less If You Find Me 'Cool' Or Not..." in "The Lounge"
1004495762|^|guest|^||^|24.4.252.201|^|Reading: "UPDATED FIGS FOR SALE $ 5 PER FIGURE BACKSTAGE MAYHEM ACCESSORIES AND MORE" in "Classifieds Area"
1004495763|^|CustomKid1213|^|00003493|^|64.12.103.28|^|Reading: "New Set Ideas (All Read, Kick Ass Ideas)" in "AFR Figure Discussion"
1004495764|^|ChrisG|^|00006274|^|66.1.39.227|^|Browsing: "Customizing Forum"
1004495775|^|guest|^||^|24.159.115.222|^|Reading: "Betrayl.Carnage.No Mercy.No Mercy Results! 40 + pictures!" in "Figure Fed/Storyline Board"
1004495777|^|In Your House|^|00002607|^|207.32.12.141|^|Reading: "Posed Ankle Lock submission!!! **UPDATE ON PAGE 2**" in "Customizing Forum"
1004495778|^|pork|^|00003523|^|24.90.1.86|^|Reading: "what should real reation 2 be?" in "AFR Figure Discussion"
1004495785|^|bubba ray dj|^|00003533|^|205.161.239.49|^|Reading: "I want the new Just Bring it america flag rock shirt.." in "Pro-Wrestling Hub"
1004495788|^|guest|^||^|64.77.130.178|^|Reading: "Two NEW animations!! (SuperPlex and NewJack Jump)! Check it out!!" in "Figure Animation Board"
1004495793|^|guest|^||^|63.155.242.249|^|Reading: "can someone make any customs for me" in "Customizing Forum"
1004495793|^|chazburgr|^|00003998|^|209.244.132.217|^|Reading: "ggggrrrrrrrrrrr........My power went out a half hour into RAW!!" in "Pro-Wrestling Hub"
1004495794|^|ECWISCOOL|^|00005198|^|64.12.102.154|^|Browsing: "Pro-Wrestling Hub"
1004495797|^|guest|^||^|65.34.32.56|^|Browsing: "Entertainment Hub"
1004495798|^|guest|^||^|64.12.104.41|^|Reading: "moc and loose pics of ttl 13 triple h" in "AFR Figure Discussion"
1004495803|^|AeroSmith|^|00006075|^|63.30.139.122|^|Browsing: "The Lounge"
1004495804|^|guest|^||^|24.128.246.141|^|Reading: "Who wants a Real-Scan Linda McMahon" in "AFR Figure Discussion"
1004495804|^|guest|^||^|216.142.233.105|^|Browsing: "Pro-Wrestling Hub"
1004495806|^|abckid24|^|00003340|^|24.184.1.146|^|Reading: "Who's your favorite lightweight wrestler?" in "Pro-Wrestling Hub"
1004495808|^|Xtreme Kid|^|00003191|^|208.248.187.154|^|Reading: "My MOC and Loose Collection *PICS* " in "AFR Figure Discussion"
1004495811|^|guest|^||^|24.39.214.240|^|Browsing: "Figure Findings/Store Reports"
1004495812|^|brmkane|^|00004217|^|205.188.193.176|^|Browsing: "Figure Findings/Store Reports"
1004495813|^|blockbusterbomb|^|00003244|^|66.65.56.208|^|Browsing: "Pro-Wrestling Hub"
1004495814|^|HHHTheGame024|^|00003043|^|205.188.201.193|^|Reading: "Findings at KB Cottman Ave. Phila. PA" in "Figure Findings/Store Reports"
1004495815|^|Adam316|^|00002107|^|64.12.105.152|^|Reading: "*UPDATED*Full List of Real Scans for sale $4-$7 shipped(all loose, never played with)" in "Classifieds Area"
1004495816|^|guest|^||^|206.215.13.45|^|Reading: "what should real reation 2 be?" in "AFR Figure Discussion"

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
-double post-

[ 10-30-2001: Message edited by: mpearson ]

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
Well that doesn't really help. I'll have to look at ubb_whos_online_ssi.cgi since the code that calls the users online on a Web page is there.

Joined: Oct 2001
Posts: 23
M
Junior Member
OP Offline
Junior Member
M
Joined: Oct 2001
Posts: 23
Dexter,

here is the ubb_whos_online_ssi.cgi file again. I posted it in this thread a day or so ago, but i figured i'd toss it in again.

Let me know anything else you'll be needing!

ubb_whos_online_ssi.cgi
--------------------
#!/usr/local/bin/perl
### UBB Who's Online SSI CGI
### by qasic (06/07/2001)

# ubb libraries required
use strict;
use CGI::Carp qw(fatalsToBrowser carpout);
use CGI qw(:cgi-lib :standard);

# variables
use vars qw(%vars_config %vars_misc %in $masterCharset @ubber $invisble_pref $username $user_number @Ell_cookie $invisible_pref @people %vars_whos_online);

($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows /
($0 =~ m,(.*)\[^\]+,) && unshift (@INC, "$1"); # Get the script location: Windows

# get variables and wordlets
eval {
require "vars_config.cgi";
require "$vars_config{VariablesPath}/vars_display.cgi";
require "$vars_config{VariablesPath}/vars_misc.cgi";
require "$vars_config{VariablesPath}/vars_whos_online.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_mods.cgi";
require "ubb_lib.cgi";
require "ubb_lib_time.cgi";
};

# print header
print "Content-type: text/htmlnn";

# check files
if ([email protected]) {
print "
Error including required files: [email protected] $!n";
print "Make sure these files exist, permissions are set properly, and paths are set correctly.
";
exit;
}

# check for UBB closure
if ($vars_misc{BBStatus} ne 'ON') {
exit;
}

# retrieve cookies!
@ubber = cookie("ubber$vars_config{Cookie_Number}");
if ($ubber[0] ne '') { $username = $ubber[0]; }
if ($ubber[4] ne '') { $user_number = $ubber[4]; }
@Ell_cookie = cookie("Ell$vars_config{Cookie_Number}");
if ($Ell_cookie[0] ne '') { $invisible_pref = $Ell_cookie[0]; }
$invisible_pref = "" unless $vars_whos_online{allow_invisible};

#get who's online people
if (-e "$vars_config{MembersPath}/UBB6online.cgi") {
@people = &OpenFileAsArray("$vars_config{MembersPath}/UBB6online.cgi");
}

# now get ssi and output it
$in{ubb} = "whos_online_ssi";
require "$vars_config{CGIPath}/ubb_whos_online.cgi";
&whos_online_ssi($user_number, $invisible_pref);
exit;

Joined: May 2001
Posts: 6,708
L
Member
Offline
Member
L
Joined: May 2001
Posts: 6,708
Well I'm sorry to say but I don't think I could change this file so it displays how many users are online. Bets thing to do is ask qasic about it. I have unjumbled at bit of it though.

Code
code:

We would need to change that to...

Code
code:

Or something like that. But I'm sorry I couldn't do it..


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,558
Posts293,857
Members13,848
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,819
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 70
Gizmo 16
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2022 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Snapshot build 20220120)
Responsive Width:

PHP: 7.3.29 Page Time: 0.026s Queries: 54 (0.009s) Memory: 0.9133 MB (Peak: 1.0330 MB) Data Comp: Zlib Server Time: 2022-01-27 05:57:05 UTC
Valid HTML 5 and Valid CSS