############################################################################### # Post.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. # ############################################################################### $postplver = "1 Gold - SP 1.1"; sub Post { if($username eq 'Guest' && $enable_guestposting == 0) { &fatal_error($txt{'165'}); } if( $currentboard eq '' ) { &fatal_error($txt{'1'}); } my($filetype_info, $filesize_info); my( $subtitle, $x, $mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate, $msubject, $mattach, $mip, $mmessage, $mns, $quotestart); my $quotemsg = $INFO{'quote'}; $threadid = $INFO{'num'}; ($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split(/\|/,$yyThreadLine); if( $mstate == 1 ) { &fatal_error($txt{'90'}); } # Determine what category we are in. fopen(FILE, "$boardsdir/$currentboard.ctb") || &fatal_error("300 $txt{'106'}: $txt{'23'} $currentboard.ctb"); $cat = ; fclose(FILE); $curcat = $cat; fopen(FILE, "$boardsdir/$cat.cat") || &fatal_error("300 $txt{'106'}: $txt{'23'} $cat.cat"); $cat = ; fclose(FILE); $notification = ! $enable_notification || $username eq 'Guest' ? '' : <<"~;"; $txt{'131'}: $txt{'750'} ~; $name_field = $realname eq '' ? qq~ $txt{'44'}: ~ : qq~~; $email_field = $realemail eq '' ? qq~ $txt{'69'}: ~ : qq~~; $sub = ""; $settofield="subject"; if( $threadid ne '' ) { fopen(FILE, "$datadir/$threadid.txt") || &fatal_error("201 $txt{'106'}: $txt{'23'} $threadid.txt"); @messages = ; fclose(FILE); if($quotemsg ne '') { ($msubject, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mmessage, $mns) = split(/\|/,$messages[$quotemsg]); $message=$mmessage; $message =~ s~
~\n~g; $message =~ s~\n{0,1}\[quote([^\]]*)\](.*?)\[/quote\]\n{0,1}~\n~isg; $message =~ s~\n*\[/*quote([^\]]*)\]\n*~~ig; $mname ||= $musername || $txt{'470'}; $quotestart = int( $quotemsg / $maxmessagedisplay ) * $maxmessagedisplay; $message = qq~[quote author=$mname link=board=$currentboard;num=$threadid;start=$quotestart#$quotemsg date=$mdate\]$message\[/quote\]\n~; $msubject =~ s/\bre:\s+//ig; if ($mns eq "NS") {$nscheck="checked";} } else { ($msubject, $mname, $memail, $mdate, $musername, $micon, $mattache, $mip, $mmessage, $mns) = split(/\|/,$messages[0]); $msubject =~ s/\bre:\s+//ig; } $sub = "Re: $msubject"; $settofield="message"; } if(!$sub) { $subtitle = "$txt{'33'}"; } else { $subtitle = "$sub"; } $yymain .= qq~
   $mbname
   $cat
   $boardname
   $INFO{'title'} ( $subtitle )
~; $submittxt = "$txt{'105'}"; $destination = "post2"; $icon = "xx"; $waction = "post"; $post = "post"; $preview = "preview"; $yytitle = "$INFO{'title'}"; &Postpage; &doshowthread; &template; exit; } sub Postpage { my $extra; my($filetype_info, $filesize_info); $filetype_info = $checkext == 1 ? qq~$fatxt{'2'} @ext~ : qq~$fatxt{'2'} $fatxt{'4'}~; $filesize_info = $limit != 0 ? qq~$fatxt{'3'} $limit KB~ : qq~$fatxt{'3'} $fatxt{'5'}~; if ($FORM{'waction'} =~ /preview/) {$txt{'507'}=$txt{'771'};} if (-e "$datadir/$INFO{'thread'}.poll"){ fopen (FILE, "$datadir/$INFO{'thread'}.poll"); @polloptions = ; fclose (FILE); chomp $polloptions[0]; ($question, $unorlock) = split(/\|/, $polloptions[0]); } if (($useraddpoll == 1) && ((!(-e "$datadir/$INFO{'thread'}.poll") && $INFO{'title'} !~ /Poll/) && ($INFO{"action"} eq "modify" && $INFO{"message"} == 0))){ $addthis = qq~ $polltxt{'15'}: $polltxt{'26'} ~; } if (($INFO{'title'} =~ /Poll/ && $threadid eq '') || ($INFO{"action"} eq "modify" && $INFO{'message'} == 0 && (($INFO{'title'} =~ /Poll/ && $useraddpoll == 1) || (-e("$datadir/$INFO{'thread'}.poll") && $usereditpoll == 1)))) { $ispollthread = 1; chomp $polloptions[0]; $polloptions .= qq~ $polltxt{'6'}:   ~; $pollcount = 1; while ($pollcount <= $numpolloptions){ ($crap, $needed) = split(/\|/, $polloptions[$pollcount]); chomp $needed; if ($pollcount == 1){ $polloptions .= qq~~; } else{ $polloptions .= qq~ ~; } $pollcount ++; } $polloptions .= qq~
$polltxt{'7'} 1: 
$polltxt{'7'} $pollcount: 
~; if (($userdelpoll == 1) && (($INFO{"action"} eq "modify" && $INFO{"message"} == 0) && (-e "$datadir/$INFO{'thread'}.poll"))){ $polloptions .= qq~ $polltxt{'27'}~;} } if($waction eq "imsend") { if(!$INFO{'to'}) { $INFO{'to'} = $FORM{'to'};} if($INFO{'to'}) {$settofield="message";} else {$settofield="to";} $idinfo = "$INFO{'id'}"; if(!$INFO{'adminim'}) { if(-e("$memberdir/$username.imconfig")) { fopen(FILE, "$memberdir/$username.imconfig"); @userimcfg = ; fclose(FILE); } $userimcfg[8] =~ s~[\n\r]~~g; if ($userimcfg[8] > 0) { if ($userimcfg[8] == 1) {$dropdown_members = "\n";} if ($settofield eq "to") { $settofield = "to2"; } if ($INFO{'to'}) { fopen(TIEDOSTO, "$memberdir/$INFO{'to'}.dat"); @jasentiedot=; fclose(TIEDOSTO); $nimi = $jasentiedot[1]; $nimi =~ s~[\n\r]~~g; $dropdown_members .= "