mam napisany skrypcik do IPB

  1. <?
  2.  
  3. // ---------------------------- < setting > ---------------------------- //
  4. $NEWS_FORUM         = 262;                                                    // News forum.
  5. $NEWS_LIMIT         = 10;                                                     // Show a max of x news.
  6. $HOME_NAME            = da';                                            // Website's name.
  7. $HOME_URL            = 'http://www.veum.com';                                // Website's url.
  8. $HOME_DESCRIPTION    = daa';                                    // Website's description.
  9. $BOARD_PATH            = './';                                            // Board PATH.
  10. // --------------------------- < / setting > --------------------------- //
  11.  
  12.  
  13. define( 'ROOT_PATH'  , $BOARD_PATH );
  14. define ( 'USE_SHUTDOWN', 1 );
  15. define ( 'IN_IPB', 1 );
  16. define ( 'IN_DEV', 0 );
  17. error_reporting  (E_ERROR | E_WARNING | E_PARSE);
  18.  
  19. //-----------------------------------------------
  20. // Require files :
  21. //-----------------------------------------------
  22. include ROOT_PATH.'conf_global.php';
  23. include ROOT_PATH.'sources/functions.php';
  24. $std   = new FUNC;
  25.  
  26. //-----------------------------------------------
  27. // Class info :
  28. //-----------------------------------------------
  29. class info {
  30.     var $input      = array();
  31.     var $base_url   = &#092;"\";
  32.     var $vars       = &#092;"\";
  33.     
  34.     function info()
  35.         {
  36.             global $sess, $std, $DB, $INFO;
  37.             $this->vars = &$INFO;
  38.         }
  39. }        // End of class info.
  40.  
  41.  
  42. //-----------------------------------------------
  43. // DB Connexion
  44. //-----------------------------------------------
  45. $INFO['sql_driver'] = ! $INFO['sql_driver'] ? 'mysql' : strtolower($INFO['sql_driver']);
  46. require ( ROOT_PATH.'ips_kernel/class_db_'.$INFO['sql_driver'].&#092;".php\" );
  47.  
  48. $DB = new db_driver;
  49.     $DB->obj['sql_database']     = $INFO['sql_database'];
  50.     $DB->obj['sql_user']         = $INFO['sql_user'];
  51.     $DB->obj['sql_pass']         = $INFO['sql_pass'];
  52.     $DB->obj['sql_host']         = $INFO['sql_host'];
  53.     $DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
  54.     $DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$INFO['sql_driver'].'_queries.php';
  55.     $DB->obj['use_shutdown']     = USE_SHUTDOWN;
  56. $DB->connect();
  57.  
  58.  
  59. //-----------------------------------------------
  60. // The query :
  61. //-----------------------------------------------
  62. $DB->query(&#092;"SELECT t.*, p.*
  63.             FROM &#092;".SQL_PREFIX.\"topics t
  64.                     LEFT JOIN &#092;".SQL_PREFIX.\"posts p ON (p.new_topic = 1 AND p.topic_id = t.tid)
  65.             WHERE t.forum_id=&#092;".$NEWS_FORUM.\" AND t.approved=1 ORDER BY t.tid DESC LIMIT 0, \".$NEWS_LIMIT);
  66.  
  67.  
  68. //-----------------------------------------------
  69. // RSS header :
  70. //-----------------------------------------------
  71. header(&#092;"Content-Type: text/xml; charset=ISO-8859-2\");
  72. header(&#092;"Cache-Control: no-cache\");
  73. $RSS_header = &#092;"<?xml version='1.0' encoding='ISO-8859-2'?>
  74. <rss version='2.0'>
  75.     <channel>
  76.         <title>\".$HOME_NAME.\"</title>
  77.         <link>\".$HOME_URL.\"</link>
  78.         <generator>by Spanner</generator>\";
  79.  
  80.  
  81. //-----------------------------------------------
  82. // RSS header :
  83. //-----------------------------------------------
  84. $RSS_item = '';
  85. while ( $DATABASE_DATA = $DB->fetch_row() )
  86.     {
  87.         // Suppression HTML et bbCode :
  88.         $post = $DATABASE_DATA['post'];
  89.         $post = preg_replace( '#[(.+?)](.+?)[/(.+?)]#is',             '' ,     $post );        // Vire le bbCode.
  90.         $post = preg_replace( '#<a (.+?)>(.*?)</a>#is',                 '2',     $post );        // Vire le HTML.
  91.         $post = preg_replace( '#<!--emo(.*?)-->(.*?)<!--endemo-->#ie',    '',        $post );        // Vire les émoticons.
  92.         $post = preg_replace( '#<b>(.*?)</b>#is',                         '2',     $post );
  93.         $post = preg_replace( '#<u>(.*?)</u>#is',                         '2',     $post );
  94.         $post = preg_replace( '#<i>(.*?)</i>#is',                         '2',     $post );
  95.         $post = str_replace ( '<br />',                                 ' ',     $post );
  96.  
  97.         $RSS_item .= \"<item>
  98.             <link>\".$HOME_URL.\"/index.php?showtopic=\".$DATABASE_DATA['tid'].\"</link>
  99.             <pubDate>\".gmdate('d M Y H:i', $DATABASE_DATA['post_date']).\"</pubDate>
  100.             <title>\".$DATABASE_DATA['title'].\"</title>
  101.             <description>\".$post.\"</description>
  102.          </item>\";
  103. }
  104.  
  105.  
  106. //-----------------------------------------------
  107. // RSS header :
  108. //-----------------------------------------------
  109. $RSS_footer = \"</channel>
  110. </rss>\";
  111.  
  112.  
  113. //-----------------------------------------------
  114. // Show RSS :
  115. //-----------------------------------------------
  116. $show_RSS = $RSS_header.$RSS_item.$RSS_footer;
  117.  
  118. echo $show_RSS;
  119.  
  120. $DB->close_DB();    // Fermeture mySQL.
  121.  
  122. ?>


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ś ?