aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-11 21:02:37 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-11 21:02:37 +0100
commit2f47c99432c604a2adaad73821602a4b1763caa8 (patch)
tree3fc6247d2203b73861511ef1690346cf467a80be
parent1aae72961a3205a8487218b6d69361c43a1297d6 (diff)
downloadforums-2f47c99432c604a2adaad73821602a4b1763caa8.tar
forums-2f47c99432c604a2adaad73821602a4b1763caa8.tar.gz
forums-2f47c99432c604a2adaad73821602a4b1763caa8.tar.bz2
forums-2f47c99432c604a2adaad73821602a4b1763caa8.tar.xz
forums-2f47c99432c604a2adaad73821602a4b1763caa8.zip
[feature/avatars] Add more consistency to codebase
PHPBB3-10018
-rw-r--r--phpBB/adm/style/acp_avatar_options_gravatar.html4
-rw-r--r--phpBB/adm/style/acp_avatar_options_remote.html4
-rw-r--r--phpBB/includes/acp/acp_groups.php2
-rw-r--r--phpBB/includes/acp/acp_users.php4
-rw-r--r--phpBB/includes/avatar/driver/gravatar.php19
-rw-r--r--phpBB/includes/avatar/driver/remote.php15
-rw-r--r--phpBB/includes/ucp/ucp_profile.php4
7 files changed, 31 insertions, 21 deletions
diff --git a/phpBB/adm/style/acp_avatar_options_gravatar.html b/phpBB/adm/style/acp_avatar_options_gravatar.html
index 04fd5c459d..47422a6ecd 100644
--- a/phpBB/adm/style/acp_avatar_options_gravatar.html
+++ b/phpBB/adm/style/acp_avatar_options_gravatar.html
@@ -5,7 +5,7 @@
<dl>
<dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
<dd>
- <label for="avatar_gravatar_width"><input type="text" name="avatar_gravatar_width" id="avatar_gravatar_width" size="3" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
- <label for="avatar_gravatar_height"><input type="text" name="avatar_gravatar_height" id="avatar_gravatar_height" size="3" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
+ <input type="text" name="avatar_gravatar_width" id="avatar_gravatar_width" size="3" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="text" name="avatar_gravatar_height" id="avatar_gravatar_height" size="3" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
</dd>
</dl>
diff --git a/phpBB/adm/style/acp_avatar_options_remote.html b/phpBB/adm/style/acp_avatar_options_remote.html
index ab91e90c27..1dc4b05992 100644
--- a/phpBB/adm/style/acp_avatar_options_remote.html
+++ b/phpBB/adm/style/acp_avatar_options_remote.html
@@ -5,7 +5,7 @@
<dl>
<dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
<dd>
- <label for="avatar_remote_width"><input type="text" name="avatar_remote_width" id="avatar_remote_width" size="3" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
- <label for="avatar_remote_height"><input type="text" name="avatar_remote_height" id="avatar_remote_height" size="3" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
+ <input type="text" name="avatar_remote_width" id="avatar_remote_width" size="3" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="text" name="avatar_remote_height" id="avatar_remote_height" size="3" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
</dd>
</dl>
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index ae0abdd139..fe65ea2f03 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -529,7 +529,7 @@ class acp_groups
$avatars_enabled = true;
$config_name = $phpbb_avatar_manager->get_driver_config_name($driver);
$template->set_filenames(array(
- 'avatar' => "acp_avatar_options_$config_name.html",
+ 'avatar' => "acp_avatar_options_{$config_name}.html",
));
if ($driver->prepare_form($template, $avatar_data, $avatar_error))
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index b3cfd81949..b2ef43edbe 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1765,7 +1765,7 @@ class acp_users
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $result) . '
- WHERE user_id = ' . $user_id;
+ WHERE user_id = ' . (int) $user_id;
$db->sql_query($sql);
trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
@@ -1810,7 +1810,7 @@ class acp_users
$avatars_enabled = true;
$config_name = $phpbb_avatar_manager->get_driver_config_name($driver);
$template->set_filenames(array(
- 'avatar' => "acp_avatar_options_$config_name.html",
+ 'avatar' => "acp_avatar_options_{$config_name}.html",
));
if ($driver->prepare_form($template, $avatar_data, $error))
diff --git a/phpBB/includes/avatar/driver/gravatar.php b/phpBB/includes/avatar/driver/gravatar.php
index 11996ca561..2b10fd0c2d 100644
--- a/phpBB/includes/avatar/driver/gravatar.php
+++ b/phpBB/includes/avatar/driver/gravatar.php
@@ -77,13 +77,18 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
require($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
}
- $error = array_merge($error, validate_data(array(
- 'email' => $row['avatar'],
- ), array(
- 'email' => array(
- array('string', false, 6, 60),
- array('email')),
- )));
+ $validate_array = validate_data(
+ array(
+ 'email' => $row['avatar'],
+ ),
+ array(
+ 'email' => array(
+ array('string', false, 6, 60),
+ array('email'))
+ )
+ );
+
+ $error = array_merge($error, $validate_array);
if (!empty($error))
{
diff --git a/phpBB/includes/avatar/driver/remote.php b/phpBB/includes/avatar/driver/remote.php
index 9135a62eac..1f16fce1e7 100644
--- a/phpBB/includes/avatar/driver/remote.php
+++ b/phpBB/includes/avatar/driver/remote.php
@@ -66,11 +66,16 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
require($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
}
- $error = array_merge($error, validate_data(array(
- 'url' => $url,
- ), array(
- 'url' => array('string', true, 5, 255),
- )));
+ $validate_array = validate_data(
+ array(
+ 'url' => $url,
+ ),
+ array(
+ 'url' => array('string', true, 5, 255),
+ )
+ );
+
+ $error = array_merge($error, $validate_array);
if (!empty($error))
{
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 14639b00ff..8ed5aff3e3 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -590,7 +590,7 @@ class ucp_profile
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $result) . '
- WHERE user_id = ' . $user->data['user_id'];
+ WHERE user_id = ' . (int) $user->data['user_id'];
$db->sql_query($sql);
@@ -615,7 +615,7 @@ class ucp_profile
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $result) . '
- WHERE user_id = ' . $user->data['user_id'];
+ WHERE user_id = ' . (int) $user->data['user_id'];
$db->sql_query($sql);