summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.htaccess1
-rw-r--r--includes/common.inc34
-rw-r--r--includes/pager.inc2
-rw-r--r--misc/drupal.css9
-rw-r--r--modules/admin.module3
-rw-r--r--modules/book.module2
-rw-r--r--modules/book/book.module2
-rw-r--r--modules/comment.module12
-rw-r--r--modules/comment/comment.module12
-rw-r--r--modules/profile.module13
-rw-r--r--modules/profile/profile.module13
-rw-r--r--modules/statistics.module2
-rw-r--r--modules/statistics/statistics.module2
-rw-r--r--modules/tracker.module4
-rw-r--r--modules/tracker/tracker.module4
-rw-r--r--themes/xtemplate/xtemplate.css3
-rw-r--r--themes/xtemplate/xtemplate.theme14
17 files changed, 82 insertions, 50 deletions
diff --git a/.htaccess b/.htaccess
index 16f055558..82d34dea3 100644
--- a/.htaccess
+++ b/.htaccess
@@ -20,6 +20,7 @@ ErrorDocument 500 /error.php
# Overload PHP variables:
<IfModule mod_php4.c>
+ php_value register_globals 0
php_value track_vars 1
php_value short_open_tag 1
php_value magic_quotes_gpc 0
diff --git a/includes/common.inc b/includes/common.inc
index 0aa8b9001..532720898 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -104,11 +104,27 @@ function request_uri() {
*/
if (isset($_SERVER["REQUEST_URI"])) {
- return $_SERVER["REQUEST_URI"];
+ $uri = $_SERVER["REQUEST_URI"];
}
else {
- return $_SERVER["PHP_SELF"] ."?". $_SERVER["QUERY_STRING"];
+ $uri = $_SERVER["PHP_SELF"] ."?". $_SERVER["QUERY_STRING"];
}
+
+ /*
+ ** We pipe the request URI through htmlspecialchars() to prevent
+ ** XSS attacks.
+ */
+
+ $uri = htmlspecialchars($uri, ENT_QUOTES);
+
+ /*
+ ** We replace ( and ) with their entity equivalents to prevent XSS
+ ** attacks.
+ */
+
+ $uri = strtr($uri, array("(" => "&040;", ")" => "&041;"));
+
+ return $uri;
}
function message_access() {
@@ -776,7 +792,7 @@ function format_name($object) {
function form($form, $method = "post", $action = 0, $options = 0) {
if (!$action) {
- $action = htmlentities(request_uri());
+ $action = request_uri();
}
return "<form action=\"$action\" method=\"$method\"". ($options ? " $options" : "") .">\n$form</form>\n";
}
@@ -786,19 +802,19 @@ function form_item($title, $value, $description = 0) {
}
function form_radio($title, $name, $value = 1, $checked = 0, $description = 0) {
- return form_item(0, "<input type=\"radio\" name=\"edit[$name]\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") ." /> $title", $description);
+ return form_item(0, "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") ." /> $title", $description);
}
function form_checkbox($title, $name, $value = 1, $checked = 0, $description = 0) {
- return form_hidden($name, 0) . form_item(0, "<input type=\"checkbox\" name=\"edit[$name]\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") ." /> $title", $description);
+ return form_hidden($name, 0) . form_item(0, "<input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name]\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") ." /> $title", $description);
}
function form_textfield($title, $name, $value, $size, $maxlength, $description = 0) {
- return form_item($title, "<input maxlength=\"$maxlength\" name=\"edit[$name]\" size=\"$size\" value=\"". check_form($value) ."\" />", $description);
+ return form_item($title, "<input maxlength=\"$maxlength\" class=\"form-text\" name=\"edit[$name]\" size=\"$size\" value=\"". check_form($value) ."\" />", $description);
}
function form_password($title, $name, $value, $size, $maxlength, $description = 0) {
- return form_item($title, "<input type=\"password\" maxlength=\"$maxlength\" name=\"edit[$name]\" size=\"$size\" value=\"". check_form($value) ."\" />", $description);
+ return form_item($title, "<input type=\"password\" class=\"form-password\" maxlength=\"$maxlength\" name=\"edit[$name]\" size=\"$size\" value=\"". check_form($value) ."\" />", $description);
}
function form_textarea($title, $name, $value, $cols, $rows, $description = 0) {
@@ -816,7 +832,7 @@ function form_select($title, $name, $value, $options, $description = 0, $extra =
}
function form_file($title, $name, $size, $description = 0) {
- return form_item($title, "<input type=\"file\" name=\"edit[$name]\" size=\"$size\" />\n", $description);
+ return form_item($title, "<input type=\"file\" class=\"form-file\" name=\"edit[$name]\" size=\"$size\" />\n", $description);
}
function form_hidden($name, $value) {
@@ -824,7 +840,7 @@ function form_hidden($name, $value) {
}
function form_submit($value) {
- return "<input type=\"submit\" name=\"op\" value=\"". check_form($value) ."\" />\n";
+ return "<input type=\"submit\" class=\"form-submit\" name=\"op\" value=\"". check_form($value) ."\" />\n";
}
function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $description = 0, $extra = 0) {
diff --git a/includes/pager.inc b/includes/pager.inc
index 57dae4046..f031f3a33 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -17,7 +17,7 @@
* @return string html of pager
*/
function pager_display($tags = "", $limit = 10, $element = 0, $type = "default", $attributes = array()) {
- return theme("pager_display_". $type, $tags, $limit, $element, $attributes = array());
+ return theme("pager_display_". $type, $tags, $limit, $element, $attributes);
}
/**
diff --git a/misc/drupal.css b/misc/drupal.css
index 2e5eecb4b..38bd0d179 100644
--- a/misc/drupal.css
+++ b/misc/drupal.css
@@ -6,6 +6,15 @@
.item-list .icon a { color: #000; text-decoration: none; }
.item-list .icon a:hover { color: #000; text-decoration: none; }
+tr.dark { background-color: #ddd; }
+tr.light { background-color: #eee; }
+
+#tracker table { border-collapse: collapse; }
+#tracker th { text-align: left; padding: 0.25em 1em; }
+#tracker td { vertical-align: top; padding: 1em; }
+#tracker td ul { margin-top: 0; margin-bottom: 0; }
+#tracker td ul a { font-weight: normal; }
+
.poll .bar { height: 1em; }
.poll .bar .foreground { background-color: #000; float: left; height: 1em; }
.poll .bar .background { background-color: #ddd; float: left; height: 1em; }
diff --git a/modules/admin.module b/modules/admin.module
index 246c422e5..846d33bac 100644
--- a/modules/admin.module
+++ b/modules/admin.module
@@ -42,12 +42,11 @@ function admin_page() {
<head>
<title><?php echo variable_get("site_name", "drupal") . " " . t("administration pages"); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <base href="<?php echo "$base_url/" ?>" />
+ <?php print theme_head(); ?>
<link rel="stylesheet" type="text/css" media="print" href="misc/print.css" />
<style type="text/css" title="layout" media="Screen">
@import url("misc/admin.css");
</style>
- <?php print theme_head(); ?>
</head>
<body<?php print theme_onload_attribute(); ?>>
<?php
diff --git a/modules/book.module b/modules/book.module
index 8e2c6057a..ee55265e2 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -104,7 +104,7 @@ function book_load($node) {
/*
** If a user is about to update a book page, we overload some
- ** fields to reflect the changes. We use the $REQUEST_URI to
+ ** fields to reflect the changes. We use the request URI to
** dectect this as we don't want to interfer with updating a
** book page through the admin pages. See also: book_save().
*/
diff --git a/modules/book/book.module b/modules/book/book.module
index 8e2c6057a..ee55265e2 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -104,7 +104,7 @@ function book_load($node) {
/*
** If a user is about to update a book page, we overload some
- ** fields to reflect the changes. We use the $REQUEST_URI to
+ ** fields to reflect the changes. We use the request URI to
** dectect this as we don't want to interfer with updating a
** book page through the admin pages. See also: book_save().
*/
diff --git a/modules/comment.module b/modules/comment.module
index 4dbfb90a4..e61cda4ef 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -5,11 +5,11 @@ $GLOBALS["cmodes"] = array(1 => t("Flat list - collapsed"), 2 => t("Flat list -
$GLOBALS["corder"] = array(1 => t("Date - newest first"), 2 => t("Date - oldest first"));
function comment_help() {
-- $output .= t("<p>The comment module enables users to submit posts that are directly associated with a piece of content, a node. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of a threaded one. Further, users may choose to order their comments view by <i>newest comments first</i> or by <i>oldest comments first</i>. Finally, users may view a folded list, where only comment <i>subjects</i> are displayed, or an expanded list, where the whole comment is shown.</p>");
-- $output .= t("<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. A user can setup how they want they comments displayed -- Threaded/Flat, Expanded/Folded -- and how many comments to display per page. If there are more comments than you have configured to display on a page, navigation links are displayed. The home page displays, for the current user, the number of read and unread comments for a given node. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>");
-- $output .= t("<p>Comments behave like other user submissions in Drupal. Specifically, if the administrator has enabled them, ". l("filters", "admin/system/filters") .", like smileys and HTML, work fine. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>");
-- $output .= t("<p>Administrators may control which roles are allowed to submit, submit without moderation, view and administer comments using the \"post comments\", \"post comments without approval\", \"access comments\", and \"administrate comments\" ". l("user permissions", "admin/user/permission") .". Additionally, administrators may set the default display view, edit or search through comments on the ". l("comments admininistration page", "admin/comment") .".</p>");
-- $output .= t("<p>If you really have a lot of comments, you can enable moderation. You assign ". l("moderation permissions", "admin/user/permission") ." to role(s), then setup some \"". l("moderation votes","admin/comment/moderation/votes") ."\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, ". l("a value", "admin/comment/moderation/matrix") .", which can be either positive or negative. This allows, if you wish, some roles to have greater \"weight\" in their moderation. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Next your have to setup the \"". l("Queue settings", "admin/system/modules/queue") ."\" to allow a moderated comment to either be posted or dumpped. Finally, you may want to setup the ". l("comment thresholds", "admin/comment/moderation/threshold") .": these are floor/ceiling values which users can set in the comment control panel. Thresholds are useful for hiding poorly rated comments from your users while they are reading.</p>");
+ $output .= t("<p>The comment module enables users to submit posts that are directly associated with a piece of content, a node. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of a threaded one. Further, users may choose to order their comments view by <i>newest comments first</i> or by <i>oldest comments first</i>. Finally, users may view a folded list, where only comment <i>subjects</i> are displayed, or an expanded list, where the whole comment is shown.</p>");
+ $output .= t("<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. A user can setup how they want they comments displayed -- Threaded/Flat, Expanded/Folded -- and how many comments to display per page. If there are more comments than you have configured to display on a page, navigation links are displayed. The home page displays, for the current user, the number of read and unread comments for a given node. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>");
+ $output .= t("<p>Comments behave like other user submissions in Drupal. Specifically, if the administrator has enabled them, ". l("filters", "admin/system/filters") .", like smileys and HTML, work fine. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>");
+ $output .= t("<p>Administrators may control which roles are allowed to submit, submit without moderation, view and administer comments using the \"post comments\", \"post comments without approval\", \"access comments\", and \"administrate comments\" ". l("user permissions", "admin/user/permission") .". Additionally, administrators may set the default display view, edit or search through comments on the ". l("comments admininistration page", "admin/comment") .".</p>");
+ $output .= t("<p>If you really have a lot of comments, you can enable moderation. You assign ". l("moderation permissions", "admin/user/permission") ." to role(s), then setup some \"". l("moderation votes","admin/comment/moderation/votes") ."\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, ". l("a value", "admin/comment/moderation/matrix") .", which can be either positive or negative. This allows, if you wish, some roles to have greater \"weight\" in their moderation. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Next your have to setup the \"". l("Queue settings", "admin/system/modules/queue") ."\" to allow a moderated comment to either be posted or dumpped. Finally, you may want to setup the ". l("comment thresholds", "admin/comment/moderation/threshold") .": these are floor/ceiling values which users can set in the comment control panel. Thresholds are useful for hiding poorly rated comments from your users while they are reading.</p>");
return $output;
}
@@ -465,7 +465,7 @@ function comment_render($node, $cid = 0) {
if ($comment_num && ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2))) {
print "<form method=\"post\" action=\"". url("comment") ."\">\n";
- theme("box", t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page));
+ theme("box", "", theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page));
print form_hidden("nid", $nid);
print "</form>";
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 4dbfb90a4..e61cda4ef 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -5,11 +5,11 @@ $GLOBALS["cmodes"] = array(1 => t("Flat list - collapsed"), 2 => t("Flat list -
$GLOBALS["corder"] = array(1 => t("Date - newest first"), 2 => t("Date - oldest first"));
function comment_help() {
-- $output .= t("<p>The comment module enables users to submit posts that are directly associated with a piece of content, a node. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of a threaded one. Further, users may choose to order their comments view by <i>newest comments first</i> or by <i>oldest comments first</i>. Finally, users may view a folded list, where only comment <i>subjects</i> are displayed, or an expanded list, where the whole comment is shown.</p>");
-- $output .= t("<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. A user can setup how they want they comments displayed -- Threaded/Flat, Expanded/Folded -- and how many comments to display per page. If there are more comments than you have configured to display on a page, navigation links are displayed. The home page displays, for the current user, the number of read and unread comments for a given node. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>");
-- $output .= t("<p>Comments behave like other user submissions in Drupal. Specifically, if the administrator has enabled them, ". l("filters", "admin/system/filters") .", like smileys and HTML, work fine. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>");
-- $output .= t("<p>Administrators may control which roles are allowed to submit, submit without moderation, view and administer comments using the \"post comments\", \"post comments without approval\", \"access comments\", and \"administrate comments\" ". l("user permissions", "admin/user/permission") .". Additionally, administrators may set the default display view, edit or search through comments on the ". l("comments admininistration page", "admin/comment") .".</p>");
-- $output .= t("<p>If you really have a lot of comments, you can enable moderation. You assign ". l("moderation permissions", "admin/user/permission") ." to role(s), then setup some \"". l("moderation votes","admin/comment/moderation/votes") ."\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, ". l("a value", "admin/comment/moderation/matrix") .", which can be either positive or negative. This allows, if you wish, some roles to have greater \"weight\" in their moderation. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Next your have to setup the \"". l("Queue settings", "admin/system/modules/queue") ."\" to allow a moderated comment to either be posted or dumpped. Finally, you may want to setup the ". l("comment thresholds", "admin/comment/moderation/threshold") .": these are floor/ceiling values which users can set in the comment control panel. Thresholds are useful for hiding poorly rated comments from your users while they are reading.</p>");
+ $output .= t("<p>The comment module enables users to submit posts that are directly associated with a piece of content, a node. These associated posts are called <i>comments</i>. Comments may be <i>threaded</i>, which means that Drupal keeps track of multiple subconversations around a piece of content. Threading helps to keep the comment conversation organized. Users are presented with several ways to view the comment conversation, and if desired, users may easily choose a <i>flat</i> presentation of comments instead of a threaded one. Further, users may choose to order their comments view by <i>newest comments first</i> or by <i>oldest comments first</i>. Finally, users may view a folded list, where only comment <i>subjects</i> are displayed, or an expanded list, where the whole comment is shown.</p>");
+ $output .= t("<p>Since a busy site generates lots of comments, Drupal takes care to present a personalized view of comments for each user. A user can setup how they want they comments displayed -- Threaded/Flat, Expanded/Folded -- and how many comments to display per page. If there are more comments than you have configured to display on a page, navigation links are displayed. The home page displays, for the current user, the number of read and unread comments for a given node. Also, the tracker module (when installed) displays all recent comments on the site. Finally, comments which the user has not yet read are highlighted with a red star (this graphic may depend on the current theme).</p>");
+ $output .= t("<p>Comments behave like other user submissions in Drupal. Specifically, if the administrator has enabled them, ". l("filters", "admin/system/filters") .", like smileys and HTML, work fine. Also, throttles are usually enabled to prevent a single user from spamming the web site with too many comments in a short period of time.</p>");
+ $output .= t("<p>Administrators may control which roles are allowed to submit, submit without moderation, view and administer comments using the \"post comments\", \"post comments without approval\", \"access comments\", and \"administrate comments\" ". l("user permissions", "admin/user/permission") .". Additionally, administrators may set the default display view, edit or search through comments on the ". l("comments admininistration page", "admin/comment") .".</p>");
+ $output .= t("<p>If you really have a lot of comments, you can enable moderation. You assign ". l("moderation permissions", "admin/user/permission") ." to role(s), then setup some \"". l("moderation votes","admin/comment/moderation/votes") ."\"; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, ". l("a value", "admin/comment/moderation/matrix") .", which can be either positive or negative. This allows, if you wish, some roles to have greater \"weight\" in their moderation. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Next your have to setup the \"". l("Queue settings", "admin/system/modules/queue") ."\" to allow a moderated comment to either be posted or dumpped. Finally, you may want to setup the ". l("comment thresholds", "admin/comment/moderation/threshold") .": these are floor/ceiling values which users can set in the comment control panel. Thresholds are useful for hiding poorly rated comments from your users while they are reading.</p>");
return $output;
}
@@ -465,7 +465,7 @@ function comment_render($node, $cid = 0) {
if ($comment_num && ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2))) {
print "<form method=\"post\" action=\"". url("comment") ."\">\n";
- theme("box", t("Control panel"), theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page));
+ theme("box", "", theme("comment_controls", $threshold, $mode, $order, $nid, $comment_page, $comment_num, $comments_per_page));
print form_hidden("nid", $nid);
print "</form>";
}
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"));
}
}
}
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 71e7f7653..d9ef80489 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/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"));
}
}
}
diff --git a/modules/statistics.module b/modules/statistics.module
index a167c734a..3b8d7d8ca 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -314,7 +314,7 @@ function statistics_admin_accesslog_table($type, $id) {
$url = message_na();
}
- $rows[] = array(array("data" => format_date($log->timestamp, "small"), "nowrap" => "nowrap"), ($node->nid ? l($node->title, "statistics/log/$node->nid") : message_na()), format_name($user), $log->hostname ? $log->hostname : message_na(), $url, ($log->nid ? l("track node", "admin/statistics/log/node/$log->nid") : ""), ($user->uid ? l("track user", "admin/statistics/log/user/$user->uid") : ""), ($log->hostname ? l("track host", "admin/statistics/log/host/$log->hostname") : ""));
+ $rows[] = array(array("data" => format_date($log->timestamp, "small"), "nowrap" => "nowrap"), ($node->nid ? l($node->title, "node/view/$node->nid") : message_na()), format_name($user), $log->hostname ? $log->hostname : message_na(), $url, ($log->nid ? l("track node", "admin/statistics/log/node/$log->nid") : ""), ($user->uid ? l("track user", "admin/statistics/log/user/$user->uid") : ""), ($log->hostname ? l("track host", "admin/statistics/log/host/$log->hostname") : ""));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index a167c734a..3b8d7d8ca 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -314,7 +314,7 @@ function statistics_admin_accesslog_table($type, $id) {
$url = message_na();
}
- $rows[] = array(array("data" => format_date($log->timestamp, "small"), "nowrap" => "nowrap"), ($node->nid ? l($node->title, "statistics/log/$node->nid") : message_na()), format_name($user), $log->hostname ? $log->hostname : message_na(), $url, ($log->nid ? l("track node", "admin/statistics/log/node/$log->nid") : ""), ($user->uid ? l("track user", "admin/statistics/log/user/$user->uid") : ""), ($log->hostname ? l("track host", "admin/statistics/log/host/$log->hostname") : ""));
+ $rows[] = array(array("data" => format_date($log->timestamp, "small"), "nowrap" => "nowrap"), ($node->nid ? l($node->title, "node/view/$node->nid") : message_na()), format_name($user), $log->hostname ? $log->hostname : message_na(), $url, ($log->nid ? l("track node", "admin/statistics/log/node/$log->nid") : ""), ($user->uid ? l("track user", "admin/statistics/log/user/$user->uid") : ""), ($log->hostname ? l("track host", "admin/statistics/log/host/$log->hostname") : ""));
}
if ($pager = pager_display(NULL, 50, 0, "admin")) {
diff --git a/modules/tracker.module b/modules/tracker.module
index a48234707..c4c3e9607 100644
--- a/modules/tracker.module
+++ b/modules/tracker.module
@@ -25,10 +25,10 @@ function tracker_link($type) {
function tracker_posts($id = 0) {
if ($id) {
- $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node WHERE uid = '". check_query($id) ."'");
+ $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node WHERE status = 1 AND uid = '". check_query($id) ."'");
}
else {
- $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node");
+ $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node WHERE status = 1");
}
$header = array(t("Type"), t("Title"), t("Author"));
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index a48234707..c4c3e9607 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -25,10 +25,10 @@ function tracker_link($type) {
function tracker_posts($id = 0) {
if ($id) {
- $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node WHERE uid = '". check_query($id) ."'");
+ $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = '". check_query($id) ."' AND n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node WHERE status = 1 AND uid = '". check_query($id) ."'");
}
else {
- $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node");
+ $sresult = pager_query("SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, MAX(GREATEST(n.changed, c.timestamp)) AS last_activity FROM node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = 1 GROUP BY n.nid, n.title, n.type, n.changed, n.uid, u.name ORDER BY last_activity DESC", 10, 0, "SELECT COUNT(nid) FROM node WHERE status = 1");
}
$header = array(t("Type"), t("Title"), t("Author"));
diff --git a/themes/xtemplate/xtemplate.css b/themes/xtemplate/xtemplate.css
index af0e09dd4..51acb09a0 100644
--- a/themes/xtemplate/xtemplate.css
+++ b/themes/xtemplate/xtemplate.css
@@ -189,6 +189,9 @@ table {
.calendar .day-today {
background-color: #69c;
}
+.calendar .day-today a {
+ color: #fff;
+}
.calendar .day-selected {
background-color: #369;
color: #fff;
diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme
index d6c283fc9..6f8f8cc21 100644
--- a/themes/xtemplate/xtemplate.theme
+++ b/themes/xtemplate/xtemplate.theme
@@ -127,15 +127,13 @@ class Theme_xtemplate extends BaseTheme {
}
function box($title, $content, $region = "main") {
- if ($title && $content) {
- $this->template->assign(array(
- "subject" => $title,
- "content" => $content));
+ $this->template->assign(array(
+ "subject" => $title,
+ "content" => $content));
- $this->template->parse("box");
- print $this->template->text("box");
- $this->template->reset("box");
- }
+ $this->template->parse("box");
+ print $this->template->text("box");
+ $this->template->reset("box");
}
function footer() {