aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php14
-rw-r--r--phpBB/includes/functions_display.php6
-rw-r--r--phpBB/includes/functions_posting.php2
-rw-r--r--phpBB/includes/functions_privmsgs.php2
-rw-r--r--phpBB/includes/message_parser.php88
-rw-r--r--phpBB/includes/session.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php8
7 files changed, 62 insertions, 62 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 939de4b1ab..461a700c89 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -265,17 +265,21 @@ function get_moderators(&$forum_moderators, $forum_id = false)
}
// User authorisation levels output
-function gen_forum_auth_level($mode, &$forum_id)
+function gen_forum_auth_level($mode, $forum_id)
{
global $SID, $template, $auth, $user;
- $rules = array('post', 'reply', 'edit', 'delete', 'attach');
+ $rules = array(
+ ($auth->acl_get('f_post', $forum_id)) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'],
+ ($auth->acl_get('f_reply', $forum_id)) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'],
+ ($auth->acl_gets('f_edit', 'm_edit', $forum_id)) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'],
+ ($auth->acl_gets('f_delete', 'm_delete', $forum_id)) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
+ ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach', $forum_id)) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT']
+ );
foreach ($rules as $rule)
{
- $template->assign_block_vars('rules', array(
- 'RULE' => ($auth->acl_get('f_' . $rule, intval($forum_id))) ? $user->lang['RULES_' . strtoupper($rule) . '_CAN'] : $user->lang['RULES_' . strtoupper($rule) . '_CANNOT'])
- );
+ $template->assign_block_vars('rules', array('RULE' => $rule));
}
return;
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index bb820946d0..516f38aa6d 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -105,7 +105,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
{
$active_forum_ary['forum_id'][] = $forum_id;
$active_forum_ary['enable_icons'][] = $row['enable_icons'];
- $active_forum_ary['forum_topics'] += $row['forum_topics'];
+ $active_forum_ary['forum_topics'] += ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
$active_forum_ary['forum_posts'] += $row['forum_posts'];
}
@@ -128,7 +128,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
$subforums[$parent_id]['name'][$forum_id] = $row['forum_name'];
// Include subforum topic/post counts in parent counts
- $forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
+ $forum_rows[$parent_id]['forum_topics'] += ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
// Do not list redirects in LINK Forums as Posts.
if ($row['forum_type'] != FORUM_LINK)
@@ -313,7 +313,7 @@ function display_forums($root_data = '', $display_moderators = TRUE)
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESC' => $row['forum_desc'],
$l_post_click_count => $post_click_count,
- 'TOPICS' => $row['forum_topics'],
+ 'TOPICS' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['forum_topics_real'] : $row['forum_topics'],
'LAST_POST_TIME' => $last_post_time,
'LAST_POSTER' => $last_poster,
'MODERATORS' => $moderators_list,
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index fede697d1e..c44d539716 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -68,7 +68,7 @@ function generate_smilies($mode, $forum_id)
{
$template->assign_block_vars('emoticon', array(
'SMILEY_CODE' => $row['code'],
- 'SMILEY_IMG' => $config['smilies_path'] . '/' . $row['smile_url'],
+ 'SMILEY_IMG' => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smile_url'],
'SMILEY_WIDTH' => $row['smile_width'],
'SMILEY_HEIGHT' => $row['smile_height'],
'SMILEY_DESC' => $row['emoticon'])
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index a33e82e055..9b60b50973 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -501,7 +501,7 @@ function place_pm_into_folder($global_privmsgs_rules, $release = false)
}
}
- if ($full_folder_action != FULL_FOLDER_MOVE)
+ if ($full_folder_action < 0)
{
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
SET folder_id = $dest_folder, new = 0
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 1229055b9d..88b83e4cd3 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -995,60 +995,56 @@ class parse_message extends bbcode_firstpass
}
// Parse Poll
- function parse_poll(&$poll, $poll_data)
+ function parse_poll(&$poll)
{
- global $auth, $forum_id, $user, $config;
+ global $auth, $user, $config;
- // Need a second look at
- return;
- /*
- // Process poll options
- if ($poll_data['poll_option_text'] && (($auth->acl_get('f_poll', $forum_id) && !$poll_data['poll_last_vote']) || $auth->acl_get('m_edit', $forum_id)))
- {
- $message = $this->message;
- $this->message = $poll_data['poll_option_text'];
-
- if (($result = $this->parse($poll_data['enable_html'], $poll_data['enable_bbcode'], $poll_data['bbcode_uid'], $poll_data['enable_urls'], $poll_data['enable_smilies'], false)) != '')
- {
- $this->warn_msg[] = $result;
- }
+ $poll_max_options = $poll['poll_max_options'];
- $poll_data['poll_option_text'] = $this->message;
- $this->message = $message;
- unset($message);
+ // Parse Poll Option text ;)
+ $tmp_message = $this->message;
+ $this->message = $poll['poll_option_text'];
+ $bbcode_bitfield = $this->bbcode_bitfield;
- $poll['poll_options'] = explode("\n", trim($poll_data['poll_option_text']));
- $poll['poll_options_size'] = sizeof($poll['poll_options']);
-
- if (sizeof($poll['poll_options']) == 1)
- {
- $this->warn_msg[] = $user->lang['TOO_FEW_POLL_OPTIONS'];
- }
- elseif (sizeof($poll['poll_options']) > intval($config['max_poll_options']))
- {
- $this->warn_msg[] = $user->lang['TOO_MANY_POLL_OPTIONS'];
- }
- elseif (sizeof($poll['poll_options']) < $poll['poll_options_size'])
- {
- $this->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
- }
- elseif ($poll_data['poll_max_options'] > sizeof($poll['poll_options']))
- {
- $this->warn_msg[] = $user->lang['TOO_MANY_USER_OPTIONS'];
- }
+ $poll['poll_option_text'] = $this->parse($poll['enable_html'], $poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false);
+
+ $this->bbcode_bitfield |= $bbcode_bitfield;
+ $this->message = $tmp_message;
- $poll['poll_title'] = ($poll_data['poll_title']) ? $poll_data['poll_title'] : '';
- $poll['poll_length'] = ($poll_data['poll_length']) ? intval($poll_data['poll_length']) : 0;
+ // Parse Poll Title
+ $tmp_message = $this->message;
+ $this->message = $poll['poll_title'];
+ $bbcode_bitfield = $this->bbcode_bitfield;
- if (!$poll['poll_title'] && $poll['poll_options_size'])
- {
- $this->warn_msg[] = $user->lang['NO_POLL_TITLE'];
- }
+ $poll['poll_title'] = $this->parse($poll['enable_html'], $poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false);
+
+ $this->bbcode_bitfield |= $bbcode_bitfield;
+ $this->message = $tmp_message;
+
+ unset($tmp_message);
+
+ $poll['poll_options'] = explode("\n", trim($poll['poll_option_text']));
+ $poll['poll_options_size'] = sizeof($poll['poll_options']);
+
+ if (sizeof($poll['poll_options']) == 1)
+ {
+ $this->warn_msg[] = $user->lang['TOO_FEW_POLL_OPTIONS'];
+ }
+ else if ($poll['poll_options_size'] > (int) $config['max_poll_options'])
+ {
+ $this->warn_msg[] = $user->lang['TOO_MANY_POLL_OPTIONS'];
+ }
+ else if ($poll_max_options > $poll['poll_options_size'])
+ {
+ $this->warn_msg[] = $user->lang['TOO_MANY_USER_OPTIONS'];
}
- $poll['poll_start'] = $poll_data['poll_start'];
- $poll['poll_max_options'] = ($poll_data['poll_max_options'] < 1) ? 1 : (($poll_data['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll_data['poll_max_options']);
- */
+ if (!$poll['poll_title'] && $poll['poll_options_size'])
+ {
+ $this->warn_msg[] = $user->lang['NO_POLL_TITLE'];
+ }
+
+ $poll['poll_max_options'] = ($poll['poll_max_options'] < 1) ? 1 : (($poll['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll['poll_max_options']);
}
}
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 5aa9d52b77..c69328ff5a 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -751,7 +751,7 @@ class user extends session
static $imgs;
global $phpbb_root_path;
- if (empty($imgs[$img . $suffix]) || $width)
+ if (empty($imgs[$img . $suffix]) || $width !== false)
{
if (!isset($this->theme['primary'][$img]) || !$this->theme['primary'][$img])
{
@@ -760,7 +760,7 @@ class user extends session
return $imgs[$img . $suffix];
}
- if (!$width)
+ if ($width === false)
{
list($imgsrc, $height, $width) = explode('*', $this->theme['primary'][$img]);
}
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index b00bb65cfb..6d1b612288 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -153,9 +153,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($user_info['online']) ? $user->img('btn_online', $user->lang['ONLINE']) : $user->img('btn_offline', $user->lang['OFFLINE'])),
'DELETE_IMG' => $user->img('btn_delete', $user->lang['DELETE_PM']),
- 'IP_IMG' => $user->img('btn_ip', $user->lang['VIEW_IP']),
+ 'INFO_IMG' => $user->img('btn_info', $user->lang['VIEW_PM_INFO']),
'REPORT_IMG' => $user->img('btn_report', $user->lang['REPORT_PM']),
- 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['REPORTED_MESSAGE']),
+ 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['MESSAGE_REPORTED_MESSAGE']),
'PROFILE_IMG' => $user->img('btn_profile', $user->lang['READ_PROFILE']),
'EMAIL_IMG' => $user->img('btn_email', $user->lang['SEND_EMAIL']),
'QUOTE_IMG' => $user->img('btn_quote', $user->lang['POST_QUOTE_PM']),
@@ -171,7 +171,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;mode=pm_details&amp;p=" . $message_row['msg_id'],
'U_REPORT' => ($config['auth_report_pm'] && $auth->acl_get('u_pm_report')) ? "{$phpbb_root_path}report.$phpEx$SID&amp;pm=" . $message_row['msg_id'] : '',
- 'U_IP' => ($auth->acl_get('m_ip') && $message_row['message_reported']) ? "{$phpbb_root_path}mcp.$phpEx?sid=" . $user->session_id . "&amp;mode=pm_details&amp;p=" . $message_row['msg_id'] . '#ip' : '',
+ 'U_INFO' => ($auth->acl_get('m_') && ($message_row['message_reported'] || $message_row['forwarded'])) ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;mode=pm_details&amp;p=" . $message_row['msg_id'] : '',
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_AUTHOR_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $author_id,
'U_EMAIL' => $user_info['email'],
@@ -201,7 +201,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
}
}
- if ($_REQUEST['view'] != 'print')
+ if (!isset($_REQUEST['view']) || $_REQUEST['view'] != 'print')
{
// Message History
if (message_history($msg_id, $user->data['user_id'], $message_row, $folder))