#!/usr/bin/perl # ### CONTROL PANEL SCRIPT FOR ULTIMATE BULLETIN BOARD ## # # Ultimate Bulletin Board is copyright Infopop Corporation, 1998-2000. # # ------------ cpanel.cgi ------------- # # This file contains some of the control panel functionality for # the UBB. It is called from the controlpanel pages (cp.html). # # 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"; print ("Content-type: text/html\n\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 "mods.file"; require "Styles.file"; require "ubb_library.pl"; require "ubb_library2.pl"; }; if ($@) { print "

Error including the required files:

"; print "

Be sure you uploaded UltBB.setup, Styles.file, mods.file and forums.cgi in ASCII/Text mode to your CGI directory. [This is a manual setting on your FTP software]

Make sure spelling and case are correct: UltBB.setup not ultbb.setup.

\n\n"; print "

Here is the message returned from UBB:

$@

\n\n"; exit; } &ReadParse; foreach $row(@in) { ($Name, $Value) = split ("=", $row); $Name = &decodeURL($Name); $Value = &decodeURL($Value); if ($Name eq "action") { $action = $Value; } if ($Name eq "Email") { $Email = $Value; $Email =~tr/A-Z/a-z/; } if ($Name eq "UserName") { $UserName = $Value; } if ($Name eq "Password") { $Password = $Value; } } #end foreach loop if ($VariablesPath eq "") { $VariablesPath = $CGIPath; } if ($action eq "setmods") { &SetMods; } if ($action eq "UpdateThreads") { &UpdateThreads; } if ($action eq "prune") { &Prune; } if ($action eq "digest") { &Digest; } if ($action eq "index") { &Index; } if ($action eq "archives") { &Archives; } if ($action eq "addforums") { &AddForums; } if ($action eq "banlists") { &BanLists; } if ($action eq "variables") { &Variables; } if ($action eq "permissions") { &Permissions; } if ($action eq "env") { &Env; } if ($action eq "misc") { &Misc; } if ($action eq "mail") { &Mail; } if ($action eq "style") { &Styles; } if ($action eq "logintoforums") { &LogIntoForums; } sub Styles { if ($profilegif eq "") { $profilegif = "profile.gif"; } if ($mailgif eq "") { $mailgif = "email.gif"; } if ($CopyrightTextColor eq "") { $CopyrightTextColor = "#C0C0C0"; } if ($TextSize eq "") { $TextSize = "2"; } if ($TextColor eq "") { $TextColor = "#000000"; } if ($LinkColor eq "") { $LinkColor = "#000080"; } if ($VisitedLinkColor eq "") { $VisitedLinkColor = "#808000"; } if ($ActiveLinkColor eq "") { $ActiveLinkColor = "#800000"; } if ($TableStripTextColor eq "") { $TableStripTextColor = "#000080"; } if ($CategoryStripTextColor eq "") { $CategoryStripTextColor = "#000000"; } if ($BBTitle eq "") { $BBTitle = "bbtitle1.jpg"; } if ($BBTopic eq "") { $BBTopic = "topic1.jpg"; } if ($BBReply eq "") { $BBReply = "reply1.jpg"; } if ($ThreadClosed eq "") { $ThreadClosed = "threadclose1.jpg"; } if ($TableWidth eq "") { $TableWidth = "95%"; } if ($FDTextSize eq "") { $FDTextSize = "1"; } if ($TimeColor eq "") { $TimeColor = "#800080"; } if ($BBTitleFontColor eq "") { $BBTitleFontColor = "#800000"; } $PageTitle = " S E T      S T Y L E S"; &HEADERHTML1; print<

