{$config['home_title']} {$config['http_home_url']} ru {$config['description']} Files-Sib.NET XML; if($doaction=="comments"){ if($id = intval($_GET['news'])){ $where = "AND post_id = '".intval($id)."'"; }else{$where = "";} $sql_comments = "SELECT c.autor, c.text, c.post_id, c.autor, p.alt_name FROM " . PREFIX . "_comments c, " . PREFIX . "_post p WHERE c.post_id=p.id $where order by c.date desc limit 0,". $config['rss_comm_number']; $sql_result = $db->query ($sql_comments); $i = 0; while ($row = $db->get_row ($sql_result)){ $i++; $author = "".$row['autor'].""; $row['text'] = preg_replace ( "#\[hide\](.+?)\[/hide\]#is", "Текст только для зарегистрированных", $row['text'] ); $full_link = $config['http_home_url'] . $row['post_id'] . "-" . $row['alt_name'] . ".html"; $rss_content .= << #{$i} {$full_link}
: {$author}]]>
{$row['autor']} XML; } } elseif ($doaction=="news") { if($category_id = get_ID ( $cat_info, $_GET['category'])){ $get_cats = get_sub_cats ( $category_id ); if ($config['allow_multi_category']) { $where_category = "AND category regexp '[[:<:]](" . $get_cats . ")[[:>:]]'"; } else { $get_cats = str_replace ( "|", "','", $get_cats ); $where_category = "AND category IN ('" . $get_cats . "')"; } } else $where_category = ""; $sql_select = "SELECT id, autor, date, short_story, title, category, alt_name, remote_addr FROM cms_post WHERE approve {$where_category}"; if ($config['rss_mtype']) $sql_select .= " AND allow_main=1"; $sql_select .= " ORDER BY " . $config['news_sort'] . " " . $config['news_msort'] . " LIMIT 0," . $config['rss_number']; $sql_results = $db->query($sql_select); $i = 0; while($row = $db->get_row($sql_results)){ $i++; $date = date( $row['date'] ); if( $row['remote_addr'] != "" ) {$full_link = $config['http_home_url'] . "out.php?url=" . rawurlencode( base64_encode( $row['remote_addr'] ) ); } else {$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";} $rss_content .= << {$row['title']} {$full_link} {$full_link} {$row['autor']} {$date} XML; } } $rss_content .= '
'; header( 'Content-type: application/xml' ); die($rss_content); ?>