#!/usr/bin/perl # ### PRIMARY UBB SCRIPT ## # # Ultimate Bulletin Board is copyright Infopop Corporation, 1998-2000. # # ------------ forumdisplay.cgi ------------- # # This file contains the functionality for the UBB # individual forum page display. # # Infopop Corporation offers no # warranties on this script. The owner/licensee of the script is # solely responsible for any problems caused by installation of # the script or use of the script, including messages that may be # posted on the BB. # # All copyright notices regarding the Ultimate Bulletin Board # must remain intact on the scripts and in the HTML # for the scripts. # # For more info on the Ultimate BB, # see http://www.UltimateBB.com # ############################################################### # #If you are running UBB on IIS, #you may need to add the following line #if so, just remove the "#" sign before the print line below #print "HTTP/1.0 200 OK\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 "Date.pl"; require "mods.file"; require "ubb_library.pl"; }; print ("Content-type: text/html\n\n"); &ReadParse; foreach $row(@in) { ($Name, $Value) = split ("=", $row); $Name = &decodeURL($Name); $Value = &decodeURL($Value); if ($Name eq "forum") { $Forum = $Value; $Forum =~ s/\/\\//g; $ForumCoded = &HTMLIFY($Forum); $ForumCoded =~ tr/ /+/; $Forum = &UNHTMLIFY($Forum); } if ($Name eq "TopicSubject") { $TopicSubject = $Value; $TopicSubject =~ s/<.+?>//g; $TopicSubject = &UNHTMLIFY($TopicSubject); } if ($Name eq "UserName") { $UserName = $Value; $UserNameFile = $UserName; $UserNameFile =~ s/ /_/g; #remove spaces } if ($Name eq "BypassCookie") { $BypassCookie = $Value; } if ($Name eq "category") { $category = $Value; $CategoryName = &GetCatName($category); } if ($Name eq "PasswordConfirm") { $PasswordConfirm = $Value; } if ($Name eq "number") { $number = $Value; unless($number =~ /^A:\d{6}$/i) { $number =~ s/\D//sg; } } if ($Name eq "DaysPrune") { $DaysPrune = $Value; } if ($Name eq "topic") { $topic = $Value; } if ($Name eq "TotalPosts") { $TotalPosts = $Value; } if ($Name eq "sendto") { $sendto = $Value; } } # end FOREACH $row if ($VariablesPath eq "") { $VariablesPath = $CGIPath; } if (-e "$ForumsPath/Forum$number/forumstyles.file") { require "$ForumsPath/Forum$number/forumstyles.file"; $use_forum_styles++; } else { require "$VariablesPath/Styles.file"; } $infopopcopy =~ s/\"\"/\"$CopyrightTextColor\"/; # fix missing copyright text color in custom styles my $RegLinkHere = ""; unless ($DisplayRegistration eq "NO") { $RegLinkHere = qq(profile | register |); } if ($AllowSearch eq "FALSE") { $SearchOption = ""; } else { $SearchOption = qq(| search); } if ($use_forum_styles) { # set above with -e $Header = $ForumHeader unless ($ForumHeader eq ''); $Footer = $ForumFooter unless ($ForumFooter eq ''); } if( ($Header ne "") || ($Footer ne "") ) { #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(
); $BorderBottom = qq(
); } else { $TableWidth2 = $TableWidth; $BorderTop = ""; $BorderBottom = ""; } if ($BBStatus eq "OFF") { &StandardHTML($BBClosedMessage); exit; } $ReplyMessage = $in{'ReplyMessage'}; $Message = $in{'Message'}; $SubjectCoded = &HTMLIFY($TopicSubject); $SubjectCoded =~ tr/ /+/; if (@in == 0) { &Topics; exit; } if ($in{'action'} eq "topics") { &Topics; exit; } if ($in{'action'} eq "idcheck") { #&HackChecker; &idcheck; } if ($in{'action'} eq "displayprivate") { &DisplayPrivate; } sub Topics { if ($number eq "") { &StandardHTML("You did not select a specific forum or archive. Please go back and try again."); exit; } &get_cookie; #retrieves all current cookies $SessionLogin = "$cookie{sessionLogin}"; $SessionLoginDT = "$cookie{sessionLoginDT}"; #check to see if forum is private! if ($number =~ /A/) { ($junk, $ArchiveNumber) = split(/\:/, $number); &DisplayArchive($ArchiveNumber); exit; } @thisforum = &GetForumRecord($number); if ($thisforum[8] eq "") { &StandardHTML("We could not find that forum or archive. Please go back and try again."); exit; } $category = $thisforum[0]; $CategoryName = &GetCatName($category); $ForumPW = $thisforum[12]; $LWA = $thisforum[6]; if ($LWA eq "private") { $ReplyRestrict = "restrict"; $TopicRestrict = "restrict"; } else { ($TopicRestrict, $ReplyRestrict) = split("&", $LWA); } $Moderator = ("Forum" . "$number" . "Moderator"); $Moderator = $$Moderator; #split up Mod var @mods = split(/\|\|\^\|\|/, $Moderator); if ($LWA eq "private") { $PrivateMax = $thisforum[13]; chomp($PrivateMax); #check for private cookies to see if we can proceed immediately $PasswordPrivate = "$cookie{PasswordPrivate}"; $UserNamePrivate = "$cookie{UserNamePrivate}"; $NumbersPrivate = "$cookie{ForumNumberPrivate}"; $DIRPW = "$thisforum[7]"; $ExactPath = "Forum$number/private-$DIRPW"; if ($PasswordPrivate ne "") { &VerifyID; if (($ForumPW ne "") && ($ProceedNow ne "true")) { &ConfirmIdentity; exit; } } else { &ConfirmIdentity; exit; } } else { $DIRPW = ""; $ExactPath = "Forum$number"; $ProceedNow = "true"; } if ($ProceedNow eq "true") { if ($DaysPrune eq "") { $DaysPrune = "$cookie{DaysPrune}"; } if ($DaysPrune eq "") { $DaysPrune = $DaysPruneDefault; } if ($in{'start'} eq "here") { $AddNewSessionLogin = "true"; } $Forum = $thisforum[1]; $CustomTitle = $thisforum[9]; chomp($CustomTitle); if ($CustomTitle eq "") { $CustomTitle = "$BBTitle"; } if ($TopicRestrict eq "restrict") { $TopicLegend = "New Topics: Only authorized users may post new topics in this forum."; } elsif ($TopicRestrict eq "allreg") { $TopicLegend = "New Topics: All registered users may post new topics in this forum."; } else { $TopicLegend = "New Topics: Any visitors (including unregistered) may post new topics in this forum."; } if ($ReplyRestrict eq "restrict") { $ReplyLegend = "Replies: Only authorized users may post replies to topics in this forum."; } elsif ($ReplyRestrict eq "allreg") { $ReplyLegend = "Replies: All registered users may post replies in this forum."; } elsif ($ReplyRestrict eq "all") { $ReplyLegend = "Replies: Any visitors (including unregistered) may post replies in this forum."; } else { $ReplyLegend = "Replies: No replies are permitted in this forum."; } $ForumCoded = &HTMLIFY($Forum); $ForumCoded =~ tr/ /+/; foreach $unomod(@mods) { chomp($unomod); $ModNumber = &GetUserNumber($unomod); if ($ModNumber ne "") { @theprofile = &OpenProfile("$ModNumber.cgi"); $ModeratorEmail = "$theprofile[2]"; if ($ModeratorLine ne "") { $ModeratorLine .= qq(, $unomod); } else { $ModeratorLine = qq($unomod); } } } #are icons allowed? - ICON CONCEPT BY KOMBAT03! if ($AllowIcons eq "TRUE") { $IconFieldHeader = qq( ); } else { $IconFieldHeader = ""; } #Check Announcements &CheckAnnouncements("$number"); &TopicTopHTML; &CurrentDate; if ($DaysPrune eq "1000") { $DPJulian = 0; } else { $DPJulian = $CurrentJulian - $DaysPrune; } ##### create new threads summary file, if necessary unless (-e "$ForumsPath/$ExactPath/forum$number.threads") { my $CreateThreadFile = "yes"; &ForumSummary($number); } # end UNLESS THREADS SUMMARY EXISTS ########## if ($CreateThreadFile ne "yes") { #open thread file online @thefinalarray = &OpenFile("$ForumsPath/$ExactPath/forum$number.threads"); } $TotalTopics = @thefinalarray; #open last number file @foruminfo = &OpenFile("$ForumsPath/$ExactPath/lastnumber.file"); chomp($foruminfo[1]); $LastNumberVerify = $foruminfo[1] + 0; if ($TotalTopics != $LastNumberVerify) { &SetThreadInfo; &ForumSummary($number); @sortfinalarray = sort(@finalarray); } else { @sortfinalarray = sort(@thefinalarray); } @finalarray = reverse(@sortfinalarray); ## @finalarray hold thread summary used to display page $x = $number; #set Days Prune variable to 3 digits for matching-- if ($DaysPrune == 1) { $Days1 = "SELECTED"; } elsif ($DaysPrune == 2) { $Days2 = "SELECTED"; } elsif ($DaysPrune == 5) { $Days5 = "SELECTED"; } elsif ($DaysPrune == 10) { $Days10 = "SELECTED"; } elsif ($DaysPrune == 20) { $Days20 = "SELECTED"; } elsif ($DaysPrune == 30) { $Days30 = "SELECTED"; } elsif ($DaysPrune == 45) { $Days45 = "SELECTED"; } elsif ($DaysPrune == 60) { $Days60 = "SELECTED"; } elsif ($DaysPrune == 75) { $Days75 = "SELECTED"; } elsif ($DaysPrune == 100) { $Days100 = "SELECTED"; } elsif ($DaysPrune == 1000) { $Days1000 = "SELECTED"; } else { $Days365 = "SELECTED"; } &TopicMidHTML; $Count = 0; CHECKEACH: for $eachone(@finalarray) { chomp($eachone); @threadinfo2 = split(/\|\^\|/, $eachone); if ($threadinfo2[2] eq "") { next CHECKEACH; } $PostDateJulian2 = $threadinfo2[0]; ($PostDateJulian, $junk) = split(/\./, $PostDateJulian2); #do date compare on post julian if ($PostDateJulian >= $DPJulian) { push(@goodarray2, $eachone); } else { last CHECKEACH; } } #foreach eachone $TotalGood2 = @goodarray2; $TotalGood = $TotalGood2 - 1; #check to see if we need to truncate this list unless (($ForumDisplayMax eq "") || ($ForumDisplayMax eq "NONE")) { $Sections = $TotalGood2 / $ForumDisplayMax; $Sections = "$Sections"; if ($Sections =~ /\./) { ($Whole, $junk) = split(/\./, $Sections); $Sections = $Whole; } else { $Sections = $Sections - 1; } if ($in{'startpoint'} eq "") { $StartPoint = 0; $ArrayStop = $ForumDisplayMax - 1; if ($TotalGood <= $ArrayStop) { $MoreTopicsWording = ""; $ArrayStop = $TotalGood; } else { for ($Section = 0; $Section <= $Sections; $Section++) { $Starting = $Section * $ForumDisplayMax; $Block = $Section + 1; if ($Block == 1) { $MoreTopicsWording .= qq($Block ); } else { $MoreTopicsWording .= qq($Block ); } } } } else { $StartPoint = $in{'startpoint'}; $ArrayStop = $StartPoint + $ForumDisplayMax; $ArrayStop--; if ($TotalGood <= $ArrayStop) { $ArrayStop = $TotalGood; } for ($Section = 0; $Section <= $Sections; $Section++) { $Starting = $Section * $ForumDisplayMax; $Block = $Section + 1; if ($StartPoint == $Starting) { $MoreTopicsWording .= qq($Block ); } else { $MoreTopicsWording .= qq($Block ); } } } if ($MoreTopicsWording ne "") { $MoreTopicsW = ("Page: $MoreTopicsWording"); } @truncate = @goodarray2[$StartPoint... $ArrayStop]; @goodarray3 = sort(@truncate); @goodarray2 = reverse(@goodarray3); } foreach $goodie(@goodarray2) { chomp($goodie); @threadinfo = split(/\|\^\|/, $goodie); $ClosedItem = $threadinfo[6]; chomp($ClosedItem); $ReplyCount=$threadinfo[3]; #format date $ThisYear = substr($threadinfo[5], 0, 4); $ThisMonth = substr($threadinfo[5], 4, 2); $ThisDay = substr($threadinfo[5], 6, 2); $hour = substr($threadinfo[5], 8, 2); $min = substr($threadinfo[5], 10, 2); $HyphenIt = "$ThisMonth-$ThisDay-$ThisYear"; if ($DateFormat eq "US") { $TheDate = "$ThisMonth-$ThisDay-$ThisYear"; $DateWording = "All dates are in Month-Day-Year format."; $DateSize = "2"; } elsif ($DateFormat eq "Euro") { $TheDate = "$ThisDay-$ThisMonth-$ThisYear"; $DateWording = "All dates are in Day-Month-Year format."; $DateSize = "2"; } elsif ($DateFormat eq "USX") { $TheDate = &DateFormat("$HyphenIt", "USExpanded"); $DateSize = "1"; } else { $TheDate = &DateFormat("$HyphenIt", "EuroExpanded"); $DateSize = "1"; } $TopicJulianDT = $threadinfo[0]; #format time option 1 if ($TimeFormat eq "24HR") { $FormatTime = "$hour:$min"; } &NormalTime; #format time option 2 if ($TimeFormat eq "AMPM") { $FormatTime = "$hour:$min $AMPM"; } if ($SessionLogin eq "") { if ($ClosedItem =~ /X/) { $FolderIcon = ""; } else { if (($HotIcons eq "ON") && ($ReplyCount > $HotCount)) { $FolderIcon = ""; } else { $FolderIcon = ""; } } } else { if ($TopicJulianDT > $SessionLogin) { if ($ClosedItem =~ /X/) { $FolderIcon = ""; } else { if (($HotIcons eq "ON") && ($ReplyCount > $HotCount)) { $FolderIcon = ""; } else { $FolderIcon = ""; } } $NewThreadPosts = "yes"; } else { if ($ClosedItem =~ /X/) { $FolderIcon = ""; } else { if (($HotIcons eq "ON") && ($ReplyCount > $HotCount)) { $FolderIcon = ""; } else { $FolderIcon = ""; } } $NewThreadPosts = "no"; } } if ($AllowIcons eq "TRUE") { my $IconNumber = $threadinfo[7]; chomp($IconNumber); if ($IconNumber eq "") { $IconNumber = "1"; } unless (-e "$NonCGIPath/icons/icon$IconNumber.gif") { $IconNumber = "1"; } $IconField = qq(); } else { $IconField = ""; } &TopicGutsHTML; } #end foreach goodarray &TopicBottomHTML; &GetForumSelectList; if ($SessionLogin ne "") { &TopicBottom2JShtml; } else { &TopicBottom2NonJShtml; } } else { $AccessWording = qq(We cannot confirm your access rights... please identify yourself below.); &ConfirmIdentity; exit; } # if proceednow = true } ## END TOPICS SR #### sub CheckAnnouncements { $ForumNumber = shift; opendir (GETANNC, "$ForumsPath/$ExactPath/ANNC"); @forummsgs = readdir(GETANNC); closedir (GETANNC); @announcements = grep(/annc/, @forummsgs); #now we have all announcements in the forum #need to figure out which ones are live $NewAnnounce = ""; for $eachannc(@announcements) { $Live = ""; $Dead = ""; ($start, $end, $trash) = split("-", $eachannc); &DateCompare("$start", "$end"); if ($Live eq "true") { $sortline = ("$StartJulian|$eachannc"); push(@livelist, $sortline); } $StartJulian = ($StartJulian + .99); if ($StartJulian > $SessionLogin) { $NewAnnounce = "true"; } if ($Dead eq "true") { unlink ("$ForumsPath/$ExactPath/ANNC/$eachannc"); } } #end For $eachannc #now we have our list of announcements @thesortlist = sort(@livelist); #sort list @sortlist = reverse(@thesortlist); #reverse it, latest first $ListTotal = @sortlist; ($junk, $anncfile) = split(/\|/, $sortlist[0]); if ($ListTotal < 1) { $AnnouncementBlock = ""; } else { if ($NewAnnounce eq "true") { open (LATEST, "$ForumsPath/$ExactPath/ANNC/$anncfile"); @latest = ; close (LATEST); $LatestTitle = $latest[1]; chomp($LatestTitle); $AnnouncementBlock = "\"New   $LatestTitle"; } else { open (LATEST, "$ForumsPath/$ExactPath/ANNC/$anncfile"); @latest = ; close (LATEST); $LatestTitle = $latest[1]; chomp($LatestTitle); $AnnouncementBlock = "\"Announcements\"  $LatestTitle"; } } } #end CheckAnnouncements sr # HTML SUBROUTINES ASSOCIATED WITH THE # FORUM PAGE DISPLAY ARE LISTED BELOW--- sub TopicTopHTML { &GetCookieInfo; if ($SetCookies eq "DirectorySpecific") { $ExtraInfo = qq(domain=$TheDomain;path=/$ThePath;); } else { $ExtraInfo = ""; } &GetDateTime; print < $BBName $HeaderInsert $Header TOP } ## END TOPIC TOP HTML sr sub TopicMidHTML { if ($CategoriesOnly eq "true") { $FolderLine = qq(  $CategoryName
  $Forum); } else { $FolderLine = qq(  $Forum); } print <

