Polish Bittorrent Tracker Support

  • Maj 18, 2012, 04:50:30
  • Witamy, Gość
Zaloguj się lub zarejestruj.

Zaloguj się podając nazwę użytkownika, hasło i długość sesji
Szukanie zaawansowane  

Aktualności:

Autor Wątek: Nowy wygląd details.php  (Przeczytany 585 razy)

0 użytkowników i 1 Gość przegląda ten wątek.

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Nowy wygląd details.php
« dnia: Czerwiec 29, 2011, 12:10:42 »

Szukam takiego wyglądu dla details.php
nie chodzi mi mi o graficzność tylko o samo ułożenie tabel i skryptu w tabelach pod tbsource 1.5.0 wersja finalna publiczny tracker.


Bardzo proszę o pomoc.
Zapisane
ReactionTorrent.net

chillo

  • Gość
Odp: Nowy wygląd details.php
« Odpowiedź #1 dnia: Lipiec 03, 2011, 09:15:21 »

całkiem fajnie to wygląda :)
Zapisane

P2P

  • BTDEV Staff
  • Super zaawansowany
  • *****
  • Reputacja 45
  • Online Online
  • Płeć: Mężczyzna
  • Wiadomości: 471
Odp: Nowy wygląd details.php
« Odpowiedź #2 dnia: Lipiec 04, 2011, 03:05:25 »

Przerób sobie tabele w bittorrent.php  :P
Zapisane
Brazylijscy naukowcy odkryli, że ludzie czytający posty i trzymający rękę na myszce mają niższe IQ

Już za późno nie zdejmujcie

Hammond

  • Początkujący++
  • ***
  • Reputacja 2
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 21
Odp: Nowy wygląd details.php
« Odpowiedź #3 dnia: Sierpień 16, 2011, 09:10:35 »

Przyłączam się do prośby.
Zapisane

