diff --git a/phpBB/config.php b/phpBB/config.php
index e69de29bb2..067ae2e7b1 100644
--- a/phpBB/config.php
+++ b/phpBB/config.php
@@ -0,0 +1,51 @@
+
\ No newline at end of file
diff --git a/phpBB/faq.php b/phpBB/faq.php
index ea741799e9..7c406eb79f 100644
--- a/phpBB/faq.php
+++ b/phpBB/faq.php
@@ -21,7 +21,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
@@ -37,24 +37,23 @@ init_userprefs($userdata);
//
// Load the appropriate faq file
//
-
if( isset($HTTP_GET_VARS['mode']) )
{
switch( $HTTP_GET_VARS['mode'] )
{
case 'bbcode':
- $lang_file = "lang_bbcode";
+ $lang_file = 'lang_bbcode';
$l_title = $lang['BBCode_guide'];
break;
default:
- $lang_file = "lang_faq";
+ $lang_file = 'lang_faq';
$l_title = $lang['FAQ'];
break;
}
}
else
{
- $lang_file = "lang_faq";
+ $lang_file = 'lang_faq';
$l_title = $lang['FAQ'];
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);
@@ -70,7 +69,7 @@ $faq_block_titles = array();
for($i = 0; $i < count($faq); $i++)
{
- if( $faq[$i][0] != "--" )
+ if( $faq[$i][0] != '--' )
{
$faq_block[$j][$counter]['id'] = $counter_2;
$faq_block[$j][$counter]['question'] = $faq[$i][0];
@@ -96,35 +95,24 @@ $page_title = $l_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "body" => "faq_body.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'body' => 'faq_body.tpl')
);
-
-$jumpbox = make_jumpbox($forum_id);
-$template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle("JUMPBOX", "jumpbox");
+make_jumpbox('viewforum.'.$phpEx, $forum_id);
$template->assign_vars(array(
- "L_FAQ_TITLE" => $l_title,
- "L_BACK_TO_TOP" => $lang['Back_to_top'])
+ 'L_FAQ_TITLE' => $l_title,
+ 'L_BACK_TO_TOP' => $lang['Back_to_top'])
);
for($i = 0; $i < count($faq_block); $i++)
{
if( count($faq_block[$i]) )
{
- $template->assign_block_vars("faq_block", array(
- "BLOCK_TITLE" => $faq_block_titles[$i])
+ $template->assign_block_vars('faq_block', array(
+ 'BLOCK_TITLE' => $faq_block_titles[$i])
);
- $template->assign_block_vars("faq_block_link", array(
- "BLOCK_TITLE" => $faq_block_titles[$i])
+ $template->assign_block_vars('faq_block_link', array(
+ 'BLOCK_TITLE' => $faq_block_titles[$i])
);
for($j = 0; $j < count($faq_block[$i]); $j++)
@@ -132,27 +120,27 @@ for($i = 0; $i < count($faq_block); $i++)
$row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $template->assign_block_vars("faq_block.faq_row", array(
- "ROW_COLOR" => "#" . $row_color,
- "ROW_CLASS" => $row_class,
- "FAQ_QUESTION" => $faq_block[$i][$j]['question'],
- "FAQ_ANSWER" => $faq_block[$i][$j]['answer'],
+ $template->assign_block_vars('faq_block.faq_row', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'FAQ_QUESTION' => $faq_block[$i][$j]['question'],
+ 'FAQ_ANSWER' => $faq_block[$i][$j]['answer'],
- "U_FAQ_ID" => $faq_block[$i][$j]['id'])
+ 'U_FAQ_ID' => $faq_block[$i][$j]['id'])
);
- $template->assign_block_vars("faq_block_link.faq_row_link", array(
- "ROW_COLOR" => "#" . $row_color,
- "ROW_CLASS" => $row_class,
- "FAQ_LINK" => $faq_block[$i][$j]['question'],
+ $template->assign_block_vars('faq_block_link.faq_row_link', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'FAQ_LINK' => $faq_block[$i][$j]['question'],
- "U_FAQ_LINK" => "#" . $faq_block[$i][$j]['id'])
+ 'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id'])
);
}
}
}
-$template->pparse("body");
+$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php
index a51537b5b5..942c923756 100644
--- a/phpBB/groupcp.php
+++ b/phpBB/groupcp.php
@@ -25,6 +25,89 @@ $phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
+// -------------------------
+//
+function generate_user_info(&$row, $date_format, &$from, &$posts, &$joined, &$poster_avatar, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www, &$icq_status_img, &$icq_img, &$icq, &$aim_img, &$aim, &$msn_img, &$msn, &$yim_img, &$yim)
+{
+ global $lang, $images, $board_config;
+
+ $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
+ $joined = create_date($date_format, $row['user_regdate'], $board_config['board_timezone']);
+ $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
+
+ $poster_avatar = '';
+ if ( $row['user_avatar_type'] && $row['user_id'] != ANONYMOUS && $row['user_allowavatar'] )
+ {
+ switch( $row['user_avatar_type'] )
+ {
+ case USER_AVATAR_UPLOAD:
+ $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? ' ' : '';
+ break;
+ case USER_AVATAR_REMOTE:
+ $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? ' ' : '';
+ break;
+ case USER_AVATAR_GALLERY:
+ $poster_avatar = ( $board_config['allow_avatar_local'] ) ? ' ' : '';
+ break;
+ }
+ }
+
+ if ( !empty($row['user_viewemail']) || $userdata['user_level'] == ADMIN )
+ {
+ $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $row['user_id']) : 'mailto:' . $row['user_email'];
+
+ $email_img = ' ';
+ $email = '' . $lang['Send_email'] . ' ';
+ }
+ else
+ {
+ $email_img = ' ';
+ $email = ' ';
+ }
+
+ $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']);
+ $profile_img = ' ';
+ $profile = '' . $lang['Read_profile'] . ' ';
+
+ $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $row['user_id']);
+ $pm_img = ' ';
+ $pm = '' . $lang['Send_private_message'] . ' ';
+
+ $www_img = ( $row['user_website'] ) ? ' ' : '';
+ $www = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . ' ' : '';
+
+ if ( !empty($row['user_icq']) )
+ {
+ $icq_status_img = ' ';
+ $icq_img = ' ';
+ $icq = '' . $lang['ICQ'] . ' ';
+ }
+ else
+ {
+ $icq_status_img = '';
+ $icq_img = '';
+ $icq = '';
+ }
+
+ $aim_img = ( $row['user_aim'] ) ? ' ' : '';
+ $aim = ( $row['user_aim'] ) ? '' . $lang['AIM'] . ' ' : '';
+
+ $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']);
+ $msn_img = ( $row['user_msnm'] ) ? ' ' : '';
+ $msn = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . ' ' : '';
+
+ $yim_img = ( $row['user_yim'] ) ? ' ' : '';
+ $yim = ( $row['user_yim'] ) ? '' . $lang['YIM'] . ' ' : '';
+
+ $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts");
+ $search_img = ' ';
+ $search = '' . $lang['Search_user_posts'] . ' ';
+
+ return;
+}
+//
+// --------------------------
+
//
// Start session management
//
@@ -34,7 +117,7 @@ init_userprefs($userdata);
// End session management
//
-$script_name = preg_replace("/^\/?(.*?)\/?$/", "\\1", trim($board_config['script_path']));
+$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/groupcp.'.$phpEx : 'groupcp.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
@@ -42,7 +125,7 @@ $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config
$server_url = $server_protocol . $server_name . $server_port . $script_name;
-if( isset($HTTP_GET_VARS[POST_GROUPS_URL]) || isset($HTTP_POST_VARS[POST_GROUPS_URL]) )
+if ( isset($HTTP_GET_VARS[POST_GROUPS_URL]) || isset($HTTP_POST_VARS[POST_GROUPS_URL]) )
{
$group_id = ( isset($HTTP_GET_VARS[POST_GROUPS_URL]) ) ? intval($HTTP_GET_VARS[POST_GROUPS_URL]) : intval($HTTP_POST_VARS[POST_GROUPS_URL]);
}
@@ -51,7 +134,7 @@ else
$group_id = '';
}
-if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
+if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
@@ -60,7 +143,6 @@ else
$mode = '';
}
-
$confirm = ( isset($HTTP_POST_VARS['confirm']) ) ? TRUE : 0;
$cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? TRUE : 0;
@@ -69,30 +151,30 @@ $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) :
//
// Default var values
//
+$header_location = ( @preg_match('/Microsoft|WebSTAR/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
$is_moderator = FALSE;
-if( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
+if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
{
- if( !$userdata['session_logged_in'] )
+ if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
$sql = "SELECT group_moderator
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain user and group information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
- if( $row['group_moderator'] != $userdata['user_id'] && $userdata['user_level'] != ADMIN )
+ if ( $row['group_moderator'] != $userdata['user_id'] && $userdata['user_level'] != ADMIN )
{
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
$message = $lang['Not_group_moderator'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
@@ -103,32 +185,28 @@ if( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
$sql = "UPDATE " . GROUPS_TABLE . "
SET group_type = " . intval($HTTP_POST_VARS['group_type']) . "
WHERE group_id = $group_id";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain user and group information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
}
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang["Group_type_updated"] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
+ $message = $lang['Group_type_updated'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
-else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
+else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id )
{
//
// First, joining a group
- //
-
- //
// If the user isn't logged in redirect them to login
//
- if( !$userdata['session_logged_in'] )
+ if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . ppend_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
@@ -137,24 +215,24 @@ else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
WHERE g.group_id = $group_id
AND g.group_type <> " . GROUP_HIDDEN . "
AND ug.group_id = g.group_id";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain user and group information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
}
- if( $row = $db->sql_fetchrow($result) )
+ if ( $row = $db->sql_fetchrow($result) )
{
if ( $row['group_type'] == GROUP_OPEN )
{
do
{
- if( $userdata['user_id'] == $row['user_id'] )
+ if ( $userdata['user_id'] == $row['user_id'] )
{
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang["Already_member_group"] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
+ $message = $lang['Already_member_group'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
@@ -163,10 +241,10 @@ else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
else
{
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang["This_closed_group"] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
+ $message = $lang['This_closed_group'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
@@ -178,7 +256,7 @@ else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES ($group_id, " . $userdata['user_id'] . ", 1)";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql);
}
@@ -187,7 +265,7 @@ else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
FROM ".USERS_TABLE . " u, " . GROUPS_TABLE . " g
WHERE u.user_id = g.group_moderator
AND g.group_id = $group_id";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Error getting group moderator data", "", __LINE__, __FILE__, $sql);
}
@@ -197,60 +275,54 @@ else if( isset($HTTP_POST_VARS['joingroup']) && $group_id )
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
- $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
+ $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- $emailer->use_template("group_request", $moderator['user_lang']);
+ $emailer->use_template('group_request', $moderator['user_lang']);
$emailer->email_address($moderator['user_email']);
$emailer->set_subject();//$lang['Group_request']
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
- "SITENAME" => $board_config['sitename'],
- "GROUP_MODERATOR" => $moderator['username'],
- "EMAIL_SIG" => str_replace(" ", "\n", "-- \n" . $board_config['board_email_sig']),
+ 'SITENAME' => $board_config['sitename'],
+ 'GROUP_MODERATOR' => $moderator['username'],
+ 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']),
- "U_GROUPCP" => $server_url . "?" . POST_GROUPS_URL . "=$group_id&validate=true")
+ 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true")
);
$emailer->send();
$emailer->reset();
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang["Group_joined"] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
+ $message = $lang['Group_joined'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
-else if( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending']) && $group_id )
+else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending']) && $group_id )
{
//
// Second, unsubscribing from a group
- //
-
- //
// Check for confirmation of unsub.
//
- if( $cancel )
+ if ( $cancel )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . ppend_sid("groupcp.$phpEx", true));
}
-
- if( !$userdata['session_logged_in'] )
+ elseif ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
- if( $confirm )
+ if ( $confirm )
{
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE user_id = " . $userdata['user_id'] . "
AND group_id = $group_id";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Could not delete group memebership data", "Error", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not delete group memebership data', '', __LINE__, __FILE__, $sql);
}
if ( $userdata['user_level'] != ADMIN && $userdata['user_level'] == MOD )
@@ -270,7 +342,7 @@ else if( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending'
$sql = "UPDATE " . USERS_TABLE . "
SET user_level = " . USER . "
WHERE user_id = " . $userdata['user_id'];
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
}
@@ -278,7 +350,7 @@ else if( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending'
}
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
$message = $lang['Usub_success'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
@@ -295,36 +367,34 @@ else if( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending'
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "confirm" => "confirm_body.tpl")
+ 'confirm' => 'confirm_body.tpl')
);
$template->assign_vars(array(
- "MESSAGE_TITLE" => $lang['Confirm'],
- "MESSAGE_TEXT" => $unsub_msg,
- "L_YES" => $lang['Yes'],
- "L_NO" => $lang['No'],
- "S_CONFIRM_ACTION" => append_sid("groupcp.$phpEx"),
- "S_HIDDEN_FIELDS" => $s_hidden_fields)
+ 'MESSAGE_TITLE' => $lang['Confirm'],
+ 'MESSAGE_TEXT' => $unsub_msg,
+ 'L_YES' => $lang['Yes'],
+ 'L_NO' => $lang['No'],
+ 'S_CONFIRM_ACTION' => append_sid("groupcp.$phpEx"),
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
- $template->pparse("confirm");
+ $template->pparse('confirm');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
}
-else if( $group_id )
+else if ( $group_id )
{
-
//
// Did the group moderator get here through an email?
// If so, check to see if they are logged in.
//
- if( isset($HTTP_GET_VARS['validate']) )
+ if ( isset($HTTP_GET_VARS['validate']) )
{
- if( !$userdata['session_logged_in'] )
+ if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
}
@@ -374,7 +444,7 @@ else if( $group_id )
{
$group_moderator = $group_info['group_moderator'];
- if( $group_moderator == $userdata['user_id'] || $userdata['user_level'] == ADMIN )
+ if ( $group_moderator == $userdata['user_id'] || $userdata['user_level'] == ADMIN )
{
$is_moderator = TRUE;
}
@@ -382,18 +452,17 @@ else if( $group_id )
//
// Handle Additions, removals, approvals and denials
//
- if( !empty($HTTP_POST_VARS['add']) || !empty($HTTP_POST_VARS['remove']) || isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) )
+ if ( !empty($HTTP_POST_VARS['add']) || !empty($HTTP_POST_VARS['remove']) || isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) )
{
- if( !$userdata['session_logged_in'] )
+ if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
}
- if( !$is_moderator )
+ if ( !$is_moderator )
{
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
$message = $lang['Not_group_moderator'] . ' ' . sprintf($lang['Click_return_index'], '', ' ');
@@ -401,25 +470,25 @@ else if( $group_id )
message_die(GENERAL_MESSAGE, $message);
}
- if( isset($HTTP_POST_VARS['add']) )
+ if ( isset($HTTP_POST_VARS['add']) )
{
$username = ( isset($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : "";
$sql = "SELECT user_id, user_email, user_lang, user_level
FROM " . USERS_TABLE . "
WHERE username = '" . str_replace("\'", "''", $username) . "'";
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql);
}
- if( !($row = $db->sql_fetchrow($result)) )
+ if ( !($row = $db->sql_fetchrow($result)) )
{
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang["Could_not_add_user"] . " " . sprintf($lang['Click_return_group'], "", " ") . " " . sprintf($lang['Click_return_index'], "", " ");
+ $message = $lang['Could_not_add_user'] . " " . sprintf($lang['Click_return_group'], "", " ") . " " . sprintf($lang['Click_return_index'], "", " ");
message_die(GENERAL_MESSAGE, $message);
}
@@ -430,7 +499,7 @@ else if( $group_id )
'META' => ' ')
);
- $message = $lang["Could_not_anon_user"] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
+ $message = $lang['Could_not_anon_user'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
@@ -449,8 +518,7 @@ else if( $group_id )
{
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
VALUES (" . $row['user_id'] . ", $group_id, 0)";
-
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not add user to group', '', __LINE__, __FILE__, $sql);
}
@@ -460,24 +528,24 @@ else if( $group_id )
$sql = "UPDATE " . USERS_TABLE . "
SET user_level = " . MOD . "
WHERE user_id = " . $row['user_id'];
- if( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
}
}
- // Email the user and tell them they're in the group
-
//
// Get the group name
+ // Email the user and tell them they're in the group
//
$group_sql = "SELECT group_name
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id";
- if(!$result = $db->sql_query($group_sql))
+ if ( !($result = $db->sql_query($group_sql)) )
{
- message_die(GENERAL_ERROR, "Could not get group information", '', __LINE__, __FILE__, $group_sql);
+ message_die(GENERAL_ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
}
+
$group_name_row = $db->sql_fetchrow($result);
$group_name = $group_name_row['group_name'];
@@ -485,19 +553,19 @@ else if( $group_id )
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
- $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
+ $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- $emailer->use_template("group_added", $row['user_lang']);
+ $emailer->use_template('group_added', $row['user_lang']);
$emailer->email_address($row['user_email']);
$emailer->set_subject();//$lang['Group_added']
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
- "SITENAME" => $board_config['sitename'],
- "GROUP_NAME" => $group_name,
- "EMAIL_SIG" => str_replace(" ", "\n", "-- \n" . $board_config['board_email_sig']),
+ 'SITENAME' => $board_config['sitename'],
+ 'GROUP_NAME' => $group_name,
+ 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']),
- "U_GROUPCP" => $server_url . "?" . POST_GROUPS_URL . "=$group_id")
+ 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
$emailer->reset();
@@ -505,17 +573,17 @@ else if( $group_id )
else
{
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang["User_is_member_group"] . " " . sprintf($lang['Click_return_group'], "", " ") . " " . sprintf($lang['Click_return_index'], "", " ");
+ $message = $lang['User_is_member_group'] . ' ' . sprintf($lang['Click_return_group'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
}
else
{
- if( ( ( isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) ) && isset($HTTP_POST_VARS['pending_members']) ) || ( isset($HTTP_POST_VARS['remove']) && isset($HTTP_POST_VARS['members']) ) )
+ if ( ( ( isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) ) && isset($HTTP_POST_VARS['pending_members']) ) || ( isset($HTTP_POST_VARS['remove']) && isset($HTTP_POST_VARS['members']) ) )
{
$members = ( isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) ) ? $HTTP_POST_VARS['pending_members'] : $HTTP_POST_VARS['members'];
@@ -526,7 +594,7 @@ else if( $group_id )
$sql_in .= ( ( $sql_in != '' ) ? ', ' : '' ) . $members[$i];
}
- if( isset($HTTP_POST_VARS['approve']) )
+ if ( isset($HTTP_POST_VARS['approve']) )
{
if ( $group_info['auth_mod'] )
{
@@ -534,7 +602,7 @@ else if( $group_id )
SET user_level = " . MOD . "
WHERE user_id IN ($sql_in)
AND user_level NOT IN (" . MOD . ", " . ADMIN . ")";
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
}
@@ -544,11 +612,9 @@ else if( $group_id )
SET user_pending = 0
WHERE user_id IN ($sql_in)
AND group_id = $group_id";
-
$sql_select = "SELECT user_email
FROM ". USERS_TABLE . "
WHERE user_id IN ($sql_in)";
-
}
else if ( isset($HTTP_POST_VARS['deny']) || isset($HTTP_POST_VARS['remove']) )
{
@@ -591,7 +657,7 @@ else if( $group_id )
SET user_level = " . USER . "
WHERE user_id IN ($remove_mod_sql)
AND user_level NOT IN (" . ADMIN . ")";
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
}
@@ -604,7 +670,7 @@ else if( $group_id )
AND group_id = $group_id";
}
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user group table', '', __LINE__, __FILE__, $sql);
}
@@ -614,9 +680,9 @@ else if( $group_id )
//
if ( isset($HTTP_POST_VARS['approve']) )
{
- if ( !$result = $db->sql_query($sql_select) )
+ if ( !($result = $db->sql_query($sql_select)) )
{
- message_die(GENERAL_ERROR, "Could not get user email information", "Error", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not get user email information', '', __LINE__, __FILE__, $sql);
}
$email_addresses = '';
@@ -633,7 +699,7 @@ else if( $group_id )
WHERE group_id = $group_id";
if ( !($result = $db->sql_query($group_sql)) )
{
- message_die(GENERAL_ERROR, "Could not get group information", "Error", __LINE__, __FILE__, $group_sql);
+ message_die(GENERAL_ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
}
$group_name_row = $db->sql_fetchrow($result);
@@ -642,19 +708,19 @@ else if( $group_id )
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
- $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\nBcc: " . $email_addresses . "\r\n";
+ $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\nBcc: " . $email_addresses . "\r\n";
- $emailer->use_template("group_approved");
+ $emailer->use_template('group_approved');
$emailer->email_address($userdata['user_email']);
$emailer->set_subject();//$lang['Group_approved']
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
- "SITENAME" => $board_config['sitename'],
- "GROUP_NAME" => $group_name,
- "EMAIL_SIG" => str_replace(" ", "\n", "-- \n" . $board_config['board_email_sig']),
+ 'SITENAME' => $board_config['sitename'],
+ 'GROUP_NAME' => $group_name,
+ 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']),
- "U_GROUPCP" => $server_url . "?" . POST_GROUPS_URL . "=$group_id")
+ 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
$emailer->reset();
@@ -678,12 +744,12 @@ else if( $group_id )
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id
AND group_single_user = 0";
- if(!$result = $db->sql_query($sql))
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql);
}
- if( !($group_info = $db->sql_fetchrow($result)) )
+ if ( !($group_info = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, $lang['Group_not_exist']);
}
@@ -694,9 +760,9 @@ else if( $group_id )
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm
FROM " . USERS_TABLE . "
WHERE user_id = " . $group_info['group_moderator'];
- if(!$result = $db->sql_query($sql))
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error getting user list for group", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql);
}
$group_moderator = $db->sql_fetchrow($result);
@@ -713,7 +779,7 @@ else if( $group_id )
ORDER BY u.username";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error getting user list for group", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql);
}
$group_members = $db->sql_fetchrowset($result);
@@ -729,7 +795,7 @@ else if( $group_id )
ORDER BY u.username";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error getting user pending information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error getting user pending information', '', __LINE__, __FILE__, $sql);
}
$modgroup_pending_list = $db->sql_fetchrowset($result);
@@ -771,39 +837,39 @@ else if( $group_id )
$group_details = $lang['Are_group_moderator'];
- $s_hidden_fields = " ";
+ $s_hidden_fields = ' ';
}
else if ( $is_group_member || $is_group_pending_member )
{
- $template->assign_block_vars("switch_unsubscribe_group_input", array());
+ $template->assign_block_vars('switch_unsubscribe_group_input', array());
$group_details = ( $is_group_pending_member ) ? $lang['Pending_this_group'] : $lang['Member_this_group'];
- $s_hidden_fields = " ";
+ $s_hidden_fields = ' ';
}
else if ( $userdata['user_id'] == ANONYMOUS )
{
$group_details = $lang['Login_to_join'];
- $s_hidden_fields = "";
+ $s_hidden_fields = '';
}
else
{
if ( $group_info['group_type'] == GROUP_OPEN )
{
- $template->assign_block_vars("switch_subscribe_group_input", array());
+ $template->assign_block_vars('switch_subscribe_group_input', array());
$group_details = $lang['This_open_group'];
- $s_hidden_fields = " ";
+ $s_hidden_fields = ' ';
}
else if ( $group_info['group_type'] == GROUP_CLOSED )
{
$group_details = $lang['This_closed_group'];
- $s_hidden_fields = "";
+ $s_hidden_fields = '';
}
else if ( $group_info['group_type'] == GROUP_HIDDEN )
{
$group_details = $lang['This_hidden_group'];
- $s_hidden_fields = "";
+ $s_hidden_fields = '';
}
}
@@ -814,143 +880,96 @@ else if( $group_id )
// Load templates
//
$template->set_filenames(array(
- "info" => "groupcp_info_body.tpl",
- "pendinginfo" => "groupcp_pending_info.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'info' => 'groupcp_info_body.tpl',
+ 'pendinginfo' => 'groupcp_pending_info.tpl')
);
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ make_jumpbox('viewforum.'.$phpEx);
//
// Add the moderator
//
$username = $group_moderator['username'];
$user_id = $group_moderator['user_id'];
- $from = $group_moderator['user_from'];
- $joined = create_date($board_config['default_dateformat'], $group_moderator['user_regdate'], $board_config['board_timezone']);
+ generate_user_info($group_moderator, $board_config['default_dateformat'], $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim);
- $posts = ($group_moderator['user_posts']) ? $group_moderator['user_posts'] : 0;
-
- $profile_img = " ";
-
- $pm_img = " ";
-
- if ( !empty($group_moderator['user_viewemail']) )
- {
- $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_moderator['user_id']) : "mailto:" . $group_moderator['user_email'];
-
- $email_img = " ";
- }
- else
- {
- $email_img = "";
- }
-
- $www_img = ( $group_moderator['user_website'] ) ? " " : " ";
-
- if ( !empty($group_moderator['user_icq']) )
- {
- $icq_status_img = " ";
- $icq_add_img = " ";
- }
- else
- {
- $icq_status_img = "";
- $icq_add_img = "";
- }
-
- $aim_img = ( $group_moderator['user_aim'] ) ? " " : "";
-
- $msn_img = ( $group_moderator['user_msnm'] ) ? " " : "";
-
- $yim_img = ( $group_moderator['user_yim'] ) ? " " : "";
-
- $search_img = " ";
-
$template->assign_vars(array(
- "L_GROUP_INFORMATION" => $lang['Group_Information'],
- "L_GROUP_NAME" => $lang['Group_name'],
- "L_GROUP_DESC" => $lang['Group_description'],
- "L_GROUP_TYPE" => $lang['Group_type'],
- "L_GROUP_MEMBERSHIP" => $lang['Group_membership'],
- "L_SUBSCRIBE" => $lang['Subscribe'],
- "L_UNSUBSCRIBE" => $lang['Unsubscribe'],
- "L_JOIN_GROUP" => $lang['Join_group'],
- "L_UNSUBSCRIBE_GROUP" => $lang['Unsubscribe'],
- "L_GROUP_OPEN" => $lang['Group_open'],
- "L_GROUP_CLOSED" => $lang['Group_closed'],
- "L_GROUP_HIDDEN" => $lang['Group_hidden'],
- "L_UPDATE" => $lang['Update'],
+ 'L_GROUP_INFORMATION' => $lang['Group_Information'],
+ 'L_GROUP_NAME' => $lang['Group_name'],
+ 'L_GROUP_DESC' => $lang['Group_description'],
+ 'L_GROUP_TYPE' => $lang['Group_type'],
+ 'L_GROUP_MEMBERSHIP' => $lang['Group_membership'],
+ 'L_SUBSCRIBE' => $lang['Subscribe'],
+ 'L_UNSUBSCRIBE' => $lang['Unsubscribe'],
+ 'L_JOIN_GROUP' => $lang['Join_group'],
+ 'L_UNSUBSCRIBE_GROUP' => $lang['Unsubscribe'],
+ 'L_GROUP_OPEN' => $lang['Group_open'],
+ 'L_GROUP_CLOSED' => $lang['Group_closed'],
+ 'L_GROUP_HIDDEN' => $lang['Group_hidden'],
+ 'L_UPDATE' => $lang['Update'],
+ 'L_GROUP_MODERATOR' => $lang['Group_Moderator'],
+ 'L_GROUP_MEMBERS' => $lang['Group_Members'],
+ 'L_PENDING_MEMBERS' => $lang['Pending_members'],
+ 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
+ 'L_PM' => $lang['Private_Message'],
+ 'L_EMAIL' => $lang['Email'],
+ 'L_WEBSITE' => $lang['Website'],
+ 'L_FROM' => $lang['Location'],
+ 'L_ORDER' => $lang['Order'],
+ 'L_SORT' => $lang['Sort'],
+ 'L_SUBMIT' => $lang['Sort'],
+ 'L_AIM' => $lang['AIM'],
+ 'L_YIM' => $lang['YIM'],
+ 'L_MSNM' => $lang['MSNM'],
+ 'L_ICQ' => $lang['ICQ'],
+ 'L_SELECT' => $lang['Select'],
+ 'L_REMOVE_SELECTED' => $lang['Remove_selected'],
+ 'L_ADD_MEMBER' => $lang['Add_member'],
+ 'L_FIND_USERNAME' => $lang['Find_username'],
- "GROUP_NAME" => $group_info['group_name'],
- "GROUP_DESC" => $group_info['group_description'],
- "GROUP_DETAILS" => $group_details,
+ 'GROUP_NAME' => $group_info['group_name'],
+ 'GROUP_DESC' => $group_info['group_description'],
+ 'GROUP_DETAILS' => $group_details,
+ 'MOD_ROW_COLOR' => '#' . $theme['td_color1'],
+ 'MOD_ROW_CLASS' => $theme['td_class1'],
+ 'MOD_USERNAME' => $username,
+ 'MOD_FROM' => $from,
+ 'MOD_JOINED' => $joined,
+ 'MOD_POSTS' => $posts,
+ 'MOD_AVATAR_IMG' => $poster_avatar,
+ 'MOD_PROFILE_IMG' => $profile_img,
+ 'MOD_PROFILE' => $profile,
+ 'MOD_SEARCH_IMG' => $search_img,
+ 'MOD_SEARCH' => $search,
+ 'MOD_PM_IMG' => $pm_img,
+ 'MOD_PM' => $pm,
+ 'MOD_EMAIL_IMG' => $email_img,
+ 'MOD_EMAIL' => $email,
+ 'MOD_WWW_IMG' => $www_img,
+ 'MOD_WWW' => $www,
+ 'MOD_ICQ_STATUS_IMG' => $icq_status_img,
+ 'MOD_ICQ_IMG' => $icq_img,
+ 'MOD_ICQ' => $icq,
+ 'MOD_AIM_IMG' => $aim_img,
+ 'MOD_AIM' => $aim,
+ 'MOD_MSN_IMG' => $msn_img,
+ 'MOD_MSN' => $msn,
+ 'MOD_YIM_IMG' => $yim_img,
+ 'MOD_YIM' => $yim,
- "S_GROUP_OPEN_TYPE" => GROUP_OPEN,
- "S_GROUP_CLOSED_TYPE" => GROUP_CLOSED,
- "S_GROUP_HIDDEN_TYPE" => GROUP_HIDDEN,
- "S_GROUP_OPEN_CHECKED" => ( $group_info['group_type'] == GROUP_OPEN ) ? "checked=\"checked\"" : "",
- "S_GROUP_CLOSED_CHECKED" => ( $group_info['group_type'] == GROUP_CLOSED ) ? "checked=\"checked\"" : "",
- "S_GROUP_HIDDEN_CHECKED" => ( $group_info['group_type'] == GROUP_HIDDEN ) ? "checked=\"checked\"" : "",
- "S_HIDDEN_FIELDS" => $s_hidden_fields)
- );
+ 'U_MOD_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"),
+ 'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser"),
- //
- // Generate memberlist if there any!
- //
- $template->assign_vars(array(
- "L_GROUP_MODERATOR" => $lang['Group_Moderator'],
- "L_GROUP_MEMBERS" => $lang['Group_Members'],
- "L_PENDING_MEMBERS" => $lang['Pending_members'],
- "L_SELECT_SORT_METHOD" => $lang['Select_sort_method'],
- "L_PM" => $lang['Private_Message'],
- "L_EMAIL" => $lang['Email'],
- "L_WEBSITE" => $lang['Website'],
- "L_FROM" => $lang['Location'],
- "L_ORDER" => $lang['Order'],
- "L_SORT" => $lang['Sort'],
- "L_SUBMIT" => $lang['Sort'],
- "L_AIM" => $lang['AIM'],
- "L_YIM" => $lang['YIM'],
- "L_MSNM" => $lang['MSNM'],
- "L_ICQ" => $lang['ICQ'],
- "L_SELECT" => $lang['Select'],
- "L_REMOVE_SELECTED" => $lang['Remove_selected'],
- "L_ADD_MEMBER" => $lang['Add_member'],
- "L_FIND_USERNAME" => $lang['Find_username'],
-
- "MOD_ROW_COLOR" => "#" . $theme['td_color1'],
- "MOD_ROW_CLASS" => $theme['td_class1'],
- "MOD_USERNAME" => $username,
- "MOD_FROM" => $from,
- "MOD_JOINED" => $joined,
- "MOD_POSTS" => $posts,
- "MOD_EMAIL_IMG" => $email_img,
- "MOD_PM_IMG" => $pm_img,
- "MOD_WWW_IMG" => $www_img,
- "MOD_ICQ_STATUS_IMG" => $icq_status_img,
- "MOD_ICQ_ADD_IMG" => $icq_add_img,
- "MOD_AIM_IMG" => $aim_img,
- "MOD_YIM_IMG" => $yim_img,
- "MOD_MSN_IMG" => $msn_img,
- "MOD_SEARCH_IMG" => $search,
-
- "U_MOD_VIEWPROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $user_id),
- "U_SEARCH_USER" => append_sid("search.$phpEx?mode=searchuser"),
-
- "S_MODE_SELECT" => $select_sort_mode,
- "S_ORDER_SELECT" => $select_sort_order,
- "S_GROUPCP_ACTION" => append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id"))
+ 'S_GROUP_OPEN_TYPE' => GROUP_OPEN,
+ 'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED,
+ 'S_GROUP_HIDDEN_TYPE' => GROUP_HIDDEN,
+ 'S_GROUP_OPEN_CHECKED' => ( $group_info['group_type'] == GROUP_OPEN ) ? ' checked="checked"' : '',
+ 'S_GROUP_CLOSED_CHECKED' => ( $group_info['group_type'] == GROUP_CLOSED ) ? ' checked="checked"' : '',
+ 'S_GROUP_HIDDEN_CHECKED' => ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '',
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields,
+ 'S_MODE_SELECT' => $select_sort_mode,
+ 'S_ORDER_SELECT' => $select_sort_order,
+ 'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id"))
);
//
@@ -961,79 +980,48 @@ else if( $group_id )
$username = $group_members[$i]['username'];
$user_id = $group_members[$i]['user_id'];
- $from = $group_members[$i]['user_from'];
+ generate_user_info($group_members[$i], $board_config['default_dateformat'], $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim);
- $joined = create_date($board_config['default_dateformat'], $group_members[$i]['user_regdate'], $board_config['board_timezone']);
-
- $posts = ($group_members[$i]['user_posts']) ? $group_members[$i]['user_posts'] : 0;
-
- $profile_img = " ";
-
- $pm_img = " ";
-
- if ( !empty($group_members[$i]['user_viewemail']) )
- {
- $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_members[$i]['user_id']) : "mailto:" . $group_members[$i]['user_email'];
-
- $email_img = " ";
- }
- else
- {
- $email_img = "";
- }
-
- $www_img = ( $group_members[$i]['user_website'] ) ? " " : " ";
-
- if ( !empty($group_members[$i]['user_icq']) )
- {
- $icq_status_img = " ";
- $icq_add_img = " ";
- }
- else
- {
- $icq_status_img = "";
- $icq_add_img = "";
- }
-
- $aim_img = ( $group_members[$i]['user_aim'] ) ? " " : "";
-
- $msn_img = ( $group_members[$i]['user_msnm'] ) ? " " : "";
-
- $yim_img = ( $group_members[$i]['user_yim'] ) ? " " : "";
-
- $search_img = " ";
-
if ( $group_info['group_type'] != GROUP_HIDDEN || $is_group_member || $is_moderator )
{
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $template->assign_block_vars("member_row", array(
- "ROW_COLOR" => "#" . $row_color,
- "ROW_CLASS" => $row_class,
- "USERNAME" => $username,
- "FROM" => $from,
- "JOINED" => $joined,
- "POSTS" => $posts,
-
- "USER_ID" => $user_id,
-
- "EMAIL_IMG" => $email_img,
- "PM_IMG" => $pm_img,
- "WWW_IMG" => $www_img,
- "ICQ_STATUS_IMG" => $icq_status_img,
- "ICQ_ADD_IMG" => $icq_add_img,
- "AIM_IMG" => $aim_img,
- "YIM_IMG" => $yim_img,
- "MSN_IMG" => $msn_img,
- "SEARCH_IMG" => $search,
-
- "U_VIEWPROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $user_id))
+ $template->assign_block_vars('member_row', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'USERNAME' => $username,
+ 'FROM' => $from,
+ 'JOINED' => $joined,
+ 'POSTS' => $posts,
+ 'USER_ID' => $user_id,
+ 'AVATAR_IMG' => $poster_avatar,
+ 'PROFILE_IMG' => $profile_img,
+ 'PROFILE' => $profile,
+ 'SEARCH_IMG' => $search_img,
+ 'SEARCH' => $search,
+ 'PM_IMG' => $pm_img,
+ 'PM' => $pm,
+ 'EMAIL_IMG' => $email_img,
+ 'EMAIL' => $email,
+ 'WWW_IMG' => $www_img,
+ 'WWW' => $www,
+ 'ICQ_STATUS_IMG' => $icq_status_img,
+ 'ICQ_IMG' => $icq_img,
+ 'ICQ' => $icq,
+ 'AIM_IMG' => $aim_img,
+ 'AIM' => $aim,
+ 'MSN_IMG' => $msn_img,
+ 'MSN' => $msn,
+ 'YIM_IMG' => $yim_img,
+ 'YIM' => $yim,
+
+ 'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
);
if ( $is_moderator )
{
- $template->assign_block_vars("member_row.switch_mod_option", array());
+ $template->assign_block_vars('member_row.switch_mod_option', array());
}
}
}
@@ -1043,18 +1031,19 @@ else if( $group_id )
//
// No group members
//
- $template->assign_block_vars("switch_no_members", array());
-
+ $template->assign_block_vars('switch_no_members', array());
$template->assign_vars(array(
- "L_NO_MEMBERS" => $lang['No_group_members'])
+ 'L_NO_MEMBERS' => $lang['No_group_members'])
);
}
- $current_page = ( !$members_count ) ? '1' : ceil( $members_count / $board_config['topics_per_page'] );
- $template->assign_vars(array(
- "PAGINATION" => generate_pagination("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id", $members_count, $board_config['topics_per_page'], $start),
- "PAGE_NUMBER" => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), $current_page ),
- "L_GOTO_PAGE" => $lang['Goto_page'])
+ $current_page = ( !$members_count ) ? 1 : ceil( $members_count / $board_config['topics_per_page'] );
+
+ $template->assign_vars(array(
+ 'PAGINATION' => generate_pagination("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id", $members_count, $board_config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), $current_page ),
+
+ 'L_GOTO_PAGE' => $lang['Goto_page'])
);
if ( $group_info['group_type'] == GROUP_HIDDEN && !$is_group_member && !$is_moderator )
@@ -1062,10 +1051,9 @@ else if( $group_id )
//
// No group members
//
- $template->assign_block_vars("switch_hidden_group", array());
-
+ $template->assign_block_vars('switch_hidden_group', array());
$template->assign_vars(array(
- "L_HIDDEN_MEMBERS" => $lang['Group_hidden_members'])
+ 'L_HIDDEN_MEMBERS' => $lang['Group_hidden_members'])
);
}
@@ -1085,108 +1073,71 @@ else if( $group_id )
$username = $modgroup_pending_list[$i]['username'];
$user_id = $modgroup_pending_list[$i]['user_id'];
- $from = $modgroup_pending_list[$i]['user_from'];
-
- $joined = create_date($board_config['default_dateformat'], $modgroup_pending_list[$i]['user_regdate'], $board_config['board_timezone']);
-
- $posts = ( $modgroup_pending_list[$i]['user_posts'] ) ? $modgroup_pending_list[$i]['user_posts'] : 0;
-
- $profile_img = " ";
-
- $pm_img = " ";
-
- if ( !empty($modgroup_pending_list[$i]['user_viewemail']) )
- {
- $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $modgroup_pending_list[$i]['user_id']) : "mailto:" . $modgroup_pending_list[$i]['user_email'];
-
- $email_img = " ";
- }
- else
- {
- $email_img = "";
- }
-
- $www_img = ( $modgroup_pending_list[$i]['user_website'] ) ? " " : "";
-
- if ( !empty($modgroup_pending_list[$i]['user_icq']) )
- {
- $icq_status_img = " ";
- $icq_add_img = " ";
- }
- else
- {
- $icq_status_img = "";
- $icq_add_img = "";
- }
-
- $aim_img = ( $modgroup_pending_list[$i]['user_aim'] ) ? " " : "";
-
- $msn_img = ( $modgroup_pending_list[$i]['user_msnm'] ) ? " " : "";
-
- $yim_img = ( $modgroup_pending_list[$i]['user_yim'] ) ? " " : "";
-
- $search_img = " ";
+ generate_user_info($modgroup_pending_list[$i], $board_config['default_dateformat'], $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim);
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$user_select = ' ';
- $template->assign_block_vars("pending_members_row", array(
- "U_VIEWPROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $user_id),
-
- "ROW_CLASS" => $row_class,
- "USERNAME" => $username,
- "FROM" => $from,
- "JOINED" => $joined,
- "POSTS" => $posts,
-
- "USER_ID" => $user_id,
-
- "EMAIL_IMG" => $email_img,
- "PM_IMG" => $pm_img,
- "SEARCH_IMG" => $search,
- "WWW_IMG" => $www_img,
- "ICQ_STATUS_IMG" => $icq_status_img,
- "ICQ_ADD_IMG" => $icq_add_img,
- "AIM_IMG" => $aim_img,
- "YIM_IMG" => $yim_img,
- "MSN_IMG" => $msn_img,
- "SELECT" => $user_select)
+ $template->assign_block_vars('pending_members_row', array(
+ 'ROW_CLASS' => $row_class,
+ 'ROW_COLOR' => '#' . $row_color,
+ 'USERNAME' => $username,
+ 'FROM' => $from,
+ 'JOINED' => $joined,
+ 'POSTS' => $posts,
+ 'USER_ID' => $user_id,
+ 'AVATAR_IMG' => $poster_avatar,
+ 'PROFILE_IMG' => $profile_img,
+ 'PROFILE' => $profile,
+ 'SEARCH_IMG' => $search_img,
+ 'SEARCH' => $search,
+ 'PM_IMG' => $pm_img,
+ 'PM' => $pm,
+ 'EMAIL_IMG' => $email_img,
+ 'EMAIL' => $email,
+ 'WWW_IMG' => $www_img,
+ 'WWW' => $www,
+ 'ICQ_STATUS_IMG' => $icq_status_img,
+ 'ICQ_IMG' => $icq_img,
+ 'ICQ' => $icq,
+ 'AIM_IMG' => $aim_img,
+ 'AIM' => $aim,
+ 'MSN_IMG' => $msn_img,
+ 'MSN' => $msn,
+ 'YIM_IMG' => $yim_img,
+ 'YIM' => $yim,
+
+ 'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
);
}
- $template->assign_block_vars("switch_pending_members", array() );
+ $template->assign_block_vars('switch_pending_members', array() );
$template->assign_vars(array(
- "L_SELECT" => $lang['Select'],
- "L_APPROVE_SELECTED" => $lang['Approve_selected'],
- "L_DENY_SELECTED" => $lang['Deny_selected'])
+ 'L_SELECT' => $lang['Select'],
+ 'L_APPROVE_SELECTED' => $lang['Approve_selected'],
+ 'L_DENY_SELECTED' => $lang['Deny_selected'])
);
- $template->assign_var_from_handle("PENDING_USER_BOX", "pendinginfo");
+ $template->assign_var_from_handle('PENDING_USER_BOX', 'pendinginfo');
}
}
if ( $is_moderator )
{
- $template->assign_block_vars("switch_mod_option", array());
- $template->assign_block_vars("switch_add_member", array());
+ $template->assign_block_vars('switch_mod_option', array());
+ $template->assign_block_vars('switch_add_member', array());
}
- //
- // Parse group info output
- //
- $template->pparse("info");
-
+ $template->pparse('info');
}
else
{
//
// Show the main groupcp.php screen where the user can select a group.
- //
-
//
// Select all group that the user is a member of or where the user has
// a pending membership.
@@ -1232,7 +1183,7 @@ else
//
// Select all other groups i.e. groups that this user is not a member of
//
- $ignore_group_sql = ( count($in_group) ) ? "AND group_id NOT IN (" . implode(", ", $in_group) . ")" : "";
+ $ignore_group_sql = ( count($in_group) ) ? "AND group_id NOT IN (" . implode(', ', $in_group) . ")" : '';
$sql = "SELECT group_id, group_name, group_type
FROM " . GROUPS_TABLE . " g
WHERE group_single_user <> " . TRUE . "
@@ -1261,39 +1212,28 @@ else
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- 'user' => 'groupcp_user_body.tpl',
- 'jumpbox' => 'jumpbox.tpl')
+ 'user' => 'groupcp_user_body.tpl')
);
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+ make_jumpbox('viewforum.'.$phpEx);
if ( $s_pending_groups_opt != '' || $s_member_groups_opt != '' )
{
- $template->assign_block_vars('groups_joined', array() );
+ $template->assign_block_vars('switch_groups_joined', array() );
}
if ( $s_member_groups_opt != '' )
{
- $template->assign_block_vars('groups_joined.groups_member', array() );
+ $template->assign_block_vars('switch_groups_joined.switch_groups_member', array() );
}
if ( $s_pending_groups_opt != '' )
{
- $template->assign_block_vars('groups_joined.groups_pending', array() );
+ $template->assign_block_vars('switch_groups_joined.switch_groups_pending', array() );
}
if ( $s_group_list_opt != '' )
{
- $template->assign_block_vars('groups_remaining', array() );
+ $template->assign_block_vars('switch_groups_remaining', array() );
}
$s_hidden_fields = ' ';
@@ -1325,9 +1265,6 @@ else
}
-//
-// Page footer
-//
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
\ No newline at end of file
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 602d241578..8ae87f656f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -90,9 +90,9 @@ function get_userdata($user)
return ( $row = $db->sql_fetchrow($result) ) ? $row : false;
}
-function make_jumpbox($match_forum_id = 0)
+function make_jumpbox($action, $match_forum_id = 0)
{
- global $lang, $db, $SID, $nav_links, $phpEx;
+ global $template, $lang, $db, $SID, $nav_links, $phpEx;
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
@@ -174,7 +174,20 @@ function make_jumpbox($match_forum_id = 0)
$boxstring .= ' ';
}
- return $boxstring;
+ $template->set_filenames(array(
+ 'jumpbox' => 'jumpbox.tpl')
+ );
+ $template->assign_vars(array(
+ 'L_GO' => $lang['Go'],
+ 'L_JUMP_TO' => $lang['Jump_to'],
+ 'L_SELECT_FORUM' => $lang['Select_forum'],
+
+ 'S_JUMPBOX_SELECT' => $boxstring,
+ 'S_JUMPBOX_ACTION' => append_sid($action))
+ );
+ $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+
+ return;
}
//
diff --git a/phpBB/includes/functions_search.php b/phpBB/includes/functions_search.php
index b28bf699ee..b74ac398b4 100644
--- a/phpBB/includes/functions_search.php
+++ b/phpBB/includes/functions_search.php
@@ -22,20 +22,12 @@
function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
{
// Weird, $init_match doesn't work with static when double quotes (") are used...
- static $drop_char_match = array('^', '$', '&', '(', ')', '<', '>', '`', "'", '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
- static $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' ');
-
-// static $accent_match = array("ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");
-// static $accent_replace = array("s", "a", "a", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "o", "n", "o", "o", "o", "o", "o", "o", "u", "u", "u", "u", "y", "t", "y");
+ static $drop_char_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
+ static $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' ');
$entry = ' ' . strip_tags(strtolower($entry)) . ' ';
- for($i = 0; $i < count($accent_match); $i++)
- {
- $entry = str_replace($accent_match[$i], $accent_replace[$i], $entry);
- }
-
- if( $mode == 'post' )
+ if ( $mode == 'post' )
{
// Replace line endings by a space
$entry = preg_replace('/[\n\r]/is', ' ', $entry);
@@ -48,7 +40,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
$entry = preg_replace('/\[\/?url(=.*?)?\]/', ' ', $entry);
$entry = preg_replace('/\[\/?[a-z\*=\+\-]+(\:?[0-9a-z]+)?:[a-z0-9]{10,}(\:[a-z0-9]+)?=?.*?\]/', ' ', $entry);
}
- else if( $mode == 'search' )
+ else if ( $mode == 'search' )
{
$entry = str_replace('+', ' and ', $entry);
$entry = str_replace('-', ' not ', $entry);
@@ -65,15 +57,15 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
$entry = str_replace($drop_char_match[$i], $drop_char_replace[$i], $entry);
}
- if( $mode == 'post' )
+ if ( $mode == 'post' )
{
$entry = str_replace('*', ' ', $entry);
// 'words' that consist of <=3 or >=25 characters are removed.
- $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{25,})\b/',' ', $entry);
+ $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{20,})\b/',' ', $entry);
}
- if( !empty($stopword_list) )
+ if ( !empty($stopword_list) )
{
for ($j = 0; $j < count($stopword_list); $j++)
{
@@ -86,7 +78,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
}
}
- if( !empty($synonym_list) )
+ if ( !empty($synonym_list) )
{
for ($j = 0; $j < count($synonym_list); $j++)
{
@@ -103,7 +95,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
function split_words(&$entry, $mode = 'post')
{
- if( $mode == 'post' )
+ if ( $mode == 'post' )
{
preg_match_all("/\b(\w[\w']*\w+|\w+?)\b/", $entry, $split_entries);
}
@@ -128,10 +120,10 @@ function add_search_words($post_id, $post_text, $post_title = '')
$word = array();
$word_insert_sql = array();
- while( list($word_in, $search_matches) = @each($search_raw_words) )
+ while ( list($word_in, $search_matches) = @each($search_raw_words) )
{
$word_insert_sql[$word_in] = '';
- if( !empty($search_matches) )
+ if ( !empty($search_matches) )
{
for ($i = 0; $i < count($search_matches); $i++)
{
@@ -149,7 +141,7 @@ function add_search_words($post_id, $post_text, $post_title = '')
}
}
- if( count($word) )
+ if ( count($word) )
{
sort($word);
@@ -178,12 +170,12 @@ function add_search_words($post_id, $post_text, $post_title = '')
$sql = "SELECT word_id, word_text
FROM " . SEARCH_WORD_TABLE . "
WHERE word_text IN ($word_text_sql)";
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select words', '', __LINE__, __FILE__, $sql);
}
- while( $row = $db->sql_fetchrow($result) )
+ while ( $row = $db->sql_fetchrow($result) )
{
$check_words[$row['word_text']] = $row['word_id'];
}
@@ -195,18 +187,18 @@ function add_search_words($post_id, $post_text, $post_title = '')
for ($i = 0; $i < count($word); $i++)
{
$new_match = true;
- if( isset($check_words[$word[$i]]) )
+ if ( isset($check_words[$word[$i]]) )
{
$new_match = false;
}
- if( $new_match )
+ if ( $new_match )
{
switch( SQL_LAYER )
{
case 'mysql':
case 'mysql4':
- $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . "('" . $word[$i] . "')";
+ $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\')';
break;
case 'mssql':
$value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "'";
@@ -238,7 +230,7 @@ function add_search_words($post_id, $post_text, $post_title = '')
break;
}
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql);
}
@@ -255,7 +247,7 @@ function add_search_words($post_id, $post_text, $post_title = '')
SELECT $post_id, word_id, $title_match
FROM " . SEARCH_WORD_TABLE . "
WHERE word_text IN ($match_sql)";
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert new word matches', '', __LINE__, __FILE__, $sql);
}
@@ -278,18 +270,18 @@ function remove_common($mode, $fraction, $word_id_list = array())
global $db;
$sql = ( $mode == 'global' ) ? "SELECT COUNT(post_id) AS total_posts FROM " . SEARCH_MATCH_TABLE . " GROUP BY post_id" : "SELECT SUM(forum_posts) AS total_posts FROM " . FORUMS_TABLE;
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain post count', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
- if( $row['total_posts'] >= 100 )
+ if ( $row['total_posts'] >= 100 )
{
$common_threshold = floor($row['total_posts'] * $fraction);
- if( $mode == 'single' && count($word_id_list) )
+ if ( $mode == 'single' && count($word_id_list) )
{
$word_id_sql = '';
for($i = 0; $i < count($word_id_list); $i++)
@@ -312,32 +304,32 @@ function remove_common($mode, $fraction, $word_id_list = array())
HAVING COUNT(word_id) > $common_threshold";
}
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain common word list', '', __LINE__, __FILE__, $sql);
}
$common_word_id = '';
- while( $row = $db->sql_fetchrow($result) )
+ while ( $row = $db->sql_fetchrow($result) )
{
$common_word_id .= ( ( $common_word_id != '' ) ? ', ' : '' ) . $row['word_id'];
}
$db->sql_freeresult($result);
- if( $common_word_id != '' )
+ if ( $common_word_id != '' )
{
$sql = "UPDATE " . SEARCH_WORD_TABLE . "
SET word_common = " . TRUE . "
WHERE word_id IN ($common_word_id)";
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete word list entry', '', __LINE__, __FILE__, $sql);
}
$sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "
WHERE word_id IN ($common_word_id)";
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete word match entry', '', __LINE__, __FILE__, $sql);
}
@@ -353,7 +345,7 @@ function remove_search_post($post_id_sql)
$words_removed = false;
- switch( SQL_LAYER )
+ switch ( SQL_LAYER )
{
case 'mysql':
case 'mysql4':
@@ -364,7 +356,7 @@ function remove_search_post($post_id_sql)
if ( $result = $db->sql_query($sql) )
{
$word_id_sql = '';
- while( $row = $db->sql_fetchrow($result) )
+ while ( $row = $db->sql_fetchrow($result) )
{
$word_id_sql .= ( $word_id_sql != '' ) ? ', ' . $row['word_id'] : $row['word_id'];
}
@@ -377,7 +369,7 @@ function remove_search_post($post_id_sql)
if ( $result = $db->sql_query($sql) )
{
$word_id_sql = '';
- while( $row = $db->sql_fetchrow($result) )
+ while ( $row = $db->sql_fetchrow($result) )
{
$word_id_sql .= ( $word_id_sql != '' ) ? ', ' . $row['word_id'] : $row['word_id'];
}
@@ -434,12 +426,12 @@ function remove_search_post($post_id_sql)
//
// Username search
//
-function username_search($search_match, $is_inline_review = 0, $default_list = "")
+function username_search($search_match)
{
global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
global $starttime;
- $author_list = '';
+ $username_list = '';
if ( !empty($search_match) )
{
$username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match)));
@@ -457,55 +449,49 @@ function username_search($search_match, $is_inline_review = 0, $default_list = "
{
do
{
- $author_list .= '' .$row['username'] . ' ';
+ $username_list .= '' . $row['username'] . ' ';
}
while ( $row = $db->sql_fetchrow($result) );
}
else
{
- $author_list = '' . $lang['No_match']. ' ';
+ $username_list .= '' . $lang['No_match']. ' ';
}
-
}
- if ( !$is_inline_review )
+ $gen_simple_header = TRUE;
+ $page_title = $lang['Search'];
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
+
+ $template->set_filenames(array(
+ 'search_user_body' => 'search_username.tpl')
+ );
+
+ $template->assign_vars(array(
+ 'USERNAME' => ( !empty($search_match) ) ? $search_match : '',
+
+ 'L_CLOSE_WINDOW' => $lang['Close_window'],
+ 'L_SEARCH_USERNAME' => $lang['Find_username'],
+ 'L_UPDATE_USERNAME' => $lang['Select_username'],
+ 'L_SELECT' => $lang['Select'],
+ 'L_SEARCH' => $lang['Search'],
+ 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'],
+ 'L_CLOSE_WINDOW' => $lang['Close_window'],
+
+ 'S_USERNAME_OPTIONS' => $username_list,
+ 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=searchuser"))
+ );
+
+ if ( $username_list != '' )
{
- $gen_simple_header = TRUE;
- $page_title = $lang['Search'];
- include($phpbb_root_path . 'includes/page_header.'.$phpEx);
-
- $template->set_filenames(array(
- 'search_user_body' => 'search_username.tpl')
- );
-
- $template->assign_vars(array(
- 'L_CLOSE_WINDOW' => $lang['Close_window'],
- 'L_SEARCH_USERNAME' => $lang['Find_username'],
- 'L_UPDATE_USERNAME' => $lang['Select_username'],
- 'L_SELECT' => $lang['Select'],
- 'L_SEARCH' => $lang['Search'],
- 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'],
- 'L_CLOSE_WINDOW' => $lang['Close_window'],
-
- 'S_AUTHOR_OPTIONS' => $author_list,
- 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=searchuser"))
- );
-
- //
- // If we have results then dump them out and enable
- // the appropriate switch block
- //
- if ( !empty($author_list) )
- {
- $template->assign_block_vars('switch_select_name', array());
- }
-
- $template->pparse('search_user_body');
-
- include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
+ $template->assign_block_vars('switch_select_name', array());
}
- return($author_list);
+ $template->pparse('search_user_body');
+
+ include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
+
+ return;
}
?>
\ No newline at end of file
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index 1d6465f4d1..8fde164676 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -31,22 +31,22 @@ define('HEADER_INC', TRUE);
// gzip_compression
//
$do_gzip_compress = FALSE;
-if($board_config['gzip_compress'])
+if ( $board_config['gzip_compress'] )
{
$phpver = phpversion();
- if($phpver >= '4.0.4pl1')
+ if ( $phpver >= '4.0.4pl1' )
{
- if(extension_loaded('zlib'))
+ if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
- else if($phpver > '4.0')
+ else if ( $phpver > '4.0' )
{
- if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
+ if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
- if(extension_loaded('zlib'))
+ if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
@@ -68,14 +68,14 @@ $template->set_filenames(array(
//
// Generate logged in/logged out status
//
-if($userdata['session_logged_in'])
+if ( $userdata['session_logged_in'] )
{
- $u_login_logout = "login.$phpEx?logout=true";
- $l_login_logout = $lang['Logout'] . ' [ ' . $userdata["username"] . ' ]';
+ $u_login_logout = 'login.'.$phpEx.'?logout=true';
+ $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
else
{
- $u_login_logout = "login.$phpEx";
+ $u_login_logout = 'login.'.$phpEx;
$l_login_logout = $lang['Login'];
}
@@ -87,7 +87,6 @@ $s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['
//
$user_forum_sql = ( !empty($forum_id) ) ? "AND ( u.user_session_page = $forum_id
OR s.session_page = $forum_id)" : '';
-
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
@@ -95,8 +94,7 @@ $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.s
OR u.user_session_time >= " . ( time() - 300 ) . " )
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
-$result = $db->sql_query($sql);
-if(!$result)
+if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
@@ -115,24 +113,24 @@ $prev_user_ip = '';
while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
- if( $row['session_logged_in'] )
+ if ( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
- if( $row['user_id'] != $prev_user_id )
+ if ( $row['user_id'] != $prev_user_id )
{
$style_color = '';
- if( $row['user_level'] == ADMIN )
+ if ( $row['user_level'] == ADMIN )
{
$row['username'] = '' . $row['username'] . ' ';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
- else if( $row['user_level'] == MOD )
+ else if ( $row['user_level'] == MOD )
{
$row['username'] = '' . $row['username'] . ' ';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
- if( $row['user_allow_viewonline'] )
+ if ( $row['user_allow_viewonline'] )
{
$user_online_link = '' . $row['username'] . ' ';
$logged_visible_online++;
@@ -143,26 +141,27 @@ while( $row = $db->sql_fetchrow($result) )
$logged_hidden_online++;
}
- if( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
+ if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
- $online_userlist .= ( $online_userlist != "" ) ? ", " . $user_online_link : $user_online_link;
+ $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link;
}
}
+
+ $prev_user_id = $row['user_id'];
}
else
{
// Skip multiple sessions for one user
- if( $row['session_ip'] != $prev_session_ip )
+ if ( $row['session_ip'] != $prev_session_ip )
{
$guests_online++;
}
}
$prev_session_ip = $row['session_ip'];
- $prev_user_id = $row['user_id'];
}
-if( empty($online_userlist) )
+if ( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
@@ -172,31 +171,31 @@ $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_o
if ( $total_online_users > $board_config['record_online_users'])
{
+ $board_config['record_online_users'] = $total_online_users;
+ $board_config['record_online_date'] = time();
+
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$total_online_users'
WHERE config_name = 'record_online_users'";
- if ( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . CONFIG_TABLE . "
- SET config_value = '" . time() . "'
+ SET config_value = '" . $board_config['record_online_date'] . "'
WHERE config_name = 'record_online_date'";
- if ( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);
}
-
- $board_config['record_online_users'] = $total_online_users;
- $board_config['record_online_date'] = time();
}
-if( $total_online_users == 0 )
+if ( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
-else if( $total_online_users == 1 )
+else if ( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
@@ -205,11 +204,11 @@ else
$l_t_user_s = $lang['Online_users_total'];
}
-if( $logged_visible_online == 0 )
+if ( $logged_visible_online == 0 )
{
$l_r_user_s = $lang['Reg_users_zero_total'];
}
-else if( $logged_visible_online == 1 )
+else if ( $logged_visible_online == 1 )
{
$l_r_user_s = $lang['Reg_user_total'];
}
@@ -218,11 +217,11 @@ else
$l_r_user_s = $lang['Reg_users_total'];
}
-if( $logged_hidden_online == 0 )
+if ( $logged_hidden_online == 0 )
{
$l_h_user_s = $lang['Hidden_users_zero_total'];
}
-else if( $logged_hidden_online == 1 )
+else if ( $logged_hidden_online == 1 )
{
$l_h_user_s = $lang['Hidden_user_total'];
}
@@ -231,11 +230,11 @@ else
$l_h_user_s = $lang['Hidden_users_total'];
}
-if( $guests_online == 0 )
+if ( $guests_online == 0 )
{
$l_g_user_s = $lang['Guest_users_zero_total'];
}
-else if( $guests_online == 1 )
+else if ( $guests_online == 1 )
{
$l_g_user_s = $lang['Guest_user_total'];
}
@@ -253,19 +252,19 @@ $l_online_users .= sprintf($l_g_user_s, $guests_online);
// Obtain number of new private messages
// if user is logged in
//
-if( $userdata['session_logged_in'] )
+if ( $userdata['session_logged_in'] )
{
- if( $userdata['user_new_privmsg'] )
+ if ( $userdata['user_new_privmsg'] )
{
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);
- if( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
+ if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_last_privmsg = " . $userdata['user_lastvisit'] . "
WHERE user_id = " . $userdata['user_id'];
- if( !$status = $db->sql_query($sql) )
+ if ( !($status = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
}
@@ -287,7 +286,7 @@ if( $userdata['session_logged_in'] )
$icon_pm = $images['pm_no_new_msg'];
}
- if( $userdata['user_unread_privmsg'] )
+ if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
@@ -301,7 +300,7 @@ else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
- $l_privmsgs_text_unread = "";
+ $l_privmsgs_text_unread = '';
$s_privmsg_new = 0;
}
@@ -310,16 +309,16 @@ else
//
$nav_links_html = '';
$nav_link_proto = ' ' . "\n";
-while(list($nav_item, $nav_array) = @each($nav_links) )
+while( list($nav_item, $nav_array) = @each($nav_links) )
{
- if( !empty($nav_array['url']) )
+ if ( !empty($nav_array['url']) )
{
$nav_links_html .= sprintf($nav_link_proto, $nav_item, $nav_array['url'], $nav_array['title']);
}
else
{
// We have a nested array, used for items like that can occur more than once.
- while(list(,$nested_array) = each($nav_array) )
+ while( list(,$nested_array) = each($nav_array) )
{
$nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']);
}
@@ -328,63 +327,43 @@ while(list($nav_item, $nav_array) = @each($nav_links) )
//
// The following assigns all _common_ variables that may be used at any point
-// in a template. Note that all URL's should be wrapped in append_sid, as
-// should all S_x_ACTIONS for forms.
+// in a template.
//
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'SITE_DESCRIPTION' => $board_config['site_desc'],
'PAGE_TITLE' => $page_title,
+ 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
+ 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
'TOTAL_USERS_ONLINE' => $l_online_users,
- 'LOGGED_IN_USER_LIST' => $online_userlist,
+ 'LOGGED_IN_USER_LIST' => $online_userlist,
+ 'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
- 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
- 'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
'PRIVMSG_IMG' => $icon_pm,
- 'L_USERNAME' => $lang['Username'],
- 'L_PASSWORD' => $lang['Password'],
- 'L_LOGIN' => $lang['Login'],
- 'L_LOG_ME_IN' => $lang['Log_me_in'],
- 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
- 'L_REGISTER' => $lang['Register'],
- 'L_PROFILE' => $lang['Profile'],
- 'L_SEARCH' => $lang['Search'],
- 'L_PRIVATEMSGS' => $lang['Private_Messages'],
- 'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
- 'L_MEMBERLIST' => $lang['Memberlist'],
- 'L_FAQ' => $lang['FAQ'],
- 'L_USERGROUPS' => $lang['Usergroups'],
- 'L_FORUM' => $lang['Forum'],
- 'L_TOPICS' => $lang['Topics'],
- 'L_REPLIES' => $lang['Replies'],
- 'L_VIEWS' => $lang['Views'],
- 'L_POSTS' => $lang['Posts'],
- 'L_LASTPOST' => $lang['Last_Post'],
- 'L_NO_NEW_POSTS' => $lang['No_new_posts'],
- 'L_NEW_POSTS' => $lang['New_posts'],
- 'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'],
- 'L_NEW_POSTS_HOT' => $lang['New_posts_hot'],
- 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
- 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
- 'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
- 'L_STICKY' => $lang['Post_Sticky'],
- 'L_POSTED' => $lang['Posted'],
- 'L_JOINED' => $lang['Joined'],
- 'L_AUTO_LOGIN' => $lang['Log_me_in'],
- 'L_AUTHOR' => $lang['Author'],
- 'L_SUBJECT' => $lang['Subject'],
- 'L_MESSAGE' => $lang['Message'],
- 'L_LOGIN_LOGOUT' => $l_login_logout,
+ 'L_USERNAME' => $lang['Username'],
+ 'L_PASSWORD' => $lang['Password'],
+ 'L_LOGIN_LOGOUT' => $l_login_logout,
+ 'L_LOGIN' => $lang['Login'],
+ 'L_LOG_ME_IN' => $lang['Log_me_in'],
+ 'L_AUTO_LOGIN' => $lang['Log_me_in'],
+ 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
+ 'L_REGISTER' => $lang['Register'],
+ 'L_PROFILE' => $lang['Profile'],
+ 'L_SEARCH' => $lang['Search'],
+ 'L_PRIVATEMSGS' => $lang['Private_Messages'],
+ 'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
+ 'L_MEMBERLIST' => $lang['Memberlist'],
+ 'L_FAQ' => $lang['FAQ'],
+ 'L_USERGROUPS' => $lang['Usergroups'],
'L_SEARCH_NEW' => $lang['Search_new'],
- 'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'],
+ 'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'],
'L_SEARCH_SELF' => $lang['Search_your_posts'],
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '', ' '),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '', ' '),
- 'L_RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
@@ -455,7 +434,7 @@ $template->assign_vars(array(
//
// Login box?
//
-if( !$userdata['session_logged_in'] )
+if ( !$userdata['session_logged_in'] )
{
$template->assign_block_vars('switch_user_logged_out', array());
}
@@ -463,23 +442,20 @@ else
{
$template->assign_block_vars('switch_user_logged_in', array());
- if( !empty($userdata['user_popup_pm']) )
+ if ( !empty($userdata['user_popup_pm']) )
{
$template->assign_block_vars('switch_enable_pm_popup', array());
}
}
-if ( $HTTP_SERVER_VARS['REQUEST_METHOD'] == 'POST' )
-{
- header ('Cache-Control: private, must-revalidate, max-age=25');
-}
-else
+
+if ( getenv('REQUEST_METHOD') != 'POST' )
{
header ('Cache-Control: private, no-cache, must-revalidate, pre-check=2, post-check=2, max-age=25');
header ('Pragma: no-cache');
- header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
}
+header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
$template->pparse('overall_header');
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/includes/topic_review.php b/phpBB/includes/topic_review.php
index 54afbbc074..bc4d0b05e4 100644
--- a/phpBB/includes/topic_review.php
+++ b/phpBB/includes/topic_review.php
@@ -28,9 +28,9 @@ function topic_review($topic_id, $is_inline_review)
global $orig_word, $replacement_word;
global $starttime;
- if( !$is_inline_review )
+ if ( !$is_inline_review )
{
- if( !isset($topic_id) )
+ if ( !isset($topic_id) )
{
message_die(GENERAL_MESSAGE, 'Topic_not_exist');
}
@@ -42,12 +42,12 @@ function topic_review($topic_id, $is_inline_review)
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id";
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
- if( !($forum_row = $db->sql_fetchrow($result)) )
+ if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
@@ -76,7 +76,7 @@ function topic_review($topic_id, $is_inline_review)
//
// Define censored word matches
//
- if( empty($orig_word) && empty($replacement_word) )
+ if ( empty($orig_word) && empty($replacement_word) )
{
$orig_word = array();
$replacement_word = array();
@@ -87,15 +87,15 @@ function topic_review($topic_id, $is_inline_review)
//
// Dump out the page header and load viewtopic body template
//
- if( !$is_inline_review )
+ if ( !$is_inline_review )
{
$gen_simple_header = TRUE;
- $page_title = $lang['Topic_review'] ." - $topic_title";
+ $page_title = $lang['Topic_review'] . ' - ' . $topic_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "reviewbody" => "posting_topic_review.tpl")
+ 'reviewbody' => 'posting_topic_review.tpl')
);
}
@@ -109,9 +109,9 @@ function topic_review($topic_id, $is_inline_review)
AND p.post_id = pt.post_id
ORDER BY p.post_time DESC
LIMIT " . $board_config['posts_per_page'];
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain post/user information.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql);
}
//
@@ -120,6 +120,9 @@ function topic_review($topic_id, $is_inline_review)
//
if ( $row = $db->sql_fetchrow($result) )
{
+ $mini_post_img = $images['icon_minipost'];
+ $mini_post_alt = $lang['Post'];
+
$i = 0;
do
{
@@ -128,8 +131,6 @@ function topic_review($topic_id, $is_inline_review)
$post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
- $mini_post_img = ' ';
-
//
// Handle anon users posting with usernames
//
@@ -139,7 +140,7 @@ function topic_review($topic_id, $is_inline_review)
$poster_rank = $lang['Guest'];
}
- $post_subject = ( $row['post_subject'] != "" ) ? $row['post_subject'] : "";
+ $post_subject = ( $row['post_subject'] != '' ) ? $row['post_subject'] : '';
$message = $row['post_text'];
$bbcode_uid = $row['bbcode_uid'];
@@ -150,12 +151,12 @@ function topic_review($topic_id, $is_inline_review)
//
if ( !$board_config['allow_html'] && $row['enable_html'] )
{
- $message = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $message);
+ $message = preg_replace('#(<)([\/]?.*?)(>)#is', '<\2>', $message);
}
if ( $bbcode_uid != "" )
{
- $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $message);
+ $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
$message = make_clickable($message);
@@ -171,7 +172,7 @@ function topic_review($topic_id, $is_inline_review)
$message = smilies_pass($message);
}
- $message = str_replace("\n", " ", $message);
+ $message = str_replace("\n", ' ', $message);
//
// Again this will be handled by the templating
@@ -180,15 +181,17 @@ function topic_review($topic_id, $is_inline_review)
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $template->assign_block_vars("postrow", array(
- "ROW_COLOR" => "#" . $row_color,
- "ROW_CLASS" => $row_class,
+ $template->assign_block_vars('postrow', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
- "MINI_POST_IMG" => $mini_post_img,
- "POSTER_NAME" => $poster,
- "POST_DATE" => $post_date,
- "POST_SUBJECT" => $post_subject,
- "MESSAGE" => $message)
+ 'MINI_POST_IMG' => $mini_post_img,
+ 'POSTER_NAME' => $poster,
+ 'POST_DATE' => $post_date,
+ 'POST_SUBJECT' => $post_subject,
+ 'MESSAGE' => $message,
+
+ 'L_MINI_POST_ALT' => $mini_post_alt)
);
$i++;
@@ -197,18 +200,20 @@ function topic_review($topic_id, $is_inline_review)
}
else
{
- message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', '', __LINE__, __FILE__, $sql);
}
$template->assign_vars(array(
- "L_POSTED" => $lang['Posted'],
- "L_POST_SUBJECT" => $lang['Post_subject'],
- "L_TOPIC_REVIEW" => $lang['Topic_review'])
+ 'L_AUTHOR' => $lang['Author'],
+ 'L_MESSAGE' => $lang['Message'],
+ 'L_POSTED' => $lang['Posted'],
+ 'L_POST_SUBJECT' => $lang['Post_subject'],
+ 'L_TOPIC_REVIEW' => $lang['Topic_review'])
);
if ( !$is_inline_review )
{
- $template->pparse("reviewbody");
+ $template->pparse('reviewbody');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
}
diff --git a/phpBB/includes/usercp_avatar.php b/phpBB/includes/usercp_avatar.php
index b5b0fb1a02..9ba50399ee 100644
--- a/phpBB/includes/usercp_avatar.php
+++ b/phpBB/includes/usercp_avatar.php
@@ -278,7 +278,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current
}
@reset($avatar_images);
- $s_categories = '';
+ $s_categories = '';
while( list($key) = each($avatar_images) )
{
$selected = ( $key == $category ) ? ' selected="selected"' : '';
@@ -287,6 +287,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current
$s_categories .= '' . ucfirst($key) . ' ';
}
}
+ $s_categories .= ' ';
$s_colspan = 0;
for($i = 0; $i < count($avatar_images[$category]); $i++)
@@ -323,7 +324,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current
'L_RETURN_PROFILE' => $lang['Return_profile'],
'L_CATEGORY' => $lang['Select_category'],
- 'S_OPTIONS_CATEGORIES' => $s_categories,
+ 'S_CATEGORY_SELECT' => $s_categories,
'S_COLSPAN' => $s_colspan,
'S_PROFILE_ACTION' => append_sid("profile.$phpEx?mode=$mode"),
'S_HIDDEN_FIELDS' => $s_hidden_vars)
diff --git a/phpBB/includes/usercp_email.php b/phpBB/includes/usercp_email.php
index 1ffcf6be71..7970c4f1c8 100644
--- a/phpBB/includes/usercp_email.php
+++ b/phpBB/includes/usercp_email.php
@@ -94,16 +94,16 @@ if ( $result = $db->sql_query($sql) )
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
- $email_headers = "From: " . $userdata['user_email'] . "\n";
+ $email_headers = 'From: ' . $userdata['user_email'] . "\n";
if ( !empty($HTTP_POST_VARS['cc_email']) )
{
$email_headers .= "Cc: " . $userdata['user_email'] . "\n";
}
- $email_headers .= "Return-Path: " . $userdata['user_email'] . "\n";
- $email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\n";
- $email_headers .= "X-AntiAbuse: User_id - " . $userdata['user_id'] . "\n";
- $email_headers .= "X-AntiAbuse: Username - " . $userdata['username'] . "\n";
- $email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
+ $email_headers .= 'Return-Path: ' . $userdata['user_email'] . "\n";
+ $email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
+ $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
+ $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
+ $email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";
$emailer->use_template('profile_send_email', $user_lang);
$emailer->email_address($user_email);
@@ -138,20 +138,9 @@ if ( $result = $db->sql_query($sql) )
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- 'body' => 'profile_send_email.tpl',
- 'jumpbox' => 'jumpbox.tpl')
+ 'body' => 'profile_send_email.tpl')
);
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+ make_jumpbox('viewforum.'.$phpEx);
if ( $error )
{
@@ -164,15 +153,9 @@ if ( $result = $db->sql_query($sql) )
$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
}
- if ( $userdata['user_sig'] != '' )
- {
- $template->assign_block_vars('signature_checkbox', array());
- }
-
$template->assign_vars(array(
'USERNAME' => $username,
- 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
'S_POST_ACTION' => append_sid("profile.$phpEx?&mode=email&" . POST_USERS_URL . "=$user_id"),
'L_SEND_EMAIL_MSG' => $lang['Send_email_msg'],
@@ -184,7 +167,6 @@ if ( $result = $db->sql_query($sql) )
'L_EMPTY_MESSAGE_EMAIL' => $lang['Empty_message_email'],
'L_OPTIONS' => $lang['Options'],
'L_CC_EMAIL' => $lang['CC_email'],
- 'L_NOTIFY_ON_REPLY' => $lang['Notify'],
'L_SPELLCHECK' => $lang['Spellcheck'],
'L_SEND_EMAIL' => $lang['Send_email'])
);
@@ -203,4 +185,4 @@ else
message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
}
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php
index a3f762765a..4c92af339b 100644
--- a/phpBB/includes/usercp_register.php
+++ b/phpBB/includes/usercp_register.php
@@ -680,20 +680,7 @@ else if ( $mode == 'editprofile' && !isset($HTTP_POST_VARS['avatargallery']) &&
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
-$template->set_filenames(array(
- "jumpbox" => "jumpbox.tpl")
-);
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid('viewforum.$phpEx'))
-);
-$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+make_jumpbox('viewforum.'.$phpEx);
if ( $mode == 'editprofile' )
{
@@ -711,7 +698,7 @@ if( isset($HTTP_POST_VARS['avatargallery']) && !$error )
$avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? $HTTP_POST_VARS['avatarcategory'] : '';
$template->set_filenames(array(
- "body" => "profile_avatar_gallery.tpl")
+ 'body' => 'profile_avatar_gallery.tpl')
);
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat);
@@ -786,7 +773,7 @@ else
if ( $mode == 'editprofile' )
{
- $template->assign_block_vars('edit_profile', array());
+ $template->assign_block_vars('switch_edit_profile', array());
}
//
@@ -908,25 +895,25 @@ else
//
if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
{
- $template->assign_block_vars('avatar_block', array() );
+ $template->assign_block_vars('switch_avatar_block', array() );
if ( $board_config['allow_avatar_upload'] && file_exists('./' . $board_config['avatar_path']) )
{
if ( $form_enctype != '' )
{
- $template->assign_block_vars('avatar_block.avatar_local_upload', array() );
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
}
- $template->assign_block_vars('avatar_block.avatar_remote_upload', array() );
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
}
if ( $board_config['allow_avatar_remote'] )
{
- $template->assign_block_vars('avatar_block.avatar_remote_link', array() );
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
}
if ( $board_config['allow_avatar_local'] && file_exists('./' . $board_config['avatar_gallery_path']) )
{
- $template->assign_block_vars('avatar_block.avatar_local_gallery', array() );
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
}
}
}
@@ -935,4 +922,4 @@ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/includes/usercp_sendpasswd.php b/phpBB/includes/usercp_sendpasswd.php
index c5b810faf5..2ca37ffb6b 100644
--- a/phpBB/includes/usercp_sendpasswd.php
+++ b/phpBB/includes/usercp_sendpasswd.php
@@ -23,14 +23,14 @@
if ( !defined('IN_PHPBB') )
{
- die("Hacking attempt");
+ die('Hacking attempt');
exit;
}
if ( isset($HTTP_POST_VARS['submit']) )
{
- $username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags($HTTP_POST_VARS['username'])) : "";
- $email = ( !empty($HTTP_POST_VARS['email']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
+ $username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags($HTTP_POST_VARS['username'])) : '';
+ $email = ( !empty($HTTP_POST_VARS['email']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : '';
$sql = "SELECT user_id, username, user_email, user_active, user_lang
FROM " . USERS_TABLE . "
@@ -40,7 +40,7 @@ if ( isset($HTTP_POST_VARS['submit']) )
{
if ( $row = $db->sql_fetchrow($result) )
{
- if ( $row['user_active'] == 0 )
+ if ( !$row['user_active'] )
{
message_die(GENERAL_MESSAGE, $lang['No_send_account_inactive']);
}
@@ -53,37 +53,37 @@ if ( isset($HTTP_POST_VARS['submit']) )
$sql = "UPDATE " . USERS_TABLE . "
SET user_newpasswd = '" .md5($user_password) . "', user_actkey = '$user_actkey'
WHERE user_id = " . $row['user_id'];
- if ( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Couldn't update new password information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update new password information', '', __LINE__, __FILE__, $sql);
}
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
- $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
+ $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- $emailer->use_template("user_activate_passwd", $row['user_lang']);
+ $emailer->use_template('user_activate_passwd', $row['user_lang']);
$emailer->email_address($row['user_email']);
$emailer->set_subject();//$lang['New_password_activation']
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
- "SITENAME" => $board_config['sitename'],
- "USERNAME" => $username,
- "PASSWORD" => $user_password,
- "EMAIL_SIG" => str_replace(" ", "\n", "-- \n" . $board_config['board_email_sig']),
+ 'SITENAME' => $board_config['sitename'],
+ 'USERNAME' => $username,
+ 'PASSWORD' => $user_password,
+ 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']),
- "U_ACTIVATE" => $server_url . "?mode=activate&act_key=$user_actkey")
+ 'U_ACTIVATE' => $server_url . "?mode=activate&act_key=$user_actkey")
);
$emailer->send();
$emailer->reset();
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
- $message = $lang['Password_updated'] . " " . sprintf($lang['Click_return_index'], "", " ");
+ $message = $lang['Password_updated'] . ' ' . sprintf($lang['Click_return_index'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
@@ -94,13 +94,13 @@ if ( isset($HTTP_POST_VARS['submit']) )
}
else
{
- message_die(GENERAL_ERROR, "Couldn't obtain user information for sendpassword", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user information for sendpassword', '', __LINE__, __FILE__, $sql);
}
}
else
{
- $username = "";
- $email = "";
+ $username = '';
+ $email = '';
}
//
@@ -109,33 +109,23 @@ else
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "body" => "profile_send_pass.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'body' => 'profile_send_pass.tpl')
);
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle("JUMPBOX", "jumpbox");
+make_jumpbox('viewforum.'.$phpEx);
$template->assign_vars(array(
- "USERNAME" => $username,
- "EMAIL" => $email,
+ 'USERNAME' => $username,
+ 'EMAIL' => $email,
- "L_SEND_PASSWORD" => $lang['Send_password'],
- "L_ITEMS_REQUIRED" => $lang['Items_required'],
- "L_EMAIL_ADDRESS" => $lang['Email_address'],
- "L_SUBMIT" => $lang['Submit'],
- "L_RESET" => $lang['Reset'])
+ 'L_SEND_PASSWORD' => $lang['Send_password'],
+ 'L_ITEMS_REQUIRED' => $lang['Items_required'],
+ 'L_EMAIL_ADDRESS' => $lang['Email_address'],
+ 'L_SUBMIT' => $lang['Submit'],
+ 'L_RESET' => $lang['Reset'])
);
-$template->pparse("body");
+$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-?>
+
+?>
\ No newline at end of file
diff --git a/phpBB/includes/usercp_viewprofile.php b/phpBB/includes/usercp_viewprofile.php
index 6960e4a9ca..0b5bd0939b 100644
--- a/phpBB/includes/usercp_viewprofile.php
+++ b/phpBB/includes/usercp_viewprofile.php
@@ -51,20 +51,9 @@ $db->sql_freeresult($result);
// Output page header and profile_view template
//
$template->set_filenames(array(
- 'body' => 'profile_view_body.tpl',
- 'jumpbox' => 'jumpbox.tpl')
+ 'body' => 'profile_view_body.tpl')
);
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+make_jumpbox('viewforum.'.$phpEx);
//
// Calculate the number of days this user has been a member ($memberdays)
@@ -85,19 +74,6 @@ else
$percentage = 0;
}
-if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
-{
- $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL . "=" . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];
-
- $email = '' . $lang['Send_email'] . ' ';
- $email_img = ' ';
-}
-else
-{
- $email = '';
- $email_img = '';
-}
-
$avatar_img = '';
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
@@ -140,29 +116,51 @@ else
}
}
+$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
+$pm_img = ' ';
+$pm = '' . $lang['Send_private_message'] . ' ';
+
+if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
+{
+ $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];
+
+ $email_img = ' ';
+ $email = '' . $lang['Send_email'] . ' ';
+}
+else
+{
+ $email_img = ' ';
+ $email = ' ';
+}
+
+$www_img = ( $profiledata['user_website'] ) ? ' ' : ' ';
+$www = ( $profiledata['user_website'] ) ? '' . $profiledata['user_website'] . ' ' : ' ';
+
if ( !empty($profiledata['user_icq']) )
{
- $icq_status_img = ' ';
- $icq_add_img = ' ';
+ $icq_status_img = ' ';
+ $icq_img = ' ';
+ $icq = '' . $lang['ICQ'] . ' ';
}
else
{
$icq_status_img = ' ';
- $icq_add_img = ' ';
+ $icq_img = ' ';
+ $icq = ' ';
}
-$aim_img = ( $profiledata['user_aim'] ) ? ' ' : ' ';
+$aim_img = ( $profiledata['user_aim'] ) ? ' ' : ' ';
+$aim = ( $profiledata['user_aim'] ) ? '' . $lang['AIM'] . ' ' : ' ';
-$msnm_img = ( $profiledata['user_msnm'] ) ? ' ' . $profiledata['user_msnm'] : ' ';
+$msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ';
+$msn = $msn_img;
-$yim_img = ( $profiledata['user_yim'] ) ? ' ' : ' ';
+$yim_img = ( $profiledata['user_yim'] ) ? ' ' : '';
+$yim = ( $profiledata['user_yim'] ) ? '' . $lang['YIM'] . ' ' : '';
-$search_img = ' ';
-$search = '' . $lang['Search_user_posts'] . ' ';
-
-$www_img = ( $profiledata['user_website'] ) ? ' ' : ' ';
-
-$pm_img = ' ';
+$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
+$search_img = ' ';
+$search = '' . $lang['Search_user_posts'] . ' ';
//
// Generate page
@@ -180,23 +178,25 @@ $template->assign_vars(array(
'PERCENTAGE' => $percentage . '%',
'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day),
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage),
- 'EMAIL' => $email,
- 'EMAIL_IMG' => $email_img,
- 'PM_IMG' => $pm_img,
- 'UL_SEARCH' => $search,
+
'SEARCH_IMG' => $search_img,
- 'ICQ' => ( $profiledata['user_icq'] ) ? $profiledata['user_icq'] : ' ',
- 'ICQ_IMG' => ( $profiledata['user_icq'] ) ? $images['icon_icq'] : ' ',
- 'ICQ_ADD_IMG' => $icq_add_img,
+ 'SEARCH' => $search,
+ 'PM_IMG' => $pm_img,
+ 'PM' => $pm,
+ 'EMAIL_IMG' => $email_img,
+ 'EMAIL' => $email,
+ 'WWW_IMG' => $www_img,
+ 'WWW' => $www,
'ICQ_STATUS_IMG' => $icq_status_img,
- 'AIM' => ( $profiledata['user_aim'] ) ? '' . $profiledata['user_aim'] . ' ' : ' ',
+ 'ICQ_IMG' => $icq_img,
+ 'ICQ' => $icq,
'AIM_IMG' => $aim_img,
- 'MSN' => ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : ' ',
- 'MSN_IMG' => $msnm_img,
- 'YIM' => ( $profiledata['user_yim'] ) ? '' . $profiledata['user_yim'] . ' ' : ' ',
+ 'AIM' => $aim,
+ 'MSN_IMG' => $msn_img,
+ 'MSN' => $msn,
'YIM_IMG' => $yim_img,
- 'WEBSITE' => ( $profiledata['user_website'] ) ? '' . $profiledata['user_website'] . ' ' : ' ',
- 'WEBSITE_IMG' => $www_img,
+ 'YIM' => $yim,
+
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
@@ -206,6 +206,7 @@ $template->assign_vars(array(
'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']),
'L_AVATAR' => $lang['Avatar'],
'L_POSTER_RANK' => $lang['Poster_rank'],
+ 'L_JOINED' => $lang['Joined'],
'L_TOTAL_POSTS' => $lang['Total_posts'],
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']),
'L_CONTACT' => $lang['Contact'],
@@ -230,4 +231,4 @@ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/index.php b/phpBB/index.php
index 814ff90699..3d7963d094 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -267,6 +267,17 @@ if( ( $total_categories = count($category_rows) ) )
'FORUM_NEW_IMG' => $images['forum_new'],
'FORUM_LOCKED_IMG' => $images['forum_locked'],
+ 'L_FORUM' => $lang['Forum'],
+ 'L_TOPICS' => $lang['Topics'],
+ 'L_REPLIES' => $lang['Replies'],
+ 'L_VIEWS' => $lang['Views'],
+ 'L_POSTS' => $lang['Posts'],
+ 'L_LASTPOST' => $lang['Last_Post'],
+ 'L_NO_NEW_POSTS' => $lang['No_new_posts'],
+ 'L_NEW_POSTS' => $lang['New_posts'],
+ 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
+ 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
+
'L_MODERATOR' => $lang['Moderators'],
'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],
@@ -299,10 +310,10 @@ if( ( $total_categories = count($category_rows) ) )
//
if ( $display_forums )
{
- $template->assign_block_vars("catrow", array(
- "CAT_ID" => $cat_id,
- "CAT_DESC" => $category_rows[$i]['cat_title'],
- "U_VIEWCAT" => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
+ $template->assign_block_vars('catrow', array(
+ 'CAT_ID' => $cat_id,
+ 'CAT_DESC' => $category_rows[$i]['cat_title'],
+ 'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
);
if ( $viewcat == $cat_id || $viewcat == -1 )
@@ -317,7 +328,8 @@ if( ( $total_categories = count($category_rows) ) )
{
if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED )
{
- $folder_image = ' ';
+ $folder_image = $images['forum_locked'];
+ $folder_alt = $lang['Forum_locked'];
}
else
{
@@ -365,7 +377,8 @@ if( ( $total_categories = count($category_rows) ) )
}
}
- $folder_image = ( $unread_topics ) ? ' ' : ' ';
+ $folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
+ $folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
}
$posts = $forum_data[$j]['forum_posts'];
@@ -377,9 +390,9 @@ if( ( $total_categories = count($category_rows) ) )
$last_post = $last_post_time . ' ';
- $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != "" ) ? $forum_data[$j]['post_username'] . " " : $lang['Guest'] . " " ) : '' . $forum_data[$j]['username'] . ' ';
+ $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '' . $forum_data[$j]['username'] . ' ';
- $last_post .= ' ';
+ $last_post .= ' ';
}
else
{
@@ -400,20 +413,21 @@ if( ( $total_categories = count($category_rows) ) )
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $template->assign_block_vars("catrow.forumrow", array(
- "ROW_COLOR" => '#' . $row_color,
- "ROW_CLASS" => $row_class,
- "FOLDER" => $folder_image,
- "FORUM_NAME" => $forum_data[$j]['forum_name'],
- "FORUM_DESC" => $forum_data[$j]['forum_desc'],
- "POSTS" => $forum_data[$j]['forum_posts'],
- "TOPICS" => $forum_data[$j]['forum_topics'],
- "LAST_POST" => $last_post,
- "MODERATORS" => $moderator_list,
+ $template->assign_block_vars('catrow.forumrow', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'FORUM_FOLDER_IMG' => $folder_image,
+ 'FORUM_NAME' => $forum_data[$j]['forum_name'],
+ 'FORUM_DESC' => $forum_data[$j]['forum_desc'],
+ 'POSTS' => $forum_data[$j]['forum_posts'],
+ 'TOPICS' => $forum_data[$j]['forum_topics'],
+ 'LAST_POST' => $last_post,
+ 'MODERATORS' => $moderator_list,
- "L_MODERATOR" => $l_moderators,
+ 'L_MODERATOR' => $l_moderators,
+ 'L_FORUM_FOLDER_ALT' => $folder_alt,
- "U_VIEWFORUM" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
+ 'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
);
}
}
diff --git a/phpBB/login.php b/phpBB/login.php
index 240f965603..c37c9954b9 100644
--- a/phpBB/login.php
+++ b/phpBB/login.php
@@ -27,7 +27,7 @@
define("IN_LOGIN", true);
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
@@ -40,6 +40,8 @@ init_userprefs($userdata);
// End session management
//
+$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
+
if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($HTTP_POST_VARS['logout']) || isset($HTTP_GET_VARS['logout']) )
{
//
@@ -47,19 +49,17 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
// since this doesn't exist for ISAPI mode and therefore the
// normal Location redirector is used in preference
//
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
-
if( ( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) ) && !$userdata['session_logged_in'] )
{
- $username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : "";
- $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : "";
+ $username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : '';
+ $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';
$sql = "SELECT user_id, username, user_password, user_active, user_level
FROM " . USERS_TABLE . "
WHERE username = '" . str_replace("\'", "''", $username) . "'";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error in obtaining userdata : login", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql);
}
if( $row = $db->sql_fetchrow($result) )
@@ -94,10 +94,10 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
}
else
{
- $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
+ $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : '';
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
$message = $lang['Error_login'] . ' ' . sprintf($lang['Click_return_login'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
@@ -111,7 +111,7 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
$template->assign_vars(array(
- "META" => ' ')
+ 'META' => ' ')
);
$message = $lang['Error_login'] . ' ' . sprintf($lang['Click_return_login'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
@@ -159,7 +159,7 @@ else
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "body" => "login_body.tpl")
+ 'body' => 'login_body.tpl')
);
if( isset($HTTP_POST_VARS['redirect']) || isset($HTTP_GET_VARS['redirect']) )
@@ -170,25 +170,25 @@ else
{
$forward_to = ( !empty($forward_matches[3]) ) ? $forward_matches[3] : $forward_matches[1];
- $forward_match = explode("&", $forward_to);
+ $forward_match = explode('&', $forward_to);
if(count($forward_match) > 1)
{
- $forward_page = "";
+ $forward_page = '';
for($i = 1; $i < count($forward_match); $i++)
{
if( !ereg("sid=", $forward_match[$i]) )
{
- if( $forward_page != "" )
+ if( $forward_page != '' )
{
- $forward_page .= "&";
+ $forward_page .= '&';
}
$forward_page .= $forward_match[$i];
}
}
- $forward_page = $forward_match[0] . "?" . $forward_page;
+ $forward_page = $forward_match[0] . '?' . $forward_page;
}
else
{
@@ -198,33 +198,34 @@ else
}
else
{
- $forward_page = "";
+ $forward_page = '';
}
- $username = ( $userdata['user_id'] != ANONYMOUS ) ? $userdata['username'] : "";
+ $username = ( $userdata['user_id'] != ANONYMOUS ) ? $userdata['username'] : '';
$s_hidden_fields = ' ';
+ make_jumpbox('viewforum.'.$phpEx, $forum_id);
$template->assign_vars(array(
- "USERNAME" => $username,
+ 'USERNAME' => $username,
- "L_ENTER_PASSWORD" => $lang['Enter_password'],
- "L_SEND_PASSWORD" => $lang['Forgotten_password'],
+ 'L_ENTER_PASSWORD' => $lang['Enter_password'],
+ 'L_SEND_PASSWORD' => $lang['Forgotten_password'],
- "U_SEND_PASSWORD" => append_sid("profile.$phpEx?mode=sendpassword"),
+ 'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
- "S_HIDDEN_FIELDS" => $s_hidden_fields)
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
- $template->pparse("body");
+ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else
{
- header("Location: " . append_sid("index.$phpEx", true));
+ header($header_location . append_sid("index.$phpEx", true));
}
}
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index c1e5325153..99b51bb36a 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -20,7 +20,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
@@ -37,22 +37,78 @@ $start = ( isset($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0;
if(isset($HTTP_POST_VARS['order']))
{
- $sort_order = ($HTTP_POST_VARS['order'] == "ASC") ? "ASC" : "DESC";
+ $sort_order = ($HTTP_POST_VARS['order'] == 'ASC') ? 'ASC' : 'DESC';
}
else if(isset($HTTP_GET_VARS['order']))
{
- $sort_order = ($HTTP_GET_VARS['order'] == "ASC") ? "ASC" : "DESC";
+ $sort_order = ($HTTP_GET_VARS['order'] == 'ASC') ? 'ASC' : 'DESC';
}
else
{
- $sort_order = "ASC";
+ $sort_order = 'ASC';
}
-if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
-{
- $mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
+//
+// Memberlist sorting
+//
+$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten']);
+$mode_types = array('joindate', 'username', 'location', 'posts', 'email', 'website', 'topten');
- switch($mode)
+$select_sort_mode = '';
+for($i = 0; $i < count($mode_types_text); $i++)
+{
+ $selected = ( $mode == $mode_types[$i] ) ? ' selected="selected"' : '';
+ $select_sort_mode .= "" . $mode_types_text[$i] . " ";
+}
+$select_sort_mode .= ' ';
+
+$select_sort_order = '';
+if($sort_order == 'ASC')
+{
+ $select_sort_order .= '' . $lang['Sort_Ascending'] . ' ' . $lang['Sort_Descending'] . ' ';
+}
+else
+{
+ $select_sort_order .= '' . $lang['Sort_Ascending'] . ' ' . $lang['Sort_Descending'] . ' ';
+}
+$select_sort_order .= ' ';
+
+//
+// Generate page
+//
+$page_title = $lang['Memberlist'];
+include($phpbb_root_path . 'includes/page_header.'.$phpEx);
+
+$template->set_filenames(array(
+ 'body' => 'memberlist_body.tpl')
+);
+make_jumpbox('viewforum.'.$phpEx);
+
+$template->assign_vars(array(
+ 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
+ 'L_EMAIL' => $lang['Email'],
+ 'L_WEBSITE' => $lang['Website'],
+ 'L_FROM' => $lang['Location'],
+ 'L_ORDER' => $lang['Order'],
+ 'L_SORT' => $lang['Sort'],
+ 'L_SUBMIT' => $lang['Sort'],
+ 'L_AIM' => $lang['AIM'],
+ 'L_YIM' => $lang['YIM'],
+ 'L_MSNM' => $lang['MSNM'],
+ 'L_ICQ' => $lang['ICQ'],
+ 'L_JOINED' => $lang['Joined'],
+ 'L_POSTS' => $lang['Posts'],
+
+ 'S_MODE_SELECT' => $select_sort_mode,
+ 'S_ORDER_SELECT' => $select_sort_order,
+ 'S_MODE_ACTION' => append_sid("memberlist.$phpEx"))
+);
+
+if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
+{
+ $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
+
+ switch( $mode )
{
case 'joined':
$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page'];
@@ -84,214 +140,169 @@ else
{
$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
}
+
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY $order_by";
if( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't query users", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
-$members = $db->sql_fetchrowset($result);
-$db->sql_freeresult($result);
-
-//
-// Memberlist sorting
-//
-$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten']);
-$mode_types = array("joindate", "username", "location", "posts", "email", "website", "topten");
-
-$select_sort_mode = "";
-for($i = 0; $i < count($mode_types_text); $i++)
+if ( $row = $db->sql_fetchrow($result) )
{
- $selected = ($mode == $mode_types[$i]) ? " selected=\"selected\"" : "";
- $select_sort_mode .= "" . $mode_types_text[$i] . " ";
-}
-$select_sort_mode .= " ";
-
-$select_sort_order = "";
-if($sort_order == "ASC")
-{
- $select_sort_order .= "" . $lang['Sort_Ascending'] . " " . $lang['Sort_Descending'] . " ";
-}
-else
-{
- $select_sort_order .= "" . $lang['Sort_Ascending'] . " " . $lang['Sort_Descending'] . " ";
-}
-$select_sort_order .= " ";
-
-//
-// Generate page
-//
-$page_title = $lang['Memberlist'];
-include($phpbb_root_path . 'includes/page_header.'.$phpEx);
-
-$template->set_filenames(array(
- "body" => "memberlist_body.tpl",
- "jumpbox" => "jumpbox.tpl"));
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle("JUMPBOX", "jumpbox");
-
-$template->assign_vars(array(
- "L_SELECT_SORT_METHOD" => $lang['Select_sort_method'],
- "L_EMAIL" => $lang['Email'],
- "L_WEBSITE" => $lang['Website'],
- "L_FROM" => $lang['Location'],
- "L_ORDER" => $lang['Order'],
- "L_SORT" => $lang['Sort'],
- "L_SUBMIT" => $lang['Sort'],
- "L_AIM" => $lang['AIM'],
- "L_YIM" => $lang['YIM'],
- "L_MSNM" => $lang['MSNM'],
- "L_ICQ" => $lang['ICQ'],
-
- "S_MODE_SELECT" => $select_sort_mode,
- "S_ORDER_SELECT" => $select_sort_order,
- "S_MODE_ACTION" => append_sid("memberlist.$phpEx"))
-);
-
-for($i = 0; $i < count($members); $i++)
-{
- $username = $members[$i]['username'];
- $user_id = $members[$i]['user_id'];
-
- $from = ( !empty($members[$i]['user_from']) ) ? $members[$i]['user_from'] : " ";
-
- $joined = create_date($lang['DATE_FORMAT'], $members[$i]['user_regdate'], $board_config['board_timezone']);
-
- $posts = ( $members[$i]['user_posts'] ) ? $members[$i]['user_posts'] : 0;
-
- if( $members[$i]['user_avatar_type'] && $user_id != ANONYMOUS && $members[$i]['user_allowavatar'] )
+ $i = 0;
+ do
{
- switch( $postrow[$i]['user_avatar_type'] )
+ $username = $row['username'];
+ $user_id = $row['user_id'];
+
+ $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
+ $joined = create_date($lang['DATE_FORMAT'], $row['user_regdate'], $board_config['board_timezone']);
+ $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
+
+ $poster_avatar = '';
+ if ( $row['user_avatar_type'] && $user_id != ANONYMOUS && $row['user_allowavatar'] )
{
- case USER_AVATAR_UPLOAD:
- $poster_avatar = " ";
- break;
- case USER_AVATAR_REMOTE:
- $poster_avatar = " ";
- break;
- case USER_AVATAR_GALLERY:
- $poster_avatar = " ";
- break;
+ switch( $row['user_avatar_type'] )
+ {
+ case USER_AVATAR_UPLOAD:
+ $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? ' ' : '';
+ break;
+ case USER_AVATAR_REMOTE:
+ $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? ' ' : '';
+ break;
+ case USER_AVATAR_GALLERY:
+ $poster_avatar = ( $board_config['allow_avatar_local'] ) ? ' ' : '';
+ break;
+ }
}
+
+ if ( !empty($row['user_viewemail']) || $userdata['user_level'] == ADMIN )
+ {
+ $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $user_id) : 'mailto:' . $row['user_email'];
+
+ $email_img = ' ';
+ $email = '' . $lang['Send_email'] . ' ';
+ }
+ else
+ {
+ $email_img = ' ';
+ $email = ' ';
+ }
+
+ $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");
+ $profile_img = ' ';
+ $profile = '' . $lang['Read_profile'] . ' ';
+
+ $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id");
+ $pm_img = ' ';
+ $pm = '' . $lang['Send_private_message'] . ' ';
+
+ $www_img = ( $row['user_website'] ) ? ' ' : '';
+ $www = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . ' ' : '';
+
+ if ( !empty($row['user_icq']) )
+ {
+ $icq_status_img = ' ';
+ $icq_img = ' ';
+ $icq = '' . $lang['ICQ'] . ' ';
+ }
+ else
+ {
+ $icq_status_img = '';
+ $icq_img = '';
+ $icq = '';
+ }
+
+ $aim_img = ( $row['user_aim'] ) ? ' ' : '';
+ $aim = ( $row['user_aim'] ) ? '' . $lang['AIM'] . ' ' : '';
+
+ $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");
+ $msn_img = ( $row['user_msnm'] ) ? ' ' : '';
+ $msn = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . ' ' : '';
+
+ $yim_img = ( $row['user_yim'] ) ? ' ' : '';
+ $yim = ( $row['user_yim'] ) ? '' . $lang['YIM'] . ' ' : '';
+
+ $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts");
+ $search_img = ' ';
+ $search = '' . $lang['Search_user_posts'] . ' ';
+
+ $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
+ $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
+
+ $template->assign_block_vars('memberrow', array(
+ 'ROW_NUMBER' => $i + ( $HTTP_GET_VARS['start'] + 1 ),
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'USERNAME' => $username,
+ 'FROM' => $from,
+ 'JOINED' => $joined,
+ 'POSTS' => $posts,
+ 'AVATAR_IMG' => $poster_avatar,
+ 'PROFILE_IMG' => $profile_img,
+ 'PROFILE' => $profile,
+ 'SEARCH_IMG' => $search_img,
+ 'SEARCH' => $search,
+ 'PM_IMG' => $pm_img,
+ 'PM' => $pm,
+ 'EMAIL_IMG' => $email_img,
+ 'EMAIL' => $email,
+ 'WWW_IMG' => $www_img,
+ 'WWW' => $www,
+ 'ICQ_STATUS_IMG' => $icq_status_img,
+ 'ICQ_IMG' => $icq_img,
+ 'ICQ' => $icq,
+ 'AIM_IMG' => $aim_img,
+ 'AIM' => $aim,
+ 'MSN_IMG' => $msn_img,
+ 'MSN' => $msn,
+ 'YIM_IMG' => $yim_img,
+ 'YIM' => $yim,
+
+ 'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
+ );
+
+ $i++;
}
- else
- {
- $poster_avatar = "";
- }
-
- if( !empty($members[$i]['user_viewemail']) || $userdata['user_level'] == ADMIN )
- {
- $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $members[$i]['user_id']) : "mailto:" . $members[$i]['user_email'];
-
- $email_img = " ";
- }
- else
- {
- $email_img = " ";
- }
-
- $pm_img = " ";
-
- if( $members[$i]['user_website'] != "" )
- {
- $www_img = " ";
- }
- else
- {
- $www_img = " ";
- }
-
- if( $members[$i]['user_icq'] )
- {
- $icq_status_img = " ";
-
- $icq_add_img = " ";
- }
- else
- {
- $icq_status_img = " ";
- $icq_add_img = " ";
- }
-
- $aim_img = ( $members[$i]['user_aim'] ) ? " " : " ";
-
- $msn_img = ( $members[$i]['user_msnm'] ) ? " " : " ";
-
- $yim_img = ( $members[$i]['user_yim'] ) ? " " : " ";
-
- $search_img = " ";
-
- $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
- $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
-
- $template->assign_block_vars("memberrow", array(
- "U_VIEWPROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $user_id),
-
- "ROW_NUMBER" => $i + ( $HTTP_GET_VARS['start'] + 1 ),
- "ROW_COLOR" => "#" . $row_color,
- "ROW_CLASS" => $row_class,
- "USERNAME" => $username,
- "FROM" => $from,
- "JOINED" => $joined,
- "POSTS" => $posts,
-
- "AVATAR_IMG" => $poster_avatar,
- "EMAIL_IMG" => $email_img,
- "PM_IMG" => $pm_img,
- "WWW_IMG" => $www_img,
- "ICQ_STATUS_IMG" => $icq_status_img,
- "ICQ_ADD_IMG" => $icq_add_img,
- "AIM_IMG" => $aim_img,
- "YIM_IMG" => $yim_img,
- "MSN_IMG" => $msn_img,
- "SEARCH_IMG" => $search)
- );
+ while ( $row = $db->sql_fetchrow($result) );
}
-if($mode != "topten" || $board_config['topics_per_page'] < 10)
+if ( $mode != 'topten' || $board_config['topics_per_page'] < 10 )
{
$sql = "SELECT count(*) AS total
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS;
- if(!$count_result = $db->sql_query($sql))
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Error getting total users.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
}
- else
+
+ if ( $total = $db->sql_fetchrow($result) )
{
- $total = $db->sql_fetchrow($count_result);
$total_members = $total['total'];
- $pagination = generate_pagination("memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config['topics_per_page'], $start)." ";
+ $pagination = generate_pagination("memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config['topics_per_page'], $start). ' ';
}
}
else
{
- $pagination = " ";
+ $pagination = ' ';
$total_members = 10;
}
$template->assign_vars(array(
- "PAGINATION" => $pagination,
- "PAGE_NUMBER" => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )),
+ 'PAGINATION' => $pagination,
+ 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )),
- "L_GOTO_PAGE" => $lang['Goto_page'])
+ 'L_GOTO_PAGE' => $lang['Goto_page'])
);
-$template->pparse("body");
+
+$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/modcp.php b/phpBB/modcp.php
index 39d667d861..6cd2140329 100644
--- a/phpBB/modcp.php
+++ b/phpBB/modcp.php
@@ -86,7 +86,9 @@ if ( isset($HTTP_POST_VARS['cancel']) )
{
$redirect = "index.$phpEx";
}
- header("Location: " . append_sid($redirect, true));
+
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
+ header($header_location . append_sid($redirect, true));
}
//
@@ -179,7 +181,7 @@ init_userprefs($userdata);
//
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);
-if( !$is_auth['auth_mod'] )
+if ( !$is_auth['auth_mod'] )
{
message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
}
@@ -403,14 +405,13 @@ switch($mode)
$topic_list .= ( ( $topic_list != '' ) ? ', ' : '' ) . $topics[$i];
}
- $sql_select = "SELECT *
+ $sql = "SELECT *
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_list)
AND topic_moved_id = 0";
-
- if ( !($result = $db->sql_query($sql_select, BEGIN_TRANSACTION)) )
+ if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
- message_die(GENERAL_ERROR, 'Could not select from topic table', '', __LINE__, __FILE__, $sql_select);
+ message_die(GENERAL_ERROR, 'Could not select from topic table', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrowset($result);
@@ -518,14 +519,14 @@ switch($mode)
'L_YES' => $lang['Yes'],
'L_NO' => $lang['No'],
- 'S_FORUM_BOX' => make_forum_select('new_forum', $forum_id),
+ 'S_FORUM_SELECT' => make_forum_select('new_forum', $forum_id),
'S_MODCP_ACTION' => append_sid("modcp.$phpEx"),
'S_HIDDEN_FIELDS' => $hidden_fields)
);
- $template->pparse("movetopic");
+
+ $template->pparse('movetopic');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-
}
break;
@@ -724,6 +725,7 @@ switch($mode)
'L_POST_SUBJECT' => $lang['Post_subject'],
'L_MARK_ALL' => $lang['Mark_all'],
'L_UNMARK_ALL' => $lang['Unmark_all'],
+ 'L_POST' => $lang['Post'],
'FORUM_NAME' => $forum_name,
@@ -797,8 +799,9 @@ switch($mode)
'POST_DATE' => $post_date,
'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message,
- 'SPLIT_CHECKBOX' => $checkbox,
- 'POST_ID' => $post_id)
+ 'POST_ID' => $post_id,
+
+ 'S_SPLIT_CHECKBOX' => $checkbox)
);
}
@@ -872,39 +875,43 @@ switch($mode)
message_die(GENERAL_ERROR, 'Could not get IP information for this user', '', __LINE__, __FILE__, $sql);
}
- $poster_ips = $db->sql_fetchrowset($result);
-
- $j = 0;
- for($i = 0; $i < count($poster_ips); $i++)
+ if ( $row = $db->sql_fetchrow($result) )
{
- if ( $poster_ips[$i]['poster_ip'] == $post_row['poster_ip'] )
+ $i = 0;
+ do
{
- $template->assign_vars(array(
- 'POSTINGS' => $poster_ips[$i]['postings'] . ' ' .$lang['Posts'])
+ if ( $row['poster_ip'] == $post_row['poster_ip'] )
+ {
+ $template->assign_vars(array(
+ 'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ))
+ );
+ continue;
+ }
+
+ $ip = decode_ip($row['poster_ip']);
+ $ip = ( $rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
+
+ $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
+ $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
+
+ $template->assign_block_vars('iprow', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'IP' => $ip,
+ 'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ),
+
+ 'U_LOOKUP_IP' => append_sid("modcp.$phpEx?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $row['poster_ip']))
);
- continue;
+
+ $i++;
}
- $ip = decode_ip($poster_ips[$i]['poster_ip']);
- $ip = ( $rdns_ip_num == $poster_ips[$i]['poster_ip'] || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
-
- $j++; // Can't use $i because of the 'continue'
- $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
- $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
-
- $template->assign_block_vars('iprow', array(
- 'ROW_COLOR' => '#' . $row_color,
- 'ROW_CLASS' => $row_class,
- 'IP' => $ip,
- 'POSTINGS' => $poster_ips[$i]['postings'] . ' ' .$lang['Posts'],
-
- 'U_LOOKUP_IP' => append_sid("modcp.$phpEx?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $poster_ips[$i]['poster_ip']))
- );
+ while ( $row = $db->sql_fetchrow($result) );
}
//
// Get other users who've posted under this IP
//
- $sql = "SELECT u.user_id, u.username, count(*) as postings
+ $sql = "SELECT u.user_id, u.username, COUNT(*) as postings
FROM " . USERS_TABLE ." u, " . POSTS_TABLE . " p
WHERE p.poster_id = u.user_id
AND p.poster_ip = '" . $post_row['poster_ip'] . "'
@@ -915,29 +922,34 @@ switch($mode)
message_die(GENERAL_ERROR, 'Could not get posters information based on IP', '', __LINE__, __FILE__, $sql);
}
- $poster_ids = $db->sql_fetchrowset($result);
-
- for($i = 0; $i < count($poster_ids); $i++)
+ if ( $row = $db->sql_fetchrow($result) )
{
- $id = $poster_ids[$i]['user_id'];
- $username = ( $is == ANONYMOUS ) ? $lang['Guest'] : $poster_ids[$i]['username'];
+ $i = 0;
+ do
+ {
+ $id = $row['user_id'];
+ $username = ( $id == ANONYMOUS ) ? $lang['Guest'] : $row['username'];
- $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
- $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
+ $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
+ $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $template->assign_block_vars('userrow', array(
- 'ROW_COLOR' => '#' . $row_color,
- 'ROW_CLASS' => $row_class,
- 'USERNAME' => $username,
- 'POSTINGS' => $poster_ids[$i]['postings'] . ' ' .$lang['Posts'],
- 'L_SEARCH_POSTS' => sprintf($lang['Search_user_posts'], $username),
+ $template->assign_block_vars('userrow', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'USERNAME' => $username,
+ 'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ),
+ 'L_SEARCH_POSTS' => sprintf($lang['Search_user_posts'], $username),
- 'U_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$id"),
- 'U_SEARCHPOSTS' => append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=topics"))
- );
+ 'U_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$id"),
+ 'U_SEARCHPOSTS' => append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=topics"))
+ );
+
+ $i++;
+ }
+ while ( $row = $db->sql_fetchrow($result) );
}
- $template->pparse("viewip");
+ $template->pparse('viewip');
break;
@@ -961,6 +973,10 @@ switch($mode)
'L_MOVE' => $lang['Move'],
'L_LOCK' => $lang['Lock'],
'L_UNLOCK' => $lang['Unlock'],
+ 'L_TOPICS' => $lang['Topics'],
+ 'L_REPLIES' => $lang['Replies'],
+ 'L_LASTPOST' => $lang['Last_Post'],
+ 'L_SELECT' => $lang['Select'],
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"),
'S_HIDDEN_FIELDS' => ' ',
@@ -1018,8 +1034,6 @@ switch($mode)
}
}
- $folder_image = ' ';
-
$topic_id = $row['topic_id'];
$topic_type = $row['topic_type'];
$topic_status = $row['topic_status'];
@@ -1060,20 +1074,20 @@ switch($mode)
$template->assign_block_vars('topicrow', array(
'U_VIEW_TOPIC' => $u_view_topic,
- 'FOLDER_IMG' => $folder_image,
+ 'TOPIC_FOLDER_IMG' => $folder_img,
'TOPIC_TYPE' => $topic_type,
'TOPIC_TITLE' => $topic_title,
'REPLIES' => $topic_replies,
- 'LAST_POST' => $last_post_time,
- 'TOPIC_ID' => $topic_id)
+ 'LAST_POST_TIME' => $last_post_time,
+ 'TOPIC_ID' => $topic_id,
+
+ 'L_TOPIC_FOLDER_ALT' => $folder_alt)
);
}
$template->assign_vars(array(
'PAGINATION' => generate_pagination("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id", $forum_topics, $board_config['topics_per_page'], $start),
-
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $forum_topics / $board_config['topics_per_page'] )),
-
'L_GOTO_PAGE' => $lang['Goto_page'])
);
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 83f51c26a8..cd2dc81fef 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -21,7 +21,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
@@ -55,16 +55,16 @@ $topic_type = ( !empty($HTTP_POST_VARS['topictype']) ) ? $HTTP_POST_VARS['topict
// If the mode is set to topic review then output
// that review ...
//
-if( $mode == 'topicreview' )
+if ( $mode == 'topicreview' )
{
require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
topic_review($topic_id, false);
exit;
}
-else if( $mode == 'smilies' )
+else if ( $mode == 'smilies' )
{
- generate_smilies("window", PAGE_POSTING);
+ generate_smilies('window', PAGE_POSTING);
exit;
}
@@ -72,7 +72,7 @@ else if( $mode == 'smilies' )
// Was cancel pressed? If so then redirect to the appropriate
// page, no point in continuing with any further checks
//
-if( isset($HTTP_POST_VARS['cancel']) )
+if ( isset($HTTP_POST_VARS['cancel']) )
{
if ( $post_id )
{
@@ -95,7 +95,9 @@ if( isset($HTTP_POST_VARS['cancel']) )
$post_append = "";
}
- header('Location: ' . append_sid($redirect) . $post_append, true);
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
+ header($header_location . append_sid($redirect) . $post_append, true);
+ exit;
}
//
@@ -114,11 +116,11 @@ $is_auth = array();
switch( $mode )
{
case 'newtopic':
- if( $topic_type == POST_ANNOUNCE )
+ if ( $topic_type == POST_ANNOUNCE )
{
$is_auth_type = 'auth_announce';
}
- else if( $topic_type == POST_STICKY )
+ else if ( $topic_type == POST_STICKY )
{
$is_auth_type = 'auth_sticky';
}
@@ -190,9 +192,9 @@ switch ( $mode )
message_die(GENERAL_MESSAGE, $lang['No_post_id']);
}
- $select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : "";
- $from_sql = ( !$submit ) ? ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u" : "";
- $where_sql = ( !$submit ) ? "AND pt.post_id = p.post_id AND u.user_id = p.poster_id" : "";
+ $select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';
+ $from_sql = ( !$submit ) ? ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u" : '';
+ $where_sql = ( !$submit ) ? "AND pt.post_id = p.post_id AND u.user_id = p.poster_id" : '';
$sql = "SELECT f.*, t.topic_id, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.topic_vote, p.post_id, p.poster_id" . $select_sql . "
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $from_sql . "
@@ -245,7 +247,7 @@ if ( $result = $db->sql_query($sql) )
ORDER BY vr.vote_option_id";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain vote data for this topic", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
}
$poll_options = array();
@@ -276,16 +278,16 @@ if ( $result = $db->sql_query($sql) )
//
if ( $post_info['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod'] )
{
- $message = ( $delete || $mode == "delete" ) ? $lang['Delete_own_posts'] : $lang['Edit_own_posts'];
+ $message = ( $delete || $mode == 'delete' ) ? $lang['Delete_own_posts'] : $lang['Edit_own_posts'];
$message .= ' ' . sprintf($lang['Click_return_topic'], '', ' ');
message_die(GENERAL_MESSAGE, $message);
}
- else if ( !$post_data['last_post'] && !$is_auth['auth_mod'] && ( $mode == "delete" || $delete ) )
+ else if ( !$post_data['last_post'] && !$is_auth['auth_mod'] && ( $mode == 'delete' || $delete ) )
{
message_die(GENERAL_MESSAGE, $lang['Cannot_delete_replied']);
}
- else if ( !$post_data['edit_poll'] && !$is_auth['auth_mod'] && ( $mode == "poll_delete" || $poll_delete ) )
+ else if ( !$post_data['edit_poll'] && !$is_auth['auth_mod'] && ( $mode == 'poll_delete' || $poll_delete ) )
{
message_die(GENERAL_MESSAGE, $lang['Cannot_delete_poll']);
}
@@ -334,7 +336,7 @@ if ( !$is_auth[$is_auth_type] )
break;
}
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
exit;
}
@@ -383,7 +385,7 @@ else
AND user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain topic watch information", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
}
$notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['user_notify'];
@@ -399,7 +401,7 @@ $attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']
// --------------------
// What shall we do?
//
-if ( ( $delete || $poll_delete || $mode == "delete" ) && !$confirm )
+if ( ( $delete || $poll_delete || $mode == 'delete' ) && !$confirm )
{
//
// Confirm deletion
@@ -450,7 +452,7 @@ else if ( $mode == 'vote' )
GROUP BY vd.vote_id";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain vote data for this topic", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
}
if ( $vote_info = $db->sql_fetchrow($result) )
@@ -463,7 +465,7 @@ else if ( $mode == 'vote' )
AND vote_user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain user vote data for this topic", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
@@ -474,14 +476,14 @@ else if ( $mode == 'vote' )
AND vote_option_id = $vote_option_id";
if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
- message_die(GENERAL_ERROR, "Couldn't update poll result", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update poll result', '', __LINE__, __FILE__, $sql);
}
$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip)
VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";
if ( !$db->sql_query($sql, END_TRANSACTION) )
{
- message_die(GENERAL_ERROR, "Couldn't insert user_id for poll", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__, $sql);
}
$message = $lang['Vote_cast'];
@@ -687,7 +689,8 @@ if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != '' )
'L_POST_SUBJECT' => $lang['Post_subject'],
'L_PREVIEW' => $lang['Preview'],
- 'L_POSTED' => $lang['Posted'])
+ 'L_POSTED' => $lang['Posted'],
+ 'L_POST' => $lang['Post'])
);
$template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview');
}
@@ -791,7 +794,7 @@ else
//
if( $user_sig != '' )
{
- $template->assign_block_vars('signature_checkbox', array());
+ $template->assign_block_vars('switch_signature_checkbox', array());
}
//
@@ -800,7 +803,7 @@ if( $user_sig != '' )
if ( $board_config['allow_html'] )
{
$html_status = $lang['HTML_is_ON'];
- $template->assign_block_vars('html_checkbox', array());
+ $template->assign_block_vars('switch_html_checkbox', array());
}
else
{
@@ -813,7 +816,7 @@ else
if ( $board_config['allow_bbcode'] )
{
$bbcode_status = $lang['BBCode_is_ON'];
- $template->assign_block_vars('bbcode_checkbox', array());
+ $template->assign_block_vars('switch_bbcode_checkbox', array());
}
else
{
@@ -826,7 +829,7 @@ else
if ( $board_config['allow_smilies'] )
{
$smilies_status = $lang['Smilies_are_ON'];
- $template->assign_block_vars('smilies_checkbox', array());
+ $template->assign_block_vars('switch_smilies_checkbox', array());
}
else
{
@@ -835,7 +838,7 @@ else
if( !$userdata['session_logged_in'] || ( $mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS ) )
{
- $template->assign_block_vars('username_select', array());
+ $template->assign_block_vars('switch_username_select', array());
}
//
@@ -845,7 +848,7 @@ if ( $userdata['session_logged_in'] )
{
if ( $mode != 'editpost' || ( $mode == 'editpost' && $post_info['poster_id'] != ANONYMOUS ) )
{
- $template->assign_block_vars('notify_checkbox', array());
+ $template->assign_block_vars('switch_notify_checkbox', array());
}
}
@@ -854,7 +857,7 @@ if ( $userdata['session_logged_in'] )
//
if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $is_auth['auth_mod'] ) )
{
- $template->assign_block_vars('delete_checkbox', array());
+ $template->assign_block_vars('switch_delete_checkbox', array());
}
//
@@ -863,7 +866,7 @@ if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
- $template->assign_block_vars('type_toggle', array());
+ $template->assign_block_vars('switch_type_toggle', array());
if( $is_auth['auth_sticky'] )
{
@@ -912,7 +915,7 @@ switch( $mode )
}
// Generate smilies listing for page output
-generate_smilies("inline", PAGE_POSTING);
+generate_smilies('inline', PAGE_POSTING);
//
// Include page header
@@ -922,20 +925,9 @@ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'posting_body.tpl',
'pollbody' => 'posting_poll_body.tpl',
- 'jumpbox' => 'jumpbox.tpl',
'reviewbody' => 'posting_topic_review.tpl')
);
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+make_jumpbox('viewforum.'.$phpEx);
$template->assign_vars(array(
'FORUM_NAME' => $forum_name,
@@ -1056,7 +1048,7 @@ if( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
if( $mode == 'editpost' && $post_data['edit_poll'] )
{
- $template->assign_block_vars('poll_delete_toggle', array());
+ $template->assign_block_vars('switch_poll_delete_toggle', array());
}
if( !empty($poll_options) )
@@ -1064,7 +1056,7 @@ if( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
while( list($option_id, $option_text) = each($poll_options) )
{
$template->assign_block_vars('poll_option_rows', array(
- 'POLL_OPTION' => str_replace("\"", """, $option_text),
+ 'POLL_OPTION' => str_replace('"', '"', $option_text),
'S_POLL_OPTION_NUM' => $option_id)
);
@@ -1086,11 +1078,8 @@ if( $mode == 'reply' )
$template->assign_var_from_handle('TOPIC_REVIEW_BOX', 'reviewbody');
}
-//
-// Parse and print the body
-//
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index c8bea4ff60..074c5c392b 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -21,7 +21,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
@@ -35,9 +35,6 @@ if ( !empty($board_config['privmsg_disable']) )
message_die(GENERAL_MESSAGE, 'PM_disabled');
}
-//
-// Var definitions
-//
$html_entities_match = array('#', '#<#', '#>#');
$html_entities_replace = array('&', '<', '>');
@@ -76,7 +73,9 @@ else
//
if ( $cancel )
{
- header('Location: ' . append_sid("privmsg.$phpEx?folder=$folder", true));
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
+ header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
+ exit;
}
//
@@ -97,7 +96,7 @@ if ( !empty($HTTP_POST_VARS['mode']) || !empty($HTTP_GET_VARS['mode']) )
}
else
{
- $mode = "";
+ $mode = '';
}
$start = ( !empty($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0;
@@ -108,7 +107,7 @@ if ( isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL
}
else
{
- $privmsg_id = "";
+ $privmsg_id = '';
}
$error = FALSE;
@@ -116,22 +115,22 @@ $error = FALSE;
//
// Define the box image links
//
-$inbox_img = ($folder != "inbox" || $mode != "") ? ' ' : ' ';
-$inbox_url = ($folder != "inbox" || $mode != "") ? '' . $lang['Inbox'] . ' ' : $lang['Inbox'];
+$inbox_img = ( $folder != 'inbox' || $mode != '' ) ? ' ' : ' ';
+$inbox_url = ( $folder != 'inbox' || $mode != '' ) ? '' . $lang['Inbox'] . ' ' : $lang['Inbox'];
-$outbox_img = ($folder != "outbox" || $mode != "") ? ' ' : ' ';
-$outbox_url = ($folder != "outbox" || $mode != "") ? '' . $lang['Outbox'] . ' ' : $lang['Outbox'];
+$outbox_img = ( $folder != 'outbox' || $mode != '' ) ? ' ' : ' ';
+$outbox_url = ( $folder != 'outbox' || $mode != '' ) ? '' . $lang['Outbox'] . ' ' : $lang['Outbox'];
-$sentbox_img = ($folder != "sentbox" || $mode != "") ? ' ' : ' ';
-$sentbox_url = ($folder != "sentbox" || $mode != "") ? '' . $lang['Sentbox'] . ' ' : $lang['Sentbox'];
+$sentbox_img = ( $folder != 'sentbox' || $mode != '' ) ? ' ' : ' ';
+$sentbox_url = ( $folder != 'sentbox' || $mode != '' ) ? '' . $lang['Sentbox'] . ' ' : $lang['Sentbox'];
-$savebox_img = ($folder != "savebox" || $mode != "") ? ' ' : ' ';
-$savebox_url = ($folder != "savebox" || $mode != "") ? '' . $lang['Savebox'] . ' ' : $lang['Savebox'];
+$savebox_img = ( $folder != 'savebox' || $mode != '' ) ? ' ' : ' ';
+$savebox_url = ( $folder != 'savebox' || $mode != '' ) ? '' . $lang['Savebox'] . ' ' : $lang['Savebox'];
// ----------
// Start main
//
-if ( $mode == "newpm" )
+if ( $mode == 'newpm' )
{
$gen_simple_header = TRUE;
@@ -139,7 +138,7 @@ if ( $mode == "newpm" )
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "body" => "privmsgs_popup.tpl")
+ 'body' => 'privmsgs_popup.tpl')
);
if ( $userdata['session_logged_in'] )
@@ -153,7 +152,7 @@ if ( $mode == "newpm" )
$l_new_message = $lang['You_no_new_pm'];
}
- $l_new_message .= " " . sprintf($lang['Click_view_privmsg'], "", " ");
+ $l_new_message .= ' ' . sprintf($lang['Click_view_privmsg'], '', ' ');
}
else
{
@@ -161,16 +160,16 @@ if ( $mode == "newpm" )
}
$template->assign_vars(array(
- "L_CLOSE_WINDOW" => $lang['Close_window'],
- "L_MESSAGE" => $l_new_message)
+ 'L_CLOSE_WINDOW' => $lang['Close_window'],
+ 'L_MESSAGE' => $l_new_message)
);
- $template->pparse("body");
+ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
-else if ( $mode == "read" )
+else if ( $mode == 'read' )
{
if ( !empty($HTTP_GET_VARS[POST_POST_URL]) )
{
@@ -183,58 +182,45 @@ else if ( $mode == "read" )
if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true));
}
- if ( $folder )
+ //
+ // SQL to pull appropriate message, prevents nosey people
+ // reading other peoples messages ... hopefully!
+ //
+ switch( $folder )
{
- //
- // SQL to pull appropriate message, prevents nosey people
- // reading other peoples messages ... hopefully!
- //
- if ($folder == "inbox")
- {
+ case 'inbox':
$l_box_name = $lang['Inbox'];
-
$pm_sql_user = "AND pm.privmsgs_to_userid = " . $userdata['user_id'] . "
AND ( pm.privmsgs_type = " . PRIVMSGS_READ_MAIL . "
OR pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . "
OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )";
- }
- else if ($folder == "outbox")
- {
+ break;
+ case 'outbox':
$l_box_name = $lang['Outbox'];
-
$pm_sql_user = "AND pm.privmsgs_from_userid = " . $userdata['user_id'] . "
AND ( pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . "
OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) ";
- }
- else if ($folder == "sentbox")
- {
+ break;
+ case 'sentbox':
$l_box_name = $lang['Sentbox'];
-
$pm_sql_user = "AND pm.privmsgs_from_userid = " . $userdata['user_id'] . "
AND pm.privmsgs_type = " . PRIVMSGS_SENT_MAIL;
- }
- else if ($folder == "savebox")
- {
+ break;
+ case 'savebox':
$l_box_name = $lang['Savebox'];
-
$pm_sql_user .= "AND ( ( pm.privmsgs_to_userid = " . $userdata['user_id'] . "
AND pm.privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " )
OR ( pm.privmsgs_from_userid = " . $userdata['user_id'] . "
AND pm.privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " )
)";
- }
- else
- {
+ break;
+ default:
message_die(GENERAL_ERROR, $lang['No_such_folder']);
- }
- }
- else
- {
- message_die(GENERAL_ERROR, $lang['No_folder']);
+ break;
}
//
@@ -247,17 +233,17 @@ else if ( $mode == "read" )
$pm_sql_user
AND u.user_id = pm.privmsgs_from_userid
AND u2.user_id = pm.privmsgs_to_userid";
- if ( !$pm_status = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Could not query private message post information.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not query private message post information', '', __LINE__, __FILE__, $sql);
}
//
// Did the query return any data?
//
- if ( !( $privmsg = $db->sql_fetchrow($pm_status) ) )
+ if ( !($privmsg = $db->sql_fetchrow($result)) )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
}
@@ -267,22 +253,22 @@ else if ( $mode == "read" )
// Is this a new message in the inbox? If it is then save
// a copy in the posters sent box
//
- if ( ( $privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL ) && $folder == "inbox" )
+ if ( ( $privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL ) && $folder == 'inbox' )
{
$sql = "UPDATE " . PRIVMSGS_TABLE . "
SET privmsgs_type = " . PRIVMSGS_READ_MAIL . "
WHERE privmsgs_id = " . $privmsg['privmsgs_id'];
- if ( !$pm_upd_status = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not update private message read status.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update private message read status', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg - 1
WHERE user_id = " . $userdata['user_id'];
- if ( !$user_upd_status = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not update private message read status for user.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update private message read status for user', '', __LINE__, __FILE__, $sql);
}
//
@@ -294,103 +280,132 @@ else if ( $mode == "read" )
AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid'];
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain sent message info for sendee', '', __LINE__, __FILE__, $sql);
}
- $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
+ $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';
- if ( $db->sql_numrows($result) )
+ if ( $sent_info = $db->sql_fetchrow($result) )
{
- $sent_info = $db->sql_fetchrow($result);
-
if ( $sent_info['sent_items'] >= $board_config['max_sentbox_privmsgs'] )
{
$sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . "
WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . "
AND privmsgs_date = " . $sent_info['oldest_post_time'] . "
AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid'];
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs', '', __LINE__, __FILE__, $sql);
}
}
}
//
- // This makes a copy of the post and stores
- // it as a SENT message from the sendee. Perhaps
- // not the most DB friendly way but a lot easier
- // to manage, besides the admin will be able to
- // set limits on numbers of storable posts for
- // users ... hopefully!
+ // This makes a copy of the post and stores it as a SENT message from the sendee. Perhaps
+ // not the most DB friendly way but a lot easier to manage, besides the admin will be able to
+ // set limits on numbers of storable posts for users ... hopefully!
//
$sql = "INSERT $sql_priority INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
VALUES (" . PRIVMSGS_SENT_MAIL . ", '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_subject'])) . "', " . $privmsg['privmsgs_from_userid'] . ", " . $privmsg['privmsgs_to_userid'] . ", " . $privmsg['privmsgs_date'] . ", '" . $privmsg['privmsgs_ip'] . "', " . $privmsg['privmsgs_enable_html'] . ", " . $privmsg['privmsgs_enable_bbcode'] . ", " . $privmsg['privmsgs_enable_smilies'] . ", " . $privmsg['privmsgs_attach_sig'] . ")";
- if ( !$pm_sent_status = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
}
- else
- {
- $privmsg_sent_id = $db->sql_nextid();
- $sql = "INSERT $sql_priority INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
- VALUES ($privmsg_sent_id, '" . $privmsg['privmsgs_bbcode_uid'] . "', '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_text'])) . "')";
- if (!$pm_sent_text_status = $db->sql_query($sql))
- {
- message_die(GENERAL_ERROR, "Could not insert private message sent text. $sql", "", __LINE__, __FILE__, $sql);
- }
+ $privmsg_sent_id = $db->sql_nextid();
+
+ $sql = "INSERT $sql_priority INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
+ VALUES ($privmsg_sent_id, '" . $privmsg['privmsgs_bbcode_uid'] . "', '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_text'])) . "')";
+ if ( !$db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
}
}
//
- // Pick a folder, any folder, so long as it's one
- // below ...
+ // Pick a folder, any folder, so long as it's one below ...
//
- if ( $folder == "inbox" )
+ $post_urls = array(
+ 'post' => append_sid("privmsg.$phpEx?mode=post"),
+ 'reply' => append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsg_id"),
+ 'quote' => append_sid("privmsg.$phpEx?mode=quote&" . POST_POST_URL . "=$privmsg_id"),
+ 'edit' => append_sid("privmsg.$phpEx?mode=edit&" . POST_POST_URL . "=$privmsg_id")
+ );
+ $post_icons = array(
+ 'post_img' => ' ',
+ 'post' => '' . $lang['Post_new_pm'] . ' ',
+ 'reply_img' => ' ',
+ 'reply' => '' . $lang['Post_reply_pm'] . ' ',
+ 'quote_img' => ' ',
+ 'quote' => '' . $lang['Post_quote_pm'] . ' ',
+ 'edit_img' => ' ',
+ 'edit' => '' . $lang['Edit_pm'] . ' '
+ );
+
+ if ( $folder == 'inbox' )
{
- $post_pm_img = " ";
- $reply_pm_img = " ";
- $quote_pm_img = " ";
- $edit_pm_img = "";
+ $post_img = $post_icons['post_img'];
+ $reply_img = $post_icons['reply_img'];
+ $quote_img = $post_icons['quote_img'];
+ $edit_img = '';
+ $post = $post_icons['post'];
+ $reply = $post_icons['reply'];
+ $quote = $post_icons['quote'];
+ $edit = '';
$l_box_name = $lang['Inbox'];
}
- else if ( $folder == "outbox" )
+ else if ( $folder == 'outbox' )
{
- $post_pm_img = " ";
- $reply_pm_img = "";
- $quote_pm_img = "";
- $edit_pm_img = " ";
+ $post_img = $post_icons['post_img'];
+ $reply_img = '';
+ $quote_img = '';
+ $edit_img = $post_icons['edit_img'];
+ $post = $post_icons['post'];
+ $reply = '';
+ $quote = '';
+ $edit = $post_icons['edit'];
$l_box_name = $lang['Outbox'];
}
- else if ( $folder == "savebox" )
+ else if ( $folder == 'savebox' )
{
if ( $privmsg['privmsgs_type'] == PRIVMSGS_SAVED_IN_MAIL )
{
- $post_pm_img = " ";
- $reply_pm_img = " ";
- $quote_pm_img = " ";
- $edit_pm_img = "";
+ $post_img = $post_icons['post_img'];
+ $reply_img = $post_icons['reply_img'];
+ $quote_img = $post_icons['quote_img'];
+ $edit_img = '';
+ $post = $post_icons['post'];
+ $reply = $post_icons['reply'];
+ $quote = $post_icons['quote'];
+ $edit = '';
}
else
{
- $post_pm_img = " ";
- $reply_pm_img = "";
- $quote_pm_img = "";
- $edit_pm_img = "";
+ $post_img = $post_icons['post_img'];
+ $reply_img = '';
+ $quote_img = '';
+ $edit_img = '';
+ $post = $post_icons['post'];
+ $reply = '';
+ $quote = '';
+ $edit = '';
}
$l_box_name = $lang['Saved'];
}
- else if ( $folder == "sentbox" )
+ else if ( $folder == 'sentbox' )
{
- $post_pm_img = " ";
- $reply_pm_img = "";
- $quote_pm_img = "";
- $edit_pm_img = "";
+ $post_img = $post_icons['post_img'];
+ $reply_img = '';
+ $quote_img = '';
+ $edit_img = '';
+ $post = $post_icons['post'];
+ $reply = '';
+ $quote = '';
+ $edit = '';
$l_box_name = $lang['Sent'];
}
- $s_hidden_fields = " ";
+ $s_hidden_fields = ' ';
$page_title = $lang['Read_private_message'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
@@ -399,53 +414,47 @@ else if ( $mode == "read" )
// Load templates
//
$template->set_filenames(array(
- "body" => "privmsgs_read_body.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'body' => 'privmsgs_read_body.tpl')
);
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ make_jumpbox('viewforum.'.$phpEx);
$template->assign_vars(array(
- "INBOX_IMG" => $inbox_img,
- "SENTBOX_IMG" => $sentbox_img,
- "OUTBOX_IMG" => $outbox_img,
- "SAVEBOX_IMG" => $savebox_img,
- "INBOX_LINK" => $inbox_url,
+ 'INBOX_IMG' => $inbox_img,
+ 'SENTBOX_IMG' => $sentbox_img,
+ 'OUTBOX_IMG' => $outbox_img,
+ 'SAVEBOX_IMG' => $savebox_img,
+ 'INBOX' => $inbox_url,
- "POST_PM_IMG" => $post_pm_img,
- "REPLY_PM_IMG" => $reply_pm_img,
- "EDIT_PM_IMG" => $edit_pm_img,
- "QUOTE_PM_IMG" => $quote_pm_img,
+ 'POST_PM_IMG' => $post_img,
+ 'REPLY_PM_IMG' => $reply_img,
+ 'EDIT_PM_IMG' => $edit_img,
+ 'QUOTE_PM_IMG' => $quote_img,
+ 'POST_PM' => $post,
+ 'REPLY_PM' => $reply,
+ 'EDIT_PM' => $edit,
+ 'QUOTE_PM' => $quote,
- "SENTBOX_LINK" => $sentbox_url,
- "OUTBOX_LINK" => $outbox_url,
- "SAVEBOX_LINK" => $savebox_url,
+ 'SENTBOX' => $sentbox_url,
+ 'OUTBOX' => $outbox_url,
+ 'SAVEBOX' => $savebox_url,
- "BOX_NAME" => $l_box_name,
+ 'BOX_NAME' => $l_box_name,
- "L_INBOX" => $lang['Inbox'],
- "L_OUTBOX" => $lang['Outbox'],
- "L_SENTBOX" => $lang['Sent'],
- "L_SAVEBOX" => $lang['Saved'],
- "L_FLAG" => $lang['Flag'],
- "L_SUBJECT" => $lang['Subject'],
- "L_DATE" => $lang['Date'],
- "L_FROM" => $lang['From'],
- "L_TO" => $lang['To'],
- "L_SAVE_MSG" => $lang['Save_message'],
- "L_DELETE_MSG" => $lang['Delete_message'],
+ 'L_INBOX' => $lang['Inbox'],
+ 'L_OUTBOX' => $lang['Outbox'],
+ 'L_SENTBOX' => $lang['Sent'],
+ 'L_SAVEBOX' => $lang['Saved'],
+ 'L_FLAG' => $lang['Flag'],
+ 'L_SUBJECT' => $lang['Subject'],
+ 'L_POSTED' => $lang['Posted'],
+ 'L_DATE' => $lang['Date'],
+ 'L_FROM' => $lang['From'],
+ 'L_TO' => $lang['To'],
+ 'L_SAVE_MSG' => $lang['Save_message'],
+ 'L_DELETE_MSG' => $lang['Delete_message'],
- "S_PRIVMSGS_ACTION" => append_sid("privmsg.$phpEx?folder=$folder"),
- "S_HIDDEN_FIELDS" => $s_hidden_fields)
+ 'S_PRIVMSGS_ACTION' => append_sid("privmsg.$phpEx?folder=$folder"),
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
$username_from = $privmsg['username_1'];
@@ -455,39 +464,56 @@ else if ( $mode == "read" )
$post_date = create_date($board_config['default_dateformat'], $privmsg['privmsgs_date'], $board_config['board_timezone']);
- $profile_img = " ";
+ $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $user_id_from);
+ $profile_img = ' ';
+ $profile = '' . $lang['Read_profile'] . ' ';
- if ( !empty($privmsg['user_viewemail']) )
+ $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$poster_id");
+ $pm_img = ' ';
+ $pm = '' . $lang['Send_private_message'] . ' ';
+
+ if ( !empty($privmsg['user_viewemail']) || $is_auth['auth_mod'] )
{
- $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $user_id_from) : 'mailto:' . $privmsg['user_email'];
+ $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $poster_id) : 'mailto:' . $privmsg['user_email'];
- $email_img = ' ';
+ $email_img = ' ';
+ $email = '' . $lang['Send_email'] . ' ';
}
else
{
$email_img = '';
+ $email = '';
}
- $www_img = ( $privmsg['user_website']) ? ' ' : '';
+ $www_img = ( $privmsg['user_website'] ) ? ' ' : '';
+ $www = ( $privmsg['user_website'] ) ? '' . $lang['Visit_website'] . ' ' : '';
if ( !empty($privmsg['user_icq']) )
{
$icq_status_img = ' ';
- $icq_add_img = ' ';
+ $icq_img = ' ';
+ $icq = '' . $lang['ICQ'] . ' ';
}
else
{
$icq_status_img = '';
- $icq_add_img = '';
+ $icq_img = '';
+ $icq = '';
}
- $aim_img = ( $privmsg['user_aim'] ) ? " " : "";
+ $aim_img = ( $privmsg['user_aim'] ) ? ' ' : '';
+ $aim = ( $privmsg['user_aim'] ) ? '' . $lang['AIM'] . ' ' : '';
- $msn_img = ( $privmsg['user_msnm'] ) ? " " : "";
+ $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id");
+ $msn_img = ( $privmsg['user_msnm'] ) ? ' ' : '';
+ $msn = ( $privmsg['user_msnm'] ) ? '' . $lang['MSNM'] . ' ' : '';
- $yim_img = ( $privmsg['user_yim'] ) ? " " : "";
+ $yim_img = ( $privmsg['user_yim'] ) ? ' ' : '';
+ $yim = ( $privmsg['user_yim'] ) ? '' . $lang['YIM'] . ' ' : '';
- $search_img = " ";
+ $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username_from) . "&showresults=posts");
+ $search_img = ' ';
+ $search = '' . $lang['Search_user_posts'] . ' ';
//
// Processing of post
@@ -503,8 +529,9 @@ else if ( $mode == "read" )
}
else
{
- $user_sig = "";
+ $user_sig = '';
}
+
$user_sig_bbcode_uid = ( $privmsg['privmsgs_from_userid'] == $userdata['user_id'] ) ? $userdata['user_sig_bbcode_uid'] : $privmsg['user_sig_bbcode_uid'];
//
@@ -513,32 +540,32 @@ else if ( $mode == "read" )
//
if ( !$board_config['allow_html'] )
{
- if ( $user_sig != "" && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] )
+ if ( $user_sig != '' && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] )
{
- $user_sig = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $user_sig);
+ $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
}
if ( $privmsg['privmsgs_enable_html'] )
{
- $private_message = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $private_message);
+ $private_message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $private_message);
}
}
- if ( $user_sig != "" && $privmsg['privmsgs_attach_sig'] && $user_sig_bbcode_uid != "" )
+ if ( $user_sig != '' && $privmsg['privmsgs_attach_sig'] && $user_sig_bbcode_uid != '' )
{
- $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $user_sig);
+ $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
}
- if ( $bbcode_uid != "" )
+ if ( $bbcode_uid != '' )
{
- $private_message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($private_message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $private_message);
+ $private_message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($private_message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $private_message);
}
$private_message = make_clickable($private_message);
- if ( $privmsg['privmsgs_attach_sig'] && $user_sig != "" )
+ if ( $privmsg['privmsgs_attach_sig'] && $user_sig != '' )
{
- $private_message .= " _________________ " . make_clickable($user_sig);
+ $private_message .= ' _________________ ' . make_clickable($user_sig);
}
if ( count($orig_word) )
@@ -552,45 +579,52 @@ else if ( $mode == "read" )
$private_message = smilies_pass($private_message);
}
- $private_message = str_replace("\n", " ", $private_message);
+ $private_message = str_replace("\n", ' ', $private_message);
//
// Dump it to the templating engine
//
$template->assign_vars(array(
- "MESSAGE_TO" => $username_to,
- "MESSAGE_FROM" => $username_from,
- "RANK_IMAGE" => $rank_image,
- "POSTER_JOINED" => $poster_joined,
- "POSTER_POSTS" => $poster_posts,
- "POSTER_FROM" => $poster_from,
- "POSTER_AVATAR" => $poster_avatar,
- "PROFILE_IMG" => $profile_img,
- "SEARCH_IMG" => $search_img,
- "EMAIL_IMG" => $email_img,
- "WWW_IMG" => $www_img,
- "ICQ" => ( $privmsg['user_icq'] ) ? $privmsg['user_icq'] : " ",
- "ICQ_IMG" => ( $privmsg['user_icq'] ) ? $images['icon_icq'] : " ",
- "ICQ_STATUS_IMG" => $icq_status_img,
- "ICQ_ADD_IMG" => $icq_add_img,
- "AIM_IMG" => $aim_img,
- "MSN_IMG" => $msn_img,
- "YIM_IMG" => $yim_img,
- "POST_SUBJECT" => $post_subject,
- "MESSAGE" => $private_message,
- "POST_DATE" => $post_date)
+ 'MESSAGE_TO' => $username_to,
+ 'MESSAGE_FROM' => $username_from,
+ 'RANK_IMAGE' => $rank_image,
+ 'POSTER_JOINED' => $poster_joined,
+ 'POSTER_POSTS' => $poster_posts,
+ 'POSTER_FROM' => $poster_from,
+ 'POSTER_AVATAR' => $poster_avatar,
+ 'POST_SUBJECT' => $post_subject,
+ 'POST_DATE' => $post_date,
+ 'MESSAGE' => $private_message,
+
+ 'PROFILE_IMG' => $profile_img,
+ 'PROFILE' => $profile,
+ 'SEARCH_IMG' => $search_img,
+ 'SEARCH' => $search,
+ 'EMAIL_IMG' => $email_img,
+ 'EMAIL' => $email,
+ 'WWW_IMG' => $www_img,
+ 'WWW' => $www,
+ 'ICQ_STATUS_IMG' => $icq_status_img,
+ 'ICQ_IMG' => $icq_img,
+ 'ICQ' => $icq,
+ 'AIM_IMG' => $aim_img,
+ 'AIM' => $aim,
+ 'MSN_IMG' => $msn_img,
+ 'MSN' => $msn,
+ 'YIM_IMG' => $yim_img,
+ 'YIM' => $yim)
);
- $template->pparse("body");
+ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else if ( ( $delete && $mark_list ) || $delete_all )
{
- if (!$userdata['session_logged_in'])
+ if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
}
if ( isset($mark_list) && !is_array($mark_list) )
@@ -602,7 +636,7 @@ else if ( ( $delete && $mark_list ) || $delete_all )
if ( !$confirm )
{
$s_hidden_fields = ' ';
- $s_hidden_fields .= (isset($HTTP_POST_VARS['delete'])) ? ' ' : ' ';
+ $s_hidden_fields .= ( isset($HTTP_POST_VARS['delete']) ) ? ' ' : ' ';
for($i = 0; $i < count($mark_list); $i++)
{
@@ -615,19 +649,20 @@ else if ( ( $delete && $mark_list ) || $delete_all )
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "confirm_body" => "confirm_body.tpl")
+ 'confirm_body' => 'confirm_body.tpl')
);
$template->assign_vars(array(
- "MESSAGE_TITLE" => $lang['Information'],
- "MESSAGE_TEXT" => ( count($mark_list) == 1) ? $lang['Confirm_delete_pm'] : $lang['Confirm_delete_pms'],
+ 'MESSAGE_TITLE' => $lang['Information'],
+ 'MESSAGE_TEXT' => ( count($mark_list) == 1 ) ? $lang['Confirm_delete_pm'] : $lang['Confirm_delete_pms'],
- "L_YES" => $lang['Yes'],
- "L_NO" => $lang['No'],
+ 'L_YES' => $lang['Yes'],
+ 'L_NO' => $lang['No'],
- "S_CONFIRM_ACTION" => append_sid("privmsg.$phpEx?folder=$folder"),
- "S_HIDDEN_FIELDS" => $s_hidden_fields)
+ 'S_CONFIRM_ACTION' => append_sid("privmsg.$phpEx?folder=$folder"),
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
- $template->pparse("confirm_body");
+
+ $template->pparse('confirm_body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
@@ -664,7 +699,7 @@ else if ( ( $delete && $mark_list ) || $delete_all )
WHERE $delete_type";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Could not obtain id list to delete all messages.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain id list to delete all messages', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
@@ -677,7 +712,7 @@ else if ( ( $delete && $mark_list ) || $delete_all )
if ( count($mark_list) )
{
- $delete_sql_id = implode(", ", $mark_list);
+ $delete_sql_id = implode(', ', $mark_list);
//
// Need to decrement the new message counter of recipient
@@ -693,23 +728,23 @@ else if ( ( $delete && $mark_list ) || $delete_all )
AND privmsgs_type = " . PRIVMSGS_NEW_MAIL;
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain user id list for outbox messages", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user id list for outbox messages', '', __LINE__, __FILE__, $sql);
}
- $update_pm_sql = "";
+ $update_pm_sql = '';
while( $row = $db->sql_fetchrow($result) )
{
- $update_pm_sql .= ( ( $update_pm_sql != "" ) ? ", " : "" ) . $row['privmsgs_to_userid'];
+ $update_pm_sql .= ( ( $update_pm_sql != '' ) ? ', ' : '' ) . $row['privmsgs_to_userid'];
}
- if ( $update_pm_sql != "" )
+ if ( $update_pm_sql != '' )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_new_privmsg = user_new_privmsg - 1
WHERE user_id IN ($update_pm_sql)";
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Couldn't update users new msg counters", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update users new msg counters', '', __LINE__, __FILE__, $sql);
}
}
@@ -720,23 +755,23 @@ else if ( ( $delete && $mark_list ) || $delete_all )
AND privmsgs_type = " . PRIVMSGS_UNREAD_MAIL;
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain user id list for outbox messages", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user id list for outbox messages', '', __LINE__, __FILE__, $sql);
}
- $update_pm_sql = "";
+ $update_pm_sql = '';
while( $row = $db->sql_fetchrow($result) )
{
- $update_pm_sql .= ( ( $update_pm_sql != "" ) ? ", " : "" ) . $row['privmsgs_to_userid'];
+ $update_pm_sql .= ( ( $update_pm_sql != '' ) ? ', ' : '' ) . $row['privmsgs_to_userid'];
}
- if ( $update_pm_sql != "" )
+ if ( $update_pm_sql != '' )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg - 1
WHERE user_id IN ($update_pm_sql)";
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Couldn't update users new msg counters", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update users new msg counters', '', __LINE__, __FILE__, $sql);
}
}
}
@@ -747,7 +782,7 @@ else if ( ( $delete && $mark_list ) || $delete_all )
WHERE privmsgs_id IN ($delete_sql_id)
AND ";
- switch($folder)
+ switch( $folder )
{
case 'inbox':
$delete_sql .= "privmsgs_to_userid = " . $userdata['user_id'] . " AND (
@@ -773,21 +808,21 @@ else if ( ( $delete && $mark_list ) || $delete_all )
if ( !$db->sql_query($delete_sql, BEGIN_TRANSACTION) )
{
- message_die(GENERAL_ERROR, "Could not delete private message info.", "", __LINE__, __FILE__, $delete_sql);
+ message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql);
}
if ( !$db->sql_query($delete_text_sql, END_TRANSACTION) )
{
- message_die(GENERAL_ERROR, "Could not delete private message text.", "", __LINE__, __FILE__, $delete_text_sql);
+ message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql);
}
}
}
}
-else if ( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
+else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' )
{
if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
}
@@ -802,10 +837,10 @@ else if ( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") )";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain sent message info for sendee', '', __LINE__, __FILE__, $sql);
}
- $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
+ $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';
if ( $saved_info = $db->sql_fetchrow($result) )
{
@@ -817,9 +852,9 @@ else if ( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
OR ( privmsgs_from_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") )
AND privmsgs_date = " . $saved_info['oldest_post_time'];
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs', '', __LINE__, __FILE__, $sql);
}
}
}
@@ -829,7 +864,7 @@ else if ( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
//
$saved_sql = "UPDATE " . PRIVMSGS_TABLE;
- switch($folder)
+ switch( $folder )
{
case 'inbox':
$saved_sql .= " SET privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . "
@@ -855,32 +890,28 @@ else if ( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
if ( count($mark_list) )
{
- $saved_sql_id = "";
+ $saved_sql_id = '';
for($i = 0; $i < count($mark_list); $i++)
{
- if ( $saved_sql_id != "" )
- {
- $saved_sql_id .= ", ";
- }
- $saved_sql_id .= $mark_list[$i];
+ $saved_sql_id .= ( ( $saved_sql_id != '' ) ? ', ' : '' ) . $mark_list[$i];
}
$saved_sql .= " AND privmsgs_id IN ($saved_sql_id)";
- if ( !$save_status = $db->sql_query($saved_sql) )
+ if ( !$db->sql_query($saved_sql) )
{
- message_die(GENERAL_ERROR, "Could not save private messages.", "", __LINE__, __FILE__, $saved_sql);
+ message_die(GENERAL_ERROR, 'Could not save private messages', '', __LINE__, __FILE__, $saved_sql);
}
}
}
-else if ( $submit || $refresh || $mode != "" )
+else if ( $submit || $refresh || $mode != '' )
{
- if (!$userdata['session_logged_in'])
+ if ( !$userdata['session_logged_in'] )
{
- $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? "&" . POST_USERS_URL . "=" . $HTTP_GET_VARS[POST_USERS_URL] : "";
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? '&' . POST_USERS_URL . '=' . $HTTP_GET_VARS[POST_USERS_URL] : '';
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
}
@@ -915,9 +946,9 @@ else if ( $submit || $refresh || $mode != "" )
}
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : $userdata['user_attachsig'];
- $user_sig = ( $userdata['user_sig'] != "" && $board_config['allow_sig'] ) ? $userdata['user_sig'] : "";
+ $user_sig = ( $userdata['user_sig'] != '' && $board_config['allow_sig'] ) ? $userdata['user_sig'] : "";
- if ( $submit && $mode != "edit" )
+ if ( $submit && $mode != 'edit' )
{
//
// Flood control
@@ -952,15 +983,13 @@ else if ( $submit || $refresh || $mode != "" )
FROM " . USERS_TABLE . "
WHERE username = '" . str_replace("\'", "''", $to_username) . "'
AND user_id <> " . ANONYMOUS;
- if (!($result = $db->sql_query($sql)))
+ if ( !($result = $db->sql_query($sql)) )
{
$error = TRUE;
$error_msg = $lang['No_such_user'];
}
- else
- {
- $to_userdata = $db->sql_fetchrow($result);
- }
+
+ $to_userdata = $db->sql_fetchrow($result);
}
else
{
@@ -1024,7 +1053,7 @@ else if ( $submit || $refresh || $mode != "" )
message_die(GENERAL_MESSAGE, $lang['No_such_user']);
}
- $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
+ $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';
if ( $inbox_info = $db->sql_fetchrow($result) )
{
@@ -1036,21 +1065,13 @@ else if ( $submit || $refresh || $mode != "" )
OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )
AND privmsgs_date = " . $inbox_info['oldest_post_time'] . "
AND privmsgs_to_userid = " . $to_userdata['user_id'];
- if ( !($result = $db->sql_query($sql)) )
+ if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs', '', __LINE__, __FILE__, $sql);
}
}
}
- //
- // This area is reserved for future use :D
- //
-
- //
- //
- //
-
$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $userdata['user_id'] . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $html_on, $bbcode_on, $smilies_on, $attach_sig)";
}
@@ -1061,85 +1082,81 @@ else if ( $submit || $refresh || $mode != "" )
WHERE privmsgs_id = $privmsg_id";
}
- if ( !$pm_sent_status = $db->sql_query($sql_info, BEGIN_TRANSACTION) )
+ if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
}
+
+ if ( $mode != "edit" )
+ {
+ $privmsg_sent_id = $db->sql_nextid();
+
+ $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
+ VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')";
+ }
else
{
- if ( $mode != "edit" )
- {
- $privmsg_sent_id = $db->sql_nextid();
-
- $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
- VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')";
- }
- else
- {
- $sql = "UPDATE " . PRIVMSGS_TEXT_TABLE . "
- SET privmsgs_text = '" . str_replace("\'", "''", $privmsg_message) . "', privmsgs_bbcode_uid = '$bbcode_uid'
- WHERE privmsgs_text_id = $privmsg_id";
- }
-
- if ( !($pm_sent_text_status = $db->sql_query($sql, END_TRANSACTION)) )
- {
- message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
- }
- else if ( $mode != "edit" )
- {
- //
- // Add to the users new pm counter
- //
- $sql = "UPDATE " . USERS_TABLE . "
- SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "
- WHERE user_id = " . $to_userdata['user_id'];
- if ( !$status = $db->sql_query($sql) )
- {
- message_die(GENERAL_ERROR, "Could not update private message new/read status for user.", "", __LINE__, __FILE__, $sql);
- }
-
- if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] )
- {
- $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
-
- $script_name = preg_replace("/^\/?(.*?)\/?$/", "\\1", trim($board_config['script_path']));
- $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;
- $server_name = trim($board_config['server_name']);
- $server_protocol = ( $board_config['cookie_secure'] ) ? "https://" : "http://";
- $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
-
- include($phpbb_root_path . 'includes/emailer.'.$phpEx);
- $emailer = new emailer($board_config['smtp_delivery']);
-
- //
- // Attempt to use language setting for recipient
- //
- $emailer->use_template("privmsg_notify", $to_userdata['user_lang']);
- $emailer->extra_headers($email_headers);
- $emailer->email_address($to_userdata['user_email']);
- $emailer->set_subject(); //$lang['Notification_subject']
-
- $emailer->assign_vars(array(
- "USERNAME" => $to_username,
- "SITENAME" => $board_config['sitename'],
- "EMAIL_SIG" => str_replace(" ", "\n", "-- \n" . $board_config['board_email_sig']),
-
- "U_INBOX" => $server_protocol . $server_name . $server_port . $script_name . "?folder=inbox")
- );
-
- $emailer->send();
- $emailer->reset();
- }
- }
-
- $template->assign_vars(array(
- "META" => ' ')
- );
-
- $msg = $lang['Message_sent'] . " " . sprintf($lang['Click_return_inbox'], "", " ") . " " . sprintf($lang['Click_return_index'], "", " ");
-
- message_die(GENERAL_MESSAGE, $msg);
+ $sql = "UPDATE " . PRIVMSGS_TEXT_TABLE . "
+ SET privmsgs_text = '" . str_replace("\'", "''", $privmsg_message) . "', privmsgs_bbcode_uid = '$bbcode_uid'
+ WHERE privmsgs_text_id = $privmsg_id";
}
+
+ if ( !$db->sql_query($sql, END_TRANSACTION) )
+ {
+ message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
+ }
+
+ if ( $mode != 'edit' )
+ {
+ //
+ // Add to the users new pm counter
+ //
+ $sql = "UPDATE " . USERS_TABLE . "
+ SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "
+ WHERE user_id = " . $to_userdata['user_id'];
+ if ( !$status = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
+ }
+
+ if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] )
+ {
+ $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
+
+ $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
+ $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;
+ $server_name = trim($board_config['server_name']);
+ $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
+ $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
+
+ include($phpbb_root_path . 'includes/emailer.'.$phpEx);
+ $emailer = new emailer($board_config['smtp_delivery']);
+
+ $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
+ $emailer->extra_headers($email_headers);
+ $emailer->email_address($to_userdata['user_email']);
+ $emailer->set_subject(); //$lang['Notification_subject']
+
+ $emailer->assign_vars(array(
+ 'USERNAME' => $to_username,
+ 'SITENAME' => $board_config['sitename'],
+ 'EMAIL_SIG' => str_replace(' ', "\n", "-- \n" . $board_config['board_email_sig']),
+
+ 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')
+ );
+
+ $emailer->send();
+ $emailer->reset();
+ }
+ }
+
+ $template->assign_vars(array(
+ 'META' => ' ')
+ );
+
+ $msg = $lang['Message_sent'] . ' ' . sprintf($lang['Click_return_inbox'], '', ' ') . ' ' . sprintf($lang['Click_return_index'], '', ' ');
+
+ message_die(GENERAL_MESSAGE, $msg);
}
else if ( $preview || $refresh || $error )
{
@@ -1149,9 +1166,9 @@ else if ( $submit || $refresh || $mode != "" )
// passed to the script, process it a little, do some checks
// where neccessary, etc.
//
- $to_username = ( isset($HTTP_POST_VARS['username']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['username']))) : "";
- $privmsg_subject = ( isset($HTTP_POST_VARS['subject']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['subject']))) : "";
- $privmsg_message = ( isset($HTTP_POST_VARS['message']) ) ? trim($HTTP_POST_VARS['message']) : "";
+ $to_username = ( isset($HTTP_POST_VARS['username']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['username']))) : '';
+ $privmsg_subject = ( isset($HTTP_POST_VARS['subject']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['subject']))) : '';
+ $privmsg_message = ( isset($HTTP_POST_VARS['message']) ) ? trim($HTTP_POST_VARS['message']) : '';
$privmsg_message = preg_replace('##si', '</textarea>', $privmsg_message);
- $user_sig = ( $board_config['allow_sig'] ) ? $privmsg['user_sig'] : "";
+ $user_sig = ( $board_config['allow_sig'] ) ? $privmsg['user_sig'] : '';
$to_username = $privmsg['username'];
$to_userid = $privmsg['user_id'];
}
- else if ( $mode == "reply" || $mode == "quote" )
+ else if ( $mode == 'reply' || $mode == 'quote' )
{
$sql = "SELECT pm.privmsgs_subject, pm.privmsgs_date, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text, u.username, u.user_id
@@ -1297,36 +1292,36 @@ else if ( $submit || $refresh || $mode != "" )
AND pmt.privmsgs_text_id = pm.privmsgs_id
AND pm.privmsgs_to_userid = " . $userdata['user_id'] . "
AND u.user_id = pm.privmsgs_from_userid";
- if (!$pm_reply_status = $db->sql_query($sql))
+ if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain private message for editing', '', __LINE__, __FILE__, $sql);
}
- if ( !($privmsg = $db->sql_fetchrow($pm_reply_status)) )
+ if ( !($privmsg = $db->sql_fetchrow($result)) )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
}
- $privmsg_subject = ( ( !preg_match("/^Re:/", $privmsg['privmsgs_subject']) ) ? "Re: " : "" ) . $privmsg['privmsgs_subject'];
+ $privmsg_subject = ( ( !preg_match('/^Re:/', $privmsg['privmsgs_subject']) ) ? 'Re: ' : '' ) . $privmsg['privmsgs_subject'];
$to_username = $privmsg['username'];
$to_userid = $privmsg['user_id'];
- if ( $mode == "quote" )
+ if ( $mode == 'quote' )
{
$privmsg_message = $privmsg['privmsgs_text'];
$privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid'];
- $privmsg_message = preg_replace("/\:(([a-z0-9]:)?)$privmsg_bbcode_uid/si", "", $privmsg_message);
- $privmsg_message = str_replace(" ", "\n", $privmsg_message);
+ $privmsg_message = preg_replace("/\:(([a-z0-9]:)?)$privmsg_bbcode_uid/si", '', $privmsg_message);
+ $privmsg_message = str_replace(' ', "\n", $privmsg_message);
$privmsg_message = preg_replace('##si', '</textarea>', $privmsg_message);
$msg_date = create_date($board_config['default_dateformat'], $privmsg['privmsgs_date'], $board_config['board_timezone']);
- $privmsg_message = "[quote=\"" . $to_username . "\"]" . $privmsg_message . "[/quote]\n";
+ $privmsg_message = '[quote="' . $to_username . '"]' . $privmsg_message . '[/quote]';
- $mode = "reply";
+ $mode = 'reply';
}
}
}
@@ -1334,15 +1329,14 @@ else if ( $submit || $refresh || $mode != "" )
//
// Has admin prevented user from sending PM's?
//
- if ( !$userdata['user_allow_pm'] && $mode != "edit" )
+ if ( !$userdata['user_allow_pm'] && $mode != 'edit' )
{
$message = $lang['Cannot_send_privmsg'];
message_die(GENERAL_MESSAGE, $message);
}
//
- // Start output, first preview, then errors
- // then post form
+ // Start output, first preview, then errors then post form
//
$page_title = $lang['Send_private_message'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
@@ -1366,13 +1360,13 @@ else if ( $submit || $refresh || $mode != "" )
//
if ( !$html_on )
{
- if ( $user_sig != "" || !$userdata['user_allowhtml'] )
+ if ( $user_sig != '' || !$userdata['user_allowhtml'] )
{
- $user_sig = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $user_sig);
+ $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
}
}
- if ( $attach_sig && $user_sig != "" && $userdata['user_sig_bbcode_uid'] )
+ if ( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] )
{
$user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']);
}
@@ -1382,9 +1376,9 @@ else if ( $submit || $refresh || $mode != "" )
$preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
}
- if ( $attach_sig && $user_sig != "" )
+ if ( $attach_sig && $user_sig != '' )
{
- $preview_message = $preview_message . " _________________ " . $user_sig;
+ $preview_message = $preview_message . ' _________________ ' . $user_sig;
}
if ( count($orig_word) )
@@ -1403,37 +1397,39 @@ else if ( $submit || $refresh || $mode != "" )
}
$preview_message = make_clickable($preview_message);
- $preview_message = str_replace("\n", " ", $preview_message);
+ $preview_message = str_replace("\n", ' ', $preview_message);
- $s_hidden_fields = " ";
- $s_hidden_fields .= " ";
+ $s_hidden_fields = ' ';
+ $s_hidden_fields .= ' ';
if ( isset($privmsg_id) )
{
- $s_hidden_fields .= " ";
+ $s_hidden_fields .= ' ';
}
$template->set_filenames(array(
- "preview" => "privmsgs_preview.tpl")
+ "preview" => 'privmsgs_preview.tpl')
);
+
$template->assign_vars(array(
- "TOPIC_TITLE" => $preview_subject,
- "POST_SUBJECT" => $preview_subject,
- "MESSAGE_TO" => $to_username,
- "MESSAGE_FROM" => $userdata['username'],
- "POST_DATE" => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
- "MESSAGE" => $preview_message,
+ 'TOPIC_TITLE' => $preview_subject,
+ 'POST_SUBJECT' => $preview_subject,
+ 'MESSAGE_TO' => $to_username,
+ 'MESSAGE_FROM' => $userdata['username'],
+ 'POST_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
+ 'MESSAGE' => $preview_message,
- "S_HIDDEN_FIELDS" => $s_hidden_fields,
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields,
- "L_SUBJECT" => $lang['Subject'],
- "L_DATE" => $lang['Date'],
- "L_FROM" => $lang['From'],
- "L_TO" => $lang['To'],
- "L_PREVIEW" => $lang['Preview'],
- "L_POSTED" => $lang['Posted'])
+ 'L_SUBJECT' => $lang['Subject'],
+ 'L_DATE' => $lang['Date'],
+ 'L_FROM' => $lang['From'],
+ 'L_TO' => $lang['To'],
+ 'L_PREVIEW' => $lang['Preview'],
+ 'L_POSTED' => $lang['Posted'])
);
- $template->assign_var_from_handle("POST_PREVIEW_BOX", "preview");
+
+ $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview');
}
//
@@ -1442,52 +1438,34 @@ else if ( $submit || $refresh || $mode != "" )
if ($error)
{
$template->set_filenames(array(
- "reg_header" => "error_body.tpl")
+ 'reg_header' => 'error_body.tpl')
);
$template->assign_vars(array(
- "ERROR_MESSAGE" => $error_msg)
+ 'ERROR_MESSAGE' => $error_msg)
);
- $template->assign_var_from_handle("ERROR_BOX", "reg_header");
+ $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
}
- //
- // End error handling
- //
-
- //
- // Generic posting form ...
- //
//
// Load templates
//
$template->set_filenames(array(
- "body" => "posting_body.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'body' => 'posting_body.tpl')
);
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle("JUMPBOX", "jumpbox");
+ make_jumpbox('viewforum.'.$phpEx);
//
// Enable extensions in posting_body
//
- $template->assign_block_vars("privmsg_extensions", array());
+ $template->assign_block_vars('switch_privmsg', array());
//
// HTML toggle selection
//
- if ($board_config['allow_html'])
+ if ( $board_config['allow_html'] )
{
$html_status = $lang['HTML_is_ON'];
- $template->assign_block_vars("html_checkbox", array());
+ $template->assign_block_vars('switch_html_checkbox', array());
}
else
{
@@ -1497,10 +1475,10 @@ else if ( $submit || $refresh || $mode != "" )
//
// BBCode toggle selection
//
- if ($board_config['allow_bbcode'])
+ if ( $board_config['allow_bbcode'] )
{
$bbcode_status = $lang['BBCode_is_ON'];
- $template->assign_block_vars("bbcode_checkbox", array());
+ $template->assign_block_vars('switch_bbcode_checkbox', array());
}
else
{
@@ -1510,10 +1488,10 @@ else if ( $submit || $refresh || $mode != "" )
//
// Smilies toggle selection
//
- if ($board_config['allow_smilies'])
+ if ( $board_config['allow_smilies'] )
{
$smilies_status = $lang['Smilies_are_ON'];
- $template->assign_block_vars("smilies_checkbox", array());
+ $template->assign_block_vars('switch_smilies_checkbox', array());
}
else
{
@@ -1524,35 +1502,30 @@ else if ( $submit || $refresh || $mode != "" )
// Signature toggle selection - only show if
// the user has a signature
//
- if ( $user_sig != "" )
+ if ( $user_sig != '' )
{
- $template->assign_block_vars("signature_checkbox", array());
+ $template->assign_block_vars('switch_signature_checkbox', array());
}
- if ($mode == 'post')
+ if ( $mode == 'post' )
{
$post_a = $lang['Send_a_new_message'];
}
- else if ($mode == 'reply')
+ else if ( $mode == 'reply' )
{
$post_a = $lang['Send_a_reply'];
- //
- // Switch mode to post ... it's a bit of a cheat really but once the basic
- // info for the reply is determined it really becomes a new post ... so why
- // do it any other way?!
- //
- $mode = "post";
+ $mode = 'post';
}
- else if ($mode == 'edit')
+ else if ( $mode == 'edit' )
{
$post_a = $lang['Edit_message'];
}
- $s_hidden_fields = " ";
- $s_hidden_fields .= " ";
- if ($mode == "edit")
+ $s_hidden_fields = ' ';
+ $s_hidden_fields .= ' ';
+ if ( $mode == 'edit' )
{
- $s_hidden_fields .= " ";
+ $s_hidden_fields .= ' ';
}
//
@@ -1561,96 +1534,95 @@ else if ( $submit || $refresh || $mode != "" )
generate_smilies('inline', PAGE_PRIVMSGS);
$template->assign_vars(array(
- "SUBJECT" => preg_replace($html_entities_match, $html_entities_replace, $privmsg_subject),
- "USERNAME" => preg_replace($html_entities_match, $html_entities_replace, $to_username),
- "MESSAGE" => $privmsg_message,
- "HTML_STATUS" => $html_status,
- "SMILIES_STATUS" => $smilies_status,
- "BBCODE_STATUS" => sprintf($bbcode_status, '', ' '),
- "FORUM_NAME" => $lang['Private_message'],
+ 'SUBJECT' => preg_replace($html_entities_match, $html_entities_replace, $privmsg_subject),
+ 'USERNAME' => preg_replace($html_entities_match, $html_entities_replace, $to_username),
+ 'MESSAGE' => $privmsg_message,
+ 'HTML_STATUS' => $html_status,
+ 'SMILIES_STATUS' => $smilies_status,
+ 'BBCODE_STATUS' => sprintf($bbcode_status, '', ' '),
+ 'FORUM_NAME' => $lang['Private_message'],
- "BOX_NAME" => $l_box_name,
- "INBOX_IMG" => $inbox_img,
- "SENTBOX_IMG" => $sentbox_img,
- "OUTBOX_IMG" => $outbox_img,
- "SAVEBOX_IMG" => $savebox_img,
- "INBOX_LINK" => $inbox_url,
- "SENTBOX_LINK" => $sentbox_url,
- "OUTBOX_LINK" => $outbox_url,
- "SAVEBOX_LINK" => $savebox_url,
+ 'BOX_NAME' => $l_box_name,
+ 'INBOX_IMG' => $inbox_img,
+ 'SENTBOX_IMG' => $sentbox_img,
+ 'OUTBOX_IMG' => $outbox_img,
+ 'SAVEBOX_IMG' => $savebox_img,
+ 'INBOX' => $inbox_url,
+ 'SENTBOX' => $sentbox_url,
+ 'OUTBOX' => $outbox_url,
+ 'SAVEBOX' => $savebox_url,
- "L_SUBJECT" => $lang['Subject'],
- "L_MESSAGE_BODY" => $lang['Message_body'],
- "L_OPTIONS" => $lang['Options'],
- "L_SPELLCHECK" => $lang['Spellcheck'],
- "L_PREVIEW" => $lang['Preview'],
- "L_SUBMIT" => $lang['Submit'],
- "L_CANCEL" => $lang['Cancel'],
- "L_POST_A" => $post_a,
- "L_FIND_USERNAME" => $lang['Find_username'],
- "L_FIND" => $lang['Find'],
- "L_DISABLE_HTML" => $lang['Disable_HTML_pm'],
- "L_DISABLE_BBCODE" => $lang['Disable_BBCode_pm'],
- "L_DISABLE_SMILIES" => $lang['Disable_Smilies_pm'],
- "L_ATTACH_SIGNATURE" => $lang['Attach_signature'],
+ 'L_SUBJECT' => $lang['Subject'],
+ 'L_MESSAGE_BODY' => $lang['Message_body'],
+ 'L_OPTIONS' => $lang['Options'],
+ 'L_SPELLCHECK' => $lang['Spellcheck'],
+ 'L_PREVIEW' => $lang['Preview'],
+ 'L_SUBMIT' => $lang['Submit'],
+ 'L_CANCEL' => $lang['Cancel'],
+ 'L_POST_A' => $post_a,
+ 'L_FIND_USERNAME' => $lang['Find_username'],
+ 'L_FIND' => $lang['Find'],
+ 'L_DISABLE_HTML' => $lang['Disable_HTML_pm'],
+ 'L_DISABLE_BBCODE' => $lang['Disable_BBCode_pm'],
+ 'L_DISABLE_SMILIES' => $lang['Disable_Smilies_pm'],
+ 'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
- "L_BBCODE_B_HELP" => $lang['bbcode_b_help'],
- "L_BBCODE_I_HELP" => $lang['bbcode_i_help'],
- "L_BBCODE_U_HELP" => $lang['bbcode_u_help'],
- "L_BBCODE_Q_HELP" => $lang['bbcode_q_help'],
- "L_BBCODE_C_HELP" => $lang['bbcode_c_help'],
- "L_BBCODE_L_HELP" => $lang['bbcode_l_help'],
- "L_BBCODE_O_HELP" => $lang['bbcode_o_help'],
- "L_BBCODE_P_HELP" => $lang['bbcode_p_help'],
- "L_BBCODE_W_HELP" => $lang['bbcode_w_help'],
- "L_BBCODE_A_HELP" => $lang['bbcode_a_help'],
- "L_BBCODE_S_HELP" => $lang['bbcode_s_help'],
- "L_BBCODE_F_HELP" => $lang['bbcode_f_help'],
- "L_EMPTY_MESSAGE" => $lang['Empty_message'],
+ 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
+ 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
+ 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
+ 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
+ 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
+ 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
+ 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
+ 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
+ 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
+ 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
+ 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
+ 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
+ 'L_EMPTY_MESSAGE' => $lang['Empty_message'],
- "L_FONT_COLOR" => $lang['Font_color'],
- "L_COLOR_DEFAULT" => $lang['color_default'],
- "L_COLOR_DARK_RED" => $lang['color_dark_red'],
- "L_COLOR_RED" => $lang['color_red'],
- "L_COLOR_ORANGE" => $lang['color_orange'],
- "L_COLOR_BROWN" => $lang['color_brown'],
- "L_COLOR_YELLOW" => $lang['color_yellow'],
- "L_COLOR_GREEN" => $lang['color_green'],
- "L_COLOR_OLIVE" => $lang['color_olive'],
- "L_COLOR_CYAN" => $lang['color_cyan'],
- "L_COLOR_BLUE" => $lang['color_blue'],
- "L_COLOR_DARK_BLUE" => $lang['color_dark_blue'],
- "L_COLOR_INDIGO" => $lang['color_indigo'],
- "L_COLOR_VIOLET" => $lang['color_violet'],
- "L_COLOR_WHITE" => $lang['color_white'],
- "L_COLOR_BLACK" => $lang['color_black'],
+ 'L_FONT_COLOR' => $lang['Font_color'],
+ 'L_COLOR_DEFAULT' => $lang['color_default'],
+ 'L_COLOR_DARK_RED' => $lang['color_dark_red'],
+ 'L_COLOR_RED' => $lang['color_red'],
+ 'L_COLOR_ORANGE' => $lang['color_orange'],
+ 'L_COLOR_BROWN' => $lang['color_brown'],
+ 'L_COLOR_YELLOW' => $lang['color_yellow'],
+ 'L_COLOR_GREEN' => $lang['color_green'],
+ 'L_COLOR_OLIVE' => $lang['color_olive'],
+ 'L_COLOR_CYAN' => $lang['color_cyan'],
+ 'L_COLOR_BLUE' => $lang['color_blue'],
+ 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
+ 'L_COLOR_INDIGO' => $lang['color_indigo'],
+ 'L_COLOR_VIOLET' => $lang['color_violet'],
+ 'L_COLOR_WHITE' => $lang['color_white'],
+ 'L_COLOR_BLACK' => $lang['color_black'],
- "L_FONT_SIZE" => $lang['Font_size'],
- "L_FONT_TINY" => $lang['font_tiny'],
- "L_FONT_SMALL" => $lang['font_small'],
- "L_FONT_NORMAL" => $lang['font_normal'],
- "L_FONT_LARGE" => $lang['font_large'],
- "L_FONT_HUGE" => $lang['font_huge'],
+ 'L_FONT_SIZE' => $lang['Font_size'],
+ 'L_FONT_TINY' => $lang['font_tiny'],
+ 'L_FONT_SMALL' => $lang['font_small'],
+ 'L_FONT_NORMAL' => $lang['font_normal'],
+ 'L_FONT_LARGE' => $lang['font_large'],
+ 'L_FONT_HUGE' => $lang['font_huge'],
- "L_BBCODE_CLOSE_TAGS" => $lang['Close_Tags'],
- "L_STYLES_TIP" => $lang['Styles_tip'],
+ 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
+ 'L_STYLES_TIP' => $lang['Styles_tip'],
- "S_HTML_CHECKED" => (!$html_on) ? "checked=\"checked\"" : "",
- "S_BBCODE_CHECKED" => (!$bbcode_on) ? "checked=\"checked\"" : "",
- "S_SMILIES_CHECKED" => (!$smilies_on) ? "checked=\"checked\"" : "",
- "S_SIGNATURE_CHECKED" => ($attach_sig) ? "checked=\"checked\"" : "",
- "S_NAMES_SELECT" => $user_names_select,
- "S_HIDDEN_FORM_FIELDS" => $s_hidden_fields,
- "S_POST_ACTION" => append_sid("privmsg.$phpEx"),
+ 'S_HTML_CHECKED' => ( !$html_on ) ? ' checked="checked"' : '',
+ 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? ' checked="checked"' : '',
+ 'S_SMILIES_CHECKED' => ( !$smilies_on ) ? ' checked="checked"' : '',
+ 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? ' checked="checked"' : '',
+ 'S_NAMES_SELECT' => $user_names_select,
+ 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields,
+ 'S_POST_ACTION' => append_sid("privmsg.$phpEx"),
- "U_SEARCH_USER" => append_sid("search.$phpEx?mode=searchuser"),
- "U_VIEW_FORUM" => append_sid("privmsg.$phpEx"))
+ 'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser"),
+ 'U_VIEW_FORUM' => append_sid("privmsg.$phpEx"))
);
- $template->pparse("body");
+ $template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-
}
//
@@ -1658,7 +1630,7 @@ else if ( $submit || $refresh || $mode != "" )
//
if ( !$userdata['session_logged_in'] )
{
- $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
}
@@ -1668,18 +1640,18 @@ if ( !$userdata['session_logged_in'] )
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg + user_new_privmsg, user_new_privmsg = 0, user_last_privmsg = " . $userdata['session_start'] . "
WHERE user_id = " . $userdata['user_id'];
-if ( !$status = $db->sql_query($sql) )
+if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not update private message new/read status for user.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . PRIVMSGS_TABLE . "
SET privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "
WHERE privmsgs_type = " . PRIVMSGS_NEW_MAIL . "
AND privmsgs_to_userid = " . $userdata['user_id'];
-if ( !$status = $db->sql_query($sql) )
+if ( !$db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not update private message new/read status (2) for user.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not update private message new/read status (2) for user', '', __LINE__, __FILE__, $sql);
}
//
@@ -1698,25 +1670,14 @@ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// Load templates
//
$template->set_filenames(array(
- "body" => "privmsgs_body.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'body' => 'privmsgs_body.tpl')
);
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle("JUMPBOX", "jumpbox");
+make_jumpbox('viewforum.'.$phpEx);
//
// New message
//
-$post_new_mesg_url = " ";
+$post_new_mesg_url = ' ';
//
// General SQL to obtain messages
@@ -1725,8 +1686,7 @@ $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 ";
-
-switch($folder)
+switch( $folder )
{
case 'inbox':
$sql_tot .= "WHERE privmsgs_to_userid = " . $userdata['user_id'] . "
@@ -1776,7 +1736,8 @@ switch($folder)
break;
default:
- message_die(GENERAL_ERROR, "Could not query private message information. No folder specified.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_MESSAGE, $lang['No_such_folder']);
+ break;
}
//
@@ -1784,20 +1745,20 @@ switch($folder)
//
if ( $submit_msgdays && ( !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'];
+ $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']))
+ if ( !empty($HTTP_POST_VARS['msgdays']) )
{
$start = 0;
}
}
else
{
- $limit_msg_time = "";
+ $limit_msg_time = '';
$post_days = 0;
}
@@ -1808,39 +1769,19 @@ $sql_tot .= $limit_msg_time_total;
//
// Get messages
//
-if ( !$pm_tot_status = $db->sql_query($sql_tot) )
+if ( !($result = $db->sql_query($sql_tot)) )
{
- message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot);
-}
-else
-{
- if ( $db->sql_numrows($pm_tot_status) )
- {
- $row = $db->sql_fetchrow($pm_tot_status);
- $pm_total = $row['total'];
- }
+ message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql_tot);
}
-if ( !$pm_all_status = $db->sql_query($sql_all_tot) )
+$pm_total = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0;
+
+if ( !($result = $db->sql_query($sql_all_tot)) )
{
- message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot);
-}
-else
-{
- if ( $db->sql_numrows($pm_all_status) )
- {
- $row = $db->sql_fetchrow($pm_all_status);
- $pm_all_total = $row['total'];
- }
+ message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql_tot);
}
-if ( !$pm_status = $db->sql_query($sql) )
-{
- message_die(GENERAL_ERROR, "Could not query private messages.", "", __LINE__, __FILE__, $sql);
-}
-$pm_count = $db->sql_numrows($pm_status);
-
-$pm_list = $db->sql_fetchrowset($pm_status);
+$pm_all_total = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0;
//
// Build select box
@@ -1848,49 +1789,49 @@ $pm_list = $db->sql_fetchrowset($pm_status);
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
-$select_msg_days = "";
+$select_msg_days = '';
for($i = 0; $i < count($previous_days); $i++)
{
- $selected = ($msg_days == $previous_days[$i]) ? " selected=\"selected\"" : "";
- $select_msg_days .= "" . $previous_days_text[$i] . " ";
+ $selected = ( $msg_days == $previous_days[$i] ) ? ' selected="selected"' : '';
+ $select_msg_days .= '' . $previous_days_text[$i] . ' ';
}
//
// Define correct icons
//
-if ( $folder == "inbox" )
+if ( $folder == 'inbox' )
{
- $post_pm_img = " ";
- $reply_pm_img = " ";
- $quote_pm_img = " ";
- $edit_pm_img = "";
+ $post_pm_img = ' ';
+ $reply_pm_img = ' ';
+ $quote_pm_img = ' ';
+ $edit_pm_img = '';
$l_box_name = $lang['Inbox'];
}
-else if ( $folder == "outbox" )
+else if ( $folder == 'outbox' )
{
- $post_pm_img = " ";
- $reply_pm_img = "";
- $quote_pm_img = "";
- $edit_pm_img = " ";
+ $post_pm_img = ' ';
+ $reply_pm_img = '';
+ $quote_pm_img = '';
+ $edit_pm_img = ' ';
$l_box_name = $lang['Outbox'];
}
-else if ( $folder == "savebox" )
+else if ( $folder == 'savebox' )
{
- $post_pm_img = " ";
- $reply_pm_img = " ";
- $quote_pm_img = " ";
- $edit_pm_img = "";
+ $post_pm_img = ' ';
+ $reply_pm_img = ' ';
+ $quote_pm_img = ' ';
+ $edit_pm_img = '';
$l_box_name = $lang['Savedbox'];
}
-else if ( $folder == "sentbox" )
+else if ( $folder == 'sentbox' )
{
- $post_pm_img = " ";
- $reply_pm_img = "";
- $quote_pm_img = " ";
- $edit_pm_img = "";
+ $post_pm_img = ' ';
+ $reply_pm_img = '';
+ $quote_pm_img = ' ';
+ $edit_pm_img = '';
$l_box_name = $lang['Sentbox'];
}
@@ -1898,7 +1839,7 @@ else if ( $folder == "sentbox" )
//
// Output data for inbox status
//
-if ( $folder != "outbox" )
+if ( $folder != 'outbox' )
{
if ( $board_config['max_' . $folder . '_privmsgs'] > 0 )
{
@@ -1925,7 +1866,7 @@ if ( $folder != "outbox" )
$inbox_limit_remain = 0;
}
- $template->assign_block_vars("box_size_notice", array());
+ $template->assign_block_vars('switch_box_size_notice', array());
switch( $folder )
{
@@ -1939,76 +1880,81 @@ if ( $folder != "outbox" )
$l_box_size_status = sprintf($lang['Savebox_size'], $inbox_limit_pct);
break;
default:
- $l_box_size_status = "";
+ $l_box_size_status = '';
break;
}
-
}
//
// Dump vars to template
//
$template->assign_vars(array(
- "BOX_NAME" => $l_box_name,
- "INBOX_IMG" => $inbox_img,
- "SENTBOX_IMG" => $sentbox_img,
- "OUTBOX_IMG" => $outbox_img,
- "SAVEBOX_IMG" => $savebox_img,
- "INBOX_LINK" => $inbox_url,
- "SENTBOX_LINK" => $sentbox_url,
- "OUTBOX_LINK" => $outbox_url,
- "SAVEBOX_LINK" => $savebox_url,
+ 'BOX_NAME' => $l_box_name,
+ 'INBOX_IMG' => $inbox_img,
+ 'SENTBOX_IMG' => $sentbox_img,
+ 'OUTBOX_IMG' => $outbox_img,
+ 'SAVEBOX_IMG' => $savebox_img,
+ 'INBOX' => $inbox_url,
+ 'SENTBOX' => $sentbox_url,
+ 'OUTBOX' => $outbox_url,
+ 'SAVEBOX' => $savebox_url,
- "POST_PM_IMG" => $post_pm_img,
+ 'POST_PM_IMG' => $post_pm_img,
- "INBOX_LIMIT_IMG_WIDTH" => $inbox_limit_img_length,
- "INBOX_LIMIT_PERCENT" => $inbox_limit_pct,
+ 'INBOX_LIMIT_IMG_WIDTH' => $inbox_limit_img_length,
+ 'INBOX_LIMIT_PERCENT' => $inbox_limit_pct,
- "BOX_SIZE_STATUS" => $l_box_size_status,
+ 'BOX_SIZE_STATUS' => $l_box_size_status,
- "L_INBOX" => $lang['Inbox'],
- "L_OUTBOX" => $lang['Outbox'],
- "L_SENTBOX" => $lang['Sent'],
- "L_SAVEBOX" => $lang['Saved'],
- "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'],
- "L_MARK_ALL" => $lang['Mark_all'],
- "L_UNMARK_ALL" => $lang['Unmark_all'],
- "L_DELETE_MARKED" => $lang['Delete_marked'],
- "L_DELETE_ALL" => $lang['Delete_all'],
- "L_SAVE_MARKED" => $lang['Save_marked'],
+ 'L_INBOX' => $lang['Inbox'],
+ 'L_OUTBOX' => $lang['Outbox'],
+ 'L_SENTBOX' => $lang['Sent'],
+ 'L_SAVEBOX' => $lang['Saved'],
+ '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'],
+ 'L_MARK_ALL' => $lang['Mark_all'],
+ 'L_UNMARK_ALL' => $lang['Unmark_all'],
+ 'L_DELETE_MARKED' => $lang['Delete_marked'],
+ 'L_DELETE_ALL' => $lang['Delete_all'],
+ 'L_SAVE_MARKED' => $lang['Save_marked'],
- "S_PRIVMSGS_ACTION" => append_sid("privmsg.$phpEx?folder=$folder"),
- "S_HIDDEN_FIELDS" => "",
- "S_POST_NEW_MSG" => $post_new_mesg_url,
- "S_MSG_DAYS_OPTIONS" => $select_msg_days,
+ 'S_PRIVMSGS_ACTION' => append_sid("privmsg.$phpEx?folder=$folder"),
+ 'S_HIDDEN_FIELDS' => '',
+ 'S_POST_NEW_MSG' => $post_new_mesg_url,
+ 'S_SELECT_MSG_DAYS' => $select_msg_days,
- "U_POST_NEW_TOPIC" => $post_new_topic_url)
+ 'U_POST_NEW_TOPIC' => $post_new_topic_url)
);
-
//
// Okay, let's build the correct folder
//
-if ( $pm_count )
+if ( !($result = $db->sql_query($sql)) )
{
- for($i = 0; $i < $pm_count; $i++)
+ message_die(GENERAL_ERROR, 'Could not query private messages', '', __LINE__, __FILE__, $sql);
+}
+
+if ( $row = $db->sql_fetchrow($result) )
+{
+ do
{
- $privmsg_id = $pm_list[$i]['privmsgs_id'];
+ $privmsg_id = $row['privmsgs_id'];
- $flag = $pm_list[$i]['privmsgs_type'];
- $icon_flag = ($flag == PRIVMSGS_NEW_MAIL || $flag == PRIVMSGS_UNREAD_MAIL ) ? " " : " ";
+ $flag = $row['privmsgs_type'];
- $msg_userid = $pm_list[$i]['user_id'];
- $msg_username = $pm_list[$i]['username'];
+ $icon_flag = ( $flag == PRIVMSGS_NEW_MAIL || $flag == PRIVMSGS_UNREAD_MAIL ) ? $images['pm_unreadmsg'] : $images['pm_readmsg'];
+ $icon_flag_alt = ( $flag == PRIVMSGS_NEW_MAIL || $flag == PRIVMSGS_UNREAD_MAIL ) ? $lang['Unread_message'] : $lang['Read_message'];
+
+ $msg_userid = $row['user_id'];
+ $msg_username = $row['username'];
$u_from_user_profile = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$msg_userid");
- $msg_subject = $pm_list[$i]['privmsgs_subject'];
+ $msg_subject = $row['privmsgs_subject'];
if ( count($orig_word) )
{
@@ -2017,52 +1963,55 @@ if ( $pm_count )
$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['board_timezone']);
+ $msg_date = create_date($board_config['default_dateformat'], $row['privmsgs_date'], $board_config['board_timezone']);
- if ( $flag == PRIVMSGS_NEW_MAIL && $folder == "inbox" )
+ if ( $flag == PRIVMSGS_NEW_MAIL && $folder == 'inbox' )
{
- $msg_subject = "" . $msg_subject . " ";
- $msg_date = "" . $msg_date . " ";
- $msg_username = "" . $msg_username . " ";
+ $msg_subject = '' . $msg_subject . ' ';
+ $msg_date = '' . $msg_date . ' ';
+ $msg_username = '' . $msg_username . ' ';
}
- $row_color = (!($i % 2)) ? $theme['td_color1'] : $theme['td_color2'];
- $row_class = (!($i % 2)) ? $theme['td_class1'] : $theme['td_class2'];
+ $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
+ $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
- $template->assign_block_vars("listrow", array(
- "ROW_COLOR" => "#". $row_color,
- "ROW_CLASS" => $row_class,
- "ICON_FLAG_IMG" => $icon_flag,
- "FROM" => $msg_username,
- "SUBJECT" => $msg_subject,
- "DATE" => $msg_date,
+ $template->assign_block_vars('listrow', array(
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'FROM' => $msg_username,
+ 'SUBJECT' => $msg_subject,
+ 'DATE' => $msg_date,
+ 'PRIVMSG_FOLDER_IMG' => $icon_flag,
- "S_MARK_ID" => $privmsg_id,
+ 'L_PRIVMSG_FOLDER_ALT' => $icon_flag_alt,
- "U_READ" => $u_subject,
- "U_FROM_USER_PROFILE" => $u_from_user_profile)
+ 'S_MARK_ID' => $privmsg_id,
+
+ 'U_READ' => $u_subject,
+ 'U_FROM_USER_PROFILE' => $u_from_user_profile)
);
- } // for ...
+ }
+ while( $row = $db->sql_fetchrow($result) );
$template->assign_vars(array(
- "PAGINATION" => generate_pagination("privmsg.$phpEx?folder=$folder", $pm_total, $board_config['topics_per_page'], $start),
- "PAGE_NUMBER" => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $pm_total / $board_config['topics_per_page'] )),
+ 'PAGINATION' => generate_pagination("privmsg.$phpEx?folder=$folder", $pm_total, $board_config['topics_per_page'], $start),
+ 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $pm_total / $board_config['topics_per_page'] )),
- "L_GOTO_PAGE" => $lang['Goto_page'])
+ 'L_GOTO_PAGE' => $lang['Goto_page'])
);
}
else
{
$template->assign_vars(array(
- "L_NO_MESSAGES" => $lang['No_messages_folder'])
+ 'L_NO_MESSAGES' => $lang['No_messages_folder'])
);
- $template->assign_block_vars("nomessages", array() );
+ $template->assign_block_vars("switch_no_messages", array() );
}
-$template->pparse("body");
+$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/search.php b/phpBB/search.php
index f5b3ef26ba..ae408dfd61 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -21,7 +21,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
@@ -39,7 +39,7 @@ init_userprefs($userdata);
//
// Define initial vars
//
-if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
+if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
@@ -48,7 +48,7 @@ else
$mode = '';
}
-if( isset($HTTP_POST_VARS['search_keywords']) || isset($HTTP_GET_VARS['search_keywords']) )
+if ( isset($HTTP_POST_VARS['search_keywords']) || isset($HTTP_GET_VARS['search_keywords']) )
{
$search_keywords = ( isset($HTTP_POST_VARS['search_keywords']) ) ? $HTTP_POST_VARS['search_keywords'] : $HTTP_GET_VARS['search_keywords'];
}
@@ -57,7 +57,7 @@ else
$search_keywords = '';
}
-if( isset($HTTP_POST_VARS['search_author']) || isset($HTTP_GET_VARS['search_author']))
+if ( isset($HTTP_POST_VARS['search_author']) || isset($HTTP_GET_VARS['search_author']))
{
$search_author = ( isset($HTTP_POST_VARS['search_author']) ) ? $HTTP_POST_VARS['search_author'] : $HTTP_GET_VARS['search_author'];
}
@@ -66,11 +66,11 @@ else
$search_author = '';
}
-$search_id = ( isset($HTTP_GET_VARS['search_id']) ) ? $HTTP_GET_VARS['search_id'] : "";
+$search_id = ( isset($HTTP_GET_VARS['search_id']) ) ? intval($HTTP_GET_VARS['search_id']) : '';
$show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'posts';
-if( isset($HTTP_POST_VARS['search_terms']) )
+if ( isset($HTTP_POST_VARS['search_terms']) )
{
$search_terms = ( $HTTP_POST_VARS['search_terms'] == 'all' ) ? 1 : 0;
}
@@ -79,7 +79,7 @@ else
$search_terms = 0;
}
-if( isset($HTTP_POST_VARS['search_fields']) )
+if ( isset($HTTP_POST_VARS['search_fields']) )
{
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : 0;
}
@@ -95,7 +95,7 @@ $search_forum = ( isset($HTTP_POST_VARS['search_forum']) ) ? intval($HTTP_POST_V
$sort_by = ( isset($HTTP_POST_VARS['sort_by']) ) ? intval($HTTP_POST_VARS['sort_by']) : 0;
-if( isset($HTTP_POST_VARS['sort_dir']) )
+if ( isset($HTTP_POST_VARS['sort_dir']) )
{
$sort_dir = ( $HTTP_POST_VARS['sort_dir'] == 'DESC' ) ? 'DESC' : 'ASC';
}
@@ -104,9 +104,9 @@ else
$sort_dir = 'DESC';
}
-if(!empty($HTTP_POST_VARS['search_time']) )
+if ( !empty($HTTP_POST_VARS['search_time']) || !empty($HTTP_GET_VARS['search_time']))
{
- $search_time = time() - ( intval($HTTP_POST_VARS['search_time']) * 86400 );
+ $search_time = time() - ( ( ( !empty($HTTP_POST_VARS['search_time']) ) ? intval($HTTP_POST_VARS['search_time']) : intval($HTTP_GET_VARS['search_time']) ) * 86400 );
}
else
{
@@ -124,27 +124,23 @@ $sort_by_sql = array('p.post_time', 'pt.post_subject', 't.topic_title', 'u.usern
//
// Begin core code
//
-if( $mode == 'searchuser' )
+if ( $mode == 'searchuser' )
{
//
- // This handles the simple windowed user search
- // functions called from various other scripts. If a
- // script allows an 'inline' user search then this is
- // handled by the script itself, this is only for the
- // windowed version
+ // This handles the simple windowed user search functions called from various other scripts
//
- if( isset($HTTP_POST_VARS['search_author']) )
+ if ( isset($HTTP_POST_VARS['search_username']) )
{
- username_search($HTTP_POST_VARS['search_author'], false);
+ username_search($HTTP_POST_VARS['search_username']);
}
else
{
- username_search('', false);
+ username_search('');
}
exit;
}
-else if( $search_keywords != '' || $search_author != '' || $search_id )
+else if ( $search_keywords != '' || $search_author != '' || $search_id )
{
$store_vars = array('search_results', 'total_match_count', 'split_search', 'sort_by', 'sort_dir', 'show_results', 'return_chars');
@@ -271,7 +267,7 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
break;
default:
- if( !empty($search_terms) )
+ if ( !empty($search_terms) )
{
$current_match_type = 'and';
}
@@ -600,12 +596,12 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
FROM " . SEARCH_TABLE . "
WHERE search_id = $search_id
AND session_id = '". $userdata['session_id'] . "'";
- if( !($result = $db->sql_query($sql)) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql);
}
- if( $row = $db->sql_fetchrow($result) )
+ if ( $row = $db->sql_fetchrow($result) )
{
$search_data = unserialize($row['search_array']);
for($i = 0; $i < count($store_vars); $i++)
@@ -632,13 +628,14 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
}
else
{
- $sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
- FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . USERS_TABLE . " u2, " . POSTS_TABLE . " p
+ $sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
+ FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.topic_id IN ($search_results)
+ AND t.topic_poster = u.user_id
AND f.forum_id = t.forum_id
- AND u.user_id = t.topic_poster
- AND p.post_id = t.topic_last_post_id
- AND p.poster_id = u2.user_id";
+ AND p.post_id = t.topic_first_post_id
+ AND p2.post_id = t.topic_last_post_id
+ AND u2.user_id = p2.poster_id";
}
$per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page'];
@@ -674,28 +671,16 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
if ( $show_results == 'posts' )
{
$template->set_filenames(array(
- 'body' => 'search_results_posts.tpl',
- 'jumpbox' => 'jumpbox.tpl')
+ 'body' => 'search_results_posts.tpl')
);
}
else
{
$template->set_filenames(array(
- 'body' => 'search_results_topics.tpl',
- 'jumpbox' => 'jumpbox.tpl')
+ 'body' => 'search_results_topics.tpl')
);
}
-
- $jumpbox = make_jumpbox();
- $template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
- );
- $template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+ make_jumpbox('viewforum.'.$phpEx);
$l_search_matches = ( $total_match_count == 1 ) ? sprintf($lang['Found_search_match'], $total_match_count) : sprintf($lang['Found_search_matches'], $total_match_count);
@@ -704,29 +689,24 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
'L_TOPIC' => $lang['Topic'])
);
- $highlight_active = "";
- $search_string = array();
- $replace_string = array();
+ $highlight_active = '';
+ $highlight_match = array();
for($j = 0; $j < count($split_search); $j++ )
{
$split_word = $split_search[$j];
- if( $split_word != 'and' && $split_word != 'or' && $split_word != 'not' )
+ if ( $split_word != 'and' && $split_word != 'or' && $split_word != 'not' )
{
+ $highlight_match[] = '#\b(' . str_replace("*", "([\w]+)?", $split_word) . ')\b#is';
$highlight_active .= " " . $split_word;
- $search_string[] = '#\b(' . str_replace("\*", ".*?", phpbb_preg_quote($split_word, '#')) . ')(?!.*?<\/a>)(?!.*?\[/url\])(?!.*?<\/span>)\b#i';
- $replace_string[] = '\1 ';
-
for ($k = 0; $k < count($synonym_array); $k++)
{
list($replace_synonym, $match_synonym) = split(' ', trim(strtolower($synonym_array[$k])));
- if( $replace_synonym == $split_word )
+ if ( $replace_synonym == $split_word )
{
- $search_string[] = '#\b(' . str_replace('\*', '.*?', phpbb_preg_quote($replace_synonym, '#')) . ')(?!.*?<\/a>)(?!.*?\[/url\])(?!.*?<\/span>)\b#i';
- $replace_string[] = '\1 ';
-
+ $highlight_match[] = '#\b(' . str_replace("*", "([\w]+)?", $replace_synonym) . ')\b#is';
$highlight_active .= ' ' . $match_synonym;
}
}
@@ -740,9 +720,9 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
for($i = 0; $i < count($searchset); $i++)
{
- $forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $searchset[$i]['forum_id']);
- $topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $searchset[$i]['topic_id'] . "&highlight=$highlight_active");
- $post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $searchset[$i]['post_id'] . "&highlight=$highlight_active#" . $searchset[$i]['post_id']);
+ $forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $searchset[$i]['forum_id']);
+ $topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $searchset[$i]['topic_id'] . "&highlight=$highlight_active");
+ $post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active#" . $searchset[$i]['post_id']);
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
@@ -752,9 +732,9 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
$forum_id = $searchset[$i]['forum_id'];
$topic_id = $searchset[$i]['topic_id'];
- if( $show_results == 'posts' )
+ if ( $show_results == 'posts' )
{
- if( isset($return_chars) )
+ if ( isset($return_chars) )
{
$bbcode_uid = $searchset[$i]['bbcode_uid'];
@@ -762,43 +742,112 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
- if( $return_chars != -1 )
+ if ( $return_chars != -1 )
{
$message = strip_tags($message);
$message = preg_replace("/\[.*?:$bbcode_uid:?.*?\]/si", '', $message);
$message = preg_replace('/\[url\]|\[\/url\]/si', '', $message);
$message = ( strlen($message) > $return_chars ) ? substr($message, 0, $return_chars) . ' ...' : $message;
- if( count($search_string) )
+ if ( count($search_string) )
{
$message = preg_replace($search_string, $replace_string, $message);
}
}
else
{
- if( !$board_config['allow_html'] )
+ if ( !$board_config['allow_html'] )
{
- if( $postrow[$i]['enable_html'] )
+ if ( $postrow[$i]['enable_html'] )
{
$message = preg_replace('#(<)([\/]?.*?)(>)#is', '<\\2>', $message);
}
}
- if( $bbcode_uid != '' )
+ if ( $bbcode_uid != '' )
{
$message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
$message = make_clickable($message);
- if( count($search_string) )
+ if ( $highlight_active )
{
- $message = preg_replace($search_string, $replace_string, $message);
- }
+ if ( preg_match('/<.*>/', $message) )
+ {
+ $message = preg_replace($highlight_match, '\1', $message);
+ $end_html = 0;
+ $start_html = 1;
+ $temp_message = '';
+ $message = ' ' . $message . ' ';
+
+ while( $start_html = strpos($message, '<', $start_html) )
+ {
+ $grab_length = $start_html - $end_html - 1;
+ $temp_message .= substr($message, $end_html + 1, $grab_length);
+
+ if ( $end_html = strpos($message, '>', $start_html) )
+ {
+ $length = $end_html - $start_html + 1;
+ $hold_string = substr($message, $start_html, $length);
+
+ if ( strrpos(' ' . $hold_string, '<') != 1 )
+ {
+ $end_html = $start_html + 1;
+ $end_counter = 1;
+
+ while ( $end_counter && $end_html < strlen($message) )
+ {
+ if ( substr($message, $end_html, 1) == '>' )
+ {
+ $end_counter--;
+ }
+ else if ( substr($message, $end_html, 1) == '<' )
+ {
+ $end_counter++;
+ }
+
+ $end_html++;
+ }
+
+ $length = $end_html - $start_html + 1;
+ $hold_string = substr($message, $start_html, $length);
+ $hold_string = str_replace('', '', $hold_string);
+ $hold_string = str_replace('', '', $hold_string);
+ }
+ else if ( $hold_string == '' )
+ {
+ $hold_string = str_replace('', '', $hold_string);
+ }
+ else if ( $hold_string == '' )
+ {
+ $hold_string = str_replace('', ' ', $hold_string);
+ }
+
+ $temp_message .= $hold_string;
+
+ $start_html += $length;
+ }
+ else
+ {
+ $start_html = strlen($message);
+ }
+ }
+
+ $grab_length = strlen($message) - $end_html - 1;
+ $temp_message .= substr($message, $end_html + 1, $grab_length);
+
+ $message = trim($temp_message);
+ }
+ else
+ {
+ $message = preg_replace($highlight_match, '\1 ', $message);
+ }
+ }
}
- if( count($orig_word) )
+ if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
$post_subject = ( $searchset[$i]['post_subject'] != "" ) ? preg_replace($orig_word, $replacement_word, $searchset[$i]['post_subject']) : $topic_title;
@@ -810,7 +859,7 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
$post_subject = ( $searchset[$i]['post_subject'] != '' ) ? $searchset[$i]['post_subject'] : $topic_title;
}
- if($board_config['allow_smilies'] && $searchset[$i]['enable_smilies'])
+ if ($board_config['allow_smilies'] && $searchset[$i]['enable_smilies'])
{
$message = smilies_pass($message);
}
@@ -823,29 +872,32 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
$poster .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != "" ) ? $searchset[$i]['post_username'] : $lang['Guest'] );
$poster .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? '' : '';
- if( $userdata['session_logged_in'] && $searchset[$i]['post_time'] > $userdata['user_lastvisit'] )
+ if ( $userdata['session_logged_in'] && $searchset[$i]['post_time'] > $userdata['user_lastvisit'] )
{
- if( !empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id]) )
+ if ( !empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id]) )
{
$topic_last_read = ( $tracking_topics[$topic_id] > $tracking_forums[$forum_id] ) ? $tracking_topics[$topic_id] : $tracking_forums[$forum_id];
}
- else if( !empty($tracking_topics[$topic_id]) || !empty($tracking_forums[$forum_id]) )
+ else if ( !empty($tracking_topics[$topic_id]) || !empty($tracking_forums[$forum_id]) )
{
$topic_last_read = ( !empty($tracking_topics[$topic_id]) ) ? $tracking_topics[$topic_id] : $tracking_forums[$forum_id];
}
- if( $searchset[$i]['post_time'] > $topic_last_read )
+ if ( $searchset[$i]['post_time'] > $topic_last_read )
{
- $mini_post_img = ' ';
+ $mini_post_img = $images['icon_minipost_new'];
+ $mini_post_alt = $lang['New_post'];
}
else
{
- $mini_post_img = ' ';
+ $mini_post_img = $images['icon_minipost'];
+ $mini_post_alt = $lang['Post'];
}
}
else
{
- $mini_post_img = ' ';
+ $mini_post_img = $images['icon_minipost'];
+ $mini_post_alt = $lang['Post'];
}
$template->assign_block_vars("searchresults", array(
@@ -857,9 +909,10 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
'TOPIC_REPLIES' => $searchset[$i]['topic_replies'],
'TOPIC_VIEWS' => $searchset[$i]['topic_views'],
'MESSAGE' => $message,
-
'MINI_POST_IMG' => $mini_post_img,
+ 'L_MINI_POST_ALT' => $mini_post_alt,
+
'U_POST' => $post_url,
'U_TOPIC' => $topic_url,
'U_FORUM' => $forum_url)
@@ -869,27 +922,27 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
{
$message = '';
- if( count($orig_word) )
+ if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $searchset[$i]['topic_title']);
}
$topic_type = $searchset[$i]['topic_type'];
- if($topic_type == POST_ANNOUNCE)
+ if ($topic_type == POST_ANNOUNCE)
{
$topic_type = $lang['Topic_Announcement'] . ' ';
}
- else if($topic_type == POST_STICKY)
+ else if ($topic_type == POST_STICKY)
{
$topic_type = $lang['Topic_Sticky'] . ' ';
}
else
{
- $topic_type = "";
+ $topic_type = '';
}
- if( $searchset[$i]['topic_vote'] )
+ if ( $searchset[$i]['topic_vote'] )
{
$topic_type .= $lang['Topic_Poll'] . ' ';
}
@@ -897,7 +950,7 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
$views = $searchset[$i]['topic_views'];
$replies = $searchset[$i]['topic_replies'];
- if( ( $replies + 1 ) > $board_config['posts_per_page'] )
+ if ( ( $replies + 1 ) > $board_config['posts_per_page'] )
{
$total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
$goto_page = ' [ ' . $lang['Goto_page'] . ': ';
@@ -906,7 +959,7 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
{
$goto_page .= '' . $times . ' ';
- if( $times == 1 && $total_pages > 4 )
+ if ( $times == 1 && $total_pages > 4 )
{
$goto_page .= ' ... ';
$times = $total_pages - 3;
@@ -925,7 +978,7 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
$goto_page = '';
}
- if( $searchset[$i]['topic_status'] == TOPIC_MOVED )
+ if ( $searchset[$i]['topic_status'] == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . ' ';
$topic_id = $searchset[$i]['topic_moved_id'];
@@ -935,24 +988,24 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
}
else
{
- if( $searchset[$i]['topic_status'] == TOPIC_LOCKED )
+ if ( $searchset[$i]['topic_status'] == TOPIC_LOCKED )
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
- else if( $searchset[$i]['topic_type'] == POST_ANNOUNCE )
+ else if ( $searchset[$i]['topic_type'] == POST_ANNOUNCE )
{
$folder = $images['folder_announce'];
$folder_new = $images['folder_announce_new'];
}
- else if( $searchset[$i]['topic_type'] == POST_STICKY )
+ else if ( $searchset[$i]['topic_type'] == POST_STICKY )
{
$folder = $images['folder_sticky'];
$folder_new = $images['folder_sticky_new'];
}
else
{
- if( $replies >= $board_config['hot_threshold'] )
+ if ( $replies >= $board_config['hot_threshold'] )
{
$folder = $images['folder_hot'];
$folder_new = $images['folder_hot_new'];
@@ -964,42 +1017,43 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
}
}
- if( $userdata['session_logged_in'] )
+ if ( $userdata['session_logged_in'] )
{
- if( $searchset[$i]['post_time'] > $userdata['user_lastvisit'] )
+ if ( $searchset[$i]['post_time'] > $userdata['user_lastvisit'] )
{
- if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
+ if ( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
$unread_topics = true;
- if( !empty($tracking_topics[$topic_id]) )
+ if ( !empty($tracking_topics[$topic_id]) )
{
- if( $tracking_topics[$topic_id] > $searchset[$i]['post_time'] )
+ if ( $tracking_topics[$topic_id] > $searchset[$i]['post_time'] )
{
$unread_topics = false;
}
}
- if( !empty($tracking_forums[$forum_id]) )
+ if ( !empty($tracking_forums[$forum_id]) )
{
- if( $tracking_forums[$forum_id] > $searchset[$i]['post_time'] )
+ if ( $tracking_forums[$forum_id] > $searchset[$i]['post_time'] )
{
$unread_topics = false;
}
}
- if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
+ if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
- if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $searchset[$i]['post_time'] )
+ if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $searchset[$i]['post_time'] )
{
$unread_topics = false;
}
}
- if( $unread_topics )
+ if ( $unread_topics )
{
- $folder_image = ' ';
+ $folder_image = $folder_new;
+ $folder_alt = $lang['New_posts'];
$newest_post_img = ' ';
}
@@ -1007,50 +1061,54 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
{
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
- $folder_image = " ";
+ $folder_image = $folder;
+ $folder_alt = $folder_alt;
$newest_post_img = '';
}
}
- else if( $searchset[$i]['post_time'] > $userdata['user_lastvisit'] )
+ else if ( $searchset[$i]['post_time'] > $userdata['user_lastvisit'] )
{
- $folder_image = ' ';
+ $folder_image = $folder_new;
+ $folder_alt = $lang['New_posts'];
$newest_post_img = ' ';
}
else
{
+ $folder_image = $folder;
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
- $folder_image = " ";
- $newest_post_img = "";
+ $newest_post_img = '';
}
}
else
{
+ $folder_image = $folder;
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
- $folder_image = " ";
- $newest_post_img = "";
+ $newest_post_img = '';
}
}
else
{
+ $folder_image = $folder;
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
- $folder_image = " ";
- $newest_post_img = "";
+ $newest_post_img = '';
}
}
- $topic_poster = ( $searchset[$i]['user_id'] != ANONYMOUS ) ? '' : '';
- $topic_poster .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != '' ) ? $searchset[$i]['post_username'] : $lang['Guest'] );
- $topic_poster .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? ' ' : '';
+
+ $topic_author = ( $searchset[$i]['user_id'] != ANONYMOUS ) ? '' : '';
+ $topic_author .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != '' ) ? $searchset[$i]['post_username'] : $lang['Guest'] );
+
+ $topic_author .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? ' ' : '';
+
+ $first_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['topic_time'], $board_config['board_timezone']);
$last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
- $last_post_user = ( $searchset[$i]['id2'] == ANONYMOUS && $searchset[$i]['post_username'] != '' ) ? $searchset[$i]['post_username'] : $searchset[$i]['user2'];
+ $last_post_author = ( $searchset[$i]['id2'] == ANONYMOUS ) ? ( ($searchset[$i]['post_username2'] != '' ) ? $searchset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '' . $searchset[$i]['user2'] . ' ';
- $last_post = $last_post_time . ' ';
- $last_post .= ( $searchset[$i]['id2'] == ANONYMOUS ) ? ( ($searchset[$i]['post_username'] != '' ) ? $searchset[$i]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '' . $searchset[$i]['user2'] . ' ';
- $last_post .= ' ';
+ $last_post_url = ' ';
$template->assign_block_vars('searchresults', array(
'FORUM_NAME' => $searchset[$i]['forum_name'],
@@ -1058,17 +1116,22 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
'TOPIC_ID' => $topic_id,
'FOLDER' => $folder_image,
'NEWEST_POST_IMG' => $newest_post_img,
- 'TOPIC_POSTER' => $topic_poster,
+ 'TOPIC_FOLDER_IMG' => $folder_image,
'GOTO_PAGE' => $goto_page,
'REPLIES' => $replies,
'TOPIC_TITLE' => $topic_title,
'TOPIC_TYPE' => $topic_type,
'VIEWS' => $views,
- 'LAST_POST' => $last_post,
+ 'TOPIC_AUTHOR' => $topic_author,
+ 'FIRST_POST_TIME' => $first_post_time,
+ 'LAST_POST_TIME' => $last_post_time,
+ 'LAST_POST_AUTHOR' => $last_post_author,
+ 'LAST_POST_IMG' => $last_post_url,
+
+ 'L_TOPIC_FOLDER_ALT' => $folder_alt,
'U_VIEW_FORUM' => $forum_url,
- 'U_VIEW_TOPIC' => $topic_url,
- 'U_TOPIC_POSTER_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $searchset[$i]['user_id']))
+ 'U_VIEW_TOPIC' => $topic_url)
);
}
}
@@ -1079,6 +1142,17 @@ else if( $search_keywords != '' || $search_author != '' || $search_id )
'PAGINATION' => generate_pagination($base_url, $total_match_count, $per_page, $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $per_page ) + 1 ), ceil( $total_match_count / $per_page )),
+ 'L_AUTHOR' => $lang['Author'],
+ 'L_MESSAGE' => $lang['Message'],
+ 'L_FORUM' => $lang['Forum'],
+ 'L_TOPICS' => $lang['Topics'],
+ 'L_REPLIES' => $lang['Replies'],
+ 'L_VIEWS' => $lang['Views'],
+ 'L_POSTS' => $lang['Posts'],
+ 'L_LASTPOST' => $lang['Last_Post'],
+ 'L_POSTED' => $lang['Posted'],
+ 'L_SUBJECT' => $lang['Subject'],
+
'L_GOTO_PAGE' => $lang['Goto_page'])
);
@@ -1096,7 +1170,7 @@ $sql = "SELECT c.cat_title, c.cat_id, f.forum_name, f.forum_id
WHERE f.cat_id = c.cat_id
ORDER BY c.cat_id, f.forum_order";
$result = $db->sql_query($sql);
-if( !$result )
+if ( !$result )
{
message_die(GENERAL_ERROR, 'Could not obtain forum_name/forum_id', '', __LINE__, __FILE__, $sql);
}
@@ -1106,17 +1180,17 @@ $is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
$s_forums = '';
while( $row = $db->sql_fetchrow($result) )
{
- if( $is_auth_ary[$row['forum_id']]['auth_read'] )
+ if ( $is_auth_ary[$row['forum_id']]['auth_read'] )
{
$s_forums .= '' . $row['forum_name'] . ' ';
- if( empty($list_cat[$row['cat_id']]) )
+ if ( empty($list_cat[$row['cat_id']]) )
{
$list_cat[$row['cat_id']] = $row['cat_title'];
}
}
}
-if( $s_forums != '' )
+if ( $s_forums != '' )
{
$s_forums = '' . $lang['All_available'] . ' ' . $s_forums;
@@ -1177,20 +1251,9 @@ $page_title = $lang['Search'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- 'body' => 'search_body.tpl',
- 'jumpbox' => 'jumpbox.tpl')
+ 'body' => 'search_body.tpl')
);
-
-$jumpbox = make_jumpbox();
-$template->assign_vars(array(
- 'L_GO' => $lang['Go'],
- 'L_JUMP_TO' => $lang['Jump_to'],
- 'L_SELECT_FORUM' => $lang['Select_forum'],
-
- 'S_JUMPBOX_LIST' => $jumpbox,
- 'S_JUMPBOX_ACTION' => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
+make_jumpbox('viewforum.'.$phpEx);
$template->assign_vars(array(
'L_SEARCH_QUERY' => $lang['Search_query'],
@@ -1211,6 +1274,9 @@ $template->assign_vars(array(
'L_SORT_DESCENDING' => $lang['Sort_Descending'],
'L_SEARCH_PREVIOUS' => $lang['Search_previous'],
'L_DISPLAY_RESULTS' => $lang['Display_results'],
+ 'L_FORUM' => $lang['Forum'],
+ 'L_TOPICS' => $lang['Topics'],
+ 'L_POSTS' => $lang['Posts'],
'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=results"),
'S_CHARACTER_OPTIONS' => $s_characters,
diff --git a/phpBB/templates/subSilver/agreement.tpl b/phpBB/templates/subSilver/agreement.tpl
index f53996df9c..6c1e9ed434 100644
--- a/phpBB/templates/subSilver/agreement.tpl
+++ b/phpBB/templates/subSilver/agreement.tpl
@@ -1,21 +1,19 @@
-
-
- {SITENAME}
- - {REGISTRATION}
-
-
-
-
-
-
+
+
+
+ {SITENAME} - {REGISTRATION}
+
+
+
+
diff --git a/phpBB/templates/subSilver/bbcode.tpl b/phpBB/templates/subSilver/bbcode.tpl
index b53bf77e10..b5e2472705 100755
--- a/phpBB/templates/subSilver/bbcode.tpl
+++ b/phpBB/templates/subSilver/bbcode.tpl
@@ -1,108 +1,60 @@
-
-
-
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
{USERNAME} {L_WROTE}:
-
-
-
-
-
-
+
+
+
-
-
+
-
-
-
+
+
-
-
+
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
-
-
-
+
-
-{DESCRIPTION}
-
+{DESCRIPTION}
-
-{EMAIL}
-
+{EMAIL}
diff --git a/phpBB/templates/subSilver/confirm_body.tpl b/phpBB/templates/subSilver/confirm_body.tpl
index d28ddb5847..f79a6438de 100644
--- a/phpBB/templates/subSilver/confirm_body.tpl
+++ b/phpBB/templates/subSilver/confirm_body.tpl
@@ -1,21 +1,17 @@
-
-
- {MESSAGE_TITLE}
-
-
-
-
-
-
+
-
+
+
+
+ {MESSAGE_TITLE}
+
+
+
+
+
+
+
diff --git a/phpBB/templates/subSilver/error_body.tpl b/phpBB/templates/subSilver/error_body.tpl
index 6895322002..dd71af8518 100644
--- a/phpBB/templates/subSilver/error_body.tpl
+++ b/phpBB/templates/subSilver/error_body.tpl
@@ -1,20 +1,18 @@
-
-
-
-
-
-
-
-
- {ERROR_MESSAGE}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {ERROR_MESSAGE}
+
+
+
+
+
+
diff --git a/phpBB/templates/subSilver/faq_body.tpl b/phpBB/templates/subSilver/faq_body.tpl
index c31e080c19..9c8a3a8e7d 100755
--- a/phpBB/templates/subSilver/faq_body.tpl
+++ b/phpBB/templates/subSilver/faq_body.tpl
@@ -1,40 +1,43 @@
-
-
- {L_INDEX}
-
+
-
+
-
+
- {faq_block.BLOCK_TITLE}
+ {faq_block.BLOCK_TITLE}
- {faq_block.faq_row.FAQ_QUESTION} {faq_block.faq_row.FAQ_ANSWER}{L_BACK_TO_TOP}
+ {faq_block.faq_row.FAQ_QUESTION} {faq_block.faq_row.FAQ_ANSWER}{L_BACK_TO_TOP}
-
+
@@ -43,7 +46,7 @@
-
- {S_TIMEZONE} {JUMPBOX}
-
+
+ {S_TIMEZONE} {JUMPBOX}
+
diff --git a/phpBB/templates/subSilver/groupcp_info_body.tpl b/phpBB/templates/subSilver/groupcp_info_body.tpl
index 6cd2f83133..37fafd3850 100644
--- a/phpBB/templates/subSilver/groupcp_info_body.tpl
+++ b/phpBB/templates/subSilver/groupcp_info_body.tpl
@@ -1,45 +1,48 @@
-
-
-
-
-
+
+
+
{L_JOIN_A_GROUP}
@@ -58,7 +58,7 @@
-
+
diff --git a/phpBB/templates/subSilver/index_body.tpl b/phpBB/templates/subSilver/index_body.tpl
index 4d56523867..4135f10d80 100644
--- a/phpBB/templates/subSilver/index_body.tpl
+++ b/phpBB/templates/subSilver/index_body.tpl
@@ -27,7 +27,7 @@
- {catrow.forumrow.FOLDER}
+
{catrow.forumrow.FORUM_NAME}
{catrow.forumrow.FORUM_DESC}
{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}
@@ -56,7 +56,7 @@
- {TOTAL_USERS_ONLINE} [ {L_WHOSONLINE_ADMIN} ] [ {L_WHOSONLINE_MOD} ] {L_RECORD_USERS} {LOGGED_IN_USER_LIST}
+ {TOTAL_USERS_ONLINE} [ {L_WHOSONLINE_ADMIN} ] [ {L_WHOSONLINE_MOD} ] {RECORD_USERS} {LOGGED_IN_USER_LIST}
diff --git a/phpBB/templates/subSilver/jumpbox.tpl b/phpBB/templates/subSilver/jumpbox.tpl
index 41d0bbf634..2000e92056 100644
--- a/phpBB/templates/subSilver/jumpbox.tpl
+++ b/phpBB/templates/subSilver/jumpbox.tpl
@@ -1,10 +1,6 @@
-
diff --git a/phpBB/templates/subSilver/memberlist_body.tpl b/phpBB/templates/subSilver/memberlist_body.tpl
index 8573e8ef78..6f1523c00d 100644
--- a/phpBB/templates/subSilver/memberlist_body.tpl
+++ b/phpBB/templates/subSilver/memberlist_body.tpl
@@ -44,7 +44,7 @@
{PAGE_NUMBER}
- {S_TIMEZONE} {PAGINATION}
+ {S_TIMEZONE} {PAGINATION}
diff --git a/phpBB/templates/subSilver/message_body.tpl b/phpBB/templates/subSilver/message_body.tpl
index c74b04fb93..6be7f51331 100644
--- a/phpBB/templates/subSilver/message_body.tpl
+++ b/phpBB/templates/subSilver/message_body.tpl
@@ -1,27 +1,27 @@
-
-
- {MESSAGE_TITLE}
-
-
-
-
-
-
-
-
- {MESSAGE_TEXT}
-
-
-
-
-
-
-
+
+
+
+ {MESSAGE_TITLE}
+
+
+
+
+
+
+
+ {MESSAGE_TEXT}
+
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/phpBB/templates/subSilver/modcp_body.tpl b/phpBB/templates/subSilver/modcp_body.tpl
index 898aecd6c7..fd0fe1b5b6 100644
--- a/phpBB/templates/subSilver/modcp_body.tpl
+++ b/phpBB/templates/subSilver/modcp_body.tpl
@@ -23,10 +23,10 @@
- {topicrow.FOLDER_IMG}
+
{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE}
{topicrow.REPLIES}
- {topicrow.LAST_POST}
+ {topicrow.LAST_POST_TIME}
diff --git a/phpBB/templates/subSilver/modcp_move.tpl b/phpBB/templates/subSilver/modcp_move.tpl
index 515d08accb..730952cd62 100644
--- a/phpBB/templates/subSilver/modcp_move.tpl
+++ b/phpBB/templates/subSilver/modcp_move.tpl
@@ -16,7 +16,7 @@
- {L_MOVE_TO_FORUM} {S_FORUM_BOX}
+ {L_MOVE_TO_FORUM} {S_FORUM_SELECT}
{L_LEAVESHADOW}
{MESSAGE_TEXT}
diff --git a/phpBB/templates/subSilver/modcp_split.tpl b/phpBB/templates/subSilver/modcp_split.tpl
index c29c080352..e3c0c92ccb 100644
--- a/phpBB/templates/subSilver/modcp_split.tpl
+++ b/phpBB/templates/subSilver/modcp_split.tpl
@@ -48,7 +48,7 @@
- {L_POSTED}:
+ {L_POSTED}:
{postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}
@@ -58,7 +58,7 @@
- {postrow.SPLIT_CHECKBOX}
+ {postrow.S_SPLIT_CHECKBOX}
diff --git a/phpBB/templates/subSilver/modcp_viewip.tpl b/phpBB/templates/subSilver/modcp_viewip.tpl
index d03d1b2c97..d497d88f5d 100644
--- a/phpBB/templates/subSilver/modcp_viewip.tpl
+++ b/phpBB/templates/subSilver/modcp_viewip.tpl
@@ -16,7 +16,7 @@
- {IP} ({POSTINGS})
+ {IP} [ {POSTS} ]
[ {L_LOOKUP_IP}
]
@@ -31,7 +31,7 @@
- {userrow.USERNAME} ({userrow.POSTINGS})
+ {userrow.USERNAME} [ {userrow.POSTS} ]
@@ -46,7 +46,7 @@
- {iprow.IP} ({iprow.POSTINGS})
+ {iprow.IP} [ {iprow.POSTS} ]
[ {L_LOOKUP_IP}
]
diff --git a/phpBB/templates/subSilver/overall_footer.tpl b/phpBB/templates/subSilver/overall_footer.tpl
index 18749d7470..58b489fb34 100644
--- a/phpBB/templates/subSilver/overall_footer.tpl
+++ b/phpBB/templates/subSilver/overall_footer.tpl
@@ -1,26 +1,19 @@
- {ADMIN_LINK}
-
- Powered by phpBB {PHPBB_VERSION} © 2001 phpBB
- Group {TRANSLATION_INFO}
-
-
+Powered by phpBB {PHPBB_VERSION} © 2001 phpBB Group {TRANSLATION_INFO}
+
+
-
+