StyleHTML &ColorRow("Page Background Color", "Format - #FFFFFF", "BGColor", "#C7C6BA"); &ColorRow("Text Color", "", "TextColor", "#D5D2BB"); &ColorRow("Link Color", "", "LinkColor", "#C7C6BA"); &ColorRow("Active Link Color", "", "ActiveLinkColor", "#D5D2BB"); &ColorRow("Visited Link Color", "", "VisitedLinkColor", "#C7C6BA"); &ColorRow("Table Border Color", "", "TableBorderColor", "#D5D2BB"); &ColorRow("Table Header Strip Text Color", "", "TableStripTextColor", "#C7C6BA"); &ColorRow("Table Header Strip Background Color", "", "TableColorStrip", "#D5D2BB"); &ColorRow("Time Color", "This color is used for the time field on the main forum summary page and the forum pages and for the \"posted by\" line for each post.", "TimeColor", "#C7C6BA"); &ColorRow("First Alternating Table Column Color", "", "AltColumnColor1", "#D5D2BB"); &ColorRow("Second Alternating Table Column Color", "", "AltColumnColor2", "#C7C6BA"); &ColorRow("Category Strip Background Color", "", "CategoryStripColor", "#D5D2BB"); &ColorRow("Category Strip Text Color", "", "CategoryStripTextColor", "#C7C6BA"); &ColorRow("Copyright Text Color", "", "CopyrightTextColor", "#D5D2BB"); &ColorRow("BB Title Font Color", "", "BBTitleFontColor", "#C7C6BA"); print<
Color Options
Miscellaneous Graphic Options
Font Face (e.g., Verdana)
We recommend you use a backup font as well. For example: to use Verdana as your first choice, with Arial as a conditional font for those users that don't have Verdana as a font on their system, you would type "Verdana, Arial")
Table Width
You may use either exact pixels (recommended: 600) or a percentage (recommended: 90%)
Text Size
We recommend using size 2... but depending on your font face, you may want to alter this.
Forum Description Text Size
The default setting is for the Forum Description wording to appear as your standard Text Size (which you set above). You may set the size for the forum descriptions to another size, however, if you prefer. For example, setting the size to 1, when the normal text size is 2 will make the Forum Names appear more prominent.
Page Background Graphic
Not recommended to be used, but you can add a background graphic to your pages. If you do so, you should upload the graphic into your NON CGI directory and place the name of the background graphic in this field. For example, background.gif.
Graphic Images

You can choose from 6 coordinated graphic sets, or substitute your own graphics. There are 3 main graphics used- the title or logo graphic that appears at the top of most pages, a "Post New Topic" graphic, a "Post Reply" graphic, and a "Closed Thread" graphic. Many of the available graphics were created by the very talented Karen Vail. Some recent smilies were created by Venus and Amy Medina of Something Fishy.

The graphic sets are pictured here. To use one of these graphics, just type in the name of the graphic in the corresponding field. To use one of your own graphics, type in its own unique name in the corresponding field. Also, if you use your own graphics, be sure to FTP the images into your Non CGI directory.

Recommended graphic sizes: if you are creating your own graphics, we recommend that the following sizes (in pixels) be used (in order to fit with layout of the BB):

  • Title/logo graphic- 300 wide by 75 high
  • Post New Topic graphic - 80 wide by 17 high
  • Post Reply graphic - 75 wide by 17 high
  • Thread Close graphic - 75 wide by 17 high

Don't forget: if you are using your own custom graphics instead of one of the standard graphics shown above, be sure to upload (FTP) your custom graphics to your UBB NON CGI directory. You may want to check out the UBB Graphics Shop to see graphics created by others for use on the Ultimate Bulletin Board.
Title Graphic:
Post New Topic Graphic:
Post Reply Graphic:
Thread Closed Graphic:
Profile Graphic:
Email Graphic:
Verify Your Identity
ONLY ADMINISTRATORS CAN SET STYLES
Your User Name
Your Password


Powered by: Infopop © 2000
Ultimate Bulletin Board $Version

Style12 } ## END Styles subroutine sub UpdateThreads { $PageTitle = "U P D A T E      T H R E A D S"; &HEADERHTML1; print<Note: only administrators may update HTML threads.

After you make changes to your control panel settings, these changes take affect immediately for all new pages. Older HTML pages, however, are not updated until you update them here. You should run this function after you have made all changes to your control panel settings.

