We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 089ec53 + f42553a commit f75b114Copy full SHA for f75b114
1 file changed
class/TopicHandler.php
@@ -242,6 +242,22 @@ public function getTopPostId($topic_id)
242
return $post_id;
243
}
244
245
+ //Added by BigKev to get the next unread post ID based on the $lastreadpost_id
246
+ public function getNextPostId($topic_id, $lastreadpost_id)
247
+ {
248
+ $sql = 'SELECT MIN(post_id) AS post_id FROM ' . $this->db->prefix('newbb_posts') . ' WHERE topic_id = ' . $topic_id . ' AND post_id > ' . $lastreadpost_id . ' ORDER BY post_id LIMIT 1';
249
+ $result = $this->db->query($sql);
250
+ if (!$result) {
251
+ //xoops_error($this->db->error());
252
+ return false;
253
+ }
254
+ [$post_id] = $this->db->fetchRow($result);
255
+
256
+ return $post_id;
257
258
259
260
261
/**
262
* @param $topic
263
* @param string $order
0 commit comments