Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   FreeTSP (http://www.bvlist.com/forumdisplay.php?f=120)
-   -   FreeTSP modded by - FIREFLY [RC3][Unofficial] (http://www.bvlist.com/showthread.php?t=8477)

firefly 11th November 2012 20:25

FreeTSP modded by - FIREFLY [RC3][Unofficial]
 
1 Attachment(s)
Thanks go's to the original authors...

PHP Code:

*-------------------------------------------------------------------------------*
*------------   
Original Credits to tbSourceBytemonsoonTBDev   -------------*
*-------------------------------------------------------------------------------*
*--------           
Developed ByKryptoFireknightSubzero           --------*
*-------------------------------------------------------------------------------*
*-----------------       
First Release Date August 2010      -------------------*
*-----------                 
http://www.freetsp.info                 -----------*
*------                    2010 FreeTSP Development Team                  ------*
*-------------------------------------------------------------------------------* 

Index

Mods added to index
  • Top ten uploads with images.
  • Top forum posts
  • shoutbox on index
  • Online users in shoutbox (Like Torrent Day)
  • Last ten visitors
  • Server load
Styling to index
  • Wrapped each section with a div
  • Added heads

Other pages


Upload page
  • Stop and start announce
  • upload Poster
  • Trailer(youtube)

----------------------------------------------------------------


Screens

http://bodyrockdance.co.za/screen1.jpg
http://bodyrockdance.co.za/screen2.jpg
http://bodyrockdance.co.za/screen3.jpg
http://bodyrockdance.co.za/screen4.jpg


Install

Please follow the instructionsin "Install Guide.html"

Tones 11th November 2012 21:24

Nice!!
 
This is modded TBDEV or what source is it??

nvm i see is modded TBDEV!!



After install i get this error on home page

HTML Code:

Warning: fopen(/index/lastten.txt) [function.fopen]: failed to open stream: No such file or directory in /home/u899582385/public_html/index.php on line 633

Warning: fputs(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 634

Warning: fclose(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 635
Last 10 visitors



what is rong??

firefly 11th November 2012 22:34

Quote:

After install i get this error on home page

Warning: fopen(/index/lastten.txt) [function.fopen]: failed to open stream: No such file or directory in /home/u899582385/public_html/index.php on line 633

Warning: fputs(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 634

Warning: fclose(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 635

Change this

$file = "$CACHE/index/lastten.txt";

to this

$file = "lastten.txt";

you might need to create a file called lastten.txt and chmod it to 777

Tones 11th November 2012 22:54

Solved
 
thanks I got it.Can you tell me how to implement http://www.bvlist.com/mods-themes/78...pload-mod.html in the source?????

firefly 11th November 2012 22:57

Quote:

Originally Posted by Tones (Post 37351)
thanks I got it.Can you tell me how to implement http://www.bvlist.com/mods-themes/78...pload-mod.html in the source?????

I will give it a bash...

Tones 11th November 2012 23:06

Quote:

Originally Posted by firefly (Post 37352)
I will give it a bash...

Thx man Looking forward to hearing from you!

firefly 12th November 2012 01:19

DHT_Upload-FREETSP
 
2 Attachment(s)
DHT_Upload-FREETSP

Tones 12th November 2012 08:45

Great!!
 
Quote:

Originally Posted by firefly (Post 37357)
DHT_Upload-FREETSP

Thanks man I will try to see how it works back after to tell how it goes!!

DHT works without problems if there is a problem along'll let you know!

But until then here's what appears on the home page

Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 736

Our Tracker Load: (0 %)(these stats are an approximation)


Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 744


Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 747


Have you any suggestions???

Quote:

Originally Posted by firefly (Post 37357)
DHT_Upload-FREETSP


Look at this ...

http://s11.postimage.org/64wkgynkz/DHT.jpg

Joco1114 18th November 2012 11:40

I deleted the 3 blocks, so I cut the "server load" part from the source.

Bump: I replaced with this:

$file = ROOT_DIR."cache/lastten.txt"; // it's a cache directory

Quote:

Originally Posted by Tones (Post 37348)
This is modded TBDEV or what source is it??

After install i get this error on home page

Warning: fopen(/index/lastten.txt) [function.fopen]: failed to open stream: No such file or directory in /home/u899582385/public_html/index.php on line 633

Warning: fputs(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 634

Warning: fclose(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 635
Last 10 visitors


Tones 18th November 2012 16:24

solved!
 
Thx man problem solved a long time a go!!

Chez 18th November 2012 18:39

External upload error ... it show me this error

http://i.imgur.com/pCauf.png

and if i remove it, when i press UPLOAD button it show me blank page

Joco1114 19th November 2012 20:12

I made a modification for the details page: use hightslide to zoom pictures.
If any1 need I can paste the code and the method.

Bump: Did you try to upload same file again? This error will appear when the mysql insertion in the line 245 wasnt success.
Try to change the line like this to show the exact error and report here:

from: mysql_err();
to: die(mysql_error());

Sorry about my English, I'm from Hungary. :)

Quote:

Originally Posted by Chez (Post 37442)
External upload error ... it show me this error

http://i.imgur.com/pCauf.png

and if i remove it, when i press UPLOAD button it show me blank page


wMan 22nd November 2012 03:02

Quote:

Originally Posted by Tones (Post 37348)
This is modded TBDEV or what source is it??

nvm i see is modded TBDEV!!



After install i get this error on home page

Warning: fopen(/index/lastten.txt) [function.fopen]: failed to open stream: No such file or directory in /home/u899582385/public_html/index.php on line 633

Warning: fputs(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 634

Warning: fclose(): supplied argument is not a valid stream resource in /home/u899582385/public_html/index.php on line 635
Last 10 visitors



what is rong??

its a 08 TBDEV code mate needs alot of work you not much in the way of mods too mate

firefly 22nd November 2012 08:44

Quote:

Originally Posted by bill123 (Post 37502)
its a 08 TBDEV code mate needs alot of work you not much in the way of mods too mate



1) That error has nothing to do with the code and more to do with an error I made.

This is based largely on '08 but there are some alterations to the code

2)
Quote:

External upload error ... it show me this error

http://i.imgur.com/pCauf.png

and if i remove it, when i press UPLOAD button it show me blank page
The DHT mod is incomplete and not finished yet but it seemed to work for me. As I explained above , I needed to edit a lot of the code for it to work cause that mod came from old DEV source. I made that for Tones. When I get a chance I will look though it and clean it up and debug it.

You can PM your site link to me and I will check it out.

Joco1114 23rd November 2012 17:32

DHT is working, but I have issues with login. Sometimes I get errors from page_verify->check(). After sign up, I cant login, I have to ask an another password and after that I can login.

Is there any new version of it?

wMan 23rd November 2012 18:01

Quote:

Originally Posted by Joco1114 (Post 37550)
DHT is working, but I have issues with login. Sometimes I get errors from page_verify->check(). After sign up, I cant login, I have to ask an another password and after that I can login.

Is there any new version of it?

yes i have but not out for release yet

firefly 25th November 2012 05:49

Quote:

Originally Posted by Joco1114 (Post 37550)
DHT is working, but I have issues with login. Sometimes I get errors from page_verify->check(). After sign up, I cant login, I have to ask an another password and after that I can login.

Is there any new version of it?

I don't seem to have that problem, have you tried removing all cookies related to that domain name and then closing and open your browser . Ive tested it my self and it seem to be fine by the way the login and takelogin are untouched.:chch:

I am about to release a even more complete version pretty soon! I'm just finishing off a few thing:gum:

Joco1114 27th November 2012 21:16

I got the solution with login. There was the problem with mksecret() function in functions\function_main.php. It seems the genereated secret string stored in the mysql table was re-read incorrectly. That's because I use special accents (like: áűőúöüóí) and I had conflict with the codepages in PHP and in MySQL. Here is my mksecret():

PHP Code:

function mksecret($len 20)
{
    
$ret "";
    
$chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    
$size strlen$chars );
    for( 
$i 0$i $len$i++ ) {
        
$ret .= $charsrand0$size ) ];
    }
    return 
$ret;


As it seems it generated only "readable" secret string contain [a-zA-Z0-9] chars. No accents! :)

PS: I'm waiting your complete version impatiently. :)


Quote:

Originally Posted by firefly (Post 37583)
I don't seem to have that problem, have you tried removing all cookies related to that domain name and then closing and open your browser . Ive tested it my self and it seem to be fine by the way the login and takelogin are untouched.:chch:

I am about to release a even more complete version pretty soon! I'm just finishing off a few thing:gum:


firefly 28th November 2012 04:58

Quote:

Originally Posted by Joco1114 (Post 37659)
I got the solution with login. There was the problem with mksecret() function in functions\function_main.php. It seems the genereated secret string stored in the mysql table was re-read incorrectly. That's because I use special accents (like: áűőúöüóí) and I had conflict with the codepages in PHP and in MySQL. Here is my mksecret():

PHP Code:

function mksecret($len 20)
{
    
$ret "";
    
$chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    
$size strlen$chars );
    for( 
$i 0$i $len$i++ ) {
        
$ret .= $charsrand0$size ) ];
    }
    return 
$ret;


As it seems it generated only "readable" secret string contain [a-zA-Z0-9] chars. No accents! :)

PS: I'm waiting your complete version impatiently. :)

I will have a look... what is your language?

Pretty soon, I'm busy make language pack, its very time consuming ....

Joco1114 28th November 2012 07:38

I'm from Hungary. I had to change all HTMLEntities() to HTMLSpecialChars() because of accented chars. I got strange chars instead of my Hungarian chars.

Language files would be welcomed. :) I will translate it to Hungarian, if you will publish it.

