mirror of
https://github.com/e107inc/e107.git
synced 2025-07-15 12:06:19 +02:00
Issue #877: Feature request: event triggerings in core plugins (e.g: forum, pm, chatbox_menu)
This commit is contained in:
@ -598,6 +598,7 @@ class e107forum
|
|||||||
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
|
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
|
||||||
$info['data'] = $postInfo;
|
$info['data'] = $postInfo;
|
||||||
$postId = $sql->insert('forum_post', $info);
|
$postId = $sql->insert('forum_post', $info);
|
||||||
|
e107::getEvent()->trigger('user-forum-post-created', $info);
|
||||||
$forumInfo = array();
|
$forumInfo = array();
|
||||||
|
|
||||||
if($postId && $updateThread)
|
if($postId && $updateThread)
|
||||||
@ -627,7 +628,7 @@ class e107forum
|
|||||||
$info['_FIELD_TYPES']['thread_total_replies'] = 'cmd';
|
$info['_FIELD_TYPES']['thread_total_replies'] = 'cmd';
|
||||||
|
|
||||||
$result = $sql->update('forum_thread', $info);
|
$result = $sql->update('forum_thread', $info);
|
||||||
|
e107::getEvent()->trigger('user-forum-thread-updated', $info);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($result || !$updateThread) && $updateForum)
|
if(($result || !$updateThread) && $updateForum)
|
||||||
@ -684,6 +685,7 @@ class e107forum
|
|||||||
$info['data'] = $threadInfo;
|
$info['data'] = $threadInfo;
|
||||||
if($newThreadId = e107::getDb()->insert('forum_thread', $info))
|
if($newThreadId = e107::getDb()->insert('forum_thread', $info))
|
||||||
{
|
{
|
||||||
|
e107::getEvent()->trigger('user-forum-thread-created', $info);
|
||||||
$postInfo['post_thread'] = $newThreadId;
|
$postInfo['post_thread'] = $newThreadId;
|
||||||
$newPostId = $this->postAdd($postInfo, false);
|
$newPostId = $this->postAdd($postInfo, false);
|
||||||
$this->threadMarkAsRead($newThreadId);
|
$this->threadMarkAsRead($newThreadId);
|
||||||
@ -740,6 +742,7 @@ class e107forum
|
|||||||
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
||||||
$info['WHERE'] = 'thread_id = '.(int)$threadId;
|
$info['WHERE'] = 'thread_id = '.(int)$threadId;
|
||||||
e107::getDb()->update('forum_thread', $info);
|
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['_FIELD_TYPES'] = $this->fieldTypes['forum_post'];
|
||||||
$info['WHERE'] = 'post_id = '.(int)$postId;
|
$info['WHERE'] = 'post_id = '.(int)$postId;
|
||||||
e107::getDb()->update('forum_post', $info);
|
e107::getDb()->update('forum_post', $info);
|
||||||
|
e107::getEvent()->trigger('user-forum-post-updated', $info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1886,6 +1890,7 @@ class e107forum
|
|||||||
if($sql->delete('forum_thread', 'thread_id='.$threadId))
|
if($sql->delete('forum_thread', 'thread_id='.$threadId))
|
||||||
{
|
{
|
||||||
$status = true;
|
$status = true;
|
||||||
|
e107::getEvent()->trigger('user-forum-thread-deleted', $threadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Delete any thread tracking
|
//Delete any thread tracking
|
||||||
@ -1937,6 +1942,7 @@ class e107forum
|
|||||||
if($sql->delete('forum_post', 'post_id='.$postId))
|
if($sql->delete('forum_post', 'post_id='.$postId))
|
||||||
{
|
{
|
||||||
$deleted = true;
|
$deleted = true;
|
||||||
|
e107::getEvent()->trigger('user-forum-post-deleted', $postId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update statistics
|
// update statistics
|
||||||
|
@ -56,6 +56,7 @@ class private_message
|
|||||||
{
|
{
|
||||||
$this->pm_send_receipt($pm_info);
|
$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))
|
if($pmid = $sql->insert('private_msg', $info))
|
||||||
{
|
{
|
||||||
|
e107::getEvent()->trigger('user-pm-sent', $info);
|
||||||
if($class == FALSE)
|
if($class == FALSE)
|
||||||
{
|
{
|
||||||
$toclass .= $u['user_name'].', ';
|
$toclass .= $u['user_name'].', ';
|
||||||
|
Reference in New Issue
Block a user