Yet another faked if loop

git-svn-id: file:///svn/phpbb/trunk@727 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-07-22 19:53:08 +00:00
parent 7d83ba703c
commit 287feac024
3 changed files with 64 additions and 48 deletions

View file

@ -167,9 +167,14 @@ $lang['No_Posts'] = "No Posts";
$lang['Forum_Index'] = "Forum Index"; $lang['Forum_Index'] = "Forum Index";
$lang['No_forums'] = "This board has no forums"; $lang['No_forums'] = "This board has no forums";
$lang['Private_Messages'] = "Private Messages";
$lang['Who_is_Online'] = "Who is Online";
// //
// Viewforum // Viewforum
// //
$lang['View_forum'] = "View Forum";
$lang['Forum_not_exist'] = "The forum you selected does not exist, please go back and try again"; $lang['Forum_not_exist'] = "The forum you selected does not exist, please go back and try again";
$lang['Reached_on_error'] = "You have reached this page in error, please go back and try again"; $lang['Reached_on_error'] = "You have reached this page in error, please go back and try again";
@ -181,6 +186,7 @@ $lang['Sticky'] = "<b>Sticky:</b>";
// Viewtopic // Viewtopic
// //
$lang['View_topic'] = "View topic"; $lang['View_topic'] = "View topic";
$lang['Guest'] = 'Guest'; $lang['Guest'] = 'Guest';
$lang['Post_subject'] = "Post subject"; $lang['Post_subject'] = "Post subject";
$lang['View_next_topic'] = "View next topic"; $lang['View_next_topic'] = "View next topic";
@ -265,6 +271,8 @@ $lang['to_return_topic'] = "to return to the topic";
// //
// Private Messaging // Private Messaging
// //
$lang['Private_Messaging'] = "Private Messaging";
$lang['You_have'] = "You have"; // followed by "x new message/s" $lang['You_have'] = "You have"; // followed by "x new message/s"
$lang['new'] = "new"; // see above $lang['new'] = "new"; // see above
$lang['message'] = "message"; // see above $lang['message'] = "message"; // see above
@ -285,6 +293,8 @@ $lang['Mark'] = "Mark";
$lang['Display_messages'] = "Display messages from previous"; // Followed by number of days/weeks/months $lang['Display_messages'] = "Display messages from previous"; // Followed by number of days/weeks/months
$lang['All_Messages'] = "All Messages"; $lang['All_Messages'] = "All Messages";
$lang['No_messages_folder'] = "You have no messages in this folder";
$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";
@ -463,6 +473,7 @@ $lang['Non_member_groups'] = "Non-member groups";
$lang['Memberships_pending'] = "Memberships pending"; $lang['Memberships_pending'] = "Memberships pending";
$lang['Join_group'] = "Join Group"; $lang['Join_group'] = "Join Group";
$lang['No_group_members'] = "This group has no members";
$lang['This_open_group'] = "This is an open group, click to request membership"; $lang['This_open_group'] = "This is an open group, click to request membership";
$lang['This_closed_group'] = "This is a closed group, no more users accepted"; $lang['This_closed_group'] = "This is a closed group, no more users accepted";
@ -613,24 +624,12 @@ $lang[11] = "GMT + 11" . " " . $lang['Hours'];
$lang[12] = "GMT + 12" . " " . $lang['Hours']; $lang[12] = "GMT + 12" . " " . $lang['Hours'];
// //
// End
// -------------------------------------------------
// -------------------------------------------------
// Old format ... _DON'T_add_any_ new entries here!! // Old format ... _DON'T_add_any_ new entries here!!
// //
// Index page
// Members and profile
// Viewforum
// Private forums
// Viewtopic
// Functions
// Page_header
$l_statsblock = '$statsblock = "Our users have posted a total of -$total_posts- $l_messages.<br>
We have -$total_users- Registered Users.<br>
The newest Registered User is -<a href=\"$profile_url\">$newest_user</a>-.<br>
-$users_online- ". ($users_online==1?"user is":"users are") ." <a href=\"$online_url\">currently browsing</a> the forums.<br>";';
$l_privnotify = '$privnotify = "<br>You have $new_message <a href=\"$privmsg_url\">new private ".($new_message>1?"messages":"message")."</a>.";';
// Page_tail
// Auth
// Register // Register
$l_mailingaddress = $l_mailingaddress =
" "

View file

