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
NFO fix [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-04-07 16:12:03
This isnt really a mod. Its basically a fix to the original code
in torrents-details.php find
//DISPLAY NFO BLOCK
function my_nfo_translate($nfo){
       $trans = array(
       "\x80" => "Ç", "\x81" => "ü", "\x82" => "é", "\x83" => "â", "\x84" => "ä", "\x85" => "à", "\x86" => "å", "\x87" => "ç", "\x88" => "ê", "\x89" => "ë", "\x8a" => "è", "\x8b" => "ï", "\x8c" => "î", "\x8d" => "ì", "\x8e" => "Ä", "\x8f" => "Å", "\x90" => "É",
       "\x91" => "æ", "\x92" => "Æ", "\x93" => "ô", "\x94" => "ö", "\x95" => "ò", "\x96" => "û", "\x97" => "ù", "\x98" => "ÿ", "\x99" => "Ö", "\x9a" => "Ü", "\x9b" => "¢", "\x9c" => "£", "\x9d" => "¥", "\x9e" => "₧", "\x9f" => "ƒ", "\xa0" => "á", "\xa1" => "í",
       "\xa2" => "ó", "\xa3" => "ú", "\xa4" => "ñ", "\xa5" => "Ñ", "\xa6" => "ª", "\xa7" => "º", "\xa8" => "¿", "\xa9" => "⌐", "\xaa" => "¬", "\xab" => "½", "\xac" => "¼", "\xad" => "¡", "\xae" => "«", "\xaf" => "»", "\xb0" => "░", "\xb1" => "▒", "\xb2" => "▓",
       "\xb3" => "│", "\xb4" => "┤", "\xb5" => "╡", "\xb6" => "╢", "\xb7" => "╖", "\xb8" => "╕", "\xb9" => "╣", "\xba" => "║", "\xbb" => "╗", "\xbc" => "╝", "\xbd" => "╜", "\xbe" => "╛", "\xbf" => "┐", "\xc0" => "└", "\xc1" => "┴", "\xc2" => "┬", "\xc3" => "├",
       "\xc4" => "─", "\xc5" => "┼", "\xc6" => "╞", "\xc7" => "╟", "\xc8" => "╚", "\xc9" => "╔", "\xca" => "╩", "\xcb" => "╦", "\xcc" => "╠", "\xcd" => "═", "\xce" => "╬", "\xcf" => "╧", "\xd0" => "╨", "\xd1" => "╤", "\xd2" => "╥", "\xd3" => "╙", "\xd4" => "╘",
       "\xd5" => "╒", "\xd6" => "╓", "\xd7" => "╫", "\xd8" => "╪", "\xd9" => "┘", "\xda" => "┌", "\xdb" => "█", "\xdc" => "▄", "\xdd" => "▌", "\xde" => "▐", "\xdf" => "▀", "\xe0" => "α", "\xe1" => "ß", "\xe2" => "Γ", "\xe3" => "π", "\xe4" => "Σ", "\xe5" => "σ",
       "\xe6" => "µ", "\xe7" => "τ", "\xe8" => "Φ", "\xe9" => "Θ", "\xea" => "Ω", "\xeb" => "δ", "\xec" => "∞", "\xed" => "φ", "\xee" => "ε", "\xef" => "∩", "\xf0" => "≡", "\xf1" => "±", "\xf2" => "≥", "\xf3" => "≤", "\xf4" => "⌠", "\xf5" => "⌡", "\xf6" => "÷",
       "\xf7" => "≈", "\xf8" => "°", "\xf9" => "∙", "\xfa" => "·", "\xfb" => "√", "\xfc" => "ⁿ", "\xfd" => "²", "\xfe" => "■", "\xff" => " ",
       );
       $trans2 = array("\xe4" => "ä",        "\xF6" => "ö",        "\xFC" => "ü",        "\xC4" => "Ä",        "\xD6" => "Ö",        "\xDC" => "Ü",        "\xDF" => "ß");
       $all_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
       $last_was_ascii = False;
       $tmp = "";
       $nfo = $nfo . "\00";
       for ($i = 0; $i < (strlen($nfo) - 1); $i++)
       {
               $char = $nfo[$i];
               if (isset($trans2[$char]) and ($last_was_ascii or strpos($all_chars, ($nfo[$i + 1]))))
               {
                       $tmp = $tmp . $trans2[$char];
                       $last_was_ascii = True;
               }
               else
               {
                       if (isset($trans[$char]))
                       {
                               $tmp = $tmp . $trans[$char];
                       }
                       else
                       {
                           $tmp = $tmp . $char;
                       }
                       $last_was_ascii = strpos($all_chars, $char);
               }
       }
       return $tmp;
}
//-----------------------------------------------

//DISPLAY NFO BLOCK
if($row["nfo"]== "yes"){
   $nfofilelocation = "$nfo_dir/$row[id].nfo";
   $filegetcontents = file_get_contents($nfofilelocation);
   $nfo = htmlspecialchars($filegetcontents);
       if ($nfo) {
           $nfo = my_nfo_translate($nfo);
           echo "<br /><br /><b>NFO:</b><br />";
           print("<textarea class='nfo' style='width:98%;height:100%;' rows='20' cols='20' readonly='readonly'>".stripslashes($nfo)."</textarea>");
       }else{
           print(T_("ERROR")." reading .nfo file!");
       }
}

replace with

//DISPLAY NFO BLOCK
begin_frame("NFO");
   if ($row["nfo"] == "yes") {
    echo('<img src="nfo-view.php?id=' . $id . '">');
           }
       else {
           if ($nfo) {
               $nfo = my_nfo_translate($nfo);
               echo "<br /><br /><b>NFO:</b><br />";
               print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
           } //$nfo
           else {
               $nfo = utf8_encode(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @file_get_contents($nfofilelocation)));
               if ($nfo) {
                   $nfo = my_nfo_translate($nfo);
                   echo "<br /><br /><b>NFO:</b><br />";
                   print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
               } //$nfo
               else {
                   print(T_("NFO_NOT_FOUND"));
               }
           }
       }
end_frame();

upload attached files keeping folder structure
nfo-fix.rar
Download

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)
2019-04-20 09:38:11
still not working
2019-04-20 13:54:43
shit, I screwed up my copy/paste, try it now. I need to clean that code up because it has some useless lines in it, but it works. When I get a moment, I should clean that mess up
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)
2019-04-20 13:59:42
works now.  but it should be good if there is a minimize option
2019-04-20 14:04:28
I'll look into it. I have to reinstall my pc. Its all messed up
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)
2019-04-21 02:54:07
found this. Seems pretty cool. To minimize the window (you must do the edits in the first post)
replace in torrents-details.php find
//DISPLAY NFO BLOCK
begin_frame("NFO");
   if ($row["nfo"] == "yes") {
    echo('<img src="nfo-view.php?id=' . $id . '">');
           }
       else {
           if ($nfo) {
               $nfo = my_nfo_translate($nfo);
               echo "<br /><br /><b>NFO:</b><br />";
               print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
           } //$nfo
           else {
               $nfo = utf8_encode(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @file_get_contents($nfofilelocation)));
               if ($nfo) {
                   $nfo = my_nfo_translate($nfo);
                   echo "<br /><br /><b>NFO:</b><br />";
                   print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
               } //$nfo
               else {
                   print(T_("NFO_NOT_FOUND"));
               }
           }
       }
end_frame();

with

///NEW NFO DISPLAY
begin_frame("NFO");
?>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.collapsible {
 background-color: inherit;
 color: inherit;
 cursor: pointer;
 padding: 18px;
 width: 100%;
 border: none;
 text-align: left;
 outline: none;
 font-size: 15px;
}

.active, .collapsible:hover {
 background-color: inherit;
}

.content {
 padding: 0 18px;
 max-height: 0;
 overflow: hidden;
 transition: max-height 0.2s ease-out;
 background-color: inherit;

}
</style>
</head>
<body>
<button class="collapsible">Click to view NFO</button>
<div class="content">
 <p><?php echo "<br />";
     if ($row["nfo"] == "yes") {
    echo('<img src="nfo-view.php?id=' . $id . '">');
           }
       else {
            print(T_("NFO_NOT_FOUND"));
             }
     echo "<br /><br />";
     ?></p>
   </div></div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
 coll[i].addEventListener("click", function() {
   this.classList.toggle("active");
   var content = this.nextElementSibling;
   if (content.style.maxHeight){
     content.style.maxHeight = null;
   } else {
     content.style.maxHeight = content.scrollHeight + "px";
   }
 });
}
</script>

</body>
               <?php
   end_frame();
               echo "<br /><br />";
///END NEW NFO DISPLAY

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)
2019-04-21 07:59:26
works perfectly. Thanks
2019-04-21 18:27:56
post edited, looks a bit better now
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)
2019-05-06 07:49:03
I have a problem of line length that decentralizes the whole page torrent details [ATTACH type="full" alt="5042"]5042[/ATTACH]
nfo.png
nfo.png
2019-05-17 16:43:31
"ambrosia, post: 66551, member: 20305":

I have a problem of line length that decentralizes the whole page torrent details [ATTACH=full]5042[/ATTACH]

to the class css by the name of .content {

Add after: line-height and display: inline;

[url='https://www.w3schools.com/cssref/pr_dim_line-height.asp']Here[/url] and Here
Unknown User
2019-11-17 14:37:42
If click "Click to view NFO" im see only

[img]https://e-tanker.net/nfo-view.php?id=15[/img]

How to fix it?:unsure:
2019-11-17 17:52:24
you messed up your edits. recheck your edits, or post your torrents-details.php file
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)
Unknown User
2019-11-17 19:52:32
Thanks for help!

This is my file
torrents-details.php.zip
Download
2019-11-17 20:09:52
I dont see anything wrong. Are you sure you uploaded nfo-view.php to your root directory? You have your directories all complicated.
require_once($_SERVER["DOCUMENT_ROOT"]."/backend/functions/functions.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/backend/functions/BDecode.php");

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)
Unknown User
2019-11-18 14:57:01
Yes, I have all my files uploaded so how do I need. Maybe the server needs to have some special appendix installed?
Some pictures that the necessary files exist on the server.

[ATTACH]5241[/ATTACH][ATTACH width="98px"]5242[/ATTACH][ATTACH]5243[/ATTACH][ATTACH]5244[/ATTACH]

It's very confusing that it doesn't work when it's all right.  :confused:

This NFO works nicely in another tracker, of course there's a tracker code another
backend-files.png
backend-files.png
func-bdcode-files.png
func-bdcode-files.png
NFO-view-file.png
NFO-view-file.png
click-view-nfo.png
click-view-nfo.png
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