Commenting support is provided through the BitOwl_Comments class. The use of a captcha is determined by the functions provided in captcha.php. Comments are implemented through a threaded model.
BitOwl_Comments::__construct($thread, $countOnly[, $replySubject[, $handlePost]])
Prepares a comment thread for display. $countOnly is used to retrieve only the number of comments in the thread instead of the entire data set.
$replySubject is used to provide a default reply subject. $handlePost can disable the behavior of handling the post data by itself (can be useful if you want to have multiple comment forms on a single page.
Note: If you let the constructor handle comment posting you
must check getThreadId()
for a change in the thread number.
void BitOwl_Comments::display($template)
Displays the comment thread using the template provided.
int BitOwl_Comments::getCount()
Returns the number of comments in the thread.
int BitOwl_Comments::getThreadId()
Returns the current thread id which may be different than what was provided for the constructor.
int BitOwl_Comments::postComment($parent, $name, $email, $subject, $comment, &$error)
Posts the comment to the thread. $parent is the id of the post in which to reply to or 0 if it is supposed to be replying to the root. $name, $email, $subject, and $comment are the user's input.
$error will be populated with any error message that may occur while posting a comment.
The captcha module provides two functions which display and check the answer of the captcha respectively.
str captcha_get_html()
bool captcha_check_answer()