sql_query($sql)) { message_die(GENERAL_ERROR, "Could not get topic id by post id", '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $topic = $row['topic_id']; } // // Start RSS output // $rss_result = " ".make_xml_compatible($board_config['sitename'])." ".$base_url."index.".$phpEx." ".make_xml_compatible($board_config['site_desc'])." ".$board_config['default_lang']." (c) Copyright ".create_date("Y", time(), $board_config['board_timezone'])." by ".make_xml_compatible($board_config['sitename'])." ".$board_config['board_email']." ".$board_config['board_email']." ".create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])." ".create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])." http://backend.userland.com/rss phpBB2 RSS Syndication Mod by Lucas 1 ".make_xml_compatible($board_config['sitename'])." ".$board_config['rss_image']." ".$base_url." ".make_xml_compatible($board_config['site_desc'])." "; // // Get latest topics // if(!$topic && !$forum) { // // This SQL Code selects the latest topics on he forum // $sql = "SELECT t.topic_title, t.topic_last_post_id, t.forum_id, p.post_time, pt.post_text, pt.bbcode_uid, u.username, u.user_id FROM ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".POSTS_TEXT_TABLE." pt, ".USERS_TABLE." u WHERE t.topic_status != 1 AND p.post_id = t.topic_last_post_id AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY t.topic_last_post_id DESC LIMIT 0, ".intval($board_config['max_rss_topics']); if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not get Latest topics", '', __LINE__, __FILE__, $sql); } while($row = $db->sql_fetchrow($result)) { $is_auth = array(); $is_auth = auth(AUTH_ALL, $row['forum_id'], $userdata); if($is_auth['auth_view'] && $is_auth['auth_read']) { $description = " ".$lang['Author'].": ".$row['username']."
".$lang['Posted'].": ".create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])."

".$row['post_text']; $rss_result .= " ".make_xml_compatible(strip_tags($row['topic_title']))." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['topic_last_post_id']."#".$row['topic_last_post_id']." ".make_xml_compatible($description, $row['bbcode_uid'], true)." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['topic_last_post_id']."#".$row['topic_last_post_id']." ".make_xml_compatible($row['username'])." ".create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['topic_last_post_id']."#".$row['topic_last_post_id']." "; } } } if($topic && !$forum) { // // This SQL query selects the latest posts of a topic // $sql = "SELECT p.post_id, p.post_time, pt.post_text, pt.bbcode_uid, pt.post_subject, t.topic_title, t.forum_id, u.username, u.user_id FROM ".POSTS_TABLE." p, ".POSTS_TEXT_TABLE." pt, ".TOPICS_TABLE." t, ".USERS_TABLE." u WHERE p.topic_id = ".intval($topic)." AND pt.post_id = p.post_id AND t.topic_id = p.topic_id AND u.user_id = p.poster_id ORDER BY p.post_time DESC LIMIT 0, ".intval($board_config['max_rss_topics']); if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not get Latest posts", '', __LINE__, __FILE__, $sql); } $auth_loaded = false; while($row = $db->sql_fetchrow($result)) { if(!$auth_loaded) { $is_auth = array(); $is_auth = auth(AUTH_ALL, $row['forum_id'], $userdata); $auth_loaded = true; } if($is_auth['auth_view'] && $is_auth['auth_read']) { $description = " ".$lang['Author'].": ".$row['username']."
".$lang['Posted'].": ".create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])."

".$row['post_text']; $rss_result .= " ".make_xml_compatible(strip_tags(($row['post_subject'] != '' ? $row['post_subject'] : "Re: ".$row['topic_title'])))." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['post_id']."#".$row['post_id']." ".make_xml_compatible($description, $row['bbcode_uid'], true)." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['post_id']."#".$row['post_id']." ".make_xml_compatible($row['username'])." ".create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['post_id']."#".$row['post_id']." "; } } } if($forum && !$topic) { // // This SQL query selects the latest topics of a specific forum // $sql = "SELECT t.topic_title, t.topic_last_post_id, p.post_time, pt.post_text, pt.bbcode_uid, u.username, u.user_id FROM ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".POSTS_TEXT_TABLE." pt, ".USERS_TABLE." u WHERE t.forum_id = ".intval($forum)." AND t.topic_status != 1 AND p.post_id = t.topic_last_post_id AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY t.topic_last_post_id DESC LIMIT 0, ".intval($board_config['max_rss_topics']); if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not get Latest topics", '', __LINE__, __FILE__, $sql); } $is_auth = array(); $is_auth = auth(AUTH_ALL, $forum, $userdata); while($row = $db->sql_fetchrow($result)) { if($is_auth['auth_view'] && $is_auth['auth_read']) { $description = " ".$lang['Author'].": ".$row['username']."
".$lang['Posted'].": ".create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])."

".$row['post_text']; $rss_result .= " ".make_xml_compatible(strip_tags($row['topic_title']))." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['topic_last_post_id']."#".$row['topic_last_post_id']." ".make_xml_compatible($description, $row['bbcode_uid'], true)." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['topic_last_post_id']."#".$row['topic_last_post_id']." ".make_xml_compatible($row['username'])." ".create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone'])." ".$base_url."viewtopic.".$phpEx."?".POST_POST_URL."=".$row['topic_last_post_id']."#".$row['topic_last_post_id']." "; } } } $rss_result .= "
"; header("Content-type: text/xml", true); echo $rss_result; ?>