aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/modules/ucp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/modules/ucp')
-rw-r--r--phpBB/modules/ucp/ucp_activate.php12
-rw-r--r--phpBB/modules/ucp/ucp_attachments.php22
-rw-r--r--phpBB/modules/ucp/ucp_groups.php82
-rw-r--r--phpBB/modules/ucp/ucp_main.php80
-rw-r--r--phpBB/modules/ucp/ucp_pm.php18
-rw-r--r--phpBB/modules/ucp/ucp_pm_compose.php72
-rw-r--r--phpBB/modules/ucp/ucp_pm_options.php110
-rw-r--r--phpBB/modules/ucp/ucp_pm_viewfolder.php40
-rw-r--r--phpBB/modules/ucp/ucp_pm_viewmessage.php24
-rw-r--r--phpBB/modules/ucp/ucp_prefs.php12
-rw-r--r--phpBB/modules/ucp/ucp_profile.php34
-rw-r--r--phpBB/modules/ucp/ucp_register.php16
-rw-r--r--phpBB/modules/ucp/ucp_remind.php14
-rw-r--r--phpBB/modules/ucp/ucp_resend.php24
-rw-r--r--phpBB/modules/ucp/ucp_zebra.php26
15 files changed, 293 insertions, 293 deletions
diff --git a/phpBB/modules/ucp/ucp_activate.php b/phpBB/modules/ucp/ucp_activate.php
index 967deb6740..2738da4275 100644
--- a/phpBB/modules/ucp/ucp_activate.php
+++ b/phpBB/modules/ucp/ucp_activate.php
@@ -33,9 +33,9 @@ class ucp_activate
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
FROM ' . USERS_TABLE . "
WHERE user_id = $user_id";
- $result = $db->sql_query($sql);
- $user_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $user_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$user_row)
{
@@ -66,9 +66,9 @@ class ucp_activate
);
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user_row['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
}
if (!$update_password)
@@ -80,7 +80,7 @@ class ucp_activate
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = ''
WHERE user_id = {$user_row['user_id']}";
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
}
if (phpbb::$config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
diff --git a/phpBB/modules/ucp/ucp_attachments.php b/phpBB/modules/ucp/ucp_attachments.php
index 97d0e630f9..a4610c6a98 100644
--- a/phpBB/modules/ucp/ucp_attachments.php
+++ b/phpBB/modules/ucp/ucp_attachments.php
@@ -42,15 +42,15 @@ class ucp_attachments
FROM ' . ATTACHMENTS_TABLE . '
WHERE poster_id = ' . phpbb::$user->data['user_id'] . '
AND is_orphan = 0
- AND ' . $db->sql_in_set('attach_id', $delete_ids);
- $result = $db->sql_query($sql);
+ AND ' . phpbb::$db->sql_in_set('attach_id', $delete_ids);
+ $result = phpbb::$db->sql_query($sql);
$delete_ids = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$delete_ids[] = $row['attach_id'];
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
if ($delete && sizeof($delete_ids))
@@ -114,9 +114,9 @@ class ucp_attachments
FROM ' . ATTACHMENTS_TABLE . '
WHERE poster_id = ' . phpbb::$user->data['user_id'] . '
AND is_orphan = 0';
- $result = $db->sql_query($sql);
- $num_attachments = $db->sql_fetchfield('num_attachments');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $num_attachments = phpbb::$db->sql_fetchfield('num_attachments');
+ phpbb::$db->sql_freeresult($result);
$sql = 'SELECT a.*, t.topic_title, p.message_subject as message_title
FROM ' . ATTACHMENTS_TABLE . ' a
@@ -125,10 +125,10 @@ class ucp_attachments
WHERE a.poster_id = ' . phpbb::$user->data['user_id'] . "
AND a.is_orphan = 0
ORDER BY $order_by";
- $result = $db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
+ $result = phpbb::$db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
$row_count = 0;
- if ($row = $db->sql_fetchrow($result))
+ if ($row = phpbb::$db->sql_fetchrow($result))
{
$template->assign_var('S_ATTACHMENT_ROWS', true);
@@ -165,9 +165,9 @@ class ucp_attachments
$row_count++;
}
- while ($row = $db->sql_fetchrow($result));
+ while ($row = phpbb::$db->sql_fetchrow($result));
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($num_attachments, phpbb::$config['topics_per_page'], $start),
diff --git a/phpBB/modules/ucp/ucp_groups.php b/phpBB/modules/ucp/ucp_groups.php
index 83b9cf42f0..97446f4d97 100644
--- a/phpBB/modules/ucp/ucp_groups.php
+++ b/phpBB/modules/ucp/ucp_groups.php
@@ -54,15 +54,15 @@ class ucp_groups
$sql = 'SELECT group_id, group_name, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_id IN (' . $group_id . ', ' . phpbb::$user->data['group_id'] . ')';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$group_row = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? phpbb::$user->lang['G_' . $row['group_name']] : $row['group_name'];
$group_row[$row['group_id']] = $row;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
if (!sizeof($group_row))
{
@@ -127,9 +127,9 @@ class ucp_groups
$sql = 'SELECT group_type
FROM ' . GROUPS_TABLE . '
WHERE group_id = ' . $group_id;
- $result = $db->sql_query($sql);
- $group_type = (int) $db->sql_fetchfield('group_type');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $group_type = (int) phpbb::$db->sql_fetchfield('group_type');
+ phpbb::$db->sql_freeresult($result);
if ($group_type != GROUP_OPEN && $group_type != GROUP_FREE)
{
@@ -165,9 +165,9 @@ class ucp_groups
WHERE ug.user_id = u.user_id
AND ug.group_id = ' . $group_id . '
AND ug.user_id = ' . phpbb::$user->data['user_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if ($row)
{
@@ -208,9 +208,9 @@ class ucp_groups
WHERE ug.user_id = u.user_id
AND ' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? 'ug.user_id = ' . phpbb::$user->data['user_id'] : 'ug.group_leader = 1') . "
AND ug.group_id = $group_id";
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$messenger->template($email_template, $row['user_lang']);
@@ -228,7 +228,7 @@ class ucp_groups
$messenger->send($row['user_notify_type']);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$messenger->save_queue();
@@ -292,11 +292,11 @@ class ucp_groups
WHERE ug.user_id = ' . phpbb::$user->data['user_id'] . '
AND g.group_id = ug.group_id
ORDER BY g.group_type DESC, g.group_name';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$group_id_ary = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$block = ($row['group_leader']) ? 'leader' : (($row['user_pending']) ? 'pending' : 'member');
@@ -338,19 +338,19 @@ class ucp_groups
$group_id_ary[] = $row['group_id'];
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
// Hide hidden groups unless user is an admin with group privileges
$sql_and = (phpbb::$acl->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? '<> ' . GROUP_SPECIAL : 'NOT IN (' . GROUP_SPECIAL . ', ' . GROUP_HIDDEN . ')';
$sql = 'SELECT group_id, group_name, group_colour, group_desc, group_desc_uid, group_desc_bitfield, group_desc_options, group_type, group_founder_manage
FROM ' . GROUPS_TABLE . '
- WHERE ' . ((sizeof($group_id_ary)) ? $db->sql_in_set('group_id', $group_id_ary, true) . ' AND ' : '') . "
+ WHERE ' . ((sizeof($group_id_ary)) ? phpbb::$db->sql_in_set('group_id', $group_id_ary, true) . ' AND ' : '') . "
group_type $sql_and
ORDER BY group_type DESC, group_name";
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
switch ($row['group_type'])
{
@@ -388,7 +388,7 @@ class ucp_groups
'U_VIEW_GROUP' => append_sid('memberlist', 'mode=group&amp;g=' . $row['group_id']))
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$template->assign_vars(array(
'S_CHANGE_DEFAULT' => (phpbb::$acl->acl_get('u_chggrp')) ? true : false,
@@ -417,9 +417,9 @@ class ucp_groups
$sql = 'SELECT *
FROM ' . GROUPS_TABLE . "
WHERE group_id = $group_id";
- $result = $db->sql_query($sql);
- $group_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $group_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$group_row)
{
@@ -651,15 +651,15 @@ class ucp_groups
FROM ' . RANKS_TABLE . '
WHERE rank_special = 1
ORDER BY rank_title';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$rank_options = '<option value="0"' . ((!$group_rank) ? ' selected="selected"' : '') . '>' . phpbb::$user->lang['USER_DEFAULT'] . '</option>';
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$selected = ($group_rank && $row['rank_id'] == $group_rank) ? ' selected="selected"' : '';
$rank_options .= '<option value="' . $row['rank_id'] . '"' . $selected . '>' . $row['rank_title'] . '</option>';
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$type_free = ($group_type == GROUP_FREE) ? ' checked="checked"' : '';
$type_open = ($group_type == GROUP_OPEN) ? ' checked="checked"' : '';
@@ -745,9 +745,9 @@ class ucp_groups
AND u.user_id = ug.user_id
AND ug.group_leader = 1
ORDER BY ug.user_pending DESC, u.username_clean";
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$template->assign_block_vars('leader', array(
'USERNAME' => $row['username'],
@@ -760,16 +760,16 @@ class ucp_groups
'USER_ID' => $row['user_id'])
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
// Total number of group members (non-leaders)
$sql = 'SELECT COUNT(user_id) AS total_members
FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $group_id
AND group_leader = 0";
- $result = $db->sql_query($sql);
- $total_members = (int) $db->sql_fetchfield('total_members');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $total_members = (int) phpbb::$db->sql_fetchfield('total_members');
+ phpbb::$db->sql_freeresult($result);
// Grab the members
$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
@@ -778,12 +778,12 @@ class ucp_groups
AND u.user_id = ug.user_id
AND ug.group_leader = 0
ORDER BY ug.user_pending DESC, u.username_clean";
- $result = $db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
+ $result = phpbb::$db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
$pending = false;
$approved = false;
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
if ($row['user_pending'] && !$pending)
{
@@ -815,7 +815,7 @@ class ucp_groups
'USER_ID' => $row['user_id'])
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$s_action_options = '';
$options = array('default' => 'DEFAULT', 'approve' => 'APPROVE', 'deleteusers' => 'DELETE');
@@ -896,16 +896,16 @@ class ucp_groups
FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $group_id
ORDER BY user_id";
- $result = $db->sql_query_limit($sql, 200, $start);
+ $result = phpbb::$db->sql_query_limit($sql, 200, $start);
$mark_ary = array();
- if ($row = $db->sql_fetchrow($result))
+ if ($row = phpbb::$db->sql_fetchrow($result))
{
do
{
$mark_ary[] = $row['user_id'];
}
- while ($row = $db->sql_fetchrow($result));
+ while ($row = phpbb::$db->sql_fetchrow($result));
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
@@ -915,7 +915,7 @@ class ucp_groups
{
$start = 0;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
while ($start);
}
@@ -1057,9 +1057,9 @@ class ucp_groups
AND g.group_id = ug.group_id
AND ug.group_leader = 1
ORDER BY g.group_type DESC, g.group_name';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($value = $db->sql_fetchrow($result))
+ while ($value = phpbb::$db->sql_fetchrow($result))
{
$template->assign_block_vars('leader', array(
'GROUP_NAME' => ($value['group_type'] == GROUP_SPECIAL) ? phpbb::$user->lang['G_' . $value['group_name']] : $value['group_name'],
@@ -1072,7 +1072,7 @@ class ucp_groups
'U_EDIT' => $this->u_action . "&amp;action=edit&amp;g={$value['group_id']}")
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
break;
}
diff --git a/phpBB/modules/ucp/ucp_main.php b/phpBB/modules/ucp/ucp_main.php
index 550d586744..37a1037e2d 100644
--- a/phpBB/modules/ucp/ucp_main.php
+++ b/phpBB/modules/ucp/ucp_main.php
@@ -71,11 +71,11 @@ class ucp_main
if (sizeof($forum_ary))
{
- $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
+ $sql .= ' AND ' . phpbb::$db->sql_in_set('forum_id', $forum_ary, true);
}
- $result = $db->sql_query_limit($sql, 1);
- $g_forum_id = (int) $db->sql_fetchfield('forum_id');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $g_forum_id = (int) phpbb::$db->sql_fetchfield('forum_id');
+ phpbb::$db->sql_freeresult($result);
$sql = "SELECT t.* $sql_select
FROM $sql_from
@@ -87,14 +87,14 @@ class ucp_main
// If the user can't see any forums, he can't read any posts because fid of 0 is invalid
if ($g_forum_id)
{
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$topic_list[] = $row['topic_id'];
$rowset[$row['topic_id']] = $row;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
$topic_tracking_info = array();
@@ -218,9 +218,9 @@ class ucp_main
if (sizeof($forums))
{
$sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . '
- WHERE ' . $db->sql_in_set('forum_id', $forums) . '
+ WHERE ' . phpbb::$db->sql_in_set('forum_id', $forums) . '
AND user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$l_unwatch .= '_FORUMS';
}
@@ -228,9 +228,9 @@ class ucp_main
if (sizeof($topics))
{
$sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topics) . '
+ WHERE ' . phpbb::$db->sql_in_set('topic_id', $topics) . '
AND user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$l_unwatch .= '_TOPICS';
}
@@ -267,7 +267,7 @@ class ucp_main
'WHERE' => 'fw.user_id = ' . phpbb::$user->data['user_id'] . '
AND f.forum_id = fw.forum_id
- AND ' . $db->sql_in_set('f.forum_id', $forbidden_forums, true, true),
+ AND ' . phpbb::$db->sql_in_set('f.forum_id', $forbidden_forums, true, true),
'ORDER_BY' => 'left_id'
);
@@ -289,10 +289,10 @@ class ucp_main
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query($sql);
+ $sql = phpbb::$db->sql_build_query('SELECT', $sql_array);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$forum_id = $row['forum_id'];
@@ -350,7 +350,7 @@ class ucp_main
'U_VIEWFORUM' => append_sid('viewforum', 'f=' . $row['forum_id']))
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
// Subscribed Topics
@@ -405,8 +405,8 @@ class ucp_main
{
$sql = 'DELETE FROM ' . BOOKMARKS_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . '
- AND ' . $db->sql_in_set('topic_id', $topics);
- $db->sql_query($sql);
+ AND ' . phpbb::$db->sql_in_set('topic_id', $topics);
+ phpbb::$db->sql_query($sql);
meta_refresh(3, $url);
$message = phpbb::$user->lang['BOOKMARKS_REMOVED'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_UCP'], '<a href="' . $url . '">', '</a>');
@@ -449,9 +449,9 @@ class ucp_main
if (sizeof($drafts))
{
$sql = 'DELETE FROM ' . DRAFTS_TABLE . '
- WHERE ' . $db->sql_in_set('draft_id', $drafts) . '
+ WHERE ' . phpbb::$db->sql_in_set('draft_id', $drafts) . '
AND user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
}
$msg = phpbb::$user->lang['DRAFTS_DELETED'];
unset($drafts);
@@ -479,10 +479,10 @@ class ucp_main
);
$sql = 'UPDATE ' . DRAFTS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $draft_row) . "
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $draft_row) . "
WHERE draft_id = $draft_id
AND user_id = " . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$message = phpbb::$user->lang['DRAFT_UPDATED'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
@@ -518,11 +518,11 @@ class ucp_main
AND topic_id = 0
ORDER BY save_time DESC';
}
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$draftrows = $topic_ids = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
if ($row['topic_id'])
{
@@ -530,20 +530,20 @@ class ucp_main
}
$draftrows[] = $row;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
if (sizeof($topic_ids))
{
$sql = 'SELECT topic_id, forum_id, topic_title
FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids));
- $result = $db->sql_query($sql);
+ WHERE ' . phpbb::$db->sql_in_set('topic_id', array_unique($topic_ids));
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$topic_rows[$row['topic_id']] = $row;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
unset($topic_ids);
@@ -644,12 +644,12 @@ class ucp_main
'WHERE' => 'i.topic_id = t.topic_id
AND i.user_id = ' . phpbb::$user->data['user_id'] . '
- AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
+ AND ' . phpbb::$db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
);
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query($sql);
- $topics_count = (int) $db->sql_fetchfield('topics_count');
- $db->sql_freeresult($result);
+ $sql = phpbb::$db->sql_build_query('SELECT', $sql_array);
+ $result = phpbb::$db->sql_query($sql);
+ $topics_count = (int) phpbb::$db->sql_fetchfield('topics_count');
+ phpbb::$db->sql_freeresult($result);
if ($topics_count)
{
@@ -672,7 +672,7 @@ class ucp_main
'WHERE' => 'tw.user_id = ' . phpbb::$user->data['user_id'] . '
AND t.topic_id = tw.topic_id
- AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
+ AND ' . phpbb::$db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
'ORDER_BY' => 't.topic_last_post_time DESC'
@@ -690,7 +690,7 @@ class ucp_main
),
'WHERE' => 'b.user_id = ' . phpbb::$user->data['user_id'] . '
- AND ' . $db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true),
+ AND ' . phpbb::$db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true),
'ORDER_BY' => 't.topic_last_post_time DESC'
);
@@ -714,11 +714,11 @@ class ucp_main
$sql_array['SELECT'] .= ', tp.topic_posted';
}
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
+ $sql = phpbb::$db->sql_build_query('SELECT', $sql_array);
+ $result = phpbb::$db->sql_query_limit($sql, phpbb::$config['topics_per_page'], $start);
$topic_list = $topic_forum_list = $global_announce_list = $rowset = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$topic_id = (isset($row['b_topic_id'])) ? $row['b_topic_id'] : $row['topic_id'];
@@ -733,7 +733,7 @@ class ucp_main
$global_announce_list[] = $topic_id;
}
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$topic_tracking_info = array();
if (phpbb::$config['load_db_lastread'])
diff --git a/phpBB/modules/ucp/ucp_pm.php b/phpBB/modules/ucp/ucp_pm.php
index d8efc0ad9b..794649d199 100644
--- a/phpBB/modules/ucp/ucp_pm.php
+++ b/phpBB/modules/ucp/ucp_pm.php
@@ -252,9 +252,9 @@ class ucp_pm
WHERE msg_id = $msg_id
AND folder_id <> " . PRIVMSGS_NO_BOX . '
AND user_id = ' . phpbb::$user->data['user_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$row)
{
@@ -280,9 +280,9 @@ class ucp_pm
AND t.msg_id = p.msg_id
AND p.message_time $sql_condition p2.message_time
ORDER BY p.message_time $sql_ordering";
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$row)
{
@@ -302,9 +302,9 @@ class ucp_pm
AND t.folder_id = $folder_id
AND t.msg_id = p.msg_id
AND p.msg_id = $msg_id";
- $result = $db->sql_query($sql);
- $message_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $message_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$message_row)
{
diff --git a/phpBB/modules/ucp/ucp_pm_compose.php b/phpBB/modules/ucp/ucp_pm_compose.php
index 1426b802f1..931efefdd4 100644
--- a/phpBB/modules/ucp/ucp_pm_compose.php
+++ b/phpBB/modules/ucp/ucp_pm_compose.php
@@ -99,14 +99,14 @@ function compose_pm($id, $mode, $action)
$sql .= 'g.group_receive_pm = 1
ORDER BY g.group_type DESC, g.group_name ASC';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$group_options = '';
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? phpbb::$user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
$template->assign_vars(array(
@@ -216,9 +216,9 @@ function compose_pm($id, $mode, $action)
if ($sql)
{
- $result = $db->sql_query($sql);
- $post = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $post = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$post)
{
@@ -230,9 +230,9 @@ function compose_pm($id, $mode, $action)
WHERE t.user_id = ' . phpbb::$user->data['user_id'] . "
AND t.msg_id = $msg_id
AND t.msg_id = p.msg_id";
- $result = $db->sql_query($sql);
- $post = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $post = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if ($post)
{
@@ -256,9 +256,9 @@ function compose_pm($id, $mode, $action)
$sql = 'SELECT forum_password
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . (int) $post['forum_id'];
- $result = $db->sql_query($sql);
- $forum_password = (string) $db->sql_fetchfield('forum_password');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $forum_password = (string) phpbb::$db->sql_fetchfield('forum_password');
+ phpbb::$db->sql_freeresult($result);
if ($forum_password)
{
@@ -422,9 +422,9 @@ function compose_pm($id, $mode, $action)
WHERE ug.user_id = ' . phpbb::$user->data['user_id'] . '
AND ug.user_pending = 0
AND ug.group_id = g.group_id';
- $result = $db->sql_query($sql);
- $max_recipients = (int) $db->sql_fetchfield('max_recipients');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $max_recipients = (int) phpbb::$db->sql_fetchfield('max_recipients');
+ phpbb::$db->sql_freeresult($result);
$max_recipients = (!$max_recipients) ? phpbb::$config['pm_max_recipients'] : $max_recipients;
@@ -485,9 +485,9 @@ function compose_pm($id, $mode, $action)
AND in_message = 1
AND is_orphan = 0
ORDER BY filetime DESC";
- $result = $db->sql_query($sql);
- $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $message_parser->attachment_data = array_merge($message_parser->attachment_data, phpbb::$db->sql_fetchrowset($result));
+ phpbb::$db->sql_freeresult($result);
}
if (!in_array($action, array('quote', 'edit', 'delete', 'forward')))
@@ -509,9 +509,9 @@ function compose_pm($id, $mode, $action)
AND topic_id = 0
AND user_id = ' . phpbb::$user->data['user_id'] .
(($draft_id) ? " AND draft_id <> $draft_id" : '');
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if ($row)
{
@@ -541,7 +541,7 @@ function compose_pm($id, $mode, $action)
{
if (confirm_box(true))
{
- $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . phpbb::$db->sql_build_array('INSERT', array(
'user_id' => phpbb::$user->data['user_id'],
'topic_id' => 0,
'forum_id' => 0,
@@ -550,7 +550,7 @@ function compose_pm($id, $mode, $action)
'draft_message' => $message
)
);
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$redirect_url = append_sid('ucp', "i=pm&amp;mode=$mode");
@@ -602,9 +602,9 @@ function compose_pm($id, $mode, $action)
AND topic_id = 0
AND forum_id = 0
AND user_id = " . phpbb::$user->data['user_id'];
- $result = $db->sql_query_limit($sql, 1);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
- if ($row = $db->sql_fetchrow($result))
+ if ($row = phpbb::$db->sql_fetchrow($result))
{
$message_parser->message = $row['draft_message'];
$message_subject = $row['draft_subject'];
@@ -615,7 +615,7 @@ function compose_pm($id, $mode, $action)
{
$draft_id = 0;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
// Load Drafts
@@ -877,9 +877,9 @@ function compose_pm($id, $mode, $action)
{
$sql = 'SELECT user_id as id, username as name, user_colour as colour
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u']))) . '
+ WHERE ' . phpbb::$db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u']))) . '
ORDER BY username_clean ASC';
- $result['u'] = $db->sql_query($sql);
+ $result['u'] = phpbb::$db->sql_query($sql);
}
if (!empty($address_list['g']))
@@ -901,10 +901,10 @@ function compose_pm($id, $mode, $action)
$sql .= (phpbb::$acl->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' WHERE ' : ' AND ';
$sql .= 'g.group_receive_pm = 1
- AND ' . $db->sql_in_set('g.group_id', array_map('intval', array_keys($address_list['g']))) . '
+ AND ' . phpbb::$db->sql_in_set('g.group_id', array_map('intval', array_keys($address_list['g']))) . '
ORDER BY g.group_name ASC';
- $result['g'] = $db->sql_query($sql);
+ $result['g'] = phpbb::$db->sql_query($sql);
}
$u = $g = array();
@@ -913,7 +913,7 @@ function compose_pm($id, $mode, $action)
{
if (isset($result[$type]) && $result[$type])
{
- while ($row = $db->sql_fetchrow($result[$type]))
+ while ($row = phpbb::$db->sql_fetchrow($result[$type]))
{
if ($type == 'g')
{
@@ -922,7 +922,7 @@ function compose_pm($id, $mode, $action)
${$type}[$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
}
- $db->sql_freeresult($result[$type]);
+ phpbb::$db->sql_freeresult($result[$type]);
}
}
@@ -1176,17 +1176,17 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
{
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . '
+ WHERE ' . phpbb::$db->sql_in_set('user_id', array_keys($address_list['u'])) . '
AND user_allow_pm = 0';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$removed = false;
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$removed = true;
unset($address_list['u'][$row['user_id']]);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
// print a notice about users not being added who do not want to receive pms
if ($removed)
diff --git a/phpBB/modules/ucp/ucp_pm_options.php b/phpBB/modules/ucp/ucp_pm_options.php
index a82a8a1388..4319cd2c38 100644
--- a/phpBB/modules/ucp/ucp_pm_options.php
+++ b/phpBB/modules/ucp/ucp_pm_options.php
@@ -55,7 +55,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_full_folder = ' . $set_folder_id . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
phpbb::$user->data['user_full_folder'] = $set_folder_id;
@@ -77,11 +77,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
{
$sql = 'SELECT folder_name
FROM ' . PRIVMSGS_FOLDER_TABLE . "
- WHERE folder_name = '" . $db->sql_escape($folder_name) . "'
+ WHERE folder_name = '" . phpbb::$db->sql_escape($folder_name) . "'
AND user_id = " . phpbb::$user->data['user_id'];
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if ($row)
{
@@ -91,20 +91,20 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'SELECT COUNT(folder_id) as num_folder
FROM ' . PRIVMSGS_FOLDER_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $result = $db->sql_query($sql);
- $num_folder = (int) $db->sql_fetchfield('num_folder');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $num_folder = (int) phpbb::$db->sql_fetchfield('num_folder');
+ phpbb::$db->sql_freeresult($result);
if ($num_folder >= phpbb::$config['pm_max_boxes'])
{
trigger_error('MAX_FOLDER_REACHED');
}
- $sql = 'INSERT INTO ' . PRIVMSGS_FOLDER_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ $sql = 'INSERT INTO ' . PRIVMSGS_FOLDER_TABLE . ' ' . phpbb::$db->sql_build_array('INSERT', array(
'user_id' => (int) phpbb::$user->data['user_id'],
'folder_name' => $folder_name)
);
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$msg = phpbb::$user->lang['FOLDER_ADDED'];
}
}
@@ -135,9 +135,9 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
FROM ' . PRIVMSGS_FOLDER_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . "
AND folder_id = $rename_folder_id";
- $result = $db->sql_query_limit($sql, 1);
- $folder_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $folder_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$folder_row)
{
@@ -145,10 +145,10 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
}
$sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . "
- SET folder_name = '" . $db->sql_escape($new_folder_name) . "'
+ SET folder_name = '" . phpbb::$db->sql_escape($new_folder_name) . "'
WHERE folder_id = $rename_folder_id
AND user_id = " . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$msg = phpbb::$user->lang['FOLDER_RENAMED'];
}
else
@@ -182,9 +182,9 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
FROM ' . PRIVMSGS_FOLDER_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . "
AND folder_id = $remove_folder_id";
- $result = $db->sql_query_limit($sql, 1);
- $folder_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $folder_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$folder_row)
{
@@ -206,14 +206,14 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . "
AND folder_id = $remove_folder_id";
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$msg_ids = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$msg_ids[] = (int) $row['msg_id'];
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
// First of all, copy all messages to another folder... or delete all messages
switch ($remove_action)
@@ -239,7 +239,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'DELETE FROM ' . PRIVMSGS_FOLDER_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . "
AND folder_id = $remove_folder_id";
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
// Check full folder option. If the removed folder has been specified as destination switch back to inbox
if (phpbb::$user->data['user_full_folder'] == $remove_folder_id)
@@ -247,7 +247,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_full_folder = ' . PRIVMSGS_INBOX . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
phpbb::$user->data['user_full_folder'] = PRIVMSGS_INBOX;
}
@@ -258,7 +258,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql .= ($remove_action == 1) ? $move_to : PRIVMSGS_INBOX;
$sql .= ' WHERE rule_folder_id = ' . $remove_folder_id;
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$meta_info = append_sid('ucp', "i=pm&amp;mode=$mode");
$message = phpbb::$user->lang['FOLDER_REMOVED'];
@@ -312,24 +312,24 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'SELECT rule_id
FROM ' . PRIVMSGS_RULES_TABLE . '
- WHERE ' . $db->sql_build_array('SELECT', $rule_ary);
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ WHERE ' . phpbb::$db->sql_build_array('SELECT', $rule_ary);
+ $result = phpbb::$db->sql_query($sql);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if ($row)
{
trigger_error('RULE_ALREADY_DEFINED');
}
- $sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);
- $db->sql_query($sql);
+ $sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . phpbb::$db->sql_build_array('INSERT', $rule_ary);
+ phpbb::$db->sql_query($sql);
// Update users message rules
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_message_rules = 1
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$msg = phpbb::$user->lang['RULE_ADDED'];
}
@@ -359,7 +359,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'DELETE FROM ' . PRIVMSGS_RULES_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . "
AND rule_id = $delete_id";
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$meta_info = append_sid('ucp', 'i=pm&amp;mode=' . $mode);
$message = phpbb::$user->lang['RULE_DELETED'];
@@ -368,9 +368,9 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'SELECT rule_id
FROM ' . PRIVMSGS_RULES_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
// Update users message rules
if (!$row)
@@ -378,7 +378,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_message_rules = 0
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
}
meta_refresh(3, $meta_info);
@@ -397,9 +397,9 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . '
AND folder_id = ' . PRIVMSGS_INBOX;
- $result = $db->sql_query($sql);
- $num_messages = (int) $db->sql_fetchfield('num_messages');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $num_messages = (int) phpbb::$db->sql_fetchfield('num_messages');
+ phpbb::$db->sql_freeresult($result);
$folder[PRIVMSGS_INBOX] = array(
'folder_name' => phpbb::$user->lang['PM_INBOX'],
@@ -409,10 +409,10 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$sql = 'SELECT folder_id, folder_name, pm_count
FROM ' . PRIVMSGS_FOLDER_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$num_user_folder = 0;
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$num_user_folder++;
$folder[$row['folder_id']] = array(
@@ -420,7 +420,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
'message_status' => sprintf(phpbb::$user->lang['FOLDER_MESSAGE_STATUS'], $row['pm_count'], phpbb::$user->data['message_limit'])
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$s_full_folder_options = $s_to_folder_options = $s_folder_options = '';
@@ -691,10 +691,10 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($rule_string)) . "'";
- $result = $db->sql_query($sql);
- $rule_user_id = (int) $db->sql_fetchfield('user_id');
- $db->sql_freeresult($result);
+ WHERE username_clean = '" . phpbb::$db->sql_escape(utf8_clean_string($rule_string)) . "'";
+ $result = phpbb::$db->sql_query($sql);
+ $rule_user_id = (int) phpbb::$db->sql_fetchfield('user_id');
+ phpbb::$db->sql_freeresult($result);
if (!$rule_user_id)
{
@@ -706,9 +706,9 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
$sql = 'SELECT username
FROM ' . USERS_TABLE . "
WHERE user_id = $rule_user_id";
- $result = $db->sql_query($sql);
- $rule_string = $db->sql_fetchfield('username');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $rule_string = phpbb::$db->sql_fetchfield('username');
+ phpbb::$db->sql_freeresult($result);
if (!$rule_string)
{
@@ -752,10 +752,10 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
$sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
ORDER BY g.group_type DESC, g.group_name ASC';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$s_group_options = '';
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
if ($rule_group_id && ($row['group_id'] == $rule_group_id))
{
@@ -767,7 +767,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
$s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? phpbb::$user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$template->assign_vars(array(
'S_GROUP_CONDITION' => true,
@@ -799,10 +799,10 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
FROM ' . PRIVMSGS_RULES_TABLE . '
WHERE user_id = ' . $user_id . '
ORDER BY rule_id ASC';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$count = 0;
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$template->assign_block_vars('rule', array(
'COUNT' => ++$count,
@@ -814,7 +814,7 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
'FOLDER' => ($row['rule_action'] == ACTION_PLACE_INTO_FOLDER) ? $folder[$row['rule_folder_id']]['folder_name'] : '')
);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
?> \ No newline at end of file
diff --git a/phpBB/modules/ucp/ucp_pm_viewfolder.php b/phpBB/modules/ucp/ucp_pm_viewfolder.php
index f1f6d0a41e..35d9336c16 100644
--- a/phpBB/modules/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/modules/ucp/ucp_pm_viewfolder.php
@@ -90,14 +90,14 @@ function view_folder($id, $mode, $folder_id, $folder)
$sql = 'SELECT *
FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$friend[$row['zebra_id']] = $row['friend'];
$foe[$row['zebra_id']] = $row['foe'];
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$template->assign_vars(array(
'S_MARK_OPTIONS' => $s_mark_options,
@@ -147,11 +147,11 @@ function view_folder($id, $mode, $folder_id, $folder)
FROM ' . GROUPS_TABLE . '
WHERE ';
}
- $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
+ $sql .= phpbb::$db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
if ($ug_type == 'g')
{
@@ -160,7 +160,7 @@ function view_folder($id, $mode, $folder_id, $folder)
$recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
}
@@ -286,9 +286,9 @@ function view_folder($id, $mode, $folder_id, $folder)
AND t.folder_id = $folder_id
AND t.msg_id = p.msg_id
AND p.msg_id = $message_id";
- $result = $db->sql_query_limit($sql, 1);
- $message_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $message_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
$_types = array('u', 'g');
foreach ($_types as $ug_type)
@@ -307,16 +307,16 @@ function view_folder($id, $mode, $folder_id, $folder)
FROM ' . GROUPS_TABLE . '
WHERE ';
}
- $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address[$message_id][$ug_type])));
+ $sql .= phpbb::$db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address[$message_id][$ug_type])));
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($info_row = $db->sql_fetchrow($result))
+ while ($info_row = phpbb::$db->sql_fetchrow($result))
{
$address[$message_id][$ug_type][$address[$message_id][$ug_type][$info_row['id']]][] = $info_row['name'];
unset($address[$message_id][$ug_type][$info_row['id']]);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
}
@@ -480,9 +480,9 @@ function get_pm_from($folder_id, $folder, $user_id)
AND t.user_id = $user_id
AND t.msg_id = p.msg_id
AND p.message_time >= $min_post_time";
- $result = $db->sql_query_limit($sql, 1);
- $pm_count = (int) $db->sql_fetchfield('pm_count');
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $pm_count = (int) phpbb::$db->sql_fetchfield('pm_count');
+ phpbb::$db->sql_freeresult($result);
$sql_limit_time = "AND p.message_time >= $min_post_time";
}
@@ -544,14 +544,14 @@ function get_pm_from($folder_id, $folder, $user_id)
AND t.msg_id = p.msg_id
$sql_limit_time
ORDER BY $sql_sort_order";
- $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
+ $result = phpbb::$db->sql_query_limit($sql, $sql_limit, $sql_start);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$rowset[$row['msg_id']] = $row;
$pm_list[] = $row['msg_id'];
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$pm_list = ($store_reverse) ? array_reverse($pm_list) : $pm_list;
diff --git a/phpBB/modules/ucp/ucp_pm_viewmessage.php b/phpBB/modules/ucp/ucp_pm_viewmessage.php
index d535098328..0a0ba0ed94 100644
--- a/phpBB/modules/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/modules/ucp/ucp_pm_viewmessage.php
@@ -102,13 +102,13 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
WHERE post_msg_id = $msg_id
AND in_message = 1
ORDER BY filetime DESC, post_msg_id ASC";
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$attachments[] = $row;
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
// No attachments exist, but message table thinks they do so go ahead and reset attach flags
if (!sizeof($attachments))
@@ -116,7 +116,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$sql = 'UPDATE ' . PRIVMSGS_TABLE . "
SET message_attachment = 0
WHERE msg_id = $msg_id";
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
}
}
else
@@ -136,8 +136,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
SET download_count = download_count + 1
- WHERE ' . $db->sql_in_set('attach_id', array_unique($update_count));
- $db->sql_query($sql);
+ WHERE ' . phpbb::$db->sql_in_set('attach_id', array_unique($update_count));
+ phpbb::$db->sql_query($sql);
}
}
@@ -261,9 +261,9 @@ function get_user_information($user_id, $user_row)
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
WHERE user_id = ' . (int) $user_id;
- $result = $db->sql_query($sql);
- $user_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $user_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
}
// Some standard values
@@ -277,9 +277,9 @@ function get_user_information($user_id, $user_row)
FROM ' . SESSIONS_TABLE . "
WHERE session_user_id = $user_id
GROUP BY session_user_id";
- $result = $db->sql_query_limit($sql, 1);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query_limit($sql, 1);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
$update_time = phpbb::$config['load_online_time'] * 60;
if ($row)
diff --git a/phpBB/modules/ucp/ucp_prefs.php b/phpBB/modules/ucp/ucp_prefs.php
index 598015380c..d288df8082 100644
--- a/phpBB/modules/ucp/ucp_prefs.php
+++ b/phpBB/modules/ucp/ucp_prefs.php
@@ -93,9 +93,9 @@ class ucp_prefs
);
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
meta_refresh(3, $this->u_action);
$message = phpbb::$user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
@@ -215,9 +215,9 @@ class ucp_prefs
);
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
meta_refresh(3, $this->u_action);
$message = phpbb::$user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
@@ -316,9 +316,9 @@ class ucp_prefs
);
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$msg = phpbb::$user->lang['PREFERENCES_UPDATED'];
}
diff --git a/phpBB/modules/ucp/ucp_profile.php b/phpBB/modules/ucp/ucp_profile.php
index 716af62b19..2369b9eac3 100644
--- a/phpBB/modules/ucp/ucp_profile.php
+++ b/phpBB/modules/ucp/ucp_profile.php
@@ -174,15 +174,15 @@ class ucp_profile
if (sizeof($admin_ary))
{
- $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
+ $where_sql .= ' OR ' . phpbb::$db->sql_in_set('user_id', $admin_ary);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . ' ' .
$where_sql;
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$messenger->template('admin_activate', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
@@ -196,7 +196,7 @@ class ucp_profile
$messenger->send($row['user_notify_type']);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
user_active_flip('deactivate', phpbb::$user->data['user_id'], INACTIVE_PROFILE);
@@ -209,9 +209,9 @@ class ucp_profile
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
}
// Need to update config, forum, topic, posting, messages, etc.
@@ -373,28 +373,28 @@ class ucp_profile
}
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
// Update Custom Fields
if (sizeof($cp_data))
{
$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $cp_data) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
- if (!$db->sql_affectedrows())
+ if (!phpbb::$db->sql_affectedrows())
{
$cp_data['user_id'] = (int) phpbb::$user->data['user_id'];
- $db->sql_return_on_error(true);
+ phpbb::$db->sql_return_on_error(true);
- $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
- $db->sql_query($sql);
+ $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . phpbb::$db->sql_build_array('INSERT', $cp_data);
+ phpbb::$db->sql_query($sql);
- $db->sql_return_on_error(false);
+ phpbb::$db->sql_return_on_error(false);
}
}
@@ -510,9 +510,9 @@ class ucp_profile
);
$sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . phpbb::$user->data['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
$message = phpbb::$user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
diff --git a/phpBB/modules/ucp/ucp_register.php b/phpBB/modules/ucp/ucp_register.php
index e57ed9271f..fc0a832839 100644
--- a/phpBB/modules/ucp/ucp_register.php
+++ b/phpBB/modules/ucp/ucp_register.php
@@ -253,11 +253,11 @@ class ucp_register
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
- WHERE group_name = '" . $db->sql_escape($group_name) . "'
+ WHERE group_name = '" . phpbb::$db->sql_escape($group_name) . "'
AND group_type = " . GROUP_SPECIAL;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$row)
{
@@ -377,15 +377,15 @@ class ucp_register
if (sizeof($admin_ary))
{
- $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
+ $where_sql .= ' OR ' . phpbb::$db->sql_in_set('user_id', $admin_ary);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . ' ' .
$where_sql;
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$messenger->template('admin_activate', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
@@ -399,7 +399,7 @@ class ucp_register
$messenger->send($row['user_notify_type']);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
}
diff --git a/phpBB/modules/ucp/ucp_remind.php b/phpBB/modules/ucp/ucp_remind.php
index 378fa49f08..63ce234ab4 100644
--- a/phpBB/modules/ucp/ucp_remind.php
+++ b/phpBB/modules/ucp/ucp_remind.php
@@ -35,11 +35,11 @@ class ucp_remind
{
$sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
FROM ' . USERS_TABLE . "
- WHERE user_email = '" . $db->sql_escape($email) . "'
- AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
- $result = $db->sql_query($sql);
- $user_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ WHERE user_email = '" . phpbb::$db->sql_escape($email) . "'
+ AND username_clean = '" . phpbb::$db->sql_escape(utf8_clean_string($username)) . "'";
+ $result = phpbb::$db->sql_query($sql);
+ $user_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$user_row)
{
@@ -81,9 +81,9 @@ class ucp_remind
$user_password = gen_rand_string(8);
$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
+ SET user_newpasswd = '" . phpbb::$db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . phpbb::$db->sql_escape($user_actkey) . "'
WHERE user_id = " . $user_row['user_id'];
- $db->sql_query($sql);
+ phpbb::$db->sql_query($sql);
include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
diff --git a/phpBB/modules/ucp/ucp_resend.php b/phpBB/modules/ucp/ucp_resend.php
index 35af962a2a..3d70485739 100644
--- a/phpBB/modules/ucp/ucp_resend.php
+++ b/phpBB/modules/ucp/ucp_resend.php
@@ -42,11 +42,11 @@ class ucp_resend
$sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason
FROM ' . USERS_TABLE . "
- WHERE user_email = '" . $db->sql_escape($email) . "'
- AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
- $result = $db->sql_query($sql);
- $user_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ WHERE user_email = '" . phpbb::$db->sql_escape($email) . "'
+ AND username_clean = '" . phpbb::$db->sql_escape(utf8_clean_string($username)) . "'";
+ $result = phpbb::$db->sql_query($sql);
+ $user_row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$user_row)
{
@@ -72,9 +72,9 @@ class ucp_resend
$sql = 'SELECT group_name, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_id = ' . $user_row['group_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $result = phpbb::$db->sql_query($sql);
+ $row = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
if (!$row)
{
@@ -121,10 +121,10 @@ class ucp_resend
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']);
- $result = $db->sql_query($sql);
+ WHERE ' . phpbb::$db->sql_in_set('user_id', $admin_ary[0]['a_user']);
+ $result = phpbb::$db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$messenger->template('admin_activate', $row['user_lang']);
$messenger->to($row['user_email'], $row['username']);
@@ -138,7 +138,7 @@ class ucp_resend
$messenger->send($row['user_notify_type']);
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
}
meta_refresh(3, append_sid('index'));
diff --git a/phpBB/modules/ucp/ucp_zebra.php b/phpBB/modules/ucp/ucp_zebra.php
index aa698eecae..1ac6888ca4 100644
--- a/phpBB/modules/ucp/ucp_zebra.php
+++ b/phpBB/modules/ucp/ucp_zebra.php
@@ -62,10 +62,10 @@ class ucp_zebra
FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u
WHERE z.user_id = ' . phpbb::$user->data['user_id'] . '
AND u.user_id = z.zebra_id';
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$friends = $foes = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
if ($row['friend'])
{
@@ -76,7 +76,7 @@ class ucp_zebra
$foes[] = utf8_clean_string($row['username']);
}
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
// remove friends from the username array
$n = sizeof($data['add']);
@@ -111,12 +111,12 @@ class ucp_zebra
{
$sql = 'SELECT user_id, user_type
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('username_clean', $data['add']) . '
+ WHERE ' . phpbb::$db->sql_in_set('username_clean', $data['add']) . '
AND user_type <> ' . phpbb::USER_INACTIVE;
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$user_id_ary = array();
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
if ($row['user_id'] != ANONYMOUS && $row['user_type'] != phpbb::USER_IGNORE)
{
@@ -127,7 +127,7 @@ class ucp_zebra
$error[] = phpbb::$user->lang['NOT_ADDED_' . $l_mode . '_ANONYMOUS'];
}
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
if (sizeof($user_id_ary))
{
@@ -169,7 +169,7 @@ class ucp_zebra
);
}
- $db->sql_multi_insert(ZEBRA_TABLE, $sql_ary);
+ phpbb::$db->sql_multi_insert(ZEBRA_TABLE, $sql_ary);
$updated = true;
}
@@ -188,8 +188,8 @@ class ucp_zebra
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . phpbb::$user->data['user_id'] . '
- AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
- $db->sql_query($sql);
+ AND ' . phpbb::$db->sql_in_set('zebra_id', $data['usernames']);
+ phpbb::$db->sql_query($sql);
$updated = true;
}
@@ -224,14 +224,14 @@ class ucp_zebra
AND $sql_and
AND u.user_id = z.zebra_id
ORDER BY u.username_clean ASC";
- $result = $db->sql_query($sql);
+ $result = phpbb::$db->sql_query($sql);
$s_username_options = '';
- while ($row = $db->sql_fetchrow($result))
+ while ($row = phpbb::$db->sql_fetchrow($result))
{
$s_username_options .= '<option value="' . $row['zebra_id'] . '">' . $row['username'] . '</option>';
}
- $db->sql_freeresult($result);
+ phpbb::$db->sql_freeresult($result);
$template->assign_vars(array(
'L_TITLE' => phpbb::$user->lang['UCP_ZEBRA_' . $l_mode],