###############################################################################
# AdminEdit.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 1 Gold - SP 1.1 #
# Released: December 2001; Updated March 22, 2002 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2002 Xnull (www.xnull.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
$admineditplver = "1 Gold - SP 1.1";
sub EditNews {
&is_admin;
my($line);
$yymain .= qq~
~;
$yytitle = "$txt{'7'}";
&template;
exit;
}
sub EditNews2 {
&is_admin;
fopen(FILE, ">$vardir/news.txt", 1);
print FILE "$FORM{'news'}";
fclose(FILE);
$yySetLocation = qq~$cgi\;action=admin~;
&redirectexit;
}
sub EditMemberGroups {
&is_admin;
my(@lines, $mgroups, $i);
fopen(FILE, "$vardir/membergroups.txt");
@lines = ;
fclose(FILE);
foreach $i (@lines) {
$i =~ tr/\r//d;
$i =~ tr/\n//d;
}
for( $i = 7; $i < @lines; ++$i ) {
if( $lines[$i] =~ m~\A\s+\Z~ ) { next; }
$mgroups .= "$lines[$i]\n";
}
$yymain .= qq~
$txt{'8'} |
|
~;
$yytitle = $txt{'8'};
&template;
exit;
}
sub EditMemberGroups2 {
&is_admin;
my $additional = $FORM{'additional'};
while( $groups = each(%FORM) ) {
$FORM{$groups} =~ tr/\n//d;
$FORM{$groups} =~ tr/\r//d;
}
fopen(FILE, ">$vardir/membergroups.txt", 1);
print FILE "$FORM{'admin'}\n";
print FILE "$FORM{'moderator'}\n";
print FILE "$FORM{'newbie'}\n";
print FILE "$FORM{'junior'}\n";
print FILE "$FORM{'full'}\n";
print FILE "$FORM{'senior'}\n";
print FILE "$FORM{'god'}\n";
print FILE "$additional";
fclose(FILE);
$yySetLocation = qq~$cgi;action=admin~;
&redirectexit;
}
sub SetCensor {
&is_admin;
my( @censored, $i );
fopen(FILE, "$vardir/censor.txt");
@censored = ;
fclose(FILE);
foreach $i (@censored) {
$i =~ tr/\r//d;
$i =~ tr/\n//d;
}
$yymain .= qq~
~;
$yytitle = "$txt{'135'}";
&template;
exit;
}
sub SetCensor2 {
&is_admin;
$FORM{'censored'} =~ tr/\r//d;
$FORM{'censored'} =~ s~\A[\s\n]+~~;
$FORM{'censored'} =~ s~[\s\n]+\Z~~;
$FORM{'censored'} =~ s~\n\s*\n~\n~g;
my @lines = split( /\n/, $FORM{'censored'} );
fopen(FILE, ">$vardir/censor.txt", 1);
foreach my $i (@lines) {
$i =~ tr/\n//d;
unless( $i && $i =~ m~.+\=.+~ ) { next; }
print FILE "$i\n";
}
fclose(FILE);
$yySetLocation = qq~$cgi;action=admin~;
&redirectexit;
}
sub SetReserve {
my( @reserved, @reservecfg, $i );
&is_admin;
fopen(FILE, "$vardir/reserve.txt");
@reserved = ;
fclose(FILE);
fopen(FILE, "$vardir/reservecfg.txt");
@reservecfg = ;
fclose(FILE);
for(my $i = 0; $i < @reservecfg; $i++) { chomp $reservecfg[$i]; }
$yymain .= qq~
~;
$yytitle = "$txt{'341'}";
&template;
exit;
}
sub SetReserve2 {
&is_admin;
$FORM{'reserved'} =~ tr/\r//d;
$FORM{'reserved'} =~ s~\A[\s\n]+~~;
$FORM{'reserved'} =~ s~[\s\n]+\Z~~;
$FORM{'reserved'} =~ s~\n\s*\n~\n~g;
fopen(FILE, ">$vardir/reserve.txt", 1);
my $matchword = $FORM{'matchword'} eq 'checked' ? 'checked' : '';
my $matchcase = $FORM{'matchcase'} eq 'checked' ? 'checked' : '';
my $matchuser = $FORM{'matchuser'} eq 'checked' ? 'checked' : '';
my $matchname = $FORM{'matchname'} eq 'checked' ? 'checked' : '';
print FILE $FORM{'reserved'};
fclose(FILE);
fopen(FILE, "+>$vardir/reservecfg.txt");
print FILE "$matchword\n";
print FILE "$matchcase\n";
print FILE "$matchuser\n";
print FILE "$matchname\n";
fclose(FILE);
$yySetLocation = qq~$cgi;action=admin~;
&redirectexit;
}
sub ModifyTemplate {
&is_admin;
my( $fulltemplate, $line );
fopen(FILE, "$boarddir/template.html");
while( $line = ) {
$line =~ s~[\r\n]~~g;
&FromHTML;
$fulltemplate .= qq~$line\n~;
}
fclose(FILE);
$yymain .= qq~
~;
$yytitle = "$txt{'216'}";
&template;
exit;
}
sub ModifyTemplate2 {
&is_admin;
$FORM{'template'} =~ tr/\r//d;
$FORM{'template'} =~ s~\A\n~~;
$FORM{'template'} =~ s~\n\Z~~;
fopen(FILE, ">$boarddir/template.html");
print FILE $FORM{'template'};
fclose(FILE);
$yySetLocation = qq~$cgi;action=admin~;
&redirectexit;
}
sub ModifyAgreement {
&is_admin;
my( $fullagreement, $line );
fopen(FILE, "$vardir/agreement.txt");
while( $line = ) {
$line =~ tr/[\r\n]//d;
&FromHTML($line);
$fullagreement .= qq~$line\n~;
}
fclose(FILE);
$yymain .= qq~
~;
$yytitle = "$txt{'764'}";
&template;
exit;
}
sub ModifyAgreement2 {
&is_admin;
$FORM{'agreement'} =~ tr/\r//d;
$FORM{'agreement'} =~ s~\A\n~~;
$FORM{'agreement'} =~ s~\n\Z~~;
fopen(FILE, ">$vardir/agreement.txt");
print FILE $FORM{'agreement'};
fclose(FILE);
$yySetLocation = qq~$cgi;action=admin~;
&redirectexit;
}
## /START section added in File Attachments v2.4 to auto-config paths needed for mod
sub AttachDir {
&is_admin;
my $findme = 'attachments'; # Set this equal to the name of your attachments directory.
if((-d $_) && ($_ eq "$findme")) {
$upload_dir = "$File::Find::dir/$_";
}
}
## /END File Attachment auto-config paths section
sub ModifySettings {
&is_admin;
my($mainchecked, $guestaccchecked, $forcechecked, $blankchecked, $agreechecked, $mailpasschecked, $newpasschecked, $welchecked);
my($menuchecked, $ubbcchecked, $aluchecked, $cpchecked, $pbchecked, $insertchecked, $newschecked, $gpchecked, $notifchecked);
my($ahmchecked, $slmchecked, $srbarchecked, $smbarchecked, $smreadchecked, $smodchecked, $supicchecked, $sutextchecked, $sgichecked);
my($snfchecked, $fls1, $fls2, $fls3, $utfchecked, $truncchecked, $mts1, $mts2, $mts3, $tsl6, $tsl5, $tsl4, $tsl3, $tsl2, $tsl1);
my($checkextcheck, $extlist, $extitem, $amdisplaypicscheck, $allowattachcheck, $allowguestattachcheck, $st1, $st2);
## /START section added in File Attachments v2.4 to auto-config paths needed for mod
if ((!$upload_dir || !$_http_dir) && $ENV{'DOCUMENT_ROOT'} && $INFO{'famod'} ne "autoconfig") {
$attachment_status = qq~
Click to attempt to auto-configure mod |
~;
}
if(!$upload_dir && $ENV{'DOCUMENT_ROOT'} && $INFO{'famod'} eq "autoconfig") {
my $toplevel = "$ENV{'DOCUMENT_ROOT'}";
if($http_dir) {
my $upload_dir_temp = $http_dir;
$upload_dir_temp =~ s~http://[\w|\.]+/?(\S*)~$1~is;
$upload_dir = "$toplevel/$upload_dir_temp";
} else {
eval { use File::Find; };
unless($@) {
&find(\&AttachDir, $toplevel);
if($upload_dir && !$http_dir) {
my $http_dir_temp = $boardurl;
$http_dir_temp =~ s~(http://[\w|\.]+)/?.*~$1~is;
my $http_dir_temp2 = $upload_dir;
$http_dir_temp2 =~ s~$toplevel/?(\S*)~$1~is;
$http_dir = "$http_dir_temp/$http_dir_temp2";
$attachment_status = qq~
Settings Need to be Saved (Settings Reflected Below Have Not Yet Been Applied) |
~;
}
if(!$upload_dir && (-e "$toplevel/yabbattach")) {
$upload_dir = "$toplevel/yabbattach";
my $http_dir_temp = $boardurl;
$http_dir_temp =~ s~(http://[\w|\.]+)/?.*~$1~is;
$http_dir = "$http_dir_temp/yabbattach";
$attachment_status = qq~
Settings Need to be Saved (Settings Reflected Below Have Not Yet Been Applied) |
~;
} elsif(!$upload_dir && (!-e "$toplevel/yabbattach")) {
mkdir("$toplevel/yabbattach", 0666) || &fatal_error("Could not create $toplevel/yabbattach for attachments directory.");
my $http_dir_temp = $boardurl;
$http_dir_temp =~ s~(http://[\w|\.]+)/?.*~$1~is;
$http_dir = "$http_dir_temp/yabbattach";
$upload_dir = "$toplevel/yabbattach";
$attachment_status = qq~
Directory Created for Attachments. Settings Need to be Saved. |
~;
}
}
}
}
if(!$http_dir && $ENV{'DOCUMENT_ROOT'} && $upload_dir && $INFO{'famod'} eq "autoconfig") {
my $toplevel = "$ENV{'DOCUMENT_ROOT'}";
my $http_dir_temp = $boardurl;
$http_dir_temp =~ s~(http://[\w|\.]+)/?.*~$1~is;
my $http_dir_temp2 = $upload_dir;
$http_dir_temp2 =~ s~$toplevel/?(\.*)~$1~is;
$http_dir = "$http_dir_temp/$http_dir_temp2";
$attachment_status = qq~
Settings Need to be Saved (Settings Reflected Below Have Not Yet Been Applied) |
~;
}
## /END File Attachment auto-config paths section
# figure out what to print
foreach $extitem(@ext) {
$extlist .= "$extitem ";
}
if ($checkext == 1) { $checkextcheck = ' checked'; }
if ($amdisplaypics == 1) { $amdisplaypicscheck = ' checked'; }
if ($allowattach == 1) { $allowattachcheck = ' checked'; }
if ($allowguestattach == 1) { $allowguestattachcheck = ' checked'; }
if ($maintenance) { $mainchecked = ' checked'; }
if ($guestaccess == 0) { $guestaccchecked = ' checked'; }
if($RegAgree) { $agreechecked = " checked"; }
if($emailpassword) { $mailpasschecked = " checked"; }
if($emailnewpass) { $newpasschecked = " checked"; }
if($emailwelcome) { $welchecked = " checked"; }
if ($MenuType) { $menuchecked = ' checked'; }
if ($enable_ubbc) { $ubbcchecked = ' checked'; }
if ($autolinkurls) { $aluchecked = ' checked'; }
if ($curposlinks) { $cpchecked = ' checked'; }
if ($profilebutton) { $pbchecked = ' checked'; }
if ($enable_news) { $newschecked = "checked" }
if ($enable_guestposting) { $gpchecked = "checked" }
if ($enable_notification) { $notifchecked = "checked" }
if ($allow_hide_email) { $ahmchecked = "checked" }
if ($showlatestmember) { $slmchecked = "checked" }
if ($Show_RecentBar) { $srbarchecked = "checked" }
if ($showmarkread) { $smreadchecked = "checked" }
if ($showmodify) { $smodchecked = "checked" }
if ($ShowBDescrip) { $bdescripchecked = "checked" }
if ($showuserpic) { $supicchecked = "checked" }
if ($showusertext) { $sutextchecked = "checked" }
if ($showgenderimage) { $sgichecked = "checked" }
if ($shownewsfader) { $snfchecked = "checked" }
if ($showyabbcbutt) { $syabbcchecked = "checked" }
if ($allowpics) { $allowpicschecked = "checked" }
if ($use_flock == 0) { $fls1 = " selected" } elsif ($use_flock == 1) { $fls2 = " selected" } elsif ($use_flock == 2) { $fls3 = " selected" }
$utfchecked = $usetempfile ? ' checked' : '';
$truncchecked = $faketruncation ? ' checked' : '';
if ($mailtype == 0) { $mts1 = ' selected'; } elsif ($mailtype == 1) { $mts2 = ' selected'; } elsif( $mailtype == 2 ) { $mts3 = ' selected'; }
if ($timeselected == 6) { $tsl6 = " selected" } elsif ($timeselected == 5) { $tsl5 = " selected" } elsif ($timeselected == 4) { $tsl4 = " selected" } elsif ($timeselected == 3) { $tsl3 = " selected" } elsif ($timeselected == 2) { $tsl2 = " selected" } else { $tsl1 = " selected" }
if ($servertype == 0) { $st1 = " selected"; } elsif ($servertype == 1) { $st2 = " selected"; }
$yymain .= qq~
~;
$yytitle = $txt{'222'};
&template;
exit;
}
sub GetBoardURL {
my $url = 'http://' . ($ENV{'HTTP_HOST'} ? $ENV{'HTTP_HOST'} : $ENV{'SERVER_NAME'}) .
($ENV{'SERVER_PORT'} != 80 ? ":$ENV{'SERVER_PORT'}" : '') .
$ENV{'SCRIPT_NAME'};
$url =~ s~/[^/]+\Z~/~;
return $url;
}
# Gets our current absolute path. Needed for error messages.
sub GetDirPath {
eval 'use Cwd; $cwd = cwd();';
unless( $cwd ) { $cwd = `pwd`; chomp $cwd; }
unless($cwd) { $cwd = $0 || $ENV{'PWD'} || $ENV{'CWD'} || ( $ENV{'DOCUMENT_ROOT'} . '/' . $ENV{'SCRIPT_NAME'} || $ENV{'PATH_INFO'} ); }
$cwd =~ tr~\\~/~;
$cwd =~ s~\A(.+)/\Z~$1~;
$cwd =~ s~\A(.+)/YaBB\.\w+\Z~$1~i;
return $cwd;
}
sub is_exe {
my ($cmd,$name);
foreach $cmd (@_) {
$name = ($cmd =~ /^(\S+)/)[0]; # remove any options
return ($cmd) if (-x $name and ! -d $name and $name =~ m:/:); # check for absolute or relative path
if (defined $ENV{PATH}) {
my $dir;
foreach $dir (split(/:/, $ENV{PATH})) {
return "$dir/$cmd" if (-x "$dir/$name" && ! -d "$dir/$name");
}
}
}
0;
}
sub ModifySettings2 {
&is_admin;
my @onoff = qw/
allowpics showyabbcbutt showbdescrip maintenance guestaccess insert_original enable_ubbc enable_news enable_guestposting enable_notification showlatestmember showrecentbar showmarkread showmodify showuserpic showusertext showgenderimage shownewsfader MenuType curposlinks profilebutton autolinkurls emailpassword RegAgree emailwelcome allow_hide_email usetempfile faketruncation emailnewpass/;
# Set as 0 or 1 if box was checked or not
my $fi;
map { $fi = lc $_; ${$_} = $FORM{$fi} eq 'on' ? 1 : 0; } @onoff;
$guestaccess = $guestaccess ? 0 : 1;
# If empty fields are submitted, set them to default-values to save yabb from crashing
$upload_dir = $FORM{'upload_dir'};
$http_dir = $FORM{'http_dir'};
$servertype = $FORM{'servertype'} || 0;
$extensions = $FORM{'extensions'};
chomp $extensions;
$limit = $FORM{'limit'} || 0;
$dirlimit = $FORM{'dirlimit'} || 0;
$checkext = $FORM{'checkext'} || 0;
$amdisplaypics = $FORM{'amdisplaypics'} || 0;
$allowattach = $FORM{'allowattach'} || 0;
$allowguestattach = $FORM{'allowguestattach'} || 0;
$maintenancetext = $FORM{'maintenancetext'} || "";
&ToHTML($maintenancetext);
$timeout = $FORM{'timeout'} || 5;
$fadertime = $FORM{'fadertime'} || 5000;
$timeselected = $FORM{'timeselect'} || 0;
$timeoffset = $FORM{'timeoffset'} || 0;
$TopAmmount = $FORM{'TopAmmount'} || 25;
$MembersPerPage = $FORM{'MembersPerPage'} || 20;
$maxdisplay = $FORM{'maxdisplay'} || 20;
$maxmessagedisplay = $FORM{'maxmessagedisplay'} || 20;
$max_log_days_old = $FORM{'max_log_days_old'} || 21;
$clicklogtime = $FORM{'clicklogtime'} || 1440;
if($clicklogtime >= 1440) { $clicklogtime = 1439; }
$use_flock = $FORM{'use_flock'} || 0;
$LOCK_EX = $FORM{'LOCK_EX'} || 2;
$LOCK_UN = $FORM{'LOCK_UN'} || 8;
$LOCK_SH = $FORM{'LOCK_SH'} || 1;
$Cookie_Length = $FORM{'cookielength'} || 60;
$cookieusername = $FORM{'cookieusername'} || 'YaBBusername';
$cookiepassword = $FORM{'cookiepassword'} || 'YaBBpassword';
if ($cookieusername eq $cookiepassword) {$cookieusername = 'YaBBusername'; $cookiepassword = 'YaBBpassword';}
$maxmesslen = $FORM{'maxmesslen'} || 5000;
$maxsiglen = $FORM{'maxsiglen'} || 200;
$jrmem = $FORM{'jrmem'} || 50;
$fullmem = $FORM{'fullmem'} || 100;
$srmem = $FORM{'srmem'} || 250;
$godmem = $FORM{'godmem'} || 500;
$language = $FORM{'language'} || 'english.lng';
$mbname = $FORM{'mbname'} || 'My YaBB 1 Gold - SP1';
$mbname =~ s/\"/\'/g;
$boardurl = $FORM{'boardurl'} || &GetBoardURL;
$boarddir = $FORM{'boarddir'} || &GetDirPath;
$boardsdir = $FORM{'boardsdir'} || "$boarddir/Boards";
$datadir = $FORM{'datadir'} || "$boarddir/Messages";
$memberdir = $FORM{'memberdir'} || "$boarddir/Members";
$sourcedir = $FORM{'sourcedir'} || "$boarddir/Sources";
$vardir = $FORM{'vardir'} || "$boarddir/Variables";
$facesdir = $FORM{'facesdir'} || "$boarddir/YaBBImages/avatars";
$facesurl = $FORM{'facesurl'} || "$boardurl/YaBBImages/avatars";
$imagesdir = $FORM{'imagesdir'} || "$boardurl/YaBBImages";
$helpfile = $FORM{'helpfile'} || "$boardurl/YaBBHelp/index.html";
$mailprog = $FORM{'mailprog'} || &is_exe('/usr/lib/sendmail','/usr/sbin/sendmail','/usr/ucblib/sendmail','sendmail','mailx','Mail','mail');
$smtp_server = $FORM{'smtp_server'} || '127.0.0.1';
$webmaster_email = $FORM{'webmaster_email'} || 'webmaster@mysite.com';
$mailtype = $FORM{'mailtype'} || 0;
$color{'titlebg'} = $FORM{'titlebg'} || '#6E94B7';
$color{'titletext'} = $FORM{'titletext'} || '#FFFFFF';
$color{'windowbg'} = $FORM{'windowbg'} || '#AFC6DB';
$color{'windowbg2'} = $FORM{'windowbg2'} || '#F8F8F8';
$color{'windowbg3'} = $FORM{'windowbg3'} || '#6394BD';
$color{'catbg'} = $FORM{'catbg'} || '#DEE7EF';
$color{'bordercolor'} = $FORM{'bordercolor'} || '#6394BD';
$color{'fadertext'} = $FORM{'fadertext'} || '#D4AD00';
$faderpath = $FORM{'faderpath'} || "$boardurl/fader.js";
$ubbcjspath = $FORM{'ubbcjspath'} || "$boardurl/ubbc.js";
if ($FORM{'userpic_width'} =~ /\d+/) { $userpic_width = $FORM{'userpic_width'}; }
else { $userpic_width = 65; }
if ($FORM{'userpic_height'} =~ /\d+/) { $userpic_height = $FORM{'userpic_height'}; }
else { $userpic_height = 65; }
$userpic_limits = $FORM{'userpic_limits'} || 'Please note that your image has to be gif or jpg and that it will be resized!';
$userpic_limits =~ s/\"/\'/g;
my $filler = q~ ~;
my $setfile = << "EOF";
###############################################################################
# Settings.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 1 Gold - SP 1.1 #
# Released: December 2001; Updated March 22, 2002 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2002 Xnull (www.xnull.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
########## Board Info ##########
# Note: these settings must be properly changed for YaBB to work
\$maintenance = $maintenance; # Set to 1 to enable Maintenance mode
\$guestaccess = $guestaccess; # Set to 0 to disallow guests from doing anything but login or register
\$language = "$language"; # Change to language pack you wish to use
\$mbname = "$mbname"; # The name of your YaBB forum
\$boardurl = "$boardurl"; # URL of your board's folder (without trailing '/')
\$Cookie_Length = $Cookie_Length; # Default minutes to set login cookies to stay for
\$cookieusername = "$cookieusername"; # Name of the username cookie
\$cookiepassword = "$cookiepassword"; # Name of the password cookie
\$RegAgree = $RegAgree; # Set to 1 to display the registration agreement when registering
\$emailpassword = $emailpassword; # 0 - instant registration. 1 - password emailed to new members
\$emailnewpass = $emailnewpass; # Set to 1 to email a new password to members if they change their email address
\$emailwelcome = $emailwelcome; # Set to 1 to email a welcome message to users even when you have mail password turned off
\$mailprog = "$mailprog"; # Location of your sendmail program
\$smtp_server = "$smtp_server"; # Address of your SMTP-Server
\$webmaster_email = q^$webmaster_email^; # Your email address. (eg: \$webmaster_email = q^admin\@host.com^;)
\$mailtype = $mailtype; # Mail program to use: 0 = sendmail, 1 = SMTP, 2 = Net::SMTP
########## Directories/Files ##########
# Note: directories other than \$imagesdir do not have to be changed unless you move things
\$boarddir = "$boarddir"; # The server path to the board's folder (usually can be left as '.')
\$boardsdir = "$boardsdir"; # Directory with board data files
\$datadir = "$datadir"; # Directory with messages
\$memberdir = "$memberdir"; # Directory with member files
\$sourcedir = "$sourcedir"; # Directory with YaBB source files
\$vardir = "$vardir"; # Directory with variable files
\$facesdir = "$facesdir"; # The server path to your avatars (userpics) folder
\$facesurl = "$facesurl"; # URL to your avatars folder
\$imagesdir = "$imagesdir"; # URL to your images folder
\$ubbcjspath = "$ubbcjspath"; # URL to your 'ubbc.js' (REQUIRED for post/modify to work properly)
\$faderpath = "$faderpath"; # URL to your 'fader.js'
\$helpfile = "$helpfile"; # URL to your help file
########## Colors ##########
# Note: equivalent to colors in CSS tag of template.html, so set to same colors preferrably
# for browsers without CSS compatibility and for some items that don't use the CSS tag
\$color{'titlebg'} = "$color{'titlebg'}"; # Background color of the 'title-bar'
\$color{'titletext'} = "$color{'titletext'}"; # Color of text in the 'title-bar' (above each 'window')
\$color{'windowbg'} = "$color{'windowbg'}"; # Background color for messages/forms etc.
\$color{'windowbg2'} = "$color{'windowbg2'}"; # Background color for messages/forms etc.
\$color{'windowbg3'} = "$color{'windowbg3'}"; # Color of horizontal rules in posts
\$color{'catbg'} = "$color{'catbg'}"; # Background color for category (at Board Index)
\$color{'bordercolor'} = "$color{'bordercolor'}"; # Table Border color for some tables
\$color{'fadertext'} = "$color{'fadertext'}"; # Color of text in the NewsFader (news color)
########## Layout ##########
\$maintenancetext = "$maintenancetext"; # User-defined text for Maintenance mode (leave blank for default text)
\$MenuType = $MenuType; # 1 for text menu or anything else for images menu
\$curposlinks = $curposlinks; # 1 for links in navigation on current page, or 0 for text without link
\$profilebutton = $profilebutton; # 1 to show view profile button under post, or 0 for blank
\$timeselected = $timeselected; # Select your preferred output Format of Time and Date
\$allow_hide_email = $allow_hide_email; # Allow users to hide their email from public. Set 0 to disable
\$showlatestmember = $showlatestmember; # Set to 1 to display "Welcome Newest Member" on the Board Index
\$shownewsfader = $shownewsfader; # 1 to allow or 0 to disallow NewsFader javascript on the Board Index
# If 0, you'll have no news at all unless you put tag
# back into template.html!!!
\$Show_RecentBar = $showrecentbar; # Set to 1 to display the Recent Post on Board Index
\$showmarkread = $showmarkread; # Set to 1 to display and enable the mark as read buttons
\$showmodify = $showmodify; # Set to 1 to display "Last modified: Realname - Date" under each message
\$ShowBDescrip = $showbdescrip; # Set to 1 to display board descriptions on the topic (message) index for each board
\$showuserpic = $showuserpic; # Set to 1 to display each member's picture in the message view (by the ICQ.. etc.)
\$showusertext = $showusertext; # Set to 1 to display each member's personal text in the message view (by the ICQ.. etc.)
\$showgenderimage = $showgenderimage; # Set to 1 to display each member's gender in the message view (by the ICQ.. etc.)
\$showyabbcbutt = $showyabbcbutt; # Set to 1 to display the yabbc buttons on Posting and IM Send Pages
########## File Attachment Settings ##########
\$limit = $limit; # Set to the maximum number of kilobytes an attachment can be. Set to 0 to disable the file size check.
\$dirlimit = $dirlimit; # Set to the maximum number of kilobytes the attachment directory can hold. Set to 0 to disable the directory size check.
\$upload_dir = '$upload_dir'; # The absolute path to the directory where your attachments are to be stored (without trailing '/' )
\$TempFile::TMPDIRECTORY = '$upload_dir'; # Puts temporary files used into same folder as attachments to prevent permission problems
\$http_dir = '$http_dir'; # The full url to the directory where your attachments are to be stored (without trailing '/' )
\$servertype = $servertype; # Set to 0 if you are running your YaBB on a Unix/Linux webhost, set to 1 if you are running on windows.
\@ext = qw($extensions); # The allowed file extensions for file attachements. Variable should be set in the form of "jpg bmp gif" and so on.
\$checkext = $checkext; # Set to 1 to enable file extension checking, set to 0 to allow all file types to be uploaded
\$amdisplaypics = $amdisplaypics; # Set to 1 to display attached pictures in posts, set to 0 to only show a link to them.
\$allowattach = $allowattach; # Set to 1 to allow file attaching, set to 0 to disable file attaching.
\$allowguestattach = $allowguestattach; # Set to 1 to allow guests to upload attachments, 0 to disable guest attachment uploading.
########## Feature Settings ##########
\$enable_ubbc = $enable_ubbc; # Set to 1 if you want to enable UBBC (Uniform Bulletin Board Code)
\$enable_news = $enable_news; # Set to 1 to turn news on, or 0 to set news off
\$allowpics = $allowpics; # set to 1 to allow members to choose avatars in their profile
\$enable_guestposting = $enable_guestposting; # Set to 0 if do not allow 1 is allow.
\$enable_notification = $enable_notification; # Allow e-mail notification
\$autolinkurls = $autolinkurls; # Set to 1 to turn URLs into links, or 0 for no auto-linking.
\$timeoffset = $timeoffset; # Time Offset (so if your server is EST, this would be set to -1 for CST)
\$TopAmmount = $TopAmmount; # No. of top posters to display on the top members list
\$MembersPerPage = $MembersPerPage; # No. of members to display per page of Members List - All
\$maxdisplay = $maxdisplay; # Maximum of topics to display
\$maxmessagedisplay = $maxmessagedisplay; # Maximum of messages to display
\$MaxMessLen = $maxmesslen; # Maximum Allowed Characters in a Posts
\$MaxSigLen = $maxsiglen; # Maximum Allowed Characters in Signatures
\$ClickLogTime = $clicklogtime; # Time in minutes to log every click to your forum (longer time means larger log file size)
\$max_log_days_old = $max_log_days_old; # If an entry in the user's log is older than ... days remove it
# Set to 0 if you want it disabled
\$fadertime = $fadertime; # Length in milliseconds to delay between each item in the news fader
\$timeout = $timeout; # Minimum time between 2 postings from the same IP
########## Membergroups ##########
\$JrPostNum = $jrmem; # Number of Posts required to show person as 'junior' membergroup
\$FullPostNum = $fullmem; # Number of Posts required to show person as 'full' membergroup
\$SrPostNum = $srmem; # Number of Posts required to show person as 'senior' membergroup
\$GodPostNum = $godmem; # Number of Posts required to show person as 'god' membergroup
########## MemberPic Settings ##########
\$userpic_width = $userpic_width; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit
\$userpic_height = $userpic_height; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit
\$userpic_limits = qq~$userpic_limits~; # Text To Describe The Limits
########## File Locking ##########
\$LOCK_EX = $LOCK_EX; # You can probably keep this as it is set now.
\$LOCK_UN = $LOCK_UN; # You can probably keep this as it is set now.
\$LOCK_SH = $LOCK_SH; # You can probably keep this as it is set now.
\$use_flock = $use_flock; # Set to 0 if your server doesn't support file locking,
# 1 for Unix/Linux and WinNT, and 2 for Windows 95/98/ME
\$usetempfile = $usetempfile; # Write to a temporary file when updating large files.
# This can potentially save your board index files from
# being corrupted if a process aborts unexpectedly.
# 0 to disable, 1 to enable.
\$faketruncation = $faketruncation; # Enable this option only if YaBB fails with the error:
# "truncate() function not supported on this platform."
# 0 to disable, 1 to enable.
1;
EOF
$setfile =~ s~(.+\;)\s+(\#.+$)~$1 . substr( $filler, 0, (70-(length $1)) ) . $2 ~gem;
$setfile =~ s~(.{64,}\;)\s+(\#.+$)~$1 . "\n " . $2~gem;
$setfile =~ s~^\s\s\s+(\#.+$)~substr( $filler, 0, 70 ) . $1~gem;
fopen(FILE, ">$boarddir/Settings.pl");
print FILE $setfile;
fclose(FILE);
$password = crypt($settings[0],$pwseed);
$Cookie_Exp_Date = 'Sunday, 17-Jan-2038 00:00:00 GMT';
$yySetCookies1 = cookie(-name => "$cookieusername",
-value => "$username",
-path => "/",
-expires => "$Cookie_Exp_Date");
$yySetCookies2 = cookie(-name => "$cookiepassword",
-value => "$password",
-path => "/",
-expires => "$Cookie_Exp_Date");
&LoadIMs;
&LoadUserSettings;
&WriteLog;
$yySetLocation = qq~$cgi;action=admin~;
&redirectexit;
}
1;