aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-05-19 21:41:55 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-05-19 21:41:55 +0000
commitd43770db28cd04b9f3ac2d12283d875782a53713 (patch)
tree45c4e4ec1617b95cbd171eab9529de6149a69ac3 /phpBB/includes
parent5a92a8c3233d3a67167a93379c6f25ba4a487496 (diff)
downloadforums-d43770db28cd04b9f3ac2d12283d875782a53713.tar
forums-d43770db28cd04b9f3ac2d12283d875782a53713.tar.gz
forums-d43770db28cd04b9f3ac2d12283d875782a53713.tar.bz2
forums-d43770db28cd04b9f3ac2d12283d875782a53713.tar.xz
forums-d43770db28cd04b9f3ac2d12283d875782a53713.zip
Further updates
git-svn-id: file:///svn/phpbb/trunk@4024 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_user.php2
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php72
-rw-r--r--phpBB/includes/ucp/ucp_profile.php12
3 files changed, 77 insertions, 9 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 6a4bea7b6d..8dc13b1e47 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -133,7 +133,7 @@ class ucp extends user
break;
case 'bool':
- $valid_data[$var_name] = ($data[$var_name] < 0) ? 0 : 1;
+ $valid_data[$var_name] = ($data[$var_name] <= 0) ? 0 : 1;
break;
case 'string':
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 2c963381f1..3027935382 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -47,8 +47,9 @@ class ucp_prefs extends ucp
'dateformat'=> '3,15',
'lang' => '2,5',
),
- 'int' => array('viewemail', 'hideonline', 'notifypm', 'popuppm', 'dst', 'style'),
- 'float' => array('tz')
+ 'int' => array('dst', 'style'),
+ 'float' => array('tz'),
+ 'bool' => array('viewemail', 'hideonline', 'notifypm', 'popuppm')
);
$data = $this->normalise_data($_POST, $normalise);
@@ -80,7 +81,8 @@ class ucp_prefs extends ucp
$db->sql_query($sql);
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode");
- trigger_error('');
+ $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>');
+ trigger_error($message);
}
//
@@ -135,6 +137,70 @@ class ucp_prefs extends ucp
break;
case 'post':
+
+ if (isset($_POST['submit']))
+ {
+ $data = array();
+ $normalise = array(
+ 'bool' => array('bbcode', 'html', 'smilies', 'sig', 'notify'),
+ );
+ $data = $this->normalise_data($_POST, $normalise);
+
+ if (!sizeof($this->error))
+ {
+ $sql_ary = array(
+ 'user_allowbbcode' => $data['bbcode'],
+ 'user_allowhtml' => $data['html'],
+ 'user_allowsmile' => $data['smilies'],
+ 'user_attachsig' => $data['sig'],
+ 'user_notify' => $data['notify'],
+ );
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $db->sql_query($sql);
+
+ meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode");
+ $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>');
+ trigger_error($message);
+ }
+
+ //
+ extract($data);
+ unset($data);
+ }
+
+ $bbcode = (isset($bbcode)) ? $bbcode : $user->data['user_allowbbcode'];
+ $bbcode_yes = ($bbcode) ? ' checked="checked"' : '';
+ $bbcode_no = (!$bbcode) ? ' checked="checked"' : '';
+ $html = (isset($html)) ? $html : $user->data['user_allowhtml'];
+ $html_yes = ($html) ? ' checked="checked"' : '';
+ $html_no = (!$html) ? ' checked="checked"' : '';
+ $smilies = (isset($smilies)) ? $smilies : $user->data['user_allowsmile'];
+ $smilies_yes = ($smilies) ? ' checked="checked"' : '';
+ $smilies_no = (!$smilies) ? ' checked="checked"' : '';
+ $sig = (isset($sig)) ? $sig : $user->data['user_attachsig'];
+ $sig_yes = ($sig) ? ' checked="checked"' : '';
+ $sig_no = (!$sig) ? ' checked="checked"' : '';
+ $notify = (isset($notify)) ? $notify : $user->data['user_notify'];
+ $notify_yes = ($notify) ? ' checked="checked"' : '';
+ $notify_no = (!$notify) ? ' checked="checked"' : '';
+
+ $template->assign_vars(array(
+ 'ERROR' => (sizeof($this->error)) ? implode('<br />', $this->error) : '',
+
+ 'DEFAULT_BBCODE_YES' => $bbcode_yes,
+ 'DEFAULT_BBCODE_NO' => $bbcode_no,
+ 'DEFAULT_HTML_YES' => $html_yes,
+ 'DEFAULT_HTML_NO' => $html_no,
+ 'DEFAULT_SMILIES_YES' => $smilies_yes,
+ 'DEFAULT_SMILIES_NO' => $smilies_no,
+ 'DEFAULT_SIG_YES' => $sig_yes,
+ 'DEFAULT_SIG_NO' => $sig_no,
+ 'DEFAULT_NOTIFY_YES' => $notify_yes,
+ 'DEFAULT_NOTIFY_NO' => $notify_no,)
+ );
break;
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 6a846b93e1..bfbcf5d076 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -81,7 +81,8 @@ class ucp_profile extends ucp
$db->sql_query($sql);
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode");
- trigger_error('');
+ $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>');
+ trigger_error($message);
}
//
@@ -129,7 +130,7 @@ class ucp_profile extends ucp
$validate = array(
'match' => array(
'icq' => ($data['icq']) ? '#^[0-9]+$#i' : '',
- 'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?([a-z0-9\-]+\.)?[a-z]+#i' : '',
+ 'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]+#i' : '',
),
);
$this->validate_data($data, $validate);
@@ -155,7 +156,8 @@ class ucp_profile extends ucp
$db->sql_query($sql);
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode");
- trigger_error('');
+ $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>');
+ trigger_error($message);
}
//
@@ -256,8 +258,8 @@ class ucp_profile extends ucp
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
- meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode");
- trigger_error('');
+ $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>');
+ trigger_error($message);
}
}