More updates, added a previous x day select box

git-svn-id: file:///svn/phpbb/trunk@554 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
uid42062 2001-07-04 21:43:57 +00:00
parent a6723b8a1b
commit 5f20953aa6
2 changed files with 98 additions and 32 deletions

View file

@ -213,9 +213,10 @@ $lang['From'] = "From";
$lang['To'] = "To"; $lang['To'] = "To";
$lang['Date'] = "Date"; $lang['Date'] = "Date";
$lang['Mark'] = "Mark"; $lang['Mark'] = "Mark";
$lang['Display_messages'] = "Display messages from previous"; // Followed by number of days/weeks/months
$lang['All_Messages'] = "All Messages";
$lang['Cannot_send_privmsg'] = "Sorry but you are not currently allowed to send private messages."; $lang['Cannot_send_privmsg'] = "Sorry but you are not currently allowed to send private messages.";
$lang['No_to_user'] = "You must specify a username to send this message"; $lang['No_to_user'] = "You must specify a username to send this message";
$lang['No_such_user'] = "Sorry but no such user exists"; $lang['No_such_user'] = "Sorry but no such user exists";
@ -257,12 +258,10 @@ $lang['Always_smile'] = "Always enable Smilies";
$lang['Always_html'] = "Always allow HTML"; $lang['Always_html'] = "Always allow HTML";
$lang['Always_bbcode'] = "Always allow BBCode"; $lang['Always_bbcode'] = "Always allow BBCode";
$lang['Always_add_sig'] = "Always attach my signature"; $lang['Always_add_sig'] = "Always attach my signature";
$lang['Board_theme'] = "Board Theme";
$l_boardtheme = "Board Theme"; $lang['Board_lang'] = "Board Language";
$l_boardlang = "Board Language"; $lang['No_themes'] = "No Themes In database";
$l_nothemes = "No Themes In database"; $lang['Timezone'] = "Timezone";
$l_saveprefs = "Save $l_preferences";
$l_timezone = "Timezone";
$lang['Avatar_panel'] = "Avatar control panel"; $lang['Avatar_panel'] = "Avatar control panel";
$lang['Avatar'] = "Avatar"; $lang['Avatar'] = "Avatar";
@ -291,12 +290,12 @@ $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_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['Avatar_imagesize'] = "The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high";
$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_subject'] = "Welcome to " . $board_config['sitename'] . " Forums"; $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['Welcome_email_activate'] = $lang['Welcome_subject'] . ",
$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. Please keep this email for your records.
@ -316,7 +315,24 @@ However, should you forget your password you can request a new one which will be
Thank you for registering. Thank you for registering.
"; "; // END
$lang['Welcome_email'] = $lang['Welcome_subject'] . ",
Please keep this email for your records.
Your account information is as follows:
----------------------------
Username: $username
Password: $password
----------------------------
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 mail a new, random, password.
Thank you for registering.
"; // END
$lang['COPPA'] = "Your account has been created but has to be approved, please check your email for details."; $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."; $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.";

View file

