1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 20:24:08 +02:00

Merge remote-tracking branch 'phpbb/develop' into ticket/11574

* phpbb/develop: (130 commits)
  [ticket/11638] Changed the layout to match the other similar commits
  [ticket/11640] removed the space that I wonder what it was doing there.
  [ticket/11749] Move event after all template data has been defined
  [ticket/10917] Variable used only once so delete it
  [ticket/10917] Revert use of phpbb wrapper
  [ticket/11749] Template events for topic_list_row_pre/append
  [ticket/11749] PHP Events for viewforum.php
  [ticket/11749] PHP Events for search.php
  [ticket/11740] Update FAQ to include Ideas Centre
  [ticket/11062] If user's language is english there is no further work needed
  [ticket/11062] Load new strings from user's language file if provided
  [ticket/10917] Using phpbb wrapper
  [ticket/10917] Fixed notice that files are out of date when updating to an unreleased version
  [ticket/11741] Fix empty brackets and remove bullet
  [ticket/11638] Removed the unneeded reset.
  [ticket/11638] Use the $parse_flags like the other commits
  [ticket/11638] Reverted to use the $parse tags way as the other ones
  [ticket/11638] Updated: bitwise $parse_flags use optionset()
  [ticket/11656] Made the check for the bitfield just like other PR's
  [ticket/11667] Use @inheritdoc
  ...
This commit is contained in:
Joas Schilling
2013-07-30 01:06:11 +02:00
72 changed files with 2164 additions and 557 deletions

View File

@@ -127,8 +127,10 @@ phpbb.addAjaxCallback('activate_deactivate', function(res) {
* The removes the parent row of the link or form that triggered the callback,
* and is good for stuff like the removal of forums.
*/
phpbb.addAjaxCallback('row_delete', function() {
$(this).parents('tr').remove();
phpbb.addAjaxCallback('row_delete', function(res) {
if (res.SUCCESS !== false) {
$(this).parents('tr').remove();
}
});

View File

@@ -8,6 +8,12 @@ imports:
- { resource: auth_providers.yml }
services:
acl.permissions:
class: phpbb_permissions
arguments:
- @dispatcher
- @user
auth:
class: phpbb_auth
@@ -239,6 +245,9 @@ services:
- %tables.notifications%
- %tables.user_notifications%
php_ini:
class: phpbb_php_ini
request:
class: phpbb_request

View File

@@ -114,6 +114,24 @@ simple_footer_after
* Location: styles/prosilver/template/simple_footer.html
* Purpose: Add content directly prior to the `</body>` tag of the simple footer
topiclist_row_prepend
===
* Locations:
+ styles/prosilver/template/search_results.html
+ styles/prosilver/template/viewforum_body.html
+ styles/subsilver2/template/search_results.html
+ styles/subsilver2/template/viewforum_body.html
* Purpose: Add content into topic rows (inside the elements containing topic titles)
topiclist_row_append
===
* Locations:
+ styles/prosilver/template/search_results.html
+ styles/prosilver/template/viewforum_body.html
+ styles/subsilver2/template/search_results.html
+ styles/subsilver2/template/viewforum_body.html
* Purpose: Add content into topic rows (inside the elements containing topic titles)
ucp_pm_viewmessage_print_head_append
===
* Location: styles/prosilver/template/ucp_pm_viewmessage_print.html

View File

@@ -41,7 +41,7 @@ if (isset($_GET['avatar']))
exit;
}
require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
@@ -50,7 +50,7 @@ if (isset($_GET['avatar']))
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Setup class loader first
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", $phpEx);
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();

View File

@@ -379,6 +379,7 @@ class acp_modules
$json_response->send(array(
'MESSAGE_TITLE' => $user->lang('ERROR'),
'MESSAGE_TEXT' => implode('<br />', $errors),
'SUCCESS' => false,
));
}

View File

@@ -25,7 +25,7 @@ class acp_permission_roles
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -306,6 +306,8 @@ class acp_permission_roles
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$phpbb_permissions = $phpbb_container->get('acl.permissions');
$template->assign_vars(array(
'S_EDIT' => true,
@@ -314,9 +316,8 @@ class acp_permission_roles
'ROLE_NAME' => $role_row['role_name'],
'ROLE_DESCRIPTION' => $role_row['role_description'],
'L_ACL_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)],
)
);
'L_ACL_TYPE' => $phpbb_permissions->get_type_lang($permission_type),
));
// We need to fill the auth options array with ACL_NO options ;)
$sql = 'SELECT auth_option_id, auth_option
@@ -456,7 +457,9 @@ class acp_permission_roles
*/
function display_auth_options($auth_options)
{
global $template, $user;
global $template, $user, $phpbb_container;
$phpbb_permissions = $phpbb_container->get('acl.permissions');
$content_array = $categories = array();
$key_sort_array = array(0);
@@ -473,7 +476,7 @@ class acp_permission_roles
foreach ($content_array as $cat => $cat_array)
{
$template->assign_block_vars('auth', array(
'CAT_NAME' => $user->lang['permission_cat'][$cat],
'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
@@ -488,8 +491,8 @@ class acp_permission_roles
'S_NO' => ($allowed == ACL_NO) ? true : false,
'FIELD_NAME' => $permission,
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);
'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
));
}
}
}

View File

@@ -22,15 +22,18 @@ class acp_permissions
{
var $u_action;
var $permission_dropdown;
protected $permissions;
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
$this->permissions = $phpbb_container->get('acl.permissions');
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
@@ -49,7 +52,7 @@ class acp_permissions
if ($user_id && isset($auth_admin->acl_options['id'][$permission]) && $auth->acl_get('a_viewauth'))
{
$this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $user->lang['acl_' . $permission]['lang']);
$this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $this->permissions->get_permission_lang($permission));
$this->permission_trace($user_id, $forum_id, $permission);
return;
}
@@ -512,7 +515,7 @@ class acp_permissions
$template->assign_vars(array(
'S_PERMISSION_DROPDOWN' => (sizeof($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type, $permission_scope) : false,
'L_PERMISSION_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)],
'L_PERMISSION_TYPE' => $this->permissions->get_type_lang($permission_type),
'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@@ -587,7 +590,7 @@ class acp_permissions
*/
function build_permission_dropdown($options, $default_option, $permission_scope)
{
global $user, $auth;
global $auth;
$s_dropdown_options = '';
foreach ($options as $setting)
@@ -598,7 +601,7 @@ class acp_permissions
}
$selected = ($setting == $default_option) ? ' selected="selected"' : '';
$l_setting = (isset($user->lang['permission_type'][$permission_scope][$setting])) ? $user->lang['permission_type'][$permission_scope][$setting] : $user->lang['permission_type'][$setting];
$l_setting = $this->permissions->get_type_lang($setting, $permission_scope);
$s_dropdown_options .= '<option value="' . $setting . '"' . $selected . '>' . $l_setting . '</option>';
}
@@ -979,7 +982,7 @@ class acp_permissions
$back = request_var('back', 0);
$template->assign_vars(array(
'PERMISSION' => $user->lang['acl_' . $permission]['lang'],
'PERMISSION' => $this->permissions->get_permission_lang($permission),
'PERMISSION_USERNAME' => $userdata['username'],
'FORUM_NAME' => $forum_name,

View File

@@ -261,7 +261,8 @@ class auth_admin extends phpbb_auth
*/
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
global $template, $user, $db, $phpbb_root_path, $phpEx;
global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container;
$phpbb_permissions = $phpbb_container->get('acl.permissions');
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
@@ -269,7 +270,7 @@ class auth_admin extends phpbb_auth
$tpl_category = 'category';
$tpl_mask = 'mask';
$l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type);
$l_acl_type = $phpbb_permissions->get_type_lang($permission_type, (($local) ? 'local' : 'global'));
// Allow trace for viewing permissions and in user mode
$show_trace = ($mode == 'view' && $user_mode == 'user') ? true : false;
@@ -1100,7 +1101,9 @@ class auth_admin extends phpbb_auth
*/
function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
{
global $template, $user, $phpbb_admin_path, $phpEx;
global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container;
$phpbb_permissions = $phpbb_container->get('acl.permissions');
@reset($category_array);
while (list($cat, $cat_array) = each($category_array))
@@ -1110,8 +1113,8 @@ class auth_admin extends phpbb_auth
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false,
'CAT_NAME' => $user->lang['permission_cat'][$cat])
);
'CAT_NAME' => $phpbb_permissions->get_category_lang($cat),
));
/* Sort permissions by name (more naturaly and user friendly than sorting by a primary key)
* Commented out due to it's memory consumption and time needed
@@ -1145,8 +1148,8 @@ class auth_admin extends phpbb_auth
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);
'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
));
}
else
{
@@ -1163,8 +1166,8 @@ class auth_admin extends phpbb_auth
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);
'PERMISSION' => $phpbb_permissions->get_permission_lang($permission),
));
}
}
}
@@ -1176,7 +1179,9 @@ class auth_admin extends phpbb_auth
*/
function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
{
global $user;
global $user, $phpbb_container;
$phpbb_permissions = $phpbb_container->get('acl.permissions');
foreach ($key_sort_array as $forum_id)
{
@@ -1191,20 +1196,12 @@ class auth_admin extends phpbb_auth
@reset($permissions);
while (list($permission, $auth_setting) = each($permissions))
{
if (!isset($user->lang['acl_' . $permission]))
{
$user->lang['acl_' . $permission] = array(
'cat' => 'misc',
'lang' => '{ acl_' . $permission . ' }'
);
}
$cat = $user->lang['acl_' . $permission]['cat'];
$cat = $phpbb_permissions->get_permission_category($permission);
// Build our categories array
if (!isset($categories[$cat]))
{
$categories[$cat] = $user->lang['permission_cat'][$cat];
$categories[$cat] = $phpbb_permissions->get_category_lang($cat);
}
// Build our content array

View File

@@ -50,7 +50,8 @@ class phpbb_captcha_factory
{
include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
}
call_user_func(array($name, 'garbage_collect'), 0);
$captcha = self::get_instance($name);
$captcha->garbage_collect(0);
}
/**

View File

@@ -1995,6 +1995,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
}
$first_post_has_topic_info = ($post_mode == 'edit_first_post' &&
(($post_visibility == ITEM_DELETED && $data['topic_posts_softdeleted'] == 1) ||
($post_visibility == ITEM_UNAPPROVED && $data['topic_posts_unapproved'] == 1) ||
($post_visibility == ITEM_APPROVED && $data['topic_posts_approved'] == 1)));
// Fix the post's and topic's visibility and first/last post information, when the post is edited
if (($post_mode != 'post' && $post_mode != 'reply') && $data['post_visibility'] != $post_visibility)
{
@@ -2007,7 +2011,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$phpbb_content_visibility->set_post_visibility($post_visibility, $data['post_id'], $data['topic_id'], $data['forum_id'], $user->data['user_id'], time(), '', $is_starter, $is_latest);
}
else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))
else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $first_post_has_topic_info)
{
if ($post_visibility == ITEM_APPROVED || $data['topic_visibility'] == $post_visibility)
{

View File

@@ -2018,14 +2018,11 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$decoded_message = bbcode_nl2br($decoded_message);
}
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = bbcode_nl2br($message);
$message = smiley_text($message, !$row['enable_smilies']);
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
$parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
$message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
$subject = censor_text($subject);

View File

@@ -289,19 +289,8 @@ class mcp_warn
// We want to make the message available here as a reminder
// Parse the message and subject
$message = censor_text($user_row['post_text']);
// Second parse bbcode here
if ($user_row['bbcode_bitfield'])
{
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
$bbcode = new bbcode($user_row['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']);
}
$message = bbcode_nl2br($message);
$message = smiley_text($message);
$parse_flags = OPTION_FLAG_SMILIES | ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
$message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true);
// Generate the appropriate user information for the user we are looking at
if (!function_exists('phpbb_get_user_avatar'))

View File

@@ -267,7 +267,7 @@ class ucp_prefs
$limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
$sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
$sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views');
// Post ordering options
$limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);

View File

@@ -38,7 +38,7 @@ class ucp_register
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$coppa = $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false;
$agreed = (int) $request->variable('agreed', false);
$agreed = $request->variable('agreed', false);
$submit = $request->is_set_post('submit');
$change_lang = request_var('change_lang', '');
$user_lang = request_var('lang', $user->lang_name);
@@ -63,7 +63,7 @@ class ucp_register
$submit = false;
// Setting back agreed to let the user view the agreement in his/her language
$agreed = ($request->variable('change_lang', false)) ? 0 : $agreed;
$agreed = false;
}
$user->lang_name = $user_lang = $use_lang;
@@ -89,7 +89,7 @@ class ucp_register
$add_coppa = ($coppa !== false) ? '&amp;coppa=' . $coppa : '';
$s_hidden_fields = array(
'change_lang' => $change_lang,
'change_lang' => '',
);
// If we change the language, we want to pass on some more possible parameter.

View File

@@ -57,7 +57,6 @@ class install_update extends module
var $new_location;
var $latest_version;
var $current_version;
var $unequal_version;
var $update_to_version;
@@ -87,7 +86,6 @@ class install_update extends module
$this->tpl_name = 'install_update';
$this->page_title = 'UPDATE_INSTALLATION';
$this->unequal_version = false;
$this->old_location = $phpbb_root_path . 'install/update/old/';
$this->new_location = $phpbb_root_path . 'install/update/new/';
@@ -199,8 +197,6 @@ class install_update extends module
// Check if the update files are actually meant to update from the current version
if ($this->current_version != $this->update_info['version']['from'])
{
$this->unequal_version = true;
$template->assign_vars(array(
'S_ERROR' => true,
'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $this->current_version, $this->update_info['version']['from'], $this->update_info['version']['to']),
@@ -208,10 +204,8 @@ class install_update extends module
}
// Check if the update files stored are for the latest version...
if ($this->latest_version != $this->update_info['version']['to'])
if (version_compare(strtolower($this->latest_version), strtolower($this->update_info['version']['to']), '>'))
{
$this->unequal_version = true;
$template->assign_vars(array(
'S_WARNING' => true,
'WARNING_MSG' => sprintf($user->lang['OLD_UPDATE_FILES'], $this->update_info['version']['from'], $this->update_info['version']['to'], $this->latest_version))
@@ -230,7 +224,14 @@ class install_update extends module
if ($this->test_update === false)
{
// What about the language file? Got it updated?
if (in_array('language/en/install.' . $phpEx, $this->update_info['files']))
if (in_array('language/' . $language . '/install.' . $phpEx, $this->update_info['files']))
{
$lang = array();
include($this->new_location . 'language/' . $language . '/install.' . $phpEx);
// this is the user's language.. just merge it
$user->lang = array_merge($user->lang, $lang);
}
if ($language != 'en' && in_array('language/en/install.' . $phpEx, $this->update_info['files']))
{
$lang = array();
include($this->new_location . 'language/en/install.' . $phpEx);
@@ -284,7 +285,7 @@ class install_update extends module
));
// Print out version the update package updates to
if ($this->unequal_version)
if ($this->latest_version != $this->update_info['version']['to'])
{
$template->assign_var('PACKAGE_VERSION', $this->update_info['version']['to']);
}

View File

@@ -33,209 +33,175 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
/**
* MODDERS PLEASE NOTE
* EXTENSION-DEVELOPERS PLEASE NOTE
*
* You are able to put your permission sets into a separate file too by
* prefixing the new file with permissions_ and putting it into the acp
* language folder.
*
* An example of how the file could look like:
*
* <code>
*
* if (empty($lang) || !is_array($lang))
* {
* $lang = array();
* }
*
* // Adding new category
* $lang['permission_cat']['bugs'] = 'Bugs';
*
* // Adding new permission set
* $lang['permission_type']['bug_'] = 'Bug Permissions';
*
* // Adding the permissions
* $lang = array_merge($lang, array(
* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'),
* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here
* ));
*
* </code>
* You are able to put your permission sets into your extension.
* The permissions logic should be added via the 'core.permissions' event.
* You can easily add new permission categories, types and permissions, by
* simply merging them into the respective arrays.
* The respective language strings should be added into a language file, that
* start with 'permissions_', so they are automatically loaded within the ACP.
*/
// Define categories and permission types
$lang = array_merge($lang, array(
'permission_cat' => array(
'actions' => 'Actions',
'content' => 'Content',
'forums' => 'Forums',
'misc' => 'Misc',
'permissions' => 'Permissions',
'pm' => 'Private messages',
'polls' => 'Polls',
'post' => 'Post',
'post_actions' => 'Post actions',
'posting' => 'Posting',
'profile' => 'Profile',
'settings' => 'Settings',
'topic_actions' => 'Topic actions',
'user_group' => 'Users &amp; Groups',
),
// With defining 'global' here we are able to specify what is printed out if the permission is within the global scope.
'permission_type' => array(
'u_' => 'User permissions',
'a_' => 'Admin permissions',
'm_' => 'Moderator permissions',
'f_' => 'Forum permissions',
'global' => array(
'm_' => 'Global moderator permissions',
),
),
'ACL_CAT_ACTIONS' => 'Actions',
'ACL_CAT_CONTENT' => 'Content',
'ACL_CAT_FORUMS' => 'Forums',
'ACL_CAT_MISC' => 'Misc',
'ACL_CAT_PERMISSIONS' => 'Permissions',
'ACL_CAT_PM' => 'Private messages',
'ACL_CAT_POLLS' => 'Polls',
'ACL_CAT_POST' => 'Post',
'ACL_CAT_POST_ACTIONS' => 'Post actions',
'ACL_CAT_POSTING' => 'Posting',
'ACL_CAT_PROFILE' => 'Profile',
'ACL_CAT_SETTINGS' => 'Settings',
'ACL_CAT_TOPIC_ACTIONS' => 'Topic actions',
'ACL_CAT_USER_GROUP' => 'Users &amp; Groups',
));
// User Permissions
$lang = array_merge($lang, array(
'acl_u_viewprofile' => array('lang' => 'Can view profiles, memberlist and online list', 'cat' => 'profile'),
'acl_u_chgname' => array('lang' => 'Can change username', 'cat' => 'profile'),
'acl_u_chgpasswd' => array('lang' => 'Can change password', 'cat' => 'profile'),
'acl_u_chgemail' => array('lang' => 'Can change email address', 'cat' => 'profile'),
'acl_u_chgavatar' => array('lang' => 'Can change avatar', 'cat' => 'profile'),
'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'),
'acl_u_chgprofileinfo' => array('lang' => 'Can change profile field information', 'cat' => 'profile'),
'ACL_U_VIEWPROFILE' => 'Can view profiles, memberlist and online list',
'ACL_U_CHGNAME' => 'Can change username',
'ACL_U_CHGPASSWD' => 'Can change password',
'ACL_U_CHGEMAIL' => 'Can change email address',
'ACL_U_CHGAVATAR' => 'Can change avatar',
'ACL_U_CHGGRP' => 'Can change default usergroup',
'ACL_U_CHGPROFILEINFO' => 'Can change profile field information',
'acl_u_attach' => array('lang' => 'Can attach files', 'cat' => 'post'),
'acl_u_download' => array('lang' => 'Can download files', 'cat' => 'post'),
'acl_u_savedrafts' => array('lang' => 'Can save drafts', 'cat' => 'post'),
'acl_u_chgcensors' => array('lang' => 'Can disable word censors', 'cat' => 'post'),
'acl_u_sig' => array('lang' => 'Can use signature', 'cat' => 'post'),
'ACL_U_ATTACH' => 'Can attach files',
'ACL_U_DOWNLOAD' => 'Can download files',
'ACL_U_SAVEDRAFTS' => 'Can save drafts',
'ACL_U_CHGCENSORS' => 'Can disable word censors',
'ACL_U_SIG' => 'Can use signature',
'acl_u_sendpm' => array('lang' => 'Can send private messages', 'cat' => 'pm'),
'acl_u_masspm' => array('lang' => 'Can send messages to multiple users', 'cat' => 'pm'),
'acl_u_masspm_group'=> array('lang' => 'Can send messages to groups', 'cat' => 'pm'),
'acl_u_readpm' => array('lang' => 'Can read private messages', 'cat' => 'pm'),
'acl_u_pm_edit' => array('lang' => 'Can edit own private messages', 'cat' => 'pm'),
'acl_u_pm_delete' => array('lang' => 'Can remove private messages from own folder', 'cat' => 'pm'),
'acl_u_pm_forward' => array('lang' => 'Can forward private messages', 'cat' => 'pm'),
'acl_u_pm_emailpm' => array('lang' => 'Can email private messages', 'cat' => 'pm'),
'acl_u_pm_printpm' => array('lang' => 'Can print private messages', 'cat' => 'pm'),
'acl_u_pm_attach' => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'),
'acl_u_pm_download' => array('lang' => 'Can download files in private messages', 'cat' => 'pm'),
'acl_u_pm_bbcode' => array('lang' => 'Can use BBCode in private messages', 'cat' => 'pm'),
'acl_u_pm_smilies' => array('lang' => 'Can use smilies in private messages', 'cat' => 'pm'),
'acl_u_pm_img' => array('lang' => 'Can use [img] BBCode tag in private messages', 'cat' => 'pm'),
'acl_u_pm_flash' => array('lang' => 'Can use [flash] BBCode tag in private messages', 'cat' => 'pm'),
'ACL_U_SENDPM' => 'Can send private messages',
'ACL_U_MASSPM' => 'Can send messages to multiple users',
'ACL_U_MASSPM_GROUP'=> 'Can send messages to groups',
'ACL_U_READPM' => 'Can read private messages',
'ACL_U_PM_EDIT' => 'Can edit own private messages',
'ACL_U_PM_DELETE' => 'Can remove private messages from own folder',
'ACL_U_PM_FORWARD' => 'Can forward private messages',
'ACL_U_PM_EMAILPM' => 'Can email private messages',
'ACL_U_PM_PRINTPM' => 'Can print private messages',
'ACL_U_PM_ATTACH' => 'Can attach files in private messages',
'ACL_U_PM_DOWNLOAD' => 'Can download files in private messages',
'ACL_U_PM_BBCODE' => 'Can use BBCode in private messages',
'ACL_U_PM_SMILIES' => 'Can use smilies in private messages',
'ACL_U_PM_IMG' => 'Can use [img] BBCode tag in private messages',
'ACL_U_PM_FLASH' => 'Can use [flash] BBCode tag in private messages',
'acl_u_sendemail' => array('lang' => 'Can send emails', 'cat' => 'misc'),
'acl_u_sendim' => array('lang' => 'Can send instant messages', 'cat' => 'misc'),
'acl_u_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'),
'acl_u_hideonline' => array('lang' => 'Can hide online status', 'cat' => 'misc'),
'acl_u_viewonline' => array('lang' => 'Can view hidden online users', 'cat' => 'misc'),
'acl_u_search' => array('lang' => 'Can search board', 'cat' => 'misc'),
'ACL_U_SENDEMAIL' => 'Can send emails',
'ACL_U_SENDIM' => 'Can send instant messages',
'ACL_U_IGNOREFLOOD' => 'Can ignore flood limit',
'ACL_U_HIDEONLINE' => 'Can hide online status',
'ACL_U_VIEWONLINE' => 'Can view hidden online users',
'ACL_U_SEARCH' => 'Can search board',
));
// Forum Permissions
$lang = array_merge($lang, array(
'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'actions'),
'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'actions'),
'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'actions'),
'acl_f_subscribe' => array('lang' => 'Can subscribe forum', 'cat' => 'actions'),
'acl_f_print' => array('lang' => 'Can print topics', 'cat' => 'actions'),
'acl_f_email' => array('lang' => 'Can email topics', 'cat' => 'actions'),
'acl_f_bump' => array('lang' => 'Can bump topics', 'cat' => 'actions'),
'acl_f_user_lock' => array('lang' => 'Can lock own topics', 'cat' => 'actions'),
'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'actions'),
'acl_f_report' => array('lang' => 'Can report posts', 'cat' => 'actions'),
'ACL_F_LIST' => 'Can see forum',
'ACL_F_READ' => 'Can read forum',
'ACL_F_SEARCH' => 'Can search the forum',
'ACL_F_SUBSCRIBE' => 'Can subscribe forum',
'ACL_F_PRINT' => 'Can print topics',
'ACL_F_EMAIL' => 'Can email topics',
'ACL_F_BUMP' => 'Can bump topics',
'ACL_F_USER_LOCK' => 'Can lock own topics',
'ACL_F_DOWNLOAD' => 'Can download files',
'ACL_F_REPORT' => 'Can report posts',
'acl_f_post' => array('lang' => 'Can start new topics', 'cat' => 'post'),
'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'),
'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'),
'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'),
'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'post'),
'acl_f_delete' => array('lang' => 'Can permanently delete own posts', 'cat' => 'post'),
'acl_f_softdelete' => array('lang' => 'Can soft delete own posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>', 'cat' => 'post'),
'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'post'),
'acl_f_postcount' => array('lang' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>', 'cat' => 'post'),
'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'post'),
'ACL_F_POST' => 'Can start new topics',
'ACL_F_STICKY' => 'Can post stickies',
'ACL_F_ANNOUNCE' => 'Can post announcements',
'ACL_F_REPLY' => 'Can reply to topics',
'ACL_F_EDIT' => 'Can edit own posts',
'ACL_F_DELETE' => 'Can permanently delete own posts',
'ACL_F_SOFTDELETE' => 'Can soft delete own posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>',
'ACL_F_IGNOREFLOOD' => 'Can ignore flood limit',
'ACL_F_POSTCOUNT' => 'Increment post counter<br /><em>Please note that this setting only affects new posts.</em>',
'ACL_F_NOAPPROVE' => 'Can post without approval',
'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'),
'acl_f_icons' => array('lang' => 'Can use topic/post icons', 'cat' => 'content'),
'acl_f_bbcode' => array('lang' => 'Can use BBCode', 'cat' => 'content'),
'acl_f_flash' => array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'),
'acl_f_img' => array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'),
'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'),
'acl_f_smilies' => array('lang' => 'Can use smilies', 'cat' => 'content'),
'ACL_F_ATTACH' => 'Can attach files',
'ACL_F_ICONS' => 'Can use topic/post icons',
'ACL_F_BBCODE' => 'Can use BBCode',
'ACL_F_FLASH' => 'Can use [flash] BBCode tag',
'ACL_F_IMG' => 'Can use [img] BBCode tag',
'ACL_F_SIGS' => 'Can use signatures',
'ACL_F_SMILIES' => 'Can use smilies',
'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'),
'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'),
'acl_f_votechg' => array('lang' => 'Can change existing vote', 'cat' => 'polls'),
'ACL_F_POLL' => 'Can create polls',
'ACL_F_VOTE' => 'Can vote in polls',
'ACL_F_VOTECHG' => 'Can change existing vote',
));
// Moderator Permissions
$lang = array_merge($lang, array(
'acl_m_edit' => array('lang' => 'Can edit posts', 'cat' => 'post_actions'),
'acl_m_delete' => array('lang' => 'Can permanently delete posts', 'cat' => 'post_actions'),
'acl_m_softdelete' => array('lang' => 'Can soft delete posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>', 'cat' => 'post_actions'),
'acl_m_approve' => array('lang' => 'Can approve and restore posts', 'cat' => 'post_actions'),
'acl_m_report' => array('lang' => 'Can close and delete reports', 'cat' => 'post_actions'),
'acl_m_chgposter' => array('lang' => 'Can change post author', 'cat' => 'post_actions'),
'ACL_M_EDIT' => 'Can edit posts',
'ACL_M_DELETE' => 'Can permanently delete posts',
'ACL_M_SOFTDELETE' => 'Can soft delete posts<br /><em>Moderators, who have the approve posts permission, can restore soft deleted posts.</em>',
'ACL_M_APPROVE' => 'Can approve posts',
'ACL_M_REPORT' => 'Can close and delete reports',
'ACL_M_CHGPOSTER' => 'Can change post author',
'acl_m_move' => array('lang' => 'Can move topics', 'cat' => 'topic_actions'),
'acl_m_lock' => array('lang' => 'Can lock topics', 'cat' => 'topic_actions'),
'acl_m_split' => array('lang' => 'Can split topics', 'cat' => 'topic_actions'),
'acl_m_merge' => array('lang' => 'Can merge topics', 'cat' => 'topic_actions'),
'ACL_M_MOVE' => 'Can move topics',
'ACL_M_LOCK' => 'Can lock topics',
'ACL_M_SPLIT' => 'Can split topics',
'ACL_M_MERGE' => 'Can merge topics',
'acl_m_info' => array('lang' => 'Can view post details', 'cat' => 'misc'),
'acl_m_warn' => array('lang' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)
'acl_m_ban' => array('lang' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)
'ACL_M_INFO' => 'Can view post details',
'ACL_M_WARN' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
'ACL_M_BAN' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
));
// Admin Permissions
$lang = array_merge($lang, array(
'acl_a_board' => array('lang' => 'Can alter board settings/check for updates', 'cat' => 'settings'),
'acl_a_server' => array('lang' => 'Can alter server/communication settings', 'cat' => 'settings'),
'acl_a_jabber' => array('lang' => 'Can alter Jabber settings', 'cat' => 'settings'),
'acl_a_phpinfo' => array('lang' => 'Can view php settings', 'cat' => 'settings'),
'ACL_A_BOARD' => 'Can alter board settings/check for updates',
'ACL_A_SERVER' => 'Can alter server/communication settings',
'ACL_A_JABBER' => 'Can alter Jabber settings',
'ACL_A_PHPINFO' => 'Can view php settings',
'acl_a_forum' => array('lang' => 'Can manage forums', 'cat' => 'forums'),
'acl_a_forumadd' => array('lang' => 'Can add new forums', 'cat' => 'forums'),
'acl_a_forumdel' => array('lang' => 'Can delete forums', 'cat' => 'forums'),
'acl_a_prune' => array('lang' => 'Can prune forums', 'cat' => 'forums'),
'ACL_A_FORUM' => 'Can manage forums',
'ACL_A_FORUMADD' => 'Can add new forums',
'ACL_A_FORUMDEL' => 'Can delete forums',
'ACL_A_PRUNE' => 'Can prune forums',
'acl_a_icons' => array('lang' => 'Can alter topic/post icons and smilies', 'cat' => 'posting'),
'acl_a_words' => array('lang' => 'Can alter word censors', 'cat' => 'posting'),
'acl_a_bbcode' => array('lang' => 'Can define BBCode tags', 'cat' => 'posting'),
'acl_a_attach' => array('lang' => 'Can alter attachment related settings', 'cat' => 'posting'),
'ACL_A_ICONS' => 'Can alter topic/post icons and smilies',
'ACL_A_WORDS' => 'Can alter word censors',
'ACL_A_BBCODE' => 'Can define BBCode tags',
'ACL_A_ATTACH' => 'Can alter attachment related settings',
'acl_a_user' => array('lang' => 'Can manage users<br /><em>This also includes seeing the users browser agent within the viewonline list.</em>', 'cat' => 'user_group'),
'acl_a_userdel' => array('lang' => 'Can delete/prune users', 'cat' => 'user_group'),
'acl_a_group' => array('lang' => 'Can manage groups', 'cat' => 'user_group'),
'acl_a_groupadd' => array('lang' => 'Can add new groups', 'cat' => 'user_group'),
'acl_a_groupdel' => array('lang' => 'Can delete groups', 'cat' => 'user_group'),
'acl_a_ranks' => array('lang' => 'Can manage ranks', 'cat' => 'user_group'),
'acl_a_profile' => array('lang' => 'Can manage custom profile fields', 'cat' => 'user_group'),
'acl_a_names' => array('lang' => 'Can manage disallowed names', 'cat' => 'user_group'),
'acl_a_ban' => array('lang' => 'Can manage bans', 'cat' => 'user_group'),
'ACL_A_USER' => 'Can manage users<br /><em>This also includes seeing the users browser agent within the viewonline list.</em>',
'ACL_A_USERDEL' => 'Can delete/prune users',
'ACL_A_GROUP' => 'Can manage groups',
'ACL_A_GROUPADD' => 'Can add new groups',
'ACL_A_GROUPDEL' => 'Can delete groups',
'ACL_A_RANKS' => 'Can manage ranks',
'ACL_A_PROFILE' => 'Can manage custom profile fields',
'ACL_A_NAMES' => 'Can manage disallowed names',
'ACL_A_BAN' => 'Can manage bans',
'acl_a_viewauth' => array('lang' => 'Can view permission masks', 'cat' => 'permissions'),
'acl_a_authgroups' => array('lang' => 'Can alter permissions for individual groups', 'cat' => 'permissions'),
'acl_a_authusers' => array('lang' => 'Can alter permissions for individual users', 'cat' => 'permissions'),
'acl_a_fauth' => array('lang' => 'Can alter forum permission class', 'cat' => 'permissions'),
'acl_a_mauth' => array('lang' => 'Can alter moderator permission class', 'cat' => 'permissions'),
'acl_a_aauth' => array('lang' => 'Can alter admin permission class', 'cat' => 'permissions'),
'acl_a_uauth' => array('lang' => 'Can alter user permission class', 'cat' => 'permissions'),
'acl_a_roles' => array('lang' => 'Can manage roles', 'cat' => 'permissions'),
'acl_a_switchperm' => array('lang' => 'Can use others permissions', 'cat' => 'permissions'),
'ACL_A_VIEWAUTH' => 'Can view permission masks',
'ACL_A_AUTHGROUPS' => 'Can alter permissions for individual groups',
'ACL_A_AUTHUSERS' => 'Can alter permissions for individual users',
'ACL_A_FAUTH' => 'Can alter forum permission class',
'ACL_A_MAUTH' => 'Can alter moderator permission class',
'ACL_A_AAUTH' => 'Can alter admin permission class',
'ACL_A_UAUTH' => 'Can alter user permission class',
'ACL_A_ROLES' => 'Can manage roles',
'ACL_A_SWITCHPERM' => 'Can use others permissions',
'acl_a_styles' => array('lang' => 'Can manage styles', 'cat' => 'misc'),
'acl_a_extensions' => array('lang' => 'Can manage extensions', 'cat' => 'misc'),
'acl_a_viewlogs' => array('lang' => 'Can view logs', 'cat' => 'misc'),
'acl_a_clearlogs' => array('lang' => 'Can clear logs', 'cat' => 'misc'),
'acl_a_modules' => array('lang' => 'Can manage modules', 'cat' => 'misc'),
'acl_a_language' => array('lang' => 'Can manage language packs', 'cat' => 'misc'),
'acl_a_email' => array('lang' => 'Can send mass email', 'cat' => 'misc'),
'acl_a_bots' => array('lang' => 'Can manage bots', 'cat' => 'misc'),
'acl_a_reasons' => array('lang' => 'Can manage report/denial reasons', 'cat' => 'misc'),
'acl_a_backup' => array('lang' => 'Can backup/restore database', 'cat' => 'misc'),
'acl_a_search' => array('lang' => 'Can manage search backends and settings', 'cat' => 'misc'),
'ACL_A_STYLES' => 'Can manage styles',
'ACL_A_EXTENSIONS' => 'Can manage extensions',
'ACL_A_VIEWLOGS' => 'Can view logs',
'ACL_A_CLEARLOGS' => 'Can clear logs',
'ACL_A_MODULES' => 'Can manage modules',
'ACL_A_LANGUAGE' => 'Can manage language packs',
'ACL_A_EMAIL' => 'Can send mass email',
'ACL_A_BOTS' => 'Can manage bots',
'ACL_A_REASONS' => 'Can manage report/denial reasons',
'ACL_A_BACKUP' => 'Can backup/restore database',
'ACL_A_SEARCH' => 'Can manage search backends and settings',
));

