updating discussion

This commit is contained in:
JT Smith 2003-10-04 19:47:35 +00:00
parent cc5248c8d6
commit 911bf4a079
2 changed files with 7 additions and 8 deletions

View file

@ -141,5 +141,6 @@ update international set internationalId=1014, namespace='WebGUI' where internat
update international set internationalId=1015, namespace='WebGUI' where internationalId='11' and namespace='MessageBoard'; update international set internationalId=1015, namespace='WebGUI' where internationalId='11' and namespace='MessageBoard';
alter table users add column referringAffiliate int not null default 0; alter table users add column referringAffiliate int not null default 0;
update users set referringAffiliate=1 where userId<>1; update users set referringAffiliate=1 where userId<>1;
delete from international where namespace='WebGUI' and internationalId=573;

View file

@ -31,10 +31,6 @@ sub _formatEditPostURL {
return WebGUI::URL::append($_[0],"forumOp=post&amp;forumPostId=".$_[1]); return WebGUI::URL::append($_[0],"forumOp=post&amp;forumPostId=".$_[1]);
} }
sub _formatLeavePostPendingURL {
return WebGUI::URL::page("op=viewMessageLog");
}
sub _formatNextThreadURL { sub _formatNextThreadURL {
return WebGUI::URL::append($_[0],"forumOp=nextThread&amp;forumThreadId=".$_[1]); return WebGUI::URL::append($_[0],"forumOp=nextThread&amp;forumThreadId=".$_[1]);
} }
@ -105,6 +101,9 @@ sub _getPostTemplateVars {
$var->{'post.status.label'} = WebGUI::International::get(553); $var->{'post.status.label'} = WebGUI::International::get(553);
$var->{'post.isLocked'} = $thread->isLocked; $var->{'post.isLocked'} = $thread->isLocked;
$var->{'post.isModerator'} = $forum->isModerator; $var->{'post.isModerator'} = $forum->isModerator;
$var->{'post.canEdit'} = ($forum->isModerator || ($post->get("userId") == $session{user}{userId}
&& $session{user}{userId} != 1 && $forum->get("editTimeout") < (WebGUI::DateTime::time()-$post->get("dateOfPost"))));
$var->{'post.user.isVisitor'} = ($post->get("userId") == 1);
$var->{'post.user.label'} = WebGUI::International::get(238); $var->{'post.user.label'} = WebGUI::International::get(238);
$var->{'post.user.name'} = $post->get("username"); $var->{'post.user.name'} = $post->get("username");
$var->{'post.user.Id'} = $post->get("userId"); $var->{'post.user.Id'} = $post->get("userId");
@ -121,9 +120,6 @@ sub _getPostTemplateVars {
$var->{'post.approve.url'} = _formatApprovePostURL($callback,$post->get("forumPostId")); $var->{'post.approve.url'} = _formatApprovePostURL($callback,$post->get("forumPostId"));
$var->{'post.deny.label'} = WebGUI::International::get(574); $var->{'post.deny.label'} = WebGUI::International::get(574);
$var->{'post.deny.url'} = _formatDenyPostURL($callback,$post->get("forumPostId")); $var->{'post.deny.url'} = _formatDenyPostURL($callback,$post->get("forumPostId"));
$var->{'post.pending.label'} = WebGUI::International::get(573);
$var->{'post.pending.url'} = _formatLeavePostPendingURL();
$var->{'post.tools.label'} = WebGUI::International::get(0);
$var->{'post.full'} = WebGUI::Template::process(WebGUI::Template::get(1,"Forum/Post"), $var); $var->{'post.full'} = WebGUI::Template::process(WebGUI::Template::get(1,"Forum/Post"), $var);
return $var; return $var;
} }
@ -135,7 +131,7 @@ sub _recurseThread {
push(@depth_loop,{depth=>$i}); push(@depth_loop,{depth=>$i});
} }
my @post_loop; my @post_loop;
push (@post_loop, _getPostTemplateVars($post, $thread, $forum, $callback, {'post.indent_loop'=>\@depth_loop})); push (@post_loop, _getPostTemplateVars($post, $thread, $forum, $callback, {'post.indent_loop'=>\@depth_loop},'post.indent.depth'=>$depth));
my $replies = $post->getReplies; my $replies = $post->getReplies;
foreach my $reply (@{$replies}) { foreach my $reply (@{$replies}) {
@post_loop = (@post_loop,@{_recurseThread($reply, $thread, $forum, $depth+1, $callback)}); @post_loop = (@post_loop,@{_recurseThread($reply, $thread, $forum, $depth+1, $callback)});
@ -178,6 +174,7 @@ sub viewForum {
'thread.root.user.profile'=>_formatUserProfileURL($root->get("userId")), 'thread.root.user.profile'=>_formatUserProfileURL($root->get("userId")),
'thread.root.user.name'=>$root->get("username"), 'thread.root.user.name'=>$root->get("username"),
'thread.root.user.id'=>$root->get("userId"), 'thread.root.user.id'=>$root->get("userId"),
'thread.root.user.isVisitor'=>($root->get("userId") == 1),
'thread.root.status'=>_formatStatus($root->get("status")), 'thread.root.status'=>_formatStatus($root->get("status")),
'thread.last.subject'=>_chopSubject($last->get("subject")), 'thread.last.subject'=>_chopSubject($last->get("subject")),
'thread.last.url'=>_formatThreadURL($callback,$last->get("forumPostId")), 'thread.last.url'=>_formatThreadURL($callback,$last->get("forumPostId")),
@ -187,6 +184,7 @@ sub viewForum {
'thread.last.user.profile'=>_formatUserProfileURL($last->get("userId")), 'thread.last.user.profile'=>_formatUserProfileURL($last->get("userId")),
'thread.last.user.name'=>$last->get("username"), 'thread.last.user.name'=>$last->get("username"),
'thread.last.user.id'=>$last->get("userId"), 'thread.last.user.id'=>$last->get("userId"),
'thread.last.user.isVisitor'=>($root->get("userId") == 1),
'thread.last.status'=>_formatStatus($last->get("status")) 'thread.last.status'=>_formatStatus($last->get("status"))
}); });
} }