1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Yep, more updates and fixes

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@2570 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2002-05-12 15:57:47 +00:00
parent a37f7ae66d
commit 801891caea
19 changed files with 229 additions and 313 deletions

View File

@@ -198,14 +198,14 @@ function add_search_words($post_id, $post_text, $post_title = '')
{
case 'mysql':
case 'mysql4':
$value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\')';
$value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\', 0)';
break;
case 'mssql':
$value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "'";
$value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "', 0";
break;
default:
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
VALUES ('" . $word[$i] . "')";
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common)
VALUES ('" . $word[$i] . "', 0)";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql);
@@ -221,11 +221,11 @@ function add_search_words($post_id, $post_text, $post_title = '')
{
case 'mysql':
case 'mysql4':
$sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text)
$sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text, word_common)
VALUES $value_sql";
break;
case 'mssql':
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common)
$value_sql";
break;
}

View File

@@ -162,7 +162,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
{
if ( $avatar_filesize <= $board_config['avatar_filesize'] && $avatar_filesize > 0 )
{
preg_match("'image\/[x\-]*([a-z]+)'", $avatar_filetype, $avatar_filetype);
preg_match('#image\/[x\-]*([a-z]+)#', $avatar_filetype, $avatar_filetype);
$avatar_filetype = $avatar_filetype[1];
}
else
@@ -184,7 +184,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
if ( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
{
$new_filename = ( ( $current_avatar != '' && $current_type == USER_AVATAR_UPLOAD ) && $mode != 'register' ) ? $current_avatar : uniqid($user_ip) . $imgtype;
$new_filename = uniqid($user_ip) . $imgtype;
if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' )
{

View File

@@ -899,27 +899,30 @@ else
// of the templates to 'fake' an IF...ELSE...ENDIF solution
// it works well :)
//
if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
if ( $mode != 'register' )
{
$template->assign_block_vars('switch_avatar_block', array() );
if ( $board_config['allow_avatar_upload'] && file_exists('./' . $board_config['avatar_path']) )
if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
{
if ( $form_enctype != '' )
$template->assign_block_vars('switch_avatar_block', array() );
if ( $board_config['allow_avatar_upload'] && file_exists('./' . $board_config['avatar_path']) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
if ( $form_enctype != '' )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
}
$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
}
$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
}
if ( $board_config['allow_avatar_remote'] )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
}
if ( $board_config['allow_avatar_remote'] )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
}
if ( $board_config['allow_avatar_local'] && file_exists('./' . $board_config['avatar_gallery_path']) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
if ( $board_config['allow_avatar_local'] && file_exists('./' . $board_config['avatar_gallery_path']) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
}
}
}
}