Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Trader (http://www.bvlist.com/forumdisplay.php?f=29)
-   -   Upload ERROR (http://www.bvlist.com/showthread.php?t=10850)

Extremlym 19th May 2016 22:56

Upload ERROR
 
After i upload any torrent i get an error
Warning
: array_key_exists() expects parameter 2 to be array, null given in
/home/extremlymtorrents/www/backend/parse.php
on line
50

Upload Failed
Torrent already uploaded.

PHP Code:

<?php
//
//  TorrentTrader v2.x
//    This file was last updated: 27/June/2007
//    
//    http://www.torrenttrader.org
//
//

/*array info for ref:
announce
infohash
creation date
intenal name
torrentsize
filecount
announceruls
comment
filelist
*/


function ParseTorrent($filename) {
    require_once(
"BDecode.php") ;
    require_once(
"BEncode.php") ;

    
$TorrentInfo = array();

    global 
$array;

    
//check file type is a torrent
    
$torrent explode("."$filename);
    
$fileend end($torrent);
    
$fileend strtolower($fileend);

    if ( 
$fileend == "torrent" ) {
        
$parseme = @file_get_contents("$filename");

    if (
$parseme == FALSE) {
        
show_error_msg("Error","Parser Error: Error Opening torrent, unable to get contents",1);
    }

    if(!isset(
$parseme)){
        
show_error_msg("Error","Parser Error: Error Opening torrent",1);
    }else{
        
$array BDecode($parseme);
        if (
$array === FALSE){
            
show_error_msg("Error","Parser Error: Error Opening torrent, unable to decode",1);
        }else{
            if(
array_key_exists("info"$array) === FALSE){
                
show_error_msg("Error","Error Opening torrent",1);
            }else{
                
//Get Announce URL
                
$TorrentInfo[0] = $array["announce"];

                
//Get Announce List Array
                
if (isset($array["announce-list"])){
                    
$TorrentInfo[6] = $array["announce-list"];
                }

                
//Read info, store as (infovariable)
                
$infovariable $array["info"];
                
                
// Calculates SHA1 Hash
                
$infohash sha1(BEncode($infovariable));
                
$TorrentInfo[1] = $infohash ;
                
                
// Calculates date from UNIX Epoch
                
$makedate date('r' $array["creation date"]);
                
$TorrentInfo[2] = $makedate ;

                
// The name of the torrent is different to the file name
                
$TorrentInfo[3] = $infovariable['name'] ;

                
//Get File List
                
if (isset($infovariable["files"]))  {
                    
// Multi File Torrent
                    
$filecount "";

                    
//Get filenames here
                    
$TorrentInfo[8] = $infovariable["files"];

                    foreach (
$infovariable["files"] as $file) {
                        
$filecount += "1";
                        
$multiname $file['path'];//Not needed here really
                        
$multitorrentsize $file['length'];
                        
$torrentsize += $file['length'];
                    }

                    
$TorrentInfo[4] = $torrentsize;  //Add all parts sizes to get total
                    
$TorrentInfo[5] = $filecount;  //Get file count
                
}else {
                    
// Single File Torrent
                    
$torrentsize $infovariable['length'];
                    
$TorrentInfo[4] = $torrentsize;//Get file count
                    
$TorrentInfo[5] = "1";
                }

                
// Get Torrent Comment
                
if(isset($array['comment'])) {
                     
$TorrentInfo[7] = $array['comment'];
                }
            }
        }
    }
}
return 
$TorrentInfo;
}
//End Function
?>


firefly007 20th May 2016 01:46

Tell me is this a new installation ~ meaning there are 0 current entries in the database especially the table thats involved with the torrents ?
If there are, Well! then it should be self explanatory.

Look I could be wrong but it might be one or two things or even both!
i) Set perms for what every dir the torrents are going in to 0777.
ii) Look in your config file and check your paths.

Ok also where or what are u hosting this site on.

If none of this works or you have done this aready then get back to me.

DND 20th May 2016 05:11

are you trying this in PHP7.0.6 ?

Extremlym 20th May 2016 10:07

Quote:

Originally Posted by firefly007 (Post 48880)
Tell me is this a new installation ~ meaning there are 0 current entries in the database especially the table thats involved with the torrents ?
If there are, Well! then it should be self explanatory.

Look I could be wrong but it might be one or two things or even both!
i) Set perms for what every dir the torrents are going in to 0777.
ii) Look in your config file and check your paths.

Ok also where or what are u hosting this site on.

If none of this works or you have done this aready then get back to me.

Yes ! is a new installation on a Ubuntu Linux 14.04.1 / Webmin 1.791 ....all the perms are set to 777 , i think i made some changes in php.ini and there is the problem [on localhost is not the same problem]

firefly007 20th May 2016 12:24

OK "PM" me your ssh and PhpMyAdmin details to me and I will see what i can do.

Extremlym 20th May 2016 20:37

I OK
I reinstall phpMyAdmin ,,,, there was an error from configuration when i update it


All times are GMT +2. The time now is 15:40.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.