if ($gettorrent === 1) {
preg_match ("#<a href=\"download.php\?id=(\d+)\" rel=\"nofollow\">#si", $topic, $r_torrent);
$torrent_url = "http://nnm-club.me/forum/download.php?id=".$r_torrent[1];
/*$options_torrent = array(CURLOPT_URL => $torrent_url,
CURLOPT_REFERER => "http://nnm-club.me/forum/download.php?id=".$r_torrent[1],
CURLOPT_COOKIEFILE => $cookie_file,
CURLOPT_COOKIEJAR => $cookie_file);
$torrent_hidden = get_torrent($options_torrent);*/
$torrent = file_get_contents($torrent_url);
$tor = bdecode($torrent);
$name = md5($torrent);
if(count($tor))
{
$new_name = md5($torrent);
$file = fopen('data/old_files/'. $new_name .'.torrent', 'w');
fputs($file, $torrent);
fclose($file);
$torrent_hidden = '<input type="hidden" name="add_attachment_body" value="0" />';
$torrent_hidden .= '<input type="hidden" name="posted_attachments_body" value="0" />';
$torrent_hidden .= '<input type="hidden" name="attachment_list[]" value="data/old_files/'. $new_name .'.torrent" />';
$torrent_hidden .= '<input type="hidden" name="filename_list[]" value="'. $name .'.torrent" />';
$torrent_hidden .= '<input type="hidden" name="extension_list[]" value="torrent" />';
$torrent_hidden .= '<input type="hidden" name="mimetype_list[]" value="application/x-bittorrent" />';
$torrent_hidden .= '<input type="hidden" name="filesize_list[]" value="'. filesize('data/old_files/'. $new_name .'.torrent') .'" />';
$torrent_hidden .= '<input type="hidden" name="filetime_list[]" value="'. TIMENOW .'" />';
$torrent_hidden .= '<input type="hidden" name="attach_id_list[]" value="" />';
$torrent_hidden .= '<input type="hidden" name="attach_thumbnailsnail_list[]" value="" />';
}
}else {
$torrent_hidden = '';
}