add sql
Code:
ALTER TABLE torrents ADD imdb varchar(125) NOT NULL DEFAULT;
torrents-upload.php
find
Code:
$ret = SQL_Query_exec("INSERT INTO torrents
look for
add
same line find
Code:
'".get_date_time()."'
add
Code:
, ".sqlesc($imdb).")"
also add above that query
Code:
$imdb = $_POST['imdb'];
find
Code:
show_error_msg(T_("UPLOAD_FAILED"), T_("UPLOAD_ALREADY_UPLOADED"), 1);
add below
Code:
require_once('backend/IMDB.class.php');
$IMDB = new IMDB;
if (($data = $IMDB->get($_POST['imdb'])) && ($image = $IMDB->getImage($data->Poster, $site_config["torrent_dir"] . "/images/", $id)))
{
SQL_Query_exec("UPDATE `torrents` SET `image1` = '$image' WHERE `id` = '$id'");
}
find
Code:
print ("<tr><td align='right'>" . T_("TORRENT_NAME") . ": </td><td align='left'><input type='text' name='name' size='60' value='" . $_POST['name'] . "' /><br />".T_("THIS_WILL_BE_TAKEN_TORRENT")." \n</td></tr>");
add below
Code:
print ("<tr><td align='right'>".T_("IMDB")."</td><td align='left'><input type='text' name='imdb' size='60' value='" . $_POST['imdb'] . "' /><br /><i>".T_("IMDB_INFO")."</i></td></tr>");
torrents-edit.php
find
Code:
echo "<tr><td align='right'><b>".T_("CATEGORIES").": </b></td><td>".$catdropdown."</td></tr>";
add above
Code:
echo "<tr><td align='right'><b>".T_("IMDB")."</b></td><td><input type='text' name='imdb' size='60' value='".$row['imdb']."' /><br /><i>".T_("IMDB_INFO")."</i></td></tr>";
find
Code:
$updateset[] = "name = " . sqlesc($_POST["name"]);
add below
Code:
# Resync IMDB Data...
if ($_POST['imdb'] != $row['imdb'])
{
$TTCache->Delete("imdb/$row[id]");
$updateset[] = 'imdb = ' . sqlesc($_POST['imdb']);
require_once('backend/IMDB.class.php');
$IMDB = new IMDB;
if (($data = $IMDB->get($_POST['imdb'])) && ($image = $IMDB->getImage($data->Poster, $site_config["torrent_dir"] . "/images/", $id)))
{
$updateset[] = "image1 = " . sqlesc($image);
}
}
torrent-details.php
find
make look like
Code:
torrents.imdb, torrents.anon,
same line
find
make look like
Code:
torrents.imdb, torrents.name,
where want to show
Code:
/////////////////////////////////////////////////////////
require_once('backend/IMDB.class.php');
$IMDB = new IMDB;
$data = null;
if ((($data = $TTCache->get("imdb/$id", 86400)) === false) && ($data = $IMDB->get($row['imdb'])))
{
$TTCache->Set("imdb/$id", $data, 86400);
}
if (($data != null) && (is_object($data))):
?>
<table class="imdb-table">
<tbody>
<tr>
<th class="imdb-th" align="center" colspan="3"><?php echo $data->Title; ?></th>
</tr>
<?
if ($row["image1"] != "" OR $row["image2"] != "") {
if ($row["image1"] != "")
$img1 = "<tr class='imdb-name'><td class='imdb-photo' rowspan='10'>
<a href='".$site_config["SITEURL"]."/uploads/images/$row[image1]' class='highslide' onclick='return hs.expand(this)'><img src='".$site_config["SITEURL"]."/uploads/images/$row[image1]' border='0' title='Click to enlarge' style='max-width: 160px;' class='image-resize' /></a>
</td>";
print("". $img1 . "");
}
?>
<?
$image = null;
if ( is_numeric($data->Rating) )
{
$rating = $data->Rating * 10;
$rating = round($rating / 5) * 5;
$image = '<img src="http://www.bvlist.com/images/imdb/' . $rating . '.gif" alt="' . $data->Rating. '" title="' . $data->Rating . '" />';
}
?>
<td class="imdb-name first-row"><?php echo T_("IMDB_RATING"); ?></td>
<td class="imdb-value first-row">
<div class="imdb-score"><?php echo $data->Rating; ?></div>
<div class="imdb-rating"><?php echo $image != null ? $image : $data->Rating; ?></div>
<div class="imdb-voters"><?php echo $data->Votes; ?> people voted.</div>
</td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_RELEASED"); ?></td>
<td class="imdb-value"><?php echo $data->Released; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_GENRE"); ?></td>
<td class="imdb-value"><?php echo $data->Genre; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_ACTORS"); ?></td>
<td class="imdb-value"><?php echo $data->Actors; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_DIRECTOR"); ?></td>
<td class="imdb-value"><?php echo $data->Director; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_WRITER"); ?></td>
<td class="imdb-value"><?php echo $data->Writer; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_RUNTIME"); ?></td>
<td class="imdb-value"><?php echo $data->Runtime; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_PLOT"); ?></td>
<td class="imdb-value"><?php echo $data->Plot; ?></td>
</tr>
<tr class="imdb-name">
<td class="imdb-name"><?php echo T_("IMDB_LINK"); ?></td>
<td class="imdb-value"><a class="imdb-link" target="_blank" style="color: blue;" href=<?php echo "".$row['imdb']."";?>><?php echo "".$row['imdb']."";?></a></td>
</tr>
</tbody>
</table>
<br /><br />
<?php
endif;
this is mine written/stolen from ipts imdb design. all credit goes to TorrentTrader.
add IMDB.class.php too backend/
add imdb/ to images
add rating.png to theme/theme_name/images