## UBB COMMON ROUTINE LIBRARY sub CheckModStatus { my($forumnumber, $UserName) = @_; $GetModerator = ("$forumnumber" . "Moderator"); $GetModerator = $$GetModerator; if ($GetModerator eq "$UserName") { $ModMatch = "yes"; } else { $ModMatch = "no"; } return ($ModMatch); } sub CheckPermissions { if ($Permission =~ m/Admin/) { $AdminPermission = "true"; } else { $AdminPermission = "false"; } if ($Permission =~ m/Write/) { $PermissionToWrite = "true"; $AdminWrite = "true"; } else { $PermissionToWrite = "false"; $AdminWrite = "false"; } if ($Permission =~ m/Moderator/) { $AdminMod = "true"; } else { $AdminMod = "false"; } } #end CheckPermissions sub CheckTheStatus { if ($Status =~ m/Administrator/) { $AdminStatus = "true"; } else { $AdminStatus = "false"; } if ($Status =~ m/Moderator/) { $ModStatus = "true"; } else { $ModStatus = "false"; } if ($Permission =~ m/Write/) { $AdminWrite = "true"; } else { $AdminWrite = "false"; } } #end CheckTheStatus sub ConvertForums2HTML { my($ForumNumber) = shift; my($ForumTotal) = shift; my($StartWith) = shift; $number = "$ForumNumber"; @thisforum = &GetForumRecord($number); $Forum = $thisforum[1]; $ForumCoded = &HTMLIFY($Forum); $ForumCoded =~ tr/ /+/; #retrieve all topics opendir (GETTHREADS, "$ForumsPath/Forum$number"); @threads = readdir (GETTHREADS); closedir (GETTHREADS); @threads = grep(/\.ubb/, @threads); @threads = sort(@threads); ($lonumber, @junky) = split(/\./, $threads[0]); $LowNumber = $lonumber + 0; #limit processing to 300 threads at a time $Start = $StartWith + 0; if ($LowNumber > $StartWith) { $Start = $LowNumber; } $End = $Start + 300; #determine highest thread number! @highest = reverse(@threads); ($hinumber, @junk) = split(/\./, $highest[0]); $High = $hinumber + 0; $GoToNextForum = ""; if ($High <= $End) { $End = $High; $GoToNextForum = "true"; } $Stop = ""; my $New = ""; my $Last = ""; CHECKEACH: for $eachthread(@threads) { $ThreadNum = substr($eachthread, 0, 6); $ThreadNumber = $ThreadNum + 0; $Last = $New; if (($ThreadNumber >= $Start) && ($ThreadNumber <= $End)) { chomp($eachthread); $New = "true"; &CreateThreadHTML("Forum$number", "$eachthread"); } else { $New = "false"; } if (($New eq "false") && ($Last eq "true")) { last CHECKEACH; } } #end for threads loop if ($GoToNextForum eq "true") { $number++; $previous = ($number - 1); $StartWith = 0; } else { $previous = $number; $StartWith = $End + 1; } $UserName =~ tr/ /+/; $Password =~ tr/ /+/; if ($number <= $TotalForums) { print<
Processing....

We are updating each of your existing threads to reflect all current settings in the control panel.

Forum $previous is currently being updated. Please wait while we continue updating!

We just finished updating threads $Start through $End in Forum $previous

NEXT } else { print<

All threads have been updated to reflect your current control panel settings.

Thank you!

CONFIRM } } # end ConvertForums2HTML sr sub CreateThreadHTML { my($ForumIs) = shift; my($ThreadFile) = shift; $ThreadNumber = substr($ThreadFile, 0, 6); my @threadinfo = &OpenThread("$ThreadFile"); @statarray = split(/\|\|/, $threadinfo[0]); $UNCoded = $statarray[3]; $UNCoded =~ tr/ /+/; $TopicSubject = $statarray[4]; chomp($TopicSubject); $SubjectCoded = &HTMLIFY($TopicSubject); $SubjectCoded =~ tr/ /+/; #PRINT THREAD TOP--- unless (-d "$ForumsPath/$ForumIs/HTML") { mkdir("$ForumsPath/$ForumIs/HTML", 0777); chmod (0777, "$ForumsPath/$ForumIs/HTML"); } ($trash, $number) = split("Forum", $ForumIs); #@thisforum = &GetForumRecord($number); $ThisThread = qq($TopicSubject - $BBName

  $BBName
  $Forum
  $TopicSubject

