Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
pages des torrents en mode listes et en
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods in Progress

2020-08-14 12:37:21
pages des torrents en mode listes et en mode images...

pourriez vous m'aider pour faire la page des torrent en mode liste et en mode images, voici le code ci-dessous pour faire la page en mode images mais je cherche comment faire pour avoir les deux fonction et pouvoir basculer en mode liste ou en mode image depuis la barre des menu au dessus du tracker...


[color=rgb(251, 160, 38)]torrent en mode images:

recherche dans function.php[/color]

    echo '<table align="center" class="ttable_headinner" width="100%"><thead><tr class="ttable_head">';

   foreach ($cols as $col) {
       switch ($col) {


           case 'category':
               echo "<th>".T_("TYPE")."</th>";
           break;
           case 'name':
               echo "<th>".T_("NAME")."</th>";
           break;
           case 'dl':
               echo "<th>".T_("DL")."</th>";
           break;
           case 'uploader':
               echo "<th>".T_("UPLOADER")."</th>";
           break;
           case 'comments':
               echo "<th>".T_("COMM")."</th>";
           break;
           case 'nfo':
               echo "<th>".T_("NFO")."</th>";
           break;
           case 'size':
               echo "<th>".T_("SIZE")."</th>";
           break;
           case 'completed':
               echo "<th>".T_("C")."</th>";
           break;
           case 'seeders':
               echo "<th>".T_("S")."</th>";
           break;
           case 'leechers':
               echo "<th>".T_("L")."</th>";
           break;
           case 'health':
               echo "<th>".T_("HEALTH")."</th>";
           break;
           case 'external':
               if ($site_config["ALLOWEXTERNAL"])
                   echo "<th>".T_("L/E")."</th>";
           break;
           case 'added':
               echo "<th>".T_("ADDED")."</th>";
           break;
           case 'speed':
               echo "<th>".T_("SPEED")."</th>";
           break;
           case 'wait':
               if ($wait)
                   echo "<th>".T_("WAIT")."</th>";
           break;
           case 'rating':
               echo "<th>".T_("RATINGS")."</th>";
           break;
       }
   }


   if ($wait && !in_array("wait", $cols))
       echo "<th>".T_("WAIT")."</th>";
 
   echo "</tr></thead>";

   while ($row = mysqli_fetch_assoc($res)) {
       $id = $row["id"];

       print("<tr class='t-row'>\n");

   $x = 1;

   foreach ($cols as $col) {
       switch ($col) {
           case 'category':
               print("<td class='ttable_col$x' align='center' valign='middle'>");
               if (!empty($row["cat_name"])) {
                   print("<a href=\"torrents.php?cat=" . $row["category"] . "\">");
                   if (!empty($row["cat_pic"]) && $row["cat_pic"] != "")
                       print("<img border=\"0\"src=\"" . $site_config['SITEURL'] . "/images/categories/" . $row["cat_pic"] . "\" alt=\"" . $row["cat_name"] . "\" />");
                   else
                       print($row["cat_parent"].": ".$row["cat_name"]);
                   print("</a>");
               } else
                   print("-");
               print("</td>\n");
           break;
           case 'name':
               $char1 = 35; //cut name length
               $smallname = htmlspecialchars(CutName($row["name"], $char1));
               $dispname = "<b>".$smallname."</b>";
             
               $last_access = $CURUSER["last_browse"];
               $time_now = gmtime();
               if ($last_access > $time_now || !is_numeric($last_access))
                   $last_access = $time_now;
               if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
                   $dispname .= "<b><font color='#ff0000'> - (".T_("NEW")."!)</font></b>";

               if ($row["freeleech"] == 1)
                   $dispname .= " <img src='images/free.gif' border='0' alt='' />";
               print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\" /></a>":"")."&nbsp;<a title=\"".$row["name"]."\" href=\"torrents-details.php?id=$id&amp;hit=1\">$dispname</a></td>");
           break;
           case 'dl':
               print("<td class='ttable_col$x' align='center'><a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\"><img src='" . $site_config['SITEURL'] . "/images/icon_download.gif' border='0' alt=\"Download .torrent\" /></a></td>");
           break;
           case 'uploader':
               echo "<td class='ttable_col$x' align='center'>";
               if (($row["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $row["owner"] && $CURUSER["edit_torrents"] != "yes")
                   echo "Anonymous";
               elseif ($row["username"])
                   echo "<a href='account-details.php?id=$row[owner]'>$row[username]</a>";
               else
                   echo "Unknown";
               echo "</td>";
           break;
           case 'comments':
               print("<td class='ttable_col$x' align='center'><font size='1' face='verdana'><a href='comments.php?type=torrent&amp;id=$id'>" . number_format($row["comments"]) . "</a></font></td>\n");
           break;
           case 'nfo':
               if ($row["nfo"] == "yes")
                   print("<td class='ttable_col$x' align='center'><a href='nfo-view.php?id=$row[id]'><img src='" . $site_config['SITEURL'] . "/images/icon_nfo.gif' border='0' alt='View NFO' /></a></td>");
               else
                   print("<td class='ttable_col$x' align='center'>-</td>");
           break;
           case 'size':
               print("<td class='ttable_col$x' align='center'>".mksize($row["size"])."</td>\n");
           break;
           case 'completed':
               print("<td class='ttable_col$x' align='center'><font color='orange'><b>".number_format($row["times_completed"])."</b></font></td>");
           break;
           case 'seeders':
               print("<td class='ttable_col$x' align='center'><font color='green'><b>".number_format($row["seeders"])."</b></font></td>\n");
           break;
           case 'leechers':
               print("<td class='ttable_col$x' align='center'><font color='#ff0000'><b>" . number_format($row["leechers"]) . "</b></font></td>\n");
           break;
           case 'health':
               print("<td class='ttable_col$x' align='center'><img src='".$site_config["SITEURL"]."/images/health/health_".health($row["leechers"], $row["seeders"]).".gif' alt='' /></td>\n");
           break;
           case 'external':
               if ($site_config["ALLOWEXTERNAL"]){
                   if ($row["external"]=='yes')
                       print("<td class='ttable_col$x' align='center'>".T_("E")."</td>\n");
                   else
                       print("<td class='ttable_col$x' align='center'>".T_("L")."</td>\n");
               }
           break;
           case 'added':
               print("<td class='ttable_col$x' align='center'>".date("d-m-Y H:i:s", utc_to_tz_time($row['added']))."</td>");
           break;
           case 'speed':
               if ($row["external"] != "yes" && $row["leechers"] >= 1){
                   $speedQ = SQL_Query_exec("SELECT (SUM(downloaded)) / (UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(started)) AS totalspeed FROM peers WHERE seeder = 'no' AND torrent = '$id' ORDER BY started ASC");
                   $a = mysqli_fetch_assoc($speedQ);
                   $totalspeed = mksize($a["totalspeed"]) . "/s";
               } else
                   $totalspeed = "--";
           print("<td class='ttable_col$x' align='center'>$totalspeed</td>");
           break;
           case 'wait':
               if ($wait){
                   $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
                   if ($elapsed < $wait && $row["external"] != "yes") {
                       $color = dechex(floor(127*($wait - $elapsed)/48 + 128)*65536);
                       print("<td class='ttable_col$x' align='center'><a href=\"faq.php#section46\"><font color=\"$color\">" . number_format($wait - $elapsed) . " h</font></a></td>\n");
                   } else
                       print("<td class='ttable_col$x' align='center'>--</td>\n");
               }
           break;
           case 'rating':
               if (!$row["rating"])
                   $rating = "--";
               else
                   $rating = "<a title='$row[rating]/5'>".ratingpic($row["rating"])."</a>";
                   //$rating = ratingpic($row["rating"]);
                    //$srating .= "$rpic (" . $row["rating"] . " out of 5) " . $row["numratings"] . " users have rated this torrent";
               print("<td class='ttable_col$x' align='center'>$rating</td>");
           break;
       }
       if ($x == 2)
           $x--;
       else
           $x++;
   }

 
       //Wait Time Check
       if ($wait && !in_array("wait", $cols)) {
           $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
           if ($elapsed < $wait && $row["external"] != "yes") {
               $color = dechex(floor(127*($wait - $elapsed)/48 + 128)*65536);
               print("<td class='ttable_col$x' align='center'><a href=\"faq.php\"><font color=\"$color\">" . number_format($wait - $elapsed) . " h</font></a></td>\n");
           } else
               print("<td class='ttable_col$x' align='center'>--</td>\n");
           $colspan++;
           if ($x == 2)
               $x--;
           else
               $x++;
       }
     
       print("</tr>\n");

       //Expanding area
       if (count($expandrows)) {
           print("<tr class='t-row'><td class='ttable_col$x' colspan='$colspan'><div id=\"kt".$row['id']."\" style=\"margin-left: 2px; display: none;\">");
           print("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
           foreach ($expandrows as $expandrow) {
               switch ($expandrow) {
                   case 'size':
                       print("<tr><td><b>".T_("SIZE")."</b>: ".mksize($row['size'])."</td></tr>");
                   break;
                   case 'speed':
                       if ($row["external"] != "yes" && $row["leechers"] >= 1){
                           $speedQ = SQL_Query_exec("SELECT (SUM(downloaded)) / (UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(started)) AS totalspeed FROM peers WHERE seeder = 'no' AND torrent = '$id' ORDER BY started ASC");
                           $a = mysqli_fetch_assoc($speedQ);
                           $totalspeed = mksize($a["totalspeed"]) . "/s";
                           print("<tr><td><b>".T_("SPEED").":</b> $totalspeed</td></tr>");
                       }
                   break;
                   case 'added':
                       print("<tr><td><b>".T_("ADDED").":</b> ".date("d-m-Y \\a\\t H:i:s", utc_to_tz_time($row['added']))."</td></tr>");
                   break;
                   case 'tracker':
                   if ($row["external"] == "yes")
                       print("<tr><td><b>".T_("TRACKER").":</b> ".htmlspecialchars($row["announce"])."</td></tr>");
                   break;
                   case 'completed':
                       print("<tr><td><b>".T_("COMPLETED")."</b>: ".number_format($row['times_completed'])."</td></tr>");
                   break;
               }
           }
               print("</table></div></td></tr>\n");
       }
       //End Expanding Area


   }


   print("</table><br />\n");

}





[color=rgb(251, 160, 38)]Remplacer par:[/color]

        echo '<table align=center cellpadding=7 cellspacing=12 width=100% border=3><tr>';

$i = 0;

   while ($row = mysqli_fetch_assoc($res)) {

       $id = $row["id"];

   foreach ($cols as $col) {

       switch ($col) {

case 'name':

               $char1 = 17; //cut name length

               $smallname = htmlspecialchars(CutName($row["name"], $char1));

               $dispname = "<b>".$smallname."</b>";

               if ($i % 5 === 0)

               echo "<tr></tr>";

if ($row["vip"] == "yes")
                   $dispname .= " <img src='images/vip.gif' border='0' alt='' />";

               echo "<td align='center'><a href=torrents-details.php?id=$row[id]'><img id='cover_img1' class='cover_img' border='2' src='uploads/images/$row[image1]' width='128px' height='177px'></a>

<br><br>

<img src=images/arrow_up.gif height='13' title='Seeders' border=0><font color=#00AA00><b>".$row['seeders']."</b></font>

|

<img src=images/arrow_down.gif height='13' title='Leechers' border=0><font color=#FF0000> <b>".$row['leechers']."</b></font><br><br>";

               echo $dispname."<br><br>";

           
echo $row['    username    ']."

<img border=\"0\"src=\"" . $site_config['SITEURL'] . "/images/categories/" . $row["cat_pic"] . "\" alt=\"" . $row["cat_name"] . "\" />

<br><br>

<font color=#BE6F04> <b>".$row['cat_name']."</b></font>";

               echo "</td>";

           break;

       }

   }

$i++;

   }

print("</tr></table>");

}










