Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Strike (http://www.bvlist.com/forumdisplay.php?f=21)
-   -   Please Help (http://www.bvlist.com/showthread.php?t=606)

ReNeJcEk 11th July 2008 22:30

Please Help
 
I`ve got torrent strike portal and i have a question... when a new user register he must wait for the 48hours... how can i change this? I`ve got one more question how can i turn BB code on?

Pls help.

Neptune 11th July 2008 23:55

Re: Please Help
 
in announce.php + details.php + include/bittorrent.php

Code:

if ($ratio < 0.5 || $gigs < 5) $wait = 48;
                        elseif ($ratio < 0.65 || $gigs < 6.5) $wait = 24;
                        elseif ($ratio < 0.8 || $gigs < 8) $wait = 12;
                        elseif ($ratio < 0.95 || $gigs < 9.5) $wait = 6;
                        else $wait = 0;

set waits to 0 (zero)

and about bbcode
in details.php

change

Code:

format_urls(htmlspecialchars($row["descr"])))
with

Code:

format_comment(htmlspecialchars($row["descr"])))

ReNeJcEk 12th July 2008 14:07

Re: Please Help
 
Thanks alot dude... i hope it will works .. im gonna report it.

Thanks for all.. im very thankful for the help.. sry 4 my bad english :D

Neptune 12th July 2008 19:54

Re: Please Help
 
:whistle:

ReNeJcEk 12th July 2008 23:24

Re: Please Help
 
I have one more question again.. i want to change logo on my theme ..ive made the logo in photoshop .. and upload on tracker.. but the logo dont want to change.. i tried 3 themes and changed the logo..but nothing happend.. pls help.

it must be some kind of a trick or something.. :S

and one more thing how i must setup up for email activation.. what shuold i type into admincp.php? That it will be work? pls help.

Thank you.

djlee 13th July 2008 16:08

Re: Please Help
 
i dont use torrentstrike so i cant help with the admincp but for the theme make sure that you name the logo the same as the existing one.. then make sure you've saved it as the correct format.. if its a GIF logo in the code it wont display a JPEG one. Also use CTRL + F5 to refresh the site after changing the logo.. the CTRL button makes the browser re-download everything from the server instead of using anything in the cache

ReNeJcEk 13th July 2008 16:56

Re: Please Help
 
I already know this.. anyway tnx for help.. ive changed the logo successfully... my oonly problem now is forum.. i cant go to the administration panel... :S

My site: http://deljenje.slo-torrents.com/

AngelDj 22nd August 2008 11:49

Hi
I have modified the 3 files announce.php details.php and bittorent.php with $wait=0.... but in the torrent says: Error: Not Authorized (1h)
Why? :

djlee 22nd August 2008 20:38

well that error is being passed by the announce script so u have missed something in there .. post your announce.php

AngelDj 22nd August 2008 22:55

Code:


ob_start("ob_gzhandler");

require_once("include/bittorrent.php");
require_once("include/benc.php");



function err($msg)
{
        benc_resp(array("failure reason" => array(type => "string", value => $msg)));
        exit();
}

function benc_resp($d)
{
        benc_resp_raw(benc(array(type => "dictionary", value => $d)));
}

function benc_resp_raw($x)
{
        header("Content-Type: text/plain");
        header("Pragma: no-cache");
        print($x);
}

$req = "info_hash:peer_id:!ip:port:uploaded:downloaded:left:!event:!passkey";
foreach (explode(":", $req) as $x)
{
        if ($x[0] == "!")
        {
                $x = substr($x, 1);
                $opt = 1;
        }
        else
                $opt = 0;
        if (!isset($_GET[$x]))
        {
                if (!$opt)
                        err("missing key");
                continue;
        }
        $GLOBALS[$x] = unesc($_GET[$x]);
}

if (ENA_PASSKEY && (
                strlen($passkey) != 32 &&
                @mysql_num_rows(@mysql_query("SELECT id FROM users WHERE passkey=" . sqlesc($passkey))) != 1))
        err("Invalid passkey! Re-download the .torrent from $BASEURL ($passkey)");
$passkey=sqlesc($passkey);       

foreach (array("info_hash","peer_id") as $x)
{
        if (strlen($GLOBALS[$x]) != 20)
                err("invalid $x (" . strlen($GLOBALS[$x]) . " - " . urlencode($GLOBALS[$x]) . ")");
}

//if (empty($ip) || !preg_match('/^(\d{1,3}\.){3}\d{1,3}$/s', $ip))
        $ip = getip();

$port = 0 + $port;
$downloaded = 0 + $downloaded;
$uploaded = 0 + $uploaded;
$left = 0 + $left;

$rsize = 50;
foreach(array("num want", "numwant", "num_want") as $k)
{
        if (isset($_GET[$k]))
        {
                $rsize = 0 + $_GET[$k];
                break;
        }
}

$agent = $_SERVER["HTTP_USER_AGENT"];

// Deny access made with a browser...
//if (ereg("^Mozilla\\/", $agent) || ereg("^Opera\\/", $agent) || ereg("^Links ", $agent) || ereg("^Lynx\\/", $agent))
//        err("torrent not registered with this tracker");

if (!$port || $port > 0xffff)
        err("invalid port");

if (!isset($event))
        $event = "";

$seeder = ($left == 0) ? "yes" : "no";




$res = mysql_query("SELECT id, banned, seeders + leechers AS numpeers, UNIX_TIMESTAMP(added) AS ts FROM torrents WHERE " . hash_where("info_hash", $info_hash));

$torrent = mysql_fetch_assoc($res);
if (!$torrent)
        err("torrent not registered with this tracker");

$torrentid = $torrent["id"];

$fields = "seeder, peer_id, ip, port, uploaded, downloaded, userid";

$numpeers = $torrent["numpeers"];
$limit = "";
if ($numpeers > $rsize)
        $limit = "ORDER BY RAND() LIMIT $rsize";
$res = mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' $limit");

$resp = 'd' . benc_str('interval') . 'i' . $announce_interval . 'e' . benc_str('peers') . (($compact = ($_GET['compact'] == 1))?'':'l');
unset($self);
while ($row = mysql_fetch_assoc($res))
{
        $row["peer_id"] = hash_pad($row["peer_id"]);

        if ($row["peer_id"] === $peer_id)
        {
                $userid = $row["userid"];
                $self = $row;
                continue;
        }
        if($compact)
        {
                $peer_ip = explode('.', $row["ip"]);
                $plist .= pack("C*", $peer_ip[0], $peer_ip[1], $peer_ip[2], $peer_ip[3]). pack("n*", (int)$row["port"]);
        } else {
                $resp .= "d" .
                benc_str("ip") . benc_str($row["ip"]) .
                benc_str("peer id") . benc_str($row["peer_id"]) .
                benc_str("port") . "i" . $row["port"] . "e" .
                "e";
        }
}

$resp .= ($compact ? benc_str($plist):''). "ee";

$selfwhere = "torrent = $torrentid AND ". (ENA_PASSKEY ?"passkey=$passkey AND ":'') . hash_where("peer_id", $peer_id);

if (!isset($self))
{
        $res = mysql_query("SELECT $fields FROM peers WHERE $selfwhere");
        $row = mysql_fetch_assoc($res);
        if ($row)
        {
                $userid = $row["userid"];
                $self = $row;
        }
}

//// Up/down stats ////////////////////////////////////////////////////////////

