80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; $index_url = $server_protocol . $server_name . $server_port . $index; $viewtopic_url = $server_protocol . $server_name . $server_port . $viewtopic; $rdf = " " . $board_config['sitename'] . " Forum " . $index_url . " " . $board_config['site_desc'] . " "; $fid = ( isset($HTTP_GET_VARS['fid']) ) ? intval($HTTP_GET_VARS['fid']) : ''; $sql_where = ( !empty($fid) ) ? " AND f.forum_id = $fid " : " "; // SQL statement to fetch active topics of public forums $sql = "SELECT DISTINCT t.topic_title, t.topic_last_post_id, p.post_time, f.forum_name FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f WHERE t.forum_id = f.forum_id AND f.auth_view = " . AUTH_ALL . " AND p.topic_id = t.topic_id AND p.post_id = t.topic_last_post_id $sql_where ORDER BY p.post_time DESC LIMIT $count"; $topics_query = $db->sql_query($sql); if ( !$topics_query ) { die("Failed obtaining list of active topics"); } else { $topics = $db->sql_fetchrowset($topics_query); } if ( count($topics) == 0 ) { die("No topics found"); } else { // $topics contains all interesting data for ($i = 0; $i < count($topics); $i++) { $title = $topics[$i]['topic_title']; $url = $viewtopic_url . "?" . POST_POST_URL . "=" . $topics[$i]['topic_last_post_id'] . "#" . $topics[$i]['topic_last_post_id']; $rdf .= " " . $title . " " . $url . " "; } } // Create RDF footer $rdf .= " "; // Output the RDF echo $rdf; ?>