Function __global->cns_send_topic_notification
Definitions
sources/cns_posts_action2.php
- Send out a notification, as a topic just got a new post.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $url | URLPATH | No | No | required parameter | N/A | N/A | The URL to view the new post |
| $topic_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the topic that got posted in |
| $post_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the post |
| $forum_id | ?AUTO_LINK | No | No | required parameter | N/A | N/A | The forum that the topic is in (null: private topic) |
| $sender_member_id | MEMBER | No | No | required parameter | N/A | N/A | The member that made the post triggering this tracking notification |
| $is_starter | boolean | No | No | required parameter | N/A | N/A | Whether the post started a new topic |
| $post | LONG_TEXT | No | No | required parameter | N/A | N/A | The post, in Comcode format |
| $topic_title | SHORT_TEXT | No | No | required parameter | N/A | N/A | The topic title (blank: look it up from the $topic_id). If non-blank we must use it as it is implying the database might not have the correct value yet |
| $_limit_to | ?MEMBER | No | No | Null | N/A | N/A | Only send the notification to this member (null: no such limit) |
| $is_pt | boolean | No | No | False | N/A | N/A | Whether this is for a Private Topic |
| $no_notify_for__notification_code | ?ID_TEXT | No | No | Null | N/A | N/A | DO NOT send notifications to: The notification code (null: no restriction) |
| $no_notify_for__code_category | ?SHORT_TEXT | No | No | Null | N/A | N/A | DO NOT send notifications to: The category within the notification code (null: none / no restriction) |
| $poster_name | ?SHORT_TEXT | No | No | Null | N/A | N/A | The name of the poster (null: default for $sender_member_id) |
Preview
Code (PHP)
/**
* Send out a notification, as a topic just got a new post.
*
* @param URLPATH $url The URL to view the new post
* @param AUTO_LINK $topic_id The ID of the topic that got posted in
* @param AUTO_LINK $post_id The ID of the post
* @param ?AUTO_LINK $forum_id The forum that the topic is in (null: private topic)
* @param MEMBER $sender_member_id The member that made the post triggering this tracking notification
* @param boolean $is_starter Whether the post started a new topic
* @param LONG_TEXT $post The post, in Comcode format
* @param SHORT_TEXT $topic_title The topic title (blank: look it up from the $topic_id). If non-blank we must use it as it is implying the database might not have the correct value yet
* @param ?MEMBER $_limit_to Only send the notification to this member (null: no such limit)
* @param boolean $is_pt Whether this is for a Private Topic
* @param ?ID_TEXT $no_notify_for__notification_code DO NOT send notifications to: The notification code (null: no restriction)
* @param ?SHORT_TEXT $no_notify_for__code_category DO NOT send notifications to: The category within the notification code (null: none / no restriction)
* @param ?SHORT_TEXT $poster_name The name of the poster (null: default for $sender_member_id)
*/
function cns_send_topic_notification(string $url, int $topic_id, int $post_id, ?int $forum_id, int $sender_member_id, bool $is_starter, string $post, string $topic_title, ?int $_limit_to = null, bool $is_pt = false, ?string $no_notify_for__notification_code = null, ?string $no_notify_for__code_category = null, ?string $poster_name = null)
* Send out a notification, as a topic just got a new post.
*
* @param URLPATH $url The URL to view the new post
* @param AUTO_LINK $topic_id The ID of the topic that got posted in
* @param AUTO_LINK $post_id The ID of the post
* @param ?AUTO_LINK $forum_id The forum that the topic is in (null: private topic)
* @param MEMBER $sender_member_id The member that made the post triggering this tracking notification
* @param boolean $is_starter Whether the post started a new topic
* @param LONG_TEXT $post The post, in Comcode format
* @param SHORT_TEXT $topic_title The topic title (blank: look it up from the $topic_id). If non-blank we must use it as it is implying the database might not have the correct value yet
* @param ?MEMBER $_limit_to Only send the notification to this member (null: no such limit)
* @param boolean $is_pt Whether this is for a Private Topic
* @param ?ID_TEXT $no_notify_for__notification_code DO NOT send notifications to: The notification code (null: no restriction)
* @param ?SHORT_TEXT $no_notify_for__code_category DO NOT send notifications to: The category within the notification code (null: none / no restriction)
* @param ?SHORT_TEXT $poster_name The name of the poster (null: default for $sender_member_id)
*/
function cns_send_topic_notification(string $url, int $topic_id, int $post_id, ?int $forum_id, int $sender_member_id, bool $is_starter, string $post, string $topic_title, ?int $_limit_to = null, bool $is_pt = false, ?string $no_notify_for__notification_code = null, ?string $no_notify_for__code_category = null, ?string $poster_name = null)
