#!/usr/bin/perl # # Ultimate Bulletin Board is copyright Infopop Corporation, 1998-2000. # # ------------ announce.cgi ------------- # 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 "ubb_library2.pl"; require "mods.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; } &ReadParse; if ($in{'action'} eq "center") { &Center; } if ($in{'action'} eq "enter") { &Enter; } if ($in{'action'} eq "submitanncedit") { &SubmitEdit; } if ($in{'action'} eq "reviewannounce") { &RetrieveAnnounce; } if ($in{'action'} eq "submitannounce") { &SubmitNew; } sub SubmitEdit { $GetAll = ""; $UserName = $in{'UserName'}; #re-confirm user $ProfileNumber = &GetUserNumber($UserName); @theprofile = &OpenProfile("$ProfileNumber.cgi"); if ($in{'Password'} eq "$theprofile[1]") { $Status = $theprofile[8]; &CheckStatus; if (($AdminStatus eq "true") || ($ModStatus eq "true")) { &ProceedWithEditWrite; } else { &StandardHTML("Sorry, but you are not authorized to perform this function. Use your Back button."); } } else { &StandardHTML("Sorry, but the password you entered was not correct. Please try again. Use your Back button."); } } #end Submit Edit sr sub RetrieveAnnounce { ## Get current announcement info from file @thisannc = &OpenFile("$in{'EditAnnounce'}"); $message = $thisannc[4]; chomp($message); $author = $thisannc[0]; chomp($author); $subject = $thisannc[1]; chomp($subject); $forumslist = $thisannc[3]; chomp($forumslist); $status = $thisannc[2]; chomp($status); $message =~ s/
/\n\r\n/ig;
$message =~ s/
Note: Only administrators or moderators may edit this announcement.
Contact Us | $MyHomePage $PrivacyStatement
$infopopcopy
/\n/ig;
$message =~ s/
/:\)/isg;
$message =~ s/
/:\(/isg;
$message =~ s/
/\:D/isg;
$message =~ s/
/\;\)/isg;
$message =~ s/
/\:o/isg;
#convert UBB Code
$UBBImages = "ON";
$OverrideImages = "no";
$message = &EditUBBConvert("$message");
#Retrieve names of each forum where displayed
if ($forumslist eq "ALL") {
$forumnames = "All";
} else {
@forumnames = split(/\|/, $forumslist);
foreach $forumname(@forumnames) {
@theforum = &GetForumRecord($forumname);
if ($forumnames ne "") {
$forumnames .= ", $theforum[1]";
} else {
$forumnames = "$theforum[1]";
}
}
}
#get start, end dates
(@splitit) = split("/", $in{'EditAnnounce'});
@sortedfiles = grep(/.annc/, @splitit);
$announcefile = $sortedfiles[0];
$EndMonth = substr($announcefile, 9, 2);
$EndDay = substr($announcefile, 11, 2);
$EditEndYear = substr($announcefile, 13, 4);
$StartMonth = substr($announcefile, 0, 2);
$StartDay = substr($announcefile, 2, 2);
$EditStartYear = substr($announcefile, 4, 4);
print <
Ultimate Bulletin Board $Version