[ATTACH type="full" alt="1597408061524.png"]5722[/ATTACH]
1597408061524.png
1597408061524.png
2020-08-14 13:03:56
maybe have 2 two functions my friend, you would need config - $site_config['torrent_image'] = true (or false)

torrenttable()  &   torrenttableimage()

if ($site_config['torrent_image'] == true) {
torrenttableimage()
} else {
torrenttable()
}


A option
And you may also move these functions to something like  torrenttables.php in functions find require_once(BACKEND."/languages.php");
below add the new file require_once(BACKEND."/new_file_name.php");
2020-08-14 13:07:45
for each user its must be setting in database
$example = select torrtable from users where id
if ($example = true)
2020-08-14 13:28:12
??? j'ai une page blanche pouvez vous m'aider a le faire et me dire les fichiers que je doit vous mettre ici en attach files ??
2020-08-14 14:07:30
I like this idea I will make later today and share  (y)

My sql is rusty ?  for v3 but I'm sure [USER=20382]@STorrents2020[/USER] or [USER=311]@MicroMonkey[/USER] can help with any db queries if needed
2020-08-14 15:14:29
ok thank you so I'll wait for your help or see if STorrents2020 or MicroMonkey will provide support for this function.:D

because it's still better to have both function which is the list of torrents in pictures or in list mode


ok merci donc j'attends votre aide ou je verrai si STorrents2020 ou MicroMonkey peuvent fournir un support pour cette fonction :D

car il est toujours préférable d'avoir les deux fonctions, c'est-à-dire la liste des torrents en images ou en mode liste
2020-08-14 15:28:48
can you post full function after this, first we make it work then add user setting
for now config to see

index.php find

   $res = DB::run($query);
   if ($res->rowCount()) {
       torrenttable($res);
       torrenttableimage($res);
   }else {



replace with
    $res = DB::run($query);
   if ($res->rowCount()) {
       if ($site_config['torrimagetable'] == true) {
       torrenttable($res);
       } else {
       torrenttableimage($res);
   }
   }else {


config.php add
$site_config["torrimagetable"] = true;


functions.php
You need OLD torrenttable function AND NEW function torrenttableimage

note - mine i edit my function with your code - sort is missing & i notice there is no default image
2020-08-14 15:50:03
here is my table file torrent.php in image and my .php function if it can help you because I can't put both functions, thanks for the support
functions.zip
Download
torrents.zip
Download
2020-08-14 15:55:18
"m-jay, post: 69034, member: 20288":

can you post full function after this, first we make it work then add user setting
for now config to see

index.php find

   $res = DB::run($query);
   if ($res->rowCount()) {
       torrenttable($res);
       torrenttableimage($res);
   }else {



replace with
    $res = DB::run($query);
   if ($res->rowCount()) {
       if ($site_config['torrimagetable'] == true) {
       torrenttable($res);
       } else {
       torrenttableimage($res);
   }
   }else {


config.php add
$site_config["torrimagetable"] = true;


functions.php
You need OLD torrenttable function AND NEW function torrenttableimage

note - mine i edit my function with your code - sort is missing & i notice there is no default image








[color=rgb(251, 160, 38)]I don't have that piece of code in index.php.[/color]

    $res = DB::run($query);
   if ($res->rowCount()) {
       torrenttable($res);
       torrenttableimage($res);
   }else {
index.zip
Download
2020-08-14 16:36:55
make backup of torrents.php & functions.php

in torrents.php find

// End
if ($count)
{
   torrenttable($res);
   print $pagerbottom;
}


replace with

// End
if ($count)
{
       if ($site_config['torrimagetable'] == true) {
       torrenttable($res);
      print $pagerbottom;
       } else {
       torrenttableimage($res);
      print $pagerbottom;
   }
   }else


in functions.php find
function torrenttable($res) {


replace with
function torrenttableimage($res) {


find
function pager($rpp, $count, $href, $opts = array()) {


before add
function torrenttable($res) {
   global $site_config, $CURUSER, $THEME, $LANGUAGE;  //Define globals

   if ($site_config["MEMBERSONLY_WAIT"] && $site_config["MEMBERSONLY"] && in_array($CURUSER["class"], explode(",",$site_config["WAIT_CLASS"]))) {
       $gigs = $CURUSER["uploaded"] / (1024*1024*1024);
       $ratio = (($CURUSER["downloaded"] > 0) ? ($CURUSER["uploaded"] / $CURUSER["downloaded"]) : 0);
       if ($ratio < 0 || $gigs < 0) $wait = $site_config["WAITA"];
       elseif ($ratio < $site_config["RATIOA"] || $gigs < $site_config["GIGSA"]) $wait = $site_config["WAITA"];
       elseif ($ratio < $site_config["RATIOB"] || $gigs < $site_config["GIGSB"]) $wait = $site_config["WAITB"];
       elseif ($ratio < $site_config["RATIOC"] || $gigs < $site_config["GIGSC"]) $wait = $site_config["WAITC"];
       elseif ($ratio < $site_config["RATIOD"] || $gigs < $site_config["GIGSD"]) $wait = $site_config["WAITD"];
       else $wait = 0;
   }

   // Columns
   $cols = explode(",", $site_config["torrenttable_columns"]);
   $cols = array_map("strtolower", $cols);
   $cols = array_map("trim", $cols);
   $colspan = count($cols);
   // End

   // Expanding Area
   $expandrows = array();
   if (!empty($site_config["torrenttable_expand"])) {
       $expandrows = explode(",", $site_config["torrenttable_expand"]);
       $expandrows = array_map("strtolower", $expandrows);
       $expandrows = array_map("trim", $expandrows);
   }
   // End

   echo '<table align="center" class="ttable_headinner" width="100%"><thead><tr class="ttable_head">';

   foreach ($cols as $col) {
       switch ($col) {
           case 'category':
               echo "<th>".T_("TYPE")."</th>";
           break;
           case 'name':
               echo "<th>".T_("NAME")."</th>";
           break;
           case 'dl':
               echo "<th>".T_("DL")."</th>";
           break;
           case 'uploader':
               echo "<th>".T_("UPLOADER")."</th>";
           break;
           case 'comments':
               echo "<th>".T_("COMM")."</th>";
           break;
           case 'nfo':
               echo "<th>".T_("NFO")."</th>";
           break;
           case 'size':
               echo "<th>".T_("SIZE")."</th>";
           break;
           case 'completed':
               echo "<th>".T_("C")."</th>";
           break;
           case 'seeders':
               echo "<th>".T_("S")."</th>";
           break;
           case 'leechers':
               echo "<th>".T_("L")."</th>";
           break;
           case 'health':
               echo "<th>".T_("HEALTH")."</th>";
           break;
           case 'external':
               if ($site_config["ALLOWEXTERNAL"])
                   echo "<th>".T_("L/E")."</th>";
           break;
           case 'added':
               echo "<th>".T_("ADDED")."</th>";
           break;
           case 'speed':
               echo "<th>".T_("SPEED")."</th>";
           break;
           case 'wait':
               if ($wait)
                   echo "<th>".T_("WAIT")."</th>";
           break;
           case 'rating':
               echo "<th>".T_("RATINGS")."</th>";
           break;
       }
   }
   if ($wait && !in_array("wait", $cols))
       echo "<th>".T_("WAIT")."</th>";

   echo "</tr></thead>";

   while ($row = mysqli_fetch_assoc($res)) {
       $id = $row["id"];

       print("<tr class='t-row'>\n");

   $x = 1;

   foreach ($cols as $col) {
       switch ($col) {
           case 'category':
               print("<td class='ttable_col$x' align='center' valign='middle'>");
               if (!empty($row["cat_name"])) {
                   print("<a href=\"torrents.php?cat=" . $row["category"] . "\">");
                   if (!empty($row["cat_pic"]) && $row["cat_pic"] != "")
                       print("<img border=\"0\"src=\"" . $site_config['SITEURL'] . "/images/categories/" . $row["cat_pic"] . "\" alt=\"" . $row["cat_name"] . "\" />");
                   else
                       print($row["cat_parent"].": ".$row["cat_name"]);
                   print("</a>");
               } else
                   print("-");
               print("</td>\n");
           break;
           case 'name':
               $char1 = 35; //cut name length
               $smallname = htmlspecialchars(CutName($row["name"], $char1));
               $dispname = "<b>".$smallname."</b>";
         
               $last_access = $CURUSER["last_browse"];
               $time_now = gmtime();
               if ($last_access > $time_now || !is_numeric($last_access))
                   $last_access = $time_now;
               if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
                   $dispname .= "<b><font color='#ff0000'> - (".T_("NEW")."!)</font></b>";

               if ($row["freeleech"] == 1)
                   $dispname .= " <img src='images/free.gif' border='0' alt='' />";
               print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\" /></a>":"")."&nbsp;<a title=\"".$row["name"]."\" href=\"torrents-details.php?id=$id&amp;hit=1\">$dispname</a></td>");
           break;
           case 'dl':
               print("<td class='ttable_col$x' align='center'><a href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\"><img src='" . $site_config['SITEURL'] . "/images/icon_download.gif' border='0' alt=\"Download .torrent\" /></a></td>");
           break;
           case 'uploader':
               echo "<td class='ttable_col$x' align='center'>";
               if (($row["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $row["owner"] && $CURUSER["edit_torrents"] != "yes")
                   echo "Anonymous";
               elseif ($row["username"])
                   echo "<a href='account-details.php?id=$row[owner]'>$row[username]</a>";
               else
                   echo "Unknown";
               echo "</td>";
           break;
           case 'comments':
               print("<td class='ttable_col$x' align='center'><font size='1' face='verdana'><a href='comments.php?type=torrent&amp;id=$id'>" . number_format($row["comments"]) . "</a></font></td>\n");
           break;
           case 'nfo':
               if ($row["nfo"] == "yes")
                   print("<td class='ttable_col$x' align='center'><a href='nfo-view.php?id=$row[id]'><img src='" . $site_config['SITEURL'] . "/images/icon_nfo.gif' border='0' alt='View NFO' /></a></td>");
               else
                   print("<td class='ttable_col$x' align='center'>-</td>");
           break;
           case 'size':
               print("<td class='ttable_col$x' align='center'>".mksize($row["size"])."</td>\n");
           break;
           case 'completed':
               print("<td class='ttable_col$x' align='center'><font color='orange'><b>".number_format($row["times_completed"])."</b></font></td>");
           break;
           case 'seeders':
               print("<td class='ttable_col$x' align='center'><font color='green'><b>".number_format($row["seeders"])."</b></font></td>\n");
           break;
           case 'leechers':
               print("<td class='ttable_col$x' align='center'><font color='#ff0000'><b>" . number_format($row["leechers"]) . "</b></font></td>\n");
           break;
           case 'health':
               print("<td class='ttable_col$x' align='center'><img src='".$site_config["SITEURL"]."/images/health/health_".health($row["leechers"], $row["seeders"]).".gif' alt='' /></td>\n");
           break;
           case 'external':
               if ($site_config["ALLOWEXTERNAL"]){
                   if ($row["external"]=='yes')
                       print("<td class='ttable_col$x' align='center'>".T_("E")."</td>\n");
                   else
                       print("<td class='ttable_col$x' align='center'>".T_("L")."</td>\n");
               }
           break;
           case 'added':
               print("<td class='ttable_col$x' align='center'>".date("d-m-Y H:i:s", utc_to_tz_time($row['added']))."</td>");
           break;
           case 'speed':
               if ($row["external"] != "yes" && $row["leechers"] >= 1){
                   $speedQ = SQL_Query_exec("SELECT (SUM(downloaded)) / (UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(started)) AS totalspeed FROM peers WHERE seeder = 'no' AND torrent = '$id' ORDER BY started ASC");
                   $a = mysqli_fetch_assoc($speedQ);
                   $totalspeed = mksize($a["totalspeed"]) . "/s";
               } else
                   $totalspeed = "--";
           print("<td class='ttable_col$x' align='center'>$totalspeed</td>");
           break;
           case 'wait':
               if ($wait){
                   $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
                   if ($elapsed < $wait && $row["external"] != "yes") {
                       $color = dechex(floor(127*($wait - $elapsed)/48 + 128)*65536);
                       print("<td class='ttable_col$x' align='center'><a href=\"faq.php#section46\"><font color=\"$color\">" . number_format($wait - $elapsed) . " h</font></a></td>\n");
                   } else
                       print("<td class='ttable_col$x' align='center'>--</td>\n");
               }
           break;
           case 'rating':
               if (!$row["rating"])
                   $rating = "--";
               else
                   $rating = "<a title='$row[rating]/5'>".ratingpic($row["rating"])."</a>";
                   //$rating = ratingpic($row["rating"]);
                    //$srating .= "$rpic (" . $row["rating"] . " out of 5) " . $row["numratings"] . " users have rated this torrent";
               print("<td class='ttable_col$x' align='center'>$rating</td>");
           break;
       }
       if ($x == 2)
           $x--;
       else
           $x++;
   }


       //Wait Time Check
       if ($wait && !in_array("wait", $cols)) {
           $elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
           if ($elapsed < $wait && $row["external"] != "yes") {
               $color = dechex(floor(127*($wait - $elapsed)/48 + 128)*65536);
               print("<td class='ttable_col$x' align='center'><a href=\"faq.php\"><font color=\"$color\">" . number_format($wait - $elapsed) . " h</font></a></td>\n");
           } else
               print("<td class='ttable_col$x' align='center'>--</td>\n");
           $colspan++;
           if ($x == 2)
               $x--;
           else
               $x++;
       }
 
       print("</tr>\n");

       //Expanding area
       if (count($expandrows)) {
           print("<tr class='t-row'><td class='ttable_col$x' colspan='$colspan'><div id=\"kt".$row['id']."\" style=\"margin-left: 2px; display: none;\">");
           print("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
           foreach ($expandrows as $expandrow) {
               switch ($expandrow) {
                   case 'size':
                       print("<tr><td><b>".T_("SIZE")."</b>: ".mksize($row['size'])."</td></tr>");
                   break;
                   case 'speed':
                       if ($row["external"] != "yes" && $row["leechers"] >= 1){
                           $speedQ = SQL_Query_exec("SELECT (SUM(downloaded)) / (UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(started)) AS totalspeed FROM peers WHERE seeder = 'no' AND torrent = '$id' ORDER BY started ASC");
                           $a = mysqli_fetch_assoc($speedQ);
                           $totalspeed = mksize($a["totalspeed"]) . "/s";
                           print("<tr><td><b>".T_("SPEED").":</b> $totalspeed</td></tr>");
                       }
                   break;
                   case 'added':
                       print("<tr><td><b>".T_("ADDED").":</b> ".date("d-m-Y \\a\\t H:i:s", utc_to_tz_time($row['added']))."</td></tr>");
                   break;
                   case 'tracker':
                   if ($row["external"] == "yes")
                       print("<tr><td><b>".T_("TRACKER").":</b> ".htmlspecialchars($row["announce"])."</td></tr>");
                   break;
                   case 'completed':
                       print("<tr><td><b>".T_("COMPLETED")."</b>: ".number_format($row['times_completed'])."</td></tr>");
                   break;
               }
           }
               print("</table></div></td></tr>\n");
       }
       //End Expanding Area


   }

   print("</table><br />\n");

}


Config.php to see use true or false
$site_config["torrimagetable"] = true;
2020-08-14 18:34:00
quand je fait ta modification dans function.php et config.php les torrent sont bien en mode liste comme ci-dessous mais quand je fait la modification du fichier torrent.php sa ne fonctionne plus il y a une page blanche ???


when I make your modification in function.php and config.php the torrents are well in list mode as below but when I make the modification of the torrent.php file it doesn't work anymore there is a blank page ???




[ATTACH type="full"]5727[/ATTACH]
1597429261077.png
1597429261077.png
2020-08-14 18:44:04
My mistake i see now use this instead - this was mistake  }else{

// End
if ($count)
{
       if ($site_config['torrimagetable'] == true) {
       torrenttableimage($res);
      print $pagerbottom;
       } else {
       torrenttable($res);
      print $pagerbottom;
   }
   }else
2020-08-14 19:01:34
use code above updated
2020-08-14 19:04:11
j'ai créer un fichier torrents-images.php et ajouter le contenu du fichier torrents.php  dedant et j'ai changer le bout de code que tu viens de me donner dans le fichier torrents-image.php et il n'y a plus de page blanche mais les torrents reste en mode liste quand on se connecte avec https://......./torrents-images.hp



i created a torrents-images.php file and added the content of the torrents.php dedant file and i changed the code snippet you just gave me in the torrents-image.php file and there is no more blank page but the torrents stay in list mode when you connect with https://......./torrents-images.hp


// End
if ($count)
{
       if ($site_config['torrimagetable'] == true) {
       torrenttable($res);
      print $pagerbottom;
       } else {
       torrenttable($res);
      print $pagerbottom;
   }
   }else {


mais les torrents reste en mode liste quand on se connecte avec https://......./torrents-images.hp
torrents.zip
Download
torrents-images.zip
Download
functions.zip
Download
2020-08-14 19:18:40
here try these two
functions.zip
Download
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728