@ -1058,23 +1058,9 @@ $savebox_url .= ($folder != "savebox") ? "<a href=\"" . append_sid("privmsg.$php
$post_new_mesg_url = "<a href=\"privmsg.$phpEx?mode=post\"><img src=\"templates/PSO/images/post.gif\" border=\"1\"></a>"; $post_new_mesg_url = "<a href=\"privmsg.$phpEx?mode=post\"><img src=\"templates/PSO/images/post.gif\" border=\"1\"></a>";
$template->assign_vars(array( //
"INBOX" => $inbox_url, // General SQL to obtain messages
"SENTBOX" => $sentbox_url, //
"OUTBOX" => $outbox_url,
"SAVEBOX" => $savebox_url,
"L_MARK" => $lang['Mark'],
"L_FLAG" => $lang['Flag'],
"L_SUBJECT" => $lang['Subject'],
"L_DATE" => $lang['Date'],
"L_FROM_OR_TO" => (($folder == "inbox" || $folder == "savebox") ? $lang['From'] : $lang['To']),
"S_HIDDEN_FIELDS" => "",
"S_PRIVMSGS_ACTION" => append_sid("privmsg.$phpEx?folder=$folder"),
"S_POST_NEW_MSG" => $post_new_mesg_url)
);
$sql_tot = "SELECT COUNT(privmsgs_id) AS total FROM " . PRIVMSGS_TABLE . " "; $sql_tot = "SELECT COUNT(privmsgs_id) AS total FROM " . PRIVMSGS_TABLE . " ";
$sql = "SELECT pm.privmsgs_type, pm.privmsgs_id, pm.privmsgs_date, pm.privmsgs_subject, u.user_id, u.username FROM " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " u "; $sql = "SELECT pm.privmsgs_type, pm.privmsgs_id, pm.privmsgs_date, pm.privmsgs_subject, u.user_id, u.username FROM " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " u ";
@ -1119,8 +1105,73 @@ switch($folder)
break; break;
} }
$sql .= " ORDER BY pm.privmsgs_date DESC LIMIT $start, " . $board_config['topics_per_page']; //
// Show messages over previous x days/months
//
if(!empty($HTTP_POST_VARS['msgdays']) || !empty($HTTP_GET_VARS['msgdays']))
{
$msg_days = (!empty($HTTP_POST_VARS['msgdays'])) ? $HTTP_POST_VARS['msgdays'] : $HTTP_GET_VARS['msgdays'];
$min_msg_time = time() - ($msg_days * 86400);
$limit_msg_time_total = " AND privmsgs_date > $min_msg_time";
$limit_msg_time = " AND pm.privmsgs_date > $min_msg_time ";
if(!empty($HTTP_POST_VARS['msgdays']))
{
$start = 0;
}
}
else
{
$limit_msg_time = "";
$post_days = 0;
}
$sql .= $limit_msg_time . " ORDER BY pm.privmsgs_date DESC LIMIT $start, " . $board_config['topics_per_page'];
$sql_tot .= $limit_msg_time_total;
//
// Build select box
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Messages'], "1 " . $lang['Day'], "7 " . $lang['Days'], "2 " . $lang['Weeks'], "1 " . $lang['Month'], "3 ". $lang['Months'], "6 " . $lang['Months'], "1 " . $lang['Year']);
$select_msg_days = "<select name=\"msgdays\">";
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($msg_days == $previous_days[$i]) ? " selected" : "";
$select_msg_days .= "<option value=\"" . $previous_days[$i] . "\"$selected>" . $previous_days_text[$i] . "</option>";
}
$select_msg_days .= "</select>";
//
// Dump vars to template
//
$template->assign_vars(array(
"INBOX" => $inbox_url,
"SENTBOX" => $sentbox_url,
"OUTBOX" => $outbox_url,
"SAVEBOX" => $savebox_url,
"L_MARK" => $lang['Mark'],
"L_FLAG" => $lang['Flag'],
"L_SUBJECT" => $lang['Subject'],
"L_DATE" => $lang['Date'],
"L_DISPLAY_MESSAGES" => $lang['Display_messages'],
"L_FROM_OR_TO" => (($folder == "inbox" || $folder == "savebox") ? $lang['From'] : $lang['To']),
"S_HIDDEN_FIELDS" => "",
"S_PRIVMSGS_ACTION" => append_sid("privmsg.$phpEx?folder=$folder"),
"S_POST_NEW_MSG" => $post_new_mesg_url,
"S_SELECT_MSG_DAYS" => $select_msg_days,
"S_MSG_DAYS_ACTION" => append_sid("privmsg.$phpEx?folder=$folder&start=$start"),
"U_POST_NEW_TOPIC" => $post_new_topic_url)
);
//
// Get messages
//
if(!$pm_tot_status = $db->sql_query($sql_tot)) if(!$pm_tot_status = $db->sql_query($sql_tot))
{ {
message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot); message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot);
@ -1135,7 +1186,6 @@ $pm_list = $db->sql_fetchrowset($pm_status);
// //
// Okay, let's build the correct folder // Okay, let's build the correct folder
// //
for($i = 0; $i < count($pm_list); $i++) for($i = 0; $i < count($pm_list); $i++)
{ {
$privmsg_id = $pm_list[$i]['privmsgs_id']; $privmsg_id = $pm_list[$i]['privmsgs_id'];