Working on notifications and renaming Web to UI

This commit is contained in:
JT Smith 2003-10-11 17:09:38 +00:00
parent 31c7e127a8
commit 4388fa9b24
3 changed files with 22 additions and 5 deletions

View file

@ -75,7 +75,6 @@ sub incrementReplies {
my ($self, $dateOfReply, $replyId) = @_;
WebGUI::SQL->write("update forumThread set replies=replies+1, lastPostId=$replyId, lastPostDate=$dateOfReply
where forumThreadId=".$self->get("forumThreadId"));
#add method to notify users for subscriptions
}
sub incrementViews {

View file

@ -1,4 +1,4 @@
package WebGUI::Forum::Web;
package WebGUI::Forum::UI;
use strict qw(vars subs);
use WebGUI::DateTime;
@ -7,6 +7,7 @@ use WebGUI::Forum;
use WebGUI::Forum::Post;
use WebGUI::Forum::Thread;
use WebGUI::HTML;
use WebGUI::MessageLog;
use WebGUI::Session;
use WebGUI::Template;
@ -177,6 +178,23 @@ sub forumOp {
return &$cmd($callback);
}
sub notifySubscribers {
my ($self, $postId) = @_;
my $post = WebGUI::Post->new($postId);
my $sth = WebGUI::SQL->read("select userId from forumThreadSubscription where forumThreadId=".$post->get("forumThreadId"));
WebGUI::MessageLog::addInternationalizedEntry($userId,"",
WebGUI::URL::page('func=showMessage&wid='.$session{form}{wid}
.'&sid='.$session{form}{sid}.'&mid='.$session{form}{mid}),875);
$forum
my $message = WebGUI::Template::process(WebGUI::Template::get(1,"Forum/Notification"), $var);
while (($userId) = $sth->array) {
WebGUI::MessageLog::addEntry($userId,"","Subscription Notification",);
}
$sth->finish;
}
sub viewForum {
my ($callback, $forumId) = @_;
my (%var, @thread_loop);