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
torrent name
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2021-11-23 11:44:53
when i put image link on description  the torrent name takes the description

2021-11-23 14:52:15
Have you added description  on table head if not you don't have enough columns

Post the description code you have added
2021-11-23 15:40:06
i think its here it happens only when i put [img][/img] tag in description
	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 'magnet':
echo "<th>".T_("MAGNET2")."</th>";
break;
case 'imdb':
               echo "<th>".T_("IMDB_INDEX_PAGE")."</th>";
           break;
case 'tube':
               echo "<th>".T_("YOUTUBE")."</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>";
$dispname .= " <img src='images/newtorrent.png' border='0'>";

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

   if ($row["uplreq"] == 'yes')
                  $dispname .= "<b><font color='#0000FF'> - (".T_("REQUEST").")</font></b>";



//////////BALLOON TOOLTIP MOD UFFENO1 VERSION (8-4-2018). Edited to suit the use of CSS to control the color of background. See theme.css of each theme for ballooncolor and balloonheadercolor.
                   $preparing_descr=SQL_Query_exec("SELECT torrents.anon, torrents.views, torrents.hits, torrents.descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, 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.external, torrents.image1, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");
              $descr=mysqli_fetch_array($preparing_descr);
             
              if (empty($descr["lang_name"]))
              $descr["lang_name"] = "Unknown/NA";
              $lang = "<b>" .T_("LANG"). " : </b>" . $descr["lang_name"] . "";
             
              if (isset($descr["lang_image"]) && $descr["lang_image"] != "")
              $flag = "<img src=$site_config[SITEURL]/images/languages/$descr[lang_image] border=0   alt=$descr[lang_name]>";
             
              $bimg = @mysqli_fetch_array(@SQL_Query_exec("SELECT image1 FROM torrents WHERE id=$id"));
                   $balon =($bimg["image1"] ? "$site_config[SITEURL]/uploads/images/" . htmlspecialchars($bimg["image1"]) : "images/nocover.png");
             
              $des = mysqli_real_escape_string($GLOBALS["DBconnector"],format_comment($descr['descr']));
              $char5 = 500; //cut name length
             
              if (($descr["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $descr["owner"] && $CURUSER["edit_torrents"] != "yes") {
              $descr['username'] = "".T_("ANONYMOUS")."";
              }else{
              $descr['username'];
              }
              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>":"")." <a href=\"torrents-details.php?id=$id&hit=1\" onMouseover=\"return overlib('<table class=ballooncolor border=1 width=100% class=ttable_headinner cellspacing=0 cellpadding=5 align=center><tr><td class=balloonheadercolor colspan=2 align=center>$smallname</td></tr><tr valign=top><td class=table_col1 align=center><img border=0 width=120 src=$balon></td><td width=80% class=table_col1><div align=left><b>Uploaded on: </b>" . date("m-d-Y", utc_to_tz_time($row["added"])) . "<br /><b>Size: </b>". mksize($row["size"]) . "<br /><b>Completed: </b>" . $row["times_completed"] . "<br /></div><div align=left><b>Views: </b>" . $descr["views"] . "<br />".$lang." ".$flag."<br /><b>Hits: </b>" . $descr["hits"] . "<br /><b>Seeders: </b><font color=green>" . $row["seeders"] . "</font><br /><b>Leechers: </b><font color=red>" . $row["leechers"] . "</font><br /><b> Uploaded by: </b>" . $descr['username'] . "</div></td></tr><tr><td class=balloonheadercolor colspan=2 align=center>".T_("DESCRIPTION")."</td></tr><tr><td class=table_col1 colspan=2>" . CutName($des, $char5) . "</td></tr></table>', CENTER, HEIGHT, 150, WIDTH, 300)\"; onMouseout=\"return nd()\">".$dispname."</a></td>");  
break;
////////END BALLOON MOD



/////This goes below to reverse the torrent encryption/////<a href=\"download.php?id=$id&name=" . rawurlencode($row["filename"]) . "\">
// case 'dl':
// print("<td class='ttable_col$x' align='center'><a href=\"download.php?id=$id&name=" . rawurlencode($row["filename"]) . "\"><img src='" . $site_config['SITEURL'] . "/images/icon_download.png' border='0' width='50' height='50'alt=\"Download .torrent\" /></a></td>");
// break;

case 'dl':
//require_once("backend/URLencrypt.php");
print("<td class='ttable_col$x' align='center'><a href=\"download.php?id=$id&name=" . rawurlencode($row["filename"]) . "\"><img src='" . $site_config['SITEURL'] . "/images/icon_download.png' border='0' width='50' height='50'title='Download .torrent' /></a></td>");
break;

case 'magnet':
$shit = mysqli_fetch_array(SQL_Query_exec("SELECT info_hash FROM torrents WHERE id=$id"));
if ($row["external"]!='yes') {
print ("<td class='ttable_col$x' align='center'><a href=\"magnet:?xt=urn:btih:" . $shit["info_hash"] . "&dn=" . rawurlencode($row['name']) . "&tr=" . $row['announce'] . "?passkey=". $CURUSER ['passkey']. "\"><img src='" . $site_config['SITEURL'] . "/images/magnetique.png' border='0' width='50' height='50'title='Download via Magnet' /></a></td>");
}else{
print ("<td class='ttable_col$x' align='center'><img src='" . $site_config['SITEURL'] . "/images/no_magnet.png' border='0' width='50' height='50'title='No magnet links on externally tracked torrents due to user passkey' /></td>");
}
break;

// case 'magnet':
//    $shit = @mysqli_fetch_array(@SQL_Query_exec("SELECT info_hash FROM torrents WHERE id=$id"));
// print ("<td class='ttable_col$x' align='center'><a href=\"magnet:?xt=urn:btih:" . $shit["info_hash"] . "&dn=" . rawurlencode($row['name']) . "&tr=" . $row['announce'] . "?passkey=". $CURUSER ['passkey']. "\"><img src='" . $site_config['SITEURL'] . "/images/magnetique.png' border='0' width='50' height='50'title='Download via Magnet' /></a></td>");
// break;

case 'imdb':
     if ($row["imdb"])  
           print("<td class='ttable_col$x' align='center'><a href=".$row['imdb']." target='_blank'><".htmlspecialchars($row['imdb'])."><img src='" . $site_config['SITEURL'] . "/images/imdb.png'  border='0' width='50' height='50' alt=\"\" /></a></td>");
        else
        print("<td class='ttable_colx' align='center'>-</td>");  
        break;

case 'tube':
$video=$row["trailers"]; //Dont forget to make changes to torrents-details also around line 304
$video=substr($video,27); //adjustments to shorten the URL removes first 27 characters from URL
$video2=$video; //changing variables to further shorten the URL
$video2=substr($video2, 0, -21); //more adjustments to shorten the URL down the the IMDB video number only. removes last 21 characters
     if ($row["tube"])  
           print("<td class='ttable_col$x' align='center'><a rel=\"prettyPhoto\"  href=".$row['tube']." ><".htmlspecialchars($row['tube'])."><img src='" . $site_config['SITEURL'] . "/images/youtube1.png'  border='0' width='50' height='50' title='Click to watch the YouTube Trailer' /></a></td>");
     elseif ($row["trailers"])  
           print("<td class='ttable_col$x' align='center'><a rel=\"prettyPhoto[iframes]\"  href=\"http://www.imdb.com/videoembed/". $video2."?ref_=embed&?iframe=true\"><img src='" . $site_config['SITEURL'] . "/images/movietrailers.png'  border='0' width='50' height='50' title='Click to watch the IMDb Trailer' /></a></td>");
else
        print("<td class='ttable_colx' align='center'>-</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]'>".class_user($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&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]'rel=\"prettyPhoto\"><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("n-d-Y g:i a", 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++;
}
?>
Last edited by djlive on 2021-11-23 21:12:04
2021-11-24 11:42:25
I tried this and you are right. If you post an image in the torrent description using [img] tags, it blows out the index tables. I'll have to look into this a bit later. I never tried images in a torrent description before. My first thought is it may have something to do with the balloon tooltips mod. You can see the onMouseout showing in your picture above.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-11-24 11:49:18
2021-11-24 16:14:19
I have erased T_("DESCRIPTION") and works now. i dont need to see the description  in ballon just image 1 and the rest of details . Thanks
Last edited by djlive on 2021-11-24 19:45:25
2021-11-24 23:52:29
so the LANG file was messing it up? Can you just use "Description" in its place? Using just plain text? Can you show what you erased?
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-11-24 23:54:30
2021-11-25 17:45:07
i just erased
".T_("DESCRIPTION")."</td></tr><tr><td class=table_col1 colspan=2>" . CutName($des, $char5) . "



so the new line line will look like this

               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 href=\"torrents-details.php?id=$id&hit=1\" onMouseover=\"return overlib('<table class=ballooncolor border=1 width=100% class=ttable_headinner cellspacing=0 cellpadding=5 align=center><tr><td class=balloonheadercolor colspan=2 align=center>$smallname</td></tr><tr valign=top><td class=table_col1 align=center><img border=0 width=120 src=$balon></td><td width=80% class=table_col1><div align=left><center><b>Uploaded on: </b>" . date("m-d-Y", utc_to_tz_time($row["added"])) . "<br /><b>Size: </b>". mksize($row["size"]) . "<br /><b>Completed: </b>" . $row["times_completed"] . "<br /></div><div align=left><b>Views: </b>" . $descr["views"] . "<br />".$lang." ".$flag."<br /><b>Hits: </b>" . $descr["hits"] . "<br /><b>Seeders: </b><font color=green>" . $row["seeders"] . "</font><br /><b>Leechers: </b><font color=red>" . $row["leechers"] . "</font><br /><b> Uploaded by: </b>" . $descr['username'] . "</div></td></tr><tr><td class=balloonheadercolor colspan=2 align=center></td></tr>', CENTER, HEIGHT, 150, WIDTH, 300)\"; onMouseout=\"return nd()\">".$dispname."</a></center></td>");   
2022-02-06 04:31:30
If you support English and no plans for other languages, add this to backend/languages.php

Replace

function T_($s)
{
   GLOBAL $LANG;
   if ($ret = $LANG[$s]) {
       return $ret;
   }
   if ($ret = $LANG["{$s}[0]"]) {
       return $ret;
   }
   return $s;
}


With

function T_(string $s): string
{
   return str_replace('_', ' ', $s);
}
2022-02-06 04:36:05
THX STorrents2020 it works how i did i cant do test on what you give but thx. Maybe others will need that code. :cheers:
2022-02-06 05:01:22
I automatically use type declarations in my stuff, but I forgot there are some still using PHP 5 - simply remove
(string ...) :string
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728