diff --git a/e107_plugins/forum/e_notify.php b/e107_plugins/forum/e_notify.php
index a24f940da..b93fb3205 100644
--- a/e107_plugins/forum/e_notify.php
+++ b/e107_plugins/forum/e_notify.php
@@ -26,7 +26,8 @@ class forum_notify extends notify
$config[] = array(
'name' => LAN_FORUM_NT_NEWTOPIC,
- 'function' => "forum_nt",
+ // 'function' => "forum_nt",
+ 'function' => "user_forum_topic_created",
'category' => ''
);
@@ -63,10 +64,42 @@ class forum_notify extends notify
return $config;
}
- function forum_nt($data)
+ //function forum_nt($data)
+ function user_forum_topic_created($data)
{
- $message = 'todo';
- $this->send('forum_nt', LAN_PLUGIN_FORUM_NAME, $message);
+ /*
+ [u] = username / realname?
+ [f] = forumname
+ [l] = link / url
+ [s] = subject
+ [m] = message
+ [d] = deleted by
+ */
+
+ if (!isset($data['post_id']) || intval($data['post_id']) < 1) return;
+
+ $threadid = $data['thread_id'];
+
+ $sql = e107::getDb();
+ $tmp = $sql->gen('SELECT u.user_loginname, f.forum_name, f.forum_sef, t.thread_id, t.thread_name, p.post_entry
+ FROM `#forum_post` AS p
+ LEFT JOIN `#user` AS u ON (p.post_user = u.user_id)
+ LEFT JOIN `#forum_thread` AS t ON (t.thread_id = p.post_thread)
+ LEFT JOIN `#forum` AS f ON (f.forum_id = t.thread_forum_id)
+ WHERE p.post_id = '.intval($data['post_id']));
+
+ if ($tmp) $data = $sql->fetch();
+ else return;
+
+
+ $message = e107::getParser()->lanVars(LAN_FORUM_NT_NEWTOPIC_MSG, array(
+ 'u' => USERNAME,
+ 'f' => $data['forum_name'],
+ 's' => $data['thread_name'],
+ 'm' => $data['post_entry'],
+ 'l' => e107::url('forum', 'topic', array('thread_id'=>$data['thread_id'], 'thread_name'=>$data['thread_name'], 'forum_sef' => $data['forum_sef']), array('mode' => 'full'))
+ ));
+ $this->send('user_forum_topic_created', LAN_PLUGIN_FORUM_NAME, $message);
}
function forum_ntp($data)
diff --git a/e107_plugins/forum/languages/English/English_notify.php b/e107_plugins/forum/languages/English/English_notify.php
index 38298ce92..9007dd709 100644
--- a/e107_plugins/forum/languages/English/English_notify.php
+++ b/e107_plugins/forum/languages/English/English_notify.php
@@ -7,6 +7,7 @@ define("LAN_FORUM_NT_8", "Forum - Thread deleted");
define("LAN_FORUM_NT_9", "Forum - Thread split");
define("LAN_FORUM_NT_10", "Forum - Post deleted");
define("LAN_FORUM_NT_11", "Forum - Post reported");
+define("LAN_FORUM_NT_12", "Forum - Post created");
define("LAN_FORUM_NT_NEWTOPIC", "New topic created");
define("LAN_FORUM_NT_NEWTOPIC_PROB", "New topic created by probationary member");
@@ -14,4 +15,37 @@ define("LAN_FORUM_NT_TOPIC_DELETED", "Topic deleted");
define("LAN_FORUM_NT_TOPIC_SPLIT", "Topic split");
define("LAN_FORUM_NT_POST_DELETED", "Post deleted");
define("LAN_FORUM_NT_POST_REPORTED", "Post reported");
+define("LAN_FORUM_NT_POST_CREATED", "Post created");
+
+define("LAN_FORUM_NT_NEWTOPIC_MSG", "Forum thread created by: [u] (Forum name: [f])
Subject: [s]
Message:
[m]
");
+define("LAN_FORUM_NT_NEWTOPIC_PROB_MSG", "Forum thread created by: [u] (Forum name: [f])
Subject: [s]
Message:
[m]
");
+
+define("LAN_FORUM_NT_POST_CREATED_MSG", "Forum message created by: [u] (Forum name: [f])
Message:
[m]
");
+define("LAN_FORUM_NT_TOPIC_DELETED_MSG", "Forum thread created by: [u] (Forum name: [f])
Subject: [s]
Forum thread deleted by:
[d]
Message: [m]
[m]
");
+
+// Forum Notify Types
+define('NT_LAN_FT_1', 'Forum Events');
+define('NT_LAN_FO_1', 'Forum thread posted');
+define('NT_LAN_MP_1', 'Forum message posted');
+define('NT_LAN_FD_1', 'Forum thread deleted');
+define('NT_LAN_FP_1', 'Forum message deleted');
+define('NT_LAN_FM_1', 'Forum thread moved');
+
+
+
+// Forum message deleted
+define('NT_LAN_FP_3', 'Forum message created by');
+define('NT_LAN_FP_4', 'Forum name');
+define('NT_LAN_FP_6', 'Message');
+define('NT_LAN_FP_7', 'Forum message is deleted');
+define('NT_LAN_FP_8', 'Forum message deleted by');
+
+// Forum thread moved
+define('NT_LAN_FM_3', 'Forum thread created by');
+define('NT_LAN_FM_4', 'Old subject');
+define('NT_LAN_FM_5', 'New subject');
+define('NT_LAN_FM_6', 'Old (source) forum name');
+define('NT_LAN_FM_7', 'New (destination) forum name');
+define('NT_LAN_FM_8', 'Forum thread is moved');
+define('NT_LAN_FM_9', 'Forum thread is moved by');
\ No newline at end of file