Post New Topic  
profile | register | faq

); @fatherarray = split(/\|\|/, $threadinfo[1]); $theDate = "$fatherarray[3]"; #format date @datearray = split(/-/, $theDate); chomp($datearray[2]); $YearCheck = $datearray[2]; $YearCheck = $YearCheck + 0; $CheckThisYear = length($YearCheck); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $TheYear = ("19" . "$YearCheck"); } else { $TheYear = $YearCheck - 100; $TheYear = sprintf ("%2d", $TheYear); $TheYear =~tr/ /0/; $TheYear = ("20" . "$TheYear"); } } else { $TheYear = $YearCheck; } if ($DateFormat eq "Euro") { $ThisDate = "$datearray[1]-$datearray[0]-$TheYear"; } else { $ThisDate = "$datearray[0]-$datearray[1]-$TheYear"; } chomp($fatherarray[6]); $theTime = "$fatherarray[4]"; #format time option 1 if ($TimeFormat eq "24HR") { ($SplitTime, $TheAMPM) = split(/ /, $theTime); chomp($TheAMPM); ($gethr, $getmin) = split(/:/, $SplitTime); &ConvertTo24Hour; $FormatTime = "$gethr:$getmin"; } else { $FormatTime = "$theTime"; } ## PRINT THREAD GUTS #get topic writer's email view status @thisprofile = &OpenProfile("$statarray[3].cgi"); $EmailView = $thisprofile[11]; if (($EmailBlock eq "ON") || ($EmailView eq "no")) { $EmailString = " "; } else { $EmailString = qq(  Click Here to Email $statarray[3]  ); } $ThisThread .= qq(
); #get Replies to this topic my $TotalReplies = $statarray[2]; if ($TotalReplies > 0) { $AlternateColor = "#dedfdf"; foreach $line(@threadinfo) { @thisline = split(/\|\|/, $line); $ReplyNo = $thisline[1] + 0; if (($thisline[0] eq "Z") && ($ReplyNo > 0)) { $UserNameCoded = $thisline[2]; $UserNameCoded =~ tr/ /+/; $theDate = "$thisline[3]"; #format date @datearray = split(/-/, $theDate); chomp($datearray[2]); $YearCheck = $datearray[2]; $YearCheck = $YearCheck + 0; $CheckThisYear = length($YearCheck); if ($CheckThisYear < 4) { if ($CheckThisYear == 2) { $TheYear = ("19" . "$YearCheck"); } else { $TheYear = $YearCheck - 100; $TheYear = sprintf ("%2d", $TheYear); $TheYear =~tr/ /0/; $TheYear = ("20" . "$TheYear"); } } if ($DateFormat eq "Euro") { $ThisDate = "$datearray[1]-$datearray[0]-$TheYear"; } else { $ThisDate = "$datearray[0]-$datearray[1]-$TheYear"; } #format time if ($TimeFormat eq "24HR") { @timearray = split(/ /, $thisline[4]); chomp($timearray[1]); ($gethour, $getmin) = split(/:/, $timearray[0]); if ($timearray[1] eq "PM") { if ($gethour < 12) { $gethour = ($gethour + 12); } } if ($AMpm eq "AM") { if ($gethour == 12) { $gethour = "0"; } } $gethour = sprintf ("%2d", $gethour); $gethour =~tr/ /0/; $getmin = sprintf ("%2d", $getmin); $getmin =~tr/ /0/; $FormatTime = "$gethour:$getmin"; } else { $FormatTime = "$thisline[4]"; } $theTime = "thisline[4]"; $ReplyText = $thisline[6]; chomp($ReplyText); #get reply writer's email view status @thisprofile = &OpenProfile("$thisline[2].cgi"); $EmailView = $thisprofile[11]; if (($EmailBlock eq "ON") || ($EmailView eq "no")) { $EmailString = " "; } else { $EmailString = qq(  Click Here to Email $thisline[2]  ); } $ThisThread .= qq(); #rotate thru alt colors if ($AlternateColor eq "#F7F7F7") { $AlternateColor = "#dedfdf"; } else { $AlternateColor = "#F7F7F7"; } } # end if not stat line and not father line } # end reply loop } # end Count > 0 loop $ThisThread .= qq(
Author Topic:   $TopicSubject
$statarray[3] posted $ThisDate $FormatTime $TimeZone   Click Here to See the Profile for $statarray[3] $EmailString
$fatherarray[6]
$thisline[2] posted $ThisDate $FormatTime $TimeZone     Click Here to See the Profile for $thisline[2]$EmailString   
$ReplyText

