} } else { titania::page_header(titania::$contrib->contrib_name . ' - ' . phpbb::$user->lang['FAQ_LIST']); titania::_include('functions_display', 'titania_topic_folder_img'); // Setup the sort tool $sort = new titania_sort(); $sort->set_url(titania::$contrib->get_url('faq')); $sort->set_defaults(phpbb::$config['topics_per_page']); $sort->request(); $faqs = array(); $sql_ary = array('SELECT' => 'f.*', 'FROM' => array(TITANIA_CONTRIB_FAQ_TABLE => 'f'), 'WHERE' => 'f.contrib_id = ' . titania::$contrib->contrib_id . ' AND f.faq_access >= ' . titania::$access_level, 'ORDER_BY' => 'f.left_id ASC'); // Main SQL Query $sql = phpbb::$db->sql_build_query('SELECT', $sql_ary); // Handle pagination if ($sort->sql_count($sql_ary, 'faq_id')) { $sort->build_pagination($faq->get_url()); // Get the data $result = phpbb::$db->sql_query_limit($sql, $sort->limit, $sort->start); while ($row = phpbb::$db->sql_fetchrow($result)) { $faqs[$row['faq_id']] = $row; } phpbb::$db->sql_freeresult($result); // Grab the tracking info titania_tracking::get_tracks(TITANIA_FAQ, array_keys($faqs)); } // Output foreach ($faqs as $id => $row) { // @todo probably should setup an edit time or something for better read tracking in case it was edited $folder_img = $folder_alt = ''; $unread = titania_tracking::get_track(TITANIA_FAQ, $id, true) === 0 ? true : false;