";
- echo "
$year_posted/$month_posted/$day_posted/$title
";
- if (!$this->comments_enabled) {
- $this->display_comment_link();
- }
- echo $entry['text'];
+ echo "
$this->year_posted/$this->month_posted/$this->day_posted/$this->title
";
+ echo $this->text;
}
private function write_navigation() {
@@ -376,21 +403,39 @@ class note extends cms {
- notes/
+END_OF_NAVIGATION;
+ if ($this->failed_captcha) {
+ echo "sorry, reCAPTCHA said you're not human.
";
+ }
+ if (!$this->comments_enabled) {
+ $this->display_comment_link();
+ }
+ echo <<notes/
END_OF_NAVIGATION;
}
private function display_comment_link() {
- $url = $this->url . 'comments/';
- echo "";
+ if ($this->number_of_comments > 0) {
+ $anchor_text = "comments ($this->number_of_comments)";
+ } else {
+ $anchor_text = "comment?";
+ }
+ if (substr($this->url, (strlen($this->url)-1), strlen($this->url)) == '/') {
+ $url = $this->url . 'comments/';
+ } else {
+ $url = $this->url . '/comments/';
+ }
+ echo "";
}
private function display_comments() {
echo "";
}
private function display_comment_form() {
+ $publickey = $this->recaptcha_publickey;
echo <<
-var RecaptchaOptions = {
- theme : 'custom',
- custom_theme_widget: 'recaptcha_widget'
- };
+function showRecaptcha() {
+Recaptcha.create("$publickey",
+ "recaptcha_div",
+ {
+ theme : 'custom',
+ custom_theme_widget: 'recaptcha_widget',
+ callback: Recaptcha.focus_response_field
+ });
+}
END_CAPTCHA_STYLE;
require_once('includes/recaptchalib.php');
// Trailing slash is necessary for reloads to work
- $url = $this->url . "verify/";
- echo "
-FORM;
- echo recaptcha_get_html($this->recaptcha_publickey);
- echo <<