Jump to content

gemma134uk

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gemma134uk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. lol that would explain it thanx but where is the code for me to change this?
  2. hi im trying to add a border round my files but not sure where to start in the pic below is what they look like and the pic below that is what i would like them to look like (with borders) mine http://img362.imageshack.us/img362/1092/70728577qt7.jpg id like the borders round the files like the pic below http://img100.imageshack.us/img100/4397/83419719uy4.jpg below is my browse.php file <?php ob_start("ob_gzhandler"); require_once("include/bittorrent.php"); loggedinorreturn(); $cats = nzbgenrelist(); $searchstr = unesc($_GET["search"]); $cleansearchstr = searchfield($searchstr); if (empty($cleansearchstr)) unset($cleansearchstr); $grpsearch = unesc($_GET["grpsearch"]); $cleangrpsearch = searchfield($grpsearch); if (empty($cleangrpsearch)) unset($cleangrpsearch); if ($_GET['sort'] && $_GET['type']) { $column = ''; $ascdesc = ''; switch($_GET['sort']) { case '1': $column = "name"; break; case '2': $column = "added"; break; case '3': $column = "postdate"; break; default: $column = "id"; break; } switch($_GET['type']) { case 'asc': $ascdesc = "ASC"; break; case 'desc': $ascdesc = "DESC"; break; default: $ascdesc = "DESC"; break; } $orderby = "ORDER BY nzbs." . $column . " " . $ascdesc; $pagerlink = "sort=" . $_GET['sort'] . "&type=" . $_GET['type'] . "&"; } else { $orderby = "ORDER BY nzbs.id DESC"; $pagerlink = ""; } $addparam = ""; $wherea = array(); $wherecatina = array(); $category = (int)$_GET["cat"]; $all = $_GET["all"]; if (!$all) if (!$_GET && $CURUSER["notifs"]) { $all = True; foreach ($cats as $cat) { $all &= $cat[id]; if (strpos($CURUSER["notifs"], "[cat" . $cat[id] . "]") !== False) { $wherecatina[] = $cat[id]; $addparam .= "c$cat[id]=1&"; } } } elseif ($category) { if (!is_valid_id($category)) stderr("Error", "Invalid category ID."); $wherecatina[] = $category; $addparam .= "cat=$category&"; } else { $all = True; foreach ($cats as $cat) { $all &= $_GET["c".$cat['id']]; if ($_GET["c".$cat['id']]) { $wherecatina[] = $cat['id']; $addparam .= "c".$cat['id']."=1&"; } } } if ($all) { $wherecatina = array(); $addparam = ""; } if (count($wherecatina) > 1) $wherecatin = implode(",",$wherecatina); elseif (count($wherecatina) == 1) $wherea[] = "category = $wherecatina[0]"; $wherebase = $wherea; $searchwhere = $_GET["searchwhere"]; if (isset($cleansearchstr)) { if ($searchwhere == "both") { $wherea[] = "MATCH (nzbs.name, nzbs.search_text, nzbs.ori_descr) AGAINST (" . sqlesc($searchstr) . ")"; $addparam .= "search=" . urlencode($searchstr) . "&searchwhere=both&"; } if ($searchwhere == "desc") { $wherea[] = "MATCH (nzbs.ori_descr) AGAINST (" . sqlesc($searchstr) . ")"; $addparam .= "search=" . urlencode($searchstr) . "&searchwhere=desc&"; } if ($searchwhere == "title") { $wherea[] = "MATCH (nzbs.name) AGAINST (" . sqlesc($searchstr) . ")"; $addparam .= "search=" . urlencode($searchstr) . "&searchwhere=title&"; } } if (isset($cleangrpsearch)) { $wherea[] = "groups LIKE '%" . sqlwildcardesc($grpsearch) . "%'"; $addparam .= "grpsearch=" . urlencode($grpsearch) . "&"; } // for retention: $retent = nzbretention(); if ($retent) $wherea[] = "postdate > $retent"; $where = implode(" AND ", $wherea); if ($wherecatin) $where .= ($where ? " AND " : "") . "category IN(" . $wherecatin . ")"; if ($where != "") $where = "WHERE $where"; $res = mysql_query("SELECT COUNT(*) FROM nzbs $where") or die(mysql_error()); $row = mysql_fetch_array($res); $count = $row[0]; if (!$count && isset($cleansearchstr)) { $wherea = $wherebase; $searcha = explode(" ", $cleansearchstr); $sc = 0; foreach ($searcha as $searchss) { if (strlen($searchss) <= 1) continue; $sc++; if ($sc > 5) break; $ssa = array(); if (($searchwhere == "both") || ($searchwhere == "desc")) { foreach (array("nzbs.name", "nzbs.search_text", "nzbs.ori_descr") as $sss) $ssa[] = "$sss LIKE '%" . sqlwildcardesc($searchss) . "%'"; } elseif ($searchwhere == "title") { foreach (array("nzbs.name") as $sss) $ssa[] = "$sss LIKE '%" . sqlwildcardesc($searchss) . "%'"; } $wherea[] = "(" . implode(" OR ", $ssa) . ")"; } if ($sc) { $where = implode(" AND ", $wherea); if ($where != "") $where = "WHERE $where"; $res = mysql_query("SELECT COUNT(*) FROM nzbs $where"); $row = mysql_fetch_array($res); $count = $row[0]; } } $nzbsperpage = $CURUSER["nzbsperpage"]; if (!$nzbsperpage) $nzbsperpage = 30; // Change to whatever default you want if ($count) { if ($addparam != "") { if ($pagerlink != "") { if ($addparam{strlen($addparam)-1} != ";") { // & = & $addparam = $addparam . "&" . $pagerlink; } else { $addparam = $addparam . $pagerlink; } } } else { $addparam = $pagerlink; } list($pagertop, $pagerbottom, $limit) = pager($nzbsperpage, $count, "nzbbrowse.php?" . $addparam); $query = "SELECT nzbs.id, nzbs.category, nzbs.name, nzbs.hits, nzbs.size, nzbs.added, nzbs.comments, nzbs.numfiles, nzbs.filename, nzbs.owner, nzbs.groups, nzbs.format, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.autoimdb, nzbs.url, nzbs.postdate, IF(nzbs.nfo <> '', 1, 0) as nfoav," . "nzbcategories.name AS cat_name, nzbcategories.image AS cat_pic, users.username FROM nzbs LEFT JOIN nzbcategories ON category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id $where $orderby $limit"; /* $query = "SELECT nzbs.id, nzbs.category, nzbs.name, nzbs.hits, nzbs.size, nzbs.added, nzbs.comments, nzbs.numfiles, nzbs.filename, nzbs.owner, nzbs.groups, nzbs.format, nzbs.imdbrating, nzbs.genre, nzbs.addtext, nzbs.autoimdb, nzbs.url, nzbs.postdate, IF(nzbs.nfo <> '', 1, 0) as nfoav," . "nzbcategories.name AS cat_name, nzbcategories.image AS cat_pic, users.username, users.advertisename FROM nzbs LEFT JOIN nzbcategories ON category = nzbcategories.id LEFT JOIN users ON nzbs.owner = users.id $where $orderby $limit"; // USE THIS QUERY IF ANONYMOUS UPLOADER MOD PRESENT */ $res = mysql_query($query) or die(mysql_error()); } else unset($res); if (isset($cleansearchstr)) stdhead("NZB Search results for \"$searchstr\""); else stdhead("NZB's"); ?> <STYLE TYPE="text/css" MEDIA=screen> a.catlink:link, a.catlink:visited{ text-decoration: none; font-size: 7pt; } a.catlink:hover { color: #444444; font-size: 7pt; } </STYLE> <form method="get" action="nzbbrowse.php"> <table class="bottom"> <tr> <td class="bottom"> <table class="bottom"> <tr> <? $i = 0; foreach ($cats as $cat) { $catsperrow = 7; print(($i && $i % $catsperrow == 0) ? "</tr><tr>" : ""); print("<td class=\"bottom\" style=\"padding-bottom: 2px;padding-left: 7px\"><input name=\"c$cat[id]\" alt=\"Select multiple categories\" title=\"Select multiple categories\" type=\"checkbox\" " . (in_array($cat['id'],$wherecatina) ? "checked=\"checked\" " : "") . "value=\"1\" /><br /><a class=\"catlink\" href=\"nzbbrowse.php?cat=".$cat["id"]."\" alt=\"Show all in this category\" title=\"Show all in this category\">" . safe($cat['name']) . "</a></td>\n"); $i++; } $alllink = "<div align=\"left\">(<a href=\"nzbbrowse.php?all=1\" alt=\"Show all categories\" title=\"Show all categories\"><b>Show all</b></a>)</div>"; $ncats = count($cats); $nrows = ceil($ncats/$catsperrow); $lastrowcols = $ncats % $catsperrow; if ($lastrowcols != 0) { if ($catsperrow - $lastrowcols != 1) { print("<td class=\"bottom\" rowspan=\"" . ($catsperrow - $lastrowcols - 1) . "\"> </td>"); } print("<td class=\"bottom\" style=\"padding-left: 5px\">$alllink</td>\n"); } ?> </tr> </table> </td> <td class="bottom"> <table class="main"> <tr> <td class="bottom" style="padding: 1px;padding-left: 10px"> <select name="incldead"> <option value="0">All</option> </select> </td> <? if ($ncats % $catsperrow == 0) print("<td class=\"bottom\" style=\"padding-left: 15px\" rowspan=\"$nrows\" valign=\"center\" align=\"right\">$alllink</td>\n"); ?> </tr> <tr> <td class="bottom" style="padding: 1px;padding-left: 10px"> <div align="center"> <input type="submit" class="codebuttons" style="width:80px;height:25px;" alt="Show all selected categories" title="Show all selected categories" value="Go!" /> </div> </td> </tr> </table> </td> </tr> </table> </form> <!-- Search --> <p> <table width="750" class="main" border="0" cellspacing="0" cellpadding="0"><tr><td class="embedded"> <form method="get" action="nzbbrowse.php"> <p align="center"> Search <select name="searchwhere"> <option value="title">titles</option> <option value="desc"<?=($searchwhere=="desc"?" selected=\"selected\"":"")?>>descriptions</option> <option value="both"<?=($searchwhere=="both"?" selected=\"selected\"":"")?>>both</option> </select> for <input type="text" name="search" size="40" value="<?= safe($searchstr) ?>" /> in <select name="cat"> <option value="0">(all types)</option> <? $cats = nzbgenrelist(); $catdropdown = ""; foreach ($cats as $cat) { $catdropdown .= "<option value=\"" . $cat["id"] . "\""; if ($cat["id"] == $_GET["cat"]) $catdropdown .= " selected=\"selected\""; $catdropdown .= ">" . safe($cat["name"]) . "</option>\n"; } ?> <?= $catdropdown ?> </select> <br /><br /> <input type="submit" class="codebuttons" style="width:80px;height:25px;" value="Search!" /> </p> </form> </td></tr></table> <!-- End Search --> <? if (isset($cleansearchstr)) print("<h2>Search results for \"" . safe($searchstr) . "\"</h2>\n"); if ($count) { print($pagertop); nzbtable($res); print($pagerbottom); } else { if (isset($cleansearchstr)) { print("<h2>Nothing found!</h2>\n"); print("<p>Try again with a refined search string.</p>\n"); } else { print("<h2>Nothing here!</h2>\n"); print("<p>Sorry pal </p>\n"); } } mysql_query("UPDATE users SET last_nzbrowse=".gmtime()." where id=".$CURUSER['id']); stdfoot(); ?> thanx in advance x
  3. ok il have a play with it and thanks for all your help
  4. i just need the zip button to download url.nzb.zip instead of url.nzb
  5. ok thank you works now and its downloading .nzbs but the zip download also downloads a nzb? nearlly there now thank you so much
  6. still blank after removing the " what if i make this print("<input type="hidden", name="dlzip" value="Download As Zip File" />"); like this print("<input type=\"hidden\" name=\"dlzip\" value="Download As Zip File" />"); do you think that would work and the same with print("<input type="hidden", name="dlnzb" value="Download As NZB" />"); ?
  7. ok ive added the code you just put in and the whole page goes blank if (getNzbPermissions("zip") == 1) print("<input type=\"image\" name=\"dlzip\" src=\"/image/zip.gif\" style=\"width:200px;height:25px;\" alt=\"ZIP\"/>"); print("<input type="hidden", name="dlzip" value="Download As Zip File" />"); if (getNzbPermissions("nzb") == 1) print(" <input type=\"image\" name=\"dlnzb\" src=\"/images/nzb.gif\" style=\"width:200px;height:25px;\" alt=\"NZB\"/>"); print("<input type="hidden", name="dlnzb" value="Download As NZB" />"); below is the code in the whole .php have i done it right? <?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"); // ----- 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("&#232;", "e", $string); $string = str_replace("&#34;", "\"", $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 = 0 + $plist['piece_segments']; $subjseg = 0 + $plist['piece_subjseg']; // the rows: $pl .= "<tr><td>".(getNzbPermissions("part")==1 && $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 .= "<br /><div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />". " <input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div><br /><br />\n"; } elseif (getNzbPermissions("part") == 1 && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) { $pl .= "<br /><div align=\"center\">".getNzbPermissions("maxmsg")."</div><br /><br />\n"; } else { $pl .= "<br /><div align=\"center\">".getNzbPermissions("partmsg")."</div><br /><br />\n"; } $pl .= "<a href=\"nzbdetails.php?id=$id\" class=\"sublink\">[Hide list]</a>". "</form>\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); // -------------------------------Auto IMDB Mod--------------------------------------------// if ($row["autoimdb"] == "yes") { 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 (); $genres = $movie->genres (); $photoremurl = $movie->photo (); if ($photoremurl) { $autodata = "[img=".$photoremurl."]"; } $autodata .= "[img=pic/sml_info.gif]"; // This'll also be useful for storage further down: $movtitle = (string) $movie->title (); $movtitle = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $movtitle); $autodata .= "[b][color=DimGray] Title: [/color][color=DarkSlateBlue] " . "".$movtitle."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Alt Titles : [/color][color=DarkSlateBlue] "; if ($movie->alsoknow() != "") { foreach ( $movie->alsoknow() as $ak){ $autodata .= "".str_replace(array("&#34;", "[", "]"), array("\"", "(", ")"), $ak["title"])."" . "".$ak["year"]."" . "".$ak["country"]."" . " (" . "".$ak["comment"]."" . ")" . ", "; } } $autodata .= "[/color][/b]\n[b][color=DimGray] Year: [/color][color=DarkSlateBlue] " . "".$movie->year ()."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Runtime: [/color][color=DarkSlateBlue] " . "".$movie->runtime ()."" . " mins[/color][/b]\n"; // store rating for later use $movrating = $movie->rating (); $desc_rating = ($movrating == ""?"Not Yet Rated":$movrating); $autodata .= "[b][color=DimGray] User Rating: [/color][color=DarkSlateBlue] " . "".$desc_rating."[/color][/b]\n"; $desc_votes = (string) $movie->votes (); $desc_votes = (strlen($desc_votes)>7?substr($desc_votes,0, 7):$desc_votes); $desc_votes = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $desc_votes); $autodata .= "[b][color=DimGray] Votes: [/color][color=DarkSlateBlue] " . "".$desc_votes."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Language: [/color][color=DarkSlateBlue] " . "".$movie->language ()."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Country: [/color][color=DarkSlateBlue] "; for ($i = 0; $i < count ($country); $i++) { $autodata .= "$country[$i]"; } for ($i = 0; $i < count ($genres); $i++) { $the_genres .= "$genres[$i] "; } $autodata .= "[/color][/b]\n[b][color=DimGray] Genre: [/color][color=DarkSlateBlue]" . "".$the_genres."[/color][/b]\n"; $tagline = $movie->tagline (); $tagline = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $tagline); $autodata .= "[b][color=DimGray] Tagline: [/color][color=DarkSlateBlue] ".$tagline."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Director(s): [/color][color=DarkSlateBlue]"; for ($i = 0; $i < count ($director); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$director[$i]["imdb"]."" ."]" . "".$director[$i]["name"]."" . "[/url] "; } $autodata .= "[/color][/b]\n[b][color=DimGray] Writer(s): [/color][/b]"; for ($i = 0; $i < count ($write); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$write[$i]["imdb"]."" ."]" . "".$write[$i]["name"]."" . "[/url] "; } $autodata .= "\n[b][color=DimGray] Trailer (if any): [/color][color=DarkSlateBlue][url=http://www.imdb.com/title/tt$thenumbers/trailers]Click here[/url][/color][/b]"; /* $autodata .= "\n[b][color=DimGray] Producer(s): [/color][/b]"; for ($i = 0; $i < count ($produce); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$produce[$i]["imdb"]."" ."]" . "".$produce[$i]["name"]."" . "[/url] "; } */ $autodata .= "\n\n\n[img=pic/sml_desc.gif]"; // $autodata .= "[b][color=darkred] Plot Outline: [/color][/b]"; for ($i = 0; $i < count ($plot); $i++) { $the_plot .= "$plot[$i]"; } if ($the_plot == "") $the_plot = "No plot summary available"; // If you're wondering what this $big_letter is for, it's something I did for BB-Code on Drugs, coming soon $big_letter = substr($the_plot, 0, 1); $rest_of_plot = substr($the_plot, 1); $rest_of_plot = str_replace(array("[", "]"), array("(", ")"), $rest_of_plot); $autodata .= str_replace("&#34;", "\"", "[color=DimGray][b]".$big_letter."".strip_tags($rest_of_plot)."[/b][/color]"); $autodata .= "\n\n\n\n[img=pic/sml_cast.gif]"; for ($i = 0; $i < count ($cast); $i++) { if ($i > 9) { break; } $autodata .= "[color=DimGray]•[/color] " . "[url=http://us.imdb.com/Name?" . "".$cast[$i]["imdb"]."" ."]" . "".$cast[$i]["name"]."" . "[/url] " . " as [b][color=DimGray]" . "".$cast[$i]["role"]."" . " [/color][/b]\n"; } $autodata .= "\n\n\n"; // to update nzbs table fields on upload/edit $checkme = 0; if (($row["imdbrating"] == "" && $row["genre"] == "") || !empty($_GET["edited"])) { // get some variables to update database $movyear = (string) $movie->year (); $movgenre = (string) $movie->genre (); $movietitle = sqlesc($movtitle." ($movyear)"); $moviegenre = sqlesc(substr($movgenre, 0, 20)); $movrating = ($movrating == ""?"NYR":$movrating); $movierating = sqlesc(strval($movrating)); mysql_query("UPDATE nzbs SET name = $movietitle, imdbrating = $movierating, genre = $moviegenre WHERE id = ".$row["id"]); $checkme = 1; } if ($_GET["uploaded"] && $checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"]."&uploaded=1"); if ($_GET["edited"] && $checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"]."&edited=1"); if ($checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"].""); } } // ------------------------------------------------------------------------------------------// $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("<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"])." "; $format = ($row["format"]!="na"?" <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><br /><br />\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") == 1 || 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=\"image\" name=\"dlzip\" src=\"/image/zip.gif\" style=\"width:200px;height:25px;\" alt=\"ZIP\"/>"); print("<input type="hidden", name="dlzip" value="Download As Zip File" />"); if (getNzbPermissions("nzb") == 1) print(" <input type=\"image\" name=\"dlnzb\" src=\"/images/nzb.gif\" style=\"width:200px;height:25px;\" alt=\"NZB\"/>"); print("<input type="hidden", name="dlnzb" value="Download As NZB" />"); print(" "); print("</td></tr>"); print("</form>\n"); } elseif ((getNzbPermissions("zip") == 1 || 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>"); } if (!empty($row["image"])) tr("Picture:", "<img src='".$row["image"]."'>", 1); else tr("Picture:", "<img src=image.jpg>", 1); 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("<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", $uprow, 1); //tr("Report<br />NZB", "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<br /><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><br /><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\"> Expired </td><td>$SITENZBRETENTION days old</td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"2\"> Dupe</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"3\"> Nuked</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"4\"> 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\" /> 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\" /> 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(); ?>
  8. the form from the nzbdetails.php with the normal buttons is (it downloads the nzb with this 1) nzbdownload.php/50/Tom%20Clancys%20Rainbow%20Six%20Vegas%202%20PAL%20X360%20Allstars.nzb the form from the edited nzbdetails.php that we just added the images is nzbdownload.php/50/Tom%20Clancys%20Rainbow%20Six%20Vegas%202%20PAL%20X360%20Allstars.nzb its the same but if i type www.topnzbs.com/nzbdownload.php/50/Tom%20Clancys%20Rainbow%20Six%20Vegas%202%20PAL%20X360%20Allstars.nzb in my address bar it goes to the blank page to so im guesing it has to go through the nzbdownload.php to get the nzb?so how come it works fine with the old buttons and not with the new images when all we have changed is the button to image? thanx gemma
  9. ok the images are now in place the code is below but when i click the download nzb or download zip it takes me to a page not found rather than the nzb if (getNzbPermissions("zip") == 1) print("<input type=\"image\" name=\"dlzip\" src=\"/image/zip.gif\" style=\"width:200px;height:25px;\" alt=\"ZIP\"/>"); if (getNzbPermissions("nzb") == 1) print(" <input type=\"image\" name=\"dlnzb\" src=\"/images/nzb.gif\" style=\"width:200px;height:25px;\" alt=\"NZB\"/>"); thanx for your help so far i am learning (slowly lol)
  10. when i change the input to image instead of displaying the images ect it just shows me the code < input type="image" name="dlzip" value="Download As Zip File" class="codebuttons" style="width:150px;height:25px;" /> < input type="image" name="dlnzb" value="Download As NZB" class="codebuttons" style="width:150px;height:25px;" /> sorry to be a pain but any chance you could edit the nzbdetails.php in the 1st post to what you think will work so i can just try the nzbdetails.php you paste to see if it works as im a bit of a php noob and am probly doing it wrong thanx gemma x or not normally this trusting but if you have a email addy il give you the ftp details to try it yourself as its doing my head in now lol
  11. thanx for the fast reply but the buttons are still there do you think the buttons are loacated lower down in code? EDIT: below is the code i need editing sorry about that // Get permissions for download link display if ((getNzbPermissions("zip") == 1 || 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(" <input type=\"submit\" name=\"dlnzb\" value=\"Download As NZB\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />"); print(" "); print("</td></tr>"); print("</form>\n"); } elseif ((getNzbPermissions("zip") == 1 || 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>"); }
  12. hi below is my nzbdetails.php im trying to make it look better as it looks a bit boring 1st thing i would like to do is change a clickable button to a clickable image (its not a <h aref=....> is a button that used a querry i think well it downloads a nzb from my site) the 2 buttons are "Download Selected in Zip File" and "Download Selected as NZB" there the 2 i want to make into a image <?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"); // ----- 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("&#232;", "e", $string); $string = str_replace("&#34;", "\"", $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 = 0 + $plist['piece_segments']; $subjseg = 0 + $plist['piece_subjseg']; // the rows: $pl .= "<tr><td>".(getNzbPermissions("part")==1 && $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 .= "<br /><div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />". " <input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div><br /><br />\n"; } elseif (getNzbPermissions("part") == 1 && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) { $pl .= "<br /><div align=\"center\">".getNzbPermissions("maxmsg")."</div><br /><br />\n"; } else { $pl .= "<br /><div align=\"center\">".getNzbPermissions("partmsg")."</div><br /><br />\n"; } $pl .= "<a href=\"nzbdetails.php?id=$id\" class=\"sublink\">[Hide list]</a>". "</form>\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); // -------------------------------Auto IMDB Mod--------------------------------------------// if ($row["autoimdb"] == "yes") { 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 (); $genres = $movie->genres (); $photoremurl = $movie->photo (); if ($photoremurl) { $autodata = "[img=".$photoremurl."]"; } $autodata .= "[img=pic/sml_info.gif]"; // This'll also be useful for storage further down: $movtitle = (string) $movie->title (); $movtitle = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $movtitle); $autodata .= "[b][color=DimGray] Title: [/color][color=DarkSlateBlue] " . "".$movtitle."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Alt Titles : [/color][color=DarkSlateBlue] "; if ($movie->alsoknow() != "") { foreach ( $movie->alsoknow() as $ak){ $autodata .= "".str_replace(array("&#34;", "[", "]"), array("\"", "(", ")"), $ak["title"])."" . "".$ak["year"]."" . "".$ak["country"]."" . " (" . "".$ak["comment"]."" . ")" . ", "; } } $autodata .= "[/color][/b]\n[b][color=DimGray] Year: [/color][color=DarkSlateBlue] " . "".$movie->year ()."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Runtime: [/color][color=DarkSlateBlue] " . "".$movie->runtime ()."" . " mins[/color][/b]\n"; // store rating for later use $movrating = $movie->rating (); $desc_rating = ($movrating == ""?"Not Yet Rated":$movrating); $autodata .= "[b][color=DimGray] User Rating: [/color][color=DarkSlateBlue] " . "".$desc_rating."[/color][/b]\n"; $desc_votes = (string) $movie->votes (); $desc_votes = (strlen($desc_votes)>7?substr($desc_votes,0, 7):$desc_votes); $desc_votes = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $desc_votes); $autodata .= "[b][color=DimGray] Votes: [/color][color=DarkSlateBlue] " . "".$desc_votes."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Language: [/color][color=DarkSlateBlue] " . "".$movie->language ()."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Country: [/color][color=DarkSlateBlue] "; for ($i = 0; $i < count ($country); $i++) { $autodata .= "$country[$i]"; } for ($i = 0; $i < count ($genres); $i++) { $the_genres .= "$genres[$i] "; } $autodata .= "[/color][/b]\n[b][color=DimGray] Genre: [/color][color=DarkSlateBlue]" . "".$the_genres."[/color][/b]\n"; $tagline = $movie->tagline (); $tagline = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $tagline); $autodata .= "[b][color=DimGray] Tagline: [/color][color=DarkSlateBlue] ".$tagline."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Director(s): [/color][color=DarkSlateBlue]"; for ($i = 0; $i < count ($director); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$director[$i]["imdb"]."" ."]" . "".$director[$i]["name"]."" . "[/url] "; } $autodata .= "[/color][/b]\n[b][color=DimGray] Writer(s): [/color][/b]"; for ($i = 0; $i < count ($write); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$write[$i]["imdb"]."" ."]" . "".$write[$i]["name"]."" . "[/url] "; } $autodata .= "\n[b][color=DimGray] Trailer (if any): [/color][color=DarkSlateBlue][url=http://www.imdb.com/title/tt$thenumbers/trailers]Click here[/url][/color][/b]"; /* $autodata .= "\n[b][color=DimGray] Producer(s): [/color][/b]"; for ($i = 0; $i < count ($produce); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$produce[$i]["imdb"]."" ."]" . "".$produce[$i]["name"]."" . "[/url] "; } */ $autodata .= "\n\n\n[img=pic/sml_desc.gif]"; // $autodata .= "[b][color=darkred] Plot Outline: [/color][/b]"; for ($i = 0; $i < count ($plot); $i++) { $the_plot .= "$plot[$i]"; } if ($the_plot == "") $the_plot = "No plot summary available"; // If you're wondering what this $big_letter is for, it's something I did for BB-Code on Drugs, coming soon $big_letter = substr($the_plot, 0, 1); $rest_of_plot = substr($the_plot, 1); $rest_of_plot = str_replace(array("[", "]"), array("(", ")"), $rest_of_plot); $autodata .= str_replace("&#34;", "\"", "[color=DimGray][b]".$big_letter."".strip_tags($rest_of_plot)."[/b][/color]"); $autodata .= "\n\n\n\n[img=pic/sml_cast.gif]"; for ($i = 0; $i < count ($cast); $i++) { if ($i > 9) { break; } $autodata .= "[color=DimGray]•[/color] " . "[url=http://us.imdb.com/Name?" . "".$cast[$i]["imdb"]."" ."]" . "".$cast[$i]["name"]."" . "[/url] " . " as [b][color=DimGray]" . "".$cast[$i]["role"]."" . " [/color][/b]\n"; } $autodata .= "\n\n\n"; // to update nzbs table fields on upload/edit $checkme = 0; if (($row["imdbrating"] == "" && $row["genre"] == "") || !empty($_GET["edited"])) { // get some variables to update database $movyear = (string) $movie->year (); $movgenre = (string) $movie->genre (); $movietitle = sqlesc($movtitle." ($movyear)"); $moviegenre = sqlesc(substr($movgenre, 0, 20)); $movrating = ($movrating == ""?"NYR":$movrating); $movierating = sqlesc(strval($movrating)); mysql_query("UPDATE nzbs SET name = $movietitle, imdbrating = $movierating, genre = $moviegenre WHERE id = ".$row["id"]); $checkme = 1; } if ($_GET["uploaded"] && $checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"]."&uploaded=1"); if ($_GET["edited"] && $checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"]."&edited=1"); if ($checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"].""); } } // ------------------------------------------------------------------------------------------// $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("<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"])." "; $format = ($row["format"]!="na"?" <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><br /><br />\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") == 1 || 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(" <input type=\"submit\" name=\"dlnzb\" value=\"Download As NZB\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />"); print(" "); print("</td></tr>"); print("</form>\n"); } elseif ((getNzbPermissions("zip") == 1 || 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>"); } if (!empty($row["image"])) tr("Picture:", "<img src='".$row["image"]."'>", 1); else tr("Picture:", "<img src=image.jpg>", 1); 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("<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", $uprow, 1); //tr("Report<br />NZB", "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<br /><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><br /><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\"> Expired </td><td>$SITENZBRETENTION days old</td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"2\"> Dupe</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"3\"> Nuked</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"4\"> 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\" /> 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\" /> 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(); ?> any help would be much appreciated ive been trying this for days but either the page goes blank or when i get the image on there when i click the image instead of downloading the nzb it takes me to a blank page thanx in advance gemma x
  13. hi yes that is exactly what i meen thank you but when i use code you just gave me it makes my page go blank? is there anychance you can put it in the nzbdetails.php ive posted above and paste it for me incase im doing it wrong? thanks again gemma x
  14. hi im new here just wondering if you guys can help me out ive got 2 buttons on my site and im trying to make them images instead the code is below $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 .= "<br /><div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />". " <input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div><br /><br />\n"; } elseif (getNzbPermissions("part") == 1 && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) { $pl .= "<br /><div align=\"center\">".getNzbPermissions("maxmsg")."</div><br /><br />\n"; } else { $pl .= "<br /><div align=\"center\">".getNzbPermissions("partmsg")."</div><br /><br />\n"; } $pl .= "<a href=\"nzbdetails.php?id=$id\" class=\"sublink\">[Hide list]</a>". "</form>\n"; here is my whole nzbdetails.php <?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"); // ----- 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("&#232;", "e", $string); $string = str_replace("&#34;", "\"", $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 = 0 + $plist['piece_segments']; $subjseg = 0 + $plist['piece_subjseg']; // the rows: $pl .= "<tr><td>".(getNzbPermissions("part")==1 && $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 .= "<br /><div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />". " <input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div><br /><br />\n"; } elseif (getNzbPermissions("part") == 1 && $CURUSER["nzbstodaydl"] >= getNzbPermissions("maxdlpday")) { $pl .= "<br /><div align=\"center\">".getNzbPermissions("maxmsg")."</div><br /><br />\n"; } else { $pl .= "<br /><div align=\"center\">".getNzbPermissions("partmsg")."</div><br /><br />\n"; } $pl .= "<a href=\"nzbdetails.php?id=$id\" class=\"sublink\">[Hide list]</a>". "</form>\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); // -------------------------------Auto IMDB Mod--------------------------------------------// if ($row["autoimdb"] == "yes") { 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 (); $genres = $movie->genres (); $photoremurl = $movie->photo (); if ($photoremurl) { $autodata = "[img=".$photoremurl."]"; } $autodata .= "[img=pic/sml_info.gif]"; // This'll also be useful for storage further down: $movtitle = (string) $movie->title (); $movtitle = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $movtitle); $autodata .= "[b][color=DimGray] Title: [/color][color=DarkSlateBlue] " . "".$movtitle."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Alt Titles : [/color][color=DarkSlateBlue] "; if ($movie->alsoknow() != "") { foreach ( $movie->alsoknow() as $ak){ $autodata .= "".str_replace(array("&#34;", "[", "]"), array("\"", "(", ")"), $ak["title"])."" . "".$ak["year"]."" . "".$ak["country"]."" . " (" . "".$ak["comment"]."" . ")" . ", "; } } $autodata .= "[/color][/b]\n[b][color=DimGray] Year: [/color][color=DarkSlateBlue] " . "".$movie->year ()."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Runtime: [/color][color=DarkSlateBlue] " . "".$movie->runtime ()."" . " mins[/color][/b]\n"; // store rating for later use $movrating = $movie->rating (); $desc_rating = ($movrating == ""?"Not Yet Rated":$movrating); $autodata .= "[b][color=DimGray] User Rating: [/color][color=DarkSlateBlue] " . "".$desc_rating."[/color][/b]\n"; $desc_votes = (string) $movie->votes (); $desc_votes = (strlen($desc_votes)>7?substr($desc_votes,0, 7):$desc_votes); $desc_votes = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $desc_votes); $autodata .= "[b][color=DimGray] Votes: [/color][color=DarkSlateBlue] " . "".$desc_votes."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Language: [/color][color=DarkSlateBlue] " . "".$movie->language ()."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Country: [/color][color=DarkSlateBlue] "; for ($i = 0; $i < count ($country); $i++) { $autodata .= "$country[$i]"; } for ($i = 0; $i < count ($genres); $i++) { $the_genres .= "$genres[$i] "; } $autodata .= "[/color][/b]\n[b][color=DimGray] Genre: [/color][color=DarkSlateBlue]" . "".$the_genres."[/color][/b]\n"; $tagline = $movie->tagline (); $tagline = str_replace(array("&#34;", "&#38;", "[", "]"), array("\"", "&", "(", ")"), $tagline); $autodata .= "[b][color=DimGray] Tagline: [/color][color=DarkSlateBlue] ".$tagline."[/color][/b]\n"; $autodata .= "[b][color=DimGray] Director(s): [/color][color=DarkSlateBlue]"; for ($i = 0; $i < count ($director); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$director[$i]["imdb"]."" ."]" . "".$director[$i]["name"]."" . "[/url] "; } $autodata .= "[/color][/b]\n[b][color=DimGray] Writer(s): [/color][/b]"; for ($i = 0; $i < count ($write); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$write[$i]["imdb"]."" ."]" . "".$write[$i]["name"]."" . "[/url] "; } $autodata .= "\n[b][color=DimGray] Trailer (if any): [/color][color=DarkSlateBlue][url=http://www.imdb.com/title/tt$thenumbers/trailers]Click here[/url][/color][/b]"; /* $autodata .= "\n[b][color=DimGray] Producer(s): [/color][/b]"; for ($i = 0; $i < count ($produce); $i++) { $autodata .= "[url=http://us.imdb.com/Name?" . "".$produce[$i]["imdb"]."" ."]" . "".$produce[$i]["name"]."" . "[/url] "; } */ $autodata .= "\n\n\n[img=pic/sml_desc.gif]"; // $autodata .= "[b][color=darkred] Plot Outline: [/color][/b]"; for ($i = 0; $i < count ($plot); $i++) { $the_plot .= "$plot[$i]"; } if ($the_plot == "") $the_plot = "No plot summary available"; // If you're wondering what this $big_letter is for, it's something I did for BB-Code on Drugs, coming soon $big_letter = substr($the_plot, 0, 1); $rest_of_plot = substr($the_plot, 1); $rest_of_plot = str_replace(array("[", "]"), array("(", ")"), $rest_of_plot); $autodata .= str_replace("&#34;", "\"", "[color=DimGray][b]".$big_letter."".strip_tags($rest_of_plot)."[/b][/color]"); $autodata .= "\n\n\n\n[img=pic/sml_cast.gif]"; for ($i = 0; $i < count ($cast); $i++) { if ($i > 9) { break; } $autodata .= "[color=DimGray]•[/color] " . "[url=http://us.imdb.com/Name?" . "".$cast[$i]["imdb"]."" ."]" . "".$cast[$i]["name"]."" . "[/url] " . " as [b][color=DimGray]" . "".$cast[$i]["role"]."" . " [/color][/b]\n"; } $autodata .= "\n\n\n"; // to update nzbs table fields on upload/edit $checkme = 0; if (($row["imdbrating"] == "" && $row["genre"] == "") || !empty($_GET["edited"])) { // get some variables to update database $movyear = (string) $movie->year (); $movgenre = (string) $movie->genre (); $movietitle = sqlesc($movtitle." ($movyear)"); $moviegenre = sqlesc(substr($movgenre, 0, 20)); $movrating = ($movrating == ""?"NYR":$movrating); $movierating = sqlesc(strval($movrating)); mysql_query("UPDATE nzbs SET name = $movietitle, imdbrating = $movierating, genre = $moviegenre WHERE id = ".$row["id"]); $checkme = 1; } if ($_GET["uploaded"] && $checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"]."&uploaded=1"); if ($_GET["edited"] && $checkme == 1) header("Location: $BASEURL/nzbdetails.php?id=".$row["id"]."&edited=1"); } } // ------------------------------------------------------------------------------------------// $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("<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"])." "; $format = ($row["format"]!="na"?" <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><br /><br />\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") == 1 || 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(" <input type=\"submit\" name=\"dlnzb\" value=\"Download As NZB\" class=\"codebuttons\" style=\"width:150px;height:25px;\" />"); print(" "); print("</td></tr>"); print("</form>\n"); } elseif ((getNzbPermissions("zip") == 1 || 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>"); } 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("<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", $uprow, 1); //tr("Report<br />NZB", "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<br /><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><br /><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\"> Expired </td><td>$SITENZBRETENTION days old</td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"2\"> Dupe</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"3\"> Nuked</td><td><input type=\"text\" size=\"40\" name=\"reason[]\"></td></tr>\n"); print("<tr><td><input name=\"reasontype\" type=\"radio\" value=\"4\"> 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\" /> 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\" /> 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(); ?> any help would be much appreciated thank you gemma x
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.