Other: I "extended" this source with the HTTP download possibility. It means above a special ratio and/or for higher classes the members can download the files with HTTP protocol. I insertet into the function_config.php a new config variable:
PHP Code:

$http_upload_dir    ROOT_DIR."/tracker"

I seed my files from this folder by default and after a file_exists() inquiry I write the link for this file. Not too elegant, but I had no change torrent table with a new HTTP_URL field. :)

Other: I'm noticed an interesting thing: every leeching will start a couple of minutes after dropping into the client. It is about 4-5 minutes and the speed is not to good, about 1Mbit/sec (120kBps). Of course my inet speed is higher (20Mbits). I checked the wait time, but it is equal is 0 (for everyone). Or is there any limit of down speed in announce.php?

Sorry about my English, I learned everything from the Internet. So I speak BASIC English. :)

Quote:

Originally Posted by firefly (Post 37665)
I will have a look... what is your language?

Pretty soon, I'm busy make language pack, its very time consuming ....


firefly 28th November 2012 11:57

Quote:

Originally Posted by Joco1114 (Post 37667)
I'm from Hungary. I had to change all HTMLEntities() to HTMLSpecialChars() because of accented chars. I got strange chars instead of my Hungarian chars.

Language files would be welcomed. :) I will translate it to Hungarian, if you will publish it.

Other: I "extended" this source with the HTTP download possibility. It means above a special ratio and/or for higher classes the members can download the files with HTTP protocol. I insertet into the function_config.php a new config variable:
PHP Code:

$http_upload_dir    ROOT_DIR."/tracker"

I seed my files from this folder by default and after a file_exists() inquiry I write the link for this file. Not too elegant, but I had no change torrent table with a new HTTP_URL field. :)

