if($tracker == 'rutracker')
{
$snoopy->host = "rutracker.org";
$snoopy->agent = "opera";
$snoopy->rawheaders["Pragma"] = "no-cache";
$snoopy->_submit_method = "POST";
$submit_vars = array (
'login_username' => $auth['rutracker']['login'],
'login_password' => $auth['rutracker']['pass'],
'login' => true,
);
$snoopy->submit("http://rutracker.org/forum/login.php", $submit_vars);
$snoopy->_httpmethod = "GET";
$snoopy->fetch($url);
$content = iconv('windows-1251', 'UTF-8', $snoopy->results);
$pos = strpos($content, 'humn_size');
$content = substr($content, 0, $pos);
if (!$content)
{
meta_refresh('release.php', '2');
bb_die('false content');
}
function rutracker($text, $mode=false)
{
if($mode == 'title')
{
//нова¤ регул¤рка дл¤ заголовка рутрекер
preg_match_all ('#data-share_title="([\s\S]*?)">#', $text, $source, PREG_SET_ORDER);
// конец новой регул¤рки
//preg_match_all ('#<h1 class="maintitle"><a.*?href=".*?">([\s\S]*?)</a></h1>#', $text, $source, PREG_SET_ORDER);
$text = @$source[0][1];
$text = str_replace('<wbr>', '', $text);
}
elseif($mode == 'torrent')
{
// нова¤ регул¤рка дл¤ торрент файла рутрекер
preg_match_all ('#<a href="dl.php\?t=(.*?)" class#', $text, $source, PREG_SET_ORDER);
// конец новой регул¤рки
//preg_match_all ('#<a href="http://dl.rutracker.org/forum/dl.php\?t=(.*?)" class#', $text, $source, PREG_SET_ORDER);
$text = $source[0][1];
}
else
{
$pos = strpos($text, '<div class="post_body"');
$text = substr($text, $pos);
$pos = strpos($text, '<div class="clear"></div>');
$text = substr($text, 0, $pos);
$text = preg_replace('/<div class="post_body" id=".*?">/', '', $text);
$text = preg_replace('#<img class="smile" src=".*?" align="absmiddle" border="0" />#', '', $text);
$text = preg_replace('#\n<h3 class="sp-title">.*?</h3>#', '', $text);
$text = str_replace('<div class="q-wrap">', '', $text);
$text = str_replace('<div class="sp-wrap">', '', $text);
$text = str_replace('<div class="c-wrap">', '', $text);
$text = preg_replace('#<a name=".*?"></a>#', '', $text);
$text = preg_replace('#<a class="postLink-name" href=".*?">([\s\S]*?)</a>#', '$1', $text);
$text = str_replace('<span class="post-hr">-</span>', "\n[hr]\n", $text);
$text = preg_replace('#<pre class="post-pre">([\s\S]*?)</pre>#', '$1', $text);
$text = preg_replace('#<div style="margin-.*?">([\s\S]*?)</div>#', '$1', $text);
$text = preg_replace('/<var class="postImg" title="(.*?)"> <\/var>/', '[img]$1[/img]', $text);
$text = preg_replace('/<var class="postImg postImgAligned img-(.*?)" title="(.*?)"> <\/var>/', "[img=\\1]\\2[/img]\n", $text);
$text = str_replace('<span class="post-br"><br /></span>', "\n\n", $text);
$text = preg_replace('/<br.*?>/', '', $text);
$text = preg_replace('/<ul type="(.*?)">/', '[list=$1]', $text);
$text = str_replace('<ul>', '[list]', $text);
$text = str_replace('</ul>', '[/list]', $text);
$text = str_replace('<li>', "\n[*]", $text);
$text = str_replace('</li>', '', $text);
$text = str_replace('<pre>', '[pre]', $text);
$text = str_replace('</pre>', '[/pre]', $text);
for ($i=0; $i<=20; $i++)
{
$text = preg_replace('/<span class="post-b">([^<]*?)<(?=\/)\/span>/', '[b]$1[/b]', $text);
$text = preg_replace('/<span class="post-u">([^<]*?)<(?=\/)\/span>/', '[u]$1[/u]', $text);
$text = preg_replace('/<span class="post-i">([^<]*?)<(?=\/)\/span>/', '[i]$1[/i]', $text);
$text = preg_replace('/<span class="post-s">([^<]*?)<(?=\/)\/span>/', '[s]$1[/s]', $text);
$text = preg_replace('/<span style="font-size: ([^<]*?)px; line-height: normal;">([^<]*?)<(?=\/)\/span>/', "[size=\\1]\\2[/size]", $text);
$text = preg_replace('/<span style="font-family: ([^<]*?);">([^<]*?)<(?=\/)\/span>/', "[font=\"\\1\"]\\2[/font]", $text);
//$text = preg_replace('#<a href="http://www.imdb.com/title/(.*?)/" class=".*?">.*?</a>#', "[imdb]http://www.imdb.com/title/$1[/imdb]", $text);
//$text = preg_replace('#<a href="http://www.kinopoisk.ru/film/(.*?)/" class=".*?">.*?</a>#', "[kp]http://www.kinopoisk.ru/film/$1[/kp]", $text);
//$text = preg_replace('#<a href="http://www.kinopoisk.ru/level/(.*?)/" class=".*?">.*?</a>#', "[kp]http://www.kinopoisk.ru/level/$1[/kp]", $text);
$text = preg_replace('/<span class="post-align" style="text-align: ([^<]*?);">([^<]*?)<(?=\/)\/span>/', "[align=\\1]\n\\2\n[/align]", $text);
$text = preg_replace('/<span class="p-color" style="color: ([^<]*?);">([^<]*?)<(?=\/)\/span>/', '[color=$1]$2[/color]', $text);
$text = preg_replace('#<a href="http://rutracker.org.*?".*?>.*?</a>#', '', $text);
$text = preg_replace('#<a href="http://www.rutracker.org.*?".*?>.*?</a>#', '', $text);
$text = preg_replace('#<a href="http://nnmclub.to.*?".*?>.*?</a>#', '', $text);
$text = preg_replace('#<a href="http://www.nnmclub.to.*?".*?>.*?</a>#', '', $text);
$text = preg_replace('/<a href="([^<]*?)" class="postLink">([^<]*?)<(?=\/)\/a>/', '[url=$1]$2[/url]', $text);
$text = preg_replace('/<div class="sp-head folded">([^<]*?)<\/div>([^<]*?)<(?=\/)\/div>([\s\S]*?)<div class="sp-body">([^<]*?)<(?=\/)\/div>([\s\S]*?)<([^<]*?)\/div>/', "[spoiler=\"\\1\"]\n\\2\n[/spoiler]", $text);
$text = preg_replace('/<div class="q-head">([^<]*?)<\/div>([^<]*?)<(?=\/)\/div>([\s\S]*?)<div class="q">([^<]*?)<(?=\/)\/div>([^<]*?)<([^<]*?)\/div>/', "[quote=\"\\1\"]\n\\2\n[/quote]", $text);
$text = preg_replace('/<div class="q-head">(.*?)<\/div>([\s\S]*?)<([^<]*?)\/div>([^<]*?)<([^<]*?)\/div>/', "[quote=\"\\1\"]\n\\2\n[/quote]", $text);
$text = preg_replace('/<div class="c-head">[\s\S]*?<div class="c-body">([^<]*?)<(?=\/)\/div>([\s\S]*?)<([^<]*?)\/div>/', "[code]\n\\1\n