1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-21 10:40:58 +02:00

A few fixes and a new online_status template variable

git-svn-id: file:///svn/phpbb/trunk@5390 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Tom Beddard
2005-12-29 01:46:51 +00:00
parent 2753d3310c
commit 844da81dfa

View File

@ -131,11 +131,11 @@ if ($view && !$post_id)
} }
// Check for global announcement correctness? // Check for global announcement correctness?
if ((!$row || !$row['forum_id']) && !$forum_id) if ((!isset($row) || !$row['forum_id']) && !$forum_id)
{ {
trigger_error('NO_TOPIC'); trigger_error('NO_TOPIC');
} }
else if ($row['forum_id']) else if (isset($row) && $row['forum_id'])
{ {
$forum_id = $row['forum_id']; $forum_id = $row['forum_id'];
} }
@ -902,7 +902,7 @@ while ($row = $db->sql_fetchrow($result))
'www' => $row['user_website'], 'www' => $row['user_website'],
'aim' => ($row['user_aim']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=aim&u=$poster_id" : '', 'aim' => ($row['user_aim']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=aim&u=$poster_id" : '',
'msn' => ($row['user_msnm']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=msnm&u=$poster_id" : '', 'msn' => ($row['user_msnm']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=msnm&u=$poster_id" : '',
'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg' : '', 'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg' : '',
'jabber' => ($row['user_jabber']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=jabber&u=$poster_id" : '', 'jabber' => ($row['user_jabber']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=jabber&u=$poster_id" : '',
'search' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&search_author=" . urlencode($row['username']) .'&showresults=posts' : '', 'search' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&search_author=" . urlencode($row['username']) .'&showresults=posts' : '',
'username' => ($row['user_colour']) ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster 'username' => ($row['user_colour']) ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster
@ -1281,6 +1281,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'POST_ICON_IMG_HEIGHT' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '', 'POST_ICON_IMG_HEIGHT' => (!empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '',
'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'], 'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'],
'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE')), 'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE')),
'ONLINE_STATUS' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? "posting.$phpEx$SID&amp;mode=edit&amp;f=$forum_id&amp;p=" . $row['post_id'] : '', 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? "posting.$phpEx$SID&amp;mode=edit&amp;f=$forum_id&amp;p=" . $row['post_id'] : '',
'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? "posting.$phpEx$SID&amp;mode=quote&amp;f=$forum_id&amp;p=" . $row['post_id'] : '', 'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? "posting.$phpEx$SID&amp;mode=quote&amp;f=$forum_id&amp;p=" . $row['post_id'] : '',
@ -1318,7 +1319,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_FIRST_UNREAD' => $s_first_unread, 'S_FIRST_UNREAD' => $s_first_unread,
'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false 'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false
); );
if (isset($cp_row['row']) && sizeof($cp_row['row'])) if (isset($cp_row['row']) && sizeof($cp_row['row']))
{ {
$postrow = array_merge($postrow, $cp_row['row']); $postrow = array_merge($postrow, $cp_row['row']);