@ -1209,50 +1209,62 @@ if(!$pm_status = $db->sql_query($sql))
message_die(GENERAL_ERROR, "Could not query private messages.", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Could not query private messages.", "", __LINE__, __FILE__, $sql);
} }
$pm_total = $db->sql_numrows($pm_tot_status); $pm_total = $db->sql_numrows($pm_tot_status);
$pm_count = $db->sql_numrows($pm_status);
$pm_list = $db->sql_fetchrowset($pm_status); $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++) if($pm_count)
{ {
$privmsg_id = $pm_list[$i]['privmsgs_id']; for($i = 0; $i < $pm_count; $i++)
$flag = $pm_list[$i]['privmsgs_type'];
$icon_flag = ($flag == PRIVMSGS_READ_MAIL || $flag == PRIVMSGS_SAVED_MAIL || $flag == PRIVMSGS_SENT_MAIL) ? "<img src=\"images/msg_read.gif\">" : "<img src=\"images/msg_unread.gif\">";
$msg_userid = $pm_list[$i]['user_id'];
$msg_username = stripslashes($pm_list[$i]['username']);
$u_from_user_profile = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$msg_userid");
$msg_subject = stripslashes($pm_list[$i]['privmsgs_subject']);
$u_subject = append_sid("privmsg.$phpEx?folder=$folder&mode=read&" . POST_POST_URL . "=$privmsg_id");
$msg_date = create_date($board_config['default_dateformat'], $pm_list[$i]['privmsgs_date'], $board_config['default_timezone']);
if($flag == PRIVMSGS_NEW_MAIL && $folder == "inbox")
{ {
$msg_subject = "<b>" . $msg_subject . "</b>"; $privmsg_id = $pm_list[$i]['privmsgs_id'];
$msg_date = "<b>" . $msg_date . "</b>";
$msg_username = "<b>" . $msg_username . "</b>";
}
$row_color = (!($i % 2)) ? "#".$theme['td_color1'] : "#".$theme['td_color2']; $flag = $pm_list[$i]['privmsgs_type'];
$icon_flag = ($flag == PRIVMSGS_READ_MAIL || $flag == PRIVMSGS_SAVED_MAIL || $flag == PRIVMSGS_SENT_MAIL) ? "<img src=\"images/msg_read.gif\">" : "<img src=\"images/msg_unread.gif\">";
$template->assign_block_vars("listrow", array( $msg_userid = $pm_list[$i]['user_id'];
"ICON_FLAG_IMG" => $icon_flag, $msg_username = stripslashes($pm_list[$i]['username']);
"FROM" => $msg_username,
"SUBJECT" => $msg_subject,
"DATE" => $msg_date,
"ROW_COLOR" => $row_color,
"S_DEL_CHECKBOX" => "<input type=\"checkbox\" name=\"mark[]\" value=\"$privmsg_id\">", $u_from_user_profile = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$msg_userid");
"U_READ" => $u_subject, $msg_subject = stripslashes($pm_list[$i]['privmsgs_subject']);
"U_FROM_USER_PROFILE" => $u_from_user_profile) $u_subject = append_sid("privmsg.$phpEx?folder=$folder&mode=read&" . POST_POST_URL . "=$privmsg_id");
$msg_date = create_date($board_config['default_dateformat'], $pm_list[$i]['privmsgs_date'], $board_config['default_timezone']);
if($flag == PRIVMSGS_NEW_MAIL && $folder == "inbox")
{
$msg_subject = "<b>" . $msg_subject . "</b>";
$msg_date = "<b>" . $msg_date . "</b>";
$msg_username = "<b>" . $msg_username . "</b>";
}
$row_color = (!($i % 2)) ? "#".$theme['td_color1'] : "#".$theme['td_color2'];
$template->assign_block_vars("listrow", array(
"ICON_FLAG_IMG" => $icon_flag,
"FROM" => $msg_username,
"SUBJECT" => $msg_subject,
"DATE" => $msg_date,
"ROW_COLOR" => $row_color,
"S_DEL_CHECKBOX" => "<input type=\"checkbox\" name=\"mark[]\" value=\"$privmsg_id\">",
"U_READ" => $u_subject,
"U_FROM_USER_PROFILE" => $u_from_user_profile)
);
} // for ...
}
else
{
$template->assign_vars(array(
"L_NO_MESSAGES" => $lang['No_messages_folder'])
); );
} // for ...
$template->assign_block_vars("nomessages", array() );
}
$template->assign_vars(array( $template->assign_vars(array(
"PAGINATION" => generate_pagination("privmsg.$phpEx?folder=$folder", $pm_total, $board_config['topics_per_page'], $start), "PAGINATION" => generate_pagination("privmsg.$phpEx?folder=$folder", $pm_total, $board_config['topics_per_page'], $start),

View file

@ -32,6 +32,11 @@
<td width="5%" align="center" valign="middle">{listrow.S_DEL_CHECKBOX}</td> <td width="5%" align="center" valign="middle">{listrow.S_DEL_CHECKBOX}</td>
</tr> </tr>
<!-- END listrow --> <!-- END listrow -->
<!-- BEGIN nomessages -->
<tr>
<td class="row1" colspan="5" align="center" valign="middle"><span class="gen">{L_NO_MESSAGES}</span></td>
</tr>
<!-- END nomessages -->
<tr> <tr>
<td class="cat" colspan="5"><table width="100%" cellspacing="0" cellpadding="0" border="0"> <td class="cat" colspan="5"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>