#!/usr/local/bin/perl
print ("Content-type: text/html\n\n");
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
#substitute all require files here for the file
require "UltBB.setup";
require "ubb_library.pl";
require "Styles.file";
require "Date.pl";
};
if ($@) {
print "Error including required files: $@\n";
print "Make sure these files exist, permissions are set properly, and paths are set correctly.";
exit;
}
if ($BBStatus eq "OFF") {
&StandardHTML("Sorry, this bulletin board is temporarily unavailable, while we perform some routine maintenance. Please try back again later. Feel free to email us at $BBEmail.");
exit;
}
&ReadParse;
#create random numbers for headers/footers
$RandomNumber = &MakeRandomNumber;
$RandomNumber2 = $RandomNumber + 100074;
if ($Header ne "") {
$Header =~ s/UBBrandomX/$RandomNumber/isg;
$Header =~ s/UBBrandomY/$RandomNumber2/isg;
}
if ($Footer ne "") {
$Footer =~ s/UBBrandomX/$RandomNumber/isg;
$Footer =~ s/UBBrandomY/$RandomNumber2/isg;
}
#adjust bgcolor variables
if ($BGColor ne ""){
$BGColor = qq(bgcolor="$BGColor");
}
if ($AltColumnColor1 ne ""){
$AltColumnColor1 = qq(bgcolor="$AltColumnColor1");
}
if ($AltColumnColor2 ne ""){
$AltColumnColor2 = qq(bgcolor="$AltColumnColor2");
}
if ($CategoryStripColor ne ""){
$CategoryStripColor = qq(bgcolor="$CategoryStripColor");
}
if ($TableColorStrip ne ""){
$TableColorStrip = qq(bgcolor="$TableColorStrip");
}
if ($PageBackground ne ""){
$PageBackground = qq(background="$NonCGIURL/$PageBackground");
}
if ($TableBorderColor ne ""){
$TableWidth2 = "100%";
$BorderTop = qq(
);
} else {
$TableWidth2 = $TableWidth;
$BorderTop = "";
$BorderBottom = "";
}
@forums = &OpenForumsFile;
$SearchUser = $in{'SearchUser'};
$SearchUser = &decodeURL($SearchUser);
$SearchUser = &UNHTMLIFY($SearchUser);
$SearchUserCoded = $SearchUser;
$SearchUserCoded = &HTMLIFY($SearchUserCoded);
$SearchUserCoded =~ tr/ /+/;
if ($in{'action'} eq "intro") {
&Intro;
}
if ($in{'action'} eq "getdaily") {
&GetDaily;
}
if ($in{'action'} eq "introprivate") {
&IntroPrivate;
}
if ($in{'action'} eq "simplesearch") {
if ($AllowSearch eq "FALSE") {
&StandardHTML("Sorry, the search function is not activated at this time.");
exit;
} else {
if ($IndexMethod eq "ONEFILE") {
&SimpleSearch;
} else {
&SimpleSearch2;
}
}
}
if ($in{'action'} eq "simplesearchP") {
if ($AllowSearch eq "FALSE") {
&StandardHTML("Sorry, the search function is not activated at this time.");
exit;
} else {
&SimpleSearchP;
}
}
if ($in{'action'} eq "privateid") {
&PrivateID;
}
sub GetDaily {
&GetDateTime;
if ($AllowSearch eq "FALSE") {
$SearchOption = "";
} else {
$SearchOption = qq(refine search | );
}
if (-e "$NonCGIPath/dailyindex-$LastLoginJulianDATE.file") {
$Daily = "exists";
@daily2 = &OpenFile("$NonCGIPath/dailyindex-$LastLoginJulianDATE.file");
@daily = sort(@daily2);
} else {
$Daily = "";
@daily = @blank;
}
#eliminate duplicates
foreach $check(@daily) {
chomp($check);
(@testit) = split(/\|/, $check);
$testit = ("$testit[0]" . "$testit[1]");
$Duplicate = "";
for $dupcheck(@good) {
@testit2 = split(/\|/, $dupcheck);
$testit2 = ("$testit2[0]" . "$testit2[1]");
if ($testit eq "$testit2") {
$Duplicate = "true";
}
}
if ($Duplicate ne "true") {
push(@good, $check);
}
}
$MatchTotal = @good;
my $MaxDisplay = 40; #maximum number to view per screen
if ($in{'StartPoint'} eq "") {
$StartPoint = 1;
if ($MatchTotal <= $MaxDisplay) {
$EndPoint = $MatchTotal;
$Done = "true";
} else {
$Done = "";
$EndPoint = $MaxDisplay;
}
$EP = $EndPoint - 1;
@daily = @good[0..$EP];
} else {
$StartPoint = $in{'StartPoint'};
$EndPoint = $StartPoint + $MaxDisplay;
$EndPoint = $EndPoint - 1;
if ($MatchTotal <= $EndPoint) {
$EndPoint = $MatchTotal;
$Done = "true";
} else {
$Done = "";
}
}
$SP = $StartPoint - 1;
$EP = $EndPoint - 1;
@daily = @good[$SP..$EP];
if ($Done ne "true") {
$NextStart = $EndPoint + 1;
$NextWording = qq([Next Topics]);
} else {
$NextWording = "";
}
if ($MatchTotal == 0) {
$StartPoint = 0;
}
print<
$BBName - Today's Active Topics
$HeaderInsert
$Header
|
Today's Active Topics: Public Forums Only
|
Displaying Topics $StartPoint - $EndPoint ($MatchTotal total) $NextWording |
$SearchOption Back to Forums
|
$BorderTop
Topic
|
Last Posted To
|
Forum
|
TOP
for $eachone(@daily) {
@goodline = split(/\|/, $eachone);
chomp($goodline[5]);
@GetForumName = &GetForumRecord("$goodline[0]");
$ForumName = "$GetForumName[1]";
$HyphenIt = "$goodline[3]";
($ThisMo, $ThisDay, $ThisYear) = split(/-/, $HyphenIt);
if ($DateFormat eq "US") {
$TheDate = "$HyphenIt";
$DateSize = "2";
}
elsif ($DateFormat eq "Euro") {
$TheDate = "$ThisDay-$ThisMo-$ThisYear";
$DateSize = "2";
}
elsif ($DateFormat eq "USX") {
$TheDate = &DateFormat("$HyphenIt", "USExpanded");
$DateSize = "1";
} else {
$TheDate = &DateFormat("$HyphenIt", "EuroExpanded");
$DateSize = "1";
}
if (-e "$NonCGIPath/Forum$goodline[0]/HTML/$goodline[1].html") {
print<
$goodline[4]
|
$TheDate
|
$ForumName
|
ROW
}
}
print<
$BorderBottom
$NextWording
$YourCopyrightNotice
Powered by:
Ultimate Bulletin Board
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 -1999.
$Footer