header("Preved: Krosavcheg!"); $forum_version = 'SMF 1.0.6'; // Get everything started up... define('SMF', 1); @set_magic_quotes_runtime(0); //error_reporting(E_ALL); $time_start = microtime(); // Load the settings... require_once('forum/Settings.php'); // Just in case something happens to Settings.php, let's try to at least load an error screen. //if (!isset($sourcedir)) $sourcedir = 'forum/Sources'; // And important includes. //require_once($sourcedir . '/QueryString.php'); require_once($sourcedir . '/Subs.php'); //require_once($sourcedir . '/Errors.php'); //require_once($sourcedir . '/Load.php'); //require_once($sourcedir . '/Security.php'); require_once("tpl.php"); // If $maintenance is set specifically to 2, then we're upgrading or something. if ($maintenance == 2) db_fatal_error(); // Connect to the MySQL database. if (empty($db_persist)) $db_connection = @mysql_connect($db_server, $db_user, $db_passwd); else $db_connection = @mysql_pconnect($db_server, $db_user, $db_passwd); // Show an error if the connection couldn't be made. if (!$db_connection || !@mysql_select_db($db_name, $db_connection)) db_fatal_error(); db_query("SET NAMES 'utf8'", __FILE__, __LINE__); if(!empty($_GET['id'])){ $id=intval($_GET['id']); $r=db_query("SELECT title, body, ID_MSG, ID_TOPIC, id_category FROM publications INNER JOIN smf_messages ON publications.id_post=smf_messages.ID_MSG WHERE id=$id ORDER BY timestamp DESC limit 1", __FILE__, __LINE__); if(mysql_num_rows($r)==0) { e404(); } $post=mysql_fetch_assoc($r); // if special - redirect to forum if ($post['id_category'] == 9) { header("Location: http://forum.rock.ru/index.php?topic={$post['ID_TOPIC']}.msg{$post['ID_MSG']}#msg{$post['ID_MSG']}"); } $context['title']=$post['title']; parsecode($post['body']); head(); $body = $post['body']; #die $r['id_category']; if (! in_array ($post['id_category'], array (3, 4))) { $body .= "
"; } block($post['title'],$body, true); foot(); } elseif(!empty($_GET['cat'])) { if (isset($_GET['page'])) { $page = intval($_GET['page']); } else { $page = 1; } if ($page > 0) $page -= 1; $start = $page * 10; $cat=intval($_GET['cat']); $r=db_query("SELECT name, urlname, reverse FROM categories WHERE id=$cat", __FILE__, __LINE__); if(mysql_num_rows($r)==0) { e404(); } list($category, $url, $reverse)=mysql_fetch_row($r); $context['title']=$category; if($reverse == 1) { $order = "ASC"; } else { $order = "DESC"; } $r=db_query("SELECT id, title, ID_MSG, ID_TOPIC, ID_MEMBER, posterName, brief, timestamp FROM publications INNER JOIN smf_messages ON publications.id_post=smf_messages.ID_MSG WHERE id_category=$cat ORDER BY timestamp $order LIMIT $start, 10", __FILE__, __LINE__); if(mysql_num_rows($r)==0) { e404(); } list($total_rows) = mysql_fetch_row( mysql_query("SELECT COUNT(*) FROM publications INNER JOIN smf_messages ON publications.id_post=smf_messages.ID_MSG WHERE id_category=$cat") ); $total_pages = ceil($total_rows/10); $txt=""; while($post=mysql_fetch_assoc($r)) { parsecode($post['brief']); $txt.=''.$post['brief'].'