Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   TTL (http://www.bvlist.com/showthread.php?t=8134)

\n";
                $htmlout .= "\n";
                $htmlout .= "\n";
                $htmlout .= "\n";
    $htmlout .= end_table();
  }
        $htmlout .= end_frame();
        $htmlout .= end_main_frame();
       
        return $htmlout;
}


?>
thats torrenttable_functions.php
djzoulox 12th July 2012 03:16

TTL
 
how to remove TTL from TBDev.2009(Final).rev.295

i been busting my head around it, but when i remove TTL in torrenttable function it looks wierd on browse page any one who can help me ?
Code:

/*
+------------------------------------------------
|  TBDev.net BitTorrent Tracker PHP
|  =============================================
|  by CoLdFuSiOn
|  (c) 2003 - 2009 TBDev.Net
|  http://www.tbdev.net
|  =============================================
|  svn: http://sourceforge.net/projects/tbdevnet/
|  Licence Info: GPL
+------------------------------------------------
|  $Date$
|  $Revision$
|  $Author$
|  $URL$
+------------------------------------------------
*/
function linkcolor($num) {
    if (!$num)
        return "red";
//    if ($num == 1)
//        return "yellow";
    return "green";
}

function torrenttable($res, $variant = "index") {
    global $TBDEV, $CURUSER, $lang;

    $wait = 0;
    $htmlout = '';
   
    if ($CURUSER["class"] < UC_VIP)
    {
      $gigs = $CURUSER["uploaded"] / (1024*1024*1024);
      $ratio = (($CURUSER["downloaded"] > 0) ? ($CURUSER["uploaded"] / $CURUSER["downloaded"]) : 0);
      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;
    }

    $htmlout .= "
   
   
   
    ";

        if ($wait)
        {
                $htmlout .= "\n";
        }

        if ($variant == "mytorrents")
  {
          $htmlout .= "\n";
    $htmlout .= "\n";
        }


    $htmlout .= "
   
   
   
   
   
   
   
   
    ";


    if ($variant == 'index')
        $htmlout .= "\n";

    $htmlout .= "\n";

    while ($row = mysql_fetch_assoc($res))
    {
        $id = $row["id"];
        $htmlout .= "\n";

        $htmlout .= "\n";

        $dispname = htmlspecialchars($row["name"]);
       
        $htmlout .= "\n";
                }
                else
                  $htmlout .= "\n";
        }

/*
        if ($row["nfoav"] && get_user_class() >= UC_POWER_USER)
          print("".$lang["torrenttable_view_nfo_alt"]."\n");
        if ($variant == "index")
            print("".$lang["torrenttable_download_alt"]."\n");

        else */
        if ($variant == "mytorrents")
            $htmlout .= "\n";
       
        if ($variant == "mytorrents")
        {
            $htmlout .= "\n";
        }

        if ($row["type"] == "single")
        {
            $htmlout .= "\n";
        }
        else
        {
            if ($variant == "index")
            {
                $htmlout .= "\n";
            }
            else
            {
                $htmlout .= "\n";
            }
        }

        if (!$row["comments"])
        {
            $htmlout .= "\n";
        }
        else
        {
            if ($variant == "index")
            {
                $htmlout .= "\n";
            }
            else
            {
                $htmlout .= "\n";
            }
        }

/*
        print("\n");
*/
        $htmlout .= "\n";
       
                $ttl = (28*24) - floor((time() - $row["added"]) / 3600);
               
                if ($ttl == 1)
                  $ttl .= "".$lang["torrenttable_hour_singular"]."";
                else
                  $ttl .= "".$lang["torrenttable_hour_plural"]."";
   
    $htmlout .= "\n
    \n";
//        print("\n");
//        print("\n");

       
        if ($row["times_completed"] != 1)
          $_s = "".$lang["torrenttable_time_plural"]."";
        else
          $_s = "".$lang["torrenttable_time_singular"]."";
        $htmlout .= "\n";

        if ($row["seeders"])
        {
            if ($variant == "index")
            {
              if ($row["leechers"]) $ratio = $row["seeders"] / $row["leechers"]; else $ratio = 1;
                $htmlout .= "\n";
            }
            else
            {
                $htmlout .= "\n";
            }
        }
        else
        {
            $htmlout .= "\n";
        }

        if ($row["leechers"])
        {
            if ($variant == "index")
                $htmlout .= "\n";
            else
                $htmlout .= "\n";
        }
        else
            $htmlout .= "\n";

        if ($variant == "index")
            $htmlout .= "\n";

      $htmlout .= "\n";
    }

    $htmlout .= "
{$lang["torrenttable_type"]}{$lang["torrenttable_name"]} {$lang["torrenttable_wait"]} {$lang["torrenttable_edit"]}{$lang["torrenttable_visible"]} {$lang["torrenttable_files"]}{$lang["torrenttable_comments"]}{$lang["torrenttable_added"]}{$lang["torrenttable_ttl"]}{$lang["torrenttable_size"]}{$lang["torrenttable_snatched"]}{$lang["torrenttable_seeders"]}{$lang["torrenttable_leechers"]} {$lang["torrenttable_uppedby"]}
";
        if (isset($row["cat_name"]))
        {
            $htmlout .= "";
            if (isset($row["cat_pic"]) && $row["cat_pic"] != "")
                $htmlout .= "{$row[";
            else
            {
                $htmlout .= $row["cat_name"];
            }
            $htmlout .= "
";
        }
        else
        {
            $htmlout .= "-";
        }
        $htmlout .= "
