Example #1
0
function topicExists($title)
{
    $topic = topicGetByTitle($title);
    if (is_array($topic) && isset($topic["id"])) {
        return true;
    } else {
        return false;
    }
}
Example #2
0
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">
		@import "stylesheet.css";
	</style>