Other: I'm noticed an interesting thing: every leeching will start a couple of minutes after dropping into the client. It is about 4-5 minutes and the speed is not to good, about 1Mbit/sec (120kBps). Of course my inet speed is higher (20Mbits). I checked the wait time, but it is equal is 0 (for everyone). Or is there any limit of down speed in announce.php?

Sorry about my English, I learned everything from the Internet. So I speak BASIC English. :)

NIce job!

I seemed to get decent speed will test it later... I'm still doing the lang mod.

It would be a great help if you could translate this so long :)

PHP Code:

<?php
/* 
------------------
Language: English
------------------
*/

$lang = array();





// headers
$lang['new_member'] = 'Welcome our newest Member';
$lang['staff_news'] = 'Staff news page';
$lang['recent_news'] = 'Recent News';
$lang['poll'] = 'Site Polls';
$lang['top_poster'] = 'Top ten with posters';
$lang['top_ten'] = 'Top ten torrents downloaded';
$lang['recomended'] = 'Recommended torrents by staff';
$lang['top_forum'] = 'Top ten forum posts';
$lang['shoutbox'] = 'Shoutbox';
$lang['modbox'] = 'Mod Shoutbox';
$lang['radio'] = 'Site radio';
$lang['stats'] = 'Site stats';
$lang['last_online'] = 'Last people on the site';
$lang['disc'] = 'Sites Disclaimer';
$lang['load'] = 'Server load and stats';

//radio
$lang['rad_link'] = 'Radio Links';
$lang['rad_req'] = 'Radio requests';
$lang['view_req'] = 'View requests';
$lang['make_req'] = 'Make requests';
$lang['rad_stat'] = 'Radio stats';

//stats

$lang['reg_use'] = 'Registered Users';
$lang['uncon_user'] = 'Unconfirmed Users';
$lang['forum_top'] = 'Forum Topics';
$lang['forum_pos'] = 'Forum Posts';
$lang['peers'] = 'peers';
$lang['seeders'] = 'Seeders';
$lang['leecher'] = 'Leechers';
$lang['users_online'] = 'Users Online';
$lang['donors'] = 'Donors';
$lang['torrents'] = 'Torrents';
$lang['new_today'] = 'Torrents added today';
$lang['uncon'] = 'Unconnectable Peers';
$lang['uncon_rat'] = 'Unconnectables Ratio (%)';
$lang['seed_leech'] = 'Seeder/Leecher Ratio (%)';
$lang['lastten_online_head'] = 'The last ten visitors';
$lang['disc1'] = '<b>None of the files shown here are actually hosted on this server. The links are provided solely by this sites users.  The administrator of this site ';
$lang['disc2'] = 'cannot be held responsible for what its users post, or any other actions of its users.  You may not use this site to distribute or download any material when you do not have the legal rights to do so.  It is your own responsibility to adhere to these terms.</b>';
$lang['our_load'] = 'Our Tracker Load:';
$lang['load_txt1'] = '(these stats are an approximation)';
$lang['load_txt2'] = 'Global Server Load (All websites on current host servers):';
            

?>

and call it lang.hu.php

Joco1114 28th November 2012 18:56

Sent by a PM.

J


Quote:

Originally Posted by firefly (Post 37671)
NIce job!
I seemed to get decent speed will test it later... I'm still doing the lang mod.
It would be a great help if you could translate this so long :)


ExtremeGaby 25th December 2012 15:14

Quote:

Originally Posted by Tones (Post 37360)
Thanks man I will try to see how it works back after to tell how it goes!!

DHT works without problems if there is a problem along'll let you know!

But until then here's what appears on the home page

Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 736

Our Tracker Load: (0 %)(these stats are an approximation)


Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 744


Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 747


Have you any suggestions???




Look at this ...

http://s11.postimage.org/64wkgynkz/DHT.jpg


poftim modul de takeupload.php sa vada 1 seeders

PHP Code:

<?php

/*
*-------------------------------------------------------------------------------*
*----------------    |  ____|        |__   __/ ____|  __ \        --------------*
*----------------    | |__ _ __ ___  ___| | | (___ | |__) |       --------------*
*----------------    |  __| '__/ _ \/ _ \ |  \___ \|  ___/        --------------*
*----------------    | |  | | |  __/  __/ |  ____) | |            --------------*
*----------------    |_|  |_|  \___|\___|_| |_____/|_|            --------------*
*-------------------------------------------------------------------------------*
*---------------------------    FreeTSP RC 3.0   -------------------------------*
*-------------------   The Alternate BitTorrent Source   -----------------------*
*-------------------------------------------------------------------------------*
*-------------------------------------------------------------------------------*
*--   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  --*
*--                                                                           --*
*-------------------------------------------------------------------------------*
*------------   Original Credits to tbSource, Bytemonsoon, TBDev   -------------*
*-------------------------------------------------------------------------------*
*--------           Developed By: Krypto, Fireknight, Subzero           --------*
*-------------------------------------------------------------------------------*
*-----------------       First Release Date August 2010      -------------------*
*-----------                 http://www.freetsp.info                 -----------*
*------                    2010 FreeTSP Development Team                  ------*
*-------------------------------------------------------------------------------*
*/

require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'functions'.DIRECTORY_SEPARATOR.'function_main.php');
require_once(
INCL_DIR.'function_user.php');
require_once(
INCL_DIR.'function_vfunctions.php');
require_once(
INCL_DIR.'function_torrenttable.php');
require_once(
INCL_DIR.'function_benc.php');
require_once(
INCL_DIR.'function_page_verify.php');

ini_set("upload_max_filesize",$max_torrent_size);

db_connect();
logged_in();

$newpage = new page_verify();
$newpage->check('_upload_');