$dispname\n";

                                if ($wait)
                                {
                                  $elapsed = floor((time() - $row["added"]) / 3600);
                if ($elapsed < $wait)
                {
                  $color = dechex(floor(127*($wait - $elapsed)/48 + 128)*65536);
                  $htmlout .= "
" . number_format($wait - $elapsed) . " ".$lang["torrenttable_wait_h"]."{$lang["torrenttable_wait_none"]} ".$lang["torrenttable_edit"]."\n";
        $htmlout .= "
";
            if ($row["visible"] == "no")
                $htmlout .= "".$lang["torrenttable_not_visible"]."";
            else
                $htmlout .= "".$lang["torrenttable_visible"]."";
            $htmlout .= "
{$row["numfiles"]}" . $row["numfiles"] . "" . $row["numfiles"] . " {$row["comments"]}" . $row["comments"] . "" . $row["comments"] . " ");
        if (!isset($row["rating"]))
            print("---");
        else {
            $rating = round($row["rating"] * 2) / 2;
            $rating = ratingpic($row["rating"]);
            if (!isset($rating))
                print("---");
            else
                print($rating);
        }
        print("
" . str_replace(",", "", get_date( $row['added'],'')) . "$ttl" . str_replace(" ", "", mksize($row["size"])) . "" . $row["views"] . "" . $row["hits"] . " " . number_format($row["times_completed"]) . "$_s
                {$row["seeders"]}
{$row["seeders"]}" . $row["seeders"] . " " .
                  number_format($row["leechers"]) . "
{$row["leechers"]}0 " . (isset($row["username"]) ? ("" . htmlspecialchars($row["username"]) . "") : "(".$lang["torrenttable_unknown_uploader"].")") . "
\n";

    return $htmlout;
}

function commenttable($rows)
{
        global $CURUSER, $TBDEV;
       
       
        $lang = load_language( 'torrenttable_functions' );
       
        $htmlout = '';
        $count = 0;
       
        $htmlout .= begin_main_frame();
        $htmlout .= begin_frame();
       
        foreach ($rows as $row)
        {
                $htmlout .= "

#{$row["id"]} {$lang["commenttable_by"]} ";
    if (isset($row["username"]))
                {
                        $title = $row["title"];
                        if ($title == "")
                                $title = get_user_class_name($row["class"]);
                        else
                                $title = htmlspecialchars($title);
        $htmlout .= "" .
                htmlspecialchars($row["username"]) . "
" . ($row["donor"] == "yes" ? "".$lang["commenttable_donor_alt"]."" : "") . ($row["warned"] == "yes" ? "".$lang["commenttable_warned_alt"]."" : "") . " ($title)\n";
                }
                else
                  $htmlout .= "(".$lang["commenttable_orphaned"].")\n";

                $htmlout .= get_date( $row['added'],'');
                $htmlout .= ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [".$lang["commenttable_edit"]."]" : "") .
                        (get_user_class() >= UC_MODERATOR ? "- [".$lang["commenttable_delete"]."]" : "") .
                        ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [".$lang["commenttable_view_original"]."]" : "") . "

\n";
                $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : "");
               
                if (!$avatar)
                        $avatar = "{$TBDEV['pic_base_url']}default_avatar.gif";
                $text = format_comment($row["text"]);
    if ($row["editedby"])
            $text .= "

".$lang["commenttable_last_edited_by"]." {$row['username']} ".$lang["commenttable_last_edited_at"]." ".get_date($row['editedat'],'DATE')."

\n";
                $htmlout .= begin_table(true);
                $htmlout .= "
$text

Bigjoos 12th July 2012 18:16

Thats because your no removing it correctly. First remove the html column :

PHP Code:

<td class='colhead' align='center'>{$lang["torrenttable_ttl"]}</td

Find this :

PHP Code:

$ttl = (28*24) - floor((time() - $row["added"]) / 3600);                  
if (
$ttl == 1)                     
$ttl .= "".$lang["torrenttable_hour_singular"]."";                  
else                     
$ttl .= "".$lang["torrenttable_hour_plural"]."";          
$htmlout .= "<td align='center'>$ttl</td>\n<td align='center'>" str_replace(" """mksize($row["size"])) . "</td>\n"

Becomes :

PHP Code:

$htmlout .= "<td align='center'>" str_replace(" """mksize($row["size"])) . "</td>\n"

You will have a html column head or a row head with the name of the data shown then the php will be next with the code to grab that data and display it to the user. That may be a while loop or a single row makes no odds its the same shit every time.

djzoulox 12th July 2012 20:45

thanks i been busting my head around how to do that how do i remove the wait time colum

Napon 10th April 2016 10:32

https://forum-u-232.servebeer.com/in...ic,3638.0.html


All times are GMT +2. The time now is 06:11.

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