Line 35 | Line 35 |
---|
}
global $user_id;
|
}
global $user_id;
|
return ($user_id) ? "&u=$user_id" : '';
| return phpbb_extra_url();
|
}
function phpbb_module_warn_url($mode, $module_row)
| }
function phpbb_module_warn_url($mode, $module_row)
|
Line 43 | Line 43 |
---|
if ($mode == 'front' || $mode == 'list') { global $forum_id;
|
if ($mode == 'front' || $mode == 'list') { global $forum_id;
|
return ($forum_id) ? "&f=$forum_id" : '';
| return phpbb_extra_url();
|
}
if ($mode == 'warn_post') { global $forum_id, $post_id;
|
}
if ($mode == 'warn_post') { global $forum_id, $post_id;
|
$url_extra = ($forum_id) ? "&f=$forum_id" : ''; $url_extra .= ($post_id) ? "&p=$post_id" : '';
return $url_extra;
| return phpbb_extra_url();
|
} else { global $user_id;
|
} else { global $user_id;
|
return ($user_id) ? "&u=$user_id" : '';
| return phpbb_extra_url();
|
} }
| } }
|
Line 89 | Line 83 |
---|
return phpbb_extra_url(); }
|
return phpbb_extra_url(); }
|
function phpbb_extra_url()
| /** * Generate URL parameters for MCP modules * * @param array $additional_parameters Array with additional parameters in format of ['key' => 'parameter_name'] * * @return string String with URL parameters (empty string if not any) */ function phpbb_extra_url($additional_parameters = [])
|
{
|
{
|
global $forum_id, $topic_id, $post_id, $report_id, $user_id;
| $url_extra = []; $url_parameters = array_merge([ 'f' => 'forum_id', 't' => 'topic_id', 'p' => 'post_id', 'r' => 'report_id', 'u' => 'user_id', ], $additional_parameters);
|
|
|
$url_extra = ''; $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; $url_extra .= ($topic_id) ? "&t=$topic_id" : ''; $url_extra .= ($post_id) ? "&p=$post_id" : ''; $url_extra .= ($user_id) ? "&u=$user_id" : ''; $url_extra .= ($report_id) ? "&r=$report_id" : '';
| foreach ($url_parameters as $key => $value) { global $$value; if (isset($$value) && $parameter = $$value) { $url_extra[] = "$key=$parameter"; } }
|
|
|
return $url_extra;
| return implode('&', $url_extra);
|
}
/**
| }
/**
|
Line 197 | Line 207 |
---|
*/ function phpbb_get_post_data($post_ids, $acl_list = false, $read_tracking = false) {
|
*/ function phpbb_get_post_data($post_ids, $acl_list = false, $read_tracking = false) {
|
global $db, $auth, $config, $user, $phpbb_container;
| global $db, $auth, $config, $user, $phpbb_dispatcher, $phpbb_container;
|
$rowset = array();
| $rowset = array();
|
Line 264 | Line 274 |
---|
$rowset[$row['post_id']] = $row; } $db->sql_freeresult($result);
|
$rowset[$row['post_id']] = $row; } $db->sql_freeresult($result);
|
| /** * This event allows you to modify post data displayed in the MCP * * @event core.mcp_get_post_data_after * @var array post_ids Array with post ids that have been fetched * @var mixed acl_list Either false or an array with permission strings to check * @var bool read_tracking Whether or not to take last mark read time into account * @var array rowset The array of posts to be returned * @since 3.2.10-RC1 * @since 3.3.1-RC1 */ $vars = [ 'post_ids', 'acl_list', 'read_tracking', 'rowset', ]; extract($phpbb_dispatcher->trigger_event('core.mcp_get_post_data_after', compact($vars)));
|
return $rowset; }
| return $rowset; }
|
Line 364 | Line 393 |
---|
/** * sorting in mcp *
|
/** * sorting in mcp *
|
* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
| * $where_sql should either be WHERE (default if ommited) or end with AND or OR
|
* * $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table * $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
| * * $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table * $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
|
Line 665 | Line 694 |
---|
* @param string $table The table to find the ids in * @param string $sql_id The ids relevant column name * @param array $acl_list A list of permissions the user need to have
|
* @param string $table The table to find the ids in * @param string $sql_id The ids relevant column name * @param array $acl_list A list of permissions the user need to have
|
* @param mixed $singe_forum Limit to one forum id (int) or the first forum found (true)
| * @param mixed $single_forum Limit to one forum id (int) or the first forum found (true)
|
* * @return mixed False if no ids were able to be retrieved, true if at least one id left. * Additionally, this value can be the forum_id assigned if $single_forum was set.
| * * @return mixed False if no ids were able to be retrieved, true if at least one id left. * Additionally, this value can be the forum_id assigned if $single_forum was set.
|