if (
get_user_class() < UC_USER)
    die;

foreach(
explode(":","descr:type:name") AS $v) {
    if (!isset(
$_POST[$v]))
        
error_message("error","Upload Failed!","Missing Form Data");
}

if (!isset(
$_FILES["file"]))
    
error_message("error","Upload Failed!","Missing Form Data");

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

if (empty(
$fname))
{
    
error_message("error","Upload Failed!","Empty filename!");
}

$nfo sqlesc('');

if(isset(
$_FILES['nfo']) && !empty($_FILES['nfo']['name']))
{
    
$nfofile $_FILES['nfo'];

    if (
$nfofile['name'] == '')
        
error_message("error","Upload Failed!","No NFO!");

    if (
$nfofile['size'] == 0)
        
error_message("error","Upload Failed!","0-byte NFO");

    if (
$nfofile['size'] > 65535)
        
error_message("error","Upload Failed!","NFO is too big! Max 65,535 bytes.");

    
$nfofilename $nfofile['tmp_name'];

    if (@!
is_uploaded_file($nfofilename))
        
error_message("error","Upload Failed!","NFO Upload Failed");

    
$nfo sqlesc(str_replace("\x0d\x0d\x0a""\x0d\x0a", @file_get_contents($nfofilename)));
}

$descr unesc($_POST["descr"]);

$tube unesc($_POST["tube"]);

if (!
$descr)
{
    
error_message("error","Upload Failed!","You must enter a Description!");
}

$catid = ($_POST["type"]);

if (!
is_valid_id($catid))
{
    
error_message("error","Upload Failed!","You must select a Category to put the torrent in!");
}

if (!
validfilename($fname))
{
    
error_message("error","Upload Failed!","Invalid Filename!");
}

if (!
preg_match('/^(.+)\.torrent$/si'$fname$matches))
{
    
error_message("error","Upload Failed!","Invalid Filename (Not a .torrent).");
}

$shortfname $torrent $matches[1];

if (!empty(
$_POST["name"]))
{
    
$torrent unesc($_POST["name"]);
}

if (!empty(
$_POST["poster"]))
{
     
$poster unesc($_POST["poster"]);
}

$tmpname $f["tmp_name"];

if (!
is_uploaded_file($tmpname))
{
    
error_message("error","Upload Failed!","eek");
}

if (!
filesize($tmpname))
{
    
error_message("error","Upload Failed!","Empty file!");
}

$dict bdec_file($tmpname$max_torrent_size);

if (!isset(
$dict))
{
    
error_message("error","Upload Failed!","What the hell did you upload? This is not a bencoded file!");
}

function 
dict_check($d$s)
{
    if (
$d["type"] != "dictionary")
    {
        
error_message("error","Upload Failed","not a dictionary");
    }

    
$a   explode(":"$s);
    
$dd  $d["value"];
    
$ret = array();
    
$t   '';

    foreach (
$a AS $k)
    {
        unset(
$t);

        if (
preg_match('/^(.*)\((.*)\)$/'$k$m))
        {
            
$k $m[1];
            
$t $m[2];
        }

        if (!isset(
$dd[$k]))
        {
            
error_message("error","Upload Failed!","Dictionary is missing Key(s)");
        }

        if (isset(
$t))
        {
            if (
$dd[$k]["type"] != $t)
            {
                
error_message("error","Upload Failed!","Invalid entry in Dictionary");
            }
            
$ret[] = $dd[$k]["value"];
        }
        else
        {
            
$ret[] = $dd[$k];
        }
    }
    return 
$ret;
}

function 
dict_get($d$k$t)
{
    if (
$d["type"] != "dictionary")
    {
        
error_message("error","Upload Failed!","Not a Dictionary");
    }

    
$dd $d["value"];

    if (!isset(
$dd[$k]))
    {
        return;
    }

    
$v $dd[$k];

    if (
$v["type"] != $t)
    {
        
error_message("error","Upload Failed!","Invalid Dictionary entry type");
    }
    return 
$v["value"];
}

list(
$ann$info) = dict_check($dict"announce(string):info");
list(
$dname$plen$pieces) = dict_check($info"name(string):piece length(integer):pieces(string)");

$passkey=$announce_urls[0].'?passkey='.$CURUSER['passkey'];

//if ($passkey != $ann)
//    error_message("error","Upload Failed!","Invalid Announce URL! must be <b>" . $announce_urls[0] . "</b>");

if (strlen($pieces) % 20 != 0)
{
    
error_message("error","Upload Failed!","Invalid Pieces");
}

$filelist = array();
$totallen dict_get($info"length""integer");

if (isset(
$totallen))
{
    
$filelist[] = array($dname$totallen);
    
$type "single";
}
else
{
    
$flist dict_get($info"files""list");

    if (!isset(
$flist))
    {
        
error_message("error","Upload Failed!","missing both length and files");
    }

    if (!
count($flist))
    {
        
error_message("error","Upload Failed!","No Files");
    }

    
$totallen 0;

    foreach (
$flist AS $fn)
    {
        list(
$ll$ff) = dict_check($fn"length(integer):path(list)");
        
$totallen += $ll;
        
$ffa = array();
        foreach (
$ff AS $ffe)
        {
            if (
$ffe["type"] != "string")
            {
                
error_message("error","Upload Failed!","Filename Error");
            }

            
$ffa[] = $ffe["value"];
        }

        if (!
count($ffa))
        {
            
error_message("error","Upload Failed!","Filename Error");
        }

        
$ffe implode("/"$ffa);
        
$filelist[] = array($ffe$ll);
    }
    
$type "multi";
}

$infohash pack("H*"sha1($info["string"]));

// Replace punctuation characters with spaces