$Forum
(moderated by $ModeratorLine)

$AnnouncementBlock

  $BBName
$FolderLine

Post New Topic
$RegLinkHere preferences | faq $SearchOption

$TopicLegend
$ReplyLegend
$BorderTop $IconFieldHeader OtherMiddle } ## END Middle HTML for Topic Page sub TopicGutsHTML { if ($PrivateMax eq "yes") { $ThisURL = qq($CGIURL/forumdisplay.cgi?action=displayprivate&number=$number&topic=$threadinfo[1]); } else { $ThisURL = qq($NonCGIURL/$ExactPath/HTML/$threadinfo[1].html); } print < $IconField GUTS } ## END Guts HTML for Topic Page sub TopicBottomHTML { print< $BorderBottom
  Topic Topic Starter Replies Last Post
$FolderIcon $threadinfo[2] $threadinfo[4] $threadinfo[3] $TheDate $FormatTime
$MoreTopicsW

All times are $TimeZone. $DateWording
Hop to:
No New Posts  Contains new posts since the last time you logged on $RedHot.
No New Posts  No new posts since the last time you logged on $YellowHot.
Closed Thread  A Closed thread - no new replies accepted.
Post New Topic

TrueTopicBottom &PageBottomHTML; } sub TopicBottom2NonJShtml { if ($HotIcons eq "ON") { $YellowHot = "(\"Hot  More than $HotCount replies)"; } else { $YellowHot = ""; } print< No New Posts  An Open Thread $YellowHot.
\"Closed  A Closed thread - no new replies accepted.

Post New Topic

TrueTopicBottom &PageBottomHTML; } sub idcheck { #open member file to see if user can access private forum if (($in{'UserName'} eq "") || ($in{'Password'} eq "")) { &StandardHTML("You did not complete all required form fields! Please go back and re-enter."); } else { #open registration file, if possible $NameFound = "no"; $ProfileNumber = &GetUserNumber($in{'UserName'}); if ($ProfileNumber ne "") { $NameFound = "yes"; } else { $NameFound = "no"; } $AllowedToEnter = ""; if ($NameFound eq "yes") { @theprofile = &OpenProfile("$ProfileNumber.cgi"); if ($in{'Password'} eq "$theprofile[1]") { $Permission = $theprofile[4]; $Status = $theprofile[8]; if ($Permission =~ /\&/) { ($junk, $forumnumbers) = split(/\&/, $Permission); chomp($forumnumbers); if ($forumnumbers =~ /,/) { @forumnums = split(",", $forumnumbers); } else { @forumnums = "$forumnumbers"; } } #check against forum password, if necessary @thisforum = &GetForumRecord($in{'forumnumber'}); if ($thisforum[12] ne "") { if ($in{'ForumPassword'} eq "$thisforum[12]") { $PasswordCheck = "true"; } } my $PermissionCheck = "false"; CHECKPERM: foreach $theesone(@forumnums) { if ($theesone eq "$in{'forumnumber'}") { $PermissionCheck = "true"; last CHECKPERM; } } $ThisNumber = $in{'forumnumber'}; $UserName = &decodeURL("$in{'UserName'}"); &CheckModStatus("Forum$in{'forumnumber'}", "$UserName"); if (($Status eq "Administrator") || ($PermissionCheck eq "true") || ($ModMatch eq "yes") || ($PasswordCheck eq "true")) { &GrantAccess; } else { &StandardHTML("Sorry, but you are not permitted to access this forum."); } } else { &StandardHTML("The password you entered was not correct. Please use your back button to try again."); } } else { &StandardHTML("We have no record of anyone registered with the name you entered. Please use your back button to try again."); } } } # end id check sub ConfirmIdentity { if ($ForumPW ne "") { $FPWWording = qq(If you are not an administrator or moderator and have not been given specific permission to access this forum but know the forum password, you must enter the password below in order to gain access. Forum Password:); } else { $FPWWording = ""; } print < $HeaderInsert $Header

P R I V A T E       F O R U M
$BorderTop $FPWWording
$AccessWording

You are attempting to access a private forum. Please identify yourself below. Note that this identification screen will only be required once per browser session (per private forum, if you are accessing via forum passwords), assuming you allow cookies to be stored. We will store your private forum access privileges as a cookie (thus, we highly recommend that you do not disable your cookies in your browser!).

UserName:
Password:
$BorderBottom




To return to Forum Summary, click here.

$Footer CONFIRM } sub GrantAccess { &GetCookieInfo; if ($SetCookies eq "DirectorySpecific") { $ExtraInfo = qq(domain=$TheDomain;path=/$ThePath;); } else { $ExtraInfo = ""; } #get private forum dir @forumarray = &GetForumRecord($in{'forumnumber'}); $PFDir = $forumarray[7]; print< $HeaderInsert $Header

$Footer ForwardHTML } #end GrantAccess sub DisplayPrivate { #verify permission to view #check for private cookies to see if we can proceed immediately &get_cookie; #retrieves all current cookies $PasswordPrivate = "$cookie{PasswordPrivate}"; $UserNamePrivate = "$cookie{UserNamePrivate}"; $NumbersPrivate = "$cookie{ForumNumberPrivate}"; if ($PasswordPrivate ne "") { my @theforum = &GetForumRecord($number); $DIRPW = "$theforum[7]"; &VerifyID; } else { &StandardHTML("Sorry, you have to view this topic by entering the forum first."); exit; } if ($ProceedNow eq "true") { @thisforum = &GetForumRecord($in{'number'}); #open file my @thisfile = &OpenFile("$ForumsPath/Forum$in{'number'}/private-$thisforum[7]/HTML/$in{'topic'}.cgi"); foreach $row(@thisfile) { print "$row"; } exit; } else { &StandardHTML("You do not have permission to view this topic."); exit; } } sub VerifyID { ##check ID using username set as cookie $NameFound = "no"; $ProfileNumber = &GetUserNumber($UserNamePrivate); if ($NumbersPrivate ne "") { if ($NumbersPrivate =~ /\:\:/) { @CheckAccess = split(/\:\:/, $NumbersPrivate); } else { @CheckAccess = $NumbersPrivate; } CHECKER: foreach $checker(@CheckAccess) { chomp($checker); ($checknum, $checkdir) = split(/\:/, $checker); if ($checknum eq "$number") { if ($checkdir eq "$DIRPW") { $ProceedNow = "true"; last CHECKER; } else { &StandardHTML("We cannot confirm your identity."); exit; } #if checkdir }# if checknum } #foreach } #if np if ($ProceedNow ne "true") { if ($ProfileNumber ne "") { $NameFound = "yes"; } else { $NameFound = "no"; } @thisprofile = &OpenProfile("$ProfileNumber.cgi"); if ($PasswordPrivate eq "$thisprofile[1]") { $Permission = "$thisprofile[4]"; $Status = $thisprofile[8]; ($GenPerms, $SpecificPerms) = split(/\&/, $Permission); $Moderator = ("Forum" . "$number" . "Moderator"); $Moderator = $$Moderator; #split up Mod var @mods = split(/\|\|\^\|\|/, $Moderator); $ModMatch = ""; foreach $unomod(@mods) { if ($unomod eq "$UserNamePrivate") { $ModMatch = "true"; } } if (($Status eq "Administrator") || ($ModMatch eq "true")) { $ProceedNow = "true"; } if (($SpecificPerms ne "") && ($ProceedNow ne "true")){ chomp($specificPerms); @accessarray = split(",", $SpecificPerms); CHECKARRAY: foreach $uno(@accessarray) { if ($uno eq "$number") { $ProceedNow = "true"; last CHECKARRAY; } } } } } } #end VerifyID sub DisplayArchive { my $ThisArchive = shift; if (-e "$NonCGIPath/Archives/archives.pl") { @archives = &OpenFile("$NonCGIPath/Archives/archives.pl"); foreach $uno(@archives) { if ($uno =~ /^$ThisArchive/) { ($ArchiveNum, $ArchiveName, $ArchiveDescription) = split(/\|\#\|/, $uno); $ArchiveDescription =~ s/"/"/isg; $ArchiveDescription =~ s/|/\|/isg; } } if ($ArchiveName eq "") { &StandardHTML("We could not find that archive. Perhaps it has recently been deleted. Please your back button to return."); exit; } } else { &StandardHTML("No archives currently exist."); exit; } if (-e "$NonCGIPath/Archives/Archive-$ArchiveNum/archives.thread") { @thisarchive2 = &OpenFile("$NonCGIPath/Archives/Archive-$ArchiveNum/archives.thread"); } else { @thisarchive2 = @blank; } @goodarray2 = sort {lc($a) cmp lc($b) } @thisarchive2; $TotalGood2 = @goodarray2; $TotalGood = $TotalGood2 - 1 ; my $ADMax = 50; $Sections = $TotalGood2 / $ADMax; $Sections = "$Sections"; if ($Sections =~ /\./) { ($Whole, $junk) = split(/\./, $Sections); $Sections = $Whole; } else { $Sections = $Sections - 1; } if ($in{'startpoint'} eq "") { $StartPoint = 0; $ArrayStop = $ADMax - 1; if ($TotalGood <= $ArrayStop) { $MoreTopicsWording = ""; $ArrayStop = $TotalGood; } else { for ($Section = 0; $Section <= $Sections; $Section++) { $Starting = $Section * $ADMax; $Block = $Section + 1; if ($Block == 1) { $MoreTopicsWording .= qq($Block ); } else { $MoreTopicsWording .= qq($Block ); } } } } else { $StartPoint = $in{'startpoint'}; $ArrayStop = $StartPoint + $ADMax; $ArrayStop--; if ($TotalGood <= $ArrayStop) { $ArrayStop = $TotalGood; } for ($Section = 0; $Section <= $Sections; $Section++) { $Starting = $Section * $ADMax; $Block = $Section + 1; if ($StartPoint == $Starting) { $MoreTopicsWording .= qq($Block ); } else { $MoreTopicsWording .= qq($Block ); } } } if ($MoreTopicsWording ne "") { $MoreTopicsW = ("Page: $MoreTopicsWording"); } @goodarray3 = @goodarray2[$StartPoint... $ArrayStop]; print< $BBName $HeaderInsert $Header

