1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 21:21:54 +02:00

Issue #877: Feature request: event triggerings in core plugins (e.g: forum, pm, chatbox_menu)

This commit is contained in:
Lóna Lore 2015-02-10 10:32:37 +01:00
parent db62f8bdb9
commit b8be599b9a
2 changed files with 11 additions and 3 deletions

View File

@ -598,6 +598,7 @@ class e107forum
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
$info['data'] = $postInfo;
$postId = $sql->insert('forum_post', $info);
e107::getEvent()->trigger('user-forum-post-created', $info);
$forumInfo = array();
if($postId && $updateThread)
@ -627,7 +628,7 @@ class e107forum
$info['_FIELD_TYPES']['thread_total_replies'] = 'cmd';
$result = $sql->update('forum_thread', $info);
e107::getEvent()->trigger('user-forum-thread-updated', $info);
}
if(($result || !$updateThread) && $updateForum)
@ -684,6 +685,7 @@ class e107forum
$info['data'] = $threadInfo;
if($newThreadId = e107::getDb()->insert('forum_thread', $info))
{
e107::getEvent()->trigger('user-forum-thread-created', $info);
$postInfo['post_thread'] = $newThreadId;
$newPostId = $this->postAdd($postInfo, false);
$this->threadMarkAsRead($newThreadId);
@ -740,6 +742,7 @@ class e107forum
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
$info['WHERE'] = 'thread_id = '.(int)$threadId;
e107::getDb()->update('forum_thread', $info);
e107::getEvent()->trigger('user-forum-thread-updated', $info);
}
@ -751,6 +754,7 @@ class e107forum
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
$info['WHERE'] = 'post_id = '.(int)$postId;
e107::getDb()->update('forum_post', $info);
e107::getEvent()->trigger('user-forum-post-updated', $info);
}
@ -1885,7 +1889,8 @@ class e107forum
// delete the thread itself
if($sql->delete('forum_thread', 'thread_id='.$threadId))
{
$status = true;
$status = true;
e107::getEvent()->trigger('user-forum-thread-deleted', $threadId);
}
//Delete any thread tracking
@ -1936,7 +1941,8 @@ class e107forum
// delete post from database
if($sql->delete('forum_post', 'post_id='.$postId))
{
$deleted = true;
$deleted = true;
e107::getEvent()->trigger('user-forum-post-deleted', $postId);
}
// update statistics

View File

@ -56,6 +56,7 @@ class private_message
{
$this->pm_send_receipt($pm_info);
}
e107::getEvent()->trigger('user-pm-read', $pm_id);
}
}
@ -210,6 +211,7 @@ class private_message
if($pmid = $sql->insert('private_msg', $info))
{
e107::getEvent()->trigger('user-pm-sent', $info);
if($class == FALSE)
{
$toclass .= $u['user_name'].', ';