Your User Name
Your Password
Specify Forums To Update:
If you are upgrading, you should update all forums. If you made style changes on one particular forum, however, you may only want to update the topics in that forum only.
Update Cycle Rate
Depending on your server and the number of messages you have stored, you can determine whether to have the UBB update your topic pages (threads) in large chunks or small chunks. The default setting is 150 topics at a time, per forum. If you are unable to complete the update process, you may want to try lowering the cycle rate. Conversely, if you have no trouble at 150, you may want to try setting the rate higher to reduce the amount of time spent on the update.

Threads2 } ## END UpdateThreads SR ## sub Archives { $PageTitle = "A R C H I V E S"; &HEADERHTML1; print<read-only sections of your UBB that store topics that were previously posted to forums. Archives are completely separate from forums. The purpose of archives is to store topics that were posted in a forum in your UBB that you want to "keep" for use as a FAQ, "Best Of", or reference area.

Archives do not have to correspond to forums, but they are populated by forum topics. For instance, if you have 9 forums, each concerning a different aspect of your company, you may want to set up one archive where you can store the most frequently asked questions in all forums- you could call that archive your Frequently Asked Questions archive. There are a number of possible uses for archives- just keep in mind that any topic you move into an archive will be strictly read-only in the archive.

Topics are transferred into archives by clicking on the "MOVE/ARCHIVE" link on the actual topic page.

To create/delete/modify an archive, identify yourself below. Note: only administrators may create or modify archives. You may create up to 40 archives.

Threads &IDTable; print<
ArchiveBottom } ## END Archives SR ## sub Index { $PageTitle = "C R E A T E / U P D A T E      I N D E X"; &HEADERHTML1; print<Only administrators or moderators may set or update the index.

The index is used for all searches. If you are upgrading from a version that did not have a search engine included, you MUST create your index before any searches will work. Just click on the button below! If you ever have problems, or if your index becomes corrupted for some reason, you can easily create it again here.

You should recreate your index here each time after you prune/delete posts in the control panel. This will not be done by the UBB automatically.

Index &IDTable; print<
Index2 } ## END INDEX SR ## sub LogIntoForums { &AssembleCats; $PageTitle = "F O R U M      S E T T I N G S"; &HEADERHTML1; print< You must be an administrator to change forum settings.

ForumLoginHTML &IDTable; print<


Powered by: Infopop © 2000
Ultimate Bulletin Board $Version
ENDIT } # end logintoforums sr sub BanLists { $PageTitle = "B A N      L I S T S"; &HEADERHTML1; print< You must be an administrator to add users to your list
of banned email addresses or IP numbers.

Note: if you are upgrading from a version before 5.38, be sure to reset your general settings prior to setting the new Ban Lists (doing so will preserve your prior ban lists set before 5.38).

ForumLoginHTML &IDTable; print<


Powered by: Infopop © 2000
Ultimate Bulletin Board $Version
ENDIT } # end banlists sr sub Env { if ( (-e "$CGIPath/edit.cgi") && (-e "$MembersPath/memberslist.cgi") && (-d "$NonCGIPath/Forum3") ) { &get_cookie; if($cookie{'UserNameCP'}) { &VerifyAdminCP($cookie{'UserNameCP'},$cookie{'PasswordCP'}); # make sure they logged in unless ($Proceed eq "true") { &StandardHTMLCP("Sorry you have not been verified as an administrator. Login through the control panel 'General Settings'."); exit; } } else {&StandardHTML("Your bulletin board paths have already been configured correctly.

For security, Environmental Variables are available only to Administrators.
Submit your 'General Settings' to verify your status."); exit; } } print<

Your Environmental Variables

Use these to help you figure out your absolute file paths, and other system information.

Perl Info:
You are using Perl Version $]

Your Environmental Variables:
Note: "DOCUMENT_ROOT" shows your absolute path to your root web directory. "SCRIPT_FILENAME" shows you absolute path of your CGI directory. If your SCRIPT_FILENAME shows "/www/whatever/whatever/cgi-bin/cpanel.cgi", your Absolute Path variable for your CGI directory would be "/www/whatever/whatever/cgi-bin". On some servers this value is called PATH_TRANSLATED.

TOP for $key (keys(%ENV)) { printf("%-10.20s: $ENV{$key}
", $key); } print< BOTTOM } # END ENV SR sub AddForums { # check to see how many forums are currently listed @forums = &OpenForumsFile; $ForumTotal = @forums; $ForumCounter = $ForumTotal + 1; my @CATEGORIES = &OpenFile("$NonCGIPath/categories.file"); my $CategoryDropDown = qq("; $PageTitle = "A D D      N E W      F O R U M"; &HEADERHTML1; print< You can add a new forum by completing the form below. You currently have $ForumTotal forums.

First Identify Yourself (only administrators can add new forums)
Your User Name
Your Password

Create New Forum Below [forum variable terms]

ForumHTML print< MoreForumGuts &ColorRow("Page Background Color", "Format - #FFFFFF", "BGColor", "#D5D2BB","colspan=2"); &ColorRow("Text Color", "", "TextColor", "#C7C6BA","colspan=2"); &ColorRow("Link Color", "", "LinkColor", "#D5D2BB","colspan=2"); &ColorRow("Active Link Color", "", "ActiveLinkColor", "#C7C6BA","colspan=2"); &ColorRow("Visited Link Color", "", "VisitedLinkColor", "#D5D2BB","colspan=2"); &ColorRow("Table Border Color", "", "TableBorderColor", "#C7C6BA","colspan=2"); &ColorRow("Table Header Strip Text Color", "", "TableStripTextColor", "#D5D2BB","colspan=2"); &ColorRow("Table Header Strip Background Color", "", "TableColorStrip", "#C7C6BA","colspan=2"); &ColorRow("Time Color", "This color is used for the time field on the main forum summary page and the forum pages and for the \"posted by\" line for each post.", "TimeColor", "#D5D2BB","colspan=2"); &ColorRow("First Alternating Table Column Color", "", "AltColumnColor1", "#C7C6BA","colspan=2"); &ColorRow("Second Alternating Table Column Color", "", "AltColumnColor2", "#D5D2BB","colspan=2"); &ColorRow("Category Strip Background Color", "", "CategoryStripColor", "#C7C6BA","colspan=2"); &ColorRow("Category Strip Text Color", "", "CategoryStripTextColor", "#D5D2BB","colspan=2"); &ColorRow("Copyright Text Color", "", "CopyrightTextColor", "#C7C6BA","colspan=2"); print<
Forum $ForumCounter
Name:
Category: $CategoryDropDown
Status: On      Off
HTML Allowed? Yes      No
UBB Code Allowed? Yes      No
UBB Code Images Allowed? Yes      No
Moderator Notification?
If yes, an email will be sent to the moderator every time someone posts a note to the forum (not recommended!)
Yes      No
Access Limits
You may make the forum completely private- which means that only admins, moderators and those that you grant permission to view (using the User Permissions area in this control panel) may view and post notes in the forum. If you set a forum password, you can also grant access to private forums and other restricted access forums to those that know the forum password.

If you do not need to make the forum completely private, you may still restrict posting permissions in various ways.


Forum Password:

Completely Private - Read/Write

Restrict Viewing and Writing of Posts To Admins, Moderators and other authorized* users

If private, you can select maximum privacy, which means that all topics are displayed dynamically, checking user identification before displaying any page, or minimum privacy, which means that topics are stored as HTML (not dynamcially created) for improved server performance, but at a security risk.

Maximum Security
Minimum Security


Posting Restrictions (With Viewing of Posts Open to All)

If forum is not completely private, you can determine which users can post topics and replies within the forum.

Who Can Post Topics?

Who Can Post Replies?

* An authorized user is someone who is not an administrator or moderator who has either been given specific authority to use a private forum or otherwise-restricted forum. Administrators can give this permission to a user by either specifically assigning the permission to the user in the control panel User Permissions area or by giving the user the Forum Password to gain entrance. You can set a forum password in the field to the left.

Forum Description:
This is displayed on your the intro page that summarizes all forums when users visit. Be sure to set Forum Descriptions "on" in the General Variables section, if you want your visitors to see this description.

Custom Header
You can add your own customized header graphic, ad banner, text, etc. for this forum. This header will appear at the top of each UBB forum page. The Header you set in your main Style settings will be used if you keep this field blank. Thus, only complete this field if you want to replace the default Header.

Custom Header
You can add your own customized header graphic, ad banner, text, etc. for this forum. This footer will appear at the top of each UBB forum page. The Footer you set in your main Style settings will be used if you keep this field blank. Thus, only complete this field if you want to replace the default Footer.

Forum Display Options

Note: The default values are the values you declare in your overall Styles Settings. You can change those values for this forum below. You can also change the default Header and Footer variables for this forum below. The values you place below will override the general style settings.If you are adding new graphics, be sure to upload them into your UBB NON CGI directory. Simply place the file name in the graphic field (as in email.gif).

Font Face (e.g., Verdana)
We recommend you use a backup font as well. For example: to use Verdana as your first choice, with Arial as a conditional font for those users that don't have Verdana as a font on their system, you would type "Verdana, Arial")
Table Width
You may use either exact pixels (recommended: 600) or a percentage (recommended: 90%)
Text Size
We recommend using size 2... but depending on your font face, you may want to alter this.

Page Background Graphic
Not recommended to be used, but you can add a background graphic to your pages. If you do so, you should upload the graphic into your NON CGI directory and place the name of the background graphic in this field. For example, background.gif.

Forum Title Graphic:
Post New Topic Graphic:
Post Reply Graphic:
Thread Closed Graphic:
Profile Graphic:
Email Graphic:


Powered by: Infopop © 2000
Ultimate Bulletin Board $Version

ForumGuts } ## END AddForums sub Permissions { $PageTitle = "U S E R      I N F O     &      P E R M I S S I O N S"; &HEADERHTML1; print< If you need to register a new user, click here.
Moderate Registration Requests
Admin UserName:
Admin Password:
 
Display All registrations All Users without posting rights Under 13
Search in the last    registrations
   
   


permissHTML # get Private Forum select List @forumlist = &OpenForumsFile; foreach(@forumlist){ if (/\|private\|/){ @privateforum = split(/\|/,"$_"); $privateforumnumber = $privateforum[14]; $privateforumnumber *= 1; $selectlist .= "\n"; } } if ($selectlist) { print ""; } print<
Search for Registered Users:
Admin UserName:
Admin Password:
 
User Name
Status
Access to Private Forums\n"; print "
Email Address
Number of Posts
 View all registered users.  

Control Panel | Bulletin Board

Powered by: Infopop © 2000
Ultimate Bulletin Board $Version

permissHTML } ## END Permissions ## sub Variables { $PageTitle = "G E N E R A L      S E T T I N G S"; if ( (-e "$CGIPath/edit.cgi") && (-e "$MembersPath/memberslist.cgi") && (-d "$NonCGIPath/Forum3") ) { &HEADERHTML1; print<Your UBB paths are already configured. Identify yourself by filling in the UserName and Password fields below!

