fixed a lot o bugs
This commit is contained in:
parent
f2584fe07b
commit
d150016395
6 changed files with 173 additions and 88 deletions
|
|
@ -39,6 +39,8 @@ Data management class for forums.
|
|||
$boolean = $forum->isModerator;
|
||||
$boolean = $forum->isSubscribed;
|
||||
|
||||
$forum->decrementReplies;
|
||||
$forum->decrementThreads;
|
||||
$forum->incrementReplies($postDate, $postId);
|
||||
$forum->incrementThreads($postDate, $postId);
|
||||
$forum->incrementViews;
|
||||
|
|
@ -120,6 +122,32 @@ sub create {
|
|||
return WebGUI::Forum->new($forumId);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 decrementReplies ( )
|
||||
|
||||
Deccrements this forum's reply counter.
|
||||
|
||||
=cut
|
||||
|
||||
sub incrementReplies {
|
||||
my ($self) = @_;
|
||||
WebGUI::SQL->write("update forum set replies=replies-1 where forumId=".$self->get("forumId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 decrementThreads ( )
|
||||
|
||||
Decrements this forum's thread counter.
|
||||
|
||||
=cut
|
||||
|
||||
sub incrementReplies {
|
||||
my ($self) = @_;
|
||||
WebGUI::SQL->write("update forum set threads=threads-1 where forumId=".$self->get("forumId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 get ( [ param ] )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue