#!/usr/bin/perl # Board Power (tm) v2.04 PF # Written by Joseph Bannon and Josh Meier # Copyright 1998-2000 The Bannon Group, LLC - All Rights Reserved # Board Power is a trademark of The Bannon Group, LLC. # Software Distributed by: The Webmaster Guide, Inc. # Visit us online at http://www.thewebmasterguide.com $thisprogram = "boardpower.cgi"; $operatingsystem = "unix"; if (($operatingsystem eq "nt") || ($operatingsystem eq "other")) { $bpdirectory = ""; } $filetorequire = "$bpdirectory" . "config.cgi"; require "$filetorequire"; $filetorequire = "$bpdirectory" . "variables/setup.cgi"; require "$filetorequire"; $filetorequire = "$bpdirectory" . "programs.cgi"; require "$filetorequire"; $filetorequire = "$bpdirectory" . "subroutes.cgi"; require "$filetorequire"; $filetorequire = "$bpdirectory" . "variables/styles.cgi"; if (-e $filetorequire) { require "$filetorequire"; } $filetorequire = "$bpdirectory" . "variables/options.cgi"; if (-e $filetorequire) { require "$filetorequire"; } # Parse incoming information. &parsequery; $action = $QUERY{'action'}; $categoryid = $QUERY{'category'}; $cookie = $QUERY{'cookie'}; $access = $QUERY{'accesskey'}; &parsecookie; if ($cookie eq "logout") { &setcookie("passwordcookie,,"); &setcookie("usernamecookie,,"); } &parseform; $access = $FORM{'inaccesskey'}; if ($access ne "") { $filetomake = "$bpdirectory" . "variables/password.cgi"; open(FILE,">$filetomake"); flock(FILE,2); print FILE "$access"; close(FILE); } &getlastvisitinfo; $newlastvisitinfo = ""; $title = "$boardtitle"; $toptlsn = "3"; &title; $filetoopen = "$bpdirectory" . "variables/password.cgi"; if (-e $filetoopen) { open(FILE,"$filetoopen"); $access1 = ; close(FILE); } if ($access1 eq "sexy") { $filetorequire = "$bpdirectory" . "variables/boardstats.cgi"; if (-e $filetorequire) { require "$filetorequire"; } if ($newestmember) { $tempnewestmember = $newestmember; $tempnewestmember =~ s/ /\_/g; $newestmember = "
Welcome Our Newest Member: $newestmember"; } $output .= "\n"; $output .= "\n"; $output .= "
\n\nYour last visit: \$boardlastvisit, Reset All Forums?\n\n\nRegistered Users: \$registeredusers $newestmember
\n"; $output .= "\n"; $output .= "\n
\n"; $output .= "\n"; $output .= "\n"; if (($frontview eq "categories") && ($action ne "viewcategory")) { $filetoopen = "$bpdirectory" . "variables/forums.cgi"; if (-e $filetoopen) { open(FILE,"$filetoopen"); flock(FILE,2); @forums = ; close(FILE); foreach $line (@forums) { ($forumid,$category,$forumname,$forumdescription) = split(/\|/,$line); $rearrange = ("$category|$forumname|$forumdescription|$forumid"); push(@newforums, $rearrange); } @sortednewforums = sort(@newforums); $linecount = 0; foreach $line (@sortednewforums) { ($category,$forumname,$forumdescription,$forumid) = split(/\|/,$line); $filetorequire = "$bpdirectory" . "forum$forumid/forum.cgi"; if (-e $filetorequire) { require $filetorequire; } $filetorequire = "$bpdirectory" . "forum$forumid/stats.cgi"; if (-e $filetorequire) { require $filetorequire; } $forumdesc =~ s/\[url\]\s*http:\/\/(.*?)\s*\[\/url\]/http:\/\/$1<\/a>/isg; $forumdesc =~ s/\[url\]\s*(.*?)\s*\[\/url\]/$1<\/a>/isg; #if ("$category" ne "$previouscategory") { $output .= "\n\n"; } $forumlastvisit = $LASTVISIT{$forumid}; if ($cookie eq "reset" || $forumlastvisit eq "") { $forumlastvisit = time; } $newlastvisitinfo .= "$forumid-$forumlastvisit&"; if ($categorylastvisit < $forumlastvisit) { $categorylastvisit = $forumlastvisit; } if ($forumlastvisit > $boardlastvisit) { $boardlastvisit = $forumlastvisit; } $nextline = $linecount + 1; ($category2,$forumname2,$forumdescription2,$forumid2) = split(/\|/,@sortednewforums[$nextline]); if ("$category" ne "$category2") { $totalforums++; $totalthreads = $totalthreads + $forumthreads; $totalposts = $totalposts + $forumposts; # if ($categorylastpost > $categorylastvisit) { if ($forumlastpost > $categorylastvisit) { $newpostgraphic = ""; $totalposts = "$totalposts"; } else { $newpostgraphic = ""; $totalposts = "$totalposts"; } # if ($categorylastpost ne "") { # $longdate = &longdate("$categorylastpost"); # $shorttime = &shorttime("$categorylastpost"); # $highestpost = "$longdate
$shorttime"; # } if (($forumlastpost ne "")&& ($forumlastpost ne "0")) { $longdate = &longdate("$forumlastpost"); $shorttime = &shorttime("$forumlastpost"); $highestpost = "$longdate
$shorttime"; } else { $highestpost = "N/A"; } if ($totalforums > 1) { $totalforums = "$totalforums Forums"; } elsif ($totalforums == 1) { $totalforums = "$totalforums Forum"; } else { $totalforums = "$totalforums Forums"; } # $output .= "
\n"; if ($forummoderator eq "") {$forummoderator = "open";} $output .= "\n"; $totalforums = ""; $totalposts = ""; $totalthreads = ""; $categorylastpost = ""; } else { $totalforums++; $totalthreads = $totalthreads + $forumthreads; $totalposts = $totalposts + $forumposts; } $previouscategory = "$category"; $linecount++; $output .= "\n"; } } } elsif (($action eq "viewcategory") && ($categoryid ne "")) { $filetoopen = "$bpdirectory" . "variables/forums.cgi"; if (-e $filetoopen) { open(FILE,"$filetoopen"); flock(FILE,2); @forums = ; close(FILE); foreach $line (@forums) { ($forumid,$category,$forumname,$forumdescription) = split(/\|/,$line); $rearrange = ("$category|$forumname|$forumdescription|$forumid"); if ($forumid eq $categoryid) { $categorytoshow = "$category"; } push(@newforums,$rearrange); } $output .= "\n"; @sortednewforums = sort alphabetically(@newforums); foreach $line (@sortednewforums) { ($category,$forumname,$forumdescription,$forumid) = split(/\|/,$line); if ("$category" eq "$categorytoshow") { $filetorequire = "$bpdirectory" . "forum$forumid/forum.cgi"; if (-e $filetorequire) { require "$filetorequire"; } $filetorequire = "$bpdirectory" . "forum$forumid/stats.cgi"; if (-e $filetorequire) { require "$filetorequire"; } $forumdesc =~ s/\[url\]\s*http:\/\/(.*?)\s*\[\/url\]/http:\/\/$1<\/a>/isg; $forumdesc =~ s/\[url\]\s*(.*?)\s*\[\/url\]/$1<\/a>/isg; $forumlastvisit = $LASTVISIT{$forumid}; if ($cookie eq "reset") { $forumlastvisit = time; } if ($forumlastvisit > $boardlastvisit) { $boardlastvisit = $forumlastvisit; } if ($forumlastpost > $forumlastvisit) { $newpostgraphic = ""; $forumposts = "$forumposts"; } else { $newpostgraphic = ""; $forumposts = "$forumposts"; } if ($forumlastpost ne "0") { $longdate = &longdate("$forumlastpost"); $shorttime = &shorttime("$forumlastpost"); $forumlastpost = "$longdate - $shorttime"; } else { $forumlastpost = "N/A"; $lastpoststamp = ""; } if ($forummoderator eq "") {$forummoderator = "open";} $output .= "\n"; $forumposts .= ""; } } } } else { $filetoopen = "$bpdirectory" . "variables/forums.cgi"; if (-e $filetoopen) { open(FILE,"$filetoopen"); flock(FILE,2); @forums = ; close(FILE); foreach $line (@forums) { ($forumid,$category,$forumname,$forumdescription) = split(/\|/,$line); $rearrange = ("$category|$forumname|$forumdescription|$forumid"); push(@newforums, $rearrange); } @sortednewforums = sort(@newforums); $boardlastvisit = 0; foreach $line (@sortednewforums) { ($category,$forumname,$forumdescription,$forumid) = split(/\|/,$line); $filetorequire = "$bpdirectory" . "forum$forumid/forum.cgi"; if (-e $filetorequire) { require "$filetorequire"; } $filetorequire = "$bpdirectory" . "forum$forumid/stats.cgi"; if (-e $filetorequire) { require "$filetorequire"; } $forumdesc =~ s/\[url\]\s*http:\/\/(.*?)\s*\[\/url\]/http:\/\/$1<\/a>/isg; $forumdesc =~ s/\[url\]\s*(.*?)\s*\[\/url\]/$1<\/a>/isg; if ("$category" ne "$previouscategory") { $output .= "\n\n"; } $forumlastvisit = $LASTVISIT{$forumid}; if ($cookie eq "reset" || $forumlastvisit eq "") { $forumlastvisit = time; } $newlastvisitinfo .= "$forumid-$forumlastvisit&"; if ($forumlastvisit > $boardlastvisit) { $boardlastvisit = $forumlastvisit; } if ($forumlastpost > $forumlastvisit) { $newpostgraphic = ""; $forumposts = "$forumposts"; } else { $newpostgraphic = ""; $forumposts = "$forumposts"; } $forumlastvisit = &shorttime("$forumlastvisit"); if ($forumlastpost ne "" && $forumlastpost > 1) { $longdate = &longdate("$forumlastpost"); $shorttime = &shorttime("$forumlastpost"); $forumlastpost = "$longdate - $shorttime"; } else { $forumlastpost = "N/A"; $lastpoststamp = ""; } unless ($forumstatus eq "off") { # Make sure sum of widths equal 100%. if ($forummoderator eq "") {$forummoderator = "open";} $output .= "\n"; $output .= ""; } $previouscategory = "$category"; } } } $output .= "
newcategory infotopicspostslast postModerator
$category
$newpostgraphic$category ($totalforums)$totalthreads$totalposts$highestpost
$newpostgraphic$category ($totalforums)$totalthreads$totalposts$highestpost$forummoderator  
Home / $categorytoshow
$newpostgraphic$forumname
$forumdesc
$forumthreads$forumposts$forumlastpost$forummoderator
$category
$newpostgraphic$forumname
$forumdesc
$forumthreads$forumposts$forumlastpost$forummoderator
\n"; $output .= "

