Working on notifications and renaming Web to UI
This commit is contained in:
parent
31c7e127a8
commit
4388fa9b24
3 changed files with 22 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -14,7 +14,7 @@ use strict;
|
|||
use Tie::CPHash;
|
||||
use WebGUI::Attachment;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Forum::Web;
|
||||
use WebGUI::Forum::UI;
|
||||
use WebGUI::HTML;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Icon;
|
||||
|
|
@ -196,9 +196,9 @@ sub www_view {
|
|||
$templateId = $_[0]->get("templateId");
|
||||
}
|
||||
if ($session{form}{forumOp}) {
|
||||
return WebGUI::Forum::Web::forumOp(WebGUI::URL::page("func=view&wid=".$_[0]->get("wobjectId")));
|
||||
return WebGUI::Forum::UI::forumOp(WebGUI::URL::page("func=view&wid=".$_[0]->get("wobjectId")));
|
||||
} else {
|
||||
return $_[0]->processTemplate($templateId,\%var).WebGUI::Forum::Web::viewForum(WebGUI::URL::page("func=view&wid=".$_[0]->get("wobjectId")),1);
|
||||
return $_[0]->processTemplate($templateId,\%var).WebGUI::Forum::UI::viewForum(WebGUI::URL::page("func=view&wid=".$_[0]->get("wobjectId")),1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue