rendered paste bodyif ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) { $self_sql = (intval($is_auth['auth_read']) == AUTH_SELF) ? " AND p.topic_id=t.topic_id AND t.topic_poster=u2.user_id AND ( u2.user_id=".$userdata['user_id']." OR t.topic_type = " . POST_ANNOUNCE .")" : ""; $topic_sql = $db->sql_build_query('SELECT', array( 'SELECT' => 't.topic_id, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_id, t.topic_last_post_id, t.topic_last_poster_colour, t.topic_last_post_time', 'FROM' => array(TOPICS_TABLE => 't'), 'WHERE' => 't.forum_id=' . $forum_id . ' AND t.topic_poster=' . $user->data['user_id'], 'ORDER_BY' => 't.topic_id DESC' )); $topic_result = $db->sql_query_limit($topic_sql, '1'); $topic_row = $db->sql_fetchrow($topic_result); } $last_poster_id = ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) ? $topic_row['topic_last_poster_id'] : $row['forum_last_poster_id']; $last_poster_name = ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) ? $topic_row['topic_last_poster_name'] : $row['forum_last_poster_name']; $last_poster_colour = ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) ? $topic_row['topic_last_poster_colour'] : $row['forum_last_poster_colour']; $last_post_id = ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) ? $topic_row['topic_last_post_id'] : $row['forum_last_post_id']; $last_post_subject = ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) ? $topic_row['forum_last_post_subject'] : $row['forum_last_post_subject']; $last_post_time = ( $auth->acl_get('f_selfview', $forum_id) && !$auth->acl_get('m_', $forum_id) ) ? $topic_row['topic_last_post_time'] : $row['forum_last_post_time'];