kalwin

  • <? print(" ?>
  • VIP
  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 183
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #4 dnia: Sierpień 17, 2011, 08:47:58 »

http://localhostr.com/files/RyYT0CU/capture.png troche pracy i sie udalo :) kod ten z danielosem testujemy wciaz jak bedzie gotow wpelni sie pojawi.. jak nie zapomne :p 
Zapisane

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #5 dnia: Październik 16, 2011, 01:22:29 »

Obowiązkowe są następujące mody by skrypt details zadziałał

Trailer
http://btdev.torrentinvite.org/index.php/topic,4062.0.html

Plakat
http://btdev.torrentinvite.org/index.php/topic,1293.20.html

Oto mój details.php z tbsource wersja finalna tracker publiczny
 został stworzony tylko do trackera publicznego
<?

/*ob_start("ob_gzhandler");*/

require_once("include/bittorrent.php");

function getagent($httpagent, $peer_id="")
{
if (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]\_B([0-9][0-9|*])(.+)$)/", $httpagent, $matches))
return "Azureus/$matches[1]";
elseif (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]\_CVS)/", $httpagent, $matches))
return "Azureus/$matches[1]";
elseif (preg_match("/^Java\/([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches))
return "Azureus/<2.0.7.0";
elseif (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches))
return "Azureus/$matches[1]";
elseif (preg_match("/BitTorrent\/S-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))
return "Shadow's/$matches[1]";
elseif (preg_match("/BitTorrent\/U-([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches))
return "UPnP/$matches[1]";
elseif (preg_match("/^BitTor(rent|nado)\\/T-(.+)$/", $httpagent, $matches))
return "BitTornado/$matches[2]";
elseif (preg_match("/^BitTornado\\/T-(.+)$/", $httpagent, $matches))
return "BitTornado/$matches[1]";
elseif (preg_match("/^BitTorrent\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))
return "ABC/$matches[1]";
elseif (preg_match("/^ABC ([0-9]+\.[0-9]+(\.[0-9]+)*)\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))
return "ABC/$matches[1]";
if(substr($peer_id, 0, 6) == "A310--")
return "ABC/3.1";
elseif (preg_match("/^ABC\/Tribler_ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))
return "Tribler/$matches[1]";
elseif (preg_match("/^Python-urllib\/.+?, BitTorrent\/([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))
return "BitTorrent/$matches[1]";
elseif (ereg("^BitTorrent\/BitSpirit$", $httpagent))
return "BitSpirit";
elseif (ereg("^DansClient", $httpagent))
return "XanTorrent";
elseif (preg_match("/^BitTorrent\/brst(.+)/", $httpagent, $matches))
return "Burst/$matches[1]";
elseif (preg_match("/^RAZA (.+)$/", $httpagent, $matches))
return "Shareaza/$matches[1]";
if(substr($peer_id, 0, 8) == "-SZ2210-")
return "Shareaza/2.2.1.0";
elseif (preg_match("/Rufus\/([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches))
return "Rufus/$matches[1]";
elseif (preg_match("/^BitTorrent\\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches))
{
if(substr($peer_id, 0, 6) == "exbc\08")
return "BitComet/0.56";
elseif(substr($peer_id, 0, 6) == "exbc\09")
return "BitComet/0.57";
elseif(substr($peer_id, 0, 6) == "exbc\0:")
return "BitComet/0.58";
elseif(substr($peer_id, 0, 8) == "-BC0059-")
return "BitComet/0.59";
elseif(substr($peer_id, 0, 8) == "-BC0060-")
return "BitComet/0.60";
elseif(substr($peer_id, 0, 8) == "-BC0061-")
return "BitComet/0.61";
elseif(substr($peer_id, 0, 8) == "-BC0062-")
return "BitComet/0.62";
elseif(substr($peer_id, 0, 8) == "-BC0063-")
return "BitComet/0.63";
elseif(substr($peer_id, 0, 8) == "-BC0064-")
return "BitComet/0.64";
elseif(substr($peer_id, 0, 8) == "-BC0065-")
return "BitComet/0.65";
elseif(substr($peer_id, 0, 8) == "-BC0066-")
return "BitComet/0.66";
elseif(substr($peer_id, 0, 8) == "-BC0067-")
return "BitComet/0.67";
elseif(substr($peer_id, 0, 8) == "-BC0068-")
return "BitComet/0.68";
elseif(substr($peer_id, 0, 8) == "-BC0069-")
return "BitComet/0.69";
elseif(substr($peer_id, 0, 8) == "-BC0070-")
return "BitComet/0.70";
elseif(substr($peer_id, 0, 8) == "-BC0071-")
return "BitComet/0.71";
elseif(substr($peer_id, 0, 7) == "exbc\0L")
return "BitLord/1.0";
elseif(substr($peer_id, 0, 7) == "exbcL")
return "BitLord/1.1";
else
return "BitTorrent/$matches[1]";
}
elseif (preg_match("/^Python-urllib\\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches))
return "G3 Torrent";
elseif (preg_match("/MLDonkey\/([0-9]+).([0-9]+).([0-9]+)*/", $httpagent, $matches))
return "MLDonkey/$matches[1].$matches[2].$matches[3]";
elseif (preg_match("/ed2k_plugin v([0-9]+\\.[0-9]+).*/", $httpagent, $matches))
return "eDonkey/$matches[1]";
elseif (preg_match("/uTorrent\/([0-9]+)([0-9]+)([0-9]+)([0-9A-Z]+)/", $httpagent, $matches))
return "uTorrent/$matches[1].$matches[2].$matches[3].$matches[4]";
elseif (ereg("^0P3R4H", $httpagent))
return "Opera BT Client";
elseif (preg_match("/CT([0-9]+)([0-9]+)([0-9]+)([0-9]+)/", $peer_id, $matches))
return "cTorrent/$matches[1].$matches[2].$matches[3].$matches[4]";
elseif (preg_match("/Transmission\/([0-9]+).([0-9]+)/", $httpagent, $matches))
return "Transmission/$matches[1].$matches[2]";
elseif (preg_match("/KT([0-9]+)([0-9]+)([0-9]+)([0-9]+)/", $peer_id, $matches))
return "KTorrent/$matches[1].$matches[2].$matches[3].$matches[4]";
elseif(substr($peer_id, 0, 8) == "-MP130n-")
return "MooPolice";
else
return "---";
}

function dltable($name, $arr, $torrent)
{

    global $CURUSER;
    $s = "<b>" . count($arr) . " $name</b>\n";
    if (!count($arr))
        return $s;
    $s .= "\n";
    $s .= "<table width=100% class=main border=1 cellspacing=0 cellpadding=5>\n";
    $s .= "<tr><td class=colhead>Użytkownik</td>" .
          "<td class=colhead align=center>Dostępny</td>".
          "<td class=colhead align=right>Wysłano</td>".
          "<td class=colhead align=right>Prędkość</td>".
          "<td class=colhead align=right>Pobrano</td>" .
          "<td class=colhead align=right>Prędkość</td>" .
          "<td class=colhead align=right>Ratio</td>" .
          "<td class=colhead align=right>Ukończono</td>" .
          "<td class=colhead align=right>Połączony</td>" .
          "<td class=colhead align=right>Idle</td>" .
          "<td class=colhead align=left>Klient</td></tr>\n";
    $now = time();
    $moderator = (isset($CURUSER) && get_user_class() >= UC_USER);
$mod = get_user_class() >= UC_USER;
    foreach ($arr as $e) {


                // user/ip/port
                // check if anyone has this ip
                ($unr = mysql_query("SELECT username, privacy, anonymous FROM users WHERE id=$e[userid] ORDER BY last_access DESC LIMIT 1")) or die;
                $una = mysql_fetch_array($unr);
                if ($una["privacy"] == "strong") continue;
        $s .= "<tr>\n";
                if (get_user_class() >= UC_USER OR $CURUSER["id"] == $e["userid"] OR $una["anonymous"] == "no"){
    if ($una["username"])
      $s .= "<td><a href=userdetails.php?id=$e[userid]><b>$una[username]</b></a></td>\n";
   }
   elseif ($una["anonymous"] == "yes")
    $s .= "<td><b>---</b></a></td>\n";
                else
                  $s .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . "</td>\n";
        $secs = max(1, ($now - $e["st"]) - ($now - $e["la"]));
        $revived = $e["revived"] == "yes";
        $s .= "<td align=center>" . ($e[connectable] == "yes" ? "<font color=green>Tak</font>" : "<font color=red>Nie</font>") . "</td>\n";
        $s .= "<td align=right>" . mksize($e["uploaded"]) . "</td>\n";
        $s .= "<td align=right><nobr>" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</nobr></td>\n";
        $s .= "<td align=right>" . mksize($e["downloaded"]) . "</td>\n";
        if ($e["seeder"] == "no")
            $s .= "<td align=right><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</nobr></td>\n";
        else
            $s .= "<td align=right><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e[st])) .    "/s</nobr></td>\n";
                if ($e["downloaded"])
                {
                  $ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000;
                    $s .= "<td align=\"right\"><font color=" . get_ratio_color($ratio) . ">" . number_format($ratio, 3) . "</font></td>\n";
                }
                   else
                  if ($e["uploaded"])
                    $s .= "<td align=right>Inf.</td>\n";
                  else
                    $s .= "<td align=right>---</td>\n";
        $s .= "<td align=right>" . sprintf("%.2f%%", 100 * (1 - ($e["to_go"] / $torrent["size"]))) . "</td>\n";
        $s .= "<td align=right>" . mkprettytime($now - $e["st"]) . "</td>\n";
        $s .= "<td align=right>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $s .= "<td align=left>" . htmlspecialchars(getagent($e["agent"], $e["peer_id"])) . "</td>\n";
        $s .= "</tr>\n";
    }
    $s .= "</table>\n";
    return $s;
}

dbconn(false);



if (isset($_GET['refresh_peers']))
{
    /*
     * Odświeżamy ilość peerów
     */

    require_once('include/benc.php');
    $id = 0+$_GET['id'];
    $res = mysql_query('SELECT ext, name, info_hash FROM torrents WHERE id = ' . $id);
    $row = mysql_fetch_row($res);
    $torrent = $row[1];
    $infohash = $row[2];
    if (!$row[0])
    {
        stderr('Not an external torrent');
    }

    $file = file_get_contents($torrent_dir . $id . '.torrent');
    $dict = bdec($file);

    function GetPeers($dict)
    {
        global $torrent, $infohash, $seeds, $leechers;
        set_time_limit(200000000);
        ignore_user_abort(1);
        $trackers = Array();
        if (isset($dict['value']['announce-list']))
        {
            /*
             * Multitracker
             */
             foreach($dict['value']['announce-list']['value'] AS $tracker)
             {
                 $tracker = $tracker['value'][0]['value'];
                 $trackers[] = $tracker;
             }
        }
        else
        {
            /*
             * Single tracker
             */
             $trackers[] = $dict['value']['announce']['value'];
        }
        $headers = Array('info_hash'     => $infohash,
                         'peer_id'        => '--PC-0.1[' . substr(md5($_SERVER['PHP_SELF']), 0, 9) . ']-',
                         'downloaded'    => '0',
                         'uploaded'        => '0',
                         'event'        => '',
                         'port'            => '80',
                         'compact'        => '1',
                         'left'            => '1',
                         'supportcrypto'=> '1',
                         'numwant'        => '1000',
                         );

        foreach ($trackers AS $tracker)
        {
            $t = parse_url($tracker);
            $host = $t['host'];
            $path = $t['path'];
            $proto = $t['scheme'];

            $f = @fsockopen(($proto == 'udp' ? 'udp://' : '') . gethostbyname($host), isset($t['port']) ? $t['port'] : 80, $errno, $errstr, 5);
            if (!$f)
            {
                write_log('Unable to get peers from ' . $t['scheme'] . '://' . $host . ' for torrent ' . $torrent . "($errno: $errstr)");
                Continue;
            }

            /*
             * Scrape testing.
             */

            $head = 'GET /scrape.php?info_hash=' . rawurlencode($infohash) . " HTTP/1.1\r\n" .
                      'Host: ' . $host . (isset($t['port'])? ':' . $t['port'] : '' ) . "\r\n" .
                    'User-agent: Peers Checker (v0.1)' . "\r\n\r\n";
            fputs($f, $head);

            $response = '';
            while (!feof($f))
            {
                $response .= fread($f, 1024);
            }
            fclose($f);

            $scrape = False;
            if (strpos($response, 'HTTP/1.1 200 OK') !== False)
            {
                $scrape = True;
                $response = trim(preg_replace('#^.+?\r\n\r\n([0-9a-f]*? *\r\n)?#si', '', $response)," \r\n\t0");
                $resp = bdec($response);

                $resp = current($resp['value']['files']['value']);
                $seeds = max($seeds, $resp['value']['complete']['value']);
                $leechers = max($seeds, $resp['value']['incomplete']['value']);
            }
            if (!$scrape)
            {
                $f = @fsockopen(gethostbyname($host), isset($t['port']) ? $t['port'] : 80, $errno, $errstr, 5);
                if (!$f)
                {
                    write_log('Unable to get peers from ' . $t['scheme'] . '://' . $host . ' for torrent ' . $torrent . "($errno: $errstr)");
                    Continue;
                }

                $path .= strpos($path, '?') !== False ? '&' : '?';

                foreach ($headers AS $hid=>$hval)
                {
                    $path .= rawurlencode($hid) . '=' . rawurlencode($hval) . '&';
                }

                $head = 'GET ' . $path . ' HTTP/1.1' . "\r\n" .
                        'Host: ' . $host . (isset($t['port'])? ':' . $t['port'] : '' ) . "\r\n" .
                        'User-agent: Peers Checker (v0.1)' . "\r\n" .
                        "\r\n";
                fputs($f, $head);

                $response = '';
                while (!feof($f))
                {
                    $response .= fread($f, 1024);
                }
                fclose($f);
                $response = trim(preg_replace('#^.+?\r\n\r\n([0-9a-f]*? *\r\n)?#si', '', $response)," \r\n\t0");
                $resp = bdec($response);
                if (isset($resp['value']['failure reason']))
                {
                    write_log('Unable to get peers from ' . $t['scheme'] . '://' . $host . ' for torrent ' . $torrent . '(' . $resp['value']['failure reason'] . ')');
                    Continue;
                }
                if (isset($resp['value']['complete']))
                {
                    $seeds = max($seeds, $resp['value']['complete']['value']);
                    $leechers = max($leechers, $resp['value']['incomplete']['value']);
                }
                else
                {
                    var_dump($resp);
                    write_log('Unable to determine peer count for tracker ' . $t['scheme'] . '://' . $host . ' (Torrent: ' . $torrent . ')');
                }
            }
        }
    }
    GetPeers($dict);
    if (mysql_query('UPDATE torrents SET ext_seed = ' . (int)$seeds . ', ext_leech = ' . (int)$leechers . ' WHERE id = ' . $id))
        header('Location: details.php?id=' . $id . '&refreshed=1');
    else
        header('Location: details.php?id=' . $id . '&refreshed=-1');
}

$id = 0 + $_GET["id"];

if (!isset($id) || !$id)
    die();
if ($close = $_GET['close'] && get_user_class() >= UC_USER) {
if ($close == 0)
mysql_query("UPDATE comments SET closed = 'no' WHERE torrent = $id");
else if ($close == 1)
mysql_query("UPDATE comments SET closed = 'yes' WHERE torrent = $id");
}

$res = mysql_query("SELECT torrents.seeders, torrents.tube, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, torrents.comments, torrents.ext, torrents.ext_seed, torrents.ext_leech, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, poster, categories.name AS cat_name, users.username FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id")
    or sqlerr();
$row = mysql_fetch_array($res);


{
    if (!isset($_GET["page"])) {
        stdhead("Szczegóły torrenta \"" . $row["name"] . "\"");

        if ($CURUSER["id"] == $row["owner"] )
            $owned = 1;
        else
            $owned = 0;

        $spacer = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

        if ($_GET["uploaded"]) {
            print("<center><h2>Pomyślnie dodany!</h2></center>\n");
        }
        elseif ($_GET["refreshed"] == 1) {
            print("<center><h2>Pomyślnie odświeżony!</h2></center>\n");
        }
        elseif ($_GET["refreshed"] == -1) {
            print("<center><h2>Problemy podczas odświeżania torrenta!</h2></center>\n");
            print("<center><p>Liczba peerów nie mogła zostać poprawnie pobrana z zewnętrznych trackerów. Proszę spróbować ponownie w przyszłości.</p></center>\n");
        }
        elseif ($_GET["edited"]) {
            print("<center><h2>Edycja torrenta zakończyła się sukcesem!</h2></center>\n");
            if (isset($_GET["returnto"]))
                print("<p><b>Go back to <a href=\"" . htmlspecialchars($_GET["returnto"]) . "\">whence you came</a>.</b></p>\n");
        }
        elseif (isset($_GET["searched"])) {
            print("<h2>Your search for \"" . htmlspecialchars($_GET["searched"]) . "\" gave a single result:</h2>\n");
        }
        elseif ($_GET["rated"]) {
 print("<h2>Głos oddany!</h2>\n");
}
elseif ($_GET["thanks"])
 print("<h2>Podziękowania oddane ;)!</h2>\n");


                print("<table width=800 border=\"0\" cellspacing=\"0\" >\n");
$s=$row["name"];
       
        {
if ($row["genre"] != "0")
$genre= "".$row[genre]."";
}
        print("<tr><td colspan=2 class='tutuldetails' border='0'><center>$s</center></td></tr>\n");
        $url = "edit.php?id=" . $row["id"];
        if (isset($_GET["returnto"])) {
            $addthis = "&amp;returnto=" . urlencode($_GET["returnto"]);
            $url .= $addthis;
            $keepget .= $addthis;
        }
        $editlink = "a href=\"$url\" class=\"sublink\"";

//        $s = "<b>" . htmlspecialchars($row["name"]) . "</b>";
//        if ($owned)
//            $s .= " $spacer<$editlink>[Edit torrent]</a>";
//        tr("Name", $s, 1);




 {
            $downloaders = array();
            $seeders = array();
            $subres = mysql_query("SELECT seeder, finishedat, downloadoffset, uploadoffset, ip, port, uploaded, downloaded, to_go, UNIX_TIMESTAMP(started) AS st, connectable, agent, peer_id, UNIX_TIMESTAMP(last_action) AS la, userid FROM peers WHERE torrent = $id") or sqlerr();
            while ($subrow = mysql_fetch_array($subres)) {
                if ($subrow["seeder"] == "yes")
                    $seeders[] = $subrow;
                else
                    $downloaders[] = $subrow;
            }}
           
            function leech_sort($a,$b) {
                                if ( isset( $_GET["usort"] ) ) return seed_sort($a,$b);
                                $x = $a["to_go"];
                $y = $b["to_go"];
                if ($x == $y)
                    return 0;
                if ($x < $y)
                    return -1;
                return 1;
            }
            function seed_sort($a,$b) {
                $x = $a["uploaded"];
                $y = $b["uploaded"];
                if ($x == $y)
                    return 0;
                if ($x < $y)
                    return 1;
                return -1;
            }

            usort($seeders, "seed_sort");
            usort($downloaders, "leech_sort");

            if ($row['ext'])
           
                if (!empty($row['description'])) {
$description = "(" . htmlspecialchars($row["description"]) . ")";
}
        else {
$description = "";
}
$preparing_baloon=mysql_query("SELECT poster FROM torrents WHERE id=$id LIMIT 0, 255") or sqlerr();
$poster=mysql_fetch_array($preparing_baloon);
if (!empty($poster['poster']))
{
$poster=$poster[poster];
$poster2 = "<img src=$poster width=128 height=178 valign=top>";
}
if (get_user_class() >= UC_USER)
     {
$pobierz= ("<li><a href=\"download.php/$id/" . rawurlencode($row["filename"]) ."\">Pobierz torrent</a>");
     }

        print("<tr class='tlodetails'><td class=descr3 width=128 height=178 valign=top><img src=$poster width=128 height=178  valign=top><br><br><b>Dodał:</b> $row[username]
                                <br><b>Data dodania:</b><br>". $row["added"] ."
                                <br>
                                    <b>Kategoria: </b>" . $row["cat_name"] . " <br>
                                    <b>Rozmiar: </b>
                " . str_replace(" ", "", mksize($row["size"])) . "
                <br>
       
                <b>Seedów:</b> <font color='green'>" . $row['ext_seed'] ."</font>
               
                <br>
                <b>Peerów: </b>
                <font color='red'>". $row['ext_leech'] . "
                </font><br>
                                <a href=details.php?id=".$row[id] ."&page=0#startcomments>Komentarze: ". $row["comments"] ."</a>
                <br>$pobierz<br>
           <br><center><a href=report.php?torrent=$id><b>Raportuj torrenta</b></a></center>
               
           <br>
       
        <br>
           <br>
</td>
       
           
               
               



               




                <td class=descr>


".str_replace(array("\n", "  "), array("<br>\n", "&nbsp; "), format_torrent(htmlspecialchars($row["descr"])))."
                           
                               
                           
                               




   

</td>

     
   

<tr class='tlodetails'><td>&nbsp;Trailer</td></tr>\n");
if (!empty($row[tube]))
        print("<tr class='tlodetails'><td colspan=2><center><embed src='". str_replace("watch?v=", "v/", htmlspecialchars($row[tube])) ."' type=\'application/x-shockwave-flash\' width=\'500\' height=\'410\'></embed></center></td></tr>");
        if (get_user_class() >= UC_MODERATOR)
     {
    print("<tr class='tlodetails'><td class=rowhead>Usuń torrent<td align=left><a href=\"fastdelete.php?id=$id\"><b>Usuń!</b></a></td>");
     }
       
     
     if (get_user_class() >= UC_MODERATOR)
     {
    print("<tr class='tlodetails'><td class=rowhead>Edytuj torrent<td align=left><a href=edit.php?id=$id\><b>Edytuj</b></a></td>");
     }





       

       
       

        if ($row["type"] == "multi") {
            if (!$_GET["filelist"])
                tr("Lista plików<br /><a href=\"details.php?id=$id&amp;filelist=1$keepget#filelist\" class=\"sublink\">[Pokaż całą listę]</a>", $row["numfiles"] . " pliki", 1);
            else {
                tr("Liczba plików", $row["numfiles"] . " plik(ów)", 1);

                $s = "<table class=main border=\"1\" cellspacing=0 cellpadding=\"5\">\n";

                $subres = mysql_query("SELECT * FROM files WHERE torrent = $id ORDER BY id");
$s.="<tr><td class=colhead>Nazwa</td><td class=colhead align=right>Rozmiar</td></tr>\n";
                while ($subrow = mysql_fetch_array($subres)) {
                    $s .= "<tr><td>" . $subrow["filename"] .
                            "</td><td align=\"right\">" . mksize($subrow["size"]) . "</td></tr>\n";
                }

                $s .= "</table>\n";
                tr("<a name=\"filelist\">Lista plików</a><br /><a href=\"details.php?id=$id$keepget\" class=\"sublink\">[Ukryj listę]</a>", $s, 1);
            }
        }
        print("<tr class='tlodetails'><td colspan=2><p align=right valign=top><a class=index href=comment.php?action=add&amp;tid=$id><img src=/pic/add_arrow.gif />Dodaj komentarz</a></p></td></tr>\n");
        print("</table></p>\n");
       

    }
    else {
        stdhead("Komentarze dla torrenta \"" . $row["name"] . "\"");
        print("<h1>Komentarze dla <a href=details.php?id=$id>" . $row["name"] . "</a></h1>\n");        print("<p><a href=\"details.php?id=$id\">Cofnij się do detali torrenta</a></p>\n");
    }

    print("<p><a name=\"startcomments\"></a></p>\n");

       

    $subres = mysql_query("SELECT COUNT(*) FROM comments WHERE torrent = $id");
    $subrow = mysql_fetch_array($subres);
    $count = $subrow[0];

    if (!$count) {
        print("<center><h2>Brak komentarzy!</h2></center>\n");
    }
    else {
        list($pagertop, $pagerbottom, $limit) = pager(20, $count, "details.php?id=$id&", array(lastpagedefault => 1));

        $subres = mysql_query("SELECT comments.id, text, user, comments.added, editedby, editedat, avatar, warned, ".
                 "username, title, class, donor, downloaded, uploaded FROM comments LEFT JOIN users ON comments.user = users.id WHERE torrent = " .
                 "$id ORDER BY comments.id $limit") or sqlerr(__FILE__, __LINE__);
        $allrows = array();
        while ($subrow = mysql_fetch_array($subres))
            $allrows[] = $subrow;

        print($commentbar);
        print($pagertop);

        commenttable($allrows);

        print($pagerbottom);
    }

    print($commentbar);



}

stdfoot();

?>
Jeżeli czegoś zapomniałem to przepraszam.
Zapisane
ReactionTorrent.net

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #6 dnia: Październik 16, 2011, 01:29:27 »

Zapisane
ReactionTorrent.net

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #7 dnia: Październik 30, 2011, 10:21:59 »

Czy mógł bym prosić o przerobienie tego moda pod tracker prywatny i bez trailera ( choć z tym chyba sobie poradziłem, ale możliwe że zostały jakieś nie potrzebne linijki kodu.). Z góry dziękuje.
Zapisane

kalwin

  • <? print(" ?>
  • VIP
  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 183
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #8 dnia: Październik 30, 2011, 03:56:14 »

podaj detalis.php inaczej nie pomozemy :)
Zapisane

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #9 dnia: Październik 30, 2011, 04:08:25 »

Nie pokazują się seedy/peery i pokazuje się tabela odpowiadająca za trailer.
Zapisane

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #10 dnia: Październik 30, 2011, 11:26:29 »

raxar daj mi details.php przerobie ci tak żeby działało ale niepodawaj mi mojego details.php tylko twój bez mojego kodu
Zapisane
ReactionTorrent.net

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #11 dnia: Październik 31, 2011, 01:00:22 »

chodzi ci o ten zwykły details.php czy ten przerobiony ?
Zapisane

kalwin

  • <? print(" ?>
  • VIP
  • Zaawansowany
  • *****
  • Reputacja 12
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 183
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #12 dnia: Listopad 02, 2011, 02:33:35 »

hmm nie znam sie dobrze ale porownalem sobie te 2 pliki nie testowalem tego ale za tego zwiastuna dodal bym ten kod

/*if ($_GET["hit"]) {

      sql_query("UPDATE torrents SET views = views + 1 WHERE id = $id");

      */

      if ($_GET["tocomm"]) {

         header("Location: $BASEURL/details.php?id=$id&page=0#startcomments");

      if ($_GET["filelist"])

         header("Location: $BASEURL/details.php?id=$id&filelist=1#filelist");

      elseif ($_GET["toseeders"])

         header("Location: $BASEURL/peery.php?id=$id&dllist=1#seeders");

      elseif ($_GET["todlers"])

         header("Location: $BASEURL/peery.php?id=$id&dllist=1#leechers");

      else

         header("Location: $BASEURL/details.php?id=$id");

      exit();

   }

nie wiem czy to zadziala nie testowalemale
« Ostatnia zmiana: Listopad 02, 2011, 02:47:51 wysłana przez kalwin »
Zapisane

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #13 dnia: Listopad 02, 2011, 04:22:05 »

To nic nie pomaga
Zapisane

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #14 dnia: Listopad 02, 2011, 06:37:25 »

Zmień to

$res = mysql_query("SELECT torrents.seeders, torrents.tube, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, torrents.comments, torrents.ext, torrents.ext_seed, torrents.ext_leech, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, poster, categories.name AS cat_name, users.username FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id")
    or sqlerr();

na

$res = mysql_query("SELECT torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, LENGTH(torrents.nfo) AS nfosz, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.poster, categories.name AS cat_name, users.username FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id")   
    or sqlerr();
Zapisane
ReactionTorrent.net

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #15 dnia: Listopad 02, 2011, 07:21:50 »

To co podałeś też nic nie zmienia. Nadal nie działa
To wygląda tak:

 
 w zakładce torrenty normalnie seedy pokazuje także na poprzednim details seedy pokazywało normalnie
 
Zapisane

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #16 dnia: Listopad 02, 2011, 07:26:21 »

zmień

" . $row['ext_seed'] ."
na

".$row['seeders']."

a ten kod

". $row['ext_leech'] . "
na ten

" . $row['leechers'] . "
Zapisane
ReactionTorrent.net

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #17 dnia: Listopad 02, 2011, 07:43:13 »

Dzięki wielkie działa ;p dostałeś reputa.
A jeszcze jedno nie moge się pozbyć tabeli odpowiadającej za trailer.
Zapisane

Daniolos

  • BTDEV Staff
  • Średnio zaawansowany
  • *****
  • Reputacja 46
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 67
  • ReactionTorrent.net
Odp: Nowy wygląd details.php
« Odpowiedź #18 dnia: Listopad 02, 2011, 08:14:11 »

skasuj to
<tr class='tlodetails'><td>&nbsp;Trailer</td></tr>
if (!empty($row[tube]))
        print("<tr class='tlodetails'><td colspan=2><center><embed src='". str_replace("watch?v=", "v/", htmlspecialchars($row[tube])) ."' type=\'application/x-shockwave-flash\' width=\'500\' height=\'410\'></embed></center></td></tr>");
« Ostatnia zmiana: Listopad 02, 2011, 08:59:36 wysłana przez Daniolos »
Zapisane
ReactionTorrent.net

raxar

  • Początkujący+
  • **
  • Reputacja 0
  • Offline Offline
  • Płeć: Mężczyzna
  • Wiadomości: 15
Odp: Nowy wygląd details.php
« Odpowiedź #19 dnia: Listopad 02, 2011, 09:17:52 »

Jeszcze raz wielkie dzięki. Działa wszystko jak nalży.
Zapisane
 

Strona wygenerowana w 0.226 sekund z 22 zapytaniami.