2003-07-18 21:38:51 +00:00
< ? php
2003-08-13 22:08:12 +00:00
2003-07-18 21:38:51 +00:00
require_once ( 'forum.inc' );
require_once ( '../util.inc' );
2003-08-13 22:08:12 +00:00
2003-07-25 20:27:34 +00:00
require_once ( 'subscribe.inc' );
2003-07-18 21:38:51 +00:00
if ( ! empty ( $_GET [ 'id' ]) && ! empty ( $_POST [ 'title' ]) && ! empty ( $_POST [ 'content' ])) {
$_GET [ 'id' ] = stripslashes ( strip_tags ( $_GET [ 'id' ]));
2003-08-15 00:58:48 +00:00
$user = get_logged_in_user ( true , '../' );
2003-07-18 21:38:51 +00:00
2003-11-28 22:35:01 +00:00
if ( $_POST [ 'add_signature' ] == " add_it " ){
$forum_signature = " \n " . $user -> signature ;
}
$threadID = createThread ( $_GET [ 'id' ], $user -> id , $_POST [ 'title' ], $_POST [ 'content' ] . $forum_signature );
2003-08-22 19:09:32 +00:00
2003-08-14 00:56:20 +00:00
header ( 'Location: thread.php?id=' . $threadID );
2003-07-18 21:38:51 +00:00
}
2003-08-13 22:08:12 +00:00
if ( ! empty ( $_GET [ 'id' ])) {
$forum = getForum ( $_GET [ 'id' ]);
$category = getCategory ( $forum -> category );
} else {
// TODO: Standard error page
2003-08-15 00:58:48 +00:00
echo " No forum ID was provided.<br> " ;
2003-08-13 22:08:12 +00:00
exit ();
2003-07-24 22:57:41 +00:00
}
2003-08-01 20:30:25 +00:00
2003-08-15 00:58:48 +00:00
$logged_in_user = get_logged_in_user ( true , '../' );
// TODO: Write a function to do this.
2003-08-13 22:08:12 +00:00
if ( $category -> is_helpdesk ) {
2003-08-22 19:09:32 +00:00
page_head ( 'Help Desk' , $logged_in_user );
2003-08-01 20:30:25 +00:00
} else {
2003-08-22 19:09:32 +00:00
page_head ( 'Forum' , $logged_in_user );
2003-08-01 20:30:25 +00:00
}
2003-08-13 22:08:12 +00:00
show_forum_title ( $forum , NULL , $category -> is_helpdesk );
2003-08-01 20:30:25 +00:00
2003-08-13 22:08:12 +00:00
if ( $category -> is_helpdesk ) {
2003-11-28 22:35:01 +00:00
echo " <p>The " , PROJECT , " Help Desk is designed to help users
find answers to questions they might have about our project ,
software , science , etc .< p > To ensure that this is effectively
achieved , please make sure to skim the questions that
have already been posted before posting your own .
If your question has already been asked by another user ,
clicking on the \ " I also have this problem \" button
in their post will be more effective than re - posting the question .
< p > If you ' ve been unable to find your question already posted ,
please fill in the fields below to add it to the Help Desk .</ p >
" ;
2003-08-13 22:08:12 +00:00
}
echo " <form action= \" post.php?id= " , $_GET [ 'id' ], " \" method= \" POST \" > " ;
if ( $category -> is_helpdesk ) {
2003-08-22 19:09:32 +00:00
$cell = " Post a New Question " ;
2003-08-13 22:08:12 +00:00
} else {
$cell = " Post a New Thread / Question " ;
}
2003-11-30 21:05:57 +00:00
start_forum_table ( array ( $cell ), 2 );
2003-08-13 22:08:12 +00:00
2003-08-22 19:09:32 +00:00
echo " <tr><td class=fieldname><b>Title</b> " ;
2003-08-13 22:08:12 +00:00
if ( $category -> is_helpdesk ) {
echo " <p>Try to describe your question as completely (and concisely) as you can in the space provided.</p>A brief, clear summary will help others with the same question (or an answer to your question) find your post.<p></p> " ;
}
echo "
2003-11-28 22:35:01 +00:00
</ td >
< td >< input type = \ " text \" name= \" title \" size=62></td>
</ tr >
< tr >
2003-11-30 21:05:57 +00:00
< td class = fieldname style = \ " vertical-align:top \" ><b>Message</b>
2003-08-13 22:08:12 +00:00
" ;
if ( $category -> is_helpdesk ) {
2003-11-28 22:35:01 +00:00
echo " <p>Please be as specific as possible:
if you are having software problems for example ,
be sure to mention the version of the software you are running ,
your computer type , operating system , etc .
< p > The more detailed your description ,
the more likely someone will be able to post an answer
that solves your problem .</ td >
" ;
2003-08-13 22:08:12 +00:00
}
echo "
2003-11-28 22:35:01 +00:00
< td >< textarea name = \ " content \" rows= \" 12 \" cols= \" 54 \" ></textarea></td>
</ tr >
2003-08-13 22:08:12 +00:00
" ;
2003-11-30 21:05:57 +00:00
row2 ( " " , " <input name=add_signature value=add_it checked=true type=checkbox>Add my signature to this post " );
row2 ( " " , " <input type=submit value= \" Post message \" > " );
2003-08-13 22:08:12 +00:00
end_forum_table ();
echo " </form> \n " ;
2003-07-18 21:38:51 +00:00
2003-08-15 00:58:48 +00:00
page_tail ();
2003-11-28 22:35:01 +00:00
?>