View File

@@ -332,7 +332,7 @@ $help = array(
),
array(
0 => 'Why isnt X feature available?',
1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added, or you want to report a bug, please visit the phpBB <a href="http://area51.phpbb.com/">Area51</a> website, where you will find resources to do so.'
1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added please visit the <a href="https://www.phpbb.com/ideas/">phpBB Ideas Centre</a>, where you can upvote existing ideas or suggest new features.'
),
array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',

View File

@@ -561,17 +561,8 @@ switch ($mode)
if ($member['user_sig'])
{
$member['user_sig'] = censor_text($member['user_sig']);
if ($member['user_sig_bbcode_bitfield'])
{
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
$bbcode = new bbcode();
$bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']);
}
$member['user_sig'] = bbcode_nl2br($member['user_sig']);
$member['user_sig'] = smiley_text($member['user_sig']);
$parse_flags = ($member['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true);
}
$poster_avatar = phpbb_get_user_avatar($member);

View File

@@ -93,7 +93,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
// Make sure getimagesize works...
if (function_exists('getimagesize'))
{
if (($width <= 0 || $height <= 0) && (($image_data = getimagesize($url)) === false))
if (($width <= 0 || $height <= 0) && (($image_data = @getimagesize($url)) === false))
{
$error[] = 'UNABLE_GET_IMAGE_SIZE';
return false;

View File

@@ -72,7 +72,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
),
),
'WHERE' => $this->db->sql_in_set('p.topic_id', $topic_ids) . '
AND ' . $this->content_visibility->get_visibility_sql('post', array(), 'p.') . '
AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . '
AND p.post_time >= ' . $min_post_time . '
AND u.user_id = p.poster_id',
'ORDER_BY' => 'p.post_time DESC',

View File

@@ -43,7 +43,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
function open()
{
$sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_type
$sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_posts_approved, t.topic_type
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . FORUMS_TABLE . ' f
ON (f.forum_id = t.forum_id)
@@ -60,7 +60,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
$this->forum_id = (int) $this->topic_data['forum_id'];
// Make sure topic is either approved or user authed
if (!$this->topic_data['topic_approved'] && !$this->auth->acl_get('m_approve', $this->forum_id))
if ($this->topic_data['topic_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $this->forum_id))
{
trigger_error('SORRY_AUTH_READ');
}

340
phpBB/phpbb/permissions.php Normal file
View File

@@ -0,0 +1,340 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}
class phpbb_permissions
{
/**
* Event dispatcher object
* @var phpbb_event_dispatcher
*/
protected $dispatcher;
/**
* User object
* @var phpbb_user
*/
protected $user;
/**
* Constructor
*
* @param phpbb_event_dispatcher $phpbb_dispatcher Event dispatcher
* @param phpbb_user $user User Object
* @return null
*/
public function __construct(phpbb_event_dispatcher $phpbb_dispatcher, phpbb_user $user)
{
$this->dispatcher = $phpbb_dispatcher;
$this->user = $user;
$categories = $this->categories;
$types = $this->types;
$permissions = $this->permissions;
/**
* Allows to specify additional permission categories, types and permissions
*
* @event core.permissions
* @var array types Array with permission types (a_, u_, m_, etc.)
* @var array categories Array with permission categories (pm, post, settings, misc, etc.)
* @var array permissions Array with permissions. Each Permission has the following layout:
* '<type><permission>' => array(
* 'lang' => 'Language Key with a Short description', // Optional, if not set,
* // the permissions identifier '<type><permission>' is used with
* // all uppercase.
* 'cat' => 'Identifier of the category, the permission should be displayed in',
* ),
* Example:
* 'u_viewprofile' => array(
* 'lang' => 'ACL_U_VIEWPROFILE',
* 'cat' => 'profile',
* ),
* @since 3.1-A1
*/
$vars = array('types', 'categories', 'permissions');
extract($phpbb_dispatcher->trigger_event('core.permissions', compact($vars)));
$this->categories = $categories;
$this->types = $types;
$this->permissions = $permissions;
}
/**
* Returns an array with all the permission categories (pm, post, settings, misc, etc.)
*
* @return array Layout: cat-identifier => Language key
*/
public function get_categories()
{
return $this->categories;
}
/**
* Returns the language string of a permission category
*
* @param string $category Identifier of the category
* @return string Language string
*/
public function get_category_lang($category)
{
return $this->user->lang($this->categories[$category]);
}
/**
* Returns an array with all the permission types (a_, u_, m_, etc.)
*
* @return array Layout: type-identifier => Language key
*/
public function get_types()
{
return $this->types;
}
/**
* Returns the language string of a permission type
*
* @param string $type Identifier of the type
* @param mixed $scope Scope of the type (should be 'global', 'local' or false)
* @return string Language string
*/
public function get_type_lang($type, $scope = false)
{
if ($scope && isset($this->types[$scope][$type]))
{
$lang_key = $this->types[$scope][$type];
}
else if (isset($this->types[$type]))
{
$lang_key = $this->types[$type];
}
else
{
$lang_key = 'ACL_TYPE_' . strtoupper(($scope) ? $scope . '_' . $type : $type);
}
return $this->user->lang($lang_key);
}
/**
* Returns an array with all the permissions.
* Each Permission has the following layout:
* '<type><permission>' => array(
* 'lang' => 'Language Key with a Short description', // Optional, if not set,
* // the permissions identifier '<type><permission>' is used with
* // all uppercase.
* 'cat' => 'Identifier of the category, the permission should be displayed in',
* ),
* Example:
* 'u_viewprofile' => array(
* 'lang' => 'ACL_U_VIEWPROFILE',
* 'cat' => 'profile',
* ),
*
* @return array
*/
public function get_permissions()
{
return $this->permissions;
}
/**
* Returns the category of a permission
*
* @param string $permission Identifier of the permission
* @return string Returns the category identifier of the permission
*/
public function get_permission_category($permission)
{
return (isset($this->permissions[$permission]['cat'])) ? $this->permissions[$permission]['cat'] : 'misc';
}
/**
* Returns the language string of a permission
*
* @param string $permission Identifier of the permission
* @return string Language string
*/
public function get_permission_lang($permission)
{
return (isset($this->permissions[$permission]['lang'])) ? $this->user->lang($this->permissions[$permission]['lang']) : $this->user->lang('ACL_' . strtoupper($permission));
}
protected $types = array(
'u_' => 'ACL_TYPE_U_',
'a_' => 'ACL_TYPE_A_',
'm_' => 'ACL_TYPE_M_',
'f_' => 'ACL_TYPE_F_',
'global' => array(
'm_' => 'ACL_TYPE_GLOBAL_M_',
),
);
protected $categories = array(
'actions' => 'ACL_CAT_ACTIONS',
'content' => 'ACL_CAT_CONTENT',
'forums' => 'ACL_CAT_FORUMS',
'misc' => 'ACL_CAT_MISC',
'permissions' => 'ACL_CAT_PERMISSIONS',
'pm' => 'ACL_CAT_PM',
'polls' => 'ACL_CAT_POLLS',
'post' => 'ACL_CAT_POST',
'post_actions' => 'ACL_CAT_POST_ACTIONS',
'posting' => 'ACL_CAT_POSTING',
'profile' => 'ACL_CAT_PROFILE',
'settings' => 'ACL_CAT_SETTINGS',
'topic_actions' => 'ACL_CAT_TOPIC_ACTIONS',
'user_group' => 'ACL_CAT_USER_GROUP',
);
protected $permissions = array(
// User Permissions
'u_viewprofile' => array('lang' => 'ACL_U_VIEWPROFILE', 'cat' => 'profile'),
'u_chgname' => array('lang' => 'ACL_U_CHGNAME', 'cat' => 'profile'),
'u_chgpasswd' => array('lang' => 'ACL_U_CHGPASSWD', 'cat' => 'profile'),
'u_chgemail' => array('lang' => 'ACL_U_CHGEMAIL', 'cat' => 'profile'),
'u_chgavatar' => array('lang' => 'ACL_U_CHGAVATAR', 'cat' => 'profile'),
'u_chggrp' => array('lang' => 'ACL_U_CHGGRP', 'cat' => 'profile'),
'u_chgprofileinfo' => array('lang' => 'ACL_U_CHGPROFILEINFO', 'cat' => 'profile'),
'u_attach' => array('lang' => 'ACL_U_ATTACH', 'cat' => 'post'),
'u_download' => array('lang' => 'ACL_U_DOWNLOAD', 'cat' => 'post'),
'u_savedrafts' => array('lang' => 'ACL_U_SAVEDRAFTS', 'cat' => 'post'),
'u_chgcensors' => array('lang' => 'ACL_U_CHGCENSORS', 'cat' => 'post'),
'u_sig' => array('lang' => 'ACL_U_SIG', 'cat' => 'post'),
'u_sendpm' => array('lang' => 'ACL_U_SENDPM', 'cat' => 'pm'),
'u_masspm' => array('lang' => 'ACL_U_MASSPM', 'cat' => 'pm'),
'u_masspm_group'=> array('lang' => 'ACL_U_MASSPM_GROUP', 'cat' => 'pm'),
'u_readpm' => array('lang' => 'ACL_U_READPM', 'cat' => 'pm'),
'u_pm_edit' => array('lang' => 'ACL_U_PM_EDIT', 'cat' => 'pm'),
'u_pm_delete' => array('lang' => 'ACL_U_PM_DELETE', 'cat' => 'pm'),
'u_pm_forward' => array('lang' => 'ACL_U_PM_FORWARD', 'cat' => 'pm'),
'u_pm_emailpm' => array('lang' => 'ACL_U_PM_EMAILPM', 'cat' => 'pm'),
'u_pm_printpm' => array('lang' => 'ACL_U_PM_PRINTPM', 'cat' => 'pm'),
'u_pm_attach' => array('lang' => 'ACL_U_PM_ATTACH', 'cat' => 'pm'),
'u_pm_download' => array('lang' => 'ACL_U_PM_DOWNLOAD', 'cat' => 'pm'),
'u_pm_bbcode' => array('lang' => 'ACL_U_PM_BBCODE', 'cat' => 'pm'),
'u_pm_smilies' => array('lang' => 'ACL_U_PM_SMILIES', 'cat' => 'pm'),
'u_pm_img' => array('lang' => 'ACL_U_PM_IMG', 'cat' => 'pm'),
'u_pm_flash' => array('lang' => 'ACL_U_PM_FLASH', 'cat' => 'pm'),
'u_sendemail' => array('lang' => 'ACL_U_SENDEMAIL', 'cat' => 'misc'),
'u_sendim' => array('lang' => 'ACL_U_SENDIM', 'cat' => 'misc'),
'u_ignoreflood' => array('lang' => 'ACL_U_IGNOREFLOOD', 'cat' => 'misc'),
'u_hideonline' => array('lang' => 'ACL_U_HIDEONLINE', 'cat' => 'misc'),
'u_viewonline' => array('lang' => 'ACL_U_VIEWONLINE', 'cat' => 'misc'),
'u_search' => array('lang' => 'ACL_U_SEARCH', 'cat' => 'misc'),
// Forum Permissions
'f_list' => array('lang' => 'ACL_F_LIST', 'cat' => 'actions'),
'f_read' => array('lang' => 'ACL_F_READ', 'cat' => 'actions'),
'f_search' => array('lang' => 'ACL_F_SEARCH', 'cat' => 'actions'),
'f_subscribe' => array('lang' => 'ACL_F_SUBSCRIBE', 'cat' => 'actions'),
'f_print' => array('lang' => 'ACL_F_PRINT', 'cat' => 'actions'),
'f_email' => array('lang' => 'ACL_F_EMAIL', 'cat' => 'actions'),
'f_bump' => array('lang' => 'ACL_F_BUMP', 'cat' => 'actions'),
'f_user_lock' => array('lang' => 'ACL_F_USER_LOCK', 'cat' => 'actions'),
'f_download' => array('lang' => 'ACL_F_DOWNLOAD', 'cat' => 'actions'),
'f_report' => array('lang' => 'ACL_F_REPORT', 'cat' => 'actions'),
'f_post' => array('lang' => 'ACL_F_POST', 'cat' => 'post'),
'f_sticky' => array('lang' => 'ACL_F_STICKY', 'cat' => 'post'),
'f_announce' => array('lang' => 'ACL_F_ANNOUNCE', 'cat' => 'post'),
'f_reply' => array('lang' => 'ACL_F_REPLY', 'cat' => 'post'),
'f_edit' => array('lang' => 'ACL_F_EDIT', 'cat' => 'post'),
'f_delete' => array('lang' => 'ACL_F_DELETE', 'cat' => 'post'),
'f_ignoreflood' => array('lang' => 'ACL_F_IGNOREFLOOD', 'cat' => 'post'),
'f_postcount' => array('lang' => 'ACL_F_POSTCOUNT', 'cat' => 'post'),
'f_noapprove' => array('lang' => 'ACL_F_NOAPPROVE', 'cat' => 'post'),
'f_attach' => array('lang' => 'ACL_F_ATTACH', 'cat' => 'content'),
'f_icons' => array('lang' => 'ACL_F_ICONS', 'cat' => 'content'),
'f_bbcode' => array('lang' => 'ACL_F_BBCODE', 'cat' => 'content'),
'f_flash' => array('lang' => 'ACL_F_FLASH', 'cat' => 'content'),
'f_img' => array('lang' => 'ACL_F_IMG', 'cat' => 'content'),
'f_sigs' => array('lang' => 'ACL_F_SIGS', 'cat' => 'content'),
'f_smilies' => array('lang' => 'ACL_F_SMILIES', 'cat' => 'content'),
'f_poll' => array('lang' => 'ACL_F_POLL', 'cat' => 'polls'),
'f_vote' => array('lang' => 'ACL_F_VOTE', 'cat' => 'polls'),
'f_votechg' => array('lang' => 'ACL_F_VOTECHG', 'cat' => 'polls'),
// Moderator Permissions
'm_edit' => array('lang' => 'ACL_M_EDIT', 'cat' => 'post_actions'),
'm_delete' => array('lang' => 'ACL_M_DELETE', 'cat' => 'post_actions'),
'm_approve' => array('lang' => 'ACL_M_APPROVE', 'cat' => 'post_actions'),
'm_report' => array('lang' => 'ACL_M_REPORT', 'cat' => 'post_actions'),
'm_chgposter' => array('lang' => 'ACL_M_CHGPOSTER', 'cat' => 'post_actions'),
'm_move' => array('lang' => 'ACL_M_MOVE', 'cat' => 'topic_actions'),
'm_lock' => array('lang' => 'ACL_M_LOCK', 'cat' => 'topic_actions'),
'm_split' => array('lang' => 'ACL_M_SPLIT', 'cat' => 'topic_actions'),
'm_merge' => array('lang' => 'ACL_M_MERGE', 'cat' => 'topic_actions'),
'm_info' => array('lang' => 'ACL_M_INFO', 'cat' => 'misc'),
'm_warn' => array('lang' => 'ACL_M_WARN', 'cat' => 'misc'),
'm_ban' => array('lang' => 'ACL_M_BAN', 'cat' => 'misc'),
// Admin Permissions
'a_board' => array('lang' => 'ACL_A_BOARD', 'cat' => 'settings'),
'a_server' => array('lang' => 'ACL_A_SERVER', 'cat' => 'settings'),
'a_jabber' => array('lang' => 'ACL_A_JABBER', 'cat' => 'settings'),
'a_phpinfo' => array('lang' => 'ACL_A_PHPINFO', 'cat' => 'settings'),
'a_forum' => array('lang' => 'ACL_A_FORUM', 'cat' => 'forums'),
'a_forumadd' => array('lang' => 'ACL_A_FORUMADD', 'cat' => 'forums'),
'a_forumdel' => array('lang' => 'ACL_A_FORUMDEL', 'cat' => 'forums'),
'a_prune' => array('lang' => 'ACL_A_PRUNE', 'cat' => 'forums'),
'a_icons' => array('lang' => 'ACL_A_ICONS', 'cat' => 'posting'),
'a_words' => array('lang' => 'ACL_A_WORDS', 'cat' => 'posting'),
'a_bbcode' => array('lang' => 'ACL_A_BBCODE', 'cat' => 'posting'),
'a_attach' => array('lang' => 'ACL_A_ATTACH', 'cat' => 'posting'),
'a_user' => array('lang' => 'ACL_A_USER', 'cat' => 'user_group'),
'a_userdel' => array('lang' => 'ACL_A_USERDEL', 'cat' => 'user_group'),
'a_group' => array('lang' => 'ACL_A_GROUP', 'cat' => 'user_group'),
'a_groupadd' => array('lang' => 'ACL_A_GROUPADD', 'cat' => 'user_group'),
'a_groupdel' => array('lang' => 'ACL_A_GROUPDEL', 'cat' => 'user_group'),
'a_ranks' => array('lang' => 'ACL_A_RANKS', 'cat' => 'user_group'),
'a_profile' => array('lang' => 'ACL_A_PROFILE', 'cat' => 'user_group'),
'a_names' => array('lang' => 'ACL_A_NAMES', 'cat' => 'user_group'),
'a_ban' => array('lang' => 'ACL_A_BAN', 'cat' => 'user_group'),
'a_viewauth' => array('lang' => 'ACL_A_VIEWAUTH', 'cat' => 'permissions'),
'a_authgroups' => array('lang' => 'ACL_A_AUTHGROUPS', 'cat' => 'permissions'),
'a_authusers' => array('lang' => 'ACL_A_AUTHUSERS', 'cat' => 'permissions'),
'a_fauth' => array('lang' => 'ACL_A_FAUTH', 'cat' => 'permissions'),
'a_mauth' => array('lang' => 'ACL_A_MAUTH', 'cat' => 'permissions'),
'a_aauth' => array('lang' => 'ACL_A_AAUTH', 'cat' => 'permissions'),
'a_uauth' => array('lang' => 'ACL_A_UAUTH', 'cat' => 'permissions'),
'a_roles' => array('lang' => 'ACL_A_ROLES', 'cat' => 'permissions'),
'a_switchperm' => array('lang' => 'ACL_A_SWITCHPERM', 'cat' => 'permissions'),
'a_styles' => array('lang' => 'ACL_A_STYLES', 'cat' => 'misc'),
'a_extensions' => array('lang' => 'ACL_A_EXTENSIONS', 'cat' => 'misc'),
'a_viewlogs' => array('lang' => 'ACL_A_VIEWLOGS', 'cat' => 'misc'),
'a_clearlogs' => array('lang' => 'ACL_A_CLEARLOGS', 'cat' => 'misc'),
'a_modules' => array('lang' => 'ACL_A_MODULES', 'cat' => 'misc'),
'a_language' => array('lang' => 'ACL_A_LANGUAGE', 'cat' => 'misc'),
'a_email' => array('lang' => 'ACL_A_EMAIL', 'cat' => 'misc'),
'a_bots' => array('lang' => 'ACL_A_BOTS', 'cat' => 'misc'),
'a_reasons' => array('lang' => 'ACL_A_REASONS', 'cat' => 'misc'),
'a_backup' => array('lang' => 'ACL_A_BACKUP', 'cat' => 'misc'),
'a_search' => array('lang' => 'ACL_A_SEARCH', 'cat' => 'misc'),
);
}

View File

@@ -1022,7 +1022,8 @@ class phpbb_session
{
include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
}
phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
$captcha_factory = new phpbb_captcha_factory();
$captcha_factory->garbage_collect($config['captcha_plugin']);
$sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
WHERE attempt_time < ' . (time() - (int) $config['ip_login_limit_time']);

View File

@@ -126,10 +126,14 @@ class phpbb_template_twig_lexer extends Twig_Lexer
{
$callback = function($matches)
{
// Remove any quotes that may have been used in different implementations
// E.g. DEFINE $TEST = 'blah' vs INCLUDE foo
// Replace {} with start/end to parse variables (' ~ TEST ~ '.html)
$matches[2] = str_replace(array('"', "'", '{', '}'), array('', '', "' ~ ", " ~ '"), $matches[2]);
// Remove matching quotes at the beginning/end if a statement;
// E.g. 'asdf'"' -> asdf'"
// E.g. "asdf'"" -> asdf'"
// E.g. 'asdf'" -> 'asdf'"
$matches[2] = preg_replace('#^([\'"])?(.+?)\1$#', '$2', $matches[2]);
// Replace template variables with start/end to parse variables (' ~ TEST ~ '.html)
$matches[2] = preg_replace('#{([a-zA-Z0-9_\.$]+)}#', "'~ \$1 ~'", $matches[2]);
// Surround the matches in single quotes ('' ~ TEST ~ '.html')
return "<!-- {$matches[1]} '{$matches[2]}' -->";
@@ -219,19 +223,20 @@ class phpbb_template_twig_lexer extends Twig_Lexer
{
$callback = function($matches)
{
$inner = $matches[2];
// Replace $TEST with definition.TEST
$matches[1] = preg_replace('#\s\$([a-zA-Z_0-9]+)#', ' definition.$1', $matches[1]);
$inner = preg_replace('#\s\$([a-zA-Z_0-9]+)#', ' definition.$1', $inner);
// Replace .test with test|length
$matches[1] = preg_replace('#\s\.([a-zA-Z_0-9\.]+)#', ' $1|length', $matches[1]);
$inner = preg_replace('#\s\.([a-zA-Z_0-9\.]+)#', ' $1|length', $inner);
return '<!-- IF' . $matches[1] . '-->';
return "<!-- {$matches[1]}IF{$inner}-->";
};
// Replace our "div by" with Twig's divisibleby (Twig does not like test names with spaces)
$code = preg_replace('# div by ([0-9]+)#', ' divisibleby($1)', $code);
return preg_replace_callback('#<!-- IF((.*)[\s][\$|\.|!]([^\s]+)(.*))-->#', $callback, $code);
return preg_replace_callback('#<!-- (ELSE)?IF((.*)[\s][\$|\.|!]([^\s]+)(.*))-->#', $callback, $code);
}
/**

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_template_twig_node_includeasset extends Twig_Node
abstract class phpbb_template_twig_node_includeasset extends Twig_Node
{
/** @var Twig_Environment */
protected $environment;
@@ -57,4 +57,19 @@ class phpbb_template_twig_node_includeasset extends Twig_Node
->raw("\n');\n")
;
}
/**
* Get the definition name
*
* @return string (e.g. 'SCRIPTS')
*/
abstract public function get_definition_name();
/**
* Append the output code for the asset
*
* @param Twig_Compiler A Twig_Compiler instance
* @return null
*/
abstract protected function append_asset(Twig_Compiler $compiler);
}

View File

@@ -9,16 +9,17 @@
class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset
{
/**
* {@inheritdoc}
*/
public function get_definition_name()
{
return 'STYLESHEETS';
}
/**
* Compiles the node to PHP.
*
* @param Twig_Compiler A Twig_Compiler instance
*/
* {@inheritdoc}
*/
public function append_asset(Twig_Compiler $compiler)
{
$compiler

View File

@@ -9,16 +9,17 @@
class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includeasset
{
/**
* {@inheritdoc}
*/
public function get_definition_name()
{
return 'SCRIPTS';
}
/**
* Compiles the node to PHP.
*
* @param Twig_Compiler A Twig_Compiler instance
*/
* {@inheritdoc}
*/
protected function append_asset(Twig_Compiler $compiler)
{
$config = $this->environment->get_phpbb_config();

View File

@@ -147,7 +147,7 @@ else
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
{
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
$captcha->init(CONFIRM_REPORT);
}
@@ -157,10 +157,13 @@ $s_hidden_fields = '';
// Submit report?
if ($submit && $reason_id)
{
$visual_confirmation_response = $captcha->validate();
if ($visual_confirmation_response)
if (isset($captcha))
{
$error[] = $visual_confirmation_response;
$visual_confirmation_response = $captcha->validate();
if ($visual_confirmation_response)
{
$error[] = $visual_confirmation_response;
}
}
$sql = 'SELECT *

View File

@@ -366,7 +366,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = "SELECT p.post_id
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
WHERE t.topic_replies = 0
WHERE t.topic_posts_approved = 1
AND p.topic_id = t.topic_id
$last_post_time
AND $m_approve_posts_fid_sql
@@ -378,7 +378,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql = 'SELECT DISTINCT ' . $sort_by_sql[$sort_key] . ", p.topic_id
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
WHERE t.topic_replies = 0
WHERE t.topic_posts_approved = 1
AND t.topic_moved_id = 0
AND p.topic_id = t.topic_id
$last_post_time
@@ -687,6 +687,18 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
/**
* Event to modify the SQL query before the topic data is retrieved
*
* @event core.search_get_topic_data
* @var string sql_select The SQL SELECT string used by search to get topic data
* @var string sql_from The SQL FROM string used by search to get topic data
* @var string sql_where The SQL WHERE string used by search to get topic data
* @since 3.1-A1
*/
$vars = array('sql_select', 'sql_from', 'sql_where');
extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars)));
$sql = "SELECT $sql_select
FROM $sql_from
WHERE $sql_where";
@@ -989,7 +1001,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
);
}
$template->assign_block_vars('searchresults', array_merge($tpl_ary, array(
$tpl_ary = array_merge($tpl_ary, array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $result_topic_id,
'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false,
@@ -1001,9 +1013,22 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . (($u_hilit) ? '&amp;hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '',
));
/**
* Modify the topic data before it is assigned to the template
*
* @event core.search_modify_tpl_ary
* @var array row Array with topic data
* @var array tpl_ary Template block array with topic data
* @since 3.1-A1
*/
$vars = array('row', 'tpl_ary');
extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
$template->assign_block_vars('searchresults', $tpl_ary);
if ($show_results == 'topics')
{
phpbb_generate_template_pagination($template, $view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);

View File

@@ -301,7 +301,7 @@ function colorPalette(dir, width, height) {
var r = 0,
g = 0,
b = 0,
numberList = new Array(6);
numberList = new Array(6),
color = '',
html = '';

View File

@@ -63,6 +63,7 @@
<dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{searchresults.TOPIC_FOLDER_IMG_ALT}">
<div class="list-inner">
<!-- EVENT topiclist_row_prepend -->
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
<a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
<!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
@@ -83,6 +84,7 @@
</div>
<!-- ENDIF -->
{L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} &raquo; {searchresults.FIRST_POST_TIME} &raquo; {L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a>
<!-- EVENT topiclist_row_append -->
</div>
</dt>

View File

@@ -144,6 +144,7 @@
<dl class="icon {topicrow.TOPIC_IMG_STYLE}">
<dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
<div class="list-inner">
<!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_DELETED --><a href="{topicrow.U_MCP_QUEUE}">{DELETED_IMG}</a> <!-- ENDIF -->
@@ -164,6 +165,7 @@
<!-- ENDIF -->
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
<!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --> &raquo; {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
<!-- EVENT topiclist_row_append -->
</div>
</dt>
<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>

View File

@@ -758,6 +758,10 @@ p.rules a {
clear: both;
}
#notification_list ul li:before, #notification_list ul li:after {
display: none;
}
#notification_list > .header {
padding: 0 10px;
font-family: Arial, "Helvetica Neue", Helvetica, Arial, sans-serif;

View File

@@ -154,8 +154,8 @@ function marklist(id, name, state)
<table width="100%" cellspacing="0">
<tr>
<td class="genmed">
<!-- IF S_NOTIFICATIONS_DISPLAY -->
[ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button">{NOTIFICATIONS_COUNT}</a> ] &bull;
<!-- IF S_NOTIFICATIONS_DISPLAY and not S_IS_BOT and S_USER_LOGGED_IN -->
[ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button">{NOTIFICATIONS_COUNT}</a> ]&nbsp;
<div id="notification_list" class="notification_list">
<div class="row1 header">
{L_NOTIFICATIONS}

View File

@@ -34,6 +34,7 @@
<!-- ENDIF -->
</td>
<td class="row1">
<!-- EVENT topiclist_row_prepend -->
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{searchresults.ATTACH_ICON_IMG} <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a>
<!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED -->
@@ -58,6 +59,7 @@
] </p>
<!-- ENDIF -->
<p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p>
<!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="100" align="center"><p class="topicauthor">{searchresults.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_REPLIES}</p></td>

View File

@@ -40,6 +40,7 @@
<td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
<!-- ENDIF -->
<td class="row1">
<!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
@@ -63,6 +64,7 @@
<!-- END pagination -->
] </p>
<!-- ENDIF -->
<!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
@@ -203,6 +205,7 @@
<td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
<!-- ENDIF -->
<td class="row1">
<!-- EVENT topiclist_row_prepend -->
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
@@ -227,6 +230,7 @@
] </p>
<!-- ENDIF -->
<!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><p class="gensmall">{L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></p><!-- ENDIF -->
<!-- EVENT topiclist_row_append -->
</td>
<td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>

View File

@@ -372,6 +372,16 @@ $sql_array = array(
'LEFT_JOIN' => array(),
);
/**
* Event to modify the SQL query before the topic data is retrieved
*
* @event core.viewforum_get_topic_data
* @var array sql_array The SQL array to get the data of all topics
* @since 3.1-A1
*/
$vars = array('sql_array');
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars)));
$sql_approved = ' AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.');
if ($user->data['is_registered'])
@@ -554,6 +564,17 @@ if (sizeof($shadow_topic_list))
$sql = 'SELECT *
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
/**
* Event to modify the SQL query before the shadowtopic data is retrieved
*
* @event core.viewforum_get_shadowtopic_data
* @var string sql The SQL string to get the data of any shadowtopics
* @since 3.1-A1
*/
$vars = array('sql');
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars)));
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))

View File

@@ -832,39 +832,14 @@ if (!empty($topic_data['poll_start']))
$poll_total += $poll_option['poll_option_total'];
}
if ($poll_info[0]['bbcode_bitfield'])
{
$poll_bbcode = new bbcode();
}
else
{
$poll_bbcode = false;
}
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
{
$poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
if ($poll_bbcode !== false)
{
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
}
$poll_info[$i]['poll_option_text'] = bbcode_nl2br($poll_info[$i]['poll_option_text']);
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
$poll_info[$i]['poll_option_text'] = generate_text_for_display($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield'], $parse_flags, true);
}
$topic_data['poll_title'] = censor_text($topic_data['poll_title']);
if ($poll_bbcode !== false)
{
$poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
}
$topic_data['poll_title'] = bbcode_nl2br($topic_data['poll_title']);
$topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
unset($poll_bbcode);
$topic_data['poll_title'] = generate_text_for_display($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield'], $parse_flags, true);
foreach ($poll_info as $poll_option)
{
@@ -1406,29 +1381,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
// End signature parsing, only if needed
if ($user_cache[$poster_id]['sig'] && $row['enable_sig'] && empty($user_cache[$poster_id]['sig_parsed']))
{
$user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
}
$user_cache[$poster_id]['sig'] = bbcode_nl2br($user_cache[$poster_id]['sig']);
$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
$user_cache[$poster_id]['sig_parsed'] = true;
$parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true);
}
// Parse the message and subject
$message = censor_text($row['post_text']);
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = bbcode_nl2br($message);
$message = smiley_text($message);
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);
if (!empty($attachments[$row['post_id']]))
{