merging 6.2.10 and 6.2.11 changes

This commit is contained in:
JT Smith 2005-01-28 22:19:39 +00:00
parent 486b96d94d
commit d47830aceb
28 changed files with 139 additions and 59 deletions

View file

@ -214,7 +214,7 @@ sub hasRated {
return 1 if ($userId != 1 && $userId eq $self->get("userId")); # is poster
$ipAddress = $session{env}{REMOTE_ADDR} unless ($ipAddress);
my ($flag) = WebGUI::SQL->quickArray("select count(*) from forumPostRating where forumPostId="
.quote($self->get("forumPostId"))." and ((userId=".quote($userId)." and userId<>1) or (userId=1 and
.quote($self->get("forumPostId"))." and ((userId=".quote($userId)." and userId<>1) or (userId='1' and
ipAddress=".quote($ipAddress)."))");
return $flag;
}

View file

@ -1393,8 +1393,11 @@ The unique id of the post that was selected by the user in this thread.
sub getFlatThread {
my ($post, $thread, $forum, $caller, $currentPost) = @_;
my (@post_loop, @posts);
@posts = WebGUI::SQL->buildArray("SELECT forumPostId FROM forumPost WHERE forumThreadId=".quote($thread->get("forumThreadId"))." ORDER BY dateOfPost");
my (@post_loop, @posts, $OR);
unless ($post->getThread->getForum->isModerator) {
$OR = "OR status='denied' OR status='pending'";
}
@posts = WebGUI::SQL->buildArray("SELECT forumPostId FROM forumPost WHERE forumThreadId=".quote($thread->get("forumThreadId"))." AND NOT (status='deleted' $OR) ORDER BY dateOfPost");
foreach my $postId (@posts){
my $post = WebGUI::Forum::Post->new($postId);
push (@post_loop, getPostTemplateVars($post,$thread, $forum, $caller, {
@ -1829,7 +1832,7 @@ sub www_postPreview {
$newPost->{_properties}->{userId} = $session{user}{userId};
$newPost->{_properties}->{username} = ($session{form}{visitorName} || $session{user}{alias});
$newPost->{_properties}->{dateOfPost} = WebGUI::DateTime::time();
my $forum = WebGUI::Forum->new($forumId);
my $var = getPostTemplateVars($newPost, WebGUI::Forum::Thread->new($threadId), WebGUI::Forum->new($forumId), $caller);
$var->{'newpost.header'} = WebGUI::International::get('Forum, Preview Heading');
@ -1851,7 +1854,7 @@ sub www_postPreview {
$var->{'form.begin'} .= WebGUI::Form::hidden({name=>'forumOp', value=>"postSave"});
$var->{'form.submit'} = WebGUI::Form::submit();
$var->{'form.end'} = WebGUI::Form::formFooter();
return WebGUI::Template::process(1,"Forum/PostPreview", $var);
return WebGUI::Template::process($forum->get("postPreviewTemplateId"),"Forum/PostPreview", $var);
}