#!/usr/bin/perl # ### FREEWARE UBB SCRIPT ## # # Ultimate Bulletin Board is copyright Infopop Corporation, 1998 -2000. # # ------------ forumdisplay.cgi ------------- # # This file contains functionality for the Freeware UBB. # # 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. These "powered by" and copyright notices MUST # remain visible when the pages are viewed on the Internet. # # You may not SELL this script. You may offer it freely to others. # It is freeware. You may not alter the code and then call it another # name. You may not alter the code and then resell it under another # name, either. # # For more info on the Ultimate BB, including licensing info, # 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 "Styles.file"; require "ubb_library.pl"; }; print ("Content-type: text/html\n\n"); if ($@) { print "Error including required files: $@\n"; print "Make sure these files exist, permissions are set properly, and paths are set correctly."; exit; } &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 "PasswordConfirm") { $PasswordConfirm = $Value; } if ($Name eq "number") { $number = $Value; } if ($Name eq "DaysPrune") { $DaysPrune = $Value; } if ($Name eq "topic") { $topic = $Value; } } # end FOREACH $row if ($VariablesPath eq "") { $VariablesPath = $CGIPath; } $SubjectCoded = &HTMLIFY($TopicSubject); $SubjectCoded =~ tr/ /+/; if (@in == 0) { &Topics; } if ($in{'action'} eq "topics") { &Topics; } sub Topics { if ($DaysPrune eq "") { $DaysPrune = "20"; } @thisforum = &GetForumRecord($number); $Moderator = ("Forum" . "$number" . "Moderator"); $Moderator = $$Moderator; $Forum = $thisforum[1]; $CustomTitle = $thisforum[9]; chomp($CustomTitle); $ForumCoded = &HTMLIFY($Forum); $ForumCoded =~ tr/ /+/; @theprofile = &OpenProfile("$Moderator.cgi"); $ModeratorEmail = "$theprofile[2]"; &TopicTopHTML; &CurrentDate; ##### create new day summary file, if necessary unless (-e "$ForumsPath/Forum$number/$RunOnDate.threads") { my $CreateThreadFile = "yes"; &ForumSummary($number); ## REMOVE OLDER .threads file, if necessary # @threadfiles contains list of all thread files foreach $threadfile(@threadfiles) { if ($threadfile ne "$RunOnDate.threads") { unlink ("$ForumsPath/Forum$number/$threadfile"); } } } # end UNLESS THREADS SUMMARY EXISTS ########## if ($CreateThreadFile ne "yes") { #open thread file online open (THREADS, "$ForumsPath/Forum$number/$RunOnDate.threads") or die(&StandardHTML("Unable to read Forum$number thread summary file $!")); @finalarray = ; close (THREADS); } @finalarray = sort(@finalarray); ## @finalarray hold thread summary used to display page $x = $number; #set Days Prune variable to 3 digits for matching-- if ($DaysPrune == 1) { $Days1 = "SELECTED"; @finalarray = grep (/^000|001/, @finalarray); } if ($DaysPrune == 2) { $Days2 = "SELECTED"; @finalarray = grep (/^(000|001|002)/, @finalarray); } if ($DaysPrune == 5) { $Days5 = "SELECTED"; @finalarray = grep (/^(000|001|002|003|004|005)/, @finalarray); } if ($DaysPrune == 10) { $Days10 = "SELECTED"; @finalarray = grep (/^(000|001|002|003|004|005|006|007|008|009|010)/, @finalarray); } if ($DaysPrune == 20) { $Days20 = "SELECTED"; } if ($DaysPrune == 30) { $Days30 = "SELECTED"; } if ($DaysPrune == 45) { $Days45 = "SELECTED"; } if ($DaysPrune == 60) { $Days60 = "SELECTED"; } if ($DaysPrune == 75) { $Days75 = "SELECTED"; } if ($DaysPrune == 100) { $Days100 = "SELECTED"; } if ($DaysPrune == 365) { $Days365 = "SELECTED"; } &TopicMidHTML; CHECKEACH: for $eachone(@finalarray) { @threadinfo = split(/\|\^\|/, $eachone); if ($threadinfo[0] <= $DaysPrune) { #format date my $ThisMonth = substr($threadinfo[2], 4, 2); my $ThisYear = substr($threadinfo[2], 0, 4); my $ThisDay = substr($threadinfo[2], 6, 2); my $JYear = substr($threadinfo[2], 0, 4); $hour = substr($threadinfo[2], 8, 2); $min = substr($threadinfo[2], 10, 2); if ($DateFormat eq "Euro") { $TheDate = "$ThisDay-$ThisMonth-$ThisYear"; $DateWording = "All dates are in Day-Month-Year format."; } else { $TheDate = "$ThisMonth-$ThisDay-$ThisYear"; $DateWording = "All dates are in Month-Day-Year format."; } #format time option 1 if ($TimeFormat eq "24HR") { $FormatTime = "$hour:$min"; } &NormalTime; #format time option 2 if ($TimeFormat eq "AMPM") { $FormatTime = "$hour:$min $AMPM"; } &TopicGutsHTML; } else { #if within prune range last CHECKEACH; } } &TopicBottomHTML; &GetForumSelectList; &TopicBottom2NonJShtml; } ## END TOPICS SR #### sub TopicTopHTML { print < $BBName TOP } ## END TOPIC TOP HTML sr sub TopicMidHTML { print <

$Forum
(moderated by $Moderator)

  $BBName
  $Forum

Post New Topic
profile | register | faq

OtherMiddle } ## END Middle HTML for Topic Page sub TopicGutsHTML { print < GUTS } ## END Guts HTML for Topic Page sub TopicBottomHTML { print<
Topic Originator Replies Last Post
  $threadinfo[4] $threadinfo[6] $threadinfo[5] $TheDate $FormatTime
All times are $TimeZone. $DateWording
Hop to:

Post New Topic

TrueTopicBottom &PageBottomHTML; }