|
#1
|
||||
|
||||
IMDB Mod
MOD UPDATED 18.09.2008
Uploader fills in torrent URL with correct imdb link. Then when people look at torrent details imdb info appears. If uploader fills something else then nothing happens. The class have cache, so only the first time data is grabbed, then its local. REQUIREMENTS: PHP-PEAR - go to imdb folder and edit imdb_config.php . There is a value for pear set to false. Or install pear! First you will need this php class : http://projects.izzysoft.de/progs/imdbphp/files.php Make a directory called imdb into the main (root) dir of your tracker Extract the archive there. Open details.php and below: Code:
require_once("include/bittorrent.php"); Code:
require ("imdb/imdb.class.php"); In the extracted files there is a imdb_config.php file, you have to edit it to match your files path Open details.php and after: PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
#2
|
|||
|
|||
Re: [TBDEV]IMDB Mod
Does this mod work with torrentstrike ?
|
#3
|
||||
|
||||
Re: [TBDEV]IMDB Mod
Quote:
:warrior: |
The Following User Says Thank You to Fynnon For This Useful Post: | ||
Corli (31st December 2008)
|
#4
|
|||
|
|||
Re: [TBDEV]IMDB Mod
yes it does, i installed it on my torrentstrike.
|
#5
|
|||
|
|||
Re: [TBDEV]IMDB Mod
im getting this:
Code:
not valid imdbID: 0not valid imdbID: 0not valid imdbID: 0 my details.php: Code:
<?php ob_start("ob_gzhandler"); require_once("include/bittorrent.php"); require ("imdb/imdb.class.php"); include("include/rating_functions.php"); function getagent($httpagent) { if (preg_match("/^Azureus ([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)/", $httpagent, $matches)) return "Azureus/$matches[1]"; elseif (preg_match("/BitTorrent\\/S-([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) return "Shadow's/$matches[1]"; elseif (preg_match("/BitTorrent\\/U-([0-9]+\\.[0-9]+\\.[0-9]+)/", $httpagent, $matches)) return "UPnP/$matches[1]"; elseif (preg_match("/^BitTorrent\\/T-(.+)$/", $httpagent, $matches)) return "BitTornado/$matches[1]"; elseif (preg_match("/^BitTorrent\\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) return "BitTorrent/$matches[1]"; elseif (preg_match("/^Python-urllib\\/.+?, BitTorrent\\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) return "BitTorrent/$matches[1]"; elseif (ereg("^BitTorrent\\/BitSpirit$", $httpagent)) return "BitSpirit"; elseif (preg_match("/^BitTorrent\\/brst(.+)/", $httpagent, $matches)) return "Burst/$matches[1]"; elseif (preg_match("/^RAZA (.+)$/", $httpagent, $matches)) return "Shareaza/$matches[1]"; else return "---"; } function dltable($name, $arr, $torrent) { global $CURUSER; $s = "" . count($arr) . " $name\n"; if (!count($arr)) return $s; $s .= "\n"; $s .= "<table width=100% class=main border=1 cellspacing=0 cellpadding=5>\n"; $s .= "<tr><td class=colhead>User/IP</td>" . "<td class=colhead align=center>Connectable</td>". "<td class=colhead align=right>Uploaded</td>". "<td class=colhead align=right>Rate</td>". "<td class=colhead align=right>Downloaded</td>" . "<td class=colhead align=right>Rate</td>" . "<td class=colhead align=right>Ratio</td>" . "<td class=colhead align=right>Complete</td>" . "<td class=colhead align=right>Connected</td>" . "<td class=colhead align=right>Idle</td>" . "<td class=colhead align=left>Client</td></tr>\n"; $now = time(); $moderator = (isset($CURUSER) && get_user_class() >= UC_MODERATOR); $mod = get_user_class() >= UC_MODERATOR; foreach ($arr as $e) { // user/ip/port // check if anyone has this ip ($unr = mysql_query("SELECT username, privacy FROM users WHERE id=$e[userid] ORDER BY last_access DESC LIMIT 1")) or die; $una = mysql_fetch_assoc($unr); if ($una["privacy"] == "strong") continue; $s .= "<tr>\n"; if ($una["username"]) $s .= "<td><a href=userdetails.php?id=$e[userid]>$una[username]</a></td>\n"; else $s .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . "</td>\n"; $secs = max(1, ($now - $e["st"]) - ($now - $e["la"])); $revived = $e["revived"] == "yes"; $s .= "<td align=center>" . ($e[connectable] == "yes" ? "Yes" : "<font color=red>No</font>") . "</td>\n"; $s .= "<td align=right>" . mksize($e["uploaded"]) . "</td>\n"; $s .= "<td align=right><nobr>" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</nobr></td>\n"; $s .= "<td align=right>" . mksize($e["downloaded"]) . "</td>\n"; if ($e["seeder"] == "no") $s .= "<td align=right><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</nobr></td>\n"; else $s .= "<td align=right><nobr>" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e[st])) . "/s</nobr></td>\n"; if ($e["downloaded"]) { $ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000; $s .= "<td align=\"right\"><font color=" . get_ratio_color($ratio) . ">" . number_format($ratio, 3) . "</font></td>\n"; } else if ($e["uploaded"]) $s .= "<td align=right>Inf.</td>\n"; else $s .= "<td align=right>---</td>\n"; $s .= "<td align=right>" . sprintf("%.2f%%", 100 * (1 - ($e["to_go"] / $torrent["size"]))) . "</td>\n"; $s .= "<td align=right>" . mkprettytime($now - $e["st"]) . "</td>\n"; $s .= "<td align=right>" . mkprettytime($now - $e["la"]) . "</td>\n"; $s .= "<td align=left>" . htmlspecialchars(getagent($e["agent"])) . "</td>\n"; $s .= "</tr>\n"; } $s .= "</table>\n"; return $s; } dbconn(false); loggedinorreturn(); $id = 0 + $_GET["id"]; if (!isset($id) || !$id) die(); $res = mysql_query("SELECT torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.points, LENGTH(torrents.nfo) AS nfosz, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.url, torrents.poster, torrents.tube, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, categories.name AS cat_name, users.username FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id") or sqlerr(); $row = mysql_fetch_assoc($res); $owned = $moderator = 0; if (get_user_class() >= UC_MODERATOR) $owned = $moderator = 1; elseif ($CURUSER["id"] == $row["owner"]) $owned = 1; //} if (!$row || ($row["banned"] == "yes" && !$moderator)) stderr("Error", "No torrent with ID."); else { if ($_GET["hit"]) { mysql_query("UPDATE torrents SET views = views + 1 WHERE id = $id"); if ($_GET["tocomm"]) header("Location: $BASEURL/details.php?id=$id&page=0#startcomments"); elseif ($_GET["filelist"]) header("Location: $BASEURL/details.php?id=$id&filelist=1#filelist"); elseif ($_GET["toseeders"]) header("Location: $BASEURL/details.php?id=$id&dllist=1#seeders"); elseif ($_GET["todlers"]) header("Location: $BASEURL/details.php?id=$id&dllist=1#leechers"); else header("Location: $BASEURL/details.php?id=$id"); exit(); } if (!isset($_GET["page"])) { stdhead("Details for torrent \"" . $row["name"] . "\""); if ($CURUSER["id"] == $row["owner"] || get_user_class() >= UC_MODERATOR) $owned = 1; else $owned = 0; $spacer = ""; if ($_GET["uploaded"]) { print("<h2>Successfully uploaded!</h2>\n"); print(" You can start seeding now. Note that the torrent won't be visible until you do that!</p>\n"); } elseif ($_GET["edited"]) { print("<h2>Successfully edited!</h2>\n"); if (isset($_GET["returnto"])) print(" Go back to <a href=\"" . htmlspecialchars("{$BASEURL}/{$_GET['returnto']}") . "\">whence you came</a>.</p>\n"); } elseif (isset($_GET["searched"])) { print("<h2>Your search for \"" . htmlspecialchars($_GET["searched"]) . "\" gave a single result:</h2>\n"); } elseif ($_GET["rated"]) { print("<h2>Rating added!</h2>\n"); } elseif ($_GET["thanks"]) print("<h2>Thanks added!</h2>\n"); $s=$row["name"]; print("<h1>$s</h1>\n"); print("<table width=750 border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n"); $url = "edit.php?id=" . $row["id"]; if (isset($_GET["returnto"])) { $addthis = "&returnto=" . urlencode($_GET["returnto"]); $url .= $addthis; $keepget .= $addthis; } $editlink = "a href=\"$url\" class=\"sublink\""; // $s = "" . htmlspecialchars($row["name"]) . ""; // if ($owned) // $s .= " $spacer<$editlink>[Edit torrent]</a>"; // tr("Name", $s, 1); if ($CURUSER["id"] == $row["owner"]) $CURUSER["downloadpos"] = "yes"; if ($CURUSER["downloadpos"] != "no") { print("<tr><td class=rowhead width=1%><img src=pic/download.jpg></td><td width=99% align=left><a class=\"index\" href=\"download.php/$id/" . rawurlencode($row["filename"]) . "\">" . htmlspecialchars($row["filename"]) . "</a></td></tr>"); // tr("Downloadsas", $row["save_as"]); /// Mod by dokty - tbdev.net $blasd = mysql_query("SELECT points FROM coins WHERE torrentid=$id AND userid=".$CURUSER["id"]); $sdsa = mysql_fetch_assoc($blasd) or $sdsa["points"] = 0; tr("Points","In total ".$row["points"]." Points given to this torrent of which ".$sdsa["points"]." from you. By clicking on the coins you can give points to the uploader of this torrent. ", 1); function hex_esc($matches) { return sprintf("%02x", ord($matches[0])); } tr("Info hash", preg_replace_callback('/./s', "hex_esc", hash_pad($row["info_hash"]))); } else { tr("Download", "You are not allowed to download"); } print("<tr valign=top><td class=rowhead>Description<a href=\"javascript: klappe_news('a1')\"> <img border=\"0\"src=\"pic/show.gif\" id=\"pica".$array['id']."\" alt=\"[Hide/Show]\"></td><td align=left><div id=\"ka1\" style=\"display: none;\">" . str_replace(array("\n", " "), array(" \n", " "), format_comment(htmlspecialchars($row["descr"]))) . "</div></td></tr>\n"); #if (!empty($row["descr"])) #tr("Description", str_replace(array("\n", " "), array(" \n", " "), format_comment(htmlspecialchars($row["descr"]))), 1); if (!empty($row["tube"])) tr("Sample:", "<embed src='". str_replace("watch?v=", "v/", htmlspecialchars($row["tube"])) ."' type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed>", 1); else tr("YouTube", "<img src=pic/nosamp.jpg>", 1); if (!empty($row["poster"])) tr("Picture", "[img]".$row["poster"]."[/img] Click For Full Picture", 1); //tr("Picture", "[img]".$row["poster"]."[/img]", 1); else tr("Picture", "<img src=poster.jpg>", 1); //auto imdb mod if (($row["url"] != "")AND(strpos($row["url"], imdb))AND(strpos($row["url"], title))) echo "<script type=\"text/javascript\" src=\"imdb/swfobject.js\"></script>"; { $thenumbers = ltrim(strrchr($row["url"],'tt'),'tt'); $thenumbers = ereg_replace("[^A-Za-z0-9]", "", $thenumbers); $movie = new imdb ($thenumbers); $movieid = $thenumbers; $movie->setid ($movieid); $country = $movie->country (); $director = $movie->director(); $write = $movie->writing(); $produce = $movie->producer(); $cast = $movie->cast(); $plot = $movie->plot (); $compose = $movie->composer(); $gen = $movie->genres(); $trailer = $movie->trailer(); if (($photo_url = $movie->photo_localurl() ) != FALSE) { $smallth = '[img]'.$photo_url.'[/img]'; } $autodata = "<font color=\"navy\">#######################################################################</font> \n"; $autodata .= "<font color=\"darkred\" size=\"3\">Information:</font> \n"; $autodata .= "<font color=\"navy\">#######################################################################</font> \n"; $autodata .= "<font color=\"DarkRed\"> Title: </font>" . "".$movie->title ()." \n"; $autodata .= "<font color=\"DarkRed\"> Also known as: </font>"; foreach ( $movie->alsoknow() as $ak){ $autodata .= "".$ak["title"]."" . "".$ak["year"]."" . "".$ak["country"]."" . " (" . "".$ak["comment"]."" . ")" . ", "; } $autodata .= " \n<font color=\"DarkRed\"> Year: </font>" . "".$movie->year ()." \n"; $autodata .= "<font color=\"DarkRed\"> Runtime: </font>" . "".$movie->runtime ()."" . " mins \n"; $autodata .= "<font color=\"DarkRed\"> Votes: </font>" . "".$movie->votes ()." \n"; $autodata .= "<font color=\"DarkRed\"> Rating: </font>" . "".$movie->rating ()." \n"; $autodata .= "<font color=\"DarkRed\"> Language: </font>" . "".$movie->language ()." \n"; $autodata .= "<font color=\"DarkRed\"> Country: </font>"; for ($i = 0; $i + 1 < count ($country); $i++) { $autodata .="$country[$i], "; } $autodata .= "$country[$i]"; $autodata .= " \n<font color=\"DarkRed\"> All Genres: </font>"; for ($i = 0; $i + 1 < count($gen); $i++) { $autodata .= "$gen[$i], "; } $autodata .= "$gen[$i]"; $autodata .= " \n<font color=\"DarkRed\"> Tagline: </font>" . "".$movie->tagline ()." \n"; $autodata .= "<font color=\"DarkRed\"> Director: </font>"; for ($i = 0; $i < count ($director); $i++) { $autodata .= "<a target=\"_blank\" href=\"http://us.imdb.com/Name?" . "".$director[$i]["imdb"]."" ."\">" . "".$director[$i]["name"]."" . "</a> "; } $autodata .= " \n<font color=\"DarkRed\"> Writing By: </font>"; for ($i = 0; $i < count ($write); $i++) { $autodata .= "<a target=\"_blank\" href=\"http://us.imdb.com/Name?" . "".$write[$i]["imdb"]."" ."\">" . "".$write[$i]["name"]."" . "</a> "; } $autodata .= " \n<font color=\"DarkRed\"> Produced By: </font>"; for ($i = 0; $i < count ($produce); $i++) { $autodata .= "<a target=\"_blank\" href=\"http://us.imdb.com/Name?" . "".$produce[$i]["imdb"]."" ." \">" . "".$produce[$i]["name"]."" . "</a> "; } $autodata .= " \n<font color=\"DarkRed\"> Music: </font>"; for ($i = 0; $i < count($compose); $i++) { $autodata .= "<a target=\"_blank\" href=\"http://us.imdb.com/Name?" . "".$compose[$i]["imdb"]."" ." \">" . "".$compose[$i]["name"]."" . "</a> "; } $autodata .= " \n\n<font color=\"navy\">#######################################################################</font> \n"; $autodata .= "<font color=\"darkred\" size=\"3\"> Description:</font> \n"; $autodata .= "<font color=\"navy\">#######################################################################</font>"; for ($i = 0; $i < count ($plot); $i++) { $autodata .= " \n<font color=\"DarkRed\"> |
#6
|
||||
|
||||
Re: [TBDEV]IMDB Mod
lol works on PMBT with allot of modding only error is the trailers dont work as they change the links all the time because the advertizing
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#7
|
|||
|
|||
wow thanks i didnt realize i could put xampp on pc thanks for the information saves me crashing the server each time i make mistakes :hi::superstition:
|
#8
|
|||
|
|||
Looking for someone to put IMDB mod on my TBSource tracker, its mostly translated in Icelandic. (not codes tho)
Will pay for the work, need this mod and 3-4 others. |
#9
|
|||
|
|||
Just been looking to see if this would work with TS 0.5 and found that I was getting parse errors so looked through the code and noticed that the quotes around the nofollow were not escaped in the code for details.php
PHP Code:
PHP Code:
Last edited by tekmobile; 2nd May 2010 at 18:12. |
The Following User Says Thank You to tekmobile For This Useful Post: | ||
nicukent (24th February 2015)
|
Tags |
imdb , mod , rating |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
IMDB Mod | kp380lv | Mods & Themes | 4 | 14th August 2015 08:47 |
Dead IMDB rating | proba10 | Community Cafe | 2 | 7th January 2010 15:24 |
[xbtit] Grab IMDB information in torrent's details | Duvelske | xBTiT | 0 | 26th July 2009 16:42 |
Help me Imdb | scream21m | Yuna Scatari Edition (YSE) | 1 | 8th May 2009 11:01 |
iMDB, Discogs, Amazon - Indexes Post Here!! | dezza | Community Cafe | 1 | 31st October 2008 22:39 |