Function __global->cns_has_read_topic
Definitions
sources/cns_topics.php
- Find whether a member has read a certain topic, such that they have possibly read all posts within it already.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $topic_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the topic |
| $topic_last_time | ?TIME | No | No | Null | N/A | N/A | The time of the last post in the topic (null: get it from the DB) |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member (null: current member) |
| $member_last_time | ?TIME | No | No | Null | N/A | N/A | The time the member last viewed the topic (null: get it from the DB) |
Returns
- They have read it as such, yes
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find whether a member has read a certain topic, such that they have possibly read all posts within it already.
*
* @param AUTO_LINK $topic_id The ID of the topic
* @param ?TIME $topic_last_time The time of the last post in the topic (null: get it from the DB)
* @param ?MEMBER $member_id The member (null: current member)
* @param ?TIME $member_last_time The time the member last viewed the topic (null: get it from the DB)
* @return boolean They have read it as such, yes
*/
function cns_has_read_topic(int $topic_id, ?int $topic_last_time = null, ?int $member_id = null, ?int $member_last_time = null) : bool
* Find whether a member has read a certain topic, such that they have possibly read all posts within it already.
*
* @param AUTO_LINK $topic_id The ID of the topic
* @param ?TIME $topic_last_time The time of the last post in the topic (null: get it from the DB)
* @param ?MEMBER $member_id The member (null: current member)
* @param ?TIME $member_last_time The time the member last viewed the topic (null: get it from the DB)
* @return boolean They have read it as such, yes
*/
function cns_has_read_topic(int $topic_id, ?int $topic_last_time = null, ?int $member_id = null, ?int $member_last_time = null) : bool