$torrent str_replace("_"" "$torrent);
$torrent str_replace(".torrent"" "$torrent);
$torrent str_replace(".rar"" "$torrent);
$torrent str_replace(".avi"" "$torrent);
$torrent str_replace(".mpeg"" "$torrent);
$torrent str_replace(".exe"" "$torrent);
$torrent str_replace(".zip"" "$torrent);
$torrent str_replace(".wmv"" "$torrent);
$torrent str_replace(".iso"" "$torrent);
$torrent str_replace(".bin"" "$torrent);
$torrent str_replace(".txt"" "$torrent);
$torrent str_replace(".nfo"" "$torrent);
$torrent str_replace(".7z"" "$torrent);
$torrent str_replace(".mp3"" "$torrent);
$torrent str_replace("."" "$torrent);

$nfo sqlesc(str_replace("\x0d\x0d\x0a""\x0d\x0a", @file_get_contents($nfofilename)));

$ret sql_query("INSERT INTO torrents (search_text, filename, owner, visible, tube, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo, poster) VALUES (" .
        
implode(","array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname$CURUSER["id"], "no"$tube,
 
$infohash$torrent$totallencount($filelist), $type$descr$descr$_POST["type"], $dname))) . ", '" get_date_time() . "', '" get_date_time() . "', $nfo, '".$poster."'
)"
);

if (!
$ret)
{
    if (
mysql_errno() == 1062)
    {
        
error_message("error","Upload Failed!","torrent already uploaded!");
    }
    
mysql_err();
}

$id mysql_insert_id();

@
sql_query("DELETE FROM files WHERE torrent = $id");

foreach (
$filelist AS $file)
{
    @
sql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
}

move_uploaded_file($tmpname"$torrent_dir/$id.torrent");

write_log("Torrent $id ($torrent) was uploaded by " $CURUSER["username"]);

/* RSS feeds */

if (($fd1 = @fopen("rss.xml""w")) && ($fd2 fopen("rssdd.xml""w")))
{
    
$cats "";
    
$res  sql_query("SELECT id, name FROM categories");

    while (
$arr mysql_fetch_assoc($res))
    {
        
$cats[$arr["id"]] = $arr["name"];
    }

    
$s "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<rss version=\"0.91\">\n<channel>\n" .
        
"<title>$site_name</title>\n<description>0-week torrents</description>\n<link>$site_url/</link>\n";
    @
fwrite($fd1$s);
    @
fwrite($fd2$s);

    
$r sql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") OR sqlerr(__FILE____LINE__);

    while (
$a mysql_fetch_assoc($r))
    {
        
$cat $cats[$a["category"]];

        
$s   "<item>\n<title>" htmlspecialchars($a["name"] . " ($cat)") . "</title>\n" "<description>" htmlspecialchars($a["descr"]) . "</description>\n";

        @
fwrite($fd1$s);
        @
fwrite($fd2$s);
        @
fwrite($fd1"<link>$site_url/details.php?id=$a[id]&hit=1</link>\n</item>\n");
        
$filename htmlspecialchars($a["filename"]);
        @
fwrite($fd2"<link>$site_url/download.php/$a[id]/$filename</link>\n</item>\n");
    }
    
$s "</channel>\n</rss>\n";

    @
fwrite($fd1$s);
    @
fwrite($fd2$s);
    @
fclose($fd1);
    @
fclose($fd2);
}

/* Email notifs

$res = sql_query("SELECT name FROM categories WHERE id=$catid") OR sqlerr();
$arr = mysql_fetch_assoc($res);
$cat = $arr["name"];
$res = sql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") OR sqlerr();
$uploader = $CURUSER['username'];

$size = mksize($totallen);
$description = ($html ? strip_tags($descr) : $descr);

$body = <<<EOD
A new torrent has been uploaded.

Name: $torrent
Size: $size
Category: $cat
Uploaded by: $uploader

Description
-------------------------------------------------------------------------------
$description
-------------------------------------------------------------------------------

You can use the URL below to download the torrent (you may have to login).

$site_url/details.php?id=$id&hit=1

--
$site_name
EOD;
$to = "";
$nmax = 100; // Max recipients per message
$nthis = 0;
$ntotal = 0;
$total = mysql_num_rows($res);
while ($arr = mysql_fetch_row($res))
{
    if ($nthis == 0)
    {
        $to = $arr[0];
    }
    else
    {
        $to .= "," . $arr[0];
    }
    ++$nthis;
    ++$ntotal;
    if ($nthis == $nmax || $ntotal == $total)
    {
        if (!mail("Multiple recipients <$site_email>", "New torrent - $torrent", $body,
            "From: $site_email\r\nBcc: $to", "-f$site_email"))
        {
            "error","Signup Failed!",("error","Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE!\n" .
                    "There was however a problem delivering the e-mail notifcations.\n" .
                    "Please let an administrator know about this error!\n");
        }
        $nthis = 0;
    }
}
*/

mysql_query("UPDATE torrents SET visible = 'yes' WHERE id=$id");
mysql_query("UPDATE torrents SET seeders=seeders+1 WHERE id=$id") or sqlerr(__FILE____LINE__);
header("Location: $site_url/details.php?id=$id&uploaded=1");
?>


Tones 25th December 2012 16:38

Nice!!
 
Merci man!!

Bump:
Quote:

Originally Posted by ExtremeGaby (Post 38444)
poftim modul de takeupload.php sa vada 1 seeders

PHP Code:

<?php

