wwwroot . "pg/discussions"; $err = false; if ( $obj = get_entity($guid) ) { if ( $obj->getSubType() == 'disctopic' ) { $author = ""; $email = ""; $comment = get_input('generic_comment'); if ( !isLoggedIn() ) { $author = get_input('discauthor'); if ( strstr($author, ';') ) { $author = str_replace(';', ' ', $author); } else if ( empty($author) ) { /*translation:Name can not be empty!*/ register_error(elgg_echo("koolielu:error_name_empty")); $err = true; } else if ( empty($comment) ) { /*translation:Comment can not be empty!*/ register_error(elgg_echo("koolielu:error_comment_empty")); $err = true; } // Captcha $captcha_token = get_input('captcha_token'); $captcha_input = get_input('captcha_input'); if (!(($captcha_token) && (captcha_verify_captcha($captcha_input, $captcha_token)))) { register_error(elgg_echo("captcha:captchafail")); $err = true; } if ( !$err ) { $cpt = $author.";".$email.";".$comment; unset($_SESSION['commauthor']); unset($_SESSION['commcomm']); $obj->annotate('generic_comment', $cpt, $obj->access_id, 0); } else { $_SESSION['commauthor'] = $author; $_SESSION['commcomm'] = $comment; } } else { $obj->annotate('generic_comment', $comment, $obj->access_id, $_SESSION['guid']); } $furl = $obj->getURL(); } } forward($furl); ?>