50 ) ? 50: $count; Ãß°¡: count ÃÖ´ë°ª 50 */ // Includes of phpBB scripts define ('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/bbcode.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // // If not set, set the output count to 15 $count = ( isset($_GET['c']) ) ? intval($_GET['c']) : 15; $count = ( $count == 0 ) ? 15 : $count; $count = ( $count > 50 ) ? 50: $count; // Check for cat_id in query // 'c'´Â ÀÌ¹Ì ¿¹¾àµÇ¾î À־ 'ct'·Î ´ë½ÅÇÕ´Ï´Ù. $cat_id = ( isset($_GET['ct']) ) ? explode(',', str_replace(' ', '', $_GET['ct'])) : ''; if ( !empty($cat_id) ) { $cat_list = implode('\',\'', $cat_id); /* cat_id¿¡ ÇØ´çÇÏ´Â forum_id¸¦ °¡Á®¿É´Ï´Ù. */ /* forum_id¸¦ °¡Á®¿À´Â ÀÌÀ¯´Â, cat_id¿Í forum_id¸¦ µ¿½Ã¿¡ »ç¿ëÇÏ´Â °æ¿ì¸¦ ´ëºñÇϱâ À§ÇÔÀÔ´Ï´Ù. */ $sql_check_cat_id = "SELECT f.forum_id FROM " . FORUMS_TABLE . " AS f WHERE f.cat_id in ('" . $cat_list . "') AND f.auth_view = " . AUTH_ALL; $check_cat_query = $db->sql_query($sql_check_cat_id); if ( $db->sql_numrows($check_cat_query) < 1 ) { message_die(GENERAL_MESSAGE, $lang['No_match']); } while ($cat_data = $db->sql_fetchrow($check_cat_query)) { $forum_lists[] = $cat_data['forum_id']; } // $_GET['f'] ¿¡ Á÷Á¢ Ãß°¡Çصµ ±¦ÂúÀ»±î¿ä? if ( isset($_GET['f']) ) $_GET['f'] .= ','.implode(',', $forum_lists); else $_GET['f'] = implode(',', $forum_lists); } // Check for forum_id in query //$forum_id = ( isset($_GET['f']) ) ? intval($_GET['f']) : ''; //$sql_where = ( !empty($forum_id) ) ? ' AND f.forum_id = ' . $forum_id : ' '; // -- forum_id¸¦ ¿©·¯°³ ÀԷ¹޵µ·Ï ÇÕ´Ï´Ù -- $forum_id = ( isset($_GET['f']) ) ? explode(',', str_replace(' ', '', $_GET['f'])) : ''; if ( !empty($forum_id) ) { $forum_list = implode('\',\'', $forum_id); /* forum_id°¡ À¯È¿ÇÑÁö °Ë»çÇÏ·Á¸é ¾Æ·¡ ÁÖ¼®À» ÇØÁ¦ÇϽʽÿä. */ /* À¯È¿¼º °Ë»ç¸¦ ÇÏÁö ¾ÊÀ¸¸é À߸øµÈ forum_id´Â ¹«½ÃµÇ¾î rss¿¡ Ãâ·ÂµÇÁö ¾ÊÀ»°ÍÀÔ´Ï´Ù. */ /* $sql_check_forum_id = "SELECT count(*) AS cnt FROM " . FORUMS_TABLE . " AS f WHERE f.forum_id in ('" . $forum_list . "') AND AND f.auth_view = " . AUTH_ALL; $check_forum_query = $db->sql_query($sql_check_forum_id); if ( $db->sql_numrows($check_forum_query) < 1 ) { message_die(GENERAL_ERROR, "DB Query error", "", __LINE__, __FILE__, $sql_check_forum_id); } $check_data = $db->sql_fetchrowset($check_forum_query); if ( $check_data[0]['cnt'] != count($forum_id) ) { // invalid forum_id in 'f=' query list message_die(GENERAL_MESSAGE, $lang['No_match']); } */ $sql_where = ' AND f.forum_id in (\'' . $forum_list . '\')'; } else $sql_where = ' '; // ÀÎÄÚµù ¼³Á¤ Ãß°¡ $set_encoding = ( isset($_GET['encoding']) ) ? $_GET['encoding'] : $lang['ENCODING']; // Create main board url (some code borrowed from functions_post.php) $script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path'])); $viewtopic = ( $script_name != '' ) ? $script_name . '/viewtopic.' . $phpEx : 'viewtopic.'. $phpEx; $index = ( $script_name != '' ) ? $script_name . '/index.' . $phpEx : 'index.'. $phpEx; $server_name = trim($board_config['server_name']); $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; $site_name = strip_tags($board_config['sitename']); $site_description = strip_tags($board_config['site_desc']); $index_url = $server_protocol . $server_name . $server_port . $index; $viewtopic_url = $server_protocol . $server_name . $server_port . $viewtopic; // Initialise template $template->set_filenames(array( "body" => "rdf2_body.tpl") ); if ($set_encoding <> $lang['ENCODING'] ) { $encfrom = strtoupper($lang['ENCODING']); $encto = strtoupper($set_encoding); $site_name = iconv($encfrom,$encto,$site_name); $site_description = iconv($encfrom,$encto,$site_description); } $template->assign_vars(array( 'S_CONTENT_ENCODING' => $set_encoding, 'U_FORUM' => $index_url, 'FORUM_TITLE' => $site_name, 'FORUM_DESCRIPTION' => $site_description, 'PUBDATE' => gmdate('D, d M Y H:i:s T',time())) ); // SQL statement to fetch active topics of public forums $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id , pt.post_text , pt.bbcode_uid, p.post_time FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . POSTS_TEXT_TABLE . " AS pt WHERE t.forum_id = f.forum_id AND f.auth_view = " . AUTH_ALL . " AND p.topic_id = t.topic_id AND pt.post_id = p.post_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 ) { message_die(GENERAL_ERROR, "Could not query list of active topics", "", __LINE__, __FILE__, $sql); } else if ( !$db->sql_numrows($topics_query) ) { message_die(GENERAL_MESSAGE, $lang['No_match']); } else { while ($topic = $db->sql_fetchrow($topics_query)) { // Variable reassignment and reformatting for post text $post_text = $topic['post_text']; $post_text = str_replace("\n", "\n
\n", $post_text); $post_text = bbencode_second_pass($post_text, $topic['bbcode_uid']); $post_text = smilies_pass($post_text); $post_text = preg_replace("/$smilies_path/", $smilies_url, $post_text); $post_text = make_clickable($post_text); $post_text = htmlspecialchars($post_text); // °¡Áö°í ¿Â post time À» º¯È¯ //$post_time = create_date($board_config['default_dateformat'], $topic['post_time'], $board_config['board_timezone']); //$post_time = date("r",$topic['post_time']); $post_time = gmdate('D, d M Y H:i:s T',$topic['post_time']); // ±ÛÀÇ Á¦¸ñ °Ë»ç - ¸¶Áö¸· ? Á¦°Å $topic_title = htmlspecialchars(preg_replace("/(([\x80-\xFE].)*)[\x80-\xFE]?$/","\\1",$topic['topic_title'])); if ($set_encoding <> $lang['ENCODING'] ) { // Ãâ·Â ÀÎÄÚµù ¼³Á¤½Ã Á¦¸ñ°ú ³»¿ëÀÇ ÀÎÄÚµù ¹Ù²Þ $encfrom = strtoupper($lang['ENCODING']); $encto = strtoupper($set_encoding); $post_text = iconv($encfrom,$encto,$post_text); $topic_title = iconv($encfrom,$encto,$topic_title); } $template->assign_block_vars('topic_item', array( 'U_TOPIC' => $viewtopic_url . '?' . POST_POST_URL . '=' . $topic['topic_last_post_id'] . '#' . $topic['topic_last_post_id'], 'POST_TEXT' => $post_text, 'TOPIC_TITLE' => $topic_title, 'POST_TIME' => $post_time) ); } } // XML and nocaching headers, copied from page_header.php if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) { header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0'); } else { header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); } header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header ('Content-Type: text/xml; charset='.$set_encoding); // Output XML page $template->pparse('body'); ?>