[UseBB-Checkins] UseBB/sources post_reply.php,1.4,1.5 post_topic.php,1.5,1.6
Light and Free PHP Forum Software
Brought to you by:
pc_freak
From: PC_Freak <pc_...@us...> - 2004-07-14 12:38:52
|
Update of /cvsroot/usebb/UseBB/sources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20925/sources Modified Files: post_reply.php post_topic.php Log Message: Added feature that saves the guest's username in the session. Index: post_topic.php =================================================================== RCS file: /cvsroot/usebb/UseBB/sources/post_topic.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** post_topic.php 13 Jul 2004 22:17:11 -0000 1.5 --- post_topic.php 14 Jul 2004 12:38:41 -0000 1.6 *************** *** 73,76 **** --- 73,82 ---- if ( ( $session->sess_info['user_id'] || ( !empty($_POST['user']) && preg_match(USER_PREG, $_POST['user']) && strlen($_POST['user']) <= $functions->get_config('username_max_length') ) ) && !empty($_POST['subject']) && !empty($_POST['content']) ) { + // + // Save the guest's username in the session + // + if ( !$session->sess_info['user_id'] ) + $_SESSION['user'] = $_POST['user']; + $poster_id = ( $session->sess_info['user_id'] ) ? $session->sess_info['user_id'] : 0; $poster_guest = ( !$session->sess_info['user_id'] ) ? $_POST['user'] : ''; *************** *** 130,133 **** --- 136,144 ---- if ( empty($_POST['submitted']) ) { + // + // Get session saved guest's username if there is one + // + $_POST['user'] = ( !$session->sess_info['user_id'] && !empty($_SESSION['user']) ) ? $_SESSION['user'] : ''; + $enable_bbcode_checked = ' checked="checked"'; $enable_smilies_checked = ' checked="checked"'; Index: post_reply.php =================================================================== RCS file: /cvsroot/usebb/UseBB/sources/post_reply.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** post_reply.php 13 Jul 2004 22:17:11 -0000 1.4 --- post_reply.php 14 Jul 2004 12:38:41 -0000 1.5 *************** *** 81,84 **** --- 81,90 ---- if ( ( $session->sess_info['user_id'] || ( !empty($_POST['user']) && preg_match(USER_PREG, $_POST['user']) && strlen($_POST['user']) <= $functions->get_config('username_max_length') ) ) && !empty($_POST['content']) ) { + // + // Save the guest's username in the session + // + if ( !$session->sess_info['user_id'] ) + $_SESSION['user'] = $_POST['user']; + $poster_id = ( $session->sess_info['user_id'] ) ? $session->sess_info['user_id'] : 0; $poster_guest = ( !$session->sess_info['user_id'] ) ? $_POST['user'] : ''; *************** *** 128,131 **** --- 134,142 ---- if ( empty($_POST['submitted']) ) { + // + // Get session saved guest's username if there is one + // + $_POST['user'] = ( !$session->sess_info['user_id'] && !empty($_SESSION['user']) ) ? $_SESSION['user'] : ''; + if ( !empty($_GET['quotepost']) && is_numeric($_GET['quotepost']) ) { |