VARHTML &IDTable; print<

Are you Upgrading your UBB? You MUST always reset your system in the following order: GENERAL settings, STYLE settings, FORUM settings and Moderators settings. You do not have to make any changes to those settings, just press the submit button for each and allow all processing to take place. Then UPDATE THREADS and INDEX.




Powered by: Infopop © 2000
Ultimate Bulletin Board $Version
BOTTOM } else { # UBB is not set up yet print<Configuration Needed

 

Your absolute paths need to be configured before you use the bulletin board.

Please click here now.




Ultimate Bulletin Board $Version
Powered by Infopop © 2000.
VARHTML } # end else }# end SR sub SetMods { $PageTitle = "S E T      M O D E R A T O R S"; &HEADERHTML1; print<Note: only administrators may set moderators.

You may set up to four moderators per forum. Assign/change your forum moderators below.

ModTOP #get current moderator info $ForumTotal = &GetTotalForums; for ($x = 1; $x <= $ForumTotal; $x++) { @thisforum = &GetForumRecord($x); $ForumName = "$thisforum[1]"; my $Moderator = ("Forum" . "$x" . "Moderator"); $Moderator = $$Moderator; my ($Mod1, $Mod2, $Mod3, $Mod4) = split(/\|\|\^\|\|/, $Moderator); print< MIDMOD } ##END FOREACH $line print<
Your User Name
Your Password
Forum Name Moderators:
$ForumName


