diff options
author | James Atkinson <thefinn@users.sourceforge.net> | 2001-03-07 06:53:39 +0000 |
---|---|---|
committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-03-07 06:53:39 +0000 |
commit | 9ef35696d2d221a1ab58886f5db94e4988833b0b (patch) | |
tree | 6f650e1fb45438aff12cb24078683e5d7e8551b4 /phpBB/posting.php | |
parent | 231c945e35ea8550bf2e1acbe79e125b9e69db61 (diff) | |
download | forums-9ef35696d2d221a1ab58886f5db94e4988833b0b.tar forums-9ef35696d2d221a1ab58886f5db94e4988833b0b.tar.gz forums-9ef35696d2d221a1ab58886f5db94e4988833b0b.tar.bz2 forums-9ef35696d2d221a1ab58886f5db94e4988833b0b.tar.xz forums-9ef35696d2d221a1ab58886f5db94e4988833b0b.zip |
Started on posting.php, got the logic done for displaying the new topic form
git-svn-id: file:///svn/phpbb/trunk@83 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 153 |
1 files changed, 152 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index b4278d1182..485b08e0d0 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1,6 +1,6 @@ <?php /*************************************************************************** - * + * posting.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group @@ -21,7 +21,158 @@ * * ***************************************************************************/ +include('extension.inc'); +include('common.'.$phpEx); + +if($submit && !$preview) +{ + switch($mode) + { + case 'newtopic': + echo "Dave likes to submit<br>"; + + break; + case 'reply': + + break; + case 'editpost': + + break; + } +} +else +{ + + switch($mode) + { + case 'newtopic': + if(!isset($forum_id)) + { + error_die($db, GENERAL_ERROR, "Sorry, no there is no such forum"); + } + + $pagetype = "newtopic"; + $page_title = " $l_postnew"; + $sql = "SELECT forum_name, forum_access FROM forums WHERE forum_id = '$forum_id'"; + if(!$result = $db->sql_query($sql)) + { + error_die($db, QUERY_ERROR); + } + $forum_info = $db->sql_fetchrowset($result); + $forum_name = stripslashes($forum_info[0]["forum_name"]); + $forum_access = $forum_info[0]["forum_access"]; + + if($forum_access == ANONALLOWED) + { + $about_posting = "$l_anonusers $l_inthisforum $l_anonhint"; + } + if($forum_access == REGONLY) + { + $about_posting = "$l_regusers $l_inthisforum"; + } + if($forum_access == MODONLY) + { + $about_posting = "$l_modusers $l_inthisforum"; + } + + include('page_header.'.$phpEx); + if($user_logged_in) + { + $username_input = $userdata["username"]; + $password_input = ""; + } + else + { + if(!isset($username)) + { + $username = $userdata["username"]; + } + $username_input = '<input type="text" name="username" value="'.$username.'" size="25" maxlength="50">'; + $password_input = '<input type="password" name="password" size="25" maxlenght="40">'; + $subject_input = '<input type="text" name="subject" value="'.$subject.'" size="50" maxlenght="255">'; + $message_input = '<textarea name="message" rows="10" cols="35" wrap="virtual">'.$message.'</textarea>'; + if($allow_html) + { + $html_status = $l_htmlis . " " . $l_on; + $html_toggle = '<input type="checkbox" name="disable_html" '; + if($disable_html) + { + $html_toggle .= 'checked'; + } + $html_toggle .= "> $l_disable $l_html $l_onthispost"; + } + else + { + $html_status = $l_htmlis . " " . $l_off; + } + if($allow_bbcode) + { + $bbcode_status = $l_bbcodeis . " " . $l_on; + $bbcode_toggle = '<input type="checkbox" name="disable_bbcode" '; + if($disable_bbcode) + { + $bbcode_toggle .= "checked"; + } + $bbcode_toggle .= "> $l_disable $l_bbcode $l_onthispost"; + } + else + { + $bbcode_status = $l_bbcodeis . " " . $l_off; + } + $smile_toggle = '<input type="checkbox" name="disable_smile" '; + if($disable_smile) + { + $smile_toggle .= "checked"; + } + $smile_toggle .= "> $l_disable $l_smilies $l_onthispost"; + + $sig_toggle = '<input type="checkbox" name="attach_sig" '; + if($attach_sig || $userdata["attach_sig"] == 1) + { + $sig_toggle .= "checked"; + } + $sig_toggle .= "> $l_attachsig"; + + $notify_toggle = '<input type="checkbox" name="notify" '; + if($notify || $userdata["always_notify"] == 1) + { + $notify_toggle .= "checked"; + } + $notify_toggle .= "> $l_notify"; + } + + $template->set_var(array("L_ABOUTPOST" => $l_aboutpost, + "L_SUBJECT" => $l_subject, + "L_MESSAGEBODY" => $l_body, + "L_OPTIONS" => $l_options, + "L_PREVIEW" => $l_preview, + "L_SUBMIT" => $l_submit, + "L_CANCEL" => $l_cancelpost, + "MODE" => $mode, + "ABOUT_POSTING" => $about_posting, + "USERNAME_INPUT" => $username_input, + "PASSWORD_INPUT" => $password_input, + "SUBJECT_INPUT" => $subject_input, + "MESSAGE_INPUT" => $message_input, + "HTML_STATUS" => $html_status, + "HTML_TOGGLE" => $html_toggle, + "SMILE_TOGGLE" => $smile_toggle, + "SIG_TOGGLE" => $sig_toggle, + "NOTIFY_TOGGLE" => $notify_toggle, + "BBCODE_TOGGLE" => $bbcode_toggle, + "BBCODE_STATUS" => $bbcode_status)); + $template->pparse("output", "body"); + include('page_tail.'.$phpEx); + break; + case 'reply': + + break; + case 'editpost': + + break; + } +} ?> |