$ArchiveName
$ArchiveDescription

  $BBName
  $ArchiveName

$RegLinkHere preferences | faq $SearchOption

Archive Topics are listed alphabetically below.
$BorderTop TOP $AltColor = "$AltColumnColor1"; if (@goodarray3) { foreach $one(@goodarray3) { @thisone = split(/\|\#\|/, $one); chomp($thisone[3]); ($theDate, $junk, $junk2) = split(/-/, $thisone[1]); my $ThisYear = substr($theDate, 0, 4); my $ThisMonth = substr($theDate, 4, 2); my $ThisDay = substr($theDate, 6, 2); my $StoredDate = "$ThisMonth-$ThisDay-$ThisYear"; if ($DateFormat eq "US") { $FormatDate = $StoredDate; $DateSize = "$TextSize"; } elsif ($DateFormat eq "Euro") { $FormatDate = &DateFormat("$StoredDate", "Euro"); $DateSize = "$TextSize"; } elsif ($DateFormat eq "USX") { $FormatDate = &DateFormat("$StoredDate", "USExpanded"); $DateSize = "1"; } else { $FormatDate = &DateFormat("$StoredDate", "EuroExpanded"); $DateSize = "1"; } print< GUTS if ($AltColor eq "$AltColumnColor1") { $AltColor = "$AltColumnColor2"; } else { $AltColor = "$AltColumnColor1"; } } } else { print< GUTS } print< $BorderBottom
Archive TopicsTopic StarterDate Archived
$thisone[0]$thisone[2]$FormatDate
This archive is currently empty!

This is an archive. All archives are strictly read-only. To post messages, visit one of our forums.

$MoreTopicsW

Hop to:

NearBottom &PageBottomHTML; } exit(0); # comply with SafePerl