#!/usr/bin/perl
#############################################################
# Ikonboard v2.1
# Copyright 2000 Ikondiscussion.com - All Rights Reserved
# Ikondiscussion is a trademark of Ikondiscussion.com
#
# Software Distributed by: Ikondiscussion.com
# Visit us online at http://www.ikondiscussion.com
# Email us on boards@ikondiscussion.com
#
# All files written by Matthew Mecham
#############################################################
use CGI::Carp "fatalsToBrowser"; # Output errors to browser
use CGI qw(:standard); # Saves loads of work
$CGI::POST_MAX=1024 * 150; # limit post data
$CGI::DISABLE_UPLOADS = 1; # Disable uploads
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "ikon.lib"; # Require ikonboard ()
require "data/progs.cgi"; # Require prog names
require "data/boardinfo.cgi";# Require board info
require "data/styles.cgi"; # Require styles info
require "ikonmail.lib"; # Require email func ()
};
if ($@) {
print header(); print start_html(-title=>"$ibtxt{'0025'}");
print "$ibtxt{'0026'} $@\n$ibtxt{'0027'}";
print end_html; exit;
}
$|++; # Unbuffer the output
#################--- Begin the program ---###################
$thisprog = "post.cgi";
$query = new CGI;
&checkVALIDITY;
$cookiepath = $query->url(-absolute=>1);
$cookiepath =~ s/$thisprog//sg;
for ('forum','topic','membername','password','action','postno','inshowsignature',
'notify','inshowemoticons','previewfirst','intopictitle','intopicdescription',
'inpost') {
next unless defined $_;
next if $_ eq 'SEND_MAIL';
$tp = $query->param($_);
$tp = &cleaninput("$tp");
${$_} = $tp;
}
$inforum = $forum;
$intopic = $topic;
$inmembername = $membername;
$inpassword = $password;
$inpostno = $postno;
$innotify = $notify;
$currenttime = time;
$postipaddress = $ENV{'REMOTE_ADDR'};
if ($inshowemoticons ne "yes") { $inshowemoticons eq "no"; }
if ($innotify ne "yes") { $innotify eq "no"; }
if (! $inmembername) { $inmembername = cookie("amembernamecookie"); }
if (! $inpassword) { $inpassword = cookie("apasswordcookie"); }
if ($inmembername eq "") {
$inmembername = "$ibtxt{'0043'}";
}
else {
&getmemberstime("$inmembername");
}
if ($action eq "addnew" or $action eq "addreply") {
$namecookie = cookie(-name => "amembernamecookie",
-value => "$inmembername",
-path => "$cookiepath",
-expires => "+30d");
$passcookie = cookie(-name => "apasswordcookie",
-value => "$inpassword",
-path => "$cookiepath",
-expires => "+30d");
print header(-cookie=>[$namecookie, $passcookie]);
}
else {
print header();
}
if (($inforum) && ($inforum !~ /^[0-9]+$/)) { &error("$ibtxt{'0901'}&$ibtxt{'0501'}"); }
if (($intopic ) && ($intopic !~ /^[0-9]+$/)) { &error("$ibtxt{'0901'}&$ibtxt{'0501'}"); }
if (($inpostno) && ($inpostno !~ /^[0-9]+$/)) { &error("$ibtxt{'0901'}&$ibtxt{'0501'}"); }
$helpurl = &helpfiles("Einen_Beitrag_schreiben");
$helpurl = qq~$helpurl ~;
my %Mode = (
'new' => \&newthread,
'reply' => \&reply,
'replyquote' => \&replyquote
);
if($Mode{$action}) {
$Mode{$action}->();
}
elsif ($action eq "addnew" && $previewfirst eq "no") { &addnewthread; }
elsif ($action eq "addnew" && $previewfirst eq "yes") { &newthread; }
elsif ($action eq "addreply" && $previewfirst eq "no") { &addreply; }
elsif ($action eq "addreply" && $previewfirst eq "yes") { &reply; }
else { &error("$ibtxt{'0901'}&$ibtxt{'1401'}"); }
&output(
-Title => "$boardname - $ibtxt{'1402'} $forumname",
-ToPrint => $output,
-Version => $versionnumber
);
############ New Thread side
sub newthread {
### Lets sort out the flood control
&getmember("$inmembername");
if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) {
$currenttime = time;
($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
$lastpost = ($lastpost + $floodcontrollimit);
if ($lastpost > $currenttime) {
&error("$ibtxt{'1403'}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}");
}
}
&getforum("$inforum");
if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; }
if (($privateforum eq "yes") && ($allowed ne "yes")) {
&error("$ibtxt{'1406'}&$ibtxt{'1407'}");
}
# Emoticons routine
if ($emoticons eq "on") {
$emoticonslink = qq~$ibtxt{'1408'} ~;
$emoticonsbutton =qq~ $ibtxt{'1409'} ~;
}
# Add member to who's online
&whosonline("$inmembername|$ibtxt{'1410'} $forumname |$ibtxt{'1602'}") if ($privateforum ne "yes");
# Set up are we previewing/emailing/start thread allowance
if ($previewfirst eq "yes") {
&preview;
$inpost =~ s/\
/\n\n/g;
$inpost =~ s/\ /\n/g;
}
else {
&mischeader("$ibtxt{'1403'}");
}
if ($emailfunctions eq "on") {
if ($innotify eq "yes") {
$requestnotify = qq~ $ibtxt{'1411'} ~;
}
else {
$requestnotify = qq~ $ibtxt{'1411'} ~;
}
}
if ($startnewthreads eq "no") {
$startthreads = "$ibtxt{'1412'} ";
}
else {
$startthreads = "$ibtxt{'1413'}";
}
# Output the form
$output .= qq~
~;
} # end newthread routine
############### sub addnewthread #############
sub addnewthread { # start routine
### Lets sort out the flood control, incase they used the back button...
&getmember("$inmembername");
if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) {
$currenttime = time;
($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
$lastpost = ($lastpost + $floodcontrollimit);
if ($lastpost > $currenttime) {
&error("$ibtxt{'1403'}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}");
}
}
# Sort out the forum moderator
&moderator;
if ($startnewthreads eq "no") {
unless ($membercode eq "ad" || $inmembmod eq "yes") {
&error("$ibtxt{'1428'}&$ibtxt{'1412'}");
}
}
if ($userregistered eq "no") { &error("$ibtxt{'1428'}&$ibtxt{'1102'}"); }
elsif ($inpassword ne $password) { &error("$ibtxt{'1428'}&$ibtxt{'1430'}"); }
elsif ($membercode eq "banned") { &error("$ibtxt{'1432'}&$ibtxt{'1431'}"); }
elsif ($intopictitle eq "") { &error("$ibtxt{'1428'}&$ibtxt{'1433'}"); }
elsif ($inpost eq "") { &error("$ibtxt{'1428'}&$ibtxt{'1434'}"); }
else { # start else
&getforum("$inforum");
if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; }
if (($privateforum eq "yes") && ($allowed ne "yes")) {
&error("$ibtxt{'1406'}&$ibtxt{'1407'}");
}
### Get a new thread number.
$dirtoopen = "$ikondir" . "forum$inforum";
opendir (DIR, "$dirtoopen");
@dirdata = readdir(DIR);
closedir (DIR);
@sorteddirdata = grep(/thd/,@dirdata);
@newdirdata = sort numerically(@sorteddirdata);
@neworderdirdata = reverse(@newdirdata);
$highest = @neworderdirdata[0];
$highest =~ s/.thd//;
$newthreadnumber = $highest + 1;
# Open the bad word filter
$filetoopen = "$ikondir" . "data/badwords.cgi";
open (FILE, "$filetoopen");
$badwords = ;
close (FILE);
if ($badwords) {
@pairs = split(/\&/,$badwords);
foreach (@pairs) {
($bad, $good) = split(/=/,$_);
$inpost =~ s/$bad/$good/g;
$intopictitle =~ s/$bad/$good/g;
$intopicdescription =~ s/$bad/$good/g;
}
}
# Write the list.threadnumber entry
$filetoopen = "$ikondir" . "forum$inforum/$newthreadnumber.pl";
$filetoopen = &stripMETA($filetoopen);
open(FILE, ">$filetoopen");
flock (FILE, 2);
print FILE "$newthreadnumber|$intopictitle|$intopicdescription|open|0|0|$inmembername|$currenttime|$inmembername|$currenttime";
close(FILE);
# Create the new thread file
$filetomake = "$ikondir" . "forum$inforum/$newthreadnumber.thd";
$filetomake = &stripMETA($filetomake);
open(FILE, ">$filetomake");
flock(FILE, 2);
print FILE "$inmembername|$intopictitle|$postipaddress|$inshowemoticons|$inshowsignature|$currenttime|$inpost";
close(FILE);
# Update stats for member, and board
&getforum("$inforum");
$cleanmembername = $inmembername;
$cleanmembername =~ s/ /\_/isg;
$numberofposts++;
$lastpostdate = "$currenttime\%\%\%$threadprog?forum=$inforum&topic=$newthreadnumber\%\%\%$intopictitle" if ($privateforum ne "yes");
chomp $lastpostdate;
$filetomake = "$ikondir" . "members/$cleanmembername.cgi";
$filetomake = &stripMETA($filetomake);
open(FILE, ">$filetomake");
flock(FILE, 2);
print FILE "$inmembername|$password|$membertitle|$membercode|$numberofposts|$emailaddress|$showemail|$ipaddress|$homepage|$aolname|$icqnumber|$location|$interests|$joineddate|$lastpostdate|$signature|$timedifference|$privateforums|$useravatar|$misc1|$misc2|$misc3";
close(FILE);
$filetoopen = "$ikondir" . "data/allforums.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen");
flock FILE, 1;
@allforums = ;
close(FILE);
$filetomake = "$ikondir" . "data/allforums.cgi";
$filetomake = &stripMETA($filetomake);
open(FILE, ">$filetomake");
flock(FILE, 2);
foreach $forum (@allforums) { #start foreach @forums
chomp($forum);
($tempno, $trash) = split(/\|/,$forum);
if ($inforum eq $tempno) {
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic) = split(/\|/,$forum);
$lastposter = $inmembername;
$lastposttime = $currenttime;
$threads = $newthreadnumber;
print FILE "$forumid|$category|$categoryplace|$forumname|$forumdescription|$forummoderator|$htmlstate|$idmbcodestate|$privateforum|$startnewthreads|$lastposter|$lastposttime|$threads|$posts|$forumgraphic\n";
}
else { print FILE "$forum\n"; }
}
close(FILE);
require "$ikondir" . "data/boardstats.cgi";
$filetomake = "$ikondir" . "data/boardstats.cgi";
$filetomake = &stripMETA($filetomake);
$totalthreads++;
open(FILE, ">$filetomake");
flock(FILE, 2);
print FILE "\$lastregisteredmember = \"$lastregisteredmember\"\;\n";
print FILE "\$totalmembers = \"$totalmembers\"\;\n";
print FILE "\$totalthreads = \"$totalthreads\"\;\n";
print FILE "\$totalposts = \"$totalposts\"\;\n";
print FILE "\n1\;";
close (FILE);
# if the user wants email notifications, lets add them.
if (($emailfunctions eq "on") && ($innotify eq "yes")) { # start mail
$filetomake = "$ikondir" . "forum$inforum/$newthreadnumber.mal";
open (FILE, ">$filetomake");
flock (FILE, 2);
print FILE "$inmembername|$emailaddress\n";
close (FILE);
} # end if
$relocurl = "$threadprog?forum=$inforum&topic=$newthreadnumber";
&mischeader("$ibtxt{'1440'}");
$output .= qq~
$ibtxt{'1441'}
$ibtxt{'0321'}
~;
rebuildLIST(-Forum=>"$inforum");
} # end else
} # end addnewthread
###########################################
############## reply side #################
sub reply {
### Lets sort out the flood control
&getmember("$inmembername");
if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) {
$currenttime = time;
($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
$lastpost = ($lastpost + $floodcontrollimit);
if ($lastpost > $currenttime) {
&error("$ibtxt{''}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}");
}
}
&getforum("$inforum");
if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; }
if (($privateforum eq "yes") && ($allowed ne "yes")) {
&error("$ibtxt{'1406'}&$ibtxt{'1407'}");
}
if ($threadstate eq "closed" or $threadstate eq 'moved') { &error("$ibtxt{'1446'}&$ibtxt{'1447'}"); }
if ($emoticons eq "on") {
$emoticonslink = qq~$ibtxt{'1408'} ~;
$emoticonsbutton =qq~ $ibtxt{'1409'} ~;
}
if ($emailfunctions eq "on") {
if ($innotify eq "yes") {
$requestnotify = qq~ $ibtxt{'1411'} ~;
}
else {
$requestnotify = qq~ $ibtxt{'1411'} ~;
}
}
if ($previewfirst eq "yes") {
&preview;
$inpost =~ s/\/\n\n/g;
$inpost =~ s/\ /\n/g;
}
else {
&mischeader("$ibtxt{'1446'}")
}
$output .= qq~
~;
# Lets display the thread review
$filetoopen = "$ikondir" . "forum$inforum/$intopic.thd";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen");
flock(FILE, 2);
@threads = ;
close(FILE);
@sortedthreads = reverse(@threads);
&threadreview;
} # end add reply routine
##### Reply with quote
sub replyquote {
### Lets sort out the flood control
&getmember("$inmembername");
if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) {
$currenttime = time;
($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
$lastpost = ($lastpost + $floodcontrollimit);
if ($lastpost > $currenttime) {
&error("$ibtxt{'1446'}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}");
}
}
&getforum("$inforum");
if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; }
if ($threadstate eq "closed") { &error("Posting a reply&Sorry, this thread has been locked"); }
if (($privateforum eq "yes") && ($allowed ne "yes")) {
&error("$ibtxt{'1406'}&$ibtxt{'1407'}");
}
# Get the post to edit
$filetoopen = "$ikondir" . "forum$inforum/$intopic.thd";
$filetoopen = &stripMETA($filetoopen);
open(FILE, $filetoopen);
flock(FILE, 1);
@threads = ;
close(FILE);
$posttoget = $inpostno;
$posttoget--;
($membername, $topictitle, $postipaddress, $showemoticons, $showsignature ,$postdate, $post) = split(/\|/, @threads[$posttoget]);
$post =~ s/\/\n\n/g;
$post =~ s/\ /\n/g;
$postdate = $postdate + ($timedifferencevalue*3600) + ($timezone*3600);
$postdate = &dateformat("$postdate");
### Print form
$rawpost = $post;
if ($previewfirst eq "yes") {
$rawpost = $inpost;
$rawpost =~ s/\
/\n\n/g;
$rawpost =~ s/\ /\n/g;
&preview;
}
else {
&mischeader("$ibtxt{'1444'}");
}
if ($threadstate eq "closed") { &error("$ibtxt{'1446'}&$ibtxt{'1447'}"); }
if ($emoticons eq "on") {
$emoticonslink = qq~$ibtxt{'1408'} ~;
$emoticonsbutton =qq~ $ibtxt{'1409'} ~;
}
if ($emailfunctions eq "on") { $requestnotify = qq~ $ibtxt{'1411'} ~; }
$temppost = qq~\[quote\]$ibtxt{'1450'} $membername $ibtxt{'1119'} $postdate\[br\]$rawpost\[\/quote\]~;
$output .= qq~
~;
# Print the thread summary
@sortedthreads = reverse(@threads);
&threadreview;
} # end add reply quote
##### add the replyto the file.
sub addreply { # start routine
### Lets sort out the flood control, incase they used the back button...
&getmember("$inmembername");
if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) {
$currenttime = time;
($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
$lastpost = ($lastpost + $floodcontrollimit);
if ($lastpost > $currenttime) {
&error("$ibtxt{'1446'}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}");
}
}
if ($userregistered eq "no") { &error("$ibtxt{'1432'}&$ibtxt{'1102'}"); }
elsif ($inpassword ne $password) { &error("$ibtxt{'1432'}&$ibtxt{'1430'}"); }
elsif ($membercode eq "banned") { &error("$ibtxt{'1432'}&$ibtxt{'1431'}"); }
elsif ($inpost eq "") { &error("$ibtxt{'1428'}&$ibtxt{'1434'}"); }
else { # start else
&getforum("$inforum");
if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; }
if (($privateforum eq "yes") && ($allowed ne "yes")) {
&error("$ibtxt{'1406'}&$ibtxt{'1407'}");
}
# Grab the thread file
$filetoopen = "$ikondir" . "forum$inforum/$intopic.thd";
$filetoopen = &stripMETA($filetoopen);
open(FILE, "$filetoopen");
@allmessages = ;
close(FILE);
$totalthreadposts = @allmessages;
($trash, $topictitle) = split(/\|/,$allmessages[0]);
# Open the bad word filter
$filetoopen = "$ikondir" . "data/badwords.cgi";
open (FILE, "$filetoopen");
$badwords = ;
close (FILE);
if ($badwords) {
@pairs = split(/\&/,$badwords);
foreach (@pairs) {
($bad, $good) = split(/=/,$_);
$inpost =~ s/$bad/$good/g;
$intopictitle =~ s/$bad/$good/g;
$intopicdescription =~ s/$bad/$good/g;
}
}
my $file = "$ikondir" . "forum$inforum/$intopic.pl";
open (ENT, $file);
flock ENT, 1;
$in = ;
close (ENT);
($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in);
if ($threadstate eq "closed" or $threadstate eq 'moved') { &error("Posting a reply&Sorry, this thread has been locked"); }
$filetomake = "$ikondir" . "forum$inforum/$intopic.thd";
$filetomake = &stripMETA($filetomake);
open(FILE, ">$filetomake");
flock(FILE, 2);
foreach $messages (@allmessages) {
chomp $messages;
print FILE "$messages\n";
}
print FILE "$inmembername|$topictitle|$postipaddress|$inshowemoticons|$inshowsignature|$currenttime|$inpost";
close(FILE);
$threadposts = @allmessages;
open(FILE, ">$file");
flock(FILE, 2);
print FILE "$intopic|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$inmembername|$currenttime";
close(FILE);
$cleanmembername = $inmembername;
$cleanmembername =~ s/ /\_/isg;
$numberofposts++;
$lastpostdate = "$currenttime\%\%\%$threadprog?forum=$inforum&topic=$intopic\%\%\%$topictitle" if ($privateforum ne "yes");
chomp $lastpostdate;
$filetomake = "$ikondir" . "members/$cleanmembername.cgi";
$filetomake = &stripMETA($filetomake);
open(FILE, ">$filetomake");
flock(FILE, 2);
print FILE "$inmembername|$password|$membertitle|$membercode|$numberofposts|$emailaddress|$showemail|$ipaddress|$homepage|$aolname|$icqnumber|$location|$interests|$joineddate|$lastpostdate|$signature|$timedifference|$privateforums|$useravatar|$misc1|$misc2|$misc3";
close(FILE);
$filetoopen = "$ikondir" . "data/allforums.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, $filetoopen);
flock (FILE, 1);
@allforums = ;
close(FILE);
$filetomake = "$ikondir" . "data/allforums.cgi";
$filetomake = &stripMETA($filetomake);
open(FILE, ">$filetomake");
flock(FILE, 2);
foreach $forum (@allforums) { #start foreach @forums
chomp($forum);
($tempno, $trash) = split(/\|/,$forum);
if ($inforum eq $tempno) {
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic) = split(/\|/,$forum);
$lastposter = $inmembername;
$lastposttime = $currenttime;
$posts++;
print FILE "$forumid|$category|$categoryplace|$forumname|$forumdescription|$forummoderator|$htmlstate|$idmbcodestate|$privateforum|$startnewthreads|$lastposter|$lastposttime|$threads|$posts|$forumgraphic\n";
}
else { print FILE "$forum\n"; }
}
close(FILE);
require "$ikondir" . "data/boardstats.cgi";
$filetomake = "$ikondir" . "data/boardstats.cgi";
$filetomake = &stripMETA($filetomake);
$totalposts++;
open(FILE, ">$filetomake");
flock(FILE, 2);
print FILE "\$lastregisteredmember = \"$lastregisteredmember\"\;\n";
print FILE "\$totalmembers = \"$totalmembers\"\;\n";
print FILE "\$totalthreads = \"$totalthreads\"\;\n";
print FILE "\$totalposts = \"$totalposts\"\;\n";
print FILE "\n1\;";
close (FILE);
### email functions
# First, lets open the maildata file, and add (if needed) the new requestee.
if ($emailfunctions eq "on") { # start mail
$filetoopen = "$ikondir" . "forum$inforum/$intopic.mal";
open (FILE, "$filetoopen");
@maildata = ;
close (FILE);
if ($innotify eq "yes") {
open (FILE, ">$filetoopen");
flock (FILE, 2);
print FILE "$inmembername|$emailaddress\n";
foreach $line (@maildata) {
chomp $line;
print FILE "$line\n";
}
close (FILE);
}
# Lets sort the data (there's no point adding the new requestee at this point!)
foreach $dataline (@maildata) {
($postersname,$posteremailaddress) = split(/\|/,$dataline);
if ($lastemailsent ne $postersname) {
# No point in getting your own post emailed to you, so...
if ($inmembername eq $postersname) { next; }
# If not,carry on!
$output .= "\n\n \n\n";
$toemail = $posteremailaddress;
chomp $toemail;
$toemail =~ s/\\//g;
$fromemail = $adminemail_out;
chomp $fromemail;
$fromemail =~ s/\\//g;
$topictitle =~ s/"/\"/g;
$topicdescription =~ s/"/\"/g;
$to = $toemail;
$from = "$boardname <$fromemail>";
$subject = "[$forumname] $ibtxt{'1453'}";
$message .= "\n";
$message .= "$boardtitle\n";
$message .= "$boardurl/$forumsummaryprog\n";
$message .= "---------------------------------------------------------------------\n\n";
$message .= "$postersname, $inmembername $ibtxt{'1454'}\n\n";
$message .= "$ibtxt{'1455'} $category\n";
$message .= "$ibtxt{'1456'} $forumname\n";
$message .= "$ibtxt{'1457'} $topictitle\n";
$message .= "$ibtxt{'1458'} $topicdescription\n\n";
$message .= "$ibtxt{'1459'}\n\n";
$message .= "$boardurl/$threadprog?forum=$inforum&topic=$intopic\n\n";
$message .= "---------------------------------------------------------------------\n";
&sendmail($from, $from, $to, $SMTP_SERVER, $subject, $message );
$lastemailsent = "$postersname";
# trash the details, just to be safe.
$message = "";
$to = "";
$from = "";
$subject = "";
} # end if
} # end foreach
} # end email send.
$numberofitems = $totalthreadposts + 1;
$numberofpages = $numberofitems / $maxthreads;
if ($numberofitems > $maxthreads) { #1
if ($maxthreads < $numberofitems) { #2
($integer,$decimal) = split(/\./,$numberofpages);
if ($decimal > 0) { $numberofpages = $integer + 1; }
$pagestart = 0;
$counter = 0;
while ($numberofpages > $counter) { #3
$counter++;
$threadpages .= qq~ $counter ~;
$pagestart = $pagestart + $maxthreads;
} #e3
} #e2
$pagestoshow = qq~ [ $ibtxt{'0605'} $threadpages ]~;
} #e1
&mischeader("$ibtxt{'1461'}");
$relocurl = "$threadprog?forum=$inforum&topic=$intopic";
$output .= qq~
$ibtxt{'1462'}
$ibtxt{'0321'}
~;
rebuildLIST(-Forum=>"$inforum");
} # end else
} # end addreply
###########################
# Thread Review
sub threadreview {
$output .= qq~
$ibtxt{'1467'} $topictitle ($ibtxt{'1468'})
~;
foreach $threadline (@sortedthreads) {
($membername, $topictitle, $postipaddress ,$showemoticons ,$showsignature ,$postdate ,$post) = split(/\|/, $threadline);
$postdate = $postdate + ($timedifferencevalue*3600) + ($timezone*3600);
$postdate = &dateformat("$postdate");
$post = &ikoncode("$post");
$post = &doemoticons("$post");
$post =~ s/\:\)/ /g;
$post =~ s/\;\)/ /g;
$post =~ s/\:\(/ /g;
$post =~ s/\:\o/ /g;
$output .= qq~
$membername
$ibtxt{'0319'} $postdate
$post
~;
} # end foreach
$output .= qq~
~;
} # end routine