"more") { $result = mysql_fetch_array($res, MYSQL_ASSOC); if (count($result)==1) { sort ($result); return $result[0]; } return $result; }; $result = array (); for ($i = 0; $i html { $BBTagsSimple = array( 'b','i','u','s','sub','sup','h1','h2','h3','h4','h5','h6','code','li','right', 'left', 'center', 'php', 'youtube','gvideo','\*','img', ); //tags with (possible) value $BBTagsAttrib = array( 'email', 'color', 'size', 'font', 'align', 'quote', 'list' ); //'url' it'll be folded into furher $regexp = '/(\[\/?' . implode('(:[^\]\s]+)?\])|(\[\/?', $BBTagsSimple) . '(:[^\]\s]+)?\])'; $regexp.= '|(\[\/?' . implode('(\=[^\]\s]+)?(:[^\]\s]+)?\])|(\[\/?', $BBTagsAttrib) . '(\=[^\]\s]+)?(:[^\]\s]+)?\])'; $regexp .= '/'; $string = preg_replace('/\[url(:[^\]\s]+)?\](.*)\[\/url(:[^\]\s]+)?\]/U', '$2', $string); $string = preg_replace('/\[url\=([^\]]+)(:.+)?\](.*)(\[\/url(:[^\]\s]+)?\])/U', '$3', $string); $string = preg_replace($regexp, "", $string); return $string; } function getrights ($forum) // проверка прав ботов на чтение форума { global $table_prefix, $botaccess, $mask; if ($botaccess==false) return true; $t=S_ql ("SELECT * from {$table_prefix}forums WHERE id='$forum'"); $rights=unserialize (stripslashes ($t['permission_array'])); if ($rights['read_perms']=="*") return true; $p=explode (",",$rights['read_perms']); if (in_array ($mask, $p)) return true; return false; } // подключаем конфиги форума include "conf_global.php"; $dbhost=$INFO['sql_host']; $dbuser=$INFO['sql_user']; $dbpasswd=$INFO['sql_pass']; $dbname=$INFO['sql_database']; $url = $INFO['board_url']; #url форума $table_prefix=$INFO['sql_tbl_prefix']; $link = mysql_connect($dbhost, $dbuser, $dbpasswd) or $error = 1; @mysql_select_db($dbname) or $error = 1; // Header ("Content-Encoding: charset=windows-1251"); S_ql ("SET NAMES 'cp1251'"); S_ql ("SET CHARACTER SET 'cp1251'"); // S_ql ("SET NAMES 'utf8'"); S_ql ("SET CHARACTER SET 'utf8'"); // конфиги и get-параметры $t=S_ql ("SELECT * from {$table_prefix}conf_settings", "more"); foreach ($t as $key=>$value) if ($value['conf_value']!="") $C[$value['conf_key']]=$value['conf_value']; else $C[$value['conf_key']]=$value['conf_default']; if (isset($_GET['forum'])) $forum=intval ($_GET['forum']); if (isset($_GET['topic'])) $topic=intval ($_GET['topic']); if (isset($_GET['post'])) $post=intval ($_GET['post']); if (isset($_GET['mode'])) $mode=$_GET['mode']; if ($_GET['forum']=="") { //$t=S_ql ("SELECT * from {$table_prefix}forums WHERE topics>0 ORDER by id", "more"); echo << Map '; exit; } else { $forum = intval($_GET['forum']); $forum_ids = array(2,50,59,3,68,30,38,69,4,40,46,47,48,5,32,33,34,35,6,8,36,37,39,43,7,42,45,27,44,9,10,11,25,51,62,52,53,54,60,28,31,15,56,57,13,41,12,29,66,16,49,55,67,63,64,65,26,17,18,19,58); if (!in_array($forum, $forum_ids)) exit; } $xml=''; if (isset($_GET['st'])) $st = intval($_GET['st']); if (isset($st)) $lim = ($st * $limit) . ", " . $limit; else $lim = "0, " . $limit; $t = S_ql ("SELECT tid, title from {$table_prefix}topics as t WHERE approved=1 AND t.forum_id='".intval($forum)."' ORDER by last_post DESC LIMIT $lim", "more"); $cnt = 1; if ($t!="") foreach ($t as $key=>$value) { if (isset($value['post_title']) && $value['post_title']=="") $title=$value['title']; elseif (isset($value['post_title'])) $title=$value['post_title']; else $title = ""; $xml.="{$cnt}. ".$title."
"; $cnt++; } $xml.=""; header ("Content-Type: text/html"); echo $xml; ?>