$posts[$p->parent]->children[$pid] =& $posts[$pid];
}
+ // Start with the last child of the first post.
+ $post = &$posts[reset($posts)->id];
+
+ $lastpost = false;
+ while (!$lastpost) {
+ if (!isset($post->children)) {
+ $post->lastpost = true;
+ $lastpost = true;
+ } else {
+ // Go to the last child of this post.
+ $post = &$posts[end($post->children)->id];
+ }
+ }
+
return $posts;
}
$topicclass = ' firstpost starter';
}
+ if (!empty($post->lastpost)) {
+ $forumpostclass = ' lastpost';
+ }
+
$postbyuser = new stdClass;
$postbyuser->post = $post->subject;
$postbyuser->user = $postuser->fullname;