mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Corrected Forum event data.
This commit is contained in:
@@ -710,8 +710,8 @@ class e107forum
|
|||||||
$info['data']['post_id'] = $postId; // Append last inserted ID to data array for passing it to event callbacks.
|
$info['data']['post_id'] = $postId; // Append last inserted ID to data array for passing it to event callbacks.
|
||||||
|
|
||||||
|
|
||||||
|
$triggerData = $info['data'];
|
||||||
e107::getEvent()->trigger('user_forum_post_created', $info);
|
e107::getEvent()->trigger('user_forum_post_created', $triggerData);
|
||||||
|
|
||||||
ob_start(); // precaution so json doesn't break.
|
ob_start(); // precaution so json doesn't break.
|
||||||
$this->trackEmail($info['data']);
|
$this->trackEmail($info['data']);
|
||||||
@@ -757,8 +757,8 @@ class e107forum
|
|||||||
|
|
||||||
e107::getMessage()->addDebug("Updating Thread with: ".print_a($info,true));
|
e107::getMessage()->addDebug("Updating Thread with: ".print_a($info,true));
|
||||||
|
|
||||||
|
$triggerData = $info['data'];
|
||||||
e107::getEvent()->trigger('user_forum_topic_updated', $info);
|
e107::getEvent()->trigger('user_forum_topic_updated', $triggerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($result || !$updateThread) && $updateForum)
|
if(($result || !$updateThread) && $updateForum)
|
||||||
@@ -824,7 +824,7 @@ class e107forum
|
|||||||
|
|
||||||
if($newThreadId = e107::getDb()->insert('forum_thread', $info))
|
if($newThreadId = e107::getDb()->insert('forum_thread', $info))
|
||||||
{
|
{
|
||||||
e107::getEvent()->trigger('user_forum_topic_created', $info);
|
|
||||||
$postInfo['post_thread'] = $newThreadId;
|
$postInfo['post_thread'] = $newThreadId;
|
||||||
|
|
||||||
if(!$newPostId = $this->postAdd($postInfo, false))
|
if(!$newPostId = $this->postAdd($postInfo, false))
|
||||||
@@ -835,6 +835,13 @@ class e107forum
|
|||||||
$this->threadMarkAsRead($newThreadId);
|
$this->threadMarkAsRead($newThreadId);
|
||||||
$threadInfo['thread_sef'] = $this->getThreadsef($threadInfo);
|
$threadInfo['thread_sef'] = $this->getThreadsef($threadInfo);
|
||||||
|
|
||||||
|
$triggerData = $info['data'];
|
||||||
|
$triggerData['thread_id'] = $newThreadId;
|
||||||
|
$triggerData['thread_sef'] = $threadInfo['thread_sef'];
|
||||||
|
$triggerData['post_id'] = $newPostId;
|
||||||
|
|
||||||
|
e107::getEvent()->trigger('user_forum_topic_created', $triggerData);
|
||||||
|
|
||||||
return array('postid' => $newPostId, 'threadid' => $newThreadId, 'threadsef'=>$threadInfo['thread_sef']);
|
return array('postid' => $newPostId, 'threadid' => $newThreadId, 'threadsef'=>$threadInfo['thread_sef']);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -902,7 +909,9 @@ class e107forum
|
|||||||
e107::getMessage()->addDebug("Thread Update Failed: ".print_a($info,true));
|
e107::getMessage()->addDebug("Thread Update Failed: ".print_a($info,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
e107::getEvent()->trigger('user_forum_topic_updated', $info);
|
$triggerData = $threadInfo;
|
||||||
|
$triggerData['thread_id'] = intval($threadId);
|
||||||
|
e107::getEvent()->trigger('user_forum_topic_updated', $triggerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -919,6 +928,8 @@ class e107forum
|
|||||||
e107::getMessage()->addDebug("Post Update Failed: ".print_a($info,true));
|
e107::getMessage()->addDebug("Post Update Failed: ".print_a($info,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$triggerData = $postInfo;
|
||||||
|
$triggerData['post_id'] = intval($postId);
|
||||||
e107::getEvent()->trigger('user_forum_post_updated', $info);
|
e107::getEvent()->trigger('user_forum_post_updated', $info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -261,6 +261,11 @@ $THREADTOPIC_REPLY = "
|
|||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
$js = <<<TMPL
|
||||||
|
// javascript here.
|
||||||
|
TMPL;
|
||||||
|
|
||||||
|
e107::js('footer-inline', $js);
|
||||||
|
|
||||||
|
|
||||||
$FORUM_POST_TEMPLATE['reply'] = "";
|
$FORUM_POST_TEMPLATE['reply'] = "";
|
||||||
|
Reference in New Issue
Block a user