/*
*-------------------------------------------------------------------------------*
*----------------    |  ____|        |__   __/ ____|  __ \        --------------*
*----------------    | |__ _ __ ___  ___| | | (___ | |__) |       --------------*
*----------------    |  __| '__/ _ \/ _ \ |  \___ \|  ___/        --------------*
*----------------    | |  | | |  __/  __/ |  ____) | |            --------------*
*----------------    |_|  |_|  \___|\___|_| |_____/|_|            --------------*
*-------------------------------------------------------------------------------*
*---------------------------    FreeTSP RC 3.0   -------------------------------*
*-------------------   The Alternate BitTorrent Source   -----------------------*
*-------------------------------------------------------------------------------*
*-------------------------------------------------------------------------------*
*--   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  --*
*--                                                                           --*
*-------------------------------------------------------------------------------*
*------------   Original Credits to tbSource, Bytemonsoon, TBDev   -------------*
*-------------------------------------------------------------------------------*
*--------           Developed By: Krypto, Fireknight, Subzero           --------*
*-------------------------------------------------------------------------------*
*-----------------       First Release Date August 2010      -------------------*
*-----------                 http://www.freetsp.info                 -----------*
*------                    2010 FreeTSP Development Team                  ------*
*-------------------------------------------------------------------------------*
*/

require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'functions'.DIRECTORY_SEPARATOR.'function_main.php');
require_once(
INCL_DIR.'function_user.php');
require_once(
INCL_DIR.'function_vfunctions.php');
require_once(
INCL_DIR.'function_torrenttable.php');
require_once(
INCL_DIR.'function_benc.php');
require_once(
INCL_DIR.'function_page_verify.php');

ini_set("upload_max_filesize",$max_torrent_size);

db_connect();
logged_in();

$newpage = new page_verify();
$newpage->check('_upload_');

if (
get_user_class() < UC_USER)
    die;

foreach(
explode(":","descr:type:name") AS $v) {
    if (!isset(
$_POST[$v]))
        
error_message("error","Upload Failed!","Missing Form Data");
}

if (!isset(
$_FILES["file"]))
    
error_message("error","Upload Failed!","Missing Form Data");

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

if (empty(
$fname))
{
    
error_message("error","Upload Failed!","Empty filename!");
}

$nfo sqlesc('');

if(isset(
$_FILES['nfo']) && !empty($_FILES['nfo']['name']))
{
    
$nfofile $_FILES['nfo'];

    if (
$nfofile['name'] == '')
        
error_message("error","Upload Failed!","No NFO!");

    if (
$nfofile['size'] == 0)
        
error_message("error","Upload Failed!","0-byte NFO");

    if (
$nfofile['size'] > 65535)
        
error_message("error","Upload Failed!","NFO is too big! Max 65,535 bytes.");

    
$nfofilename $nfofile['tmp_name'];

    if (@!
is_uploaded_file($nfofilename))
        
error_message("error","Upload Failed!","NFO Upload Failed");

    
$nfo sqlesc(str_replace("\x0d\x0d\x0a""\x0d\x0a", @file_get_contents($nfofilename)));
}

$descr unesc($_POST["descr"]);

$tube unesc($_POST["tube"]);

if (!
$descr)
{
    
error_message("error","Upload Failed!","You must enter a Description!");
}

$catid = ($_POST["type"]);

if (!
is_valid_id($catid))
{
    
error_message("error","Upload Failed!","You must select a Category to put the torrent in!");
}

if (!
validfilename($fname))
{
    
error_message("error","Upload Failed!","Invalid Filename!");
}

if (!
preg_match('/^(.+)\.torrent$/si'$fname$matches))
{
    
error_message("error","Upload Failed!","Invalid Filename (Not a .torrent).");
}

$shortfname $torrent $matches[1];

if (!empty(
$_POST["name"]))
{
    
$torrent unesc($_POST["name"]);
}

if (!empty(
$_POST["poster"]))
{
     
$poster unesc($_POST["poster"]);
}

$tmpname $f["tmp_name"];

if (!
is_uploaded_file($tmpname))
{
    
error_message("error","Upload Failed!","eek");
}

if (!
filesize($tmpname))
{
    
error_message("error","Upload Failed!","Empty file!");
}

$dict bdec_file($tmpname$max_torrent_size);

if (!isset(
$dict))
{
    
error_message("error","Upload Failed!","What the hell did you upload? This is not a bencoded file!");
}

function 
dict_check($d$s)
{
    if (
$d["type"] != "dictionary")
    {
        
error_message("error","Upload Failed","not a dictionary");
    }

    
$a   explode(":"$s);
    
$dd  $d["value"];
    
$ret = array();
    
$t   '';

    foreach (
$a AS $k)
    {
        unset(
$t);

        if (
preg_match('/^(.*)\((.*)\)$/'$k$m))
        {
            
$k $m[1];
            
$t $m[2];
        }

        if (!isset(
$dd[$k]))
        {
            
error_message("error","Upload Failed!","Dictionary is missing Key(s)");
        }

        if (isset(
$t))
        {
            if (
$dd[$k]["type"] != $t)
            {
                
error_message("error","Upload Failed!","Invalid entry in Dictionary");
            }
            
$ret[] = $dd[$k]["value"];
        }
        else
        {
            
$ret[] = $dd[$k];
        }
    }
    return 
$ret;
}

function 
dict_get($d$k$t)
{
    if (
$d["type"] != "dictionary")
    {
        
error_message("error","Upload Failed!","Not a Dictionary");
    }

    
$dd $d["value"];

    if (!isset(
$dd[$k]))
    {
        return;
    }

    
$v $dd[$k];

    if (
$v["type"] != $t)
    {
        
error_message("error","Upload Failed!","Invalid Dictionary entry type");
    }
    return 
$v["value"];
}

list(
$ann$info) = dict_check($dict"announce(string):info");
list(
$dname$plen$pieces) = dict_check($info"name(string):piece length(integer):pieces(string)");

$passkey=$announce_urls[0].'?passkey='.$CURUSER['passkey'];

