dir = ROOT_DIR . '/templates'; define( 'TEMPLATE_DIR', $tpl->dir ); //#################################################################################################################### // Определение категорий и их параметры //#################################################################################################################### $cat_info = get_vars( "category" ); if( ! $cat_info ) { $cat_info = array (); $db->query( "SELECT * FROM " . PREFIX . "_category ORDER BY posi ASC" ); while ( $row = $db->get_row() ) { $cat_info[$row['id']] = array (); foreach ( $row as $key => $value ) { $cat_info[$row['id']][$key] = $value; } } set_vars( "category", $cat_info ); $db->free(); } //################# Определение групп пользователей $user_group = get_vars( "usergroup" ); if( ! $user_group ) { $user_group = array (); $db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" ); while ( $row = $db->get_row() ) { $user_group[$row['id']] = array (); foreach ( $row as $key => $value ) { $user_group[$row['id']][$key] = $value; } } set_vars( "usergroup", $user_group ); $db->free(); } $member_id['user_group'] = 5; if( isset( $_REQUEST['year'] ) ) $year = intval( $_GET['year'] ); else $year = ''; if( isset( $_REQUEST['month'] ) ) $month = @$db->safesql( strip_tags( str_replace( '/', '', $_GET['month'] ) ) ); else $month = ''; if( isset( $_REQUEST['day'] ) ) $day = @$db->safesql( strip_tags( str_replace( '/', '', $_GET['day'] ) ) ); else $day = ''; if( isset( $_REQUEST['user'] ) ) $user = @$db->safesql( strip_tags( str_replace( '/', '', urldecode( $_GET['user'] ) ) ) ); else $user = ''; if( isset( $_REQUEST['news_name'] ) ) $news_name = @$db->safesql( strip_tags( str_replace( '/', '', $_GET['news_name'] ) ) ); else $news_name = ''; if( isset( $_REQUEST['newsid'] ) ) $newsid = intval( $_GET['newsid'] ); else $newsid = 0; if( isset( $_REQUEST['news_page'] ) ) $news_page = intval( $_GET['news_page'] ); else $news_page = 0; if( isset( $_REQUEST['category'] ) ) $category = @$db->safesql( strip_tags( str_replace( '/', '', $_GET['category'] ) ) ); else $category = ''; if (isset ( $_REQUEST['catalog'] )) $catalog = @$db->safesql ( substr ( strip_tags ( str_replace ( '/', '', urldecode ( $_GET['catalog'] ) ) ), 0, 3 ) ); else $catalog = ''; if( isset( $_REQUEST['category'] ) ) { if( substr( $_GET['category'], - 1, 1 ) == '/' ) $_GET['category'] = substr( $_GET['category'], 0, - 1 ); $category = explode( '/', $_GET['category'] ); $category = end( $category ); $category = $db->safesql( strip_tags( $category ) ); } else $category = ''; if( $category != '' ) $category_id = get_ID( $cat_info, $category ); else $category_id = false; $view_template = "rss"; $config['allow_cache'] = true; $config['allow_banner'] = false; $config['rss_number'] = intval( $config['rss_number'] ); $config['rss_format'] = intval( $config['rss_format'] ); $cstart = 0; if ( $user ) $config['allow_cache'] = false; if( $_GET['subaction'] == 'allnews' ) $config['home_title'] = $lang['show_user_news'] . ' ' . htmlspecialchars( $user ) . " - " . $config['home_title']; elseif( $_GET['do'] == 'cat' ) $config['home_title'] = stripslashes( $cat_info[$category_id]['name'] ) . " - " . $config['home_title']; $rss_content = << {$config['home_title']} {$config['http_home_url']} ru {$config['home_title']} DataLife Engine XML; if( $config['site_offline'] == "yes" or ! $config['allow_rss'] ) { $rss_content .= << RSS in offline mode RSS in offline mode undefined DataLife Engine DataLife Engine XML; } else { if( $config['rss_format'] == 1 ) { $tpl->template = << {title} {rsslink} {rsslink} {rssauthor} {rssdate} XML; } elseif( $config['rss_format'] == 2 ) { $rss_content = << {$config['home_title']} {$config['http_home_url']} ru {$config['home_title']} {$config['http_home_url']}yandexlogo.gif {$config['home_title']} {$config['http_home_url']} DataLife Engine XML; $tpl->template = << {title} {rsslink} {short-story} {category} {rssdate} {full-story} XML; } else { $tpl->template = << {title} {rsslink} {rsslink} {short-story} {category} {rssauthor} {rssdate} XML; } $tpl->copy_template = $tpl->template; include_once ENGINE_DIR . '/engine.php'; $rss_content .= $tpl->result['content']; } $rss_content .= ''; header( 'Content-type: application/xml' ); echo $rss_content; ?>