diff options
author | the_systech <the_systech@users.sourceforge.net> | 2002-03-01 17:42:51 +0000 |
---|---|---|
committer | the_systech <the_systech@users.sourceforge.net> | 2002-03-01 17:42:51 +0000 |
commit | ebef1197964061ae2f2eb17dce2061fad1df6a35 (patch) | |
tree | 18023b9b21a3f702a5c12468a3771ab28aa76bb0 | |
parent | ab516ec67d160c992f9c3a6a6a9f804cc93c99cb (diff) | |
download | forums-ebef1197964061ae2f2eb17dce2061fad1df6a35.tar forums-ebef1197964061ae2f2eb17dce2061fad1df6a35.tar.gz forums-ebef1197964061ae2f2eb17dce2061fad1df6a35.tar.bz2 forums-ebef1197964061ae2f2eb17dce2061fad1df6a35.tar.xz forums-ebef1197964061ae2f2eb17dce2061fad1df6a35.zip |
Ok it's official, I'm an idiot... Doesn't do much good to commit the updates to the profile template without the update to profile :(
git-svn-id: file:///svn/phpbb/trunk@2242 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/profile.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/phpBB/profile.php b/phpBB/profile.php index 8c87b62db6..b8e64e042e 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -1503,6 +1503,19 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $template->assign_block_vars("edit_profile", array()); } + // + // Let's do an overall check for settings/versions which would prevent + // us from doing file uploads.... + // + if( (get_cfg_var('file_uploads') == 0) || (strtolower(get_cfg_var('file_uploads')) == 'off')|| (phpversion() == '4.0.4pl1') || (!$board_config['allow_avatar_upload']) ) + { + $form_enctype = ''; + } + else + { + $form_enctype = 'enctype="multipart/form-data"'; + } + $template->assign_vars(array( "USERNAME" => $username, "EMAIL" => $email, @@ -1604,6 +1617,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) "S_ALLOW_AVATAR_LOCAL" => $board_config['allow_avatar_local'], "S_ALLOW_AVATAR_REMOTE" => $board_config['allow_avatar_remote'], "S_HIDDEN_FIELDS" => $s_hidden_fields, + "S_FORM_ENCTYPE" => $form_enctype, "S_PROFILE_ACTION" => append_sid("profile.$phpEx")) ); @@ -1612,11 +1626,11 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) // 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( $userdata['user_allowavatar'] && ( ($board_config['allow_avatar_upload'] && $form_enctype != '') || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) ) { $template->assign_block_vars("avatarblock", array() ); - if($board_config['allow_avatar_upload'] && file_exists("./" . $board_config['avatar_path']) ) + if($board_config['allow_avatar_upload'] && file_exists("./" . $board_config['avatar_path']) && $form_enctype != '') { $template->assign_block_vars("avatarblock.avatarupload", array() ); } @@ -1997,4 +2011,4 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) } } -?>
\ No newline at end of file +?> |