\n"; unless ($action eq "viewcategory") { if ($membersonline eq 0 || $membersonline > 1) { $ending1 = "s"; } else { $ending1 = ""; } if ($guestsonline eq 0 || $guestsonline >1 ) { $ending2 = "s"; } else { $ending2 = ""; } $output .= "\n"; $output .= "\n"; $output .= "
\n"; $output .= "\n"; $output .= "\n"; $output .= "
\n"; $output .= "\n"; $output .= "Who's Online: $peopleonline Total People, $membersonline Member$ending1, and $guestsonline Guest$ending2\n"; $output .= "
\n"; $output .= "

\n"; $output .= "\n"; $output .= "\n"; $output .= "
Contains new posts since the last time you logged on
No new posts since the last time you logged on

\n"; } $boardlastvisit = &dateformat("$boardlastvisit"); $output =~ s/\$boardlastvisit/$boardlastvisit/g; # After going through each forum, it's time to update the lastvisitinfo cookie. unless ($action eq "viewcategory") { &setcookie("lastvisitinfo,$newlastvisitinfo,30"); } } else { &noaccess; } sub noaccess { $output .= "

\n"; $output .= "You must read the readme file before you can go any further. In your reading of the readme file, pay attention to the file and look for a line that says \"Word To Pass Go: Password here\". replace Password here with the password that is actually in the readme file and then enter that password below. Please pay close attention when reading the readme file, because the majority of the newbie questions are answered in the readme file. You will save your time in waiting for us to answer your posts at the boards if you read the readme, because most likely your question is answered. Thank you. Also, If you could please modify your template file as talked about in the readme. I modified the openscript JavaScript a bit to clean up the messenger, so please do the updates :)

\n"; $output .= "\n"; $output .= "\n"; } $pwsn = "3"; &poweredby; &printpage;