getGUID(); $author = $_SESSION['user']->name; $email = $_SESSION['user']->email; } $_SESSION['disctitle'] = $title; $_SESSION['discauthor'] = $author; $_SESSION['discemail'] = $email; $_SESSION['discbody'] = $body; $_SESSION['disctags'] = $tags; $_SESSION['discsection'] = $section; // Convert string of tags into preformed array $tagarray = string_to_tag_array($tags); // Captcha if (!isloggedin()) { $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")); forward("pg/discussions/new_topic"); } } if ( empty($title) || empty($author) || empty($body) || empty($section) || !array_key_exists($section, $sections)) { /*translation:Please fill all required fields.*/ register_error(elgg_echo("koolielu:error_blank")); forward("pg/discussions/new_topic"); } else { $dt = new ElggObject(); $dt->subtype = "disctopic"; $dt->owner_guid = $owner_guid; $dt->access_id = $access_id; $dt->title = $title; $dt->description = $body; $dt->save(); $dt->discauthor = $author; $dt->discemail = $email; $dt->tags = $tagarray; $dt->section = $section; unset($_SESSION['disctitle']); unset($_SESSION['discauthor']); unset($_SESSION['discemail']); unset($_SESSION['discbody']); unset($_SESSION['disctags']); unset($_SESSION['discsection']); /*translation:New discussion started...*/ system_message(elgg_echo("koolielu:message_new_discussion_started")); // River add_to_river('river/object/disctopic/create','create',$_SESSION['user']->guid,$dt->guid); forward("pg/discussions"); } ?>