Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 2000
Posts: 139
Member
Member
Offline
Joined: Dec 2000
Posts: 139
Can someone please tell me how to call this from my Ultimate.cgi so it will display the ubb stats. I run my ubb on a NT server, does that matter?

here is the ubbstats.pl file.

thanks!


#!/usr/bin/perl

#change this file to ubbstats.pl

print ("Content-type: text/htmlnn");

# Define the variables please

# Example $MembersPath = "/home/yourpathto/cgi-bin/ubbcgi/Members";

$MembersPath = "/cgi-bin/Members";

# Example $UBBPath = "/home/yourpathto/cgi-bin/ubbcgi";

$UBBPath = "/cgi-bin";

# No need to edit below this line unless you know what your doing

# Open the memberlist

open (MEMBFILE, "<$MembersPath/memberslist.cgi") or die ("Can't open file: $MembersPath/memberslist.cgi!");

# Require the rest of the files
require $UBBPath . "/UltBB.setup";
require $UBBPath . "/Styles.file";
require $UBBPath . "/UltBB.setup";

# set the active thread count to 1 for the last post time (is there a more efficent way of doing this?
$num_threads = 1;

# Initialise the counts to zero
$cnt = 0;
$cntforums = 0;
$TotPosts = 0;

# Start processing
while ($line = ) {
chomp($line);
($name, $unknown, $userno) = split(/|/, $line);
open (USRFILE, "<$MembersPath/$userno.cgi") or die ("Can't open file: $MembersPath/userno.cgi!");
for ($i=0; $i < 7; $i++) {
$line = ;
if ($i == 2) {$mailto = $line};
}
$place = $line;
chomp($place);
chomp($mailto);
$line = ;
$TotPosts += $line;
$posts = sprintf("%7d", $line);
for ($i=0; $i < 4; $i++) {
$line = ;
}
close (USRFILE);
$memblist[$cnt++];
}
close (MEMBFILE);
$NoMembers = $cnt;
@newlist = sort {$b cmp $a} @memblist;
@forumlines = ("");
open(FORUMS, "<$UBBPath/forums.cgi") || die "Could not open forums.cgin";

while( )

{
push(@forumlines,$_);
$cntforums++;
}
close(FORUMS);
open (F,"$UBBPath/forums.cgi");
while ( ) {
(@parts) = split(/|/,$_);
push @forums, $parts[8];
}
close F;

foreach $forum (@forums) {
$filetoopen = $NonCGIPath . "/Forum" . $forum . "/forum" . $forum . ".threads";
open (T,"$filetoopen");
while ( ) {
(@threads) = split(/|/,$_);
$numdate = $threads[10];
$year = substr ($numdate,0,4);
$month = substr ($numdate,4,2);
$day = substr ($numdate,6,2);
$hour = substr ($numdate,8,2);
$min = substr ($numdate,10,2);

@months = ("","January","February","March","April","May","June","July","August","September","October","November","December");
$ExpandedMonth = $months[$month];
$Date = "$ExpandedMonth $day, $year at $hour:$min";
$ordered = "$threads[10]|$threads[4]|$threads[2]|$Date|$forum";
push @allthreads, $ordered;
}
close T;
}

@sortedthreads = sort {$b cmp $a} @allthreads;

$x = 0;
for (@sortedthreads) {
$x++;
unless ($x > $num_threads) {
(@threaddata) = split(/|/,$_);
}
}

open (F,"$MembersPath/memberslist.cgi");
@members = ;
close F;

$featured = $members[int(rand(@members))];
(@member) = split(/|/,$featured);
chomp($member[2]);
$filetoopen = $member[2] . ".cgi";

open (M,"$MembersPath/$filetoopen");
while () {
chomp;
push @mdata, $_;
}
close M;

# Last member

@lastmember = reverse(@members);
$LastReg = $lastmember[0];
($user,$number)=split(/|!!|/,$LastReg);
$LastRegCoded = $LastReg;
chomp($LastReg);
($username,$junk,$number)=split(/|/,$LastReg);

# Print the output

print<
























$BBName
There are currently $NoMembers
members
We have $cntforums forums
We have had $TotPosts contibutions
Last post $threaddata[3]
Todays featured member is $mdata[0]
Last member to register is $username

TOTALPOSTS

Sponsored Links

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
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
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,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)