############################################################################### # Subs.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Project started by Zef Hemel (zef@zefnet.com) # # Software Version: YaBB 1 Gold - Release # # =========================================================================== # # Software Distributed by: http://yabb.xnull.com # # Support, News, Updates at: http://yabb.xnull.com/community/ # # =========================================================================== # # Copyright (c) 2000-2001 X-Null - All Rights Reserved # # Software by: The YaBB Development Team # ############################################################################### $subsplver="1 Gold - Release"; use subs 'exit'; sub exit { local $| = 1; local $\ = ''; print ''; CORE::exit( $_[0] || 0 ); } &readform; ### Set the Cookie Exp. Date and the Current Date### $Cookie_Exp_Date = "Sun, 17-Jan-2038 00:00:00 GMT"; # default just in case &SetCookieExp; &get_date; $currentboard = $INFO{'board'}; if ($currentboard =~ m~/~){ &fatal_error($txt{'399'}); } if ($currentboard =~ m~\\~){ &fatal_error($txt{'400'}); } if ($currentboard ne '' && currentboard !~ /\A[\s0-9A-Za-z#%+,-\.:=?@^_]+\Z/){ &fatal_error($txt{'399'}); } $pwseed ||= 'ya'; $printurl = qq~$boardurl/Printpage.cgi~; $reminderurl = qq~$boardurl/Reminder.cgi~; $scripturl = qq~$boardurl/YaBB.cgi~; $cgi = qq~$scripturl?board=$currentboard~; sub redirectexit { my $headers; if( $yyForceIIS ) { $headers = "HTTP/1.0 200 OK\n"; } $headers .= "Content-type: text/html\n"; if( $yySetCookies ) { $headers .= $yySetCookies; } if( $yySetLocation ) { $yySetLocation =~ s/ /%20/g; $headers .= "Location: $yySetLocation\n"; } $headers .= "\n"; if($yyblankpageIIS) { print "HTTP/1.0 302 Found\n"; } print $headers; exit; } sub redirectinternal { if( $currentboard ) { if( $INFO{'num'} ) { require "$sourcedir/Display.pl"; &Display; } else { require "$sourcedir/MessageIndex.pl"; &MessageIndex; } } else { require "$sourcedir/BoardIndex.pl"; &BoardIndex; } exit; } sub header { my $headers; if( $yyForceIIS ) { $headers = "HTTP/1.0 200 OK\n"; } $headers .= "Content-type: text/html\n"; if( $yySetCookies ) { $headers .= $yySetCookies; } $headers .= "\n"; print $headers; $yymenu = qq~$img{'home'}$menusep$img{'help'}$menusep$img{'search'}~; if($settings[7] eq 'Administrator') { $yymenu .= qq~$menusep$img{'admin'}~; } if($username eq 'Guest') { $yymenu .= qq~$menusep$img{'login'}$menusep$img{'register'}~; } else { $yymenu .= qq~$menusep$img{'profile'}~; if($enable_notification) { $yymenu .= qq~$menusep$img{'notification'}~; } $yymenu .= qq~$menusep$img{'logout'}~; } if($enable_news) { fopen(FILE, "$vardir/news.txt"); @newsmessages = ; fclose(FILE); srand; $yynews = qq~$txt{'102'}: $newsmessages[int rand(@newsmessages)]~; } if($username ne "Guest") { fopen(IM, "$memberdir/$username.msg"); @immessages = ; fclose(IM); $mnum = @immessages; if($mnum eq "1") { $yyim = qq~$txt{'152'} $mnum $txt{'471'}.~; } else { $yyim = qq~$txt{'152'} $mnum $txt{'153'}.~; } if($maintenance) { $yyim .= qq~
$txt{'616'}~; } } fopen(TEMPLATE,"template.html") || die("$txt{'23'}: template.html"); @yytemplate =