Простоузер
Join Date: Jun 2006
Posts: 83
Reputation:
Novice 7
Репутация в разделе: 7
|
Problem With VBTT 3
0
I have Vbulletin 3.5.4 And i ionstall vbtt3, from the hack request. I do everithing thats says in the manuall, that i post here, but when i enter the forum an errror appeared:
Warning: Unknown: failed to open stream: No such file or directory in \global.php(349) : eval()'d code on line 30
Fatal error: Unknown: Failed opening required 'D:\server\APACHE\Marcogiardini\Ignacio\foro/includes/benc.php' (include_path='.;C:\php5\pear') in D:\server\APACHE\Marcogiardini\Ignacio\foro\global.php(349) : eval()
WHAT should i do???
Installation Instructions:
1) In the AdminCP, using the Product Manager, select the .xml file and upload it
2) Copy all files except the .xml to your Vbulletin Forum Folder and upload them through ftp
3) Enable Hooks and Plugins in your VB AdminCP.
4) Open includes/class_upload.php:
--------------------------------
FIND:
--------------------------------
$this->upload['location'] = $temppath;
}
--------------------------------
AND REPLACE IT WITH:
--------------------------------
$this->upload['location'] = $temppath;
}
// ##################### VBTT 3.0 #####################
// VBTT 3.0 Torrent Attachment handling
if ($this->upload['extension'] == 'torrent')
{
// we check this is a valid torrent
$dict = bdec_file($this->upload['location'] , $this->upload['filesize']);
if (!isset($dict))
{
// invalid extension
$this->set_error('vbtt_invalid_torrent');
return false;
}
list($ann, $info,$comment,$created_by) = dict_check($dict, "announce(string):info:comment(string):created by(string)");
$url_ann = array() ;
$a=0;
list($announcelist,$comment,$created_by) = dict_check($dict, "announce-list(list):comment(string):created by(string)");
// we retrieve all announce urls in the announce list
if (is_array($announcelist))
{
foreach ($announcelist as $fn)
{
for ($i=0;$i < count($hi);$i++ )
{
$url_ann[] = $fn["value"][$i]["value"] ;
}
}
}
else $url_ann[] = $ann;
if (!in_array($this->registry->options['vbtt_primary_announce'], $url_ann) && !in_array($this->registry->options['vbtt_secondary_announce'], $url_ann))
{
// invalid announce url
$this->set_error('vbtt_invalid_announce', $this->registry->options['vbtt_primary_announce'], $this->registry->options['vbtt_secondary_announce']);
return false;
}
list($dname, $plen, $pieces) = dict_check($info, "name(string)iece length(integer)ieces(string)");
if (strlen($pieces) % 20 != 0)
{
// invalid torrent
$this->set_error('vbtt_invalid_torrent');
return false;
}
$filelist = array();
$totallen = 0;
list($totallen,$md5sum) = dict_check($info, "length(integer):md5sum(string)");
if (isset($totallen)) {
$filelist[] = array($dname, $totallen,$md5sum);
$type = "single";
}
else {
$flist = dict_get($info, "files", "list");
if (!isset($flist) || !count($flist))
{
// invalid torrent
$this->set_error('vbtt_invalid_torrent');
return false;
}
foreach ($flist as $fn) {
list($ll, $ff,$md5sum) = dict_check($fn, "length(integer)ath(list):md5sum(string)");
$totallen += $ll;
$ffa = array();
foreach ($ff as $ffe) {
if ($ffe["type"] != "string")
{
// invalid torrent
$this->set_error('vbtt_invalid_torrent');
return false;
}
$ffa[] = $ffe["value"];
}
if (!count($ffa))
{
// invalid torrent
$this->set_error('vbtt_invalid_torrent');
return false;
}
$ffe = implode("/", $ffa);
$filelist[] = array($ffe, $ll,$md5sum);
}
$type = "multi";
}
if (!isset($dict["value"]["info"]["value"]["private"]) || $dict["value"]["info"]["value"]["private"]["value"] != 1 )
{
// not a private torrent !
$this->set_error('vbtt_public_torrent');
return false;
}
$hexhash = strtolower(sha1($dict["value"]["info"]["string"]));
$announce_list = implode(';', $url_ann);
if (strlen($hexhash) != 40)
{
{
// invalid info_hash
$this->set_error('vbtt_invalid_infohash');
return false;
}
}
// we save the list of files stored in the torrent
if (isset($filelist))
foreach ($filelist as $file) {
$this->registry->db->query_write("INSERT INTO ". TABLE_PREFIX ."files (info_hash, filename, size,md5sum) VALUES ('".$hexhash."', '".addslashes($file[0])."','".addslashes($file[1])."','".addslashes($file[2])."')");
}
// save the torrent
$this->data->setr('info_hash', $hexhash);
$this->data->setr('announce_list', $announce_list);
$this->data->setr('created_by', $created_by);
$this->data->setr('comment', $comment);
$this->data->setr('size', $totallen);
}
// ##################### VBTT 3.0 #####################
5) Open newattachment.php:
--------------------------------
FIND:
--------------------------------
$popid = array_keys($vbulletin->GPC['delete']);
$attachmentid = intval($popid[0]);
--------------------------------
AND REPLACE IT WITH:
--------------------------------
$popid = array_keys($vbulletin->GPC['delete']);
$attachmentid = intval($popid[0]);
// ##################### VBTT 3.0 #####################
// we retrieve the info_hash of the torrent
$query = $db->query_read("SELECT info_hash FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = $attachmentid LIMIT 1");
$result = $db->fetch_array($query);
// we remove the files if this is a torrent
if ($result['info_hash'] != '')
$db->query_write("DELETE FROM " . TABLE_PREFIX . "files WHERE info_hash = '".$result['info_hash']."'");
// ##################### VBTT 3.0 #####################
6) Open includes/class_dm_attachment.php:
--------------------------------
FIND:
--------------------------------
'filedata' => array(TYPE_NOTRIM, REQ_NO, VF_METHOD),
'filesize' => array(TYPE_UINT, REQ_YES),
--------------------------------
AND REPLACE IT WITH:
--------------------------------
'filedata' => array(TYPE_NOTRIM, REQ_NO, VF_METHOD),
'filesize' => array(TYPE_UINT, REQ_YES),
// ##################### VBTT 3.0 #####################
'info_hash' => array(TYPE_STR, REQ_NO),
'announce_list' => array(TYPE_STR, REQ_NO),
'created_by' => array(TYPE_STR, REQ_NO),
'comment' => array(TYPE_STR, REQ_NO),
'size' => array(TYPE_UINT, REQ_NO),
// ##################### VBTT 3.0 #####################
8) Open attachment.php:
--------------------------------
FIND:
--------------------------------
header('Content-Length: ' . $attachmentinfo['filesize']);
--------------------------------
AND REPLACE IT WITH:
--------------------------------
// ##################### VBTT 3.0 #####################
if ($extension != 'torrent')
{
header('Content-Length: ' . $attachmentinfo['filesize']);
}
else
{
header('Content-Length: ' . $attachmentinfo['filesize'] + 41);
}
// ##################### VBTT 3.0 #####################
--------------------------------
THEN FIND AND DELETE (TWICE):
--------------------------------
if (defined('NOSHUTDOWNFUNC'))
{
if ($_GET['stc'] == 1)
{
$db->close();
}
else
{
exec_shut_down();
}
}
--------------------------------
THEN FIND :
--------------------------------
while (!feof($fp) AND connection_status() == 0)
{ // You can limit bandwidth by decreasing the integer sent into fread()
echo @fread($fp, 1048576);
flush();
}
--------------------------------
AND REPLACE IT WITH :
--------------------------------
// ##################### VBTT 3.0 #####################
$torrentdata = '';
while (!feof($fp) AND connection_status() == 0)
{ // You can limit bandwidth by decreasing the integer sent into fread()
// echo @fread($fp, 1048576);
// flush();
$torrent_data .= @fread($fp, 1048576);
}
// ##################### VBTT 3.0 #####################
--------------------------------
THEN FIND :
--------------------------------
echo $attachmentinfo['filedata'];
flush();
--------------------------------
AND REPLACE IT WITH :
--------------------------------
// ##################### VBTT 3.0 #####################
// echo $attachmentinfo['filedata'];
// flush();
$torrent_data .= $attachmentinfo['filedata'];
// ##################### VBTT 3.0 #####################
--------------------------------
THEN FIND :
--------------------------------
($hook = vBulletinHook::fetch_hook('attachment_complete')) ? eval($hook) : false;
--------------------------------
AND REPLACE IT WITH :
--------------------------------
// ##################### VBTT 3.0 #####################
if ($extension == 'torrent')
{
$quer = $db->query_read("SELECT passkey FROM " . TABLE_PREFIX . "user WHERE userid = '".$vbulletin->userinfo['userid']."'");
$res = $db->fetch_array($quer);
$query = $db->query_read("SELECT value FROM " . TABLE_PREFIX . "setting WHERE varname='vbtt_primary_announce' OR varname='vbtt_secondary_announce' ");
while ($resu = $db->fetch_array($query))
{
if (strpos($torrent_data, $resu[value]) !== false)
{
$announce = $resu[value];
break;
}
}
$new_announce_url = $announce."?passkey=".$res[passkey] ;
// faster method and prevents incompatibility with private torrents
$torrent_data = str_replace(strlen($announce).":".$announce,strlen($new_announce_url).":".$new_announce_url,$torrent_data);
header("Content-disposition: attachment; filename=\"$attachmentinfo[filename]\"");
}
echo $torrent_data ;
if (defined('NOSHUTDOWNFUNC'))
{
if ($_GET['stc'] == 1)
{
$db->close();
}
else
{
exec_shut_down();
}
}
// ##################### VBTT 3.0 #####################
($hook = vBulletinHook::fetch_hook('attachment_complete')) ? eval($hook) : false;
9) Enjoy beta testing and please
|