############################################################################### #Post.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 1 Gold - SP 1.3 # # Released: December 2001; Updated April 6, 2003 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2003 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # # Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com # ############################################################################### $postplver = "1 Gold - SP 1.3"; 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); $pollthread = 0; $polltxt{'1a'} =~ tr/+/ /; $polltxt{'2a'} =~ tr/+/ /; if ($INFO{'title'} eq $polltxt{'1a'}) { $pollthread = 1; } elsif ($INFO{'title'} eq $polltxt{'2a'}) { $pollthread = 2; } if ($pollthread == 2 && $useraddpoll == 0) { &fatal_error($txt{'1'}); } $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 ($pollthread && $username eq "Guest") {$guest_vote = 1;} if ($pollthread == 2) { $settofield="question"; $sub = "$msubject"; } else { if (!$enable_notification || $username eq 'Guest') {$notification = ""} else { $notification = qq~ $txt{'131'}: $txt{'750'} ~;} } if(!$sub) { $subtitle = "$txt{'33'}"; } else { $subtitle = "$sub"; } $yymain .= qq~
   $mbname
   $cat
   $boardname
   $INFO{'title'} ( $subtitle )
~; $submittxt = "$txt{'105'}"; $destination = "post2"; $icon = "xx"; $is_preview = 0; $post = "post"; $preview = "preview"; $yytitle = "$INFO{'title'}"; &Postpage; if ($pollthread != 2) { &doshowthread; } &template; exit; } sub Postpage { my $extra; my($filetype_info, $filesize_info, $extensions); $extensions = join(" ", @ext); $filetype_info = $checkext == 1 ? qq~$fatxt{'2'} $extensions~ : qq~$fatxt{'2'} $fatxt{'4'}~; $filesize_info = $limit != 0 ? qq~$fatxt{'3'} $limit KB~ : qq~$fatxt{'3'} $fatxt{'5'}~; if ($is_preview) {$txt{'507'}=$txt{'771'};} $styletest = 0; fopen(TEMPLATE,"template.html") || die("$txt{'23'}: template.html"); @outemplate =