aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruid42062 <uid42062@users.sourceforge.net>2001-07-04 19:36:32 +0000
committeruid42062 <uid42062@users.sourceforge.net>2001-07-04 19:36:32 +0000
commita6723b8a1ba6ebf4a455a7a56b804d4973463402 (patch)
treebb12bdafdeceec35aa0b9cd3680654de904f6a6e
parentb2c10ae40b1815cdd72eea15b6d7d646e937a26d (diff)
downloadforums-a6723b8a1ba6ebf4a455a7a56b804d4973463402.tar
forums-a6723b8a1ba6ebf4a455a7a56b804d4973463402.tar.gz
forums-a6723b8a1ba6ebf4a455a7a56b804d4973463402.tar.bz2
forums-a6723b8a1ba6ebf4a455a7a56b804d4973463402.tar.xz
forums-a6723b8a1ba6ebf4a455a7a56b804d4973463402.zip
Lots of updates
git-svn-id: file:///svn/phpbb/trunk@553 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/common.php2
-rwxr-xr-xphpBB/language/lang_english.php92
-rw-r--r--phpBB/privmsg.php112
-rw-r--r--phpBB/profile.php1358
-rw-r--r--phpBB/templates/PSO/profile_add_body.tpl51
5 files changed, 698 insertions, 917 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 00d4fa066f..edc3ed9b7e 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -131,6 +131,8 @@ else
$board_config['avatar_path'] = $config['avatar_path'];
$board_config['prune_enable'] = $config['prune_enable'];
$board_config['gzip_compress'] = $config['gzip_compress'];
+ $board_config['smtp_delivery'] = $config['smtp_delivery'];
+ $board_config['smtp_host'] = $config['smtp_host'];
}
diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index bdfd0fc197..20d7e057b5 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -83,7 +83,14 @@ $lang['Pages'] = "Pages";
$lang['of'] = "of"; // See Page above
$lang['Go'] = "Go";
+$lang['Submit'] = "Submit";
+$lang['Reset'] = "Reset";
+$lang['Cancel'] = "Cancel";
+$lang['Yes'] = "Yes";
+$lang['No'] = "No";
+
$lang['Private_messaging'] = "Send a Private Message";
+$lang['Click_index'] = "Click <a href=\"index.$phpEx\">HERE</a> to return to the index";
//
// Global Header strings
@@ -230,6 +237,11 @@ $lang['Find_username'] = "Find a username";
$lang['Find'] = "Find";
$lang['No_match'] = "No matches found";
+$lang['No_post_id'] = "No post ID was specified";
+$lang['No_such_folder'] = "No such folder exists";
+$lang['No_folder'] = "No folder specified";
+
+
//
// Profiles/Registration
//
@@ -241,18 +253,73 @@ $lang['Bad_username'] = "The username you choose has been taken or is disallowed
$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['Always_smile'] = "Always enable Smilies";
+$lang['Always_html'] = "Always allow HTML";
+$lang['Always_bbcode'] = "Always allow BBCode";
+$lang['Always_add_sig'] = "Always attach my signature";
+
+$l_boardtheme = "Board Theme";
+$l_boardlang = "Board Language";
+$l_nothemes = "No Themes In database";
+$l_saveprefs = "Save $l_preferences";
+$l_timezone = "Timezone";
+
+$lang['Avatar_panel'] = "Avatar control panel";
$lang['Avatar'] = "Avatar";
$lang['Avatar_explain'] = "Displays a small graphic image below your details in posts. Only one image can be displayed at a time, its width can be no greater than " . $board_config['avatar_max_width'] . " pixels, a height no greater than " . $board_config['avatar_max_height'] . " pixels and a file size no more than " . (round($board_config['avatar_filesize'] / 1024)) . " kB.";
-$lang['Upload_Avatar'] = "Upload Avatar image";
+$lang['Upload_Avatar_file'] = "Upload Avatar from your machine";
+$lang['Upload_Avatar_URL'] = "Upload Avatar from a URL";
+$lang['Upload_Avatar_URL_explain'] = "Enter the URL of the location containing the Avatar image, it will be copied to this site.";
+$lang['Pick_local_Avatar'] = "Select Avatar from the gallery";
+$lang['Link_remote_Avatar'] = "Link to off-site Avatar";
+$lang['Link_remote_Avatar_explain'] = "Enter the URL of the location containing the Avatar image you wish to link to.";
$lang['Avatar_URL'] = "URL of Avatar Image";
$lang['Avatar_gallery'] = "Show gallery of Avatar images";
+
$lang['Delete_Image'] = "Delete Image";
$lang['Current_Image'] = "Current Image";
$lang['Notify_on_privmsg'] = "Notify on Private Message";
$lang['Hide_user'] = "Hide your online status";
+$lang['Profile_updated'] = "Your profile has been updated<br><br>" . $lang['Click_index'];
+
+$lang['Password_mismatch'] = "The passwords you entered did not match";
+$lang['Invalid_username'] = "The username you requested has been taken or disallowed";
+$lang['Fields_empty'] = "You must fill in the required fields";
+$lang['Avatar_filetype'] = "The avatar filetype must be .jpg, .gif or .png";
+$lang['Avatar_filesize'] = "The avatar image file size must more than 0 kB and less than " . round($board_config['avatar_filesize'] / 1024) . " kB";
+$lang['Avatar_imagesize'] = "The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high";
+
+$lang['Welcome_subject'] = "Welcome to " . $board_config['sitename'] . " Forums";
+
+$lang['Account_added'] = "Thank you for registering, your account has been created. You may now login with your username and password";
+$lang['Account_inactive'] = "Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Pease check your email for further information";
+$lang['Welcome_email_activate'] = $lang['Welcome_subject'] . "
+
+Please keep this email for your records.
+
+Your account information is as follows:
+
+----------------------------
+Username: $username
+Password: $password
+----------------------------
+
+Your account is currently inactive. You cannot use it until you visit the following link:
+
+http://$SERVER_NAME$PHP_SELF?mode=activate&act_key=$act_key
+
+Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you.
+However, should you forget your password you can request a new one which will be activated in the same way as this account.
+
+Thank you for registering.
+
+";
+
+$lang['COPPA'] = "Your account has been created but has to be approved, please check your email for details.";
+$lang['Welcome_COPPA'] = "Your account has been created, however in complance with the COPPA act you must print out this page and have you parent or guardian mail it to: <br>" . $lang['Mailing_address'] . "<br>Or fax it to: <br>" . $lang['Fax_info'] . "<br> Once this information has been received your account will be activated by the administrator and you will receive an email notification.";
//
@@ -553,7 +620,6 @@ $l_version = "Version";
// Auth
// Register
-$l_accountinactive = "Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Pease check your email for further information.";
$l_acountadded = "Thank you for registering with $sitename. Your account has been successfully created.";
$l_nowactive = "Your account is now been activated. You may login and post with this account. Thank you for using $sitename forums.";
$l_notfilledin = "Error - you did not fill in all the required fields.";
@@ -597,28 +663,6 @@ Thank you for registering.
";
-$l_welcomeemailactivate = "
-$l_welcomesubj,
-
-Please keep this email for your records.
-
-
-Your account information is as follows:
-
-----------------------------
-Username: $username
-Password: $password
-----------------------------
-
-Your account is currently INACTIVE. You cannot use it until you visit the following link:
-http://$SERVER_NAME$PHP_SELF?mode=activate&act_key=$act_key
-
-Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you.
-However, should you forget your password we provide an easy to use script to generate and email a new, random, password.
-
-Thank you for registering.
-
-";
$l_beenadded = "You have been added to the database.";
$l_thankregister= "Thank you for registering!";
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index afbaf05432..5c0c04ae9a 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -62,8 +62,7 @@ if($mode == "read")
}
else
{
- // Error out
-
+ message_die(GENERAL_ERROR, $lang['No_post_id']);
}
if(!$userdata['session_logged_in'])
@@ -99,13 +98,12 @@ if($mode == "read")
}
else
{
- // Error out
+ message_die(GENERAL_ERROR, $lang['No_such_folder']);
}
}
else
{
- // Error out
-
+ message_die(GENERAL_ERROR, $lang['No_folder']);
}
$sql = "SELECT u.username, u.user_id, u.user_website, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, u.user_viewemail, u.user_sig, u.user_avatar, pm.privmsgs_id, pm.privmsgs_type, pm.privmsgs_subject, pm.privmsgs_from_userid, pm.privmsgs_to_userid, pm.privmsgs_date, pm.privmsgs_ip, pm.privmsgs_bbcode_uid, pmt.privmsgs_text
@@ -117,7 +115,7 @@ if($mode == "read")
$sql_type";
if(!$pm_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not query private message post information.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not query private message post information.", "", __LINE__, __FILE__, $sql);
}
if(!$db->sql_numrows($pm_status))
{
@@ -133,7 +131,7 @@ if($mode == "read")
WHERE privmsgs_id = " . $privmsg['privmsgs_id'];
if(!$pm_upd_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not update private message read status.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not update private message read status.", "", __LINE__, __FILE__, $sql);
}
//
@@ -148,7 +146,7 @@ if($mode == "read")
VALUES (" . PRIVMSGS_SENT_MAIL . ", '" . $privmsg['privmsgs_subject'] . "', " . $privmsg['privmsgs_from_userid'] . ", " . $privmsg['privmsgs_to_userid'] . ", " . $privmsg['privmsgs_date'] . ", '" . $privmsg['privmsgs_ip'] . "', '" . $privmsg['privmsgs_bbcode_uid'] . "')";
if(!$pm_sent_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not insert private message sent info.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql);
}
else
{
@@ -158,7 +156,7 @@ if($mode == "read")
VALUES ($privmsg_sent_id, '" . $privmsg['privmsgs_text'] . "')";
if(!$pm_sent_text_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not insert private message sent text.<BR>$sql", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not insert private message sent text.<BR>$sql", "", __LINE__, __FILE__, $sql);
}
}
}
@@ -220,17 +218,17 @@ if($mode == "read")
$poster_avatar = ($privmsg['user_avatar'] != "" && $userdata['user_id'] != ANONYMOUS) ? "<img src=\"" . $board_config['avatar_path'] . "/" . $privmsg['user_avatar'] . "\">" : "";
- $profile_img = "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id") . "\"><img src=\"" . $images['profile'] . "\" alt=\"$l_profileof $poster\" border=\"0\"></a>";
+ $profile_img = "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id") . "\"><img src=\"" . $images['profile'] . "\" alt=\"" . $lang['Profile'] . "\" border=\"0\"></a>";
- $email_img = ($privmsg['user_viewemail'] == 1) ? "<a href=\"mailto:" . $privmsg['user_email'] . "\"><img src=\"" .$images['email'] . "\" alt=\"$l_email $poster\" border=\"0\"></a>" : "";
+ $email_img = ($privmsg['user_viewemail'] == 1) ? "<a href=\"mailto:" . $privmsg['user_email'] . "\"><img src=\"" .$images['email'] . "\" alt=\"" . $lang['Email'] . "\" border=\"0\"></a>" : "";
- $www_img = ($privmsg['user_website']) ? "<a href=\"" . $privmsg['user_website'] . "\"><img src=\"" . $images['www'] . "\" alt=\"$l_viewsite\" border=\"0\"></a>" : "";
+ $www_img = ($privmsg['user_website']) ? "<a href=\"" . $privmsg['user_website'] . "\"><img src=\"" . $images['www'] . "\" alt=\"" . $lang['Website'] . "\" border=\"0\"></a>" : "";
if($privmsg['user_icq'])
{
- $icq_status_img = "<a href=\"http://wwp.icq.com/" . $privmsg['user_icq'] . "#pager\"><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=" . $privmsg['user_icq'] . "&img=5\" alt=\"$l_icqstatus\" border=\"0\"></a>";
+ $icq_status_img = "<a href=\"http://wwp.icq.com/" . $privmsg['user_icq'] . "#pager\"><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=" . $privmsg['user_icq'] . "&img=5\" alt=\"" . $lang['Page_ICQ'] . "\" border=\"0\"></a>";
- $icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=" . $privmsg['user_icq'] . "\"><img src=\"" . $images['icq'] . "\" alt=\"$l_icq\" border=\"0\"></a>";
+ $icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=" . $privmsg['user_icq'] . "\"><img src=\"" . $images['icq'] . "\" alt=\"" . $lang['ICQ'] . "\" border=\"0\"></a>";
}
else
{
@@ -319,34 +317,18 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
if(!$userdata['user_allow_pm'])
{
//
- // Admin has prevented user
- // from sending PM's
+ // Admin has prevented user from sending PM's
//
- include('includes/page_header.'.$phpEx);
-
$msg = $lang['Cannot_send_privmsg'];
-
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl")
- );
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $msg)
- );
- $template->pparse("reg_header");
-
- include('includes/page_tail.'.$phpEx);
+ message_die(GENERAL_MESSAGE, $msg);
}
//
- // When we get to the point of a code review
- // we really really really need to look at
- // combining the following fragments with the
- // posting routine. I don't think or see it
- // necessary to actually use posting for privmsgs
- // but I'm sure more can be combined in common
- // functions ... not that I think all functions are
- // common, some functions are actually quite classy
- // and sophisticated, champagne, caviar and all that
+ // When we get to the point of a code review we really really really need to look at
+ // combining the following fragments with the posting routine. I don't think or see it
+ // necessary to actually use posting for privmsgs but I'm sure more can be combined in
+ // common functions ... not that I think all functions are common, some functions are
+ // actually quite classy and sophisticated, champagne, caviar and all that
//
$disable_html = (isset($HTTP_POST_VARS['disable_html'])) ? $HTTP_POST_VARS['disable_html'] : !$userdata['user_allowhtml'];
@@ -368,11 +350,11 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
}
else
{
- // Error out
+ message_die(GENERAL_ERROR, $lang['No_post_id']);
}
}
- if(empty($HTTP_GET_VARS[POST_USERS_URL]) && !$preview && empty($HTTP_POST_VARS['submit']))
+ if(!empty($HTTP_GET_VARS[POST_USERS_URL]) && !$preview && empty($HTTP_POST_VARS['submit']))
{
$user_id = $HTTP_GET_VARS[POST_USERS_URL];
@@ -421,7 +403,6 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
OR username LIKE '%$username_search%'
OR username LIKE '$username_search' )
AND user_id <> " . ANONYMOUS;
-
}
else
{
@@ -432,9 +413,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
WHERE ( username LIKE '" . chr($first_letter) . "%'
OR username LIKE '" . chr($first_letter) . "' )
AND user_id <> " . ANONYMOUS;
-
}
-
}
else
{
@@ -465,7 +444,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
}
$user_names_select .= "</select>";
- $user_alpha_select = "<select name=\"user_alpha\">";
+ $user_alpha_select = "<select name=\"user_alpha\" onchange=\"\">";
for($i = 65; $i < 91; $i++)
{
if($first_letter == $i)
@@ -491,7 +470,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
AND u.user_id = pm.privmsgs_to_userid";
if(!$pm_edit_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not obtain private message for editing.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql);
}
if(!$db->sql_numrows($pm_edit_status))
{
@@ -521,7 +500,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
AND u.user_id = pm.privmsgs_from_userid";
if(!$pm_reply_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not obtain private message for editing.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql);
}
if(!$db->sql_numrows($pm_reply_status))
{
@@ -663,9 +642,9 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
WHERE privmsgs_id = $privmsgs_id";
}
- if(!$pm_sent_status = $db->sql_query($sql_info))
+ if(!$pm_sent_status = $db->sql_query($sql_info, BEGIN_TRANSACTION))
{
- error_die(SQL_QUERY, "Could not insert/update private message sent info.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
}
else
{
@@ -683,9 +662,9 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
WHERE privmsgs_text_id = $privmsgs_id";
}
- if(!$pm_sent_text_status = $db->sql_query($sql))
+ if(!$pm_sent_text_status = $db->sql_query($sql, END_TRANSACTION))
{
- error_die(SQL_QUERY, "Could not insert/update private message sent text.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
}
else if($mode != "edit")
{
@@ -695,22 +674,11 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
}
}
- include('includes/page_header.'.$phpEx);
-
$msg = $lang['Message_sent'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("privmsg.$phpEx?folder=inbox") . "\">" . $lang['Here'] . "</a> " . $lang['to_return_inbox'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("index.$phpEx") . "\">" . $lang['Here'] . "</a> ". $lang['to_return_index'];
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl")
- );
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $msg)
- );
- $template->pparse("reg_header");
-
- include('includes/page_tail.'.$phpEx);
+ message_die(GENERAL_MESSAGE, $msg);
}
}
-
}
//
@@ -727,7 +695,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
AND u.user_id = ug.user_id";
if(!$group_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not obtain group moderator list.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not obtain group moderator list.", "", __LINE__, __FILE__, $sql);
}
if($db->sql_numrows($group_status))
{
@@ -863,6 +831,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
$template->assign_vars(array(
"S_USERNAME_INPUT" => $username_input,
+
"SUBJECT_INPUT" => $subject_input,
"MESSAGE_INPUT" => $message_input,
"HTML_STATUS" => $html_status,
@@ -932,7 +901,7 @@ else if( ( isset($HTTP_POST_VARS['delete']) && !empty($HTTP_POST_VARS['mark']) )
if(!$del_list_status = $db->sql_query($deleteall_sql))
{
- error_die(SQL_QUERY, "Could not obtain id list to delete all messages.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not obtain id list to delete all messages.", "", __LINE__, __FILE__, $deleteall_sql);
}
$delete_list = $db->sql_fetchrowset($del_list_status);
@@ -944,7 +913,6 @@ else if( ( isset($HTTP_POST_VARS['delete']) && !empty($HTTP_POST_VARS['mark']) )
unset($delete_type);
}
-
$delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . "
WHERE ";
$delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . "
@@ -982,15 +950,15 @@ else if( ( isset($HTTP_POST_VARS['delete']) && !empty($HTTP_POST_VARS['mark']) )
break;
}
- if(!$del_status = $db->sql_query($delete_sql))
+ if(!$del_status = $db->sql_query($delete_sql, BEGIN_TRANSACTION))
{
- error_die(SQL_QUERY, "Could not delete private message info.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not delete private message info.", "", __LINE__, __FILE__, $delete_sql);
}
else
{
- if(!$del_text_status = $db->sql_query($delete_text_sql))
+ if(!$del_text_status = $db->sql_query($delete_text_sql, END_TRANSACTION))
{
- error_die(SQL_QUERY, "Could not delete private message text.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not delete private message text.", "", __LINE__, __FILE__, $delete_text_sql);
}
}
@@ -1018,9 +986,7 @@ else if( ( isset($HTTP_POST_VARS['save']) && !empty($HTTP_POST_VARS['mark']) )
$saved_sql .= "OR ";
}
}
-
$saved_sql .= "AND ";
-
}
switch($folder)
@@ -1036,7 +1002,7 @@ else if( ( isset($HTTP_POST_VARS['save']) && !empty($HTTP_POST_VARS['mark']) )
if(!$save_status = $db->sql_query($saved_sql))
{
- error_die(SQL_QUERY, "Could not save private messages.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not save private messages.", "", __LINE__, __FILE__, $saved_sql);
}
$folder = "savebox";
@@ -1157,11 +1123,11 @@ $sql .= " ORDER BY pm.privmsgs_date DESC LIMIT $start, " . $board_config['topics
if(!$pm_tot_status = $db->sql_query($sql_tot))
{
- error_die(SQL_QUERY, "Could not query private message information.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot);
}
if(!$pm_status = $db->sql_query($sql))
{
- error_die(SQL_QUERY, "Could not query private message information.", __LINE__, __FILE__);
+ message_die(GENERAL_ERROR, "Could not query private messages.", "", __LINE__, __FILE__, $sql);
}
$pm_total = $db->sql_numrows($pm_tot_status);
$pm_list = $db->sql_fetchrowset($pm_status);
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 7cfeb787b5..d11f447838 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -64,6 +64,7 @@ function language_select($default, $dirname="language/")
function template_select($default)
{
$dir = opendir("templates");
+
$template_select = "<select name=\"template\">\n";
while($file = readdir($dir))
{
@@ -93,6 +94,7 @@ function theme_select($default)
{
$num = $db->sql_numrows($result);
$rowset = $db->sql_fetchrowset($result);
+
$theme_select = "<select name=\"theme\">\n";
for($i = 0; $i < $num; $i++)
{
@@ -104,7 +106,7 @@ function theme_select($default)
{
$selected = "";
}
- $theme_select .= "\t<option value=\"".$rowset[$i]['themes_id']."\"$selected>".stripslashes($rowset[$i]['themes_name'])."</option>\n";
+ $theme_select .= "\t<option value=\"" . $rowset[$i]['themes_id'] ."\"$selected>" . stripslashes($rowset[$i]['themes_name']) . "</option>\n";
}
$theme_select .= "</select>\n";
}
@@ -149,22 +151,15 @@ function tz_select($default)
"+6" => "(GMT +6:00 hours) Almaty, Colombo, Dhaka",
"+7" => "(GMT +7:00 hours) Bangkok, Hanoi, Jakarta",
"+8" => "(GMT +8:00 hours) Beijing, Chongqing, Hong Kong, Perth, Singapore, Taipei",
- "+9" => "(GMT +9:00 hours) Tokyo, Seoul, Osaka, Sapporo, Yakutsk",
+ "+9" => "(GMT +9:00 hours) Osaka, Sapporo, Seoul, Tokyo, Yakutsk",
"+9.5" => "(GMT +9:30 hours) Adelaide, Darwin",
"+10" => "(GMT +10:00 hours) Guam, Melbourne, Papua New Guinea, Sydney, Vladivostok",
- "+11" => "(GMT +11:00 hours) Magadan, Solomon Islands, New Caledonia",
+ "+11" => "(GMT +11:00 hours) Magadan, New Caledonia, Solomon Islands",
"+12" => "(GMT +12:00 hours) Auckland, Wellington, Fiji, Kamchatka, Marshall Island");
while(list($offset, $zone) = each($tz_array))
{
- if($offset == $default)
- {
- $selected = " selected";
- }
- else
- {
- $selected = "";
- }
+ $selected = ($offset == $default) ? " selected" : "";
$tz_select .= "\t<option value=\"$offset\"$selected>$zone</option>\n";
}
$tz_select .= "</select>\n";
@@ -185,251 +180,343 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
//
// Begin page proper
//
- switch($mode)
+ if($mode == "viewprofile")
{
- case 'viewprofile':
- $pagetype = "profile";
- $page_title = "$l_profile";
+ $pagetype = "profile";
+ $page_title = "$l_profile";
+
+ //
+ // Output page header and
+ // profile_view template
+ //
+ include('includes/page_header.'.$phpEx);
+
+ $template->set_filenames(array(
+ "body" => "profile_view_body.tpl",
+ "jumpbox" => "jumpbox.tpl")
+ );
+ $jumpbox = make_jumpbox();
+ $template->assign_vars(array(
+ "JUMPBOX_LIST" => $jumpbox,
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ //
+ // End header
+ //
+
+ if(!$HTTP_GET_VARS[POST_USERS_URL])
+ {
+ message_die(GENERAL_ERROR, "You must supply the user ID number of the user you want to view", "", __LINE__, __FILE__);
+ }
+ $profiledata = get_userdata_from_id($HTTP_GET_VARS[POST_USERS_URL]);
- //
- // Output page header and
- // profile_view template
- //
- include('includes/page_header.'.$phpEx);
-
- $template->set_filenames(array(
- "body" => "profile_view_body.tpl",
- "jumpbox" => "jumpbox.tpl")
- );
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- "JUMPBOX_LIST" => $jumpbox,
- "SELECT_NAME" => POST_FORUM_URL)
- );
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
- //
- // End header
- //
+ //
+ // Calculate the number of days this user has been a member ($memberdays)
+ // Then calculate their posts per day
+ //
+ $regdate = $profiledata['user_regdate'];
- if(!$HTTP_GET_VARS[POST_USERS_URL])
- {
- if(DEBUG)
- {
- error_die(GENERAL_ERROR, "You must supply the user ID number of the user you want to view", __LINE__, __FILE__);
- }
- else
- {
- error_die(GENERAL_ERROR, $l_nouserid);
- }
- }
- $profiledata = get_userdata_from_id($HTTP_GET_VARS[POST_USERS_URL]);
+ $memberdays = (time() - $regdate) / (24*60*60);
+ $posts_per_day = sprintf("%.2f", $profiledata['user_posts'] / $memberdays);
- //
- // Calculate the number of days this user has been a member ($memberdays)
- // Then calculate their posts per day
- //
- $regdate = $profiledata['user_regdate'];
+ // Get the users percentage of total posts
+ if($profiledata['user_posts'] != 0)
+ {
+ $total_posts = get_db_stat("postcount");
+ $percentage = sprintf("%.2f", ($profiledata['user_posts'] / $total_posts) * 100);
+ }
+ else
+ {
+ $percentage = 0;
+ }
+
+ if($profiledata['user_viewemail'])
+ {
+ // Replace the @ with 'at'. Some anti-spam mesures.
+ $email_addr = str_replace("@", " at ", $profiledata['user_email']);
+ $email = "<a href=\"mailto:$email_addr\">$email_addr</a>";
+ }
+ else
+ {
+ $email = $l_hidden;
+ }
+ $template->assign_vars(array(
+ "USERNAME" => stripslashes($profiledata['username']),
+ "JOINED" => create_date($board_config['default_dateformat'], $profiledata['user_regdate'], $board_config['default_timezone']),
+ "POSTS_PER_DAY" => $posts_per_day,
+ "POSTS" => $profiledata['user_posts'],
+ "PERCENTAGE" => $percentage . "%",
+ "EMAIL" => $email,
+ "ICQ" => stripslashes($profiledata['user_icq']),
+ "AIM" => stripslashes($profiledata['user_aim']),
+ "MSN" => stripslashes($profiledata['user_msnm']),
+ "YIM" => stripslashes($profiledata['user_yim']),
+ "WEBSITE" => stripslashes($profiledata['user_website']),
+ "LOCATION" => stripslashes($profiledata['user_from']),
+ "OCCUPATION" => stripslashes($profiledata['user_occ']),
+ "INTERESTS" => stripslashes($profiledata['user_interests']),
+ "AVATAR_IMG" => $board_config['avatar_path'] . "/" . stripslashes($profiledata['user_avatar']),
+
+ "L_VIEWING_PROFILE" => $l_viewing_profile,
+ "L_USERNAME" => $lang['Username'],
+ "L_VIEW_USERS_POSTS" => $l_view_users_posts,
+ "L_JOINED" => $l_joined,
+ "L_PER_DAY" => $l_per_day,
+ "L_OF_TOTAL" => $l_of_total,
+ "L_EMAIL_ADDRESS" => $l_emailaddress,
+ "L_ICQ_NUMBER" => $l_icq_number,
+ "L_YAHOO" => $l_yahoo,
+ "L_AIM" => $l_aim,
+ "L_WEBSITE" => $l_website,
+ "L_MESSENGER" => $l_messenger,
+ "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']),
+
+ "S_PROFILE_ACTION" => append_sid("profile.$phpEx"))
+ );
+
+ $template->pparse("body");
+
+ include('includes/page_tail.'.$phpEx);
+
+ }
+ else if($mode == "editprofile" || $mode == "register")
+ {
+
+ if(!$userdata['session_logged_in'] && $mode == "editprofile")
+ {
+ header(append_sid("Location: login.$phpEx?forward_page=$PHP_SELF&mode=editprofile"));
+ }
- $memberdays = (time() - $regdate) / (24*60*60);
- $posts_per_day = sprintf("%.2f", $profiledata['user_posts'] / $memberdays);
+ $pagetype = ($mode == "edit") ? "editprofile" : "register";
+ $page_title = ($mode == "edit") ? $lang['Edit_profile'] : $lang['Register'];
- // Get the users percentage of total posts
- if($profiledata['user_posts'] != 0)
+ include('includes/page_header.'.$phpEx);
+
+ //
+ // Start processing for output
+ //
+ if($mode == "register" && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']))
+ {
+ if(!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']))
{
- $total_posts = get_db_stat("postcount");
- $percentage = sprintf("%.2f", ($profiledata['user_posts'] / $total_posts) * 100);
+ //
+ // Load agreement template since user has not yet
+ // agreed to registration conditions/coppa
+ //
+ $template->set_filenames(array(
+ "body" => "agreement.tpl",
+ "jumpbox" => "jumpbox.tpl")
+ );
+ $jumpbox = make_jumpbox();
+ $template->assign_vars(array(
+ "JUMPBOX_LIST" => $jumpbox,
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ $template->assign_vars(array(
+ "COPPA" => $coppa,
+
+ "U_AGREE_OVER13" => append_sid("profile.$phpEx?mode=register&agreed=true"),
+ "U_AGREE_UNDER13" => append_sid("profile.$phpEx?mode=register&agreed=true&coppa=true"))
+ );
+ $template->pparse("body");
+
+ include('includes/page_tail.'.$phpEx);
}
- else
+ }
+ else if(isset($HTTP_POST_VARS['submit']) || $mode == "register")
+ {
+ if($mode == "editprofile")
{
- $percentage = 0;
+ $user_id = $HTTP_POST_VARS['user_id'];
}
+ $username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : "";
+ $email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
+
+ $password = (!empty($HTTP_POST_VARS['password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : "";
+ $password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
+
+ $icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
+ $aim = (!empty($HTTP_POST_VARS['aim'])) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : "";
+ $msn = (!empty($HTTP_POST_VARS['msn'])) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : "";
+ $yim = (!empty($HTTP_POST_VARS['yim'])) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : "";
- if($profiledata['user_viewemail'])
+ $website = (!empty($HTTP_POST_VARS['website'])) ? trim(strip_tags($HTTP_POST_VARS['website'])) : "";
+ $location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags($HTTP_POST_VARS['location'])) : "";
+ $occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : "";
+ $interests = (!empty($HTTP_POST_VARS['interests'])) ? trim($HTTP_POST_VARS['interests']) : "";
+ $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(str_replace("<br />", "\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;
+
+ $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;
+
+ $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'];
+ $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['default_timezone'];
+ $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
+ $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
+
+ $user_avatar_url = (!empty($HTTP_POST_VARS['avatarurl'])) ? $HTTP_POST_VARS['avatarurl'] : "";
+ $user_avatar_loc = ($HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : "";
+ $user_avatar_name = (!empty($HTTP_POST_FILES['avatar']['name'])) ? $HTTP_POST_FILES['avatar']['name'] : "";
+ $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;
+
+ $passwd_sql = "";
+ if($mode == "editprofile")
{
- // Replace the @ with 'at'. Some anti-spam mesures.
- $email_addy = str_replace("@", " at ", $profiledata['user_email']);
- $email = "<a href=\"mailto:$email_addy\">$email_addy</a>";
+ if($user_id != $userdata['user_id'])
+ {
+ $error = TRUE;
+ $error_msg = $lang['Wrong_Profile'];
+ }
}
- else
+ else if($mode == "register")
{
- $email = $l_hidden;
- }
- $template->assign_vars(array(
- "USERNAME" => stripslashes($profiledata['username']),
- "JOINED" => create_date($board_config['default_dateformat'], $profiledata['user_regdate'], $board_config['default_timezone']),
- "POSTS_PER_DAY" => $posts_per_day,
- "POSTS" => $profiledata['user_posts'],
- "PERCENTAGE" => $percentage . "%",
- "EMAIL" => $email,
- "ICQ" => stripslashes($profiledata['user_icq']),
- "AIM" => stripslashes($profiledata['user_aim']),
- "MSN" => stripslashes($profiledata['user_msnm']),
- "L_YAHOO" => stripslashes($l_yahoo),
- "YIM" => stripslashes($profiledata['user_yim']),
- "WEBSITE" => stripslashes($profiledata['user_website']),
- "LOCATION" => stripslashes($profiledata['user_from']),
- "OCCUPATION" => stripslashes($profiledata['user_occ']),
- "INTERESTS" => stripslashes($profiledata['user_interests']),
- "AVATAR_IMG" => $board_config['avatar_path'] . "/" . stripslashes($profiledata['user_avatar']),
-
- "L_VIEWING_PROFILE" => $l_viewing_profile,
- "L_USERNAME" => $lang['Username'],
- "L_VIEW_USERS_POSTS" => $l_view_users_posts,
- "L_JOINED" => $l_joined,
- "L_PER_DAY" => $l_per_day,
- "L_OF_TOTAL" => $l_of_total,
- "L_EMAIL_ADDRESS" => $l_emailaddress,
- "L_ICQ_NUMBER" => $l_icq_number,
- "L_AIM" => $l_aim,
- "L_WEBSITE" => $l_website,
- "L_MESSENGER" => $l_messenger,
- "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']),
-
- "S_PROFILE_ACTION" => append_sid("profile.$phpEx"))
- );
-
- $template->pparse("body");
- include('includes/page_tail.'.$phpEx);
- break;
+ $regdate = get_gmt_ts();
- case 'editprofile':
+ $coppa = (!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa']) ? 0 : 1;
- if(!$userdata['session_logged_in'])
- {
- header(append_sid("Location: login.$phpEx?forward_page=$PHP_SELF&mode=editprofile"));
+ if(empty($username) || empty($password) || empty($password_confirm) || empty($email))
+ {
+ $error = TRUE;
+ $error_msg = $lang['Fields_empty'];
+ }
}
- $pagetype = "register";
- $page_title = "$l_register";
//
- // Output page header and
- // profile_add template
- //
- include('includes/page_header.'.$phpEx);
- //
- // End header
+ // Do a ban check on this email address
//
+ $sql = "SELECT ban_email
+ FROM " . BANLIST_TABLE;
+ if(!$result = $db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain email ban information.", "", __LINE__, __FILE__, $sql);
+ }
+ $ban_email_list = $db->sql_fetchrowset($result);
+ for($i = 0; $i < count($ban_email_list); $i++)
+ {
+ if( eregi("^" . $ban_email_list[$i]['ban_email'] . "$", $email) )
+ {
+ $error = TRUE;
+ if(isset($error_msg))
+ {
+ $error_msg .= "<br />";
+ }
+ $error_msg .= $lang['Sorry_banned_email'];
+ }
+ }
- if(isset($HTTP_POST_VARS['submit']))
+ if(!empty($password) && !empty($password_confirm))
{
- $user_id = $HTTP_POST_VARS['user_id'];
- $username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : "";
- $email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
- $password = (!empty($HTTP_POST_VARS['password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : "";
- $password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
-
- $icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
- $aim = (!empty($HTTP_POST_VARS['aim'])) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : "";
- $msn = (!empty($HTTP_POST_VARS['msn'])) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : "";
- $yim = (!empty($HTTP_POST_VARS['yim'])) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : "";
-
- $website = (!empty($HTTP_POST_VARS['website'])) ? trim(strip_tags($HTTP_POST_VARS['website'])) : "";
- $location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags($HTTP_POST_VARS['location'])) : "";
- $occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : "";
- $interests = (!empty($HTTP_POST_VARS['interests'])) ? trim($HTTP_POST_VARS['interests']) : "";
- $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(str_replace("<br />", "\n", $HTTP_POST_VARS['signature'])) : "";
-
- $viewemail = $HTTP_POST_VARS['viewemail'];
- $notifypm = $HTTP_POST_VARS['notifypm'];
- $attachsig = $HTTP_POST_VARS['attachsig'];
- $allowhtml = $HTTP_POST_VARS['allowhtml'];
- $allowbbcode = $HTTP_POST_VARS['allowbbcode'];
- $allowsmilies = $HTTP_POST_VARS['allowsmilies'];
- $allowviewonline = ($HTTP_POST_VARS['allowviewonline']) ? 0 : 1;
-
- $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'];
- $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['default_timezone'];
- $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
- $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
-
- $user_avatar_url = (!empty($HTTP_POST_VARS['avatarurl'])) ? $HTTP_POST_VARS['avatarurl'] : "";
- $user_avatar_loc = ($HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : "";
- $user_avatar_name = (!empty($HTTP_POST_FILES['avatar']['name'])) ? $HTTP_POST_FILES['avatar']['name'] : "";
- $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)) ? $userdata['user_avatar'] : "";
-
- $error = FALSE;
-
- $passwd_sql = "";
- if($user_id != $userdata['user_id'])
+ // The user wants to change their password, isn't that cute..
+ if($password != $password_confirm)
{
$error = TRUE;
- $error_msg = $lang['Wrong_Profile'];
+ $error_msg = $lang['Password_mismatch'];
+ }
+ else
+ {
+ $password = md5($password);
+ $passwd_sql = "user_password = '$password', ";
}
+ }
+ else if($password && !$password_confirm)
+ {
+ $error = TRUE;
+ $error_msg = $lang['Password_mismatch'];
+ }
- if(!empty($password) && !empty($password_confirm))
+ if($board_config['allow_namechange'] || $mode == "register")
+ {
+ if($username != $userdata['username'] || $mode == "register")
{
- // The user wants to change their password, isn't that cute..
- if($password != $password_confirm)
+ if(!validate_username($username))
{
$error = TRUE;
- $error_msg = $l_mismatch . "<br />" . $l_tryagain;
+ if(isset($error_msg))
+ {
+ $error_msg .= "<br />";
+ }
+ $error_msg .= $lang['Invalid_username'];
}
else
{
- $password = md5($password);
- $passwd_sql = "user_password = '$password', ";
+ $username_sql = "username = '$username', ";
}
}
- else if($password && !$password_confirm)
+ }
+
+ if($mode == "register")
+ {
+ //
+ // The AUTO_INCREMENT field in MySQL v3.23 doesn't work
+ // correctly when there is a row with -1 in that field
+ // so we have to explicitly get the next user ID
+ //
+ $sql = "SELECT MAX(user_id) AS total
+ FROM ".USERS_TABLE;
+ if($result = $db->sql_query($sql))
{
- $error = TRUE;
- $error_msg = $l_mismatch . "<br />" . $l_tryagain;
- }
+ $user_id_row = $db->sql_fetchrow($result);
+ $new_user_id = $user_id_row['total'] + 1;
- if($board_config['allow_namechange'])
+ unset($result);
+ unset($user_id_row);
+ }
+ else
{
- if($username != $userdata['username'])
- {
- if(!validate_username($username))
- {
- $error = TRUE;
- if(isset($error_msg))
- {
- $error_msg .= "<br />";
- }
- $error_msg .= $l_invalidname;
- }
- else
- {
- $username_sql = "username = '$username', ";
- }
- }
+ message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
}
+ }
- if($board_config['allow_avatar_upload'] && !$error)
+ if($board_config['allow_avatar_upload'] && !$error)
+ {
+ //
+ // Only allow one type of upload, either a
+ // filename or a URL
+ //
+ if(!empty($user_avatar_loc) && !empty($user_avatar_url))
{
- //
- // Only allow one type of upload, either a
- // filename or a URL
- //
- if(!empty($user_avatar_loc) && !empty($user_avatar_url))
+ $error = TRUE;
+ if(isset($error_msg))
{
- $error = TRUE;
- if(isset($error_msg))
- {
- $error_msg .= "<br />";
- }
- $error_msg .= $lang['Only_one_avatar'];
+ $error_msg .= "<br />";
}
+ $error_msg .= $lang['Only_one_avatar'];
+ }
- if(isset($HTTP_POST_VARS['avatardel']))
+ if(isset($HTTP_POST_VARS['avatardel']) && $mode == "editprofile")
+ {
+ if(file_exists("./".$board_config['avatar_path']."/".$userdata['user_avatar']))
{
- if(file_exists("./".$board_config['avatar_path']."/".$userdata['user_avatar']))
- {
- @unlink("./".$board_config['avatar_path']."/".$userdata['user_avatar']);
- $avatar_sql = ", user_avatar = ''";
- }
+ @unlink("./".$board_config['avatar_path']."/".$userdata['user_avatar']);
+ $avatar_sql = ", user_avatar = ''";
}
- else if(!empty($user_avatar_loc))
+ }
+ else if(!empty($user_avatar_loc))
+ {
+ if($board_config['allow_avatar_upload'])
{
if(file_exists($user_avatar_loc) && ereg(".jpg$|.gif$|.png$", $user_avatar_name))
{
@@ -449,7 +536,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
break;
default:
$error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar filetype must be .jpg, .gif or .png" : "The avatar filetype must be .jpg, .gif or .png";
+ $error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
break;
}
@@ -460,11 +547,16 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if( $width <= $board_config['avatar_max_width'] &&
$height <= $board_config['avatar_max_height'] )
{
- $avatar_filename = $userdata['user_id'] . $imgtype;
+ $user_id = ($mode == "register") ? $new_user_id : $userdata['user_id'];
- if(file_exists("./" . $board_config['avatar_path'] . "/" . $userdata['user_id']))
+ $avatar_filename = $user_id . $imgtype;
+
+ if($mode == "editprofile")
{
- @unlink("./" . $board_config['avatar_path'] . "/" . $userdata['user_id']);
+ if(file_exists("./" . $board_config['avatar_path'] . "/" . $user_id))
+ {
+ @unlink("./" . $board_config['avatar_path'] . "/" . $user_id);
+ }
}
@copy($user_avatar_loc, "./" . $board_config['avatar_path'] . "/$avatar_filename");
$avatar_sql = ", user_avatar = '$avatar_filename'";
@@ -472,46 +564,43 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
else
{
$error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg . "<br>The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high" : "The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high";
+ $error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_imagesize'] : $lang['Avatar_imagesize'];
}
}
}
else
{
$error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar image file size must more than 0 kB and less than ".round($board_config['avatar_filesize']/1024)." kB" : "The avatar image file size must more than 0 kB and less than ".round($board_config['avatar_filesize']/1024)." kB";
+ $error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filesize'] : $lang['Avatar_filesize'];
}
}
else
{
$error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar filetype must be .jpg, .gif or .png" : "The avatar filetype must be .jpg, .gif or .png";
+ $error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
}
- }
- else if(!empty($user_avatar_url))
+ } // if ... allow_avatar_upload
+ }
+ else if(!empty($user_avatar_url))
+ {
+ if($board_config['allow_avatar_upload'])
{
//
// First check what port we should connect
// to, look for a :[xxxx]/ or, if that doesn't
- // exist see whether we're http:// or ftp://
- // if neither of these then assume its http://
+ // exist assume port 80 (http)
//
preg_match("/^(http:\/\/)?([^\/]+?)\:?([0-9]*)\/(.*)$/", $user_avatar_url, $url_ary);
- if(!empty($url_ary[3]))
- {
- $port = $url_ary[3];
- }
- else
- {
- $port = 80;
- }
if(!empty($url_ary[4]))
{
+ $port = (!empty($url_ary[3])) ? $url_ary[3] : 80;
+
$fsock = fsockopen($url_ary[2], $port, $errno, $errstr);
if($fsock)
{
$base_get = "http://" . $url_ary[2] . "/" . $url_ary[4];
+
//
// Uses HTTP 1.1, could use HTTP 1.0 ...
//
@@ -544,10 +633,10 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
break;
default:
$error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg . "<br>The avatar filetype must be .jpg, .gif or .png" : "The avatar filetype must be .jpg, .gif or .png";
+ $error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];
break;
}
-
+
if(!$error && $file_size > 0 && $file_size < $board_config['avatar_filesize'])
{
$avatar_data = substr($avatar_data, strlen($avatar_data) - $file_size, $file_size);
@@ -563,14 +652,19 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
{
- $avatar_filename = $userdata['user_id'] . $imgtype;
+ $user_id = ($mode == "register") ? $new_user_id : $userdata['user_id'];
- if(file_exists("./" . $board_config['avatar_path'] . "/" . $userdata['user_avatar']))
+ $avatar_filename = $user_id . $imgtype;
+
+ if($mode == "editprofile")
{
- @unlink("./" . $board_config['avatar_path'] . "/" . $userdata['user_avatar']);
+ if(file_exists("./" . $board_config['avatar_path'] . "/" . $user_id))
+ {
+ @unlink("./" . $board_config['avatar_path'] . "/" . $user_id);
+ }
}
copy($tmp_filename, "./" . $board_config['avatar_path'] . "/$avatar_filename");
- $avatar_sql = ", user_avatar = '$avatar_filename'";
+ $avatar_sql = ", user_avatar = '$avatar_filename'";
@unlink($tmp_filename);
}
else
@@ -580,7 +674,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
//
@unlink($tmp_filename);
$error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar image file size must more than 0 kB and less than ".round($board_config['avatar_filesize']/1024)." kB" : "The avatar image file size must more than 0 kB and less than ".round($board_config['avatar_filesize']/1024)." kB";
+ $error_msg = (!empty($error_msg)) ? $error_msg . "<br>" . $lang['Avatar_imagesize'] : $lang['Avatar_imagesize'];
}
}
else
@@ -617,424 +711,45 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$error = true;
$error_msg = (!empty($error_msg)) ? $error_msg . "<br>The URL you entered is incomplete" : "The URL you entered is incomplete";
}
- }
+ } // if ... allow_avatar_upload
}
+ }
- if(!$error)
+ if(!$error)
+ {
+ if($mode == "editprofile")
{
-
- $sql = "UPDATE ".USERS_TABLE."
- SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_template = '$user_template', user_theme = $user_theme".$avatar_sql."
+ $sql = "UPDATE " . USERS_TABLE . "
+ SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_template = '$user_template', user_theme = $user_theme" . $avatar_sql . "
WHERE user_id = $user_id";
if($result = $db->sql_query($sql))
{
- $msg = $l_infoupdated;
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl"
- ));
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $msg
- ));
- $template->pparse("reg_header");
-
- include('includes/page_tail.'.$phpEx);
+ message_die(GENERAL_MESSAGE, $lang['Profile_updated']);
}
else
{
- if(DEBUG)
- {
- $error = $db->sql_error();
- $error_msg = "Could not update the users table.<br>Reason: ".$error['message']."<br>Query: $sql";
- }
- else
- {
- $error_msg = $l_dberror;
- }
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl"
- ));
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $error_msg
- ));
- $template->pparse("reg_header");
+ message_die(GENERAL_ERROR, "Could not update users table", "", __LINE__, __FILE__, $sql);
}
}
else
{
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl"
- ));
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $error_msg
- ));
- $template->pparse("reg_header");
- }
- }
- else
- {
- $user_id = $userdata['user_id'];
- $username = $userdata['username'];
- $email = $userdata['user_email'];
- $password = "";
- $password_confirm = "";
-
- $icq = $userdata['user_icq'];
- $aim = $userdata['user_aim'];
- $msn = $userdata['user_msnm'];
- $yim = $userdata['user_yim'];
-
- $website = $userdata['user_website'];
- $location = $userdata['user_from'];
- $occupation = $userdata['user_occ'];
- $interests = $userdata['user_interests'];
- $signature = $userdata['user_sig'];
-
- $viewemail = $userdata['user_viewemail'];
- $notifypm = $userdata['user_notify_pm'];
- $attachsig = $userdata['user_attachsig'];
- $allowhtml = $userdata['user_allowhtml'];
- $allowbbcode = $userdata['user_allowbbcode'];
- $allowsmilies = $userdata['user_allowsmile'];
- $allowviewonline = $userdata['user_allow_viewonline'];
-
- $user_avatar = $userdata['user_avatar'];
- $user_theme = $userdata['user_theme'];
- $user_lang = $userdata['user_lang'];
- $user_timezone = $userdata['user_timezone'];
- $user_template = $userdata['user_template'];
- $user_dateformat = $userdata['user_dateformat'];
- }
-
- $s_hidden_fields = '<input type="hidden" name="user_id" value="' . $userdata['user_id'] . '"><input type="hidden" name="mode" value="' . $mode . '"><input type="hidden" name="agreed" value="true"><input type="hidden" name="coppa" value="0">';
-
- $template->set_filenames(array(
- "body" => "profile_add_body.tpl",
- "jumpbox" => "jumpbox.tpl")
- );
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- "JUMPBOX_LIST" => $jumpbox,
- "SELECT_NAME" => POST_FORUM_URL)
- );
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
- $template->assign_vars(array(
- "USERNAME" => stripslashes($username),
- "EMAIL" => stripslashes($email),
- "YIM" => stripslashes($yim),
- "ICQ" => stripslashes($icq),
- "MSN" => stripslashes($msn),
- "AIM" => stripslashes($aim),
- "OCCUPATION" => stripslashes($occupation),
- "INTERESTS" => stripslashes($interests),
- "LOCATION" => stripslashes($location),
- "WEBSITE" => stripslashes($website),
- "SIGNATURE" => stripslashes(str_replace("<br />", "\n", $signature)),
- "VIEW_EMAIL_YES" => ($viewemail) ? "CHECKED" : "",
- "VIEW_EMAIL_NO" => (!$viewemail) ? "CHECKED" : "",
- "HIDE_USER_YES" => (!$allowviewonline) ? "CHECKED" : "",
- "HIDE_USER_NO" => ($allowviewonline) ? "CHECKED" : "",
- "NOTIFY_PM_YES" => ($notifypm) ? "CHECKED" : "",
- "NOTIFY_PM_NO" => (!$notifypm) ? "CHECKED" : "",
- "ALWAYS_ADD_SIGNATURE_YES" => ($attachsig) ? "CHECKED" : "",
- "ALWAYS_ADD_SIGNATURE_NO" => (!$attachsig) ? "CHECKED" : "",
- "ALWAYS_ALLOW_BBCODE_YES" => ($allowbbcode) ? "CHECKED" : "",
- "ALWAYS_ALLOW_BBCODE_NO" => (!$allowbbcode) ? "CHECKED" : "",
- "ALWAYS_ALLOW_HTML_YES" => ($allowhtml) ? "CHECKED" : "",
- "ALWAYS_ALLOW_HTML_NO" => (!$allowhtml) ? "CHECKED" : "",
- "ALWAYS_ALLOW_SMILIES_YES" => ($allowsmilies) ? "CHECKED" : "",
- "ALWAYS_ALLOW_SMILIES_NO" => (!$allowsmilies) ? "CHECKED" : "",
- "ALLOW_AVATAR" => $board_config['allow_avatar_upload'],
- "AVATAR" => ($user_avatar != "") ? "<img src=\"".$board_config['avatar_path']."/$user_avatar\">" : "",
- "AVATAR_SIZE" => $board_config['avatar_filesize'],
- "LANGUAGE_SELECT" => language_select($user_lang),
- "THEME_SELECT" => theme_select($user_theme),
- "TIMEZONE_SELECT" => tz_select($user_timezone),
- "DATE_FORMAT" => stripslashes($user_dateformat),
- "TEMPLATE_SELECT" => template_select($user_template),
-
- "L_PASSWORD_IF_CHANGED" => $l_password_if_changed,
- "L_PASSWORD_CONFIRM_IF_CHANGED" => $l_password_confirm_if_changed,
- "L_SUBMIT" => $l_submit,
- "L_ICQ_NUMBER" => $l_icq_number,
- "L_MESSENGER" => $l_messenger,
- "L_YAHOO" => $l_yahoo,
- "L_WEBSITE" => $l_website,
- "L_AIM" => $l_aim,
- "L_LOCATION" => $l_from,
- "L_OCCUPATION" => $l_occupation,
- "L_BOARD_LANGUAGE" => $l_boardlang,
- "L_BOARD_THEME" => $l_boardtheme,
- "L_BOARD_TEMPLATE" => $l_boardtemplate,
- "L_TIMEZONE" => $l_timezone,
- "L_DATE_FORMAT" => $l_date_format,
- "L_DATE_FORMAT_EXPLANATION" => $l_date_format_explanation,
- "L_YES" => $l_yes,
- "L_NO" => $l_no,
- "L_INTERESTS" => $l_interests,
- "L_USER_UNIQUE" => $l_useruniq,
- "L_ALWAYS_ALLOW_SMILIES" => $l_alwayssmile,
- "L_ALWAYS_ALLOW_BBCODE" => $l_alwaysbbcode,
- "L_ALWAYS_ALLOW_HTML" => $l_alwayshtml,
- "L_HIDE_USER" => $lang['Hide_user'],
- "L_ALWAYS_ADD_SIGNATURE" => $l_alwayssig,
- "L_AVATAR" => $lang['Avatar'],
- "L_AVATAR_EXPLAIN" => $lang['Avatar_explain'],
- "L_UPLOAD_AVATAR" => $lang['Upload_Avatar'],
- "L_AVATAR_URL" => $lang['Avatar_URL'],
- "L_AVATAR_GALLERY" => $lang['Avatar_gallery'],
- "L_DELETE_AVATAR" => $lang['Delete_Image'],
- "L_CURRENT_IMAGE" => $lang['Current_Image'],
- "L_SIGNATURE" => $l_signature,
- "L_SIGNATURE_EXPLAIN" => $l_sigexplain,
- "L_NOTIFY_ON_PRIVMSG" => $lang['Notify_on_privmsg'],
- "L_PREFERENCES" => $l_preferences,
- "L_PUBLIC_VIEW_EMAIL" => $l_publicmail,
- "L_ITEMS_REQUIRED" => $l_itemsreq,
- "L_REGISTRATION_INFO" => $l_reginfo,
- "L_PROFILE_INFO" => $l_profile_info,
- "L_PROFILE_INFO_NOTICE" => $l_profile_info_notice,
- "L_CONFIRM" => $l_confirm,
- "L_EMAIL_ADDRESS" => $l_emailaddress,
-
- "S_HIDDEN_FIELDS" => $s_hidden_fields,
- "S_PROFILE_ACTION" => append_sid("profile.$phpEx"))
- );
-
- $template->pparse("body");
- include('includes/page_tail.'.$phpEx);
-
- break;
-
- case 'register':
-
- $username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : "";
- $email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
- $password = (!empty($HTTP_POST_VARS['password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : "";
- $password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
-
- $icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
- $aim = (!empty($HTTP_POST_VARS['aim'])) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : "";
- $msn = (!empty($HTTP_POST_VARS['msn'])) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : "";
- $yim = (!empty($HTTP_POST_VARS['yim'])) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : "";
-
- $website = (!empty($HTTP_POST_VARS['website'])) ? trim(strip_tags($HTTP_POST_VARS['website'])) : "";
- $location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags($HTTP_POST_VARS['location'])) : "";
- $occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : "";
- $interests = (!empty($HTTP_POST_VARS['interests'])) ? trim($HTTP_POST_VARS['interests']) : "";
- $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim($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;
- $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'] : 1;
-
- $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'];
- $user_timezone = str_replace("+", "", (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['default_timezone']);
- $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
- $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
-
- $user_avatar_loc = ($HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : "";
- $user_avatar_name = (!empty($HTTP_POST_FILES['avatar']['name'])) ? $HTTP_POST_FILES['avatar']['name'] : "";
- $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'] : "";
-
- if(!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa'])
- {
- $coppa = 0;
- }
- else
- {
- $coppa = 1;
- }
-
- list($hr, $min, $sec, $mon, $day, $year) = explode(",", gmdate("H,i,s,m,d,Y", time()));
- $regdate = gmmktime($hr, $min, $sec, $mon, $day, $year);
-
- $pagetype = "register";
- $page_title = "$l_register";
- include('includes/page_header.'.$phpEx);
-
- if(!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']))
- {
- //
- // Load agreement template
- // since user has not yet
- // agreed to registration
- // conditions/coppa
- //
- $template->set_filenames(array(
- "body" => "agreement.tpl",
- "jumpbox" => "jumpbox.tpl")
- );
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- "JUMPBOX_LIST" => $jumpbox,
- "SELECT_NAME" => POST_FORUM_URL)
- );
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
- $template->assign_vars(array(
- "COPPA" => $coppa,
-
- "U_AGREE_OVER13" => append_sid("profile.$phpEx?mode=register&agreed=true"),
- "U_AGREE_UNDER13" => append_sid("profile.$phpEx?mode=register&agreed=true&coppa=true"))
- );
- $template->pparse("body");
-
- include('includes/page_tail.'.$phpEx);
- }
- else
- {
- if(isset($HTTP_POST_VARS['submit']))
- {
- $error = FALSE;
- if(empty($username) || empty($password) || empty($password_confirm) || empty($email))
- {
- $error = TRUE;
- $error_msg = $l_notfilledin;
- }
- if(!validate_username($username))
- {
- $error = TRUE;
- if(isset($error_msg))
- {
- $error_msg .= "<br />";
- }
- $error_msg .= $l_invalidname;
- }
- if($password != $password_confirm)
+ if(SQL_LAYER != "mssql")
{
- $error = TRUE;
- if(isset($error_msg))
- {
- $error_msg .= "<br />";
- }
- $error_msg .= $l_mismatch;
+ $user_id_sql = "user_id,";
+ $user_id_value = $new_user_id . ", ";
}
-
- //
- // Do a ban check on this email address
- //
- $sql = "SELECT ban_email
- FROM " . BANLIST_TABLE;
- if(!$result = $db->sql_query($sql))
+ else
{
- error_die(QUERY_ERROR, "Couldn't obtain email ban list information.", __LINE__, __FILE__);
+ $user_id_sql = "";
+ $user_id_value = "";
}
- $ban_email_list = $db->sql_fetchrowset($result);
- for($i = 0; $i < count($ban_email_list); $i++)
- {
- if( eregi("^".$ban_email_list[$i]['ban_email']."$", $email) )
- {
- $error = TRUE;
- if(isset($error_msg))
- {
- $error_msg .= "<br />";
- }
- $error_msg .= $lang['Sorry_banned_email'];
- }
- }
- }
- //
- // The AUTO_INCREMENT field in MySQL v3.23 doesn't work
- // correctly when there is a row with -1 in that field
- // so we have to explicitly get the next user ID.
- //
- $sql = "SELECT MAX(user_id) AS total
- FROM ".USERS_TABLE;
- if($result = $db->sql_query($sql))
- {
- $user_id_row = $db->sql_fetchrow($result);
- $new_user_id = $user_id_row['total'] + 1;
- unset($result);
- unset($user_id_row);
- }
- else
- {
- error_die(SQL_QUERY, "Couldn't obtained next user_id information.", __LINE__, __FILE__);
- }
+ $sql = "INSERT INTO " . USERS_TABLE . " (" . $user_id_sql . "username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify_pm, user_timezone, user_dateformat, user_lang, user_template, user_theme, user_level, user_allow_pm, user_active, user_actkey)
+ VALUES (" . $user_id_value . "'$username', $regdate, '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', '$user_template', $user_theme, 0, 1, ";
- $avatar_filename = "";
- if($board_config['allow_avatar_upload'] && !$error)
- {
- if(!empty($user_avatar_loc))
- {
- if(file_exists($user_avatar_loc) && ereg(".jpg$|.gif$|.png$", $user_avatar_name))
- {
- if($user_avatar_size <= $board_config['avatar_filesize'] && $avatar_size > 0)
- {
- $error_type = false;
- switch($user_avatar_type)
- {
- case "image/pjpeg":
- $imgtype = '.jpg';
- break;
- case "image/gif":
- $imgtype = '.gif';
- break;
- case "image/png":
- $imgtype = '.png';
- break;
- default:
- $error_type = true;
- break;
- }
-
- if(!$error_type)
- {
- list($width, $height) = getimagesize($user_avatar_loc);
-
- if( $width <= $board_config['avatar_max_width'] &&
- $height <= $board_config['avatar_max_height'] )
- {
- $avatar_filename = $new_user_id . $imgtype;
-
- if(file_exists("./" . $board_config['avatar_path'] . "/" . $new_user_id))
- {
- @unlink("./" . $board_config['avatar_path'] . "/" . $new_user_id);
- }
- @copy($user_avatar_loc, "./" . $board_config['avatar_path'] . "/$avatar_filename");
- $avatar_sql = ", user_avatar = '$avatar_filename'";
- }
- else
- {
- $error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg . "<br>The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high" : "The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high";
- }
- }
- else
- {
- $error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar filetype must be .jpg, .gif or .png" : "The avatar filetype must be .jpg, .gif or .png";
- }
- }
- else
- {
- $error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar image file size must more than 0 kB and less than ".round($board_config['avatar_filesize']/1024)." kB" : "The avatar image file size must more than 0 kB and less than ".round($board_config['avatar_filesize']/1024)." kB";
- }
- }
- else
- {
- $error = true;
- $error_msg = (!empty($error_msg)) ? $error_msg."<br>The avatar filetype must be .jpg, .gif or .png" : "The avatar filetype must be .jpg, .gif or .png";
- }
- }
- }
-
- if(isset($HTTP_POST_VARS['submit']) && !$error)
- {
-
- $md_pass = md5($password);
- $sql = "INSERT INTO ".USERS_TABLE." (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify_pm, user_timezone, user_dateformat, user_lang, user_template, user_theme, user_level, user_active, user_actkey)
- VALUES ($new_user_id, '$username', '$regdate', '$md_pass', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$avatar_filename', '$viewemail', '$aim', '$yim', '$msn', $attachsig, $allowsmilies, '$allowhtml', $allowbbcode, $allowviewonline, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', '$user_template', $user_theme, 0, ";
- if($require_activation || $coppa == 1)
+ if($board_config['require_activation'] || $coppa == 1)
{
$act_key = generate_activation_key();
$sql .= "0, '$act_key')";
@@ -1044,211 +759,242 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$sql .= "1, '')";
}
- if($result = $db->sql_query($sql))
+ if($result = $db->sql_query($sql, BEGIN_TRANSACTION))
{
- $sql = "INSERT INTO ".GROUPS_TABLE."
- (group_name, group_description, group_single_user)
- VALUES
- ('$username', 'Personal User', 1)";
+ $sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
+ VALUES ('$username', 'Personal User', 1, 0)";
if($result = $db->sql_query($sql))
{
$group_id = $db->sql_nextid();
- $sql = "INSERT INTO ".USER_GROUP_TABLE."
- (user_id, group_id)
- VALUES
- ($new_user_id, $group_id)";
- if($result = $db->sql_query($sql))
+ $sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
+ VALUES ($new_user_id, $group_id, 0)";
+ if($result = $db->sql_query($sql, END_TRANSACTION))
{
- if($require_activation)
+ if($board_config['require_activation'])
{
- $msg = $l_accountinactive;
- $email_msg = $l_welcomeemailactivate;
+ $msg = $lang['Account_inactive'];
+ $email_msg = $lang['Welcome_email_activate'];
}
else if($coppa)
{
- $msg = $l_coppa;
- $email_msg = $l_welcomecoppa;
+ $msg = $lang['COPPA'];
+ $email_msg = $lang['Welcome_COPPA'];
}
else
{
- $msg = $l_acountadded;
- $email_msg = $l_welcomemail;
+ $msg = $lang['Account_added']; //$l_acountadded;
+ $email_msg = $lang['Welcome_email']; //$l_welcomemail;
}
if(!$coppa)
{
$email_msg .= "\r\n" . $board_config['board_email'];
- mail($email, $l_welcomesubj, $email_msg, "From: ".$board_config['board_email_from']."\r\n");
+ $email_headers = "From: " . $board_config['board_email_from'] . "\r\n";
+
+ if($board_config['smtp_delivery'] && $board_config['smtp_host'] != "")
+ {
+ include('includes/smtp.'.$phpEx);
+ smtpmail($email, $lang['Welcome_subject'], $email_msg, $email_headers);
+ }
+ else
+ {
+ mail($email, $lang['Welcome_subject'], $email_msg, $email_headers);
+ }
}
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl"
- ));
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $msg
- ));
- $template->pparse("reg_header");
-
- include('includes/page_tail.'.$phpEx);
+ message_die(GENERAL_MESSAGE, $msg);
}
else
{
- $error = TRUE;
- $err = $db->sql_error();
- $error_msg = "Query Error: ".$err["message"];
- if(DEBUG)
- {
- $error_msg .= "<br>Query: $sql";
- }
+ message_die(GENERAL_ERROR, "Couldn't insert data into user_group table", "", __LINE__, __FILE__, $sql);
}
}
else
{
- $error = TRUE;
- $err = $db->sql_error();
- $error_msg = "Query Error: ".$err["message"];
- if(DEBUG)
- {
- $error_msg .= "<br>Query: $sql";
- }
+ message_die(GENERAL_ERROR, "Couldn't insert data into groups table", "", __LINE__, __FILE__, $sql);
}
}
else
{
- $error = TRUE;
- $err = $db->sql_error();
- $error_msg = "Query Error: ".$err["message"];
- if(DEBUG)
- {
- $error_msg .= "<br>Query: $sql";
- }
+ message_die(GENERAL_ERROR, "Couldn't insert data into users table", "", __LINE__, __FILE__, $sql);
}
- }
-
- if($error)
- {
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl"
- ));
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $error_msg
- ));
- $template->pparse("reg_header");
- }
- if(!isset($coppa))
- {
- $coppa = FALSE;
- }
-
- if(!isset($user_template))
- {
- $selected_template = $board_config['default_template'];
- }
-
- $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '"><input type="hidden" name="agreed" value="true"><input type="hidden" name="coppa" value="' . $coppa . '">';
-
- //
- // Load profile_add template
- // to allow user to insert
- // new user reg details
- //
+ } // if mode == register
+ }
+ else
+ {
$template->set_filenames(array(
- "body" => "profile_add_body.tpl",
- "jumpbox" => "jumpbox.tpl")
+ "reg_header" => "error_body.tpl")
);
- $jumpbox = make_jumpbox();
$template->assign_vars(array(
- "JUMPBOX_LIST" => $jumpbox,
- "SELECT_NAME" => POST_FORUM_URL)
+ "ERROR_MESSAGE" => $error_msg)
);
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
- $template->assign_vars(array(
- "USERNAME" => stripslashes($username),
- "EMAIL" => stripslashes($email),
- "YIM" => stripslashes($yim),
- "ICQ" => stripslashes($icq),
- "MSN" => stripslashes($msn),
- "AIM" => stripslashes($aim),
- "OCCUPATION" => stripslashes($occupation),
- "INTERESTS" => stripslashes($interests),
- "LOCATION" => stripslashes($location),
- "WEBSITE" => stripslashes($website),
- "SIGNATURE" => stripslashes($signature),
- "VIEW_EMAIL_YES" => ($viewemail) ? "CHECKED" : "",
- "VIEW_EMAIL_NO" => (!$viewemail) ? "CHECKED" : "",
- "HIDE_USER_YES" => (!$allowviewonline) ? "CHECKED" : "",
- "HIDE_USER_NO" => ($allowviewonline) ? "CHECKED" : "",
- "NOTIFY_PM_YES" => ($notifypm) ? "CHECKED" : "",
- "NOTIFY_PM_NO" => (!$notifypm) ? "CHECKED" : "",
- "ALWAYS_ADD_SIGNATURE_YES" => ($attachsig) ? "CHECKED" : "",
- "ALWAYS_ADD_SIGNATURE_NO" => (!$attachsig) ? "CHECKED" : "",
- "ALWAYS_ALLOW_BBCODE_YES" => ($allowbbcode) ? "CHECKED" : "",
- "ALWAYS_ALLOW_BBCODE_NO" => (!$allowbbcode) ? "CHECKED" : "",
- "ALWAYS_ALLOW_HTML_YES" => ($allowhtml) ? "CHECKED" : "",
- "ALWAYS_ALLOW_HTML_NO" => (!$allowhtml) ? "CHECKED" : "",
- "ALWAYS_ALLOW_SMILIES_YES" => ($allowsmilies) ? "CHECKED" : "",
- "ALWAYS_ALLOW_SMILIES_NO" => (!$allowsmilies) ? "CHECKED" : "",
- "ALLOW_AVATAR" => $board_config['allow_avatar_upload'],
- "LANGUAGE_SELECT" => language_select($user_lang),
- "THEME_SELECT" => theme_select($user_theme),
- "TIMEZONE_SELECT" => tz_select($user_timezone),
- "DATE_FORMAT" => stripslashes($user_dateformat),
- "TEMPLATE_SELECT" => template_select($user_template),
-
- "L_SUBMIT" => $l_submit,
- "L_ICQ_NUMBER" => $l_icq_number,
- "L_MESSENGER" => $l_messenger,
- "L_YAHOO" => $l_yahoo,
- "L_WEBSITE" => $l_website,
- "L_AIM" => $l_aim,
- "L_LOCATION" => $l_from,
- "L_OCCUPATION" => $l_occupation,
- "L_BOARD_LANGUAGE" => $l_boardlang,
- "L_BOARD_THEME" => $l_boardtheme,
- "L_BOARD_TEMPLATE" => $l_boardtemplate,
- "L_TIMEZONE" => $l_timezone,
- "L_DATE_FORMAT" => $l_date_format,
- "L_DATE_FORMAT_EXPLANATION" => $l_date_format_explanation,
- "L_YES" => $l_yes,
- "L_NO" => $l_no,
- "L_INTERESTS" => $l_interests,
- "L_USER_UNIQUE" => $l_useruniq,
- "L_ALWAYS_ALLOW_SMILIES" => $l_alwayssmile,
- "L_ALWAYS_ALLOW_BBCODE" => $l_alwaysbbcode,
- "L_ALWAYS_ALLOW_HTML" => $l_alwayshtml,
- "L_HIDE_USER" => $lang['Hide_user'],
- "L_ALWAYS_ADD_SIGNATURE" => $l_alwayssig,
- "L_AVATAR_EXPLAIN" => $lang['Avatar_explain'],
- "L_UPLOAD_AVATAR" => $lang['Upload_Avatar'],
- "L_AVATAR_URL" => $lang['Avatar_URL'],
- "L_AVATAR_GALLERY" => $lang['Avatar_gallery'],
- "L_DELETE_AVATAR" => $lang['Delete_Image'],
- "L_CURRENT_IMAGE" => $lang['Current_Image'],
- "L_SIGNATURE" => $l_signature,
- "L_SIGNATURE_EXPLAIN" => $l_sigexplain,
- "L_NOTIFY_ON_PRIVMSG" => $lang['Notify_on_privmsg'],
- "L_PREFERENCES" => $l_preferences,
- "L_PUBLIC_VIEW_EMAIL" => $l_publicmail,
- "L_ITEMS_REQUIRED" => $l_itemsreq,
- "L_REGISTRATION_INFO" => $l_reginfo,
- "L_PROFILE_INFO" => $l_profile_info,
- "L_PROFILE_INFO_NOTICE" => $l_profile_info_notice,
- "L_CONFIRM" => $l_confirm,
- "L_EMAIL_ADDRESS" => $l_emailaddress,
-
- "S_HIDDEN_FIELDS" => $s_hidden_fields,
- "S_PROFILE_ACTION" => append_sid("profile.$phpEx"))
- );
-
- $template->pparse("body");
- include('includes/page_tail.'.$phpEx);
+ $template->pparse("reg_header");
}
- break;
- case 'activate':
+ }
+ else if($mode == "editprofile")
+ {
+ $user_id = $userdata['user_id'];
+ $username = stripslashes($userdata['username']);
+ $email = $userdata['user_email'];
+ $password = "";
+ $password_confirm = "";
+
+ $icq = $userdata['user_icq'];
+ $aim = stripslashes($$userdata['user_aim']);
+ $msn = stripslashes($$userdata['user_msnm']);
+ $yim = stripslashes($$userdata['user_yim']);
+
+ $website = stripslashes($$userdata['user_website']);
+ $location = stripslashes($$userdata['user_from']);
+ $occupation = stripslashes($$userdata['user_occ']);
+ $interests = stripslashes($$userdata['user_interests']);
+ $signature = stripslashes($userdata['user_sig']);
+
+ $viewemail = $userdata['user_viewemail'];
+ $notifypm = $userdata['user_notify_pm'];
+ $attachsig = $userdata['user_attachsig'];
+ $allowhtml = $userdata['user_allowhtml'];
+ $allowbbcode = $userdata['user_allowbbcode'];
+ $allowsmilies = $userdata['user_allowsmile'];
+ $allowviewonline = $userdata['user_allow_viewonline'];
+
+ $user_avatar = $userdata['user_avatar'];
+ $user_theme = $userdata['user_theme'];
+ $user_lang = $userdata['user_lang'];
+ $user_timezone = $userdata['user_timezone'];
+ $user_template = $userdata['user_template'];
+ $user_dateformat = $userdata['user_dateformat'];
+ }
- $sql = "SELECT user_id
+ if(!isset($coppa))
+ {
+ $coppa = FALSE;
+ }
+
+ if(!isset($user_template))
+ {
+ $selected_template = $board_config['default_template'];
+ }
+
+ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '"><input type="hidden" name="agreed" value="true"><input type="hidden" name="coppa" value="' . $coppa . '">';
+ if($mode == "editprofile")
+ {
+ $s_hidden_fields .= '<input type="hidden" name="user_id" value="' . $userdata['user_id'] . '">';
+ }
+
+ $template->set_filenames(array(
+ "body" => "profile_add_body.tpl",
+ "jumpbox" => "jumpbox.tpl")
+ );
+
+ $jumpbox = make_jumpbox();
+ $template->assign_vars(array(
+ "JUMPBOX_LIST" => $jumpbox,
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
+ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+
+ $template->assign_vars(array(
+ "USERNAME" => stripslashes($username),
+ "EMAIL" => stripslashes($email),
+ "YIM" => stripslashes($yim),
+ "ICQ" => stripslashes($icq),
+ "MSN" => stripslashes($msn),
+ "AIM" => stripslashes($aim),
+ "OCCUPATION" => stripslashes($occupation),
+ "INTERESTS" => stripslashes($interests),
+ "LOCATION" => stripslashes($location),
+ "WEBSITE" => stripslashes($website),
+ "SIGNATURE" => stripslashes(str_replace("<br />", "\n", $signature)),
+ "VIEW_EMAIL_YES" => ($viewemail) ? "CHECKED" : "",
+ "VIEW_EMAIL_NO" => (!$viewemail) ? "CHECKED" : "",
+ "HIDE_USER_YES" => (!$allowviewonline) ? "CHECKED" : "",
+ "HIDE_USER_NO" => ($allowviewonline) ? "CHECKED" : "",
+ "NOTIFY_PM_YES" => ($notifypm) ? "CHECKED" : "",
+ "NOTIFY_PM_NO" => (!$notifypm) ? "CHECKED" : "",
+ "ALWAYS_ADD_SIGNATURE_YES" => ($attachsig) ? "CHECKED" : "",
+ "ALWAYS_ADD_SIGNATURE_NO" => (!$attachsig) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_BBCODE_YES" => ($allowbbcode) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_BBCODE_NO" => (!$allowbbcode) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_HTML_YES" => ($allowhtml) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_HTML_NO" => (!$allowhtml) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_SMILIES_YES" => ($allowsmilies) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_SMILIES_NO" => (!$allowsmilies) ? "CHECKED" : "",
+ "ALLOW_AVATAR" => $board_config['allow_avatar_upload'],
+ "AVATAR" => ($user_avatar != "") ? "<img src=\"".$board_config['avatar_path']."/$user_avatar\">" : "",
+ "AVATAR_SIZE" => $board_config['avatar_filesize'],
+ "LANGUAGE_SELECT" => language_select($user_lang),
+ "THEME_SELECT" => theme_select($user_theme),
+ "TIMEZONE_SELECT" => tz_select($user_timezone),
+ "DATE_FORMAT" => stripslashes($user_dateformat),
+ "TEMPLATE_SELECT" => template_select($user_template),
+
+ "L_PASSWORD_IF_CHANGED" => ($mode == "editprofile") ? $l_password_if_changed : "",
+ "L_PASSWORD_CONFIRM_IF_CHANGED" => ($mode == "editprofile") ? $l_password_confirm_if_changed : "",
+ "L_SUBMIT" => $lang['Submit'],
+ "L_RESET" => $lang['Reset'],
+ "L_ICQ_NUMBER" => $l_icq_number,
+ "L_MESSENGER" => $l_messenger,
+ "L_YAHOO" => $l_yahoo,
+ "L_WEBSITE" => $l_website,
+ "L_AIM" => $l_aim,
+ "L_LOCATION" => $l_from,
+ "L_OCCUPATION" => $l_occupation,
+ "L_BOARD_LANGUAGE" => $l_boardlang,
+ "L_BOARD_THEME" => $l_boardtheme,
+ "L_BOARD_TEMPLATE" => $l_boardtemplate,
+ "L_TIMEZONE" => $l_timezone,
+ "L_DATE_FORMAT" => $l_date_format,
+ "L_DATE_FORMAT_EXPLANATION" => $l_date_format_explanation,
+ "L_YES" => $lang['Yes'],
+ "L_NO" => $lang['No'],
+ "L_INTERESTS" => $l_interests,
+ "L_USER_UNIQUE" => $l_useruniq,
+ "L_ALWAYS_ALLOW_SMILIES" => $lang['Always_smile'],
+ "L_ALWAYS_ALLOW_BBCODE" => $lang['Always_bbcode'],
+ "L_ALWAYS_ALLOW_HTML" => $lang['Always_html'],
+ "L_HIDE_USER" => $lang['Hide_user'],
+ "L_ALWAYS_ADD_SIGNATURE" => $lang['Always_add_sig'],
+
+ "L_AVATAR_PANEL" => $lang['Avatar_panel'],
+ "L_AVATAR_EXPLAIN" => $lang['Avatar_explain'],
+ "L_UPLOAD_AVATAR_FILE" => $lang['Upload_Avatar_file'],
+ "L_UPLOAD_AVATAR_URL" => $lang['Upload_Avatar_URL'],
+ "L_UPLOAD_AVATAR_URL_EXPLAIN" => $lang['Upload_Avatar_URL_explain'],
+ "L_AVATAR_GALLERY" => $lang['Avatar_gallery'],
+ "L_LINK_REMOTE_AVATAR" => $lang['Link_remote_Avatar'],
+ "L_LINK_REMOTE_AVATAR_EXPLAIN" => $lang['Link_remote_Avatar_explain'],
+ "L_DELETE_AVATAR" => $lang['Delete_Image'],
+ "L_CURRENT_IMAGE" => $lang['Current_Image'],
+
+ "L_SIGNATURE" => $l_signature,
+ "L_SIGNATURE_EXPLAIN" => $l_sigexplain,
+ "L_NOTIFY_ON_PRIVMSG" => $lang['Notify_on_privmsg'],
+ "L_PREFERENCES" => $l_preferences,
+ "L_PUBLIC_VIEW_EMAIL" => $l_publicmail,
+ "L_ITEMS_REQUIRED" => $l_itemsreq,
+ "L_REGISTRATION_INFO" => $l_reginfo,
+ "L_PROFILE_INFO" => $l_profile_info,
+ "L_PROFILE_INFO_NOTICE" => $l_profile_info_notice,
+ "L_CONFIRM" => $l_confirm,
+ "L_EMAIL_ADDRESS" => $l_emailaddress,
+
+ "S_ALLOW_AVATAR_UPLOAD" => $board_config['allow_avatar_upload'],
+ "S_ALLOW_AVATAR_LOCAL" => $board_config['allow_avatar_local'],
+ "S_ALLOW_AVATAR_REMOTE" => $board_config['allow_avatar_remote'],
+ "S_HIDDEN_FIELDS" => $s_hidden_fields,
+ "S_PROFILE_ACTION" => append_sid("profile.$phpEx"))
+ );
+
+ $template->pparse("body");
+
+ include('includes/page_tail.'.$phpEx);
+ }
+ else if($mode == "activate")
+ {
+ $sql = "SELECT user_id
FROM " . USERS_TABLE . "
WHERE user_actkey = '$act_key'";
if($result = $db->sql_query($sql))
@@ -1256,30 +1002,30 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if($num = $db->sql_numrows($result))
{
$rowset = $db->sql_fetchrowset($result);
+
$sql_update = "UPDATE " . USERS_TABLE . "
SET user_active = 1, user_actkey = ''
WHERE user_id = " . $rowset[0]['user_id'];
if($result = $db->sql_query($sql_update))
{
- error_die(GENERAL_ERROR, $l_nowactive);
+ message_die(GENERAL_MESSAGE, $lang['Account_active']);
}
else
{
- error_die(SQL_QUERY);
+ message_die(GENERAL_ERROR, "Couldn't update users table", "", __LINE__, __FILE__, $sql_update);
}
}
else
{
- error_die(GENERAL_ERROR, $l_wrongactiv);
+ message_die(GENERAL_ERROR, $lang['']); //wrongactiv
}
}
else
{
- error_die(SQL_QUERY);
+ message_die(GENERAL_ERROR, "Couldn't obtain user information", "", __LINE__, __FILE__, $sql);
}
- break;
+ break;
}
-
}
?> \ No newline at end of file
diff --git a/phpBB/templates/PSO/profile_add_body.tpl b/phpBB/templates/PSO/profile_add_body.tpl
index cba0c7c330..e298484977 100644
--- a/phpBB/templates/PSO/profile_add_body.tpl
+++ b/phpBB/templates/PSO/profile_add_body.tpl
@@ -11,7 +11,7 @@
<th class="secondary" colspan="2">&nbsp;<b>{L_REGISTRATION_INFO}</b> <span class="gensmall">[{L_ITEMS_REQUIRED}]</span>&nbsp;</th>
</tr>
<tr>
- <td class="row1"><span class="gen">{L_USERNAME}: *</b><br>{L_USER_UNIQ}</td>
+ <td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</b><br>{L_USER_UNIQ}</td>
<td class="row2"><input type="text" name="username" size="35" maxlength="40" value="{USERNAME}"></td>
</tr>
<tr>
@@ -97,18 +97,6 @@
<td class="row2"><input type="radio" name="allowsmilies" value="1" {ALWAYS_ALLOW_SMILIES_YES}> <span class="gen">{L_YES}</span>&nbsp;&nbsp;<input type="radio" name="allowsmilies" value="0" {ALWAYS_ALLOW_SMILIES_NO}> <span class="gen">{L_NO}</span></td>
</tr>
<tr>
- <td class="row1"><span class="gen">{L_AVATAR}:</span><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>
- <td class="row2"><table cellspacing="2" cellpadding="0" border="0">
- <tr>
- <td align="center"><span class="gensmall">{L_CURRENT_IMAGE}</span></td>
- <td rowspan="2" valign="bottom">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="gensmall">{L_UPLOAD_AVATAR}:</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}"><input type="file" name="avatar"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="gensmall">{L_AVATAR_URL}:</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="avatarurl"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="gensmall">{L_DELETE_AVATAR}:</span><input type="checkbox" name="avatardel"></td>
- </tr>
- <tr>
- <td align="center">&nbsp;{AVATAR}&nbsp;</td>
- </tr>
- </table></td>
- </tr>
- <tr>
<td class="row1"><span class="gen">{L_BOARD_LANGUAGE}:</span></td>
<td class="row2">{LANGUAGE_SELECT}</td>
</tr>
@@ -129,7 +117,42 @@
<td class="row2"><input type="text" name="dateformat" value="{DATE_FORMAT}" maxlength="16"></td>
</tr>
<tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}"></td>
+ <th class="secondary" colspan="2">&nbsp;<b>{L_AVATAR_PANEL}</b></td>
+ </tr>
+ <!-- IF $S_ALLOW_AVATAR_UPLOAD eq TRUE || $S_ALLOW_AVATAR_LOCAL eq TRUE || $S_ALLOW_AVATAR_REMOTE eq TRUE -->
+ <tr>
+ <td class="row1" colspan="2" align="center"><table width="70%" cellspacing="2" cellpadding="0" border="0">
+ <tr>
+ <td width="65%"><span class="gen"><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>
+ <td align="center"><span class="gensmall">{L_CURRENT_IMAGE}</span><br>{AVATAR}<br><input type="checkbox" name="avatardel">&nbsp;<span class="gensmall">{L_DELETE_AVATAR}</span></td>
+ </tr>
+ </table></td>
+ </tr>
+ <!-- ENDIF -->
+ <!-- IF $S_ALLOW_AVATAR_UPLOAD eq TRUE -->
+ <tr>
+ <td class="row1"><span class="gen">{L_UPLOAD_AVATAR_FILE}:</span></td>
+ <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}"><input type="file" name="avatar"></td>
+ </tr>
+ <tr>
+ <td class="row1"><span class="gen">{L_UPLOAD_AVATAR_URL}:</span><br><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
+ <td class="row2"><input type="text" name="avatarurl" size="40"></td>
+ </tr>
+ <!-- ENDIF -->
+ <!-- IF $S_ALLOW_AVATAR_REMOTE eq TRUE -->
+ <tr>
+ <td class="row1"><span class="gen">{L_LINK_REMOTE_AVATAR}:</span><br><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
+ <td class="row2"><input type="text" name="avatarremoteurl" size="40"></td>
+ </tr>
+ <!-- ENDIF -->
+ <!-- IF $S_ALLOW_AVATAR_LOCAL eq TRUE -->
+ <tr>
+ <td class="row1"><span class="gen">{L_AVATAR_GALLERY}:</span></td>
+ <td class="row2">&nbsp;</td>
+ </tr>
+ <!-- ENDIF -->
+ <tr>
+ <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}">&nbsp;&nbsp;<input type="reset" value="{L_RESET}"</td>
</tr>
</table></td>
</form></tr>