## UBB COMMON ROUTINE LIBRARY
#
# Ultimate Bulletin Board is copyright Infopop Corporation, 1998-2000.
#
# ------------ ubb_library.pl -------------
#
$Version = "4.0";
$VersionNumber = "5R4R5RB";
$maxmemfields = 14; # = 15 max fields for member data
if ($showcopytype eq 'image'){
$infopopcopy = qq(
);# end qq
}
else {$infopopcopy = qq(Powered by Ultimate Bulliten Board www.infopop.com © 2000);
}
$test = `/usr/local/etc/httpd/banner/ads.pl`;
$test =~ s/Content-Type: text\/html//;
#print "
$test\n
";
sub CheckModStatus {
my($forumnumber, $UserName) = @_;
$GetModerator = ("$forumnumber" . "Moderator");
$GetModerator = $$GetModerator;
@mods = split(/\|\|\^\|\|/, $GetModerator);
$ModMatch = "";
foreach $unomod(@mods) {
chomp($unomod);
if ($unomod eq "$UserName") {
$ModMatch = "true";
}
}
if ($ModMatch eq "true") {
$ModMatch = "yes";
} else {
$ModMatch = "no";
}
return ($ModMatch);
}
sub GetMemberListArray {
@members = @blank;
my @themembers = &OpenFile("$MembersPath/memberslist.cgi");
foreach $thisline(@themembers) {
my @profiles = split(/\|\!\!\|/, $thisline);
chomp($profiles[1]);
push (@members, $profiles[0]);
push (@thenums, $profiles[1]);
}
@sortnums = sort(@thenums);
@revnums = reverse(@sortnums);
$LastNumber = $revnums[0];
chomp($LastNumber);
} # end Get Member List Array sr
sub GetEmails {
my @theemails = &OpenFile("$MembersPath/emailfile.cgi");
foreach $dos(@theemails) {
($EmailHere, $MemNum) = split(/\|\|/, $dos);
chomp($MemNum);
$EmailLine = "$EmailHere??$MemNum";
push (@EmailList, $EmailLine);
}
}
sub ConvertTo24Hour {
if ($TheAMPM eq "PM") {
if ($gethr < 12) {
$gethr = ($gethr + 12);
}
}
if ($TheAMPM eq "AM") {
if ($gethr == 12) {
$gethr = "0";
}
}
$gethr = sprintf ("%2d", $gethr);
$gethr =~tr/ /0/;
$getmin = sprintf ("%2d", $getmin);
$getmin =~tr/ /0/;
} # end convert to 24 hour format sr
sub decodeURL {
$_ = shift;
tr/+/ /;
s/%(..)/pack('c', hex($1))/eg;
return($_);
}
sub GetForumRecord {
$forumnumber = shift;
@forums = &OpenForumsFile;
$forumnumber = $forumnumber - 1;
@requestedforum = split(/\|/, $forums[$forumnumber]);
return (@requestedforum);
}
sub GetForumSelectList {
@valid = @blank;
@catgroup = @blank;
@sortthis = @blank;
@subtotal = @blank;
@alltheforums = &OpenForumsFile;
#make sure only open forums are listed in @forums
foreach $this(@alltheforums) {
chomp($this);
@checkit = split(/\|/, $this);
if ($checkit[3] eq "On") {
push (@valid, $this);
}
}
@forums = @valid;
if (-e "$NonCGIPath/Archives/archives.pl") {
@getarchives = &OpenFile("$NonCGIPath/Archives/archives.pl");
$ArchiveWording = "or Archive";
} else {
@getarchives = "";
$ArchiveWording = "";
}
$test = `/usr/local/etc/httpd/banner/ads.pl`;
$test =~ s/Content-Type: text\/html//;
print "
$test\n
its an add";
print<Select a Forum $ArchiveWording