function topicCreateDiscussion($title, $author_id, $readers = array()) { $flags = array("private"); $readers[] = $author_id; foreach ($readers as $i) { if (userExistsById($i)) { $flags[] = "[" . $i . "]"; } } topicCreate($title, $author_id, -1, $flags); }
function topicCreateDiscussion($title, $author_id, $readers) { $flags = array("private"); foreach ($readers as $i) { if (is_numeric($i) && userExistsById($i)) { $flags[] = $i; } } topicCreate($title, $author_id, -1, $flags); }
handleErrors($res); } if (isset($_GET["reply"])) { $user = userGetLoggedIn(); $res = postCreate($_POST["topic"], $user["id"], $_POST["message"]); handleErrors($res); header("location: index.php?topic_id=" . $_POST["topic"]); } if (isset($_GET["newtopic"])) { $user = userGetLoggedIn(); if (isset($_POST["parent"])) { $parent = $_POST["parent"]; } else { $parent = -1; } $res = topicCreate($_POST["title"], $user["id"], $parent); handleErrors($res); $topic = topicGetByTitle($_POST["title"]); $res = postCreate($topic["id"], $user["id"], $_POST["message"]); handleErrors($res); header("location: index.php?topic_id=" . $topic["id"]); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1251" /> <style type="text/css">