Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Heath Bar ( Browse ) (http://www.bvlist.com/showthread.php?t=11651)

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


?>

save then move to bittorrent.php:
add:
Code:

function health($leechers, $seeders) {
    if (($leechers == 0 && $seeders == 0) || ($leechers > 0 && $seeders == 0))
        return 0;
    elseif ($seeders > $leechers)
        return 10;

    $ratio = $seeders / $leechers * 100;
    if ($ratio > 0 && $ratio < 15)
        return 1;
    elseif ($ratio >= 15 && $ratio < 25)
        return 2;
    elseif ($ratio >= 25 && $ratio < 35)
        return 3;
    elseif ($ratio >= 35 && $ratio < 45)
        return 4;
    elseif ($ratio >= 45 && $ratio < 55)
        return 5;
    elseif ($ratio >= 55 && $ratio < 65)
        return 6;
    elseif ($ratio >= 65 && $ratio < 75)
        return 7;
    elseif ($ratio >= 75 && $ratio < 85)
        return 8;
    elseif ($ratio >= 85 && $ratio < 95)
        return 9;
    else
        return 10;
}

BamBam0077 14th June 2018 17:59

Heath Bar ( Browse )
 
if your interest I will share this mod just adds a health bar inside your browse uploaded to site. example 0 seeders 0 leechers will seem like:

https://images2.imgbox.com/c0/62/f3y1ioJ5_o.png
else:
https://images2.imgbox.com/34/65/2A9s6dPK_o.png
if interested as stated earlier I will share with you. DON"T PM Post answer below you might have to do some security checks also I have yet to make it secure as I like it. but if your skilled with php I would assume a small patch wouldn't hurt to secure once I share it idea is taken from TorrentTrader plus it looks need as well. :drink:

Here:
save as torrenttable_functions.php
Code:


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 ($variant == "mytorrents")
  {
      $htmlout .= "\n";
    $htmlout .= "\n";
    }


    $htmlout .= "
   
   
   
    ";

$htmlout .= "\n";
    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";
       
        if ($variant == "mytorrents")
        {
            $htmlout .= "\n";
        }

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

    $htmlout .= "\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";
        $htmlout .= "";

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

    $htmlout .= "
{$lang["torrenttable_type"]}{$lang["torrenttable_name"]}{$lang["torrenttable_edit"]}{$lang["torrenttable_visible"]} {$lang["torrenttable_files"]}{$lang["torrenttable_size"]}{$lang["torrenttable_snatched"]}{$lang["torrenttable_seeders"]}{$lang["torrenttable_leechers"]} Health{$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 ($variant == "mytorrents")
            $htmlout .= "
".$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"] . " " . str_replace(" ", "", mksize($row["size"])) . " " . 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"].")") . "
";

    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_table2(true);
        $htmlout .= "
$text

fatjohn 14th June 2018 18:05

Wow lol so easy to do any want to be coder can add
Pop over to u232 full mod there

BamBam0077 23rd August 2022 13:23

1 Attachment(s)
:gum: nice advice though soz to disappoint you, the information suggested above is the full hack/mod for healthbar!

rootDIR: /var/www/html/include/
modifyFile: replace torrenttable_functions.php file with the one posted originally by us.
modifyFile: now edit bittorrent.php and add health function posted by us above.

!NOTICE! no health status bar, not added just yet....
https://images2.imgbox.com/14/31/tsDj0YHw_o.jpg

New Output:

0 seeders 0 leechers
https://images2.imgbox.com/c0/62/f3y1ioJ5_o.png

2 seeders 3 leechers
https://images2.imgbox.com/34/65/2A9s6dPK_o.png

+ now as you can see it works 100% without any issues if there are it will be most likely PHP version or possibly sql_ext for queries. :ok:

Bump: * create folders: images/health
* unrar files
* upload to dir_file:/var/www/html/images
* now should show like example below when images uploaded / extracted from .rar
https://images2.imgbox.com/34/65/2A9s6dPK_o.png


All times are GMT +2. The time now is 22:57.

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