News

drlevine

Registered
Код:
<?php    

//Тук посочваш от кой раздел на форума искаш да ти изкара новините 
$forum = '1';    
    
// Тук посочваш колко новини искаш да ти излизат в началната страница 
$limit = '3';    
    
// How to show the topics    
// full or blank ('')    
$show = 'full';    
    
// How to display the date and time if used    
// short or long    
$date_time = 'short';    
    
// How top display the topic link if usede    
// topic or phpbb    
$topic_link = 'topic';    
    
// Comments link - how to send them to comments    
// topic or reply    
$comment = 'topic';    
    
// ТУК ПОСОЧВАШ КЪДЕ СЕ НАМИРА ФОРУМА ПРИМЕРНО ТУК Е В ПАПКАТА "FORUM" 
$phpbb_root_path = 'C:\Program Files\xampp\htdocs\phpBB2\';    
//    
	     #############################################    
	     ## НАДОЛО НЕДЕЙ ДА ПРОМЕНЯШ ДА НЕ ОБЪРКАШ СКРИПТА 
	     #############################################    
//
if ( !defined('IN_PHPBB') )    
{    
  define('IN_PHPBB', true);    
  include($phpbb_root_path  . 'extension.inc');    
  include($phpbb_root_path  . 'common.'.$phpEx);    
  include($phpbb_root_path  . 'config.'.$phpEx);    
}    
    
if ($show == '' || $show == 'full')    
{    
   // Select the topic information from the correct forum and set it to $grab_topics    
   $grab_topics = $db-> sql_query("SELECT * FROM `{$table_prefix}topics` WHERE `forum_id` = '{$forum}' ORDER BY `topic_id` DESC LIMIT {$limit}");    
}    
    
else if ($show == 'topic')    
{    
   $grab_topics = $db->sql_query("SELECT * FROM `{$table_prefix}topics` WHERE `forum_id` = '{$forum}' AND `topic_id` = '{$_GET['t']}' ORDER BY `topic_id` DESC");    
}    
        
// Grab the information using an array and set it to $echo_topic    
while ($echo_topic = $db->sql_fetchrow($grab_topics))    
{    
   // Select the post information from the correct forum and set it to $grab_posts    
   $grab_posts = $db->sql_query("SELECT * FROM `{$table_prefix}posts` WHERE `forum_id` = '{$forum}' AND `topic_id` = '{$echo_topic['topic_id']}' LIMIT 1");    
        
   // Grab the information using an array and set it to $echo_post    
   while ($echo_post = $db->sql_fetchrow($grab_posts))    
   {    
      // Now get the post_text using the post_id were looking at and sort it info $grab_posts_text    
      $grab_posts_text = $db->sql_query("SELECT * FROM `{$table_prefix}posts_text` WHERE `post_id` = '{$echo_post['post_id']}'");    
            
      // Grab the information using an array and set it to $echo_text    
      while($echo_text = $db->sql_fetchrow($grab_posts_text))    
      {    
         // Find the user the posted    
         $find_user = $db->sql_query("SELECT * FROM `{$table_prefix}users` WHERE `user_id` = '{$echo_post['poster_id']}'");    
              
         // Sort this users info into array for the post    
         while ($echo_user = $db->sql_fetchrow($find_user))    
         {    
                    
            // Get rid of all those annoying characters from bbcode    
            $echo_text = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $echo_text);        
                  
            // BBCode    
            $echo_text = str_replace("[b]","<strong>",$echo_text);    
            $echo_text = str_replace("[/b]","</strong>",$echo_text);    
                    
            $echo_text = str_replace("[i]","<em>",$echo_text);    
            $echo_text = str_replace("[/i]","</em>",$echo_text);    
                    
            $echo_text = str_replace("[u]","<u>",$echo_text);    
            $echo_text = str_replace("[/u]","</u>",$echo_text);    
                    
            $echo_text = preg_replace('/\[quote="(.*)\"](.*)\[\/quote\]/Usi','<div style=\"Verdana: 7px\">$2</div>',$echo_text);    
                  
            $echo_text = str_replace("[quote]","<strong>Quote</strong><em>",$echo_text);    
            $echo_text = str_replace("[/quote]","</em>",$echo_text);    
                    
            $echo_text = str_replace("[code]","<strong>Code</strong><em>",$echo_text);    
            $echo_text = str_replace("
","</em>",$echo_text);

$echo_text = preg_replace('/\[list\](.*)\[\/list\]/si',"<div style=\"Verdana: 7px\">$1</div>",$echo_text);
$echo_text = preg_replace('/\
 
Код:
 if ( !defined('IN_PHPBB') )    
{


когато линка към форума е http://127.0.0.1 ... е друга грешката :(



Код:
Hacking attempt
Fatal error: Call to a member function sql_query() on a non-object in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 43


43ти ред

Код:
   $grab_topics = $db-> sql_query("SELECT * FROM `{$table_prefix}topics` WHERE `forum_id` = '{$forum}' ORDER BY `topic_id` DESC LIMIT {$limit}");    
}
 
Warning: include(phpBB2/extension.inc) [function.include]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 35

Warning: include() [function.include]: Failed opening 'phpBB2/extension.inc' for inclusion (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 35

Warning: include(phpBB2/common.) [function.include]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 36

Warning: include() [function.include]: Failed opening 'phpBB2/common.' for inclusion (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 36

Warning: include(phpBB2/config.) [function.include]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 37

Warning: include() [function.include]: Failed opening 'phpBB2/config.' for inclusion (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 37

Fatal error: Call to a member function sql_query() on a non-object in C:\Program Files\xampp\htdocs\phpBB2\news.php on line 43
 
в случая папката на форума ти трябва да е както тук в туриста ......... демек, http://сайта.com/forum/ ........ а не така http://forum.сайта.com/
ако пак не можеш да ме разбереш форума не трябва да е като субдомейн, а като поддиректория :?:
 

Back
Горе