Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   Parse error: syntax error, unexpected T_VARIABLE in taketorrent (http://www.bvlist.com/showthread.php?t=8310)

Giorgatzelos 17th September 2012 23:36

Parse error: syntax error, unexpected T_VARIABLE in taketorrent
 
I've got this message while trying to upload torrent

Parse error: syntax error, unexpected T_VARIABLE in /home/a8696442/public_html/upload/taketorrent.php on line 124

this is my taketorrent.php:
PHP Code:

<?php
/*
*----------------------------phpMyBitTorrent V 2.0-beta3-----------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              A©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/

if (!defined('IN_PMBT')) die ("You can't access this file directly");

@
ini_set("upload_max_filesize",$max_torrent_size);
@
set_time_limit(60);
@
ini_set("memory_limit","64M");


require_once(
"include/bdecoder.php");
require_once(
"include/bencoder.php");

function 
hex_to_base32($hex) {
  
$b32_alpha_to_rfc3548_chars = array(
    
'0' => 'A',
    
'1' => 'B',
    
'2' => 'C',
    
'3' => 'D',
    
'4' => 'E',
    
'5' => 'F',
    
'6' => 'G',
    
'7' => 'H',
    
'8' => 'I',
    
'9' => 'J',
    
'a' => 'K',
    
'b' => 'L',
    
'c' => 'M',
    
'd' => 'N',
    
'e' => 'O',
    
'f' => 'P',
    
'g' => 'Q',
    
'h' => 'R',
    
'i' => 'S',
    
'j' => 'T',
    
'k' => 'U',
    
'l' => 'V',
    
'm' => 'W',
    
'n' => 'X',
    
'o' => 'Y',
    
'p' => 'Z',
    
'q' => '2',
    
'r' => '3',
    
's' => '4',
    
't' => '5',
    
'u' => '6',
    
'v' => '7'
  
);
  
$b32_alpha "";
  for (
$pos 0$pos strlen($hex); $pos += 10) {
    
$hs substr($hex,$pos,10);
    
$b32_alpha_part base_convert($hs,16,32);
    
$expected_b32_len strlen($hs) * 0.8;
    
$actual_b32_len strlen($b32_alpha_part);
    
$b32_padding_needed $expected_b32_len $actual_b32_len;
    for (
$i $b32_padding_needed$i 0$i--) {
      
$b32_alpha_part '0' $b32_alpha_part;
    }
    
$b32_alpha .= $b32_alpha_part;
  }
  
$b32_rfc3548 "";
  for (
$i 0$i strlen($b32_alpha); $i++) {
    
$b32_rfc3548 .= $b32_alpha_to_rfc3548_chars[$b32_alpha[$i]];
  }
  return 
$b32_rfc3548;
}

$torrent_edited false;

$errmsg = Array();

if (!isset(
$_FILES["filex"]))
        
$errmsg[] = _btmissingdata;


$category intval($torrent_category);
if (
$category 1bterror(_btnoselected,_btuploaderror);

$cats catlist();
$in_cat false;
while (
$cat each($cats) AND !$in_cat) {
        if (
$category == $cat[1]["id"]) $in_cat true;
}

if (!
$in_cat$errmsg[] = _btillegalcat;
if(
strlen($imdb_info) > 1)$imdb $imdb_info;
else
$imdb '';


if(
strlen($tube) > 1)$tube $tubelink;
else
$tube ''


$f $_FILES["filex"];
$fname unesc($f["name"]);

if (empty(
$fname))
        
$errmsg[] = _btemptyfname;
if (!
is_filename($fname))
        
$errmsg[] = _btinvalidfname;
if (!
preg_match('/^(.+)\.torrent$/si'$fname$matches))
        
$errmsg[] = _btfnamenotorrent;

$nf $_FILES["nfox"];
$nfname unesc($nf["name"]);
if (
$nfname != "") {
        if (!
is_filename($nfname))
                
$errmsg[] = _btinvalidnfofname;
        if (!
preg_match('/^(.+)\.nfo$/si'$nfname))
                
$errmsg[] = _btfnamenonfo;
        if (!
is_uploaded_file($nf["tmp_name"]))
                
$errmsg[] = _bterrnonfoupload;
        if (
$nf["size"] <= 0)
                
$errmsg[] = _btemptyfile;
}

#Return Error
if (count($errmsg) > 0)
        
bterror($errmsg,_btupload);

$shortfname $torrentname $matches[1];
if (!empty(
$namex))
        
$torrentname unesc($namex);

$tmpname $f["tmp_name"];

if (!
is_uploaded_file($tmpname))
        
$errmsg[] = _bterrnofileupload;
if (!
filesize($tmpname))
        
$errmsg[] = _btemptyfile;

#Return Error
if (count($errmsg) > 0)
        
bterror($errmsg,_btuploaderror);


$uploader_host gethostbyaddr($_SERVER["REMOTE_ADDR"]); //uploader's hostname

#File read
$pagetorrent "";
$fp = @fopen($tmpname,"rb");
while (!@
feof($fp)) {
        
$pagetorrent .= @fread($fp,1000);
}
@
fclose($fp);
//Decode
$torrent Bdecode($pagetorrent);
unset(
$pagetorrent);
if (!
entry_exists($torrent,"info(Dictionary)")) bterror("test1".$torrent."",_btuploaderror,false);
if (!
entry_exists($torrent,"announce(String)")) bterror("test2".$torrent."",_btuploaderror);
$info entry_get($torrent,"info");
$announce entry_read($torrent,"announce(String)");


#Checking against DHT
$dht "no";
if (
entry_exists($torrent,"azureus_properties/dht_backup_enable(Integer)")) {
        if (
entry_read($torrent,"azureus_properties/dht_backup_enable(Integer)") != 0$dht "yes";
}

$info_intact true;

if (isset(
$adv_opts) AND $adv_opts == OR $addprivate) {
        if (!isset(
$dht_support)) $dht_support 0;
        if (!isset(
$private_torrent)) $private_torrent 0;

        
//If DHT Support is forced we must disable Private Flag
        
$root $torrent->first_child();
        if (
$dht_support == 1) {

                
$private_torrent 2;
                if (
$dht == "no") {
                        if (
entry_exists($torrent,"azureus_properties")) {
                                
$az_props entry_get($torrent,"azureus_properties");
                        } else {
                                
$az_props $torrent->create_element("azureus_properties");
                                
$az_props->set_attribute("type","Dictionary");
                        }
                        if (
entry_exists($torrent,"dht_backup_enable")) {
                                
$dht_back $torrent->create_element("dht_backup_enable");
                                
$az_props->remove_child($dht_back);
                        }
                        
$dht_back $torrent->create_element("dht_backup_enable");
                        
$dht_back->set_attributes("type","Integer");
                        
$enable $torrent->create_text_node("1");
                        
$dht_back->append_child($enable);
                        
$az_props->append_child($dht_back);
                        foreach (
$root->child_nodes() as $child) {
                                if (
$child->node_name() > "azureus_properties") break;
                        }
                        
$root->insert_before($az_props,$child);
                }
        } elseif (
$dht_support == 2) {
                if (
$dht == "yes") {
                        
$aznode entry_get($torrent,"azureus_properties");
                        
$dhtnode entry_get($torrent,"azureus_properties/dht_backup_enable");
                        
$aznode->remove_child($dhtnode);
                        if (!
$aznode->has_child_nodes()) $root->remove_child($aznode);

                }
        }
        unset(
$root);

        
$priv_exists entry_exists($torrent,"info/private(Integer)");
        
$priv_enabled = ($priv_exists AND entry_read($torrent,"info/private(Integer)") == 1);

        if (
$private_torrent == OR $addprivate) {
        if(
$announce == $announce_url){
                
//Force enabling Private Torrent
                
if (!$priv_enabled ) {
                        
$info_intact false;
                        if (
$priv_exists) {
                                
$private entry_get($torrent,"info/private");
                                
$info->remove_child($private);
                        }
                        
$private $torrent->create_element("private");
                        
$private->set_attribute("type","Integer");
                        
$enable $torrent->create_text_node("1");
                        
$private->append_child($enable);
                        foreach (
$info->child_nodes() as $child) {
                                if (
$child->node_name() > "private") break;
                        }
                        
$info->append_child($private);
                }
            }
        } elseif (
$private_torrent == 2) {
                if (
$priv_exists) {
                        
$info_intact false;
                        
$private entry_get($torrent,"info/private");
                        
$info->remove_child($private);
                }
        }
}


#Name, piece length and pieces

if (!entry_exists($torrent,"info/piece length(Integer)")) bterror("test3",_btuploaderror);
if (!
entry_exists($torrent,"info/pieces(String)")) bterror("test4",_btuploaderror);
$dname = (entry_exists($torrent,"info/name(String)")) ? $dname entry_read($torrent,"info/name(String)") : "";
$plen entry_read($torrent,"info/piece length(Integer)");
$pieces entry_read($torrent,"info/pieces(String)");

if (
strlen($pieces) % 20 != 0)
        
bterror(_btinvpieces,_btuploaderror);
unset(
$pieces);

$tcomment = (entry_exists($torrent,"comment(String)")) ? entry_read($torrent,"comment(String)") : "";

#Parsing Torrent Description
if ($tcomment == "" AND (!isset($descr) OR empty($descr))) bterror(_btdescrrequired,_btuploaderror);
if (
get_magic_quotes_gpc()) $descr stripslashes($descr);
if (
$descr == ""$descr parsedescr($tcomment);
if (
$allow_html) {
        if (
preg_match("/<[^>]* (on[a-z]*[.]*)=[^>]*>/i"$descr)) //HTML contains Javascript EVENTS. Must refuse
                
bterror(_btinvalidhtml,_btuploaderror);
        if (
preg_match('/<a[^>]* href="[^"]*(javascript|vbscript):[^>]*>/i'$descr)) //HTML contains Javascript or VBScript calls. Must refuse
                
bterror(_btinvalidhtml,_btuploaderror);
}
parse_html($descr);
$forum_des $descr;
$descr addslashes($descr);


#Parsing Announce
$annregexp_http "/(http[s]?+):\/\/[-\/.:_\\w]*\/announce[^\/\\s]*/i";
$annregexp_dht "/^dht:\/\/[0-9a-f]*.dht\/announce$/i";
$annregexp_udp "/udp:\/\/[-\/.:_\\w]*\/announce[^\/\\s]*/i";
if (
$announce == $announce_url) {
        if (
$stealthmodebterror(str_replace("**name**",$sitename,_bttrackerdisabled),_btuploaderror);
        
$announce "";
} elseif (
preg_match($annregexp_http$announce)) {
        
$sql "SELECT id FROM ".$db_prefix."_trackers WHERE url = '".addslashes($announce)."' AND status = 'blacklisted' LIMIT 1;";
        
$res $db->sql_query($sql);
        if (
$db->sql_numrows($res) > 0bterror(str_replace("**trk**",$announce,_bttrackerblacklisted),_btuploaderror);
        
$db->sql_freeresult($res);
} elseif (
preg_match($annregexp_dht,$announce)) {
        
$dht "yes";
} else {
        
bterror(_btinvannounce."<b>".$announce."</b>",_btuploaderror);
}
//UDP trackers or trackers inside the TOR/I2P networks are not supported *yet*



#Parsing Multiple Announce
$trackers "NULL";
$backup_tracker "false";
if (
entry_exists($torrent,"announce-list(List)")) {
if (!
$allow_multy_tracker)bterror('backup trackers not allowed',_btuploaderror);
        
$trackers = Array();
        
$to_check = Array();
        
$announce_list entry_read($torrent,"announce-list(List)");
        foreach (
$announce_list as $group) {
                
$trackers_in_group = Array();
                foreach (
$group->child_nodes() as $tracker_node) {
                        
$tracker $tracker_node->get_content();
                        if (!
preg_match($annregexp_http,$tracker) AND !preg_match($annregexp_udp,$tracker)) bterror(_btinvannounce."<b>".$tracker."</b>",_btuploaderror);
                        
//If the main tracker is NOT this one, but this one APPEARS within the Announce list then we're running backup tracker
                        
if ($tracker["value"] == $announce_url AND $announce != ""$backup_tracker "true";
                        
array_push($trackers_in_group,$tracker);
                        
array_push($to_check,"'".$tracker."'");
                        unset(
$tracker$tracker_node);
                }
                
array_push($trackers,$trackers_in_group);
                unset(
$trackers_in_group$group);

        }
        
$sql "SELECT url FROM ".$db_prefix."_trackers WHERE url IN (".implode(", ",$to_check).") AND status = 'blacklisted';";
        
$res $db->sql_query($sql) or btsqlerror($sql);
        if (
$db->sql_numrows($res) > 0) {
                
$blacklisted_trackers $db->sql_fetchrowset($res);
                
$blacklisted_trackers implode(",",$blacklisted_trackers);
                
bterror(str_replace("**trk**",$blacklisted_trackers,_bttrackerblacklisted),_btuploaderror);
        }
        
$db->sql_freeresult($res);
        unset(
$sql$to_check,$announce_list$res);
        for (
$i 0$i count($trackers); $i++) $trackers[$i] = implode("\n",$trackers[$i]);
        
$trackers "'".addslashes(implode("\n\n",$trackers))."'";
}


#Parsing password
$torrentpass $password//Keep for URL Redirect
if ($password != "" AND $announce == "") {
        if (!
get_magic_quotes_gpc()) $password addslashes($password);
        
$password "'".$password."'";
} else 
$password "NULL";


#Parsing files
$filelist = Array();
if (
entry_exists($torrent,"info/length(Integer)")) {
        
//Single file
        
$totallen entry_read($torrent,"info/length(Integer)");

        if (
entry_exists($torrent,"info/sha1(String)")) {
                
$sha1code entry_read($torrent"info/sha1(String)");
                
$magnet_link "magnet:?xt=urn:sha1:".addslashes(hex_to_base32($sha1code))."&dn=".urlencode($dname);
        } else {
                
$magnet_link "";
        }
        if (
entry_exists($torrent,"info/ed2k(String)")) {
                
$ed2k entry_read($torrent"info/ed2k(String)");
                
$ed2k_link "ed2k://|file|".urlencode($dname)."|".$totallen."|".strtoupper(str_pad($ed2k,32,"0"))."|/";
        } else {
                
$ed2k_link "";
        }
        
$filelist[] = Array($dname$totallen$magnet_link$ed2k_link);
        
$type "single";
} else {
        
//Multiple files
        
$flist entry_read($torrent"info/files(List)");
        if (!isset(
$flist))
                
bterror(_btmissinglength,_btuploaderror);
        if (!
count($flist))
                
bterror(_btnofilesintorrent,_btuplaoderror);
        
#$totallen = 0;
        
foreach ($flist as $fn) {
                
$ffe "";
                
$magnet_link "";
                
$ed2k_link "";
                
$children $fn->child_nodes();
                
$file = Array();
                foreach (
$children as $child) {
                        
$file[$child->tagname] = $child;
                }

                if (!
array_key_exists("length",$file) OR !array_key_exists("path",$file)) bterror("test5",_btuploaderror);

                
$ll $file["length"]->get_content();

                
$path = Array();
                foreach (
$file["path"]->child_nodes() as $parray_push($path,$p->get_content());
                
$ffe implode("/",$path);
                if (empty(
$ffe)) bterror(_btfilenamerror,_btuploaderror);

                if (
array_key_exists("sha1",$file)) {
                        
$magnet_link "magnet:?xt=urn:sha1:".addslashes(hex_to_base32($file["sha1"]->get_content()))."&dn=".urlencode($path[count($path)-1]);
                }
                if (
array_key_exists("ed2k",$file)) {
                        
$ed2k_link "ed2k://|file|".urlencode($path[count($path)-1])."|".$ll."|".strtoupper(str_pad($file["ed2k"]->get_content(),32,0))."|/";
                }
                unset(
$p$path);

                
$filelist[] = Array($ffe$ll$magnet_link$ed2k_link);
                
$totallen += $ll;
        }
        
$type "multi";
}

#Info Hash. The most important value
$infohash_hex sha1(Benc($info));
$infohash pack("H*"$infohash_hex);
unset(
$info);

#eXeem Alternate Link
if (isset($exeem) AND $exeem != "" AND $info_intact) {
        if (!
eregi("^exeem://[\\d]{1,2}/".$infohash_hex."/"$exeem)) bterror(_btinvalidexeem,_btuploaderror);
} else {
        
$exeem "";
}

#Torrent Owner
$owner $user->id;
$ownertype = ($owner == 0) ? intval($ownertype);
if (
$ownertype == 2$owner 0;
if (isset(
$evidence) AND $user->moderator$evidence 1;
else 
$evidence 0;

#Checking against the SAME Torrent
if (isset($jump_check) AND $jump_check == 1) {
$sql "SELECT id FROM ".$db_prefix."_torrents WHERE info_hash = '".addslashes($infohash)."';";
$res $db->sql_query($sql) or btsqlerror($sql);
if (
$db->sql_numrows($res) > 0) {
        list (
$id) = $db->sql_fetchrow($res);
        
bterror(str_replace("#id#",$id,_bttorrentpresent),_btuploaderror);
}
$db->sql_freeresult($res);
}

if (!
is_premium($btuser)) {
        
$sql "SELECT count(id) as num, sum(size) as tot_size FROM ".$db_prefix."_torrents where added > sysdate() - 1000000 AND owner = '".$user->id."'";
        
$res $db->sql_query($sql) or btsqlerror($sql);
        list (
$torrents$uploaded_size) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);

        
#Checking against minimumupload size
        
if ($totallen $minupload_size_file)
                
bterror(_bttorrenttoosmall1.mksize($minupload_size_file)._bttorrenttoosmall2.mksize($totallen)."</b>.",_btuploaderror);

        
#Checking against Max num upload on 24h time
        
if ($maxupload_day_num AND $maxupload_day_num <= $torrents)
                
bterror(str_replace("**maxupload**",$maxupload_day_num,_btmaxuploadexceeded),_btuploaderror);

        
#Max size share upload on 24h
        
if ($maxupload_day_share AND $maxupload_day_share $uploaded_size+$totallen) {
                
$search = Array("**maxupload**","**rownum**","**totsize**");
                
$replace = Array($maxupload_day_share,$torrents,mksize($uploaded_size));
                
bterror(str_replace($search,$replace,_btnumfileexceeded),_btuploaderror);
        }
}

#Filename must be at least 4 chars
$materia trim($fname);
$pos strrpos($materia'.');
if (!
$pos===false)
        
$materia substr($materia0$pos);
$search = array ("'[^\w]'",                 // Remove not letter
        
"'([\r\n])[\s]+'"                 // Remove Blank space
);
$replace = array (
        
" ",
        
"\\1"
);
$materia preg_replace ($search$replace$materia);
$materia explode(" "$materia);

$sql_filter "";
foreach(
$materia as $x) {
        
$x trim($x);
        if(
strlen($x) > 2){
                
$sql_filter .= " OR keyword LIKE '".$x."'";
        }
}
$errmsg "";
$sql_filter "SELECT * FROM ".$db_prefix."_filter WHERE 1=0 ".$sql_filter.";";
$res $db->sql_query($sql_filter) or btsqlerror($sql_filter);
if (
$db->sql_numrows($res) > 0) {
                
$errmsg "<p align=\"center\">"._btillegalword."</p></br>";
              
                while (
$row $db->sql_fetchrow($res)){
                        
$errmsg.= "<p align=\"center\">".htmlspecialchars($row["reason"])."</p></br>";
                }
              
                
$errmsg.= "<p align=\"center\">"._btillegalwordinfo."</p>";
                
bterror($errmsg,_btuploaderror);
}
$db->sql_freeresult($res);

#Checking against SIMILAR files
if (isset($jump_check) AND $jump_check == 1) {
        
$materia=trim($fname);
        
$pos strrpos($materia'.');
        if (!
$pos===false)
                
$materia substr($materia0$pos);
        
$search = array (
                 
"'[^a-zA-Z]'",                 // Remove not lecter
                 
"'([\r\n])[\s]+'"                 // Remove Blank space
        
);
        
$replace = array (
                 
" ",
                 
"\\1"
        
);

        
$materia preg_replace ($search$replace$materia);
        
$materia explode(" "$materia);

        
$sql "";
        
$sql_filter "";
        foreach(
$materia as $x){
                
$x trim($x);
                if(
strlen($x)>=5){
                        
$sql .= " OR filename LIKE '".str_replace("\'","\\\'",$x)."'";
                }
        }
        foreach (
$filelist as $file) {
                
$sql .= " OR size = '".$file[1]."'";
        }


        
$sql "SELECT torrent, filename, size FROM ".$db_prefix."_files WHERE 1=0 ".$sql;
        
$res $db->sql_query($sql) or bterror($sql);

        
$errmsg "";
        if (
$db->sql_numrows($res) > 0){
                
$errmsg _btsearchdupl;
                
$errmsg .= "<ul>\n";
                while (
$row $db->sql_fetchrow($res)){
                        
$errmsg.= "<li><p><a href='details.php?id=".$row["torrent"]."&hit=1'>".$row["filename"]."</a> (".mksize($row["size"]).")</p></li>\n";
                }
                
$errmsg .= "</ul>\n";
                
$errmsg .= _btduplinfo;
                
bterror($errmsg,_btuploaderror);
        }
}


#$searchtext = "".$shortfname." ". $dname." ". $descr." ".implode(" ",$filelist);

$searchtext "".$shortfname." "$dname." "$descr." ";
foreach(
$filelist as $subarray) {
$searchtext.=implode(" ",$subarray);
}

#Parsing external tracker sources
global $force_upload//Used to force upload even if Torrent has 0 peers or the tracker does not respond
$seeders $leechers $tot_peer 0;
if(
$autoscrape AND $announce != "") {
if(!
$allow_external)bterror("external torrents not allowed",_btuploaderror);
        
$tmp_tracker str_replace("announce""scrape"$announce).((strpos($scrape_url,"?")) ? "&" "?")."info_hash=".urlencode($infohash);
        
#echo $tmp_tracker;
        
if ($fp = @fopen($tmp_tracker"rb")) {
                
stream_set_timeout($fp10);
                
$page "";
                while (!
feof($fp)) {
                        
$page .= @fread($fp,1000000);
                }
                @
fclose($fp);
                
#echo $page;
                
                
$scrape Bdecode($page,"Scrape");
                unset(
$page);
                
#Debug 2
                //echo str_replace(Array(" ","\n"),Array("&nbsp;","\n"),htmlspecialchars($scrape->dump_mem(true,"UTF-8")));
                #Check data
                
if (!entry_exists($scrape,"files(dictionary)","Scrape")) {
                        
bterror(_bttrackerdata,_btscrapeerror);
                } elseif (!
entry_exists($scrape,"files/a".$infohash_hex."(Dictionary)","Scrape")) {
                        
bterror(_bttorrentnotregistered,_btscrapeerror,false);
                } else {
                        
#Check seeder
                        
$seeders entry_read($scrape,"files/a".$infohash_hex."/complete(Integer)","Scrape");
                        if (
$seeders <= AND $force_uploadbterror(_btnoseedersontracker,_btnoseedersontracker,false);
                        if (
$seeders <= AND !$force_uploadbterror(_btnoseedersontracker,_btscrapeerror);
                        
$leechers entry_read($scrape,"files/a".$infohash_hex."/incomplete(Integer)","Scrape");
                        
$completed entry_read($scrape,"files/a".$infohash_hex."/downloaded(Integer)","Scrape");
                }
                unset(
$scrape);
                
$visible = ($tot_peer 0) ? "yes" "no";                
        } elseif (!
$force_upload) {
                
bterror(_bttrackernotresponding.$announce,_btscrapeerror);
        }
} else {
                
$completed 0;
                
$visible = ($announce != "") ? "yes" "no";
}
if(!isset(
$build)) $build "no";









if(isset(
$post_img) && $post_img != ''){
        if (!
preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i'$post_img$match))
        {
             
bterror($errors,'The URL you specified For Poster is invalid.');
        }
        if (empty(
$match[2]))
        {
             
bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$post_img "NULL";
if(isset(
$screen1) && $screen1 != ''){
        if (!
preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i'$post_img$match))
        {
             
bterror($errors,'The URL you specified For Screenshot1 is invalid.');
        }
        if (empty(
$match[2]))
        {
             
bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screen1 "NULL";
if(isset(
$screen2) && $screen2 != ''){
        if (!
preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i'$post_img$match))
        {
             
bterror($errors,'The URL you specified For Screenshot2 is invalid.');
        }
        if (empty(
$match[2]))
        {
             
bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screen2 "NULL";
if(isset(
$screen3) && $screen3 != ''){
        if (!
preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i'$post_img$match))
        {
             
bterror($errors,'The URL you specified For Screenshot3 is invalid.');
        }
        if (empty(
$match[2]))
        {
             
bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screen3 "NULL";
if(isset(
$screen4) && $screen4 != ''){
        if (!
preg_match('#^(https?://).*?\.(gif|jpg|jpeg|png)$#i'$post_img$match))
        {
             
bterror($errors,'The URL you specified For Screenshot4 is invalid.');
        }
        if (empty(
$match[2]))
        {
             
bterror($errors,'The URL you specified is not a (gif|jpg|jpeg|png).');
        }
}
else
$screen4 "NULL";















#Preparing SQL
$torrentfields = Array();
$torrentvalues = Array();

$torrentfields[] = "info_hash";
$torrentvalues[] = "'".addslashes($infohash)."'";

$torrentfields[] = "name";
$torrentvalues[] = "'".addslashes($torrentname)."'";

$torrentfields[] = "filename";
$torrentvalues[] = "'".addslashes($dname)."'";

$torrentfields[] = "save_as";
$torrentvalues[] = "'".addslashes($shortfname)."'";

$torrentfields[] = "md5sum";
$torrentvalues[] = "'".md5_file($tmpname)."'";

$torrentfields[] = "search_text";
$torrentvalues[] = "'".addslashes($searchtext)."'";

$torrentfields[] = "descr";
$torrentvalues[] = "'".$descr."'";







// Poster Modd
$torrentfields[] = "post_img";
$torrentvalues[] = "'".addslashes($post_img)."'";

//ScreenShot Modd
$torrentfields[] = "screen1";
$torrentvalues[] = "'".addslashes($screen1)."'";

$torrentfields[] = "screen2";
$torrentvalues[] = "'".addslashes($screen2)."'";

$torrentfields[] = "screen3";
$torrentvalues[] = "'".addslashes($screen3)."'";

$torrentfields[] = "screen4";
$torrentvalues[] = "'".addslashes($screen4)."'";

//End mods













$torrentfields[] = "size";
$torrentvalues[] = "'".$totallen."'";

$torrentfields[] = "ratiobuild";
$torrentvalues[] = "'".$build."'";

$torrentfields[] = "plen";
$torrentvalues[] = "'".$plen."'";

$torrentfields[] = "category";
$torrentvalues[] = "'".intval($category)."'";

$torrentfields[] = "type";
$torrentvalues[] = "'".$type."'";

$torrentfields[] = "numfiles";
$torrentvalues[] = "'".count($filelist)."'";

$torrentfields[] = "added";
$torrentvalues[] = "NOW()";

$torrentfields[] = "exeem";
if (isset(
$exeem) AND $exeem != ""$torrentvalues[] = "'".$exeem."'";
else 
$torrentvalues[] = "NULL";

$torrentfields[] = "dht";
$torrentvalues[] = "'".$dht."'";

$torrentfields[] = "backup_tracker";
$torrentvalues[] = "'".$backup_tracker."'";

$torrentfields[] = "views";
$torrentvalues[] = "'0'";

$torrentfields[] = "downloaded";
$torrentvalues[] = "'0'";

$torrentfields[] = "completed";
$torrentvalues[] = "'".$completed."'";

$torrentfields[] = "banned";
$torrentvalues[] = "'no'";

$torrentfields[] = "password";
$torrentvalues[] = $password;

$torrentfields[] = "visible";
$torrentvalues[] = "'".$visible."'";

$torrentfields[] = "evidence";
$torrentvalues[] = "'".intval($evidence)."'";

$torrentfields[] = "owner";
$torrentvalues[] = "'".intval($owner)."'";

$torrentfields[] = "ownertype";
$torrentvalues[] = "'".intval($ownertype)."'";

$torrentfields[] = "uploader_host";
$torrentvalues[] = "'".$uploader_host."'";

$torrentfields[] = "numratings";
$torrentvalues[] = "'0'";

$torrentfields[] = "ratingsum";
$torrentvalues[] = "'0'";

$torrentfields[] = "seeders";
$torrentvalues[] = "'".intval($seeders)."'";

$torrentfields[] = "leechers";
$torrentvalues[] = "'".intval($leechers)."'";

$torrentfields[] = "tot_peer";
$torrentvalues[] = "'".intval($seeders+$leechers)."'";

$torrentfields[] = "speed";
$torrentvalues[] = "'0'";

$torrentfields[] = "comments";
$torrentvalues[] = "'0'";

$torrentfields[] = "complaints";
$torrentvalues[] = "'0,0'";

$torrentfields[] = "tracker";
if (
$announce == ""$torrentvalues[] = "NULL";
else 
$torrentvalues[] = "'".$announce."'";

$torrentfields[] = "tracker_list";
$torrentvalues[] = $trackers;

$torrentfields[] = "tracker_update";
$torrentvalues[] = "NOW()";

$torrentfields[] = "last_action";
$torrentvalues[] = "NOW()";

if(
strlen($tube) > 1){
$torrentfields[] = "tube";
$torrentvalues[] = "'".addslashes($tube)."'";
}

if(
strlen($imdb) > 1){
$torrentfields[] = "imdb";
$torrentvalues[] = "'".$imdb."'";
}


$torrentsql "INSERT INTO ".$db_prefix."_torrents (".implode(", ",$torrentfields).") VALUES (".implode(", ",$torrentvalues).");";

$db->sql_query($torrentsql) or btsqlerror($torrentsql);
$id $db->sql_nextid();
if (
$id == 0bterror("Torrent ID Error",_btuploaderror);

if (
$announce != ""){ 
$db->sql_query("INSERT INTO ".$db_prefix."_trackers (url, updated) VALUES ('".addslashes($announce)."', NOW());");
}
$db->sql_query("DELETE FROM ".$db_prefix."_files WHERE torrent = '".$id."'") or btsqlerror("DELETE FROM ".$db_prefix."_files WHERE torrent = '$id'");
foreach (
$filelist as $file) {
        list (
$fname$fsize$magnet$ed2k) = $file;
        
$fields "(torrent, filename, size";
        
$values "('".$id."', '".str_replace("'","\'",$fname)."', '".$fsize."'";
        if (
$magnet != "") {
                
$fields.= ", magnet";
                
$values.= ", '".addslashes($magnet)."'";
        }
        if (
$ed2k != "") {
                
$fields.= ", ed2k";
                
$values.= ", '".addslashes($ed2k)."'";
        }
        
$fields.= ")";
        
$values.= ")";
        
$filesql "INSERT INTO ".$db_prefix."_files ".$fields." VALUES ".$values.";";
        if (!
$db->sql_query($filesql)) { //Rollback
                
$db->sql_query("DELETE FROM ".$db_prefix."_torrents WHERE id = '".$id."' LIMIT 1;");
                
$db->sql_query("DELETE FROM ".$db_prefix."_files WHERE torrent = '".$id."';");
                
btsqlerror($filesql);
        }
}

$torrentpath $torrent_dir."/".$id.".torrent";
if (
file_exists($torrentpath)) unlink($torrentpath);

$fp fopen($torrentpath,"wb");
fwrite($fp,Bencode($torrent));
fclose($fp);
@
unlink($tmpname);

$nfopath "$torrent_dir/".$id.".nfo";
if (
file_exists($nfopath)) unlink($nfopath);
if (!empty(
$nfname)) move_uploaded_file($nf["tmp_name"],$nfopath);
$url "details.php?id=".$id."&upcomplete=1";
if (
$password != "NULL") { //Password is included in SQL Statement
        
$url .= "&password=".$torrentpass;
}
if (!
$info_intact) { //If Info Hash changed the user MUST re-download the Torrent to use it
        
$url .= "&upload_notice=1";
}
echo 
"<meta http-equiv=\"refresh\" content=\"6;url=".$url."\">";

OpenTable(_btupload);
                        
$bon "SELECT active, upload FROM ".$db_prefix."_bonus_points ;";
                        
$bonset $db->sql_query($bon);
                        list (
$active$upload_point) = $db->sql_fetchrow($bonset);
                        
$db->sql_freeresult($bonset);
if(
$active=='true')
{
$do="UPDATE ".$db_prefix."_users SET seedbonus = seedbonus + '".$upload_point."' WHERE id= ".$user->id."" ;
$db->sql_query($do) or btsqlerror($do);
}
global 
$allow_posting;//Are we allowed to post new topics
if($allow_posting){
$pmbtuser $user;
define('IN_PORTAL',TRUE);
define('FORUM_ADD',TRUE);
define('IN_PHPBB'true);
define('PHPBB_ROOT_PATH','./'.$forumbase.'/');
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
$phpEx substr(strrchr(__FILE__'.'), 1);
include_once(
$phpbb_root_path 'common.' $phpEx);
include_once(
$phpbb_root_path 'includes/functions_posting.' $phpEx);
include_once(
$phpbb_root_path 'includes/functions_display.' $phpEx);
include_once(
$phpbb_root_path 'includes/message_parser.' $phpEx);
$user->session_begin(true);
$auth->acl($user->data);
$template->assign_var('S_NEW_MESSAGE'true);
$message_parser = new parse_message();
$message_parser->bbcode_uid;
$forum_des $forum_des.'
[url='
.$siteurl.'/details.php?id='.$id.']See More Here[/url]
[url='
.$siteurl.'/download.php?id='.$id.']DownLoad Here[/url]';
$message_parser->message utf8_normalize_nfc($forum_des);
$topic_title convert_charset(str_replace(array("-","_",".","torrent"),array(" "," "," ",""),$dname));
$message_md5 md5($message_parser->message);
$current_time time();
$message_parser->parse(truetruetrue);
if(
$poster == "0"$postername 'ANONYMOUS';
else
$postername $user->name;
if(
$poster == "0"$poster "1";
else
$poster $user->data['user_id'];
//die($topic_title);
$poll = array();
            
$data = array(
                
'topic_title'            => $topic_title,
                
'topic_first_post_id'    => 0,
                
'topic_last_post_id'    => 0,
                
'topic_time_limit'        => (int) 0,
                
'topic_attachment'        => 0,
                
'post_id'                => (int) 0,
                
'topic_id'                => (int) 0,
                
'forum_id'                => (int) $auto_post,//set forum ID
                
'icon_id'                => (int) 0,
                
'poster_id'                => (int) $poster,//user id
                
'enable_sig'            => (bool) true,
                
'enable_bbcode'            => (bool) true,
                
'enable_smilies'        => (bool) true,
                
'enable_urls'            => (bool) true,
                
'enable_indexing'        => (bool) true,
                
'message_md5'            => (string) $message_md5,
                
'post_time'                => $current_time,
                
'post_checksum'            =>  '',
                
'post_edit_reason'        => '',
                
'post_edit_user'        => 0,
                
'forum_parents'            => '',
                
'forum_name'            => '',
                
'notify'                => false,
                
'notify_set'            => '',
                
'poster_ip'                => $user->ip,
                
'post_edit_locked'        => (int) 0,
                
'bbcode_bitfield'        => $message_parser->bbcode_bitfield,
                
'bbcode_uid'            => $message_parser->bbcode_uid,
                
'message'                => $message_parser->message,
                
'attachment_data'        => false,
                
'filename_data'            => false,

                
'topic_approved'        => true,
                
'post_approved'            => true,
            );
submit_post('post'$topic_title$postername0$poll$datafalse ,false);
unset(
$user);
$user = @new User($_COOKIE["btuser"]);
}
$search = Array("**id**","**name**");
$replace = Array($id,$torrentname);
echo 
"<p>".str_replace("**url**",$url,_btuploadcomplete)."</p>\n";
$mesg str_replace($search,$replace,_btuplshout);
if(isset(
$shout) AND $shout_config['shout_new_torrent'] == "yes"){
$sql "INSERT INTO ".$db_prefix."_shouts (user, text, posted) VALUES ('".$user->id."', '".$mesg."', NOW());";
                        
$db->sql_query($sql);
}
if (
$seeders <= AND $force_upload){
    echo  
"<p>"._btdeadtorrent."</p>\n";
}


if (isset(
$commnotify)){
        
$sql "INSERT INTO ".$db_prefix."_comments_notify (torrent, user) VALUES ('".$id."', ".$user->id.")";
        
$db->sql_query($sql) or btsqlerror($sql);
        echo 
"<p>&nbsp;</p>";
        echo  
"<p>"._btaddnotifycomment."</p>\n";
}
if (isset(
$seednotify) AND $announce == "") {
        
$sql "INSERT INTO ".$db_prefix."_seeder_notify (torrent, user) VALUES ('".$id."', ".$user->id.")";
        
$db->sql_query($sql) or btsqlerror($sql);
        echo 
"<p>&nbsp;</p>";
        echo 
"<p>"._btaddnotifyseeder."</p>\n";
}
CloseTable();
?>

How can i fix it?

joeroberts 17th September 2012 23:48

find this line
PHP Code:

if(strlen($tube) > 1)$tube $tubelink;
else
$tube '' 

and make it
PHP Code:

if(strlen($tube) > 1)$tube $tubelink;
else
$tube ''


Giorgatzelos 17th September 2012 23:54

now after that i am getting this:


Code:

Warning: Error: in /home/a8696442/public_html/include/bencoder/bdecoder-domxml.php on line 73


PHP Error Message

Catchable fatal error: Argument 1 passed to DOMXPath::__construct() must be an instance of DOMDocument, null given, called in /home/a8696442/public_html/include/extensions/domxml-php4-to-php5.php on line 56 and defined in /home/a8696442/public_html/include/extensions/domxml-php4-to-php5.php on line 383

Bump: nevermind i tried a torrent with just my announce...i am using nyaa.eu as a backup and there i use both announces...but in my tracker it apparently doesn't work...

joeroberts 18th September 2012 00:14

because the lead tracker is sending a invalid scrape response.

Giorgatzelos 18th September 2012 00:19

I was hopping that the youtube mod would work after that!!! :lol:

But nope it still doesn't! :mad:

joeroberts 18th September 2012 00:22

try changing
PHP Code:

if(strlen($tube) > 1)$tube $tubelink

to
PHP Code:

if(strlen($tube) > 1)$tube $tube

if thats not it try
PHP Code:

if(strlen($tubelink) > 1)$tube $tubelink


Giorgatzelos 18th September 2012 00:35

i am tring with a video of yours that you gave me the link but no luck none of these worked!


https://www.youtube.com/watch?v=vq5Ynu7_VD4

joeroberts 18th September 2012 00:38

please post a copy of you upload/torrent.php

Giorgatzelos 18th September 2012 00:44

here you are:

PHP Code:

<?php
/*
*----------------------------phpMyBitTorrent V 2.0-----------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              Â©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/

if (!defined('IN_PMBT')) die ("You can't access this file directly");

echo
"<script type=\"text/javascript\" src=\"bbcode.js\"></script>";


OpenTable(_btupload);

if (!
$stealthmode) echo "<p>" _btofficialurl." <b>".$announce_url."</b>" . (($user->passkey != "")? "OR <b>".$announce_url."?passkey=" $user->passkey "</b>" "" ). "</p>\n";  
include
'include/textarea.php';
echo 
"<p>"._btseeded."</p>";
echo 
"<form enctype=\"multipart/form-data\" action=\"upload.php?op=taketorrent\" method=\"post\" id=\"data\" name=\"formdata\">\n\n";
echo 
"<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"".$max_torrent_size."\" />\n";
echo 
"<table border=\"0\" cellspacing=\"5\" cellpadding=\"5\">\n";
echo 
"<tr><td><p>"._btupfile."</p></td><td><p><input type=\"file\" name=\"filex\" size=\"60\" /></p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
echo 
"<tr><td><p>"._btupnfo."</p></td><td><p><input type=\"file\" name=\"nfox\" size=\"60\" /></p>\n</td></tr>\n";
echo 
"<tr><td><hr /></td><td></td></tr>\n";
echo 
"<tr><td><p>"._bttorrentname."</p></td><td><p><input type=\"text\" name=\"namex\" size=\"80\" />("._btfromtorrent"<b>"._btdescname."</b>)</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";





// Poster Modd
echo "<tr><td><p>"._bt_poster."</p></td><td><p><input type=\"text\" name=\"post_img\" size=\"80\" />"._bt_poster_exp."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
// Screen shot Mod
echo "<tr><td><p>"._bt_screensa."</p></td><td><p><input type=\"text\" name=\"screan1\" size=\"80\" />"._bt_screen_expa."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
echo 
"<tr><td><p>"._bt_screensb."</p></td><td><p><input type=\"text\" name=\"screan2\" size=\"80\" />"._bt_screen_expb."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
echo 
"<tr><td><p>"._bt_screensc."</p></td><td><p><input type=\"text\" name=\"screan3\" size=\"80\" />"._bt_screen_expc."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
echo 
"<tr><td><p>"._bt_screensd."</p></td><td><p><input type=\"text\" name=\"screan4\" size=\"80\" />"._bt_screen_expd."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
// End Mods








echo "<tr><td><p>Σύνδεσμος Imdb:</p></td><td><p><input type=\"text\" name=\"imdb_info\" size=\"80\" />(Πρόσθεσε πληροφορίες απο το Imdb στην σελίδα λεπτομερειών των torrents παρέχοντας ένα σύνδεσμο ή ένα Id του Imdb)</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
echo 
"<tr><td><p>Σύνδεσμος Υoutube:</p></td><td><p><input type=\"text\" name=\"tube\" size=\"80\" />(Πρόσθεσε ένα βίντεο του Youtube στην σελίδα λεπτομερειών των torrents παρέχοντας ένα σύνδεσμο ή ένα Id του Youtube)</p>\n</td></tr>\n";
echo 
"<tr><td><p>"._btdescription."</p></td>";
echo 
'<td>';
echo 
$textarea->quick_bbcode('formdata','descr');
echo 
$textarea->input('descr');
echo 
"</table>\n";
echo <<<EOF
<script type="text/javascript">
<!--
function vB_Attachment(listobjid, editorid)
{
    this.attachments = new Array();
    this.menu_contents = new Array();
    this.windows = new Array();

    this.listobjid = listobjid;

    if (editorid == '')
    {
        for (var editorid in vB_Editor)
        {
            if (typeof vB_Editor[editorid] != 'function')
            {
                this.editorid = editorid;
                break;
            }
        }
    }
    else
    {
        this.editorid = (editorid ? editorid : null);
    }
};

// =============================================================================
// vB_Attachment methods

/**
* Does the editor popup exist in a built state?
*
* @return    boolean
*/
vB_Attachment.prototype.popup_exists = function()
{
    if (
        this.editorid &&
        ((typeof vB_Editor[this.editorid].popups['attach'] != 'undefined' && vB_Editor[this.editorid].popups['attach'] != null)
        ||
        (!vB_Editor[this.editorid].popupmode && typeof vB_Editor[this.editorid].buttons['attach'] != 'undefined' && vB_Editor[this.editorid].buttons['attach'] != null))
    )
    {
        return true;
    }
    else
    {
        return false;
    }
};

/**
* Add a new attachment
*
* @param    integer    Attachment ID
* @param    string    File name
* @param    string    File size
* @param    string    Path to item's image (images/attach/jpg.gif etc.)
*/
vB_Attachment.prototype.add = function(id, filename, filesize, imgpath)
{
    this.attachments[id] = new Array();
    this.attachments[id] = {
        'filename' : filename,
        'filesize' : filesize,
        'imgpath'  : imgpath
    };

    this.update_list();
};

/**
* Remove an attachment
*
* @param    integer    Attachment ID
*/
vB_Attachment.prototype.remove = function(id)
{
    if (typeof this.attachments[id] != 'undefined')
    {
        this.attachments[id] = null;

        this.update_list();
    }
};

/**
* Do we have any attachments?
*
* @return    boolean
*/
vB_Attachment.prototype.has_attachments = function()
{
    for (var id in this.attachments)
    {
        if (this.attachments[id] != null)
        {
            return true;
        }
    }
    return false;
};

/**
* Reset the attachments array
*/
vB_Attachment.prototype.reset = function()
{
    this.attachments = new Array();

    this.update_list();
};

/**
* Build Attachments List
*
* @param    string    ID of the HTML element to contain the list of attachments
*/
vB_Attachment.prototype.build_list = function(listobjid)
{
    var listobj = fetch_object(listobjid);

    if (listobjid != null)
    {

        for (var id in this.attachments)
        {
            var div = document.getElementById("descr");
            // try to use the template if it's been submitted to Javascript
                div.innerHTML =div.value +' [img]
$siteurl/UserFiles/$user->name/'+ this.attachments[id]['filename'] + '[/img]';
            listobj.appendChild(div);
        }
    }
};

/**
* Update the places we show a list of attachments
*/
vB_Attachment.prototype.update_list = function()
{
    this.build_list(this.listobjid);

    if (this.popup_exists())
    {
        vB_Editor[this.editorid].build_attachments_popup(
            vB_Editor[this.editorid].popupmode ? vB_Editor[this.editorid].popups['attach'] : vB_Editor[this.editorid].buttons['attach'],
            vB_Editor[this.editorid].buttons['attach']
        );
    }
};

/**
* Opens the attachment manager window
*
* @param    string    URL
* @param    integer    Width
* @param    integer    Height
* @param    string    Hash
*
* @return    window
*/
vB_Attachment.prototype.open_window = function(url, width, height, hash)
{
    if (typeof(this.windows[hash]) != 'undefined' && this.windows[hash].closed == false)
    {
        this.windows[hash].focus();
    }
    else
    {
        this.windows[hash] = openWindow(url, width, height, 'Attach' + hash);
    }

    return this.windows[hash];
};
//-->
</script>
<script type="text/javascript" src="./java/tl.js"><!-- overLIB (c) Erik Bosrup --></script>

<fieldset class="fieldset">
    <legend>Επισύναψη Αρχείων</legend>

    <div style="padding:3px">
        <div style="margin-bottom:3px">
            <div>Ο κάδος των εικόνων σας</div>
            <div>Έγκυρες επεκτάσεις αρχείων: .bmp .gif .jpe .jpeg .jpg .png</div>
        </div>
        <div style="margin-bottom:3px" id="attachlist">
            
        </div>
        <div>
            <input type="button" id="manage_attachments_button" class="button" tabindex="1" style="font-weight:normal" value="Διαχείριση Επισυνάψεων" title="Πατήστε εδώ για να προσθέσετε ή να επεξεργαστείτε συνημμένα αρχεία της περιγραφής του torrent" onclick="vB_Attachments.open_window('bitbucket-upload.php', 800, 600, '')" />

            <script type="text/javascript">vB_Attachments = new vB_Attachment('descr', '');</script>
            <noscript>
            <a rel="nofollow" href="newattachment.php?f=23&poststarttime=1230080445&posthash=68db1fa686788e92c0ebd0f96cefb1a9" target="manageattach" title="Πατήστε εδώ για να προσθέσετε ή να επεξεργαστείτε συνημμένα αρχεία της περιγραφής του torrent" tabindex="1"><strong>Διαχείριση Επισυνάψεων</strong></a>
            </noscript>
        </div>
    </div>
</fieldset>
EOF;
echo
"</td></tr>\n";
$s "<select name=\"torrent_category\"><option value=\"0\">("._btchooseone.")</option>\n";
$cats catlist();
foreach (
$cats as $row)
        
$s .= "<option value=\"" $row["id"] . "\">" htmlspecialchars($row["name"]) . "</option>\n";
$s .= "</select>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";

echo 
"<tr><td><p>"._bttype."</p></td><td><p>"$s ."</p></td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";

echo 
"<tr><td><p>"._btverduplicate."</p></td><td><p><input type=\"checkbox\" name=\"jump_check\" value=\"1\"  /> "._btduplicatinfo."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
if (
$user->premium){
                echo 
"<tr><td><p>Μη Υπολογίσιμο Κατέβασμα στο Torrent<p></td><td><p><input type=radio name=build value=yes>Ναί<input type=radio name=build checked value=no>Όχι</p>\n</td></tr>\n";
                echo 
"<tr><td><hr size=\"1\" noshade></td><td></td></tr>";
}
if(
$shout_config['shout_new_torrent'] == "yes"){
#shout new torrent
echo "<tr><td><p>"._btnewtsh."</p></td><td><p><input type=\"checkbox\" name=\"shout\" value=\"1\"  /> "._btnewshex."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
}

#Evidence. Moderators Only
if ($user->moderator) {
        echo 
"<tr><td><p>"._btupevidence."</p></td><td><p><input type=\"checkbox\" name=\"evidence\" value=\"1\" /> "._btupevidencinfo."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
}

#Owner Preferences. Not for Anonymous Users
if ($user->user) {
        echo 
"<tr><td><p>"._btowner."</p></td><td><p><select name=\"ownertype\">\n<option value=\"0\">"._btowner1."</option><option value=\"1\">"._btowner2."</option><option value=\"2\">"._btowner3."</option></select> "._btownerinfo."</p>\n</td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
}

#Torrent Password
echo "<tr><td><p>"._btpassword."</p></td><td><p><input type=\"text\" name=\"password\" value=\"\" />"._bttorrentpasswordexplain."</p>\n</td>\n</tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";


#Advanced Options
echo "<tr><td><p>"._btupadvopts."</p></td><td><p><input type=\"checkbox\" name=\"adv_opts\" value=\"1\" onClick=\"javascript:expand();\" id=\"adv_check\" />"._btadvoptsexplain."</p></td></tr>\n";
##DHT Support
echo "<tr id=\"advanced_options_1\" class=\"hide\"><td><p>"._btdhtsupport."</p></td><td><p><input type=\"radio\" name=\"dht_support\" value=\"0\" checked />"._btleaveintact."<input type=\"radio\" name=\"dht_support\" value=\"1\" onClick=\"javascript:document.formdata.private_torrent[2].checked = true;\" />"._btendht."<input type=\"radio\" name=\"dht_support\" value=\"2\" />"._btdisdht.""._btdhtsupportexplain."</p></td></tr>\n";
##Private Torrent
echo "<tr id=\"advanced_options_2\" class=\"hide\"><td><p>"._btprivatetorrent."</p></td><td><p><input type=\"radio\" name=\"private_torrent\" value=\"0\" checked />"._btleaveintact."<input type=\"radio\" name=\"private_torrent\" value=\"1\" onClick=\"javascript:document.formdata.dht_support[2].checked = true;\" />"._btenpvt."<input type=\"radio\" name=\"private_torrent\" value=\"2\">"._btdispvt.""._btprivatetorrentexplain."</p></td></tr>\n";


echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
#Notify. Only for Registered Users
if ($user->user) {
        echo 
"<tr><td><p>"._btupnotify."</p></td><td><p><input type=\"checkbox\" name=\"commnotify\" value=\"ok\" > "._btupnotifynfo."<input type=\"checkbox\" name=\"seednotify\" value=\"ok\" > "._btupnotifyseed."</p></td></tr>\n";
echo 
"<tr><td><HR SIZE=1 NOSHADE></td><td></td></tr>\n";
}

echo 
"</table><hr /><input type=\"submit\" value=\""._btfsend."\"></form>\n";
CloseTable();
?>


joeroberts 18th September 2012 00:52

ok so
try it by removing
PHP Code:

if(strlen($tube) > 1)$tube $tubelink;
else
$tube ''



All times are GMT +2. The time now is 12:55.

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