continuing development of new discussion system

This commit is contained in:
JT Smith 2003-08-09 21:51:18 +00:00
parent df6d6fe93d
commit fa7331bbf0
3 changed files with 10 additions and 6 deletions

View file

@ -300,7 +300,7 @@ sub contentType {
if ($type eq "text") {
$hash{text} = WebGUI::International::get(1010);
} elsif ($type eq "mixed") {
$hash{code} = WebGUI::International::get(1008);
$hash{mixed} = WebGUI::International::get(1008);
} elsif ($type eq "code") {
$hash{code} = WebGUI::International::get(1011);
} elsif ($type eq "html") {

View file

@ -119,7 +119,7 @@ sub viewForum {
my $p = WebGUI::Paginator->new($callback);
$p->setDataByQuery("select * from forumThread where forumId=".$forumId." order by isSticky desc, lastPostDate desc");
my $threads = $p->getPageData;
foreach my $thread (@{$threads}) {
foreach my $thread (@$threads) {
my $root = WebGUI::Forum::Post->new($thread->{rootPostId});
my $last;
if ($thread->{rootPostId} == $thread->{lastPostId}) { #saves the lookup if it's the same id
@ -186,6 +186,10 @@ sub www_post {
$subject = $reply->get("subject");
$subject = "Re: ".$subject unless ($subject =~ /^Re:/);
$var->{'subscribe.form'} = WebGUI::Form::yesNo({
name=>'subscribe',
value=>0
});
}
if ($var->{isNewThread}) {
$var->{'form.begin'} .= WebGUI::Form::hidden({
@ -200,13 +204,13 @@ sub www_post {
value=>0
});
}
}
if ($var->{isNewMessage}) {
$var->{'subscribe.label'} = WebGUI::International::get(873);
$var->{'subscribe.form'} = WebGUI::Form::yesNo({
name=>'subscribe',
value=>1
});
}
if ($var->{isNewMessage}) {
$var->{'subscribe.label'} = WebGUI::International::get(873);
if ($forum->isModerator) {
$var->{'lock.label'} = WebGUI::International::get(1012);
$var->{'lock.form'} = WebGUI::Form::yesNo({

View file

@ -645,7 +645,7 @@ sub setRow {
push(@pairs, $key.'='.quote($data->{$key}));
}
}
WebGUI::SQL->write("update $table set ".join(", ", @pairs), $dbh);
WebGUI::SQL->write("update $table set ".join(", ", @pairs)." where ".$keyColumn."=".quote($data->{$keyColumn}), $dbh);
return $data->{$keyColumn};
}