if (!isset($self))
{
        if(ENA_PASSKEY && ENA_PASSKEYLIMITCONNECTIONS)
        {
                $valid = @mysql_num_rows(@mysql_query("SELECT id FROM peers WHERE torrent=$torrentid AND passkey=$passkey"));
                if ($valid[0] >= 1 && $seeder == 'no')
                        err("Connection limit exceeded! You may only leech from one location at a time.");
                if ($valid[0] >= 3 && $seeder == 'yes')
                        err("Connection limit exceeded!");
        }
        $rz = mysql_query("SELECT id, uploaded, downloaded, class FROM users WHERE ip='$ip' AND enabled = 'yes' ". (ENA_PASSKEY ? "AND passkey=$passkey ":''). "ORDER BY last_access DESC LIMIT 1") or err("Tracker error 2");
        if ($MEMBERSONLY && mysql_num_rows($rz) == 0)
                err("Unrecognized host ($ip). Please go to $BASEURL to sign-up or login.");
        $az = mysql_fetch_assoc($rz);
        $userid = $az["id"];

        if ($left > 0 && $az["class"] < UC_VIP)
        if ($az["class"] < UC_VIP)
        {
                $gigs = $az["uploaded"] / (1024*1024*1024);
                $elapsed = floor((gmtime() - $torrent["ts"]) / 3600);
                $ratio = (($az["downloaded"] > 0) ? ($az["uploaded"] / $az["downloaded"]) : 1);
                  if ($ratio < 0.5 || $gigs < 5) $wait = 0;
                elseif ($ratio < 0.65 || $gigs < 6.5) $wait = 0;
              elseif ($ratio < 0.8 || $gigs < 8) $wait = 0;
                elseif ($ratio < 0.95 || $gigs < 9.5) $wait = 0;
                $wait = 0;
                if (($elapsed < $wait)&&($seeder == 'no'))
                                err("Not authorized (" . ($wait - $elapsed) . "h) - READ THE FAQ!");
}
}
else
{
        $upthis = max(0, $uploaded - $self["uploaded"]);
        $downthis = max(0, $downloaded - $self["downloaded"]);

        if ($upthis > 0 || $downthis > 0)
                mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
}

///////////////////////////////////////////////////////////////////////////////

function portblacklisted($port)
{
        // direct connect
        if ($port >= 411 && $port <= 413) return true;

        // bittorrent
        if ($port >= 6881 && $port <= 6889) return true;

        // kazaa
        if ($port == 1214) return true;

        // gnutella
        if ($port >= 6346 && $port <= 6347) return true;

        // emule
        if ($port == 4662) return true;

        // winmx
        if ($port == 6699) return true;

        return false;
}

$updateset = array();

if ($event == "stopped")
{
        if (isset($self))
        {
                mysql_query("DELETE FROM peers WHERE $selfwhere");
                if (mysql_affected_rows())
                {
                        if ($self["seeder"] == "yes")
                                $updateset[] = "seeders = seeders - 1";
                        else
                                $updateset[] = "leechers = leechers - 1";
                }
        }
}
else
{
        if ($event == "completed")
                $updateset[] = "times_completed = times_completed + 1";

        if (isset($self))
        {
                mysql_query("UPDATE peers SET uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = NOW(), seeder = '$seeder'"
                        . ($seeder == "yes" && $self["seeder"] != $seeder ? ", finishedat = " . time() : "") . " WHERE $selfwhere");
                if (mysql_affected_rows() && $self["seeder"] != $seeder)
                {
                        if ($seeder == "yes")
                        {
                                $updateset[] = "seeders = seeders + 1";
                                $updateset[] = "leechers = leechers - 1";
                        }
                        else
                        {
                                $updateset[] = "seeders = seeders - 1";
                                $updateset[] = "leechers = leechers + 1";
                        }
                }
        }
        else
        {
                if (portblacklisted($port))
                        err("Port $port is blacklisted.");
                else
                {
                        $sockres = @fsockopen($ip, $port, $errno, $errstr, 5);
                        if (!$sockres)
                                $connectable = "no";
                        else
                        {
                                $connectable = "yes";
                                @fclose($sockres);
                        }
                }

                $ret = mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, uploadoffset, downloadoffset, passkey) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, NOW(), NOW(), '$seeder', $userid, " . sqlesc($agent) . ", $uploaded, $downloaded, $passkey)");
                if ($ret)
                {
                        if ($seeder == "yes")
                                $updateset[] = "seeders = seeders + 1";
                        else
                                $updateset[] = "leechers = leechers + 1";
                }
        }
}

if ($seeder == "yes")
{
        if ($torrent["banned"] != "yes")
                $updateset[] = "visible = 'yes'";
        $updateset[] = "last_action = NOW()";
}

if (count($updateset))
        mysql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $torrentid");

benc_resp_raw($resp);


?>



All times are GMT +2. The time now is 05:49.

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