From fea9ffeb59ff5780034928128c22e7f13f59ad81 Mon Sep 17 00:00:00 2001 From: uid42062 Date: Wed, 4 Jul 2001 23:26:19 +0000 Subject: Fixes and updates git-svn-id: file:///svn/phpbb/trunk@558 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/lang_english.php | 4 +++ phpBB/profile.php | 76 ++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 17a1ca9f6e..1ada24f22b 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -149,6 +149,7 @@ $lang['Forum_Index'] = "Forum Index"; // // Viewforum // +$lang['Display_topics'] = "Display Topics from previous"; $lang['Annoucement'] = "Annoucement:"; $lang['Sticky'] = "Sticky:"; @@ -253,6 +254,9 @@ $lang['Wrong_Profile'] = "You cannot modify a profile that is not your own."; $lang['Bad_username'] = "The username you choose has been taken or is disallowed by the administrator."; $lang['Sorry_banned_email'] = "Sorry but the email address you gave has been banned from registering on this system."; $lang['Only_one_avatar'] = "Only one type of avatar can be specified"; +$lang['File_no_data'] = "The file at the URL you gave contains no data"; +$lang['No_connection_URL'] = "A connection could not be made to the URL you gave"; +$lang['Incomplete_URL'] = "The URL you entered is incomplete"; $lang['Always_smile'] = "Always enable Smilies"; $lang['Always_html'] = "Always allow HTML"; diff --git a/phpBB/profile.php b/phpBB/profile.php index d11f447838..3f41d266c3 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -41,7 +41,9 @@ init_userprefs($userdata); function language_select($default, $dirname="language/") { global $phpEx; + $dir = opendir($dirname); + $lang_select = "\n"; + closedir($dir); + return $lang_select; } // NOTE: This function should check is_dir($file), however the is_dir function seems to be buggy on my @@ -80,39 +84,48 @@ function template_select($default) } } $template_select .= ""; + closedir($dir); + return($template_select); } function theme_select($default) { - global $db; + global $db, $lang; $sql = "SELECT themes_id, themes_name - FROM ".THEMES_TABLE." + FROM " . THEMES_TABLE . " ORDER BY themes_name"; if($result = $db->sql_query($sql)) { $num = $db->sql_numrows($result); $rowset = $db->sql_fetchrowset($result); - $theme_select = "\n"; + for($i = 0; $i < $num; $i++) { - $selected = " selected"; - } - else - { - $selected = ""; + if(stripslashes($rowset[$i]['themes_name']) == $default || $rowset[$i]['themes_id'] == $default) + { + $selected = " selected"; + } + else + { + $selected = ""; + } + $theme_select .= "\t\n"; } - $theme_select .= "\t\n"; + $theme_select .= "\n"; + } + else + { + $theme_select = ""; } - $theme_select .= "\n"; } else { - $theme_select = ""; + message_die(GENERAL_ERROR, "Couldn't query themes table", "", __LINE__, __FILE__, $sql); } return($theme_select); } @@ -273,7 +286,6 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "L_LOCATION" => $l_from, "L_OCCUPATION" => $l_occupation, "L_INTERESTS" => $l_interests, - "L_AVATAR" => $lang['Avatar'], "U_SEARCH_USER" => append_sid("search.$phpEx?a=" . urlencode($profiledata['username']) . "&f=all&b=0&d=DESC&c=100&dosearch=1"), "U_USER_WEBSITE" => stripslashes($profiledata['user_website']), @@ -354,15 +366,14 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) $interests = (!empty($HTTP_POST_VARS['interests'])) ? trim($HTTP_POST_VARS['interests']) : ""; $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(str_replace("
", "\n", $HTTP_POST_VARS['signature'])) : ""; - $viewemail = (!empty($HTTP_POST_VARS['viewemail'])) ? $HTTP_POST_VARS['viewemail'] : 0; - $notifypm = (!empty($HTTP_POST_VARS['notifypm'])) ? $HTTP_POST_VARS['notifypm'] : 1; - $attachsig = (!empty($HTTP_POST_VARS['attachsig'])) ? $HTTP_POST_VARS['attachsig'] : 0; + $viewemail = (isset($HTTP_POST_VARS['viewemail'])) ? $HTTP_POST_VARS['viewemail'] : 0; + $allowviewonline = (isset($HTTP_POST_VARS['hideonline'])) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : 1 ) : 1; + $notifypm = (isset($HTTP_POST_VARS['notifypm'])) ? $HTTP_POST_VARS['notifypm'] : 1; + $attachsig = (isset($HTTP_POST_VARS['attachsig'])) ? $HTTP_POST_VARS['attachsig'] : 0; - $allowhtml = (!empty($HTTP_POST_VARS['allowhtml'])) ? $HTTP_POST_VARS['allowhtml'] : $board_config['allow_html']; - $allowbbcode = (!empty($HTTP_POST_VARS['allowbbcode'])) ? $HTTP_POST_VARS['allowbbcode'] : $board_config['allow_bbcode']; - $allowsmilies = (!empty($HTTP_POST_VARS['allowsmilies'])) ? $HTTP_POST_VARS['allowsmilies'] : $board_config['allow_smilies']; - - $allowviewonline = (!empty($HTTP_POST_VARS['allowviewonline'])) ? ( ($HTTP_POST_VARS['allowviewonline']) ? 0 : 1 ) : 1; + $allowhtml = (isset($HTTP_POST_VARS['allowhtml'])) ? $HTTP_POST_VARS['allowhtml'] : $board_config['allow_html']; + $allowbbcode = (isset($HTTP_POST_VARS['allowbbcode'])) ? $HTTP_POST_VARS['allowbbcode'] : $board_config['allow_bbcode']; + $allowsmilies = (isset($HTTP_POST_VARS['allowsmilies'])) ? $HTTP_POST_VARS['allowsmilies'] : $board_config['allow_smilies']; $user_theme = ($HTTP_POST_VARS['theme']) ? $HTTP_POST_VARS['theme'] : $board_config['default_theme']; $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $board_config['default_lang']; @@ -376,8 +387,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) $user_avatar_size = (!empty($HTTP_POST_FILES['avatar']['size'])) ? $HTTP_POST_FILES['avatar']['size'] : 0; $user_avatar_type = (!empty($HTTP_POST_FILES['avatar']['type'])) ? $HTTP_POST_FILES['avatar']['type'] : ""; $user_avatar = (empty($user_avatar_loc) && $mode == "editprofile") ? $userdata['user_avatar'] : ""; - } + if(isset($HTTP_POST_VARS['submit'])) { $error = FALSE; @@ -393,8 +404,6 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) } else if($mode == "register") { - $regdate = get_gmt_ts(); - $coppa = (!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa']) ? 0 : 1; if(empty($username) || empty($password) || empty($password_confirm) || empty($email)) @@ -683,8 +692,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) // Error writing file // @unlink($tmp_filename); - $error = true; - $error_msg = (!empty($error_msg)) ? $error_msg . "
Could not write the file to local storage, please contact the board administrator" : "Could not write the file to local storage, please contact the board administrator"; + message_die(GENERAL_ERROR, "Could not write avatar file to local storage. Please contact the board administrator with this message", "", __LINE__, __FILE__); } } } @@ -694,7 +702,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) // No data // $error = true; - $error_msg = (!empty($error_msg)) ? $error_msg . "
The file at that URL contains no data" : "The file at that URL contains no data"; + $error_msg = (!empty($error_msg)) ? $error_msg . "
" . $lang['File_no_data'] : $lang['File_no_data']; } } else @@ -703,13 +711,13 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) // No connection // $error = true; - $error_msg = (!empty($error_msg)) ? $error_msg . "
A connection could not be made to that URL" : "A connection could not be made to that URL"; + $error_msg = (!empty($error_msg)) ? $error_msg . "
" . $lang['No_connection_URL'] : $lang['No_connection_URL']; } } else { $error = true; - $error_msg = (!empty($error_msg)) ? $error_msg . "
The URL you entered is incomplete" : "The URL you entered is incomplete"; + $error_msg = (!empty($error_msg)) ? $error_msg . "
" . $lang['Incomplete_URL'] : $lang['Incomplete_URL']; } } // if ... allow_avatar_upload } @@ -734,6 +742,10 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) } else { + // + // Get current date + // + $regdate = get_gmt_ts(); if(SQL_LAYER != "mssql") { @@ -942,8 +954,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "L_AIM" => $l_aim, "L_LOCATION" => $l_from, "L_OCCUPATION" => $l_occupation, - "L_BOARD_LANGUAGE" => $l_boardlang, - "L_BOARD_THEME" => $l_boardtheme, + "L_BOARD_LANGUAGE" => $lang['Board_lang'], + "L_BOARD_THEME" => $lang['Board_theme'], "L_BOARD_TEMPLATE" => $l_boardtemplate, "L_TIMEZONE" => $l_timezone, "L_DATE_FORMAT" => $l_date_format, -- cgit v1.2.1