############################################################################### # Subs.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. # ############################################################################### $subsplver = "1 Gold - SP 1.1"; use subs 'exit'; $yymain = ""; # set body start to blank &readform; # parse the query &get_date; # get the current date/time $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 ||= 'yy'; if (!$user_ip) { if ($ENV{'HTTP_X_FORWARDED_FOR'} && $ENV{'HTTP_X_FORWARDED_FOR'} ne "127.0.0.1") {$user_ip = $ENV{'HTTP_X_FORWARDED_FOR'};} elsif (!$user_ip && $ENV{'HTTP_CLIENT_IP'} && $ENV{'HTTP_CLIENT_IP'} ne "127.0.0.1") {$user_ip = $ENV{'HTTP_CLIENT_IP'};} elsif (!$user_ip && $ENV{'X_CLIENT_IP'} && $ENV{'X_CLIENT_IP'} ne "127.0.0.1") {$user_ip = $ENV{'X_CLIENT_IP'};} else {$user_ip = $ENV{'REMOTE_ADDR'};} } $scripturl = qq~$boardurl/YaBB.$yyext~; $cgi = qq~$scripturl?board=$currentboard~; sub exit { local $| = 1; local $\ = ''; print ''; CORE::exit( $_[0] || 0 ); } sub redirectexit { print "Location: $yySetLocation\n\n"; exit; } sub redirectinternal { &LoadIMs; # Load IM's if($currentboard) { if($INFO{'num'}) { require "$sourcedir/Display.pl"; &Display; } else { require "$sourcedir/MessageIndex.pl"; &MessageIndex; } } else { require "$sourcedir/BoardIndex.pl"; &BoardIndex; } exit; } sub template { #START#Calendar mod# require "$sourcedir/Calendar.pl"; &get_settings; #END#Calendar mod# if($yySetCookies1 || $yySetCookies2) { print header(-cookie=>[$yySetCookies1, $yySetCookies2], -charset=>'$yycharset'); } else { print header(-status=>'200 OK', -charset=>'$yycharset'); } $yyposition = $yytitle; $yytitle = "$mbname - $yytitle"; $yymenu = qq~$img{'home'}$menusep$img{'help'}$menusep$img{'search'}$menusep$img{'memberlist'}~; if($settings[7] eq 'Administrator') { $yymenu .= qq~$menusep$img{'admin'}~; } if ($caltop == 1) {$yymenu .= qq~$menusep$img{'Calendar'}~;} 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'}~; } $yyimages = $imagesdir; fopen(TEMPLATE,"template.html") || die("$txt{'23'}: template.html"); @yytemplate =