Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/12612] Prefix check_ids() with phpbb_
  [ticket/12612] Prefix mcp_sorting() with phpbb_
  [ticket/12612] Prefix get_*_data() with phpbb_ and delete unused global
  [ticket/12612] Prefix module url functions with phpbb_
  [ticket/12612] Prefix upload_popup() with phpbb_
  [ticket/12612] Prefix handle_post_delete() with phpbb and remove unused global
  [ticket/12612] Prefix custom UCP module function with phpbb_
  [ticket/12612] Prefix _sort_last_active() with phpbb_
  [ticket/12612] Prefix show_profile() with phpbb and delete unused global
This commit is contained in:
Nils Adermann 2014-06-24 01:24:45 -04:00
commit 10d963a94e
16 changed files with 109 additions and 97 deletions

View file

@ -1448,9 +1448,9 @@ function phpbb_gen_download_links($param_key, $param_val, $phpbb_root_path, $php
/** /**
* Prepare profile data * Prepare profile data
*/ */
function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false) function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
{ {
global $config, $auth, $template, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher; global $config, $auth, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher;
$username = $data['username']; $username = $data['username'];
$user_id = $data['user_id']; $user_id = $data['user_id'];
@ -1588,7 +1588,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
return $template_data; return $template_data;
} }
function _sort_last_active($first, $second) function phpbb_sort_last_active($first, $second)
{ {
global $id_cache, $sort_dir; global $id_cache, $sort_dir;

View file

@ -22,12 +22,12 @@ if (!defined('IN_PHPBB'))
/** /**
* Functions used to generate additional URL paramters * Functions used to generate additional URL paramters
*/ */
function _module__url($mode, &$module_row) function phpbb_module__url($mode, &$module_row)
{ {
return extra_url(); return phpbb_extra_url();
} }
function _module_notes_url($mode, &$module_row) function phpbb_module_notes_url($mode, &$module_row)
{ {
if ($mode == 'front') if ($mode == 'front')
{ {
@ -38,7 +38,7 @@ function _module_notes_url($mode, &$module_row)
return ($user_id) ? "&u=$user_id" : ''; return ($user_id) ? "&u=$user_id" : '';
} }
function _module_warn_url($mode, &$module_row) function phpbb_module_warn_url($mode, &$module_row)
{ {
if ($mode == 'front' || $mode == 'list') if ($mode == 'front' || $mode == 'list')
{ {
@ -64,32 +64,32 @@ function _module_warn_url($mode, &$module_row)
} }
} }
function _module_main_url($mode, &$module_row) function phpbb_module_main_url($mode, &$module_row)
{ {
return extra_url(); return phpbb_extra_url();
} }
function _module_logs_url($mode, &$module_row) function phpbb_module_logs_url($mode, &$module_row)
{ {
return extra_url(); return phpbb_extra_url();
} }
function _module_ban_url($mode, &$module_row) function phpbb_module_ban_url($mode, &$module_row)
{ {
return extra_url(); return phpbb_extra_url();
} }
function _module_queue_url($mode, &$module_row) function phpbb_module_queue_url($mode, &$module_row)
{ {
return extra_url(); return phpbb_extra_url();
} }
function _module_reports_url($mode, &$module_row) function phpbb_module_reports_url($mode, &$module_row)
{ {
return extra_url(); return phpbb_extra_url();
} }
function extra_url() function phpbb_extra_url()
{ {
global $forum_id, $topic_id, $post_id, $report_id, $user_id; global $forum_id, $topic_id, $post_id, $report_id, $user_id;
@ -106,7 +106,7 @@ function extra_url()
/** /**
* Get simple topic data * Get simple topic data
*/ */
function get_topic_data($topic_ids, $acl_list = false, $read_tracking = false) function phpbb_get_topic_data($topic_ids, $acl_list = false, $read_tracking = false)
{ {
global $auth, $db, $config, $user; global $auth, $db, $config, $user;
static $rowset = array(); static $rowset = array();
@ -195,7 +195,7 @@ function get_topic_data($topic_ids, $acl_list = false, $read_tracking = false)
/** /**
* Get simple post data * Get simple post data
*/ */
function 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; global $db, $auth, $config, $user;
@ -269,7 +269,7 @@ function get_post_data($post_ids, $acl_list = false, $read_tracking = false)
/** /**
* Get simple forum data * Get simple forum data
*/ */
function get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false) function phpbb_get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false)
{ {
global $auth, $db, $user, $config, $phpbb_container; global $auth, $db, $user, $config, $phpbb_container;
@ -322,9 +322,9 @@ function get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking = false)
/** /**
* Get simple pm data * Get simple pm data
*/ */
function get_pm_data($pm_ids) function phpbb_get_pm_data($pm_ids)
{ {
global $db, $auth, $config, $user; global $db;
$rowset = array(); $rowset = array();
@ -366,7 +366,7 @@ function get_pm_data($pm_ids)
* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report 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 * $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
*/ */
function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE') function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
{ {
global $db, $user, $auth, $template; global $db, $user, $auth, $template;
@ -594,7 +594,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
* Additionally, this value can be the forum_id assigned if $single_forum was set. * Additionally, this value can be the forum_id assigned if $single_forum was set.
* Therefore checking the result for with !== false is the best method. * Therefore checking the result for with !== false is the best method.
*/ */
function check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = false) function phpbb_check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = false)
{ {
global $db, $auth; global $db, $auth;

View file

@ -250,13 +250,25 @@ class p_master
// Function for building 'url_extra' // Function for building 'url_extra'
$short_name = $this->get_short_name($row['module_basename']); $short_name = $this->get_short_name($row['module_basename']);
$url_func = '_module_' . $short_name . '_url'; $url_func = 'phpbb_module_' . $short_name . '_url';
if (!function_exists($url_func))
{
$url_func = '_module_' . $short_name . '_url';
}
// Function for building the language name // Function for building the language name
$lang_func = '_module_' . $short_name . '_lang'; $lang_func = 'phpbb_module_' . $short_name . '_lang';
if (!function_exists($lang_func))
{
$lang_func = '_module_' . $short_name . '_lang';
}
// Custom function for calling parameters on module init (for example assigning template variables) // Custom function for calling parameters on module init (for example assigning template variables)
$custom_func = '_module_' . $short_name; $custom_func = 'phpbb_module_' . $short_name;
if (!function_exists($custom_func))
{
$custom_func = '_module_' . $short_name;
}
$names[$row['module_basename'] . '_' . $row['module_mode']][] = true; $names[$row['module_basename'] . '_' . $row['module_mode']][] = true;

View file

@ -2489,7 +2489,7 @@ function phpbb_bump_topic($forum_id, $topic_id, $post_data, $bump_time = false)
/** /**
* Show upload popup (progress bar) * Show upload popup (progress bar)
*/ */
function upload_popup($forum_style = 0) function phpbb_upload_popup($forum_style = 0)
{ {
global $template, $user; global $template, $user;
@ -2514,9 +2514,9 @@ function upload_popup($forum_style = 0)
/** /**
* Do the various checks required for removing posts as well as removing it * Do the various checks required for removing posts as well as removing it
*/ */
function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $soft_delete_reason = '') function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $soft_delete_reason = '')
{ {
global $user, $db, $auth, $config, $request; global $user, $auth, $config, $request;
global $phpbb_root_path, $phpEx; global $phpbb_root_path, $phpEx;
$perm_check = ($is_soft) ? 'softdelete' : 'delete'; $perm_check = ($is_soft) ? 'softdelete' : 'delete';

View file

@ -3549,7 +3549,7 @@ function phpbb_get_banned_user_ids($user_ids = array(), $ban_end = true)
/** /**
* Function for assigning a template var if the zebra module got included * Function for assigning a template var if the zebra module got included
*/ */
function _module_zebra($mode, &$module_row) function phpbb_module_zebra($mode, &$module_row)
{ {
global $template; global $template;

View file

@ -185,7 +185,7 @@ class mcp_ban
} }
else if ($post_id) else if ($post_id)
{ {
$post_info = get_post_data($post_id, 'm_ban'); $post_info = phpbb_get_post_data($post_id, 'm_ban');
if (sizeof($post_info) && !empty($post_info[$post_id])) if (sizeof($post_info) && !empty($post_info[$post_id]))
{ {

View file

@ -102,7 +102,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$sort_days = $total = 0; $sort_days = $total = 0;
$sort_key = $sort_dir = ''; $sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array(); $sort_by_sql = $sort_order_sql = array();
mcp_sorting('viewforum', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id); phpbb_mcp_sorting('viewforum', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id);
$forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
@ -328,7 +328,7 @@ function mcp_resync_topics($topic_ids)
trigger_error('NO_TOPIC_SELECTED'); trigger_error('NO_TOPIC_SELECTED');
} }
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{ {
return; return;
} }
@ -380,7 +380,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$sync_topics = array_merge($topic_ids, array($to_topic_id)); $sync_topics = array_merge($topic_ids, array($to_topic_id));
$topic_data = get_topic_data($sync_topics, 'm_merge'); $topic_data = phpbb_get_topic_data($sync_topics, 'm_merge');
if (!sizeof($topic_data) || empty($topic_data[$to_topic_id])) if (!sizeof($topic_data) || empty($topic_data[$to_topic_id]))
{ {
@ -420,7 +420,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
return; return;
} }
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge'))) if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
{ {
return; return;
} }

View file

@ -187,7 +187,7 @@ class mcp_main
$forum_id = request_var('f', 0); $forum_id = request_var('f', 0);
$forum_info = get_forum_data($forum_id, 'm_', true); $forum_info = phpbb_get_forum_data($forum_id, 'm_', true);
if (!sizeof($forum_info)) if (!sizeof($forum_info))
{ {
@ -252,7 +252,7 @@ function lock_unlock($action, $ids)
$orig_ids = $ids; $orig_ids = $ids;
if (!check_ids($ids, $table, $sql_id, array('m_lock'))) if (!phpbb_check_ids($ids, $table, $sql_id, array('m_lock')))
{ {
// Make sure that for f_user_lock only the lock action is triggered. // Make sure that for f_user_lock only the lock action is triggered.
if ($action != 'lock') if ($action != 'lock')
@ -262,7 +262,7 @@ function lock_unlock($action, $ids)
$ids = $orig_ids; $ids = $orig_ids;
if (!check_ids($ids, $table, $sql_id, array('f_user_lock'))) if (!phpbb_check_ids($ids, $table, $sql_id, array('f_user_lock')))
{ {
return; return;
} }
@ -286,7 +286,7 @@ function lock_unlock($action, $ids)
WHERE ' . $db->sql_in_set($sql_id, $ids); WHERE ' . $db->sql_in_set($sql_id, $ids);
$db->sql_query($sql); $db->sql_query($sql);
$data = ($action == 'lock' || $action == 'unlock') ? get_topic_data($ids) : get_post_data($ids); $data = ($action == 'lock' || $action == 'unlock') ? phpbb_get_topic_data($ids) : phpbb_get_post_data($ids);
foreach ($data as $id => $row) foreach ($data as $id => $row)
{ {
@ -346,7 +346,7 @@ function change_topic_type($action, $topic_ids)
break; break;
} }
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true); $forum_id = phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true);
if ($forum_id === false) if ($forum_id === false)
{ {
@ -388,7 +388,7 @@ function change_topic_type($action, $topic_ids)
if (sizeof($topic_ids)) if (sizeof($topic_ids))
{ {
$data = get_topic_data($topic_ids); $data = phpbb_get_topic_data($topic_ids);
foreach ($data as $topic_id => $row) foreach ($data as $topic_id => $row)
{ {
@ -422,7 +422,7 @@ function mcp_move_topic($topic_ids)
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
// Here we limit the operation to one forum only // Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true); $forum_id = phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
if ($forum_id === false) if ($forum_id === false)
{ {
@ -442,7 +442,7 @@ function mcp_move_topic($topic_ids)
if ($to_forum_id) if ($to_forum_id)
{ {
$forum_data = get_forum_data($to_forum_id, 'f_post'); $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');
if (!sizeof($forum_data)) if (!sizeof($forum_data))
{ {
@ -479,7 +479,7 @@ function mcp_move_topic($topic_ids)
if (confirm_box(true)) if (confirm_box(true))
{ {
$topic_data = get_topic_data($topic_ids); $topic_data = phpbb_get_topic_data($topic_ids);
$leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false; $leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false;
$forum_sync_data = array(); $forum_sync_data = array();
@ -677,7 +677,7 @@ function mcp_restore_topic($topic_ids)
{ {
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve'))) if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve')))
{ {
return; return;
} }
@ -697,7 +697,7 @@ function mcp_restore_topic($topic_ids)
{ {
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS'; $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS';
$data = get_topic_data($topic_ids); $data = phpbb_get_topic_data($topic_ids);
$phpbb_content_visibility = $phpbb_container->get('content.visibility'); $phpbb_content_visibility = $phpbb_container->get('content.visibility');
foreach ($data as $topic_id => $row) foreach ($data as $topic_id => $row)
@ -750,7 +750,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
{ {
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete'))) if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
{ {
return; return;
} }
@ -770,7 +770,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
{ {
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS'; $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS';
$data = get_topic_data($topic_ids); $data = phpbb_get_topic_data($topic_ids);
foreach ($data as $topic_id => $row) foreach ($data as $topic_id => $row)
{ {
@ -878,7 +878,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
{ {
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container; global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
if (!check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_softdelete'))) if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_softdelete')))
{ {
return; return;
} }
@ -896,7 +896,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
if (confirm_box(true) && $is_soft) if (confirm_box(true) && $is_soft)
{ {
$post_info = get_post_data($post_ids); $post_info = phpbb_get_post_data($post_ids);
$topic_info = $approve_log = array(); $topic_info = $approve_log = array();
@ -984,7 +984,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
$affected_topics = sizeof($topic_id_list); $affected_topics = sizeof($topic_id_list);
$db->sql_freeresult($result); $db->sql_freeresult($result);
$post_data = get_post_data($post_ids); $post_data = phpbb_get_post_data($post_ids);
foreach ($post_data as $id => $row) foreach ($post_data as $id => $row)
{ {
@ -1105,7 +1105,7 @@ function mcp_fork_topic($topic_ids)
global $auth, $user, $db, $template, $config; global $auth, $user, $db, $template, $config;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{ {
return; return;
} }
@ -1124,7 +1124,7 @@ function mcp_fork_topic($topic_ids)
if ($to_forum_id) if ($to_forum_id)
{ {
$forum_data = get_forum_data($to_forum_id, 'f_post'); $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post');
if (!sizeof($topic_ids)) if (!sizeof($topic_ids))
{ {
@ -1161,7 +1161,7 @@ function mcp_fork_topic($topic_ids)
if (confirm_box(true)) if (confirm_box(true))
{ {
$topic_data = get_topic_data($topic_ids, 'f_post'); $topic_data = phpbb_get_topic_data($topic_ids, 'f_post');
$total_topics = $total_topics_unapproved = $total_topics_softdeleted = 0; $total_topics = $total_topics_unapproved = $total_topics_softdeleted = 0;
$total_posts = $total_posts_unapproved = $total_posts_softdeleted = 0; $total_posts = $total_posts_unapproved = $total_posts_softdeleted = 0;

View file

@ -100,7 +100,7 @@ class mcp_pm_reports
$pm_id = $report['pm_id']; $pm_id = $report['pm_id'];
$report_id = $report['report_id']; $report_id = $report['report_id'];
$pm_info = get_pm_data(array($pm_id)); $pm_info = phpbb_get_pm_data(array($pm_id));
if (!sizeof($pm_info)) if (!sizeof($pm_info))
{ {
@ -216,7 +216,7 @@ class mcp_pm_reports
$sort_days = $total = 0; $sort_days = $total = 0;
$sort_key = $sort_dir = ''; $sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array(); $sort_by_sql = $sort_order_sql = array();
mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total); phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total);
$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';

View file

@ -33,7 +33,7 @@ function mcp_post_details($id, $mode, $action)
$start = request_var('start', 0); $start = request_var('start', 0);
// Get post data // Get post data
$post_info = get_post_data(array($post_id), false, true); $post_info = phpbb_get_post_data(array($post_id), false, true);
add_form_key('mcp_post_details'); add_form_key('mcp_post_details');
@ -43,7 +43,7 @@ function mcp_post_details($id, $mode, $action)
} }
$post_info = $post_info[$post_id]; $post_info = $post_info[$post_id];
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
switch ($action) switch ($action)
{ {
@ -508,7 +508,7 @@ function change_poster(&$post_info, $userdata)
$to_username = $userdata['username']; $to_username = $userdata['username'];
// Renew post info // Renew post info
$post_info = get_post_data(array($post_id), false, true); $post_info = phpbb_get_post_data(array($post_id), false, true);
if (!sizeof($post_info)) if (!sizeof($post_info))
{ {

View file

@ -159,7 +159,7 @@ class mcp_queue
if ($topic_id) if ($topic_id)
{ {
$topic_info = get_topic_data(array($topic_id), 'm_approve'); $topic_info = phpbb_get_topic_data(array($topic_id), 'm_approve');
if (isset($topic_info[$topic_id]['topic_first_post_id'])) if (isset($topic_info[$topic_id]['topic_first_post_id']))
{ {
$post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; $post_id = (int) $topic_info[$topic_id]['topic_first_post_id'];
@ -174,7 +174,7 @@ class mcp_queue
$phpbb_notifications->mark_notifications_read('post_in_queue', $post_id, $user->data['user_id']); $phpbb_notifications->mark_notifications_read('post_in_queue', $post_id, $user->data['user_id']);
$post_info = get_post_data(array($post_id), 'm_approve', true); $post_info = phpbb_get_post_data(array($post_id), 'm_approve', true);
if (!sizeof($post_info)) if (!sizeof($post_info))
{ {
@ -343,7 +343,7 @@ class mcp_queue
if ($topic_id) if ($topic_id)
{ {
$topic_info = get_topic_data(array($topic_id)); $topic_info = phpbb_get_topic_data(array($topic_id));
if (!sizeof($topic_info)) if (!sizeof($topic_info))
{ {
@ -389,7 +389,7 @@ class mcp_queue
} }
else else
{ {
$forum_info = get_forum_data(array($forum_id), $m_perm); $forum_info = phpbb_get_forum_data(array($forum_id), $m_perm);
if (!sizeof($forum_info)) if (!sizeof($forum_info))
{ {
@ -409,7 +409,7 @@ class mcp_queue
$sort_days = $total = 0; $sort_days = $total = 0;
$sort_key = $sort_dir = ''; $sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array(); $sort_by_sql = $sort_order_sql = array();
mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
@ -572,7 +572,7 @@ class mcp_queue
global $db, $template, $user, $config, $request, $phpbb_container; global $db, $template, $user, $config, $request, $phpbb_container;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{ {
trigger_error('NOT_AUTHORISED'); trigger_error('NOT_AUTHORISED');
} }
@ -591,7 +591,7 @@ class mcp_queue
'redirect' => $redirect, 'redirect' => $redirect,
)); ));
$post_info = get_post_data($post_id_list, 'm_approve'); $post_info = phpbb_get_post_data($post_id_list, 'm_approve');
if (confirm_box(true)) if (confirm_box(true))
{ {
@ -795,7 +795,7 @@ class mcp_queue
global $db, $template, $user, $config; global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path, $request, $phpbb_container; global $phpEx, $phpbb_root_path, $request, $phpbb_container;
if (!check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve'))) if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
{ {
trigger_error('NOT_AUTHORISED'); trigger_error('NOT_AUTHORISED');
} }
@ -813,7 +813,7 @@ class mcp_queue
'redirect' => $redirect, 'redirect' => $redirect,
)); ));
$topic_info = get_topic_data($topic_id_list, 'm_approve'); $topic_info = phpbb_get_topic_data($topic_id_list, 'm_approve');
if (confirm_box(true)) if (confirm_box(true))
{ {
@ -964,7 +964,7 @@ class mcp_queue
global $db, $template, $user, $config, $phpbb_container; global $db, $template, $user, $config, $phpbb_container;
global $phpEx, $phpbb_root_path, $request; global $phpEx, $phpbb_root_path, $request;
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{ {
trigger_error('NOT_AUTHORISED'); trigger_error('NOT_AUTHORISED');
} }
@ -1016,7 +1016,7 @@ class mcp_queue
} }
} }
$post_info = get_post_data($post_id_list, 'm_approve'); $post_info = phpbb_get_post_data($post_id_list, 'm_approve');
$is_disapproving = false; $is_disapproving = false;
foreach ($post_info as $post_id => $post_data) foreach ($post_info as $post_id => $post_data)

View file

@ -106,7 +106,7 @@ class mcp_reports
$parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0; $parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0;
$parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0; $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
$post_info = get_post_data(array($post_id), 'm_report', true); $post_info = phpbb_get_post_data(array($post_id), 'm_report', true);
if (!sizeof($post_info)) if (!sizeof($post_info))
{ {
@ -269,7 +269,7 @@ class mcp_reports
if ($topic_id) if ($topic_id)
{ {
$topic_info = get_topic_data(array($topic_id)); $topic_info = phpbb_get_topic_data(array($topic_id));
if (!sizeof($topic_info)) if (!sizeof($topic_info))
{ {
@ -312,7 +312,7 @@ class mcp_reports
} }
else else
{ {
$forum_info = get_forum_data(array($forum_id), 'm_report'); $forum_info = phpbb_get_forum_data(array($forum_id), 'm_report');
if (!sizeof($forum_info)) if (!sizeof($forum_info))
{ {
@ -338,7 +338,7 @@ class mcp_reports
$sort_days = $total = 0; $sort_days = $total = 0;
$sort_key = $sort_dir = ''; $sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array(); $sort_by_sql = $sort_order_sql = array();
mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
@ -479,7 +479,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
} }
else else
{ {
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report'))) if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
{ {
trigger_error('NOT_AUTHORISED'); trigger_error('NOT_AUTHORISED');
} }
@ -515,7 +515,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
if (confirm_box(true)) if (confirm_box(true))
{ {
$post_info = ($pm) ? get_pm_data($post_id_list) : get_post_data($post_id_list, 'm_report'); $post_info = ($pm) ? phpbb_get_pm_data($post_id_list) : phpbb_get_post_data($post_id_list, 'm_report');
$sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type $sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type
FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u

View file

@ -27,13 +27,13 @@ function mcp_topic_view($id, $mode, $action)
global $phpEx, $phpbb_root_path, $config; global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth, $cache, $phpbb_container; global $template, $db, $user, $auth, $cache, $phpbb_container;
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
$user->add_lang('viewtopic'); $user->add_lang('viewtopic');
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');
$topic_id = request_var('t', 0); $topic_id = request_var('t', 0);
$topic_info = get_topic_data(array($topic_id), false, true); $topic_info = phpbb_get_topic_data(array($topic_id), false, true);
if (!sizeof($topic_info)) if (!sizeof($topic_info))
{ {
@ -114,7 +114,7 @@ function mcp_topic_view($id, $mode, $action)
$sort_days = $total = 0; $sort_days = $total = 0;
$sort_key = $sort_dir = ''; $sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array(); $sort_by_sql = $sort_order_sql = array();
mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql); phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
$limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; $limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
$phpbb_content_visibility = $phpbb_container->get('content.visibility'); $phpbb_content_visibility = $phpbb_container->get('content.visibility');
@ -278,7 +278,7 @@ function mcp_topic_view($id, $mode, $action)
// Has the user selected a topic for merge? // Has the user selected a topic for merge?
if ($to_topic_id) if ($to_topic_id)
{ {
$to_topic_info = get_topic_data(array($to_topic_id), 'm_merge'); $to_topic_info = phpbb_get_topic_data(array($to_topic_id), 'm_merge');
if (!sizeof($to_topic_info)) if (!sizeof($to_topic_info))
{ {
@ -368,13 +368,13 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
return; return;
} }
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split'))) if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split')))
{ {
return; return;
} }
$post_id = $post_id_list[0]; $post_id = $post_id_list[0];
$post_info = get_post_data(array($post_id)); $post_info = phpbb_get_post_data(array($post_id));
if (!sizeof($post_info)) if (!sizeof($post_info))
{ {
@ -398,7 +398,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
return; return;
} }
$forum_info = get_forum_data(array($to_forum_id), 'f_post'); $forum_info = phpbb_get_forum_data(array($to_forum_id), 'f_post');
if (!sizeof($forum_info)) if (!sizeof($forum_info))
{ {
@ -438,7 +438,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$sort_days = $total = 0; $sort_days = $total = 0;
$sort_key = $sort_dir = ''; $sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array(); $sort_by_sql = $sort_order_sql = array();
mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
@ -505,7 +505,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$to_topic_id = $db->sql_nextid(); $to_topic_id = $db->sql_nextid();
move_posts($post_id_list, $to_topic_id); move_posts($post_id_list, $to_topic_id);
$topic_info = get_topic_data(array($topic_id)); $topic_info = phpbb_get_topic_data(array($topic_id));
$topic_info = $topic_info[$topic_id]; $topic_info = $topic_info[$topic_id];
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject); add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject);
@ -594,7 +594,7 @@ function merge_posts($topic_id, $to_topic_id)
$sync_topics = array($topic_id, $to_topic_id); $sync_topics = array($topic_id, $to_topic_id);
$topic_data = get_topic_data($sync_topics, 'm_merge'); $topic_data = phpbb_get_topic_data($sync_topics, 'm_merge');
if (!sizeof($topic_data) || empty($topic_data[$to_topic_id])) if (!sizeof($topic_data) || empty($topic_data[$to_topic_id]))
{ {
@ -619,7 +619,7 @@ function merge_posts($topic_id, $to_topic_id)
return; return;
} }
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge'))) if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
{ {
return; return;
} }

View file

@ -118,7 +118,7 @@ if (!$auth->acl_getf_global('m_'))
$allow_user = false; $allow_user = false;
if ($quickmod && isset($user_quickmod_actions[$action]) && $user->data['is_registered'] && $auth->acl_gets($user_quickmod_actions[$action], $forum_id)) if ($quickmod && isset($user_quickmod_actions[$action]) && $user->data['is_registered'] && $auth->acl_gets($user_quickmod_actions[$action], $forum_id))
{ {
$topic_info = get_topic_data(array($topic_id)); $topic_info = phpbb_get_topic_data(array($topic_id));
if ($topic_info[$topic_id]['topic_poster'] == $user->data['user_id']) if ($topic_info[$topic_id]['topic_poster'] == $user->data['user_id'])
{ {
$allow_user = true; $allow_user = true;

View file

@ -640,7 +640,7 @@ switch ($mode)
); );
extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars)));
$template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled)); $template->assign_vars(phpbb_show_profile($member, $user_notes_enabled, $warn_user_enabled));
// If the user has m_approve permission or a_user permission, then list then display unapproved posts // If the user has m_approve permission or a_user permission, then list then display unapproved posts
if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user')) if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user'))
@ -1400,7 +1400,7 @@ switch ($mode)
if ($sort_key == 'l') if ($sort_key == 'l')
{ {
// uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));")); // uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
usort($user_list, '_sort_last_active'); usort($user_list, 'phpbb_sort_last_active');
} }
for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i) for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
@ -1416,7 +1416,7 @@ switch ($mode)
$cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array(); $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array();
} }
$memberrow = array_merge(show_profile($row), array( $memberrow = array_merge(phpbb_show_profile($row), array(
'ROW_NUMBER' => $i + ($start + 1), 'ROW_NUMBER' => $i + ($start + 1),
'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, 'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,

View file

@ -195,7 +195,7 @@ switch ($mode)
} }
else else
{ {
upload_popup(); phpbb_upload_popup();
return; return;
} }
break; break;
@ -233,7 +233,7 @@ if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'b
if ($mode == 'popup') if ($mode == 'popup')
{ {
upload_popup($post_data['forum_style']); phpbb_upload_popup($post_data['forum_style']);
return; return;
} }
@ -439,7 +439,7 @@ if ($mode == 'delete' || $mode == 'soft_delete')
$allow_reason = $auth->acl_get('m_softdelete', $forum_id) || ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id)); $allow_reason = $auth->acl_get('m_softdelete', $forum_id) || ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id));
$soft_delete_reason = ($mode == 'soft_delete' && $allow_reason) ? $request->variable('delete_reason', '', true) : ''; $soft_delete_reason = ($mode == 'soft_delete' && $allow_reason) ? $request->variable('delete_reason', '', true) : '';
handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $soft_delete_reason); phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $soft_delete_reason);
return; return;
} }
@ -1259,7 +1259,7 @@ if ($submit || $preview || $refresh)
{ {
$allow_reason = $auth->acl_get('m_softdelete', $forum_id) || ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id)); $allow_reason = $auth->acl_get('m_softdelete', $forum_id) || ($auth->acl_gets('m_delete', 'f_delete', $forum_id) && $auth->acl_gets('m_softdelete', 'f_softdelete', $forum_id));
$soft_delete_reason = (!$request->is_set_post('delete_permanent') && $allow_reason) ? $request->variable('delete_reason', '', true) : ''; $soft_delete_reason = (!$request->is_set_post('delete_permanent') && $allow_reason) ? $request->variable('delete_reason', '', true) : '';
handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $soft_delete_reason); phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, !$request->is_set_post('delete_permanent'), $soft_delete_reason);
return; return;
} }