summaryrefslogtreecommitdiff
path: root/modules/profile.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-06-03 18:04:47 +0000
committerDries Buytaert <dries@buytaert.net>2003-06-03 18:04:47 +0000
commit05288ac48a304385d9024f607fca92ee0301da30 (patch)
tree90d7c34ad935aba69fe361e3f81755e406080eb5 /modules/profile.module
parent68ca58e922395b2379b00a870ec77965c00e971a (diff)
downloadbrdo-05288ac48a304385d9024f607fca92ee0301da30.tar.gz
brdo-05288ac48a304385d9024f607fca92ee0301da30.tar.bz2
- Bugfix: made request_uri() rewrite ( and ) with their entity equivalents
to avoid XSS attacks! Patch by Al, Moshe, Marco, Kjartan and me. - Bugfix: the admin module does now import drupal.css prior to admin.css. Patch by me. - Bugfix: the admin module was still emitting a <base href=""> tag. I removed this as it is been taken care of by theme_head(); Patch by me. - Bugfix: made the tracker module's pager only consider published pages. Patch by Moshe. - Bugfix: cured some typos in the comment module's help function. Patch by Marco. - Bugfix: fixed a typo in the pager_display() that caused optional attributes to be discarded. - Bugfix: made the Xtemplate emit empty boxes like any other theme does. Patch by Al. - Bugfix: fixed broken link on the statistics module's log page. Reported by Kjartan. - CSS improvements: made the HTML output emitted by the tracker module look nicer. Patch by Moshe and Al. - CSS improvements: added CSS classes for form elements. Patch by Al. - CSS improvements: added a vertical gap between the last form item and the submit button. Patch by Al. Note that Opera 6 is not picking up this CSS but apparently others browsers such as Konqueror do. - Xtemplate improvements: changed the color of the selected day in the archive module's calendar. Patch by Al. - Usability improvements: made the "birthday" field of the profile module look nicer. Patch by Al. ------ - TODO: it might be a good idea to emit the following meta tag in the theme_head() function: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Currently, some themes (and modules!) emit this while others don't. This would also make it possible to change the charset site-wide. - TODO: now we added support for td.dark and td.light to drupal.css, maybe it can be removed from admin.css as well as xtemplate.css?
Diffstat (limited to 'modules/profile.module')
-rw-r--r--modules/profile.module13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/profile.module b/modules/profile.module
index 71e7f7653..d9ef80489 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -11,8 +11,9 @@ function _profile_init() {
$GLOBALS["profile_fields"] = array(
"address" => array("textfield", t("Address"), "", 64, 64, t("Your address: street and number.")),
"city" => array("textfield", t("City"), "", 64, 64, t("Your city.")),
- "state" => array("textfield", t("State"), "", 4, 2, t("Your state as a two letter code.")),
- "zip" => array("textfield", t("Zip"), "", 7, 5, t("Your ZIP code.")),
+ "state" => array("textfield", t("State / Province / Region"), "", 64, 64, ""),
+ "zip" => array("textfield", t("Zip / Postal Code"), "", 7, 10, ""),
+ "country" => array("textfield", t("Country"), "", 64, 64, t("Your country.")),
"birthday" => array("", t("Birthday"), ""),
"gender" => array("select", t("Gender"), "", array(0 => "-", "m" => t("male"), "f" => t("female")), "", 0, 0),
"job" => array("textfield", t("Job title"), "", 64, 64, t("Your job title or position.")),
@@ -24,7 +25,7 @@ function _profile_init() {
"biography" => array("textarea", t("Biography"), "", 64, 4, ""),
"interests" => array("textarea", t("Interests"), "", 64, 4, t("What you like.")),
"publickey" => array("textarea", t("Public key"), "", 64, 4, ""),
- "avatar" => array("", t("Avatar or picture"), t("Your virtual face or picture."))
+ "avatar" => array("", t("Avatar or picture"), t(t("Your virtual face or picture. Maximum dimensions are ".variable_get("profile_avatar_dimensions", "85x85")." and max size is ".variable_get("profile_avatar_file_size", "30")."kb.")))
);
$GLOBALS["profile_days"][0] = t("day");
@@ -174,12 +175,14 @@ function _profile_user_view(&$user, $mode) {
foreach (_profile_active_fields($mode) as $name) {
$field = $profile_fields[$name];
$t = "profile_".$name;
+
if (!empty($user->$t)) {
switch ($field[0]) {
case "textfield":
case "textarea":
case "checkbox":
- $output .= form_item($field[1], check_output($user->$t));
+ $value = ($t == "profile_homepage") ? "<a href=\"".check_output($user->$t)."\">".check_output($user->$t)."</a>" : check_output($user->$t);
+ $output .= form_item($field[1], $value);
break;
case "select":
$output .= form_item($field[1], check_output($profile_fields[$name][3][$user->$t]));
@@ -197,7 +200,7 @@ function _profile_user_view(&$user, $mode) {
if (isset($user->profile_birthday) && isset($user->profile_birthmonth) && isset($user->profile_birthyear)) {
// this is very european-centric, can we use format_date?
$time = mktime(0, 0, 0, $user->profile_birthmonth, $user->profile_birthday, $user->profile_birthyear);
- $output .= form_item(t("Birthday"), format_date($time));
+ $output .= form_item(t("Birthday"), format_date($time, "custom", "F j, Y"));
}
}
}