Post New Topic  Post Reply
Hop to:


Contact Us | $MyHomePage

Powered by: Ultimate Bulletin Board, Freeware Version 2000
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.

); if (-e "$ForumsPath/$ForumIs/HTML/$ThreadNumber.html") { chmod (0777, "$ForumsPath/$ForumIs/HTML/$ThreadNumber.html"); } &Lock("lock.file"); open (THREADHTML, ">$ForumsPath/$ForumIs/HTML/$ThreadNumber.html"); print THREADHTML ("$ThisThread"); close (THREADHTML); &Unlock("lock.file"); chmod (0777, "$ForumsPath/$ForumIs/HTML/$ThreadNumber.html"); } #end CreateThreadHTML sub GetTotalForums { open (FORUMFILE, "$VariablesPath/forums.cgi"); @forums = ; close (FORUMFILE); $ForumTotal = @forums; return($ForumTotal); } sub GotError { $ErrorLine = shift; print<
$ErrorLine
THAT } sub ConfirmHTML2 { $UserNameCoded = "$UserName"; $UserNameCoded =~ tr/ /+/; $PasswordCoded = "$Password"; $PasswordCoded =~ tr/ /+/; print<

Thank you. $ConfirmLine Confirm2 } sub ConfirmHTML { $UserNameCoded = "$UserNameCheck"; $UserNameCoded =~ tr/ /+/; $PasswordCoded = "$PasswordCheck"; $PasswordCoded =~ tr/ /+/; print<

Thank you. $ConfirmLine

Confirm } sub SetLastTimes { open (FORUMFILE, "$VariablesPath/forums.cgi"); @sortforums = ; close (FORUMFILE); &CurrentDate; for $each(@sortforums) { @thisforuminfo = split(/\|/, $each); chomp($thisforuminfo[8]); $x = "$thisforuminfo[8]"; #update or create forum summary files if ($x > 0) { &ForumSummary($x); # @finalarray = threads file $numberthreads = @finalarray; if ($numberthreads > 0) { @currthreads = sort(@finalarray); $latest = $currthreads[0]; @latest = split(/\|\^\|/, $latest); $lastdatetime = $latest[2]; $LastYear = substr($lastdatetime, 0, 4); $LastMon = substr($lastdatetime, 4, 2); $LastDay = substr($lastdatetime, 6, 2); $hour = substr($lastdatetime, 8, 2); $min = substr($lastdatetime, 10, 2); &NormalTime; $LatestTime = ("$hour" . ":" . "$min" . " $AMPM"); $HyphenDate = "$LastMon-$LastDay-$LastYear"; #update last time file &Lock("lock.file"); open (LASTTIME, ">$ForumsPath/Forum$x/lasttime.file") or die(&StandardHTML("Unable to write a Forum$x LastTime.file $!")); print LASTTIME ("$HyphenDate\n"); print LASTTIME ("$LatestTime\n"); close (LASTTIME); &Unlock("lock.file"); chmod (0666, "$ForumsPath/Forum$x/lasttime.file"); } } #end if > 0 } #end foreach forum } #end setlasttimes 1;