Powered by: Infopop © 2000
Ultimate Bulletin Board $Version
TRUEBOTTOM } ## END SET MODS SR ## sub Prune { $PageTitle = "E D I T / D E L E T E      M E S S A G E S"; &HEADERHTML1; print<Note: only moderators and administrators may edit or prune messages. Moderators may only make changes for their particular forums. Identify yourself below.
Administrator/Moderator Identification:
  User Name:
Password:
Prune By Date - a mass-delete function that will delete all messages from a forum or forums based on a time-period cut-off that you select.
Prune By User - a mass-delete function that will delete all messages posted by a user.

If you are deleting a registered user's posts, you may type all or part of the user's name and we will retreive a list of matching names. If you are deleting an unregistered user's posts, however, you must type the complete name exactly below.

User Name:    
Is the name registered? Registered Not registered

Edit/Delete A Message - edit or delete a particular message. If you edit, a note will appear on the message that it has been altered by an administrator/moderator.

PruneHTML } ## END Prune SR sub HEADERHTML1 { print< $BBName
$PageTitle

HEADER } #end HEADERHTML sr sub CheckStatus { 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 CheckStatus sub Mail { $PageTitle = "E M A I L      U S E R S"; &HEADERHTML1; print<Note: only administrators may send a mass email to all registered users. Note that email will not be sent to registered users who elect not to receive it. One profile option at your registered users' disposal is to not receive such mailings.

This email will be sent to each user separately (users will not receive a list of all email addresses).

If you prefer, you may also use your own bulk mail software program and simply generate a list of email addresses for your registered users (which you can then import into your bulk email program). To do that instead, check the box under the message box below.

Your User Name
Your Password
Your Email Subject:
Your Email Message:

   Create Email List Instead: If you would rather simply create a list of registered users' email addresses, check this box (and leave the subject and message fields blank above). You can then import that list into your own bulk email program.
Comma-delimited list   Line return list

Index } ## END MAIL SR ## sub Digest { $PageTitle = "D I G E S T      C E N T E R"; &HEADERHTML1; print< Note: only administrators or moderators may use the Digest Center.

Digests are summaries of topics posted to a given forum over a certain time period. These digests will be emailed to a list of subscribers when you so designate. You cannot have digests sent out automatically at a certain interval. You must return to this center and select the "Send Digest To Subscribers" option below in order to send a digest.

Here is a list of your current digests:

Index #retrieve current digests... if (-e "$NonCGIPath/digests/digestsummary.cgi") { open (DIGESTS, "$NonCGIPath/digests/digestsummary.cgi"); @digestsummary = ; close(DIGESTS); foreach $uno(@digestsummary) { @thisone = split(/\|/, $uno); @thisfor = &GetForumRecord($thisone[0]); my $ForumName = $thisfor[1]; print qq(); } } else { print qq(); } print<

Digest Name Forum Number Last Digest Sent
$ForumName$thisone[0]$thisone[1]
No Digests Have Been Created.
Your User Name
Your Password
What Do You Want To Do?

© Infopop Corporation.), 2000. Index2 } ## END DIGEST SR ## sub QueryForID { print< $BBName

$PageTitle

You must be an administrator to change forum settings.

$PageIntro

ForumLoginHTML &IDTable; print< $HiddenFields



Copyright, Infopop Corporation, Inc.), 1998-2000.
ENDIT } sub Misc { $PageTitle = "M I S C E L L A N E O U S      O P T I O N S
D E B U G G I N G      O P T I O N S"; &HEADERHTML1; print<Note: only administrators may perform the following tasks. Note that you should only perform the following tasks if you are experiencing problems.

ModTOP print<
Your User Name
Your Password


Powered by: Infopop © 2000
Ultimate Bulletin Board $Version
TRUEBOTTOM } ## END MISC SR ## exit(0); # comply with SafePerl