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

[ticket/10484] Use variables for sql_build_query() calls

It's easier for mods/extensions to extend the arrays.

PHPBB3-10484
This commit is contained in:
Joas Schilling
2011-11-21 16:22:07 +01:00
parent ff91c037c9
commit 4c77903129
7 changed files with 47 additions and 38 deletions

View File

@@ -943,7 +943,7 @@ if (!sizeof($post_list))
// We need to grab it because we do reverse ordering sometimes
$max_post_time = 0;
$sql = $db->sql_build_query('SELECT', array(
$sql_ary = array(
'SELECT' => 'u.*, z.friend, z.foe, p.*',
'FROM' => array(
@@ -954,14 +954,15 @@ $sql = $db->sql_build_query('SELECT', array(
'LEFT_JOIN' => array(
array(
'FROM' => array(ZEBRA_TABLE => 'z'),
'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
)
'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id',
),
),
'WHERE' => $db->sql_in_set('p.post_id', $post_list) . '
AND u.user_id = p.poster_id'
));
AND u.user_id = p.poster_id',
);
$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);