#!/usr/bin/perl # ### PRIMARY FREEWARE UBB SCRIPT ## # # Ultimate Bulletin Board is copyright Infopop Corporation, 1998-1999. # # ------------ Ultimate.cgi ------------- # # This file contains intro 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; } if ($Name eq "Email") { $Email = $Value; $Email =~tr/A-Z/a-z/; } if ($Name eq "URL") { $URL = &CleanThis($Value); $URL = &PipeCleaner($URL); } if ($Name eq "Permissions") { $Permissions = $Value; } if ($Name eq "Occupation") { $Occupation = &CleanThis($Value); $Occupation = &PipeCleaner($Occupation); } if ($Name eq "Location") { $Location = &CleanThis($Value); $Location = &PipeCleaner($Location); } if ($Name eq "TotalPosts") { $TotalPosts = $Value; } if ($Name eq "Status") { $Status = $Value; } if ($Name eq "Interests") { $Interests = &CleanThis($Value); $Interests = &PipeCleaner($Value); } if ($Name eq "sendto") { $sendto = $Value; } } # end FOREACH $row if ($VariablesPath eq "") { $VariablesPath = $CGIPath; } $SubjectCoded = &HTMLIFY($TopicSubject); $SubjectCoded =~ tr/ /+/; if (@in == 0) { &Intro; } if ($in{'action'} eq "intro") { &Intro; } if ($in{'action'} eq "noncoppareg") { &Agree; } if ($in{'action'} eq "agree") { if ($COPPACheck eq "ON"){ &COPPACheck; } else { &Agree; } } if ($in{'action'} eq "email") { &DoEmail($in{'ToWhom'}); } if ($in{'action'} eq "register") { &Register; } if ($in{'action'} eq "showcoppaform") { &PrintCOPPARegistrationHTML; } if ($in{'action'} eq "rules") { &Rules; } if ($in{'action'} eq "lostpw") { if ($UseEmail eq "ON") { &LostPW; } else { &StandardHTML("Sorry, but this feature is not available, per your administrator's directions. Use your back button to return to the BB."); } } ## INTRO PAGE SUBROUTINES #### sub Intro { &GetDateTime; &ForumsTopHTML; open (FORUMFILE, "$VariablesPath/forums.cgi"); @forums = ; close (FORUMFILE); @forums = grep(/\|/, @forums); @sortforums = @forums; for (@sortforums) { @thisforuminfo = split(/\|/, $_); chomp($thisforuminfo[8]); $x = "$thisforuminfo[8]"; $GetHour = ""; $GetMinute = ""; $MilHour = ""; $TheDate = ""; $LatestTime = ""; ## Get Forum Data from lastnumber.file(s) open (FORUMDATA, "$ForumsPath/Forum$x/lastnumber.file"); my @data = ; close (FORUMDATA); $TotalTopics = $data[1]; chomp($TotalTopics); $TotalPosts = $data[2]; chomp($TotalPosts); if ($TotalTopics eq "") { $TotalTopics = "0"; } if ($TotalPosts eq "") { $TotalPosts = "0"; } if ($TotalTopics > 0) { #open lasttime.file for forum open (LTime, "$ForumsPath/Forum$x/lasttime.file"); @lasttime = ; close (LTime); $LastDate = $lasttime[0]; $LastTime = $lasttime[1]; chomp($LastDate); chomp($LastTime); #split time/date ($GetHour, $GetMinute) = split(/:/, $LastTime); ($GetMinute, $AMpm) = split(/ /, $GetMinute); chomp($AMpm); ($GetMonth, $GetDate, $GetYear) = split(/-/, $LastDate); $CheckThisYear = length($GetYear); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $GetYear = ("19" . "$GetYear"); } else { $GetYear = $GetYear - 100; $GetYear = sprintf ("%2d", $GetYear); $GetYear =~tr/ /0/; $GetYear = ("20" . "$GetYear"); } } &MilitaryTime2; $MilTime = "$MilHour:$GetMinute"; if ($TimeFormat eq "24HR") { $LatestTime = "$MilTime"; } else { $LatestTime = "$LastTime"; } if ($DateFormat eq "Euro") { $TheDate = "$GetDate-$GetMonth-$GetYear"; $DateWording = "All dates are in DD-MM-YY format."; } else { $TheDate = "$GetMonth-$GetDate-$GetYear"; $DateWording = "All dates are in MM-DD-YY format."; } } else { $GetMonth = ""; $GetDate= ""; $GetYear = ""; $LatestTime = ""; $TheDate = ""; } @thisforum = &GetForumRecord($x); $ForumName = $thisforum[1]; $Moderator = ("Forum" . "$x" . "Moderator"); $Moderator = $$Moderator; $ForumDesc = $thisforum[2]; $OnOff = $thisforum[3]; chomp($OnOff); $ForumCoded = &HTMLIFY($ForumName); $ForumCoded =~ tr/ /+/; $ForumDesc =~ s/"/"/g; if ($ForumDescriptions eq "no") { $ForumDesc = ""; } if ($GetMonth ne "") { # Compare Last Login Time to Last Post Time.. $LPMonth = $GetMonth; $CheckThisYear = length($GetYear); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $JYear = ("19" . "$GetYear"); } else { $GetYear = $GetYear - 100; $GetYear = sprintf ("%2d", $GetYear); $GetYear =~tr/ /0/; $JYear = ("20" . "$GetYear"); } } else { $JYear = "$GetYear"; } } # end if/else month ne "" if ($OnOff eq "On") { &ForumsGutsHTML; } ## End IF ONOFF Conditional } &ForumsBottomHTML; } #END INTRO SR ### sub ForumsTopHTML { print < $BBName - powered by Infopop Ultimate Bulletin Board
$BBName
profile | register | faq
INTROHTML } ## END FORUMS TOP HTML sub ForumsGutsHTML { print < ForumSummary } ## END FORUMS GUTS HTML sub ForumsBottomHTML { print <

All times are $TimeZone. $DateWording

BOTTOMhtml &PageBottomHTML; } ## END Forums Bottom HTML subroutine ### END Intro Page Subroutines #### sub Agree { print <
Forum Posts Last Post Moderator
$ForumName
$ForumDesc
$TotalPosts $TheDate $LatestTime $Moderator
$BBName Registration


Sorry, but registration for this board is disabled. This facility is only for members of the DCU new enterprise development module. Sorry!

Agreement } sub Register { print< $BBName Registration Sorry, Registration is disabled. This board is only for the usage of members of the DCU New Enterprise Development Module. Sorry!


RegHTML } ## END Register SR ## sub PrintCOPPARegistrationHTML { print <<"COPPA" Permission to Participate at $BBName Sorry, Registration Disabled

COPPA } # end SR sub COPPACheck { # age check &GetDateTime; @months = ("blank" , "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $COPPADate = "$mday $months[$JSMonth] " . ($JSYear-13); print < $HeaderInsert Registration Disabled. $Footer COPPACheck }