lots of bug fixes

This commit is contained in:
JT Smith 2004-09-06 21:28:55 +00:00
parent fd0413c746
commit b4498138fb
12 changed files with 67 additions and 45 deletions

View file

@ -22,14 +22,13 @@ sub process {
my $a = WebGUI::SQL->read("select forumId,archiveAfter,masterForumId from forum");
while (my $forum = $a->hashRef) {
if ($forum->{masterForumId}) {
($forum->{archiveAfter}) = WebGUI::SQL->quickArray("select archiveAfter from forum where masterForumId=$forum->{masterForumId}");
($forum->{archiveAfter}) = WebGUI::SQL->quickArray("select archiveAfter from forum where masterForumId=".quote($forum->{masterForumId}));
}
my $archiveDate = $epoch - $forum->{archiveAfter};
my $b = WebGUI::SQL->read("select forumThreadId from forumThread where forumId=".$forum->{forumId}
." and lastPostDate<$archiveDate");
my $b = WebGUI::SQL->read("select forumThreadId from forumThread where forumId=".quote($forum->{forumId})." and lastPostDate<$archiveDate");
while (my ($threadId) = $b->array) {
WebGUI::SQL->write("update forumPost set status='archived' where status='approved' and forumThreadId=$threadId");
WebGUI::SQL->write("update forumThread set status='archived' where status='approved' and forumThreadId=$threadId");
WebGUI::SQL->write("update forumPost set status='archived' where status='approved' and forumThreadId=".quote($threadId));
WebGUI::SQL->write("update forumThread set status='archived' where status='approved' and forumThreadId=".quote($threadId));
}
$b->finish;
}