//if ($passkey != $ann)
//    error_message("error","Upload Failed!","Invalid Announce URL! must be <b>" . $announce_urls[0] . "</b>");

if (strlen($pieces) % 20 != 0)
{
    
error_message("error","Upload Failed!","Invalid Pieces");
}

$filelist = array();
$totallen dict_get($info"length""integer");

if (isset(
$totallen))
{
    
$filelist[] = array($dname$totallen);
    
$type "single";
}
else
{
    
$flist dict_get($info"files""list");

    if (!isset(
$flist))
    {
        
error_message("error","Upload Failed!","missing both length and files");
    }

    if (!
count($flist))
    {
        
error_message("error","Upload Failed!","No Files");
    }

    
$totallen 0;

    foreach (
$flist AS $fn)
    {
        list(
$ll$ff) = dict_check($fn"length(integer):path(list)");
        
$totallen += $ll;
        
$ffa = array();
        foreach (
$ff AS $ffe)
        {
            if (
$ffe["type"] != "string")
            {
                
error_message("error","Upload Failed!","Filename Error");
            }

            
$ffa[] = $ffe["value"];
        }

        if (!
count($ffa))
        {
            
error_message("error","Upload Failed!","Filename Error");
        }

        
$ffe implode("/"$ffa);
        
$filelist[] = array($ffe$ll);
    }
    
$type "multi";
}

$infohash pack("H*"sha1($info["string"]));

// Replace punctuation characters with spaces

$torrent str_replace("_"" "$torrent);
$torrent str_replace(".torrent"" "$torrent);
$torrent str_replace(".rar"" "$torrent);
$torrent str_replace(".avi"" "$torrent);
$torrent str_replace(".mpeg"" "$torrent);
$torrent str_replace(".exe"" "$torrent);
$torrent str_replace(".zip"" "$torrent);
$torrent str_replace(".wmv"" "$torrent);
$torrent str_replace(".iso"" "$torrent);
$torrent str_replace(".bin"" "$torrent);
$torrent str_replace(".txt"" "$torrent);
$torrent str_replace(".nfo"" "$torrent);
$torrent str_replace(".7z"" "$torrent);
$torrent str_replace(".mp3"" "$torrent);
$torrent str_replace("."" "$torrent);

$nfo sqlesc(str_replace("\x0d\x0d\x0a""\x0d\x0a", @file_get_contents($nfofilename)));

$ret sql_query("INSERT INTO torrents (search_text, filename, owner, visible, tube, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo, poster) VALUES (" .
        
implode(","array_map("sqlesc", array(searchfield("$shortfname $dname $torrent"), $fname$CURUSER["id"], "no"$tube,
 
$infohash$torrent$totallencount($filelist), $type$descr$descr$_POST["type"], $dname))) . ", '" get_date_time() . "', '" get_date_time() . "', $nfo, '".$poster."'
)"
);

if (!
$ret)
{
    if (
mysql_errno() == 1062)
    {
        
error_message("error","Upload Failed!","torrent already uploaded!");
    }
    
mysql_err();
}

$id mysql_insert_id();

@
sql_query("DELETE FROM files WHERE torrent = $id");

foreach (
$filelist AS $file)
{
    @
sql_query("INSERT INTO files (torrent, filename, size) VALUES ($id, ".sqlesc($file[0]).",".$file[1].")");
}

move_uploaded_file($tmpname"$torrent_dir/$id.torrent");

write_log("Torrent $id ($torrent) was uploaded by " $CURUSER["username"]);

/* RSS feeds */

if (($fd1 = @fopen("rss.xml""w")) && ($fd2 fopen("rssdd.xml""w")))
{
    
$cats "";
    
$res  sql_query("SELECT id, name FROM categories");

    while (
$arr mysql_fetch_assoc($res))
    {
        
$cats[$arr["id"]] = $arr["name"];
    }

    
$s "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<rss version=\"0.91\">\n<channel>\n" .
        
"<title>$site_name</title>\n<description>0-week torrents</description>\n<link>$site_url/</link>\n";
    @
fwrite($fd1$s);
    @
fwrite($fd2$s);

    
$r sql_query("SELECT id,name,descr,filename,category FROM torrents ORDER BY added DESC LIMIT 15") OR sqlerr(__FILE____LINE__);

    while (
$a mysql_fetch_assoc($r))
    {
        
$cat $cats[$a["category"]];

        
$s   "<item>\n<title>" htmlspecialchars($a["name"] . " ($cat)") . "</title>\n" "<description>" htmlspecialchars($a["descr"]) . "</description>\n";

        @
fwrite($fd1$s);
        @
fwrite($fd2$s);
        @
fwrite($fd1"<link>$site_url/details.php?id=$a[id]&hit=1</link>\n</item>\n");
        
$filename htmlspecialchars($a["filename"]);
        @
fwrite($fd2"<link>$site_url/download.php/$a[id]/$filename</link>\n</item>\n");
    }
    
$s "</channel>\n</rss>\n";

    @
fwrite($fd1$s);
    @
fwrite($fd2$s);
    @
fclose($fd1);
    @
fclose($fd2);
}

/* Email notifs

$res = sql_query("SELECT name FROM categories WHERE id=$catid") OR sqlerr();
$arr = mysql_fetch_assoc($res);
$cat = $arr["name"];
$res = sql_query("SELECT email FROM users WHERE enabled='yes' AND notifs LIKE '%[cat$catid]%'") OR sqlerr();
$uploader = $CURUSER['username'];

$size = mksize($totallen);
$description = ($html ? strip_tags($descr) : $descr);

$body = <<<EOD
A new torrent has been uploaded.

Name: $torrent
Size: $size
Category: $cat
Uploaded by: $uploader

Description
-------------------------------------------------------------------------------
$description
-------------------------------------------------------------------------------

You can use the URL below to download the torrent (you may have to login).

$site_url/details.php?id=$id&hit=1

--
$site_name
EOD;
$to = "";
$nmax = 100; // Max recipients per message
$nthis = 0;
$ntotal = 0;
$total = mysql_num_rows($res);
while ($arr = mysql_fetch_row($res))
{
    if ($nthis == 0)
    {
        $to = $arr[0];
    }
    else
    {
        $to .= "," . $arr[0];
    }
    ++$nthis;
    ++$ntotal;
    if ($nthis == $nmax || $ntotal == $total)
    {
        if (!mail("Multiple recipients <$site_email>", "New torrent - $torrent", $body,
            "From: $site_email\r\nBcc: $to", "-f$site_email"))
        {
            "error","Signup Failed!",("error","Error", "Your torrent has been been uploaded. DO NOT RELOAD THE PAGE!\n" .
                    "There was however a problem delivering the e-mail notifcations.\n" .
                    "Please let an administrator know about this error!\n");
        }
        $nthis = 0;
    }
}
*/

mysql_query("UPDATE torrents SET visible = 'yes' WHERE id=$id");
mysql_query("UPDATE torrents SET seeders=seeders+1 WHERE id=$id") or sqlerr(__FILE____LINE__);
header("Location: $site_url/details.php?id=$id&uploaded=1");
?>



Does not work same problem seeders disappear after a few minutes....

TheGodRo 9th April 2013 01:08

Code:

Fatal error: Call to undefined function mysql_err() in /membri/pips/takeextern.php on line 255
PHP Code:

 ", '" get_date_time() . "', '" get_date_time() . "', $nfo, 'yes')"); 

????? what is the problem?

Fusi0nCr0w 29th October 2013 08:54

If I want to use it, is a mistake. I have installed XAMPP v1.7.7. It comes in FireFox following error: Content Encoding Error. Compression problem.

Can anyone tell me what compression is used? It will be up to my XAMPP. Maybe an extension.

I would like to test the release. :drink:

DND 29th October 2013 10:03

so use another broswer or change the encoding settings in firefox.

wdq 4th March 2014 23:39

Quote:

Originally Posted by Tones (Post 37360)
Thanks man I will try to see how it works back after to tell how it goes!!

DHT works without problems if there is a problem along'll let you know!

But until then here's what appears on the home page

Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 736

Our Tracker Load: (0 %)(these stats are an approximation)


Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 744


Warning: exec() has been disabled for security reasons in /home/u899582385/public_html/index.php on line 747


Have you any suggestions???




Look at this ...

http://s11.postimage.org/64wkgynkz/DHT.jpg





This is a simple one, your host deactivated the exec command for security reasons i believe that is the same with others so to have this working do not call exec directly tell to exec to give you the result so the fix is put an @in front of exec, so your code for copy and paste will be

PHP Code:

<div class="cont"><div class="sthead"><div class="headtxt">Server load</div></div>
<table width=100% border=0 cellspacing=0 cellpadding=10><tr><td align=center>
<table class=interiortable border=0 width=402><tr><td style='padding: 0px; background-repeat: repeat-x'>
<? $percent min(100round(@exec('ps ax | grep -c apache') / 256 30 ));
echo 
"Our Tracker Load: ($percent %)(these stats are an approximation)<table class=interiortable border=0 width=400><tr><td style='padding: 0px; background-image: url(pic/loadbarbg.gif); background-repeat: repeat-x'>";

    if (
$percent <= 70$pic "http://www.bvlist.com/images/loadbargreen.gif";
     elseif (
$percent <= 90$pic "http://www.bvlist.com/images/loadbaryellow.gif";
      else 
$pic "http://www.bvlist.com/images/loadbarred.gif";
           
$width $percent 8;
echo 
"<img height=15 width=$width src=\"/$pic\" alt='$percent%'></td></tr></table>";
echo 
"" trim(@exec('uptime')) . "";


  
$percent min(100round(@exec('ps ax | grep -c apache') / 256 150));
echo 
"Global Server Load (All websites on current host servers): ($percent %)<table class=interiortable border=0 width=400><tr><td style='padding: 0px; background-image: url(images/loadbarbg.gif); background-repeat: repeat-x'>";

    if (
$percent <= 70$pic "http://www.bvlist.com/images/loadbargreen.gif";
     elseif (
$percent <= 90$pic "http://www.bvlist.com/images/loadbaryellow.gif";
      else 
$pic "http://www.bvlist.com/images/loadbarred.gif";
           
$width $percent 8;
echo 
"<img height=15 width=$width src=\"$pic\" alt='$percent%'></td></tr></table>"?>


DND 5th March 2014 00:55

exec error is given if you use shared hosting.

wdq 5th March 2014 07:30

Quote:

Originally Posted by DeNeDe (Post 44011)
exec error is given if you use shared hosting.

and if instead exec() was let say return=system or $array=system ?, the exec() command can be deactivated for security reasons same with system command, it can be deactivated from the apache php.ini anymay is not good overriding the way they are.

DND 5th March 2014 19:46

if you have shared hosting, you don't have access to php.ini

wdq 5th March 2014 21:38

What do you think?
 
Quote:

Originally Posted by DeNeDe (Post 44019)
if you have shared hosting, you don't have access to php.ini

I have shared hosting from hostlabor.com and i do have access to php.ini.

djzoulox 27th May 2014 05:57

enable fopen on ur php.ini

Mc Grath 28th June 2015 22:35

Upload the contents of the FreeTSP New RC3 folder to your sites Root Folder keeping the folder structure intact.

where is the RC3 folder??

Also where is Admin Menu?


All times are GMT +2. The time now is 10:08.

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