Re: [TBDEV]IMDB Mod
im getting this:
Code:
not valid imdbID:
0not valid imdbID:
0not valid imdbID:
0
my details.php:
Code:
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 .= "\n";
$s .= "User/IP | " .
"Connectable | ".
"Uploaded | ".
"Rate | ".
"Downloaded | " .
"Rate | " .
"Ratio | " .
"Complete | " .
"Connected | " .
"Idle | " .
"Client | \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 .= "\n";
if ($una["username"])
$s .= "$una[username] | \n";
else
$s .= "" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . " | \n";
$secs = max(1, ($now - $e["st"]) - ($now - $e["la"]));
$revived = $e["revived"] == "yes";
$s .= "" . ($e[connectable] == "yes" ? "Yes" : "No") . " | \n";
$s .= "" . mksize($e["uploaded"]) . " | \n";
$s .= "" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s | \n";
$s .= "" . mksize($e["downloaded"]) . " | \n";
if ($e["seeder"] == "no")
$s .= "" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s | \n";
else
$s .= "" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e[st])) . "/s | \n";
if ($e["downloaded"])
{
$ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000;
$s .= "" . number_format($ratio, 3) . " | \n";
}
else
if ($e["uploaded"])
$s .= "Inf. | \n";
else
$s .= "--- | \n";
$s .= "" . sprintf("%.2f%%", 100 * (1 - ($e["to_go"] / $torrent["size"]))) . " | \n";
$s .= "" . mkprettytime($now - $e["st"]) . " | \n";
$s .= "" . mkprettytime($now - $e["la"]) . " | \n";
$s .= "" . htmlspecialchars(getagent($e["agent"])) . " | \n";
$s .= " \n";
}
$s .= " \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("Successfully uploaded!\n");
print("
You can start seeding now. Note that the torrent won't be visible until you do that!\n");
}
elseif ($_GET["edited"]) {
print("Successfully edited!\n");
if (isset($_GET["returnto"]))
print("
Go back to whence you came.\n");
}
elseif (isset($_GET["searched"])) {
print("Your search for \"" . htmlspecialchars($_GET["searched"]) . "\" gave a single result:\n");
}
elseif ($_GET["rated"]) {
print("Rating added!\n");
}
elseif ($_GET["thanks"])
print("Thanks added!\n");
$s=$row["name"];
print("$s\n");
print("\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]";
// tr("Name", $s, 1);
if ($CURUSER["id"] == $row["owner"]) $CURUSER["downloadpos"] = "yes";
if ($CURUSER["downloadpos"] != "no")
{
print(" | " . htmlspecialchars($row["filename"]) . " | ");
// 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("Description: klappe_news('a1')\">
| " . str_replace(array("\n", " "), array("
\n", " "), format_comment(htmlspecialchars($row["descr"]))) . " | \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:", "", 1);
else
tr("YouTube", "", 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", "", 1);
//auto imdb mod
if (($row["url"] != "")AND(strpos($row["url"], imdb))AND(strpos($row["url"], title)))
echo "";
{
$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 = "#######################################################################
\n";
$autodata .= "Information:
\n";
$autodata .= "#######################################################################
\n";
$autodata .= " Title: " . "".$movie->title ()."
\n";
$autodata .= " Also known as: ";
foreach ( $movie->alsoknow() as $ak){
$autodata .= "".$ak["title"]."" . "".$ak["year"]."" . "".$ak["country"]."" . " (" . "".$ak["comment"]."" . ")" . ", ";
}
$autodata .= "
\n Year: " . "".$movie->year ()."
\n";
$autodata .= " Runtime: " . "".$movie->runtime ()."" . " mins
\n";
$autodata .= " Votes: " . "".$movie->votes ()."
\n";
$autodata .= " Rating: " . "".$movie->rating ()."
\n";
$autodata .= " Language: " . "".$movie->language ()."
\n";
$autodata .= " Country: ";
for ($i = 0; $i + 1 < count ($country); $i++) {
$autodata .="$country[$i], ";
}
$autodata .= "$country[$i]";
$autodata .= "
\n All Genres: ";
for ($i = 0; $i + 1 < count($gen); $i++) {
$autodata .= "$gen[$i], ";
}
$autodata .= "$gen[$i]";
$autodata .= "
\n Tagline: " . "".$movie->tagline ()."
\n";
$autodata .= " Director: ";
for ($i = 0; $i < count ($director); $i++) {
$autodata .= "" . "".$director[$i]["name"]."" . " ";
}
$autodata .= "
\n Writing By: ";
for ($i = 0; $i < count ($write); $i++) {
$autodata .= "" . "".$write[$i]["name"]."" . " ";
}
$autodata .= "
\n Produced By: ";
for ($i = 0; $i < count ($produce); $i++) {
$autodata .= "" . "".$produce[$i]["name"]."" . " ";
}
$autodata .= "
\n Music: ";
for ($i = 0; $i < count($compose); $i++) {
$autodata .= "" . "".$compose[$i]["name"]."" . " ";
}
$autodata .= "
\n\n#######################################################################
\n";
$autodata .= " Description:
\n";
$autodata .= "#######################################################################";
for ($i = 0; $i < count ($plot); $i++) {
$autodata .= "
\n
joeroberts |
5th July 2008 14:40 |
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
|
NatashaRhea |
6th September 2008 21:13 |
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 :drink::hi::superstition:
|
Ingvar |
9th May 2009 02:41 |
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.
|
tekmobile |
2nd May 2010 14:08 |
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:
$autodata .= "<a rel="nofollow"
changed to
PHP Code:
$autodata .= "<a rel=\"nofollow\"
after correcting this it does seem to work okay
|
rabtb |
8th October 2010 04:08 |
posters not working now iv noticed on alot of sites there missing anyone got a fix for it yet ?
|
All times are GMT +2. The time now is 09:37. |
|
Powered by vBulletin® Version 3.8.11 Beta 3 Copyright ©2000 - 2024, vBulletin Solutions Inc.
|