<? // ---------------------------- < setting > ---------------------------- // $NEWS_FORUM = 262; // News forum. $NEWS_LIMIT = 10; // Show a max of x news. $HOME_NAME = da'; // Website's name. $HOME_URL = 'http://www.veum.com'; // Website's url. $HOME_DESCRIPTION = daa'; // Website's description. $BOARD_PATH = './'; // Board PATH. // --------------------------- < / setting > --------------------------- // //----------------------------------------------- // Require files : //----------------------------------------------- include ROOT_PATH.'conf_global.php'; include ROOT_PATH.'sources/functions.php'; $std = new FUNC; //----------------------------------------------- // Class info : //----------------------------------------------- class info { var $base_url = \"\"; var $vars = \"\"; function info() { $this->vars = &$INFO; } } // End of class info. //----------------------------------------------- // DB Connexion //----------------------------------------------- require ( ROOT_PATH.'ips_kernel/class_db_'.$INFO['sql_driver'].\".php\" ); $DB = new db_driver; $DB->obj['sql_database'] = $INFO['sql_database']; $DB->obj['sql_user'] = $INFO['sql_user']; $DB->obj['sql_pass'] = $INFO['sql_pass']; $DB->obj['sql_host'] = $INFO['sql_host']; $DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; $DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_queries.php'; $DB->obj['use_shutdown'] = USE_SHUTDOWN; $DB->connect(); //----------------------------------------------- // The query : //----------------------------------------------- $DB->query(\"SELECT t.*, p.* FROM \".SQL_PREFIX.\"topics t WHERE t.forum_id=\".$NEWS_FORUM.\" AND t.approved=1 ORDER BY t.tid DESC LIMIT 0, \".$NEWS_LIMIT); //----------------------------------------------- // RSS header : //----------------------------------------------- $RSS_header = \"<?xml version='1.0' encoding='ISO-8859-2'?> <rss version='2.0'> <channel> <title>\".$HOME_NAME.\"</title> <link>\".$HOME_URL.\"</link> <generator>by Spanner</generator>\"; //----------------------------------------------- // RSS header : //----------------------------------------------- $RSS_item = ''; while ( $DATABASE_DATA = $DB->fetch_row() ) { // Suppression HTML et bbCode : $post = $DATABASE_DATA['post']; $post = preg_replace( '#[(.+?)](.+?)[/(.+?)]#is', '' , $post ); // Vire le bbCode. $post = preg_replace( '#<a (.+?)>(.*?)</a>#is', '2', $post ); // Vire le HTML. $post = preg_replace( '#<!--emo(.*?)-->(.*?)<!--endemo-->#ie', '', $post ); // Vire les émoticons. $post = preg_replace( '#<b>(.*?)</b>#is', '2', $post ); $post = preg_replace( '#<u>(.*?)</u>#is', '2', $post ); $post = preg_replace( '#<i>(.*?)</i>#is', '2', $post ); $post = str_replace ( '<br />', ' ', $post ); $RSS_item .= \"<item> <link>\".$HOME_URL.\"/index.php?showtopic=\".$DATABASE_DATA['tid'].\"</link> <pubDate>\".gmdate('d M Y H:i', $DATABASE_DATA['post_date']).\"</pubDate> <title>\".$DATABASE_DATA['title'].\"</title> <description>\".$post.\"</description> </item>\"; } //----------------------------------------------- // RSS header : //----------------------------------------------- $RSS_footer = \"</channel> </rss>\"; //----------------------------------------------- // Show RSS : //----------------------------------------------- $show_RSS = $RSS_header.$RSS_item.$RSS_footer; echo $show_RSS; $DB->close_DB(); // Fermeture mySQL. ?>
i mam z nim problem, otórz w lini
Cytat
$NEWS_FORUM = 262; // News forum.
należy podać ID forum, z którego chcemy czytać, a chcialbym dać kilka pokoi i tu pojawia się błąd, gdyż nie nie można oddzielić zapytań przecinkami, a drugie moje pytanie jest takie, gdy daje jakieś forum, a w topiku na początku jest zdjęcie to pluje się że jest błąd w pliku, podobnie dzieje się czasami gdy w topiku są wypunktowania. możecie mi pomóc jakoś ?