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
lightbox pop-ups
Controls ·  Search New posts · Mark unread

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

2017-04-09 14:35:18
copied from TT.org. This will work on TTv3 also

If you display torrents on your index page like this, a fun and neat thing to do is have your trailers and NFO pop up in a lightbox rather than opening a new page or tab when you click the nfo link on the index
[ATTACH]2478[/ATTACH]

I will post the code to make the NFO pop up, its really simple. The same thing works with videos, like youtube. I will briefly go over the video pop-up below, since my site is heavily modified, but first, the NFO.....

In each theme header.php, put jquery (if you already have jquery skip this step). Also upload jquery to the js folder. I included jquery at the bottom of this post.


<script src="/js/jquery-2.2.3.min.js"></script>

at the bottom of each theme header.php, put


<link rel="stylesheet" href="/js/prettyphoto/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
<script src="/js/prettyphoto/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
 $(document).ready(function(){
   $("a[rel^='prettyPhoto']").prettyPhoto({
       animation_speed: 'normal', /* fast/slow/normal */
       theme: 'facebook', /* pp_default / light_rounded / dark_rounded / light_square / dark_square / facebook */
       autoplay: true, /* Automatically start videos: True/False */
       default_width: 854,
       default_height: 480,
       deeplinking: false,
       });
 });
</script>

in functions.php, find


           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>");

replace with


           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>");

unpack and upload prettyphoto.zip to js folder.  https://www.mediafire.com/file/xld9135c065hzi6/prettyphoto.zip/file

I also attached jquery-2.2.3.min if you dont have it. You can use any version of jquery, so if you already have one, just use that
 

then when you click on the NFO on the index, it will pop up in a lightbox


same thing for trailers or videos on your index page, in this case, its a youtube trailer

in functions.php (if you have the youtube mod http://www.torrenttrader.org/viewtopic.php?f=14&t=712 )


     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>");



looks like this


If you are trying to pop-up an IMDb trailer, the code in my backend/functions.php looks like this. You have to use IFRAME to pop the IMDB trailers. This line of code includes the code for the youtube videos. This code is part of the IMDB mod and IMDB trailers (http://www.torrenttrader.org/viewtopic.php?f=14&t=122). Im only posting it for you to use as a reference since My site is so modified It would be hard for me to explain it exactly


           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"];
           $video=substr($video,44);
           $video2=$video;
           $video2=substr($video2, 0, -52);
     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;




[ATTACH]2478[/ATTACH]

[ATTACH]2479[/ATTACH]
index.jpg
index.jpg
jquery-2.2.3.min.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)
2017-04-10 02:41:03
Thank you all works well

Information to all, be careful to have the right nfo-view file for the NFO
**On my version 2.09 it was my problem.






2019-06-15 13:02:32
For those they have the ssl and you have the popup in white background, the solution is simple you have to change all the http in https in the file jquery.prettyPhoto.js
This is the edit file.

(Does hack work # 1 on v3 )
jquery.prettyPhoto.zip
Download

2023-09-03 16:59:21
Hello MicroMonkey  ðŸ˜Š

I am redoing my site and it does not want to work, for a while before it works, do you know if there is anything new to modify or add a module to my server to see it work?




2023-09-04 14:25:03
@Spiritblue
there is nothing to change and it works with the current js and css instructions. Check again if you might have missed something

PS
test that jquery.prettyPhoto.js instead, maybe it help you

https://www.mediafire.com/file/egplss147ni0n5c/jquery.prettyPhoto.js/file

https://pastebin.com/dTyr0LrT


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2023-09-04 15:04:42
2023-09-05 06:59:22
Everything is OK from my part of code






www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2023-09-05 07:00:23
2023-11-12 14:07:01
Hi Botanicar

I checked the account mode again and it just downloads and I never see the video or NFO,

my question: is there a server module that should be added???
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728