--- psunami.cgi.old	Wed Oct 11 10:56:11 2000
+++ psunami.cgi	Wed Oct 11 10:58:14 2000
@@ -42,8 +42,8 @@
 ################ MAIN #################
 
 # what should we do?
-if(param('action') eq 'board') {&show_board;}  # show a virtual board
-elsif(param('action') eq 'topic') {&show_thread;}# show a thread on a board
+if(param('action') eq 'board') {show_board(param('board'));}  # show a virtual board
+elsif(param('action') eq 'topic') {show_thread(param('board'),param('topic'));}# show a thread on a board
 elsif(param('action') eq 'post') {&post_thread;} # post a message
 elsif(param('action') eq 'reply') {&post_reply;}# reply to a message
 #elsif(param('action') eq 'changepwd' and $use_login_system eq 'yes') {&change_password;} # change password
@@ -261,9 +261,11 @@
 ##################### END SHOW_BOARD_LIST ######################
 
 ################## SHOW_BOARD ###################
-sub show_board
+sub show_board()
 {
-	$boardnum = param('board');
+	
+#	$boardnum = param('board');
+	$boardnum = $_[0];
 	
 	#if($use_login_system eq 'yes')
 	#{
@@ -434,8 +436,10 @@
 ################ SHOW_THREAD ###################
 sub show_thread
 {
-	my $thread = param('topic');
-	my $boardnum = param('board');
+	#my $thread = param('topic');
+	#my $boardnum = param('board');
+	$boardnum = $_[0];
+	$thread = $_[1];
 
 	#if($use_login_system eq 'yes')
 	#{
@@ -870,8 +874,8 @@
 				&set_thread_notify($boardnum, $date, @notify);
 			}
 		}
-		
-		&redirect_form("Message successfully posted!", "$script_name?action=board&board=$boardnum&session=$session", "Return to $board_name");
+		#&redirect_form("This message successfully posted!", "$script_name?action=board&board=$boardnum&session=$session", "Return to $board_name");
+		&show_board($boardnum);
 	}
 	else
 	{
@@ -952,6 +956,9 @@
 ################## POST_REPLY ######################
 sub post_reply
 {
+
+	warn "** post_reply **";
+
 	$boardnum = param('board');
 	$thread = param('thread');
 	$post = param('post'); # do we show the form, or actually post the thread?
@@ -1120,15 +1127,20 @@
 		
 		# shouldn't have to do this, but it makes it work...
 		# update: this should be fixed now, but I'll leave it in until use strict compliance
-		%prefs = &sec_get_user_prefs($uid);
+		if($uid > 0)
+		{
+			%prefs = &sec_get_user_prefs($uid);
+		}
 
 		if(exists($prefs{reply_redirect}) and $prefs{reply_redirect} eq 'thread')
 		{
-			&redirect_form("Reply successfully posted!", "$script_name?action=topic&board=$boardnum&topic=$thread&session=$session", "Return to thread");
+			#&redirect_form("Reply successfully posted!", "$script_name?action=topic&board=$boardnum&topic=$thread&session=$session", "Return to thread");
+			&show_thread($boardnum,$thread);
 		}
 		else
 		{
-			&redirect_form("Reply successfully posted!", "$script_name?action=board&board=$boardnum&session=$session", "Return to $board_name");
+			#&redirect_form("Reply successfully posted!", "$script_name?action=board&board=$boardnum&session=$session", "Return to $board_name");
+			&show_board($boardnum);
 		}
 	}
 	else

