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

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

2023-03-26 14:48:32
Hello, can you tell me if there is a way to put the imdb video in the torrent-detail.php page


Bonjour, pouvez-vous me dire si il existe un moyen de mettre la video de imdb dans la page de torrent-detail.php 😕


below is my file imdb code torrents-details.php
ci-dessous mon code imdb du fichier   torrents-details.php

//////////////////// IMDB //////////////////////////
$TTIMDB = new TTIMDB;
if ((($_data = $TTCache->Get("imdb/$id", 900)) === false) && ($_data = $TTIMDB->Get($row['imdb']))){
              $_data->Poster = $TTIMDB->getImage($_data->Poster, $id);
       if ( ! isset( $_data->imdbTime ) ){
               $_data->imdbTime = time();
               $_data->Alias = 'N/A';
               $_data->imdbVideo = null;
               }
               $TTCache->Set("imdb/$id", $_data, 900);
}

if ( is_object($_data) ): ?>
       <fieldset class="download">
       <legend><b><?php echo T_("IMDB_SHORT"); ?> - <?php echo $_data->Title; ?></b></legend>
       <table border="0" cellpadding="3" cellspacing="2" width="100%">
   <tr>
       <td width="230"><img src="<?php echo $_data->Poster; ?>" alt="<?php echo $_data->Title; ?>" title="<?php echo $_data->Title; ?>" height="317px" width="214px" /></td>
       <td valign="top"><b>
<br />

<a href="<?php echo $row['imdb']; ?>" target="_blank">
<button>
<b>Voir la description en FR sur IMDB</b>
</button>


</a>

<br /><br />

       <b><?php echo T_("IMDB_RATED"); ?></b><br /> <?php echo $TTIMDB->getRated( $_data->Rated ); ?><br /><br />
       <b><?php echo T_("IMDB_ALIAS"); ?></b><br /> <?php echo $_data->Alias; ?><br /><br />
       <b><?php echo T_("IMDB_RELEASED"); ?></b><br /> <?php echo $TTIMDB->getReleased($_data->Released); ?><br /><br />
       <b><?php echo T_("IMDB_YEAR"); ?></b><br /> <?php echo $_data->Year; ?><br /><br />
       <b><?php echo T_("IMDB_RUNTIME"); ?></b><br /> <?php echo $_data->Runtime; ?><br /><br />
       <b><?php echo T_("IMDB_GENRE"); ?></b><br /> <?php echo $_data->Genre; ?><br /><br />
       <b><?php echo T_("IMDB_DIRECTOR"); ?></b><br /> <?php echo $_data->Director; ?><br /><br />
       <b><?php echo T_("IMDB_WRITER"); ?></b><br /> <?php echo $_data->Writer; ?><br /><br />
       <b><?php echo T_("IMDB_ACTORS"); ?></b><br /> <?php echo $_data->Actors; ?><br /><br />
       <b><?php echo T_("IMDB_PLOT"); ?></b><br /> <?php echo $_data->Plot; ?>
       </td>
<?php if (($rating = $TTIMDB->getRating($_data->imdbRating)) !== null): ?>
       <td valign="top" align="center">
<?php echo $rating; ?><br /><br />
       <b><?php echo T_("IMDB_VOTES"); ?></b> <?php echo $_data->imdbVotes; ?>
   </td>
       <?php endif; ?>
   </tr>
    <tr>
       <td align="right" colspan="3">
       <b><?php echo T_("IMDB_LASTUPDATED"); ?></b> <i><?php echo $TTIMDB->getUpdated($_data->imdbTime); ?></i>
    </td>
    </tr>
    </table>
    </fieldset>
    <br />

<?php if ( strlen( $_data->imdbVideo ) > 3 ): ?>
       <center><iframe src="http://www.imdb.com/video/imdb/<?php echo $_data->imdbVideo; ?>/player?stop=1" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" height="480" width="643"></iframe></center><br />
<?php endif;
endif;

//////////////////// END IMDB //////////////////////////
Last edited by niki on 2023-03-26 14:52:09
2023-03-26 17:13:00
It would be something like this. you need a trailer table in the database that you would post the imdb video url into. There is no way that I know to pull any trailers from the OMDB, so your var $_data->imdbVideo has no value. My code is custom all over the place so its kind of hard to show you exactly what I've done, but this will get you going
   if ($row["trailers"]) { //eg: https://www.imdb.com/video/vi612877081?playlistId=tt7991608
$IMDBurl = $row["trailers"];
$trailer = explode('/', $IMDBurl);
$video2 = strtok($trailer[4],'?');
?>
      <div class="tablet">
  <center><iframe src="https://www.imdb.com/videoembed/<?php echo $video2; ?>"></iframe></center><br />
</div><?php
  }
   else {
$imdb_image = ("/images/imdb_trailers.png");
echo '<p valign="top" align="right"><img width="271" height="159" src='.$imdb_image.'></p>';
echo '<p align="center">'.'<br><br>'.'</p>';  
}

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 2023-03-26 17:21:17
2023-03-26 17:53:22

Thank you very much but where do I have to put this code because when I put it below the imdb function I have a square without the video and when I put it in the imdb code there is a bug and a blank page  ðŸ˜•
2023-03-26 19:22:32
not sure if this helps, but heres my entire code. lIke I mentioned, mine is custom, but its reasonably similar
$TTIMDB = new TTIMDB;

if ((($_data = $TTCache->Get("imdb/$id", 900)) === false) && ($_data = $TTIMDB->Get($row['imdb'])))
{
        $_data->Poster = $TTIMDB->getImage($_data->Poster, $id);
// $updateset[] = "image1 = " . sqlesc($image);

        if ( ! isset( $_data->imdbTime ) )
        {
                $_data->imdbTime = time();
               
                $_data->Alias = 'N/A';
               
                $_data->imdbVideo = null;
        }


//SQL_Query_exec("UPDATE `torrents` SET `image1` = '" . $_data->Poster . "' WHERE `id` = $id");
// below is how the posters get added to the image 1 of the imdb
         if (($imdb_image = $TTIMDB->getImage_1($_data->Poster, $site_config['torrent_dir'] . "/images/", $id))) {
           SQL_Query_exec("UPDATE `torrents` SET `image1` = '" . $imdb_image . "' WHERE `id` = $id");
 }

/////ADD a description pulled from the IMDB plot and put it in mysql as the descr
if ($row['descr'] === DEFAULT_DESCRIPTION) {
$stmt = $GLOBALS['DBconnector']->prepare('UPDATE `torrents` SET `descr` = ? WHERE `id` = ?');
$stmt->bind_param('si', $_data->Plot, $id);
$stmt->execute();
$stmt->close();
}

////ADD genre pulled from the IMDB and put it in the stupid database as genre
if (is_null($row["genre"])) {
   $genre = explode(',', $_data->Genre)[0];
   $stmt = $GLOBALS["DBconnector"]->prepare("UPDATE `torrents` SET `genre` = ? WHERE `id` = ?");
   $stmt->bind_param("si", $genre, $id);
   $stmt->execute();
$stmt->close();
}
// if ($row["genre"] === NULL) {
// $genre = explode(',', $_data->Genre)[0];
// $escapedGenre = mysqli_real_escape_string($GLOBALS["DBconnector"], $genre);
// SQL_Query_exec("UPDATE `torrents` SET `genre` = '$escapedGenre' WHERE `id` = $id");
//   }
 $TTCache->Set("imdb/$id", $_data, 900);
}

/////IMDB details layout
if ( is_object($_data) ): ?>
<fieldset class="download">
<legend><b><?php echo T_("IMDB_SHORT"); ?> - <?php echo $_data->Title; ?></b></legend>                                                          
<table border="0" cellpadding="3" cellspacing="2" width="100%">
<tr>
        <td width="230"><img src="<?php echo $_data->Poster; ?>" class="youtube" alt="<?php echo $_data->Title; ?>" title="<?php echo $_data->Title; ?>" height="317px" width="214px" /></td>
        <td valign="top">
        <b><?php echo T_("IMDB_LINK"); ?></b><br /> <a href="<?php echo $row['imdb']; ?>" target="_blank"><?php echo htmlspecialchars($row['imdb']); ?></a><br /><br />
        <b><?php echo T_("IMDB_RATED"); ?></b><br /> <?php echo $TTIMDB->getRated( $_data->Rated ); ?><br /><br />  
        <b><?php echo T_("IMDB_RELEASED"); ?></b><br /> <?php echo $TTIMDB->getReleased($_data->Released); ?><br /><br />
        <b><?php echo T_("IMDB_YEAR"); ?></b><br /> <?php echo $_data->Year; ?><br /><br />
        <b><?php echo T_("IMDB_RUNTIME"); ?></b><br /> <?php echo $_data->Runtime; ?><br /><br />
        <b><?php echo T_("IMDB_GENRE"); ?></b><br /> <?php echo $_data->Genre; ?><br /><br />
        <b><?php echo T_("IMDB_DIRECTOR"); ?></b><br /> <?php echo $_data->Director; ?><br /><br />
        <b><?php echo T_("IMDB_WRITER"); ?></b><br /> <?php echo $_data->Writer; ?><br /><br />
        <b><?php echo T_("IMDB_ACTORS"); ?></b><br /> <?php echo $_data->Actors; ?><br /><br />
        <b><?php echo T_("IMDB_PLOT"); ?></b><br /> <?php echo $_data->Plot; ?>
        </td>
<!-- below is commented to only use the star images. If reversing, dont forget to remove one endif; located below -->
        <!-- <?php // if  (($rating = $TTIMDB->getRating($_data->imdbRating)) !== null): ?>
        <td valign="top" align="right">
<?php /*?>         <?php echo $rating; ?><br />
<?php */?>
<b><?php echo T_("IMDB_RATING"); ?></b> <?php echo $_data->imdbRating; ?><br />
        <br />
        <b><?php echo T_("IMDB_VOTES"); ?></b> <?php echo $_data->imdbVotes; ?><br /><br /><b><b> -->
<!-- end comments -->

<?php $imdb_star = ("/images/imdb/imdb_gold_star.png"); ?>
        <td valign="top" align="right">
        <?php echo '<div style="font-size:2.75em;font-weight:bold;"><img width="60" height="60" style="vertical-align:middle" src='.$imdb_star.'>'.$_data->imdbRating.'</div>'?>
        <b><?php echo T_("IMDB_VOTES"); ?></b> <?php echo $_data->imdbVotes; ?><br /><br /><b><b>

<!--trailer code for both IMDB and traileraddicts -->
       
<style>
.tablet {
   width:488px;
   height: 326px;
   background-size: 100% 100%;
   background-repeat: no-repeat;
   background-image: url(images/imdb/tv.png)  
}

.tablet iframe {
 position: relative;
 top: 34px;
 left: 0px;
 width: 442px;
 height: 235px;
 border: 0 none;
 }
</style>

        <?php

  if ($row["trailers"]) { //eg: https://www.imdb.com/video/vi612877081?playlistId=tt7991608
$IMDBurl = $row["trailers"];
$trailer = explode('/', $IMDBurl);
$video2 = strtok($trailer[4],'?');
?>
      <div class="tablet">
  <center><iframe src="https://www.imdb.com/videoembed/<?php echo $video2; ?>"></iframe></center><br />
</div><?php
  }
   else {
$imdb_image = ("/images/imdb_trailers.png");
echo '<p valign="top" align="right"><img width="271" height="159" src='.$imdb_image.'></p>';
echo '<p align="center">'.'<br><br>'.'</p>';  
}
/*
$string=$_data->imdbID;
$string=substr($string,2);
$trailerkey = $site_config['TRAILERADDICT'];
$upcoming = simplexml_load_file("http://api.traileraddict.com/?imdb=".$string."&count=1&width=480&k=".$trailerkey."");

foreach($upcoming->trailer as $x => $updates)
{

echo '<p valign="top" align="left">'.$updates->embed.'</p>';
echo '<p valign="top" align="right">'.$updates->title.'</p>';
echo '<p align="center">'.'<br><br>'.'</p>';  
   }} */
/////end trailer code

   ?>
        </b></b>
        </td>

</tr>
<tr>
        <td align="right" colspan="3">
        <b><?php echo T_("IMDB_LASTUPDATED"); ?></b> <i><?php echo $TTIMDB->getUpdated($_data->imdbTime); ?></i>
        </td>
</tr>
</table>
</fieldset><br />

<?php  endif;
?>

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 2023-03-26 19:26:35
2023-03-27 15:24:41
Thank you very much for your help MicroMonkey but when I edit your code I have a blank page with an error , ...   HTTP ERROR 500   😲
2023-03-27 23:06:59
I didnt think it would a drop in replacement for anything. You can reference it, and see what I did on this file, and adjust using snippets for your specific needs rather than rewriting it. Its hard for me to take my custom code and downgrade it to match clean code for easy use, all I can do is provide the raw code and maybe some help as you go if I can. There are some things that are semi original, but alot of things that are not. I appologise and I hope you can get it working. Here is my full torrents-details page. https://pastebin.com/CVdvdkkB One thing you can try if you want to, is download my older micro edition. It has alot of this already done, and I can help with my updated edits, since I have done quite a bit since I shared that. But that copy is still available on sourceforge. Check the downloads area for TTv3
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 2023-03-27 23:12:32
2023-04-04 17:17:31
thank you for your help and for the information MicroMonkey I will watch this weekend after work I will have more time  ðŸ˜€
2026-07-24 05:53:46
plz update subject
i lost many code
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