session_start(); if (IS_ADMIN) { $forum_select_mode = 'admin'; } else { $not_auth_forums_csv = $user->get_not_auth_forums(AUTH_VIEW); $forum_select_mode = explode(',', $not_auth_forums_csv); } $template->assign_vars(array( 'URL' => true, 'SELECT_FORUM' => get_forum_select($forum_select_mode, 'forum_id', 0), )); } else { // Start session management $user->session_start(array('req_login' => true)); if($_POST['tracker'] == 'rutracker') { if (!preg_match("/http:\/\/rutracker.org\/forum\/viewtopic.php\?t=/", $url)) { meta_refresh('', '2'); bb_die("false link"); } $snoopy = new Snoopy; $snoopy->host = "rutracker.org"; $snoopy->agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; $snoopy->referer = "http://rutracker.org/"; $snoopy->rawheaders["Pragma"] = "no-cache"; $submit_url = "http://login.rutracker.org/forum/login.php"; $snoopy->_submit_method = "POST"; $submit_vars = array ( 'login_username' => "Amigoaktau", //логин 'login_password' => "123321", //пароль 'login' => $lang['LOGIN'], ); $snoopy->submit($submit_url, $submit_vars); $snoopy->_httpmethod = "GET"; $snoopy->fetch($url); $content = iconv('windows-1251', 'UTF-8', $snoopy->results); $pos = strpos($content, '
'); $content = substr($content, 0, $pos); if (!$content) { meta_refresh('', '2'); bb_die('false content'); } function rutracker($text, $mode=false) { if($mode == 'title') { preg_match_all ('#

([\s\S]*?)

#', $text, $source, PREG_SET_ORDER); $text = @$source[0][1]; $text = str_replace('', '', $text); } elseif($mode == 'torrent') { preg_match_all ('#'); $text = substr($text, 0, $pos); $text = preg_replace('/
/', '', $text); $text = preg_replace('##', '', $text); $text = preg_replace('#\n

.*?

#', '', $text); $text = str_replace('
', '', $text); $text = str_replace('
', '', $text); $text = str_replace('
', '', $text); $text = preg_replace('##', '', $text); $text = preg_replace('#([\s\S]*?)#', '$1', $text); $text = str_replace('-', "\n[hr]\n", $text); $text = preg_replace('#
([\s\S]*?)
#', '$1', $text); $text = preg_replace('#
([\s\S]*?)
#', '$1', $text); $text = preg_replace('/ <\/var>/', '[img]$1[/img]', $text); $text = preg_replace('/ <\/var>/', "[img=\\1]\\2[/img]\n", $text); $text = str_replace('
', "\n\n", $text); $text = preg_replace('//', '', $text); $text = preg_replace('/