Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   IMDB Mod (http://www.bvlist.com/showthread.php?t=139)

Fynnon 26th January 2008 20:12

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");
ad this:
Code:

require ("imdb/imdb.class.php");
Edit imdb_config.class.php in the imdb folder with the correct parameters!!!
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:

if (!empty($row["poster"]))
               
tr("Poster""<img src='".$row["poster"]."'>"1); 

Add this:
PHP Code:

//auto imdb mod
if (($row["url"] != "")AND(strpos($row["url"], imdb))AND(strpos($row["url"], title)))
{
$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();
$plotoutline $movie->plotoutline();
$trailers $movie->trailers();
$mvlang $movie->language();
$mvrating $movie->rating();

if ((
$photo_url $movie->photo_localurl() ) != FALSE) {
$smallth '<img src="'.$photo_url.'">';
}

$autodata "<strong><font color=\"navy\">#######################################################################</font>\n";
$autodata .= "<font color=\"darkred\" size=\"3\">Information:</font>\n";
$autodata .= "<font color=\"navy\">#######################################################################</font></strong>\n";
$autodata .= "<strong><font color=\"DarkRed\"> Title: </font></strong>" "".$movie->title()."\n";
$autodata .= "<strong><font color=\"DarkRed\"> Year: </font></strong>" "".$movie->year()."\n";
$autodata .= "<strong><font color=\"DarkRed\"> Runtime: </font></strong>" "".$movie->runtime()."" " mins\n";
$autodata .= "<strong><font color=\"DarkRed\"> Votes: </font></strong>" "".$movie->votes()."\n";

if (!empty(
$mvrating)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> Rating: </font></strong>" "$mvrating\n";
}

if (!empty(
$mvlang)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> Language: </font></strong>" "$mvlang\n";
}

if (!empty(
$country)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> Country: </font></strong>";
    for (
$i 0$i count ($country); $i++) {
        
$autodata .="$country[$i], ";
    }
    
$autodata .= "$country[$i]\n";
}

if (!empty(
$gen)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> All Genres: </font></strong>";
    for (
$i 0$i count($gen); $i++) {
        
$autodata .= "$gen[$i], ";
    }
    
$autodata .= "$gen[$i]\n";
}

if (!empty(
$plotoutline)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> Plot Outline: </font></strong>" "$plotoutline\n";
}

if (!empty(
$director)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> Director: </font></strong>";
    for (
$i 0$i count ($director); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$director[$i]["imdb"]."" ."\">" "".$director[$i]["name"]."" "</a>\n";
    }
}

if (!empty(
$write)) {
    
$autodata .= "<strong><font color=\"DarkRed\"> Writing By: </font></strong>";
    for (
$i 0$i count ($write); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$write[$i]["imdb"]."" ."\">" "".$write[$i]["name"]."" "</a> ";
    }
}

if (!empty(
$produce)) {
    
$autodata .= "\n<strong><font color=\"DarkRed\"> Produced By: </font></strong>";
    for (
$i 0$i count ($produce); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$produce[$i]["imdb"]."" ." \">" "".$produce[$i]["name"]."" "</a> ";
    }    
}

if (!empty(
$compose)) {
    
$autodata .= "\n<strong><font color=\"DarkRed\"> Music: </font></strong>";
    for (
$i 0$i count($compose); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$compose[$i]["imdb"]."" ." \">" "".$compose[$i]["name"]."" "</a> ";
    }
}

if (!empty(
$plot)) {
    
$autodata .= "\n\n<strong><font color=\"navy\">#######################################################################</font>\n";
    
$autodata .= "<font color=\"darkred\" size=\"3\"> Description:</font>\n";
    
$autodata .= "<font color=\"navy\">#######################################################################</font></strong>";
    for (
$i 0$i count ($plot); $i++) {
        
$autodata .= "\n<font color=\"DarkRed\">•</font> ";
        
$autodata .= "$plot[$i]";
    }
}

$autodata .= "\n\n<strong><font color=\"navy\">#######################################################################</font>\n";
$autodata .= "<font color=\"darkred\" size=\"3\"> Cast:</font>\n";
$autodata .= "<font color=\"navy\">#######################################################################</font></strong>\n";

for (
$i 0$i count ($cast); $i++) {
    if (
$i 9) {
        break;
    }
$autodata .= "<font color=\"DarkRed\">•</font> " "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$cast[$i]["imdb"]."" ."\">" "".$cast[$i]["name"]."" "</a> " " as <strong><font color=\"DarkRed\">" "".$cast[$i]["role"]."" " </font></strong>\n";
}

if (!empty(
$trailers)) {
$autodata .= "\n\n<strong><font color=\"navy\">#######################################################################</font>\n";
$autodata .= "<font color=\"darkred\" size=\"3\"> Trailers:</font>\n";
$autodata .= "<font color=\"navy\">#######################################################################</font></strong>\n";

    for (
$i=0;$i<count($trailers);++$i) {
    if (
$i 14) {
        break;
    }
      
$autodata .= "<a target=\"_blank\" href='".$trailers[$i]."'>".$trailers[$i]."</a>\n";
    }
    }
trala("Auto IMDB Info $smallth",$autodata,1);
}
//end auto imdb 

Then in bittorrent.php under:
PHP Code:

function tr($x,$y,$noesc=0) {
    if (
$noesc)
        
$a $y;
    else {
        
$a htmlspecialchars($y);
        
$a str_replace("\n""\n"$a);


    }

    print(
"<tr><td class=\"heading\" valign=\"top\" align=\"right\">$x</td><td valign=\"top\" align=left>$a</td></tr>\n");


add:
PHP Code:

function trala($x,$y,$noesc=0) {
   if (
$noesc)
       
$a $y;
   print(
"<tr><td class=\"heading\" valign=\"top\" align=\"right\">$x</td><td valign=\"top\" align=left>$a</td></tr>\n");


10x @ MaSTeRMinD - TBDEV.net

Vollari 2nd July 2008 20:50

Re: [TBDEV]IMDB Mod
 
Does this mod work with torrentstrike ?

Fynnon 2nd July 2008 23:08

Re: [TBDEV]IMDB Mod
 
Quote:

Originally Posted by Vollari
Does this mod work with torrentstrike ?

This is for TBDEV, i don`t know if it works for TorrentStrike but you can install XAMPP on your PC then install TorrentStrike and test if this mod is working then come back and tell us the result

:warrior:

allroms 2nd July 2008 23:10

Re: [TBDEV]IMDB Mod
 
yes it does, i installed it on my torrentstrike.

wMan 3rd July 2008 14:17

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 .= "" .
          "".
          "".
          "".
          "" .
          "" .
          "" .
          "" .
          "" .
          "" .
          "\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 .= "\n";
                else
                  $s .= "\n";
        $secs = max(1, ($now - $e["st"]) - ($now - $e["la"]));
        $revived = $e["revived"] == "yes";
        $s .= "\n";
        $s .= "\n";
        $s .= "\n";
        $s .= "\n";
        if ($e["seeder"] == "no")
            $s .= "\n";
        else
            $s .= "\n";
                if ($e["downloaded"])
                {
                  $ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000;
                    $s .= "\n";
                }
                  else
                  if ($e["uploaded"])
                    $s .= "\n";
                  else
                    $s .= "\n";
        $s .= "\n";
        $s .= "\n";
        $s .= "\n";
        $s .= "\n";
        $s .= "\n";
    }
    $s .= "
User/IPConnectableUploadedRateDownloadedRateRatioCompleteConnectedIdleClient
$una[username]" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . "" . ($e[connectable] == "yes" ? "Yes" : "No") . "" . mksize($e["uploaded"]) . "" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s" . mksize($e["downloaded"]) . "" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e[st])) .    "/s" . number_format($ratio, 3) . "Inf.---" . sprintf("%.2f%%", 100 * (1 - ($e["to_go"] / $torrent["size"]))) . "" . mkprettytime($now - $e["st"]) . "" . mkprettytime($now - $e["la"]) . "" . htmlspecialchars(getagent($e["agent"])) . "
\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("");
//        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("\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
" . htmlspecialchars($row["filename"]) . "
Description: klappe_news('a1')\">
\"[Hide/Show]\"
" . str_replace(array("\n", "  "), array("
\n", " "), format_comment(htmlspecialchars($row["descr"]))) . "

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 ?

wMan 7th November 2012 01:40

1 Attachment(s)
@details.php ADD ABOVE
PHP Code:

if (!empty($row["descr"])) 

PHP Code:

//----------------------------------------------------------------Auto iMDB mod by Axxel------------------------------------------------------------------
               if (($row["url"] != "")AND(strpos($row["url"], imdb))AND(strpos($row["url"], title)))
                  {
               $thenumbers = ltrim(strrchr($row["url"],'tt'),'tt');
               $thenumbers = ereg_replace("[^A-Za-z0-9]", "", $thenumbers);
               $movie = new imdb ($thenumbers);
               $movieid = $thenumbers;
               $movie->setid ($movieid);
               $plot = $movie->plot();
               $plotoutline = $movie->plotoutline();
               $gen = $movie->genres();
               $cast = $movie->cast();
               $director = $movie->director();
               $write = $movie->writing();
               $produce = $movie->producer();
               $compose = $movie->composer();

                if (($photo_url = $movie->photo_localurl() ) != FALSE) {
                $autodata = '<img class=glossy src="'.$photo_url.'" style="float:left; margin-right:5px;">';
                } else {
                $autodata = '<img  img  src="/imdb/images/default.png" style="float:left; margin-right:5px;">';
                }

               $autodata .= "<strong><a href=\"http://www.imdb.com/title/tt$movieid\"><font size=\"3\" style=\"border-bottom: 1px dotted; text-decoration: none;\">" . "".$movie->title ()."</a></font> <font size=\"3\"><b> " . "(".$movie->year ().")</b></strong></size></font>\n";
               $autodata .= "<i><font color=\"#999999\"> " . "".$movie->tagline ()."</font></i>\n";

               $autodata .= "\n<strong> Genres: </strong>";
               for ($i = 0; $i + 1 < count($gen); $i++) {
               $autodata .= "$gen[$i], ";
  }
               $autodata .= "$gen[$i]";

               $autodata .= "\n<strong> Rating: </strong>" . "".$movie->rating ()." <font size=\"1\"><u> " . "(".$movie->votes ()." votes)</size></u></font>\n";
               $autodata .= "<strong> Language: </strong>" . "".$movie->language ()."\n";

               $autodata .= "\n<strong> Runtime: </strong>" . "".$movie->runtime ()."" . " mins</strong>\n";

if (!empty($plot)) {

$autodata .= "<strong> Plot Outline: </strong>\n";

              for ($i = 0; $i < count ($plot); $i++) {
              $autodata .= "\n<font color=\"red\">[x] </font>";
              $autodata .= "$plot[$i]";
             $autodata .= "</br>\n";
break;
      }
 }


if (!empty($director)) {
    $autodata .= "<strong><font color=\"blue\"> Director: </font></strong>";
    for ($i = 0; $i < count ($director); $i++) {
        $autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "".$director[$i]["imdb"]."" ."\">" . "".$director[$i]["name"]."" . "</a>\n";
    }
}


if (!empty($write)) {
    $autodata .= "<strong><font color=\"blue\"> Writing By: </font></strong>";
    for ($i = 0; $i < count ($write); $i++) {
        $autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "".$write[$i]["imdb"]."" ."\">" . "".$write[$i]["name"]."" . "</a> ";
    }
}


if (!empty($compose)) {
    $autodata .= "\n<strong><font color=\"blue\"> Music: </font></strong>";
    for ($i = 0; $i < count($compose); $i++) {
        $autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" . "".$compose[$i]["imdb"]."" ." \">" . "".$compose[$i]["name"]."" . "</a> ";
    }
}




?>
<script type="text/javascript">
        function imdb_more(imdb_area, imdb_link) {
        var imdb_area = get_item(imdb_area);
        var imdb_link = get_item(imdb_link);

        if (imdb_area.style.display == "") {
            imdb_area.style.display = "none";
            imdb_link.innerHTML = "More";
            eraseCookie("IMDbXz");
        } else {
            imdb_area.style.display = "";
            imdb_link.innerHTML = "Less";
            createCookie("IMDbXz", "1", "100");
        }
    }
    function get_item(id){
        itm = null;
        if (document.getElementById){
            itm = document.getElementById(id);
        } else if (document.all){
            itm = document.all[id];
        } else if (document.layers) {
            itm = document.layers[id];
        }
        return itm;
    }
    function createCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(365*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }
    function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }
    function eraseCookie(name) {
        createCookie(name,"",-1);
    }
</script>
<?
              $smallth 
.= "<i><a href=\"javascript:imdb_more('imdb_area', 'imdb_link');\"><font style=\"border-bottom: 1px dotted; text-decoration: none; font-size: 7pt; color: grey;\" id=\"imdb_link\">More</font></a></i>\n";
              

$autodata .= "</br><div style=\"display:none\" id=\"imdb_area\"><strong> Cast: </strong></br>\n";

for (
$i 0$i count ($cast); $i++) {
    if (
$i 9) {
        break;
    }
$autodata .= "<font color=\"blue\"></font> " "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$cast[$i]["imdb"]."" ."\">" "".$cast[$i]["name"]."" "</a> " " as <strong><font color=\"orange\">" "".$cast[$i]["role"]."" " </font></strong></br>\n";
}


if (!empty(
$produce)) {
    
$autodata .= "\n<strong>Produced By: </strong></br>";
    for (
$i 0$i count ($produce); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$produce[$i]["imdb"]."" ." \"><font color=green>" "".$produce[$i]["name"]."" "</font></a> ";
    }
}


if (!empty(
$plot)) {
$autodata .= "<strong> Plot: </strong>\n";

              for (
$i 0$i count ($plot); $i++) {
              
$autodata .= "\n<font color=\"red\">[x] </font>";
              
$autodata .= "$plot[$i]";
             
$autodata .= "</br>\n";

     }
      }


              
tr("IMDb $smallth",$autodata,1);
}
//--------------------------------------------------------------------Auto iMDB mod end----------------------------------------------------------------------

@details.php

PHP Code:

require ("imdb/imdb.class.php"); 

0777 - imdb
0777 - imdb/images
0777 - imdb/imgs
0777 - imdb/imgs/showtimes
0777 - imdb/cache
0777 - imdb/cache.file
0777 - imdb/imdb.class.file
0777 - imdb/imdbXML.file

I UPDATED IT A FEW MONTHS AGO

@upload.php Add

PHP Code:

tr("iMDB Link""<input type=text name=url size=85 value='".$row["url"]."'>(<b>Direct link</b> from <b>iMDB.</b> Please use only for <b>Movies</b> and <b>Episodes</b>)\n"); 


@takeupload.php Add

PHP Code:

 if (!empty($_POST['url']))
$url unesc($_POST['url']); 




Add the the big query

PHP Code:

url

And

PHP Code:

$url

@edit.php Add

PHP Code:

tr("iMDB Link""<input type=text name=url size=80 value='".$row["url"]."'>"1); 

@takeedit.php Add

PHP Code:

if (!empty($_POST['url']))
$url $_POST['url']; 

And

PHP Code:

$updateset[] = "url = " sqlesc($url); 


Kristoffer 8th November 2012 01:59

Quote:

Originally Posted by bill123 (Post 37255)
Auto iMDB mod

How is it possible to use this in TBDEV? added all these but in upload it's just a blank page.

wMan 8th November 2012 03:50

PHP Code:

tr("iMDB Link""<input type=text name=url size=85 value='".$row["url"]."'>(<b>Direct link</b> from <b>iMDB.</b> Please use only for <b>Movies</b> and <b>Episodes</b>)\n"); 

PHP Code:

tr("iMDB Link""<input type=text name=url size=85 value='".$row["url"]."'>(<b>Direct link</b> from <b>iMDB.</b> Please use only for <b>Movies</b> and <b>Episodes</b>)\n"); 


tinydownload 6th April 2013 06:16

dose any one know how to pull the images from the new imdb layout?

i managed to get votes working

Code:

      /** Setup votes
      * @method private rate_vote
      */
      private function rate_vote() {
        if ($this->page["Title"] == "") $this->openpage ("Title");
        if (preg_match('!(\d{1,2}\.\d)!i',$this->page["Title"],$match)){
          $this->main_rating = $match[1];   
        } else {
          $this->main_rating = 0;
        }
        if (preg_match('#itemprop="ratingCount"[^>]*>(.*)
#U',$this->page["Title"],$match)){
            $this->main_votes = $match[1];
        }else{
            $this->main_votes = 0;
        }                                                   
      }


tihozh 12th December 2013 20:16

Hi there

maybe i'm totally Blind at the end of my days, but i did'nt find the following in my details.php. Can someone please help me out how i can use the IMDB Mod :)



Open details.php and after:
PHP Code:

if (!empty($row["poster"]))
               
tr("Poster""<img src='".$row["poster"]."'>"1); 

Add this:


i am using the latest stable Version.
Cheers

fodbrothers 10th January 2014 10:36

imdb help
 
Ok so I have everything working but need 2 little thing when I upload n add the imdb link and it goes to the upload sucessfully 1 there is no picture and 2 all the info in the imdb box works perfect but there is more info in the description box but it is not coded is thete anyway of not having the code added to that box or get the code working. Many thanks in advance

DND 10th January 2014 11:44

it's not that hard to use the latest imdb script files, right?
google it, use it, be happy :)

firefly007 10th January 2014 15:10

There is a much better Imdb script lib on Github so I wouldnt worry about using this as I suspect its old...

Also what Ive done is to rather create a few more fields in the torrent table and when the person or person uploads the info Eg. vote, cast, poster, trailer and so on will get recorded only once instead of constantly when you or the user views the torrent details.

fodbrothers 10th January 2014 19:24

what does it mean by

Add the the big query

PHP Code:
url,
And

PHP Code:
$url,

i think this maybe the issue
where and which file do i add this and lastly please can someone help me from imdb grabber sending info into the description this would help me load before fixing the image problem

DND 10th January 2014 20:14

why do u want this mod ? what do u have in the 1st place a torrentsite if you don't know what are u doing ?:wallbash:

fodbrothers 10th January 2014 20:23

hi thanks for the reply
 
no im trying to make an nzb site i got a nzb mod from here which only worked on one of the precoded versions of tbdev but it had an old version of imdb grabber i have a more uptodate version but as i said before it grabs the correct info but no image and in the description box below the imdb box it shows the info but uncoded
and yes i am new to html code and everything and have had a lot to learn and trying my best so sorry if i come accross a little dumb in this area but im trying and would really be greatful if you could help

Bump: IMDb
More Repo Men (2010)
Bad Heart? Bad Liver? Bad Credit? No Problem!!!

Genres: Action, Crime, Sci-Fi, Thriller

Rating: 6.3 (72,041 votes)

Language: English

Runtime: 111 mins

Plot Outline:

[x]
In the future humans have extended and improved our lives through highly sophisticated and expensive mechanical organs created by a company called "The Union". The dark side of these medical breakthroughs is that if you don't pay your bill, "The Union" sends its highly skilled repo men to take back its property... with no concern for your comfort or survival. Former soldier Remy is one of the best organ repo men in the business. But when he suffers a cardiac failure on the job, he awakens to find himself fitted with the company's top-of-the-line heart-replacement... as well as a hefty debt. But a side effect of the procedure is that his heart's no longer in the job. When he can't make the payments, The Union sends its toughest enforcer, Remy's former partner Jake, to track him down.

- Written by Anonymous

Director: Miguel Sapochnik
Writing By: Eric Garcia Garrett Lerner Eric Garcia
Music: Marco Beltrami



Description
Code:

Repo Men (2010)
Bad Heart? Bad Liver? Bad Credit? No Problem!!!

Genres: Action, Crime, Sci-Fi, Thriller
Rating: 6.3 (72,041 votes)
Language: English

Runtime: 111 mins
Plot Outline:

[x]
         

In the future humans have extended and improved our lives through highly sophisticated and expensive mechanical organs created by a company called "The Union". The dark side of these medical breakthroughs is that if you don't pay your bill, "The Union" sends its highly skilled repo men to take back its property... with no concern for your comfort or survival. Former soldier Remy is one of the best organ repo men in the business. But when he suffers a cardiac failure on the job, he awakens to find himself fitted with the company's top-of-the-line heart-replacement... as well as a hefty debt. But a side effect of the procedure is that his heart's no longer in the job. When he can't make the payments, The Union sends its toughest enforcer, Remy's former partner Jake, to track him down.


the in the next box i get this


Code:


              - Written by
Anonymous
       

Director: Miguel Sapochnik
Writing By: Eric Garcia Garrett Lerner Eric Garcia
Music: Marco Beltrami
this is my details.php

Code:

/***************************************************************************
 *  NZB Details Page
 *  ========================================
 *  NZB Mod - Public v.TS-1.0b
 *  TorrentStrike version
 *  ========================================
 *  created by dodgy
 *  http://www.webdeviation.com
 *  Special thanks to all who have had a hand in TBDev/TorrentStrike
 ***************************************************************************/

ob_start("ob_gzhandler");
?>

require_once("include/bittorrent.php");
include_once("imdb/imdb.class.php");
dbconn();

// ----- For display of row with missing segments:
function missing_segments($segments, $subjseg) {
      if ($segments == $subjseg)
            $display = ">($segments/$subjseg)";
      elseif ($segments < $subjseg)
            $display = " color=\"red\">($segments/$subjseg)";
      elseif ($segments > $subseg)
            $display = " color=\"green\">($segments/$subjseg)";
      return $display;         
}


// ----- Cleans NZB Subjects (not finished - add your own):
function clean_nzb_subj($string) {
      $string = str_replace(""", " ", $string);
      $string = str_replace("è", "e", $string);
      $string = str_replace(""", "\"", $string);
      $string = str_replace("_", " ", $string);
      return $string;
}

/* ---- To retrieve piece information from dB & display it on nzb page, with form
  that will record which pieces are selected by user & therefore which pieces
  will be retrieved. ---- */
function showpieces($id, $nzbname, $nzbvernum) {
     
    $pl = "
\n";
    $pl .= "\n";
    $pl .= "".
        "".
        "".
        "".
        "\n";
       
    $piecelist = @mysql_query("SELECT nzb_piece, piece_date, piece_subject, piece_size, piece_segments, piece_subjseg FROM nzbpiecelist WHERE nzb = $id ORDER BY nzb_piece");
   
    while ($plist = mysql_fetch_array($piecelist)) {
                   
        // Convert date:
        $dateunix = $plist['piece_date'];
        $dateposted = date("Y-m-d G:i:s", $dateunix);
       
        // Segment display/calculation:
        $segments = 0 + $plist['piece_segments'];
        $subjseg = 0 + $plist['piece_subjseg'];
       
        // the rows:
        $pl .= "".
              "".
              "".
              "".
              "\n";
    }
   
    $pl .= "
Dl?SubjectSizeDateParts
".(getNzbPermissions("part")==1 && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")?"                     "value=\"" . $plist['nzb_piece'] .
                    "\" />":"")."
" . safe(clean_nzb_subj($plist['piece_subject'])) . "" . mksize($plist['piece_size']) . "" . $dateposted . "
\n".
        "".
        "".
        "".
        "";
    if (getNzbPermissions("part") == 1  && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")) {
        $pl .= "
".
        "   
\n";
    } elseif (getNzbPermissions("part") == 1  && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) {
        $pl .= "
".getNzbPermissions("maxmsg")."
\n";
    } else {
        $pl .= "
".getNzbPermissions("partmsg")."
\n";
    }
    $pl .= "[Hide list]".
            "
\n";
     
    return $pl;     
}

loggedinorreturn();

$id = 0 + $_GET["id"];

if (!isset($id) || !$id)
    die();
   
$res = mysql_query("SELECT nzbs.owner, nzbs.name, nzbs.descr, nzbs.category, LENGTH(nzbs.nfo)AS nfosz, nzbs.filename, nzbs.size, nzbs.numfiles, nzbs.poster, nzbs.postdate, nzbs.groups, nzbs.id, nzbs.added, nzbs.views, nzbs.hits, nzbs.pars, nzbs.partotsize, nzbs.nzbvernum, nzbs.autoimdb, nzbs.url, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.format, nzbcategories.name AS cat_name, users.username FROM nzbs LEFT JOIN nzbcategories ON nzbs.category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id WHERE nzbs.id = $id")
    or sqlerr();
/* $res = mysql_query("SELECT nzbs.owner, nzbs.name, nzbs.descr, nzbs.category, LENGTH(nzbs.nfo)AS nfosz, nzbs.filename, nzbs.size, nzbs.numfiles, nzbs.poster, nzbs.postdate, nzbs.groups, nzbs.id, nzbs.added, nzbs.views, nzbs.hits, nzbs.pars, nzbs.partotsize, nzbs.nzbvernum, nzbs.autoimdb, nzbs.url, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.format, nzbcategories.name AS cat_name, users.username, users.advertisename FROM nzbs LEFT JOIN nzbcategories ON nzbs.category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id WHERE nzbs.id = $id")
    or sqlerr(); // USE THIS QUERY IF ANONYMOUS UPLOADER MOD PRESENT */

$row = mysql_fetch_array($res);

$owned = $moderator = 0;
    if (get_user_class() >= UC_MODERATOR)
        $owned = $moderator = 1;
    elseif ($CURUSER["id"] == $row["owner"])
        $owned = 1;
       
if ($_GET["hit"]) {
    mysql_query("UPDATE nzbs SET views = views + 1 WHERE id = $id");
    if ($_GET["tocomm"])
        header("Location: $BASEURL/nzbdetails.php?id=$id&page=0#startcomments");
    elseif ($_GET["filelist"])
        header("Location: $BASEURL/nzbdetails.php?id=$id&filelist=1#filelist");
    else
        header("Location: $BASEURL/nzbdetails.php?id=$id");
    exit();
}

if (!isset($_GET["page"])) {
    stdhead("Details for nzb \"" . $row["name"] . "\"");

    $spacer = "       ";

    if ($_GET["uploaded"]) {
        print("

Successfully uploaded!

\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 \"" . safe($_GET["searched"]) . "\" gave a single result:

\n");
    }


    $addtext = safe($row["addtext"])." ";
    $format = ($row["format"]!="na"?" \"".$row["format"]."\"":"");

    $s=$row["name"];
    print("

$s

\n");
    print("

.: $addtext $format :.

\n");
    print("\n");

    $url = "nzbedit.php?id=" . $row["id"];
    if (isset($_GET["returnto"])) {
        $addthis = "&returnto=" . urlencode($_GET["returnto"]);
        $url .= $addthis;
        $keepget .= $addthis;
    }
    $editlink = "a href=\"$url\" class=\"sublink\"";
   
   
    // Get permissions for download link display
    if ((getNzbPermissions("zip") == 1 || getNzbPermissions("nzb") == 1) && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday"))
    {
        print("");
        print("");
        print("\n");

    }
    elseif ((getNzbPermissions("zip") == 1 || getNzbPermissions("nzb") == 1) && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) {
        print("");
    } else {
        print("");
    }
    //----------------------------------------------------------------Auto iMDB mod by Axxel------------------------------------------------------------------
              if (($row["url"] != "")AND(strpos($row["url"], imdb))AND(strpos($row["url"], title)))
                  {
              $thenumbers = ltrim(strrchr($row["url"],'tt'),'tt');
              $thenumbers = ereg_replace("[^A-Za-z0-9]", "", $thenumbers);
              $movie = new imdb ($thenumbers);
              $movieid = $thenumbers;
              $movie->setid ($movieid);
              $plot = $movie->plot();
              $plotoutline = $movie->plotoutline();
              $gen = $movie->genres();
              $cast = $movie->cast();
              $director = $movie->director();
              $write = $movie->writing();
              $produce = $movie->producer();
              $compose = $movie->composer();

                if (($photo_url = $movie->photo_localurl() ) != FALSE) {
                $autodata = '';
                } else {
                $autodata = '';
                }

              $autodata .= "" . "".$movie->title ()." " . "(".$movie->year ().")\n";
              $autodata .= " " . "".$movie->tagline ()."\n";

              $autodata .= "\n Genres: ";
              for ($i = 0; $i + 1 < count($gen); $i++) {
              $autodata .= "$gen[$i], ";
  }
              $autodata .= "$gen[$i]";

              $autodata .= "\n Rating: " . "".$movie->rating ()." " . "(".$movie->votes ()." votes)\n";
              $autodata .= " Language: " . "".$movie->language ()."\n";

              $autodata .= "\n Runtime: " . "".$movie->runtime ()."" . " mins\n";

if (!empty($plot)) {

$autodata .= " Plot Outline: \n";

              for ($i = 0; $i < count ($plot); $i++) {
              $autodata .= "\n[x] ";
              $autodata .= "$plot[$i]";
            $autodata .= "
\n";
break;
      }
 }


if (!empty($director)) {
    $autodata .= " Director: ";
    for ($i = 0; $i < count ($director); $i++) {
        $autodata .= "" . "".$director[$i]["name"]."" . "\n";
    }
}


if (!empty($write)) {
    $autodata .= " Writing By: ";
    for ($i = 0; $i < count ($write); $i++) {
        $autodata .= "" . "".$write[$i]["name"]."" . " ";
    }
}


if (!empty($compose)) {
    $autodata .= "\n Music: ";
    for ($i = 0; $i < count($compose); $i++) {
        $autodata .= "" . "".$compose[$i]["name"]."" . " ";
    }
}




?>

              $smallth .= ":imdb_more('imdb_area', 'imdb_link');\">More\n";
             

$autodata .= "
Cast:
\n";

for ($i = 0; $i < count ($cast); $i++) {
    if ($i > 9) {
        break;
    }
$autodata .= " " . "" . "".$cast[$i]["name"]."" . " " . " as " . "".$cast[$i]["role"]."" . "
\n";
}


if (!empty($produce)) {
    $autodata .= "\nProduced By:
";
    for ($i = 0; $i < count ($produce); $i++) {
        $autodata .= "" . "".$produce[$i]["name"]."" . " ";
    }
}


if (!empty($plot)) {
$autodata .= " Plot: \n";

              for ($i = 0; $i < count ($plot); $i++) {
              $autodata .= "\n[x] ";
              $autodata .= "$plot[$i]";
            $autodata .= "
\n";

    }
      }


              tr("IMDb $smallth",$autodata,1);
}
//--------------------------------------------------------------------Auto iMDB mod end----------------------------------------------------------------------

    if (!empty($row["descr"]))
        $descr = $row["descr"];
    else
        $descr = " ";
    $autodata = ($row["autoimdb"] == "yes"?format_comment($autodata)."":"");
    $descri = format_comment($descr);
    tr("Description", $autodata."".$descri, 1);               

    if ($row["nfosz"] > 0)
        print("
\n");

    if ($row["url"] != "")
        tr("Info URL", format_urls(safe($row["url"])), 1);
   
    if (isset($row["cat_name"]))
        tr("Type", $row["cat_name"]);
    else
        tr("Type", "(none selected)");
       
    if ($row["autoimdb"] == "no" && $row["genre"] != "")
        tr("Genre", safe($row["genre"]), 1);

    tr("Size",mksize($row["size"]) . " (" . number_format($row["size"]) . " bytes)");

    tr("Poster", $row["poster"]);
   
    $datenix = $row["postdate"];
    $agepost = show_age($datenix);
    $datepost = date("Y-m-d H:i:s", $datenix);
    tr("Posted", $datepost." ($agepost days ago)");
   
    $groups = unserialize($row['groups']);
    if (is_array($groups)) {
        $grp = "";
        foreach ($groups as $key=>$val) {
            $grp .= "$val\n";
        }
    } else {
        $grp = $groups;
    }   
    tr("Groups", safe($grp));
   
    if ($row["pars"] > 0) {
      $percentpars = sprintf( "%.2f", (($row["partotsize"] / ($row["size"] - $row["partotsize"])) * 100));
    }
    tr("par2 Files", ($row['pars'] == 0?"None":$row['pars'].", ".mksize($row["partotsize"])." in total (Can rebuild approx $percentpars% of total filesize)"));     
    tr("NZB Added", $row["added"]);
    tr("Views", $row["views"]);
    tr("Grabs", $row["hits"]);
   
    $uprow = (isset($row["username"]) ? ("" . safe($row["username"]) . "") : "unknown");
    /* USE ABOVE ^^^ OR BELOW vvv DEPENDING ON WHETHER YOU HAVE THE ANONYMOUS UPLOADER MOD */
/*    $addnam = $row['advertisename'];
    $keepget = "";
    $uprow = ("Anonymous");
    if (get_user_class() >= UC_MODERATOR)
        $uprow = (isset($row["username"]) ? ("" . safe($row["username"]) . "") : "unknown");
    if ($addnam == "yes")
        $uprow = (isset($row["username"]) ? ("" . safe($row["username"]) . "") : "unknown"); */
    if ($owned)
        $uprow .= " $spacer<$editlink>[Edit this NZB]";
    tr("Upped by", $uprow, 1);

    //tr("ReportNZB", "Click here to report this NZB to staff for violation of the rules", 1);
   
    if (!$_GET["filelist"]) {
        tr("Num files[See full list]", $row["numfiles"] . " files", 1);
    } else {
        tr("Num files", $row["numfiles"] . " files", 1);   
        tr("File list[Hide list]", showpieces($id, $row["name"], $row['nzbvernum']), 1);
    }
   
    print("
Download");
        if (getNzbPermissions("zip") == 1)
            print("");         
        if (getNzbPermissions("nzb") == 1)
            print("   ");
        print("                   ");
        print("
Download");
        print(getNzbPermissions("maxmsg")."
Download");
        print(getNzbPermissions("nzbmsg")."
NFO".(getNzbPermissions("nfo") != 0?"View NFO (" .
            mksize($row["nfosz"]) . ")":getNzbPermissions("nfomsg"))."

\n");
   
    /* The comparison value of '0' with $datenix is so that failed uploads with no nzbs.datepost value can be deleted by the uploader */ 
    if (($datenix!=0) && (get_user_class() >= UC_MODERATOR)) {   
        print("

\n");
        print("

\n");
        print("\n");
        print("");
      // print("\n");
        print("\n");
        print("\n");
        print("");
        print("\n");
        print("\n");
        if (isset($_GET["returnto"]))
            print("\n");
        print("\n");
        print("
Delete NZB. Reason:
 Expired $SITENZBRETENTION days old
 Dupe
 Nuked
 Rules(req)
 Other:(req)
");
        print("
\n");
        print("

\n");
    } elseif (($datenix==0) && (getNzbPermissions("ulnzb")==1)) {
        print("

\n");
        print("

\n");
        print("\n");
        print("");
        print("\n");
        print("\n");
        if (isset($_GET["returnto"]))
            print("\n");
        print("\n");
        print("
Delete Failed NZB. Reason:
 What happened?:(req)
");
        print("
\n");
        print("

\n");
    }
} else {
    stdhead("Comments for NZB \"" . $row["name"] . "\"");
    print("

Comments for " . $row["name"] . "

\n");
}

print("

\n");

$commentbar = "

Add a comment

\n";

$subres = mysql_query("SELECT COUNT(*) FROM nzbcomments WHERE nzb = $id");
$subrow = mysql_fetch_array($subres);
$count = $subrow[0];

if (!$count) {
    print("

No comments yet

\n");
} else {
    list($pagertop, $pagerbottom, $limit) = pager(20, $count, "nzbdetails.php?id=$id&", array(lastpagedefault => 1));

    $subres = mysql_query("SELECT nzbcomments.id, text, user, nzbcomments.added, editedby, editedat, avatar, warned, ".
        "username, title, class, donor FROM nzbcomments LEFT JOIN users ON nzbcomments.user = users.id WHERE nzb = " .
        "$id ORDER BY nzbcomments.id $limit") or sqlerr(__FILE__, __LINE__);
    /* USE ABOVE ^^^ OR BELOW vvv DEPENDING ON WHETHER YOU HAVE THE ANONYMOUS UPLOADER MOD */
 /*  $subres = mysql_query("SELECT nzbcomments.id, text, user, nzbcomments.added, editedby, editedat, avatar, warned, ".
        "username, title, class, donor, advertisename FROM nzbcomments LEFT JOIN users ON nzbcomments.user = users.id WHERE nzb = " .
        "$id ORDER BY nzbcomments.id $limit") or sqlerr(__FILE__, __LINE__); */
    $allrows = array();
    while ($subrow = mysql_fetch_array($subres))
        $allrows[] = $subrow;

    print($commentbar);
    print($pagertop);

    nzbcommenttable($allrows, $row["owner"]);

    print($pagerbottom);
}

print($commentbar);

stdfoot();
?>


Krypto 10th January 2014 22:23

@fodbrothers STOP creating multiple Threads/Posts
 
@fodbrothers

STOP creating multiple Threads/Posts for the same issue, it will not get you a response any quicker.

If you don't receive a reply it means no one has the answer or they don't want to help.

Previous Threads DELETED

firefly007 11th January 2014 00:25

Quote:

Originally Posted by fodbrothers (Post 43607)
no im trying to make an nzb site i got a nzb mod from here which only worked on one of the precoded versions of tbdev but it had an old version of imdb grabber i have a more uptodate version but as i said before it grabs the correct info but no image and in the description box below the imdb box it shows the info but uncoded
and yes i am new to html code and everything and have had a lot to learn and trying my best so sorry if i come accross a little dumb in this area but im trying and would really be greatful if you could help

Dude! please don't make such a mess of the forums..

Get Newznab but don't get the demo rather look for Newznab+ on Github ( https://github.com/kop1/newznab ) you can you use it is as is or use the backend only. I have TBDEV08 as my front end and indexing NZB's using Newznab's backend + I'm utilising Newznab's API too.

Ive also played around with the NZB nod and even NZB strike I thought it was crappie. You can see it in action if you like http://ninjacentral.co.za

fodbrothers 11th January 2014 09:52

hi
 
thanks for the info firefly i think i will just try and fix this issue
and sorry i made a post elsewhere it got deleted as i didnt do the introduction thing and i guess they reopened it sorry

which files would you guys need to help me fix this issue which wwould probs take u 5 mins and me like 5 days :) please pm me

firefly007 11th January 2014 10:20

Well! what is the problem you are having? You have posted two different problems. So could you explain again in detail. and more importantly what is the error you are getting..

fodbrothers 11th January 2014 10:36

error
 
1 Attachment(s)
ok well i have the upload page first it asks if i have an imdb link or not which is brilliant so i have that i put that in and the only other thing that i have to add is the category so i put that in
click the done button
it takes me to the details.php
which i have attached a print screen
of what i am getting

firefly007 11th January 2014 10:39

could you post your details please

fodbrothers 11th January 2014 10:46

details
 
details in next post

firefly007 11th January 2014 10:47

could you edit your post and wrap code tags around it please

fodbrothers 11th January 2014 10:52

details again
 
PHP Code:

<?php
/***************************************************************************
 *  NZB Details Page
 *  ========================================
 *  NZB Mod - Public v.TS-1.0b
 *  TorrentStrike version
 *  ========================================
 *  created by dodgy
 *  http://www.webdeviation.com
 *  Special thanks to all who have had a hand in TBDev/TorrentStrike
 ***************************************************************************/

ob_start("ob_gzhandler");
?>
<script LANGUAGE="JavaScript">
<!-- Begin
var checkflag = "false";
function check(field) {
    if (checkflag == "false") {
        for (i = 0; i < field.length; i++) {
            field[i].checked = true;}
        checkflag = "true";
        return "Uncheck All"; }
    else {
        for (i = 0; i < field.length; i++) {
            field[i].checked = false; }
        checkflag = "false";
    return "Check All"; }
}
//  End -->
</script>
<?
require_once("include/bittorrent.php");
include_once(
"imdb/imdb.class.php");
dbconn();

// ----- For display of row with missing segments:
function missing_segments($segments$subjseg) {
      if (
$segments == $subjseg)
            
$display ">($segments/$subjseg)";
      elseif (
$segments $subjseg)
            
$display " color=\"red\">($segments/$subjseg)";
      elseif (
$segments $subseg)
            
$display " color=\"green\">($segments/$subjseg)";
      return 
$display;          



// ----- Cleans NZB Subjects (not finished - add your own):
function clean_nzb_subj($string) {
      
$string str_replace("&#x22;"" "$string);
      
$string str_replace("è""e"$string);
      
$string str_replace(""""\""$string);
      
$string str_replace("_"" "$string);
      return 
$string;
}

/* ---- To retrieve piece information from dB & display it on nzb page, with form
   that will record which pieces are selected by user & therefore which pieces 
   will be retrieved. ---- */
function showpieces($id$nzbname$nzbvernum) {
      
    
$pl "<form name=\"partnzb\" action=\"partnzbdload.php\" method=\"post\" enctype=\"multipart/form-data\">\n";
    
$pl .= "<table width=\"100%\" class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\">\n";
    
$pl .= "<tr><td width=\"3%\" class=\"colhead\" align=\"right\">Dl?</td>".
        
"<td class=\"colhead\">Subject</td>".
        
"<td width=\"8%\" class=\"colhead\" align=\"right\">Size</td>".
        
"<td width=\"8%\" class=\"colhead\" align=\"right\">Date</td>".
        
"<td width=\"6%\" class=\"colhead\" align=\"right\">Parts</td></tr>\n";
        
    
$piecelist = @mysql_query("SELECT nzb_piece, piece_date, piece_subject, piece_size, piece_segments, piece_subjseg FROM nzbpiecelist WHERE nzb = $id ORDER BY nzb_piece");
    
    while (
$plist mysql_fetch_array($piecelist)) {
                    
        
// Convert date:
        
$dateunix $plist['piece_date'];
        
$dateposted date("Y-m-d G:i:s"$dateunix);
        
        
// Segment display/calculation:
        
$segments $plist['piece_segments'];
        
$subjseg $plist['piece_subjseg'];
        
        
// the rows:
        
$pl .= "<tr><td>".(getNzbPermissions("part")==&& $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")?"<input type=\"checkbox\" name=\"nzbpieces[]\" ".
                    
"value=\"" $plist['nzb_piece'] .
                    
"\" />":"")."</td>".
              
"<td><font class=\"small\">" safe(clean_nzb_subj($plist['piece_subject'])) . "</font></td>".
              
"<td align=right><font class=\"small\">" mksize($plist['piece_size']) . "</font></td>".
              
"<td align=right><font class=\"small\">" $dateposted "</font></td>".
              
"<td align=right><font class=\"small\"" missing_segments($segments$subjseg) . "</font></td></tr>\n";
    }
    
    
$pl .= "</table>\n".
        
"<input type=\"hidden\" name=\"nzb\" value=\"" $id ."\" />".
        
"<input type=\"hidden\" name=\"nzb_name\" value=\"" $nzbname ."\" />".
        
"<input type=\"hidden\" name=\"nzbvernum\" value=\"" $nzbvernum ."\" />".
        
"<input type=\"button\" value=\"Check all\" onClick=\"this.value=check(partnzb)\" class=\"codebuttons\" style=\"width:90px;height:25px;\" />";
    if (
getNzbPermissions("part") == 1  && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")) {
        
$pl .= "<div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />".
        
"&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div>\n";
    } elseif (
getNzbPermissions("part") == 1  && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) {
        
$pl .= "<div align=\"center\">".getNzbPermissions("maxmsg")."</div>\n"
    } else {
        
$pl .= "<div align=\"center\">".getNzbPermissions("partmsg")."</div>\n";
    }
    
$pl .= "<a href=\"nzbdetails.php?id=$id\" class=\"sublink\">[Hide list]</a>".
            
"</form>\n";
      
    return 
$pl;      
}

loggedinorreturn();

$id $_GET["id"];

if (!isset(
$id) || !$id)
    die();
    
$res mysql_query("SELECT nzbs.owner, nzbs.name, nzbs.descr, nzbs.category, LENGTH(nzbs.nfo)AS nfosz, nzbs.filename, nzbs.size, nzbs.numfiles, nzbs.poster, nzbs.postdate, nzbs.groups, nzbs.id, nzbs.added, nzbs.views, nzbs.hits, nzbs.pars, nzbs.partotsize, nzbs.nzbvernum, nzbs.autoimdb, nzbs.url, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.format, nzbcategories.name AS cat_name, users.username FROM nzbs LEFT JOIN nzbcategories ON nzbs.category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id WHERE nzbs.id = $id")
    or 
sqlerr();
/* $res = mysql_query("SELECT nzbs.owner, nzbs.name, nzbs.descr, nzbs.category, LENGTH(nzbs.nfo)AS nfosz, nzbs.filename, nzbs.size, nzbs.numfiles, nzbs.poster, nzbs.postdate, nzbs.groups, nzbs.id, nzbs.added, nzbs.views, nzbs.hits, nzbs.pars, nzbs.partotsize, nzbs.nzbvernum, nzbs.autoimdb, nzbs.url, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.format, nzbcategories.name AS cat_name, users.username, users.advertisename FROM nzbs LEFT JOIN nzbcategories ON nzbs.category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id WHERE nzbs.id = $id")
    or sqlerr(); // USE THIS QUERY IF ANONYMOUS UPLOADER MOD PRESENT */

$row mysql_fetch_array($res);

$owned $moderator 0;
    if (
get_user_class() >= UC_MODERATOR)
        
$owned $moderator 1;
    elseif (
$CURUSER["id"] == $row["owner"])
        
$owned 1;
        
if (
$_GET["hit"]) {
    
mysql_query("UPDATE nzbs SET views = views + 1 WHERE id = $id");
    if (
$_GET["tocomm"])
        
header("Location: $BASEURL/nzbdetails.php?id=$id&page=0#startcomments");
    elseif (
$_GET["filelist"])
        
header("Location: $BASEURL/nzbdetails.php?id=$id&filelist=1#filelist");
    else
        
header("Location: $BASEURL/nzbdetails.php?id=$id");
    exit();
}

if (!isset(
$_GET["page"])) {
    
stdhead("Details for nzb \"" $row["name"] . "\"");

    
$spacer "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

    if (
$_GET["uploaded"]) {
        print(
"<h2>Successfully uploaded!</h2>\n");
    }
    elseif (
$_GET["edited"]) {
        print(
"<h2>Successfully edited!</h2>\n");
        if (isset(
$_GET["returnto"]))
            print(
"<p><b>Go back to <a href=\"" safe($_GET["returnto"]) . "\">whence you came</a>.</b></p>\n");
    }
    elseif (isset(
$_GET["searched"])) {
        print(
"<h2>Your search for \"" safe($_GET["searched"]) . "\" gave a single result:</h2>\n");
    }


    
$addtext safe($row["addtext"])."&nbsp;";
    
$format = ($row["format"]!="na"?"&nbsp;<img src=\"".$pic_base_url."sml_".$row["format"].".gif\" alt=\"".$row["format"]."\" />":"");

    
$s=$row["name"];
    print(
"<h1>$s</h1>\n");
    print(
"<h3>.: $addtext $format :.</h3>\n");
    print(
"<table width=\"750\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");

    
$url "nzbedit.php?id=" $row["id"];
    if (isset(
$_GET["returnto"])) {
        
$addthis "&returnto=" urlencode($_GET["returnto"]);
        
$url .= $addthis;
        
$keepget .= $addthis;
    }
    
$editlink "a href=\"$url\" class=\"sublink\"";
    
    
    
// Get permissions for download link display
    
if ((getNzbPermissions("zip") == || getNzbPermissions("nzb") == 1) && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday"))
    {
        print(
"<form action=\"nzbdownload.php/$id/" rawurlencode($row["name"]) . ".nzb\" method=\"post\">");
        print(
"<tr><td class=\"rowhead\" width=\"1%\">Download</td><td width=\"99%\" align=\"center\">");
        if (
getNzbPermissions("zip") == 1)
            print(
"<input type=\"submit\" name=\"dlzip\" value=\"Download As Zip File\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />");          
        if (
getNzbPermissions("nzb") == 1)
            print(
"&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"dlnzb\" value=\"Download As NZB\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />");
        print(
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
        print(
"</td></tr>");
        print(
"</form>\n");

    }
    elseif ((
getNzbPermissions("zip") == || getNzbPermissions("nzb") == 1) && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) {
        print(
"<tr><td class=\"rowhead\" width=\"1%\">Download</td><td width=\"99%\" align=\"center\">");
        print(
getNzbPermissions("maxmsg")."</td></tr>");
    } else {
        print(
"<tr><td class=\"rowhead\" width=\"1%\">Download</td><td width=\"99%\" align=\"center\">");
        print(
getNzbPermissions("nzbmsg")."</td></tr>");
    }
    
//----------------------------------------------------------------Auto iMDB mod by Axxel------------------------------------------------------------------
               
if (($row["url"] != "")AND(strpos($row["url"], imdb))AND(strpos($row["url"], title)))
                  {
               
$thenumbers ltrim(strrchr($row["url"],'tt'),'tt');
               
$thenumbers ereg_replace("[^A-Za-z0-9]"""$thenumbers);
               
$movie = new imdb ($thenumbers);
               
$movieid $thenumbers;
               
$movie->setid ($movieid);
               
$plot $movie->plot();
               
$plotoutline $movie->plotoutline();
               
$gen $movie->genres();
               
$cast $movie->cast();
               
$director $movie->director();
               
$write $movie->writing();
               
$produce $movie->producer();
               
$compose $movie->composer();

                if ((
$photo_url $movie->photo_localurl() ) != FALSE) {
                
$autodata '<img class=glossy src="'.$photo_url.'" style="float:left; margin-right:5px;">';
                } else {
                
$autodata '<img  img  src="/imdb/images/default.png" style="float:left; margin-right:5px;">';
                }

               
$autodata .= "<strong><a href=\"http://www.imdb.com/title/tt$movieid\"><font size=\"3\" style=\"border-bottom: 1px dotted; text-decoration: none;\">" "".$movie->title ()."</a></font> <font size=\"3\"><b> " "(".$movie->year ().")</b></strong></size></font>\n";
               
$autodata .= "<i><font color=\"#999999\"> " "".$movie->tagline ()."</font></i>\n";

               
$autodata .= "\n<strong> Genres: </strong>";
               for (
$i 0$i count($gen); $i++) {
               
$autodata .= "$gen[$i], ";
  }
               
$autodata .= "$gen[$i]";

               
$autodata .= "\n<strong> Rating: </strong>" "".$movie->rating ()." <font size=\"1\"><u> " "(".$movie->votes ()." votes)</size></u></font>\n";
               
$autodata .= "<strong> Language: </strong>" "".$movie->language ()."\n";

               
$autodata .= "\n<strong> Runtime: </strong>" "".$movie->runtime ()."" " mins</strong>\n";

if (!empty(
$plot)) {

$autodata .= "<strong> Plot Outline: </strong>\n";

              for (
$i 0$i count ($plot); $i++) {
              
$autodata .= "\n<font color=\"red\">[x] </font>";
              
$autodata .= "$plot[$i]";
             
$autodata .= "</br>\n";
break;
      }
 }


if (!empty(
$director)) {
    
$autodata .= "<strong><font color=\"blue\"> Director: </font></strong>";
    for (
$i 0$i count ($director); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$director[$i]["imdb"]."" ."\">" "".$director[$i]["name"]."" "</a>\n";
    }
}


if (!empty(
$write)) {
    
$autodata .= "<strong><font color=\"blue\"> Writing By: </font></strong>";
    for (
$i 0$i count ($write); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$write[$i]["imdb"]."" ."\">" "".$write[$i]["name"]."" "</a> ";
    }
}


if (!empty(
$compose)) {
    
$autodata .= "\n<strong><font color=\"blue\"> Music: </font></strong>";
    for (
$i 0$i count($compose); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$compose[$i]["imdb"]."" ." \">" "".$compose[$i]["name"]."" "</a> ";
    }
}




?>
<script type="text/javascript">
        function imdb_more(imdb_area, imdb_link) {
        var imdb_area = get_item(imdb_area);
        var imdb_link = get_item(imdb_link);

        if (imdb_area.style.display == "") {
            imdb_area.style.display = "none";
            imdb_link.innerHTML = "More";
            eraseCookie("IMDbXz");
        } else {
            imdb_area.style.display = "";
            imdb_link.innerHTML = "Less";
            createCookie("IMDbXz", "1", "100");
        }
    }
    function get_item(id){
        itm = null;
        if (document.getElementById){
            itm = document.getElementById(id);
        } else if (document.all){
            itm = document.all[id];
        } else if (document.layers) {
            itm = document.layers[id];
        }
        return itm;
    }
    function createCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(365*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }
    function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }
    function eraseCookie(name) {
        createCookie(name,"",-1);
    }
</script>
<?
              $smallth 
.= "<i><a href=\"javascript:imdb_more('imdb_area', 'imdb_link');\"><font style=\"border-bottom: 1px dotted; text-decoration: none; font-size: 7pt; color: grey;\" id=\"imdb_link\">More</font></a></i>\n";
              

$autodata .= "</br><div style=\"display:none\" id=\"imdb_area\"><strong> Cast: </strong></br>\n";

for (
$i 0$i count ($cast); $i++) {
    if (
$i 9) {
        break;
    }
$autodata .= "<font color=\"blue\"></font> " "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$cast[$i]["imdb"]."" ."\">" "".$cast[$i]["name"]."" "</a> " " as <strong><font color=\"orange\">" "".$cast[$i]["role"]."" " </font></strong></br>\n";
}


if (!empty(
$produce)) {
    
$autodata .= "\n<strong>Produced By: </strong></br>";
    for (
$i 0$i count ($produce); $i++) {
        
$autodata .= "<a target=\"_blank\" href=\"http://www.imdb.com/name/nm" "".$produce[$i]["imdb"]."" ." \"><font color=green>" "".$produce[$i]["name"]."" "</font></a> ";
    }
}


if (!empty(
$plot)) {
$autodata .= "<strong> Plot: </strong>\n";

              for (
$i 0$i count ($plot); $i++) {
              
$autodata .= "\n<font color=\"red\">[x] </font>";
              
$autodata .= "$plot[$i]";
             
$autodata .= "</br>\n";

     }
      }


              
tr("IMDb $smallth",$autodata,1);
}
//--------------------------------------------------------------------Auto iMDB mod end----------------------------------------------------------------------

    
if (!empty($row["descr"]))
        
$descr $row["descr"];
    else
        
$descr "&nbsp;";
    
$autodata = ($row["autoimdb"] == "yes"?format_comment($autodata)."":"");
    
$descri format_comment($descr);
    
tr("Description"$autodata."".$descri1);                

    if (
$row["nfosz"] > 0)
        print(
"<tr><td class=\"rowhead\" align=\"right\">NFO</td><td align=\"left\">".(getNzbPermissions("nfo") != 0?"<a href=nzbviewnfo.php?id=$row[id]><b>View NFO</b></a> (" .
            
mksize($row["nfosz"]) . ")":getNzbPermissions("nfomsg"))."</td></tr>\n");

    if (
$row["url"] != "")
        
tr("Info URL"format_urls(safe($row["url"])), 1);
     
    if (isset(
$row["cat_name"]))
        
tr("Type"$row["cat_name"]);
    else
        
tr("Type""(none selected)");
        
    if (
$row["autoimdb"] == "no" && $row["genre"] != "")
         
tr("Genre"safe($row["genre"]), 1);

    
tr("Size",mksize($row["size"]) . " (" number_format($row["size"]) . " bytes)");

    
tr("Poster"$row["poster"]);
    
    
$datenix $row["postdate"];
    
$agepost show_age($datenix);
    
$datepost date("Y-m-d H:i:s"$datenix);
    
tr("Posted"$datepost." ($agepost days ago)");
    
    
$groups unserialize($row['groups']);
    if (
is_array($groups)) {
        
$grp "";
        foreach (
$groups as $key=>$val) {
            
$grp .= "$val\n";
        }
    } else { 
        
$grp $groups;
    }     
    
tr("Groups"safe($grp));
    
    if (
$row["pars"] > 0) {
       
$percentpars sprintf"%.2f", (($row["partotsize"] / ($row["size"] - $row["partotsize"])) * 100));
    }
    
tr("par2 Files", ($row['pars'] == 0?"None":$row['pars'].", ".mksize($row["partotsize"])." in total (Can rebuild approx $percentpars% of total filesize)"));      
    
tr("NZB Added"$row["added"]);
    
tr("Views"$row["views"]);
    
tr("Grabs"$row["hits"]);
    
    
$uprow = (isset($row["username"]) ? ("<a href=userdetails.php?id=" $row["owner"] . "><b>" safe($row["username"]) . "</b></a>") : "<i>unknown</i>"); 
    
/* USE ABOVE ^^^ OR BELOW vvv DEPENDING ON WHETHER YOU HAVE THE ANONYMOUS UPLOADER MOD */
/*    $addnam = $row['advertisename'];
    $keepget = "";
    $uprow = ("<i>Anonymous</i>");
    if (get_user_class() >= UC_MODERATOR) 
        $uprow = (isset($row["username"]) ? ("<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safe($row["username"]) . "</b></a>") : "<i>unknown</i>"); 
    if ($addnam == "yes") 
        $uprow = (isset($row["username"]) ? ("<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safe($row["username"]) . "</b></a>") : "<i>unknown</i>"); */
    
if ($owned
        
$uprow .= $spacer<$editlink><b>[Edit this NZB]</b></a>"
    
tr("Upped by"$uprow1);

    
//tr("ReportNZB", "Click <a href=\"report.php?typ=nzb&id=$id\"><b><font color=\"#ff0532\">here</font></b></a> to report this NZB to staff for violation of the rules", 1);
    
    
if (!$_GET["filelist"]) {
        
tr("Num files<a href=\"nzbdetails.php?id=$id&filelist=1$keepget#filelist\" class=\"sublink\">[See full list]</a>"$row["numfiles"] . " files"1);
    } else {
        
tr("Num files"$row["numfiles"] . " files"1);     
        
tr("<a name=\"filelist\">File list</a><a href=\"nzbdetails.php?id=$id$keepget\" class=\"sublink\">[Hide list]</a>"showpieces($id$row["name"], $row['nzbvernum']), 1);
    }
    
    print(
"</table></p>\n");
    
    
/* The comparison value of '0' with $datenix is so that failed uploads with no nzbs.datepost value can be deleted by the uploader */  
    
if (($datenix!=0) && (get_user_class() >= UC_MODERATOR)) {    
        print(
"<p>\n");
        print(
"<form method=\"post\" action=\"nzbdelete.php\">\n");
        print(
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
        print(
"<tr><td class=\"row2\" colspan=\"2\"><b>Delete NZB.</b> Reason:</td></tr>");
       
// print("<td><input name=\"reasontype\" type=\"radio\" value=\"1\">&nbsp;Expired </td><td>$SITENZBRETENTION days old</td></tr>\n");
        
print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"2\">&nbsp;Dupe</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n");
        print(
"<tr><td><input name=\"reasontype\" type=\"radio\" value=\"3\">&nbsp;Nuked</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n");
        print(
"<tr><td><input name=\"reasontype\" type=\"radio\" value=\"4\">&nbsp;Rules</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(req)</td></tr>");
        print(
"<tr><td><input name=\"reasontype\" type=\"radio\" value=\"5\" checked=\"checked\" />&nbsp;Other:</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(req)</td></tr>\n");
        print(
"<input type=\"hidden\" name=\"id\" value=\"$id\" />\n");
        if (isset(
$_GET["returnto"]))
            print(
"<input type=\"hidden\" name=\"returnto\" value=\"" safe($_GET["returnto"]) . "\" />\n");
        print(
"<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Delete it!\" class=\"codebuttons\" style=\"width:120px;height:25px;\" /></td></tr>\n");
        print(
"</table>");
        print(
"</form>\n");
        print(
"</p>\n");
    } elseif ((
$datenix==0) && (getNzbPermissions("ulnzb")==1)) {
        print(
"<p>\n");
        print(
"<form method=\"post\" action=\"nzbdelete.php\">\n");
        print(
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
        print(
"<tr><td class=\"row2\" colspan=\"2\"><b>Delete Failed NZB.</b> Reason:</td></tr>");
        print(
"<tr><td><input name=\"reasontype\" type=\"hidden\" value=\"5\"  />&nbsp;What happened?:</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(req)</td></tr>\n");
        print(
"<input type=\"hidden\" name=\"id\" value=\"$id\" />\n");
        if (isset(
$_GET["returnto"]))
            print(
"<input type=\"hidden\" name=\"returnto\" value=\"" safe($_GET["returnto"]) . "\" />\n");
        print(
"<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Delete it!\" class=\"codebuttons\" style=\"width:120px;height:25px;\" /></td></tr>\n");
        print(
"</table>");
        print(
"</form>\n");
        print(
"</p>\n");
    }
} else {
    
stdhead("Comments for NZB \"" $row["name"] . "\"");
    print(
"<h1>Comments for <a href=\"nzbdetails.php?id=$id\">" $row["name"] . "</a></h1>\n");
}

print(
"<p><a name=\"startcomments\"></a></p>\n");

$commentbar "<p align=\"center\"><a class=\"index\" href=\"nzbcomment.php?action=add&tid=$id\">Add a comment</a></p>\n";

$subres mysql_query("SELECT COUNT(*) FROM nzbcomments WHERE nzb = $id");
$subrow mysql_fetch_array($subres);
$count $subrow[0];

if (!
$count) {
    print(
"<h2>No comments yet</h2>\n");
} else {
    list(
$pagertop$pagerbottom$limit) = pager(20$count"nzbdetails.php?id=$id&", array(lastpagedefault => 1));

    
$subres mysql_query("SELECT nzbcomments.id, text, user, nzbcomments.added, editedby, editedat, avatar, warned, ".
        
"username, title, class, donor FROM nzbcomments LEFT JOIN users ON nzbcomments.user = users.id WHERE nzb = " .
        
"$id ORDER BY nzbcomments.id $limit") or sqlerr(__FILE____LINE__);
    
/* USE ABOVE ^^^ OR BELOW vvv DEPENDING ON WHETHER YOU HAVE THE ANONYMOUS UPLOADER MOD */
 /*   $subres = mysql_query("SELECT nzbcomments.id, text, user, nzbcomments.added, editedby, editedat, avatar, warned, ".
        "username, title, class, donor, advertisename FROM nzbcomments LEFT JOIN users ON nzbcomments.user = users.id WHERE nzb = " .
        "$id ORDER BY nzbcomments.id $limit") or sqlerr(__FILE__, __LINE__); */
    
$allrows = array();
    while (
$subrow mysql_fetch_array($subres))
        
$allrows[] = $subrow;

    print(
$commentbar);
    print(
$pagertop);

    
nzbcommenttable($allrows$row["owner"]);

    print(
$pagerbottom);
}

print(
$commentbar);

stdfoot();
?>


firefly007 11th January 2014 10:56

Think it would be easier you give me ftp details please via Pm

fodbrothers 11th January 2014 11:01

ftp details
 
will pm you in a moment but the .php files are names differently
the details are nzbdetails.php
uploadnzb.php
and im sure you will see

will just make u a user now

Bump: did you get the ftp details

firefly007 12th January 2014 07:13

Yes! and its working ... In regards to your last Pm you will need to edit globals and edit that class that falls under what group, groups start from 1-5 each group has its own threshold.

fodbrothers 12th January 2014 07:52

hi
 
PMed you

fodbrothers 14th January 2014 16:26

IMDB Rating help
 
hi all in the browse i have the imdb rating but it doesnt show the rating can someone help i have posted the details.php followed by the takeupload.php
if someone could help i would be greatful

PHP Code:

<?php
/***************************************************************************
 *  NZB Details Page
 *  ========================================
 *  NZB Mod - Public v.TS-1.0b
 *  TorrentStrike version
 *  ========================================
 *  created by dodgy
 *  http://www.webdeviation.com
 *  Special thanks to all who have had a hand in TBDev/TorrentStrike
 ***************************************************************************/

ob_start("ob_gzhandler");
?>
<script LANGUAGE="JavaScript">
<!-- Begin
var checkflag = "false";
function check(field) {
    if (checkflag == "false") {
        for (i = 0; i < field.length; i++) {
            field[i].checked = true;}
        checkflag = "true";
        return "Uncheck All"; }
    else {
        for (i = 0; i < field.length; i++) {
            field[i].checked = false; }
        checkflag = "false";
    return "Check All"; }
}
//  End -->
</script>
<?
require_once("include/bittorrent.php");
include_once(
"imdb.class.php");
dbconn();

// ----- For display of row with missing segments:
function missing_segments($segments$subjseg) {
      if (
$segments == $subjseg)
            
$display ">($segments/$subjseg)";
      elseif (
$segments $subjseg)
            
$display " color=\"red\">($segments/$subjseg)";
      elseif (
$segments $subseg)
            
$display " color=\"green\">($segments/$subjseg)";
      return 
$display;          



// ----- Cleans NZB Subjects (not finished - add your own):
function clean_nzb_subj($string) {
      
$string str_replace("&#x22;"" "$string);
      
$string str_replace("è""e"$string);
      
$string str_replace(""""\""$string);
      
$string str_replace("_"" "$string);
      return 
$string;
}

/* ---- To retrieve piece information from dB & display it on nzb page, with form
   that will record which pieces are selected by user & therefore which pieces 
   will be retrieved. ---- */
function showpieces($id$nzbname$nzbvernum) {
      
    
$pl "<form name=\"partnzb\" action=\"partnzbdload.php\" method=\"post\" enctype=\"multipart/form-data\">\n";
    
$pl .= "<table width=\"100%\" class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\">\n";
    
$pl .= "<tr><td width=\"3%\" class=\"colhead\" align=\"right\">Dl?</td>".
        
"<td class=\"colhead\">Subject</td>".
        
"<td width=\"8%\" class=\"colhead\" align=\"right\">Size</td>".
        
"<td width=\"8%\" class=\"colhead\" align=\"right\">Date</td>".
        
"<td width=\"6%\" class=\"colhead\" align=\"right\">Parts</td></tr>\n";
        
    
$piecelist = @mysql_query("SELECT nzb_piece, piece_date, piece_subject, piece_size, piece_segments, piece_subjseg FROM nzbpiecelist WHERE nzb = $id ORDER BY nzb_piece");
    
    while (
$plist mysql_fetch_array($piecelist)) {
                    
        
// Convert date:
        
$dateunix $plist['piece_date'];
        
$dateposted date("Y-m-d G:i:s"$dateunix);
        
        
// Segment display/calculation:
        
$segments $plist['piece_segments'];
        
$subjseg $plist['piece_subjseg'];
        
        
// the rows:
        
$pl .= "<tr><td>".(getNzbPermissions("part")==&& $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")?"<input type=\"checkbox\" name=\"nzbpieces[]\" ".
                    
"value=\"" $plist['nzb_piece'] .
                    
"\" />":"")."</td>".
              
"<td><font class=\"small\">" safe(clean_nzb_subj($plist['piece_subject'])) . "</font></td>".
              
"<td align=right><font class=\"small\">" mksize($plist['piece_size']) . "</font></td>".
              
"<td align=right><font class=\"small\">" $dateposted "</font></td>".
              
"<td align=right><font class=\"small\"" missing_segments($segments$subjseg) . "</font></td></tr>\n";
    }
    
    
$pl .= "</table>\n".
        
"<input type=\"hidden\" name=\"nzb\" value=\"" $id ."\" />".
        
"<input type=\"hidden\" name=\"nzb_name\" value=\"" $nzbname ."\" />".
        
"<input type=\"hidden\" name=\"nzbvernum\" value=\"" $nzbvernum ."\" />".
        
"<input type=\"button\" value=\"Check all\" onClick=\"this.value=check(partnzb)\" class=\"codebuttons\" style=\"width:90px;height:25px;\" />";
    if (
getNzbPermissions("part") == 1  && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")) {
        
$pl .= "<div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />".
        
"&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div>\n";
    } elseif (
getNzbPermissions("part") == 1  && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) {
        
$pl .= "<div align=\"center\">".getNzbPermissions("maxmsg")."</div>\n"
    } else {
        
$pl .= "<div align=\"center\">".getNzbPermissions("partmsg")."</div>\n";
    }
    
$pl .= "<a href=\"nzbdetails.php?id=$id\" class=\"sublink\">[Hide list]</a>".
            
"</form>\n";
      
    return 
$pl;      
}

loggedinorreturn();

$id $_GET["id"];

if (!isset(
$id) || !$id)
    die();
    
$res mysql_query("SELECT nzbs.owner, nzbs.name, nzbs.descr, nzbs.category, LENGTH(nzbs.nfo)AS nfosz, nzbs.filename, nzbs.size, nzbs.numfiles, nzbs.poster, nzbs.postdate, nzbs.groups, nzbs.id, nzbs.added, nzbs.views, nzbs.hits, nzbs.pars, nzbs.partotsize, nzbs.nzbvernum, nzbs.autoimdb, nzbs.url, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.format, nzbcategories.name AS cat_name, users.username FROM nzbs LEFT JOIN nzbcategories ON nzbs.category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id WHERE nzbs.id = $id")
    or 
sqlerr();
/* $res = mysql_query("SELECT nzbs.owner, nzbs.name, nzbs.descr, nzbs.category, LENGTH(nzbs.nfo)AS nfosz, nzbs.filename, nzbs.size, nzbs.numfiles, nzbs.poster, nzbs.postdate, nzbs.groups, nzbs.id, nzbs.added, nzbs.views, nzbs.hits, nzbs.pars, nzbs.partotsize, nzbs.nzbvernum, nzbs.autoimdb, nzbs.url, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.format, nzbcategories.name AS cat_name, users.username, users.advertisename FROM nzbs LEFT JOIN nzbcategories ON nzbs.category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id WHERE nzbs.id = $id")
    or sqlerr(); // USE THIS QUERY IF ANONYMOUS UPLOADER MOD PRESENT */

$row mysql_fetch_array($res);

$owned $moderator 0;
    if (
get_user_class() >= UC_MODERATOR)
        
$owned $moderator 1;
    elseif (
$CURUSER["id"] == $row["owner"])
        
$owned 1;
        
if (
$_GET["hit"]) {
    
mysql_query("UPDATE nzbs SET views = views + 1 WHERE id = $id");
    if (
$_GET["tocomm"])
        
header("Location: $BASEURL/nzbdetails.php?id=$id&page=0#startcomments");
    elseif (
$_GET["filelist"])
        
header("Location: $BASEURL/nzbdetails.php?id=$id&filelist=1#filelist");
    else
        
header("Location: $BASEURL/nzbdetails.php?id=$id");
    exit();
}

if (!isset(
$_GET["page"])) {
    
stdhead("Details for nzb \"" $row["name"] . "\"");

    
$spacer "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

    if (
$_GET["uploaded"]) {
        print(
"<h2>Successfully uploaded!</h2>\n");
    }
    elseif (
$_GET["edited"]) {
        print(
"<h2>Successfully edited!</h2>\n");
        if (isset(
$_GET["returnto"]))
            print(
"<p><b>Go back to <a href=\"" safe($_GET["returnto"]) . "\">whence you came</a>.</b></p>\n");
    }
    elseif (isset(
$_GET["searched"])) {
        print(
"<h2>Your search for \"" safe($_GET["searched"]) . "\" gave a single result:</h2>\n");
    }


    
$addtext safe($row["addtext"])."&nbsp;";
    
$format = ($row["format"]!="na"?"&nbsp;<img src=\"".$pic_base_url."sml_".$row["format"].".gif\" alt=\"".$row["format"]."\" />":"");

    
$s=$row["name"];
    print(
"<h1>$s</h1>\n");
    print(
"<h3>.: $addtext $format :.</h3>\n");
    print(
"<table width=\"750\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");

    
$url "nzbedit.php?id=" $row["id"];
    if (isset(
$_GET["returnto"])) {
        
$addthis "&returnto=" urlencode($_GET["returnto"]);
        
$url .= $addthis;
        
$keepget .= $addthis;
    }
    
$editlink "a href=\"$url\" class=\"sublink\"";
    

    
// Get permissions for download link display
    
if ((getNzbPermissions("zip") == || getNzbPermissions("nzb") == 1) && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday"))
    {
        print(
"<form action=\"nzbdownload.php/$id/" rawurlencode($row["name"]) . ".nzb\" method=\"post\">");
        print(
"<tr><td class=\"rowhead\" width=\"1%\">Download</td><td width=\"99%\" align=\"center\">");
        if (
getNzbPermissions("zip") == 1)
            print(
"<input type=\"submit\" name=\"dlzip\" value=\"Download As Zip File\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />");          
        if (
getNzbPermissions("nzb") == 1)
            print(
"&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"dlnzb\" value=\"Download As NZB\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />");
        print(
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
        print(
"</td></tr>");
        print(
"</form>\n");

    }
    elseif ((
getNzbPermissions("zip") == || getNzbPermissions("nzb") == 1) && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) {
        print(
"<tr><td class=\"rowhead\" width=\"1%\">Download</td><td width=\"99%\" align=\"center\">");
        print(
getNzbPermissions("maxmsg")."</td></tr>");
    } else {
        print(
"<tr><td class=\"rowhead\" width=\"1%\">Download</td><td width=\"99%\" align=\"center\">");
        print(
getNzbPermissions("nzbmsg")."</td></tr>");
    }



/*echo "<td width='58'>&nbsp;Download</td>
    <td width='163'><a href='/nzbdownload.php/$id/" . rawurlencode($row["name"]) . ".nzb'>download</a></td></tr>";
*/    

if (isset($row["url"])) {
    
$oIMDB = new IMDB($row["url"]);
    if (
$oIMDB -> isReady) {
        
$poster $oIMDB -> getPoster();
        
$rate $oIMDB -> getRating();
        
$dire $oIMDB -> getDirector();
        
$cast $oIMDB -> getCastAndCharacter();
        
$count $oIMDB -> getCountry();
        
$idisk $oIMDB -> getDescription();
        if (
$oIMDB->getTrailerAsUrl() != 'n/A') {
        
$vid '<iframe width="660" height="500" scrolling="no" border="0" src="' $oIMDB -> getTrailerAsUrl() . '"></iframe>';
        }else {
        
$vis $oIMDB -> getTrailerAsUrl();
        }
    }
    
$imdb '
<td width="58">&nbsp;Poster</td>
<td width="163"><img src="' 
$poster '"></td>
</tr>
<tr>
    <td>&nbsp;Rating</td>
    <td>' 
$rate '</td>
</tr>
<tr>
    <td>&nbsp;Director</td>
    <td>' 
$dire '</td>
</tr>
<tr>
    <td>&nbsp;Cast</td>
    <td>' 
$cast '</td>
</tr>
<tr>
    <td>&nbsp;County</td>
    <td>' 
$count '</td>
</tr>
<tr>
    <td>&nbsp;Description</td>
    <td>' 
$idisk '</td>
    <tr>
    <tr/>'
;

    print 
$imdb;
}

    if (!empty(
$row["descr"]))
        
$descr $row["descr"];
    else
        
$descr "";
    
$autodata = ($row["autoimdb"] == "yes"?format_comment($autodata)."":"");
    
$descri format_comment($descr);
    
tr("Description"$autodata."".$descri1);                

    if (
$row["nfosz"] > 0)
        print(
"<tr><td class=\"rowhead\" align=\"right\">NFO</td><td align=\"left\">".(getNzbPermissions("nfo") != 0?"<a href=nzbviewnfo.php?id=$row[id]><b>View NFO</b></a> (" .
            
mksize($row["nfosz"]) . ")":getNzbPermissions("nfomsg"))."</td></tr>\n");

    if (
$row["url"] != "")
        
tr("Info URL"format_urls(safe($row["url"])), 1);
     
    if (isset(
$row["cat_name"]))
        
tr("Type"$row["cat_name"]);
    else
        
tr("Type""(none selected)");
        
    if (
$row["autoimdb"] == "no" && $row["genre"] != "")
         
tr("Genre"safe($row["genre"]), 1);

    
tr("Size",mksize($row["size"]) . " (" number_format($row["size"]) . " bytes)");

    
tr("Poster"$row["poster"]);
    
    
$datenix $row["postdate"];
    
$agepost show_age($datenix);
    
$datepost date("Y-m-d H:i:s"$datenix);
    
tr("Posted"$datepost." ($agepost days ago)");
    
    
$groups unserialize($row['groups']);
    if (
is_array($groups)) {
        
$grp "";
        foreach (
$groups as $key=>$val) {
            
$grp .= "$val\n";
        }
    } else { 
        
$grp $groups;
    }     
    
tr("Groups"safe($grp));
    
    if (
$row["pars"] > 0) {
       
$percentpars sprintf"%.2f", (($row["partotsize"] / ($row["size"] - $row["partotsize"])) * 100));
    }
    
tr("par2 Files", ($row['pars'] == 0?"None":$row['pars'].", ".mksize($row["partotsize"])." in total (Can rebuild approx $percentpars% of total filesize)"));      
    
tr("NZB Added"$row["added"]);
    
tr("Views"$row["views"]);
    
tr("Grabs"$row["hits"]);
    
    
$uprow = (isset($row["username"]) ? ("<a href=userdetails.php?id=" $row["owner"] . "><b>" safe($row["username"]) . "</b></a>") : "<i>unknown</i>"); 
    
/* USE ABOVE ^^^ OR BELOW vvv DEPENDING ON WHETHER YOU HAVE THE ANONYMOUS UPLOADER MOD */
/*    $addnam = $row['advertisename'];
    $keepget = "";
    $uprow = ("<i>Anonymous</i>");
    if (get_user_class() >= UC_MODERATOR) 
        $uprow = (isset($row["username"]) ? ("<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safe($row["username"]) . "</b></a>") : "<i>unknown</i>"); 
    if ($addnam == "yes") 
        $uprow = (isset($row["username"]) ? ("<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safe($row["username"]) . "</b></a>") : "<i>unknown</i>"); */
    
if ($owned
        
$uprow .= $spacer<$editlink><b>[Edit this NZB]</b></a>"
    
tr("Upped by"$uprow1);

    
//tr("ReportNZB", "Click <a href=\"report.php?typ=nzb&id=$id\"><b><font color=\"#ff0532\">here</font></b></a> to report this NZB to staff for violation of the rules", 1);
    
    
if (!$_GET["filelist"]) {
        
tr("Num files<a href=\"nzbdetails.php?id=$id&filelist=1$keepget#filelist\" class=\"sublink\">[See full list]</a>"$row["numfiles"] . " files"1);
    } else {
        
tr("Num files"$row["numfiles"] . " files"1);     
        
tr("<a name=\"filelist\">File list</a><a href=\"nzbdetails.php?id=$id$keepget\" class=\"sublink\">[Hide list]</a>"showpieces($id$row["name"], $row['nzbvernum']), 1);
    }
    
    print(
"</table></p>\n");
    
    
/* The comparison value of '0' with $datenix is so that failed uploads with no nzbs.datepost value can be deleted by the uploader */  
    
if (($datenix!=0) && (get_user_class() >= UC_MODERATOR)) {    
        print(
"<p>\n");
        print(
"<form method=\"post\" action=\"nzbdelete.php\">\n");
        print(
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
        print(
"<tr><td class=\"row2\" colspan=\"2\"><b>Delete NZB.</b> Reason:</td></tr>");
       
// print("<td><input name=\"reasontype\" type=\"radio\" value=\"1\">&nbsp;Expired </td><td>$SITENZBRETENTION days old</td></tr>\n");
        
print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"2\">&nbsp;Dupe</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n");
        print(
"<tr><td><input name=\"reasontype\" type=\"radio\" value=\"3\">&nbsp;Nuked</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n");
        print(
"<tr><td><input name=\"reasontype\" type=\"radio\" value=\"4\">&nbsp;Rules</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(req)</td></tr>");
        print(
"<tr><td><input name=\"reasontype\" type=\"radio\" value=\"5\" checked=\"checked\" />&nbsp;Other:</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(req)</td></tr>\n");
        print(
"<input type=\"hidden\" name=\"id\" value=\"$id\" />\n");
        if (isset(
$_GET["returnto"]))
            print(
"<input type=\"hidden\" name=\"returnto\" value=\"" safe($_GET["returnto"]) . "\" />\n");
        print(
"<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Delete it!\" class=\"codebuttons\" style=\"width:120px;height:25px;\" /></td></tr>\n");
        print(
"</table>");
        print(
"</form>\n");
        print(
"</p>\n");
    } elseif ((
$datenix==0) && (getNzbPermissions("ulnzb")==1)) {
        print(
"<p>\n");
        print(
"<form method=\"post\" action=\"nzbdelete.php\">\n");
        print(
"<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
        print(
"<tr><td class=\"row2\" colspan=\"2\"><b>Delete Failed NZB.</b> Reason:</td></tr>");
        print(
"<tr><td><input name=\"reasontype\" type=\"hidden\" value=\"5\"  />&nbsp;What happened?:</td><td><input type=\"text\" size=\"40\" name=\"reason[]\">(req)</td></tr>\n");
        print(
"<input type=\"hidden\" name=\"id\" value=\"$id\" />\n");
        if (isset(
$_GET["returnto"]))
            print(
"<input type=\"hidden\" name=\"returnto\" value=\"" safe($_GET["returnto"]) . "\" />\n");
        print(
"<td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Delete it!\" class=\"codebuttons\" style=\"width:120px;height:25px;\" /></td></tr>\n");
        print(
"</table>");
        print(
"</form>\n");
        print(
"</p>\n");
    }
} else {
    
stdhead("Comments for NZB \"" $row["name"] . "\"");
    print(
"<h1>Comments for <a href=\"nzbdetails.php?id=$id\">" $row["name"] . "</a></h1>\n");
}

print(
"<p><a name=\"startcomments\"></a></p>\n");

$commentbar "<p align=\"center\"><a class=\"index\" href=\"nzbcomment.php?action=add&tid=$id\">Add a comment</a></p>\n";

$subres mysql_query("SELECT COUNT(*) FROM nzbcomments WHERE nzb = $id");
$subrow mysql_fetch_array($subres);
$count $subrow[0];

if (!
$count) {
    print(
"<h2>No comments yet</h2>\n");
} else {
    list(
$pagertop$pagerbottom$limit) = pager(20$count"nzbdetails.php?id=$id&", array(lastpagedefault => 1));

    
$subres mysql_query("SELECT nzbcomments.id, text, user, nzbcomments.added, editedby, editedat, avatar, warned, ".
        
"username, title, class, donor FROM nzbcomments LEFT JOIN users ON nzbcomments.user = users.id WHERE nzb = " .
        
"$id ORDER BY nzbcomments.id $limit") or sqlerr(__FILE____LINE__);
    
/* USE ABOVE ^^^ OR BELOW vvv DEPENDING ON WHETHER YOU HAVE THE ANONYMOUS UPLOADER MOD */
 /*   $subres = mysql_query("SELECT nzbcomments.id, text, user, nzbcomments.added, editedby, editedat, avatar, warned, ".
        "username, title, class, donor, advertisename FROM nzbcomments LEFT JOIN users ON nzbcomments.user = users.id WHERE nzb = " .
        "$id ORDER BY nzbcomments.id $limit") or sqlerr(__FILE__, __LINE__); */
    
$allrows = array();
    while (
$subrow mysql_fetch_array($subres))
        
$allrows[] = $subrow;

    print(
$commentbar);
    print(
$pagertop);

    
nzbcommenttable($allrows$row["owner"]);

    print(
$pagerbottom);
}

print(
$commentbar);

stdfoot();
?>

PHP Code:

<?php
/***************************************************************************
 *  NZB Uploading Script
 *  ========================================
 *  NZB Mod - Public v.TS-1.0b
 *  TorrentStrike version
 *  ========================================
 *  created by dodgy
 *  http://www.webdeviation.com
 *  Special thanks to all who have had a hand in TBDev/TorrentStrike
 ***************************************************************************/

/* The max execution time of the script and the memory limit need to be quite high here - depending on your server you may even need to raise this a little higher. */ 
ini_set("max_execution_time""3000");
ini_set("memory_limit""32M");
ini_set("upload_max_filesize"$MAXNZBSIZE);
require_once(
"include/bittorrent.php");
include_once(
"include/zipclasses.php");

$zipped false;
dbconn();
 
 if (!empty(
$_POST['url']))
$url unesc($_POST['url']);  


// for extracting the number of segments from the subject
function subj_seg($input)
{
    for (
$i=strlen($input);$i>0;$i--) {
        if (
$input{$i} == "/") {
            break;
        }
    }

    
$segs substr($input,$i);
    
$segs str_replace("/"""$segs);
    
$segs str_replace(")"""$segs);
    return 
$segs;    
}

// Prevents simplexml utf-8 errors, forces subjects/poster to utf-8
function clean_utf8($where) {
    
$filecontent file_get_contents($where);
    
$filecontent = @mb_convert_encoding($filecontent"UTF-8");
    
file_put_contents($where$filecontent);
    unset (
$filecontent);
}

// to get nzb version number (DTD) and strip comments left by anything else
function nzb_ver_num($where) {
    global 
$SITESLOGAN;

    
$filecontent file_get_contents($where);
    
    if (
eregi("//newzBin//DTD NZB 1.0//EN"$filecontent)) {
        
$nzbvernum "1.0";
    } elseif (
eregi("//newzBin//DTD NZB 0.9//EN"$filecontent)) {
        
$nzbvernum "0.9";
    
// for some odd nzbs that are appearing with no DTD, assume they're 1.0
    
} elseif (eregi("<nzb>"$filecontent)) { 
        
$nzbvernum "1.0";
    } else {
        
bark("Invalid NZB File! See the FAQ.");
    }
        
    
$goodstring $SITESLOGAN;
    if (
eregi("<!--(.*)-->"$filecontent$matches)) {
        
$badstring $matches[1];
        
$filecontent str_replace($badstring$goodstring$filecontent);
        
file_put_contents($where$filecontent);
    }      
    
    unset (
$badstring$goodstring$filecontent$matches);
    return 
$nzbvernum;
}    

// To store each piece (<file>***</file>) in the db, includes crude dupe checker
// Regexp matches were quicker in testing for this than using simplexml
function storepieces($where$id) {
         
    
$filecontent file_get_contents($where);
    
$parts explode("</file>"$filecontent);
    
$nzbpiece 0;
    
    if (
eregi("<file (.*)"$parts[1], $matches)) {
        
$dupepiece $matches[1];
        
$dupepiece "<file ".$dupepiece."";
        
$dupepiece sqlesc($dupepiece);
        
$dupe mysql_query("SELECT nzb FROM nzbpiecelist WHERE filepiece = $dupepiece");
    
        if ((
mysql_num_rows($dupe) == 0) || !$dupe) {
            foreach(
$parts as $part){
                if (
eregi("<file (.*)"$part$matches)) {
                    
$filepiece $matches[1];
                    
$filepiece "<file ".$filepiece."";
                    
$filepiece sqlesc($filepiece);
                    
mysql_query("INSERT INTO nzbpiecelist (nzb, nzb_piece, filepiece) VALUES ($id$nzbpiece$filepiece)");
                    
$nzbpiece++;
                }
            }
        } elseif (
mysql_num_rows($dupe) > 0) {
            
mysql_query("DELETE FROM nzbs WHERE id = $id");
            
bark("This is a duplicate NZB, use search next time!");
        }
    }
    
    unset (
$parts$dupepiece$filecontent$nzbpiece$matches$dupe);


// NZB Parser - simplexml version (for php5)
// To gather info about each piece to store in db (to later retrieve and show filelist)
// This is the preferable method as it is very quick
function pieceslisting($where$id) {
      
    
$filecontent file_get_contents($where);
    
$xml simplexml_load_string($filecontent) or die ("Unable to load XML file!"); 
    
    
$nzbpiece 0;
    
    foreach(
$xml->{"file"} as $nfile) {
        
$nposter = (string) trim($nfile['poster']);
        
$nposter sqlesc($nposter);
                    
        
$ndate trim($nfile['date']);
                    
        
$nsubject = (string) trim($nfile['subject']);
        
// To find num of segments in subject:
        
$nsubjsegs subj_seg($nsubject);
        
        
// To find out if Par or not
        
$npar sqlesc(stristr($nsubject"par2")?0:1);
        
        
$nsubject sqlesc($nsubject);
                    
        
$groups = array();
        foreach(
$nfile->groups->group as $group) {
              
$groups[] = (string) trim($group);
        }
        
$ngroups sqlesc(serialize($groups));
                               
        
$nsegcount 0;
        
$nsize 0;
        foreach(
$nfile->segments->segment as $segment) {
              
$nbytes trim($segment['bytes']);
              
$nsize += $nbytes;
              
$nsegcount++; 
        }
                  
        
$query mysql_query("UPDATE nzbpiecelist SET piece_poster = $nposter, piece_date = $ndate, piece_subject = $nsubject, piece_groups = $ngroups, piece_size = $nsize, piece_segments = $nsegcount, piece_subjseg = $nsubjsegs, piece_par = $npar WHERE nzb = $id AND nzb_piece = $nzbpiece");
        if(!
$query)
              
sqlerr(__FILE____LINE__);
        
        
$nzbpiece++;
    }
    unset (
$filecontent$nzbpiece$xml$nposter$ndate$nsubject$ngroups$nsize$nsegcount$nsubjsegs$npar);
}

/*
// NZB Parser - DOM xml version (for php5)
// To gather info about each piece to store in db (to later retrieve and show filelist)
// Note that this method is supposedly very slow when handling large documents
function pieceslisting($where, $id) {

    // here we must specify the version of XML : i.e: 1.0 
    $xml = new DOMDocument('1.0');
    $xml->loadXML(file_get_contents($where));
    
    $nzbpiece = 0;
    
    foreach($xml->getElementsByTagName('file') as $nfile) {
            
        $nposter = $nfile->getAttribute('poster');
        $nposter = sqlesc($nposter);
        
        $ndate = $nfile->getAttribute('date');
        $ndate = 0 + $ndate;
        
        $nsubject = $nfile->getAttribute('subject');
        
        // To find num of segments in subject:
        $nsubjsegs = 0 + subj_seg($nsubject);
        
        // To find out if Par or not
        $npar = sqlesc(stristr($nsubject, "par2")?0:1);
        
        $nsubject = sqlesc($nsubject);
        
        // For groups:
        $groups = array();
        $xmlgroups = $nfile->getElementsByTagName('groups')->item(0);
        foreach ($xmlgroups->getElementsByTagName('group') as $groupNode) {
            $groups = $groupNode->firstChild->nodeValue;
        }
        $ngroups = sqlesc(serialize($groups));
        
        //For segments:
        $nsegcount = 0;
        $nsize = 0;
        $xmlsegments = $nfile->getElementsByTagName('segments')->item(0);
        foreach ($xmlsegments->getElementsByTagName('segment') as $segmentNode) {
            $nbytes = $segmentNode->getAttribute('bytes');
            $nsize += $nbytes;
            $nsegcount++;
        }
        
        $query = mysql_query("UPDATE nzbpiecelist SET piece_poster = $nposter, piece_date = $ndate, piece_subject = $nsubject, piece_groups = $ngroups, piece_size = $nsize, piece_segments = $nsegcount, piece_subjseg = $nsubjsegs, piece_par = $npar WHERE nzb = $id AND nzb_piece = $nzbpiece");
        if(!$query)
              sqlerr(__FILE__, __LINE__);
        
        $nzbpiece++;
    }
    unset ($xml, $nzbpiece, $nposter, $ndate, $nsubject, $ngroups, $nsize, $nsegcount, $nsubjsegs, $npar);
}
*/
/*
// NZB Parser - domxml version (for php4.3.x)
// To gather info about each piece to store in db (to later retrieve and show filelist)
// ***THIS VERSION OF THE NZB PARSER IS CURRENTLY UNTESTED! SEE THE README!***
function pieceslisting($where, $id) {

    if (!$xml = domxml_open_file($where))
        die ("Unable to load XML file!");
    
    $nzbpiece = 0;
    
    foreach($xml->get_elements_by_tagname('file') as $nfile) {
            
        $nposter = $nfile->get_attribute('poster');
        $nposter = sqlesc($nposter);
        
        $ndate = $nfile->get_attribute('date');
        $ndate = 0 + $ndate;
        
        $nsubject = $nfile->get_attribute('subject');
        
        // To find num of segments in subject:
        $nsubjsegs = 0 + subj_seg($nsubject);
        
        // To find out if Par or not
        $npar = sqlesc(stristr($nsubject, "par2")?0:1);
        
        $nsubject = sqlesc($nsubject);
        
        // For groups:
        $groups = array();
        $xmlgroups = $nfile->get_elements_by_tagname('groups');
        foreach ($xmlgroups->get_elements_by_tagname('group') as $groupNode) {
            $groups = $groupNode->first_child->node_value;
            // $groups = $groupNode->get_content(); // ??? This could possibly work instead
        }
        $ngroups = sqlesc(serialize($groups));
        
        //For segments:
        $nsegcount = 0;
        $nsize = 0;
        $xmlsegments = $nfile->get_elements_by_tagname('segments');
        foreach ($xmlsegments->get_elements_by_tagname('segment') as $segmentNode) {
            $nbytes = $segmentNode->get_attribute('bytes');
            $nsize += $nbytes;
            $nsegcount++;
        }
        
        $query = mysql_query("UPDATE nzbpiecelist SET piece_poster = $nposter, piece_date = $ndate, piece_subject = $nsubject, piece_groups = $ngroups, piece_size = $nsize, piece_segments = $nsegcount, piece_subjseg = $nsubjsegs, piece_par = $npar WHERE nzb = $id AND nzb_piece = $nzbpiece");
        if(!$query)
              sqlerr(__FILE__, __LINE__);
        
        $nzbpiece++;
    }
    unset ($xml, $nzbpiece, $nposter, $ndate, $nsubject, $ngroups, $nsize, $nsegcount, $nsubjsegs, $npar);
}
*/      

// Need to ensure that zip file is deleted when script dies
function bark($msg) {
    global 
$zipped$fname;
    if (
$zipped)
        @
unlink($fname);
    
genbark($msg"Upload failed!");
}

loggedinorreturn();

// Check upload permission
if (getNzbPermissions("ulnzb")==0)
  die;

/*// if upload disabled:  
if ($CURUSER["uploadpos"] == 'no')
die;*/

if ($_POST["nonimdb"])
    
$isimdb "nonimdb";
elseif (
$_POST["imdb"])
    
$isimdb "imdb";
else
    
bark("WTF! How'd you end up here?");      
  
if (
$isimdb == "nonimdb") {
    foreach(
explode(":","descr:type:name:format") as $v) {
        if (!isset(
$_POST[$v]))
            
bark("missing form data");
    }
} elseif (
$isimdb == "imdb") {
    foreach(
explode(":","imdburl:type:format") as $v) {
        if (!isset(
$_POST[$v]))
            
bark("missing form data");
    }
} else {
    
bark("WTF! How'd you end up here?");
}

if (!isset(
$_FILES["file"]))
    
bark("missing form data");
    
$f $_FILES["file"];
$fname unesc($f["name"]);
if (empty(
$fname))
    
bark("Empty filename!");
if (
eregi("http:"$fname) || eregi("www\."$fname))
    
bark("Filename cannot contain a URL!");
    
$nfofile $_FILES['nfo'];
if (
$nfofile['name'] != '')

{
    if (
$nfofile['size'] == 0)
        
bark("0-byte NFO");

    if (
$nfofile['size'] > 65535)
        
bark("NFO is too big! Max 65,535 bytes.");

    
$nfofilename $nfofile['tmp_name'];

    if (@!
is_uploaded_file($nfofilename))
        
bark("NFO upload failed");
}

$descr unesc($_POST["descr"]);
if (
$isimdb == "nonimdb") {
    if (!
$descr)
        
bark("You must enter a description!");
}
  
$catid = ($_POST["type"]);
if (!
is_valid_id($catid))
    
bark("You must select a category to put the NZB in!");

$tmpname $f["tmp_name"];
if (!
is_uploaded_file($tmpname))
    
bark("eek");

// zipped uploads:    
if (getNzbPermissions("ulzip")==1) {
    if (
preg_match('/^(.+)\.zip$/si'$fname$matches)) {
        
$zipname $matches[1];
        
$zip = new dUnzip2($tmpname);
        
$list $zip->getList();
        
$zpdfilecount 0;
        foreach(
$list as $fileName=>$zippedFile) {
            
$zpdnzb $fileName;
            
$zpdfilecount++;
        }
        if (
$zpdfilecount>1)
            
bark("Only upload one file at a time!");
        if (!
preg_match('/^(.+)\.nzb$/si'$zpdnzb))
            
bark("What did you just upload?!!");
        
$zip->unzip("$zpdnzb""$zpdnzb");
        if (!
file_exists("$zpdnzb")) 
            
bark("What did you just upload?!!");
        
$fname $tmpname = (string) $zpdnzb;
        
$zipped true;
    }
}

if (!
filesize($tmpname))
    
bark("Empty file!");    

if (!
validfilename($fname))
    
bark("Invalid filename!");
if (!
preg_match('/^(.+)\.nzb$/si'$fname$matches))
    
bark("Invalid filename (not an .nzb).");
$shortfname $nzbname $matches[1];
if (!empty(
$_POST["name"])) {
    
$nzbname unesc($_POST["name"]);
    if (!
validfilename($nzbname))
        
bark("Invalid name for the NZB in the Name field, please change it!");
}
    
$format sqlesc($_POST["format"]);

if (!empty(
$_POST["addtext"])) {
    
$addtext = (strlen($_POST["addtext"])>25?substr($_POST["addtext"],0,25):$_POST["addtext"]);
    
$addtext sqlesc($addtext);
} else {
    
$addtext sqlesc("");
}

if (
$isimdb == "nonimdb") { 
    if (!empty(
$_POST["genre"])) {
         
$genre = (strlen($_POST["genre"])>10?substr($_POST["genre"],0,10):$_POST["genre"]);
         
$genre sqlesc($_POST["genre"]);
    } else {
         
$genre sqlesc("");
    }
    if (!empty(
$_POST["url"]))
         
$url sqlesc($_POST["url"]);
    else
         
$url sqlesc("");
} elseif (
$isimdb == "imdb") {
    
$url $_POST["imdburl"];
    if (
$url == "")
        
bark("You must enter an IMDB url!");
    if (!
strpos($url"imdb") || !strpos($url"title") || !strpos($url"tt"))
        
bark("Invalid IMDb url!");
    
$url sqlesc($url);
    
$genre sqlesc("");
}
           
$autoimdb = ($isimdb == "nonimdb"?sqlesc("no"):sqlesc("yes"));

$imdbrating sqlesc("");       

// Replace punctuation characters with spaces    
$nzbname str_replace("_"" "$nzbname);
$nzbname str_replace("%20"" "$nzbname);

$cuser $CURUSER["id"];
$category $_POST["type"];

$nzbvernum nzb_ver_num($tmpname);

$nfo sqlesc(str_replace("\x0d\x0d\x0a""\x0d\x0a", @file_get_contents($nfofilename)));
$ret mysql_query("INSERT INTO nzbs (owner, name, descr, ori_descr, category, nfo, nzbvernum, autoimdb, url, imdbrating, genre, addtext, format) VALUES (" $cuser "," sqlesc($nzbname) . "," sqlesc($descr) . "," sqlesc($descr) . "," $category "," $nfo "," sqlesc($nzbvernum) . "," $autoimdb "," $url "," $imdbrating "," $genre "," $addtext "," $format ")");
        
if (!
$ret) {
    if (
mysql_errno() == 1062)
        
bark("nzb already uploaded!");
    
bark("mysql puked: ".mysql_error());
}

$id mysql_insert_id();

mysql_query("DELETE FROM nzbpiecelist WHERE nzb = $id");

clean_utf8($tmpname);

storepieces($tmpname$id);

// add pieces to db and return some info from them
pieceslisting($tmpname$id);

$extrainfo =  @mysql_query("SELECT piece_poster, piece_date, piece_subject, piece_groups, piece_par FROM nzbpiecelist WHERE nzb = $id AND nzb_piece = 0") or sqlerr(__FILE____LINE__);
$counting = @mysql_query("SELECT piece_size FROM nzbpiecelist WHERE nzb = $id") or sqlerr(__FILE____LINE__);
$totsize = @mysql_query("SELECT SUM(piece_size) AS tot_size FROM nzbpiecelist WHERE nzb = $id") or sqlerr(__FILE____LINE__);
$parcount = @mysql_query("SELECT piece_size FROM nzbpiecelist WHERE nzb = $id AND piece_par = 1 ") or sqlerr(__FILE____LINE__);
$partotsize = @mysql_query("SELECT SUM(piece_size) AS par_tot_size FROM nzbpiecelist WHERE nzb = $id AND piece_par = 1") or sqlerr(__FILE____LINE__); 


$numfiles mysql_num_rows($counting);
$numpars mysql_num_rows($parcount);

// find out total filesize (the size of the to-be-downloaded files)
$ptsize mysql_result($totsize0);
$parsize mysql_result($partotsize0);
if (!
$parsize)
      
$parsize 0;

$einfo mysql_fetch_array($extrainfo);
$pposter sqlesc($einfo['piece_poster']);
$pdate $einfo['piece_date'];
$psubject $einfo['piece_subject'];
// remember that groups are in a serialised array!
$pgroups sqlesc($einfo['piece_groups']);

// get 4 extra digits for filename (to stop direct downloads)
srand( (double)microtime()*1000000 );
$rand rand(10004999);

// rename nzb 
$nzbfilename $id."-".$nzbname."-".$SITENAME4FILE."-".$rand.".nzb";

// add extra details:
$updateset = array();
$updateset[] = "search_text = " sqlesc(searchfield("$shortfname $nzbname $psubject"));
$updateset[] = "filename = " sqlesc($nzbfilename);
$updateset[] = "size = " $ptsize;
$updateset[] = "numfiles = " $numfiles;
$updateset[] = "poster = " $pposter;
$updateset[] = "postdate = " $pdate;
$updateset[] = "groups = " $pgroups;
$updateset[] = "pars = " $numpars;
$updateset[] = "partotsize = " $parsize;
$updateset[] = "added = '" get_date_time() ."'";

$ret2 mysql_query("UPDATE nzbs SET " join(","$updateset) . " WHERE id = $id"); 

if (!
$ret2) {
    
bark("mysql puked: ".mysql_error());
}

$nzbfilename str_replace(" ""_"$nzbfilename);

// move nzb:
if (!$zipped) {
    
move_uploaded_file($tmpname$SITENZBDIR."/".$nzbfilename); 
} else {
    
$formove file_get_contents($tmpname);
    
file_put_contents($SITENZBDIR."/".$nzbfilename$formove);
    @
unlink($tmpname);
    unset (
$formove); 
}

// create zip file:
$createZip = new createZip;  
$fileContents file_get_contents($SITENZBDIR."/".$nzbfilename); 
$createZip -> addFile($fileContents$nzbfilename);
$fileName "$nzbfilename.zip";
$fd fopen ($fileName"wb");
fwrite ($fd$createZip -> getZippedfile());
fclose ($fd);
$formove file_get_contents($fileName);
file_put_contents($SITENZBDIR."/".$fileName$formove);
@
unlink($fileName); 

header("Location: $BASEURL/nzbdetails.php?id=$id&uploaded=1");
?>

Bump: ok so i can get the imdb rating on the details.php using the code below

PHP Code:

if (isset($row["url"])) {
    
$oIMDB = new IMDB($row["url"]);
    if (
$oIMDB -> isReady) {
        
$poster $oIMDB -> getPoster();
        
$rate $oIMDB -> getRating();
        
$dire $oIMDB -> getDirector();
        
$cast $oIMDB -> getCastAndCharacter();
        
$count $oIMDB -> getCountry();
        
$idisk $oIMDB -> getDescription();
        if (
$oIMDB->getTrailerAsUrl() != 'n/A') {
        
$vid '<iframe width="660" height="500" scrolling="no" border="0" src="' $oIMDB -> getTrailerAsUrl() . '"></iframe>';
        }else {
        
$vis $oIMDB -> getTrailerAsUrl();
        }
    }
    
$imdb '
<td width="58">&nbsp;Poster</td>
<td width="163"><img src="' 
$poster '"></td>
</tr>
<tr>
    <td>&nbsp;Rating</td>
    <td>' 
$rate '</td>
</tr>
<tr>
    <td>&nbsp;Director</td>
    <td>' 
$dire '</td>
</tr>
<tr>
    <td>&nbsp;Cast</td>
    <td>' 
$cast '</td>
</tr>
<tr>
    <td>&nbsp;County</td>
    <td>' 
$count '</td>
</tr>
<tr>
    <td>&nbsp;Description</td>
    <td>' 
$idisk '</td>
    <tr>
    <tr/>'
;

    print 
$imdb;


which works a treat. i have on the browse.php a imdb rating which i am trying to get to work. to get this to work i am trying to get the $rate above to work in takeupload.php but i dont have a clue how to send it to that php to work i know where to put it but i need the information there

Bump: I have tried to put the same code that I put in details to get the $rate into takeupload but I get a blank screen and doesnt work plz help me guys

WhyMe 28th March 2015 01:17

any one have a up to date imdb

TheLastKinQ 19th July 2015 13:13

how to display imdb rating on browse.php

pls help me

mirage 20th July 2015 12:51

Send me your imdb files and i will help you


All times are GMT +2. The time now is 12:36.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.