Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Torrents Nuked
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2011-03-21 03:02:47
ADD SQL

ALTER TABLE `torrents` ADD `nuked` ENUM( 'yes', 'no' ) DEFAULT 'no' NOT NULL;


in torrents-edit.php

add

$updateset[] = "nuked = " . sqlesc($nuked);

after

$updateset[] = "name = " . sqlesc($name);

add

echo "<tr><td align=right><B>Nuked: </b></TD><TD><input type=\"checkbox\" name=\"nuked\"" . (($row["nuked"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> Nuked?<br>";

after

echo "<tr><td align=right><B>".BANNED.": </b></TD><TD><input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".BANNED."?<br>";

save and close

in torrents-details.php find

torrents.freeleech,


add after

torrents.nuked,


find

	if ($row["external"]!='yes' && $row["freeleech"]=='1'){
print ("<B>".FREE_LEECH.": </b><font color=red>".FREE_LEECH_MSG."</font><BR>");

}

add after

if ($row["nuked"] == 'yes'){
print ("<B>Nuked: </B><font color=red><blink>Torrent NUKED!</blink></font><BR>");

}

save and close

in functions.php find

				if ($row["freeleech"] == 1)
$dispname .= " <img src='images/free.gif' border='0'>";

add after

				if ($row["nuked"] == "yes")
$dispname .= " <img src='images/nuked.png' title='Nuked' border='0'>";

save and close

find in torrents-search.php and same for torrents.php

torrents.freeleech,

add after

torrents.nuked,


save and close

add image to images folder









EDIT:Post updated
Unknown User
2011-03-21 10:35:07
nice mod i was looking for this just how i wanted it by the looks of the code  :lol:  will report bk if all working  :)  thank you Lakicevic

-------- UPDATE it seems to not update and show nuked also it cannot rember its nuked so may be a issue with db side of things and some of your instructions (above) need FIND and then ADD  adjusted i had to quess a bit hehe but hey all gd we will get there----

i think its the first bit for torrent-edit.php that needs a look at as thats the bit i was quessing

v2.06 im using aswell
Unknown User
2011-03-21 12:00:00
is working well  you need only enum yes added in torrents-edit.php so if is nuked torrent you can change by uncheck you Nuked and enum wil be no again  .so post you files so i can see what you have done pls
Unknown User
2011-03-21 12:59:15
what is this mod for? any anyone give me with a screen shot pls
Unknown User
2011-03-21 14:27:27
here is my torrent-edit.php file

<?
//

//  TorrentTrader v2.x

// This file was last updated: 03/October/2007 by TorrentialStorm

//

// http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn();

loggedinonly();

$id = (int)$_GET['id']?$_GET['id']:$_POST['id'];

if (!is_valid_id($id)) show_error_msg("Error", "Invalid ID.", 1);

$row = mysql_fetch_assoc(mysql_query("SELECT `owner` FROM `torrents` WHERE id=$id"));

$imdb = $row['imdb'];

if($CURUSER["edit_torrents"]=="no" && $CURUSER['id'] != $row['owner'])

show_error_msg("Error","You do not have permission to edit torrents",1);

function uploadimage($x, $imgname, $tid) {

global $site_config;

$maxfilesize = 512000; // 500kb

$imagesdir = "".$site_config["torrent_dir"]."/images";

$allowed_types = array(

"image/gif" => "gif",

"image/pjpeg" => "jpg",

"image/jpeg" => "jpg",

"image/jpg" => "jpg"

// Add more types here if you like

);

if (!($_FILES[image.$x]['name'] == "")) {

if ($imgname != "") {

$img = "$imagesdir/$imgname";

$del = unlink($img);

}

$y = $x + 1;

if (!array_key_exists($_FILES[image.$x]['type'], $allowed_types))

show_error_msg("Error","Invalid file type! Image $y",1);

if (!preg_match('/^(.+)\.(jpg|gif|png)$/si', $_FILES[image.$x]['name']))

show_error_msg("Invalid image", "This file TYPE is not an image!",1);

if ($_FILES[image.$x]['size'] > $maxfilesize)

show_error_msg("Error","Invalid file size! Image $y - Must be less than 500kb",1);

$uploaddir = "$imagesdir/";

$ifile = $_FILES[image.$x]['tmp_name'];

$ifilename = $tid . $x . substr($_FILES[image.$x]['name'], strlen($_FILES[image.$x]['name'])-4, 4);

$copy = copy($ifile, "".$uploaddir."".$ifilename."");

if (!$copy)

show_error_msg("Error","Error occured uploading image! - Image $y",1);

return $ifilename;

}

}//end func

//GET DATA FROM DB

$res = mysql_query("SELECT * FROM torrents WHERE id = $id");

$row = mysql_fetch_array($res);

if (!$row){

show_error_msg("Error", "This Torrent id has gone!",1);

}

$torrent_dir = $site_config["torrent_dir"];

$nfo_dir = $site_config["nfo_dir"];

//DELETE TORRENT

if ($action=="deleteit"){

$torrentid = 0 + $_POST["torrentid"];

$delreason = sqlesc($_POST["delreason"]);

$torrentname = $_POST["torrentname"];

if (!is_valid_id($torrentid))

show_error_msg("Failed", "Invalid Torrent ID",1);

if (!$delreason){

show_error_msg("Error", "Missing form data.",1);

}

deletetorrent($torrentid);

write_log($CURUSER['username']." has deleted torrent: ID:$torrentid - $torrentname - Reason: $delreason");

if ($CURUSER['id'] != $row['owner']) {

$delreason = $_POST["delreason"];

mysql_query("INSERT INTO messages (sender, receiver, added, subject, msg, unread, location) VALUES(0, ".$row['owner'].", '".get_date_time()."', 'Your torrent \'$torrentname\' has been deleted by ".$CURUSER['username']."', ".sqlesc("'$torrentname' was deleted by ".$CURUSER['username']."\n\nReason: $delreason").", 'yes', 'in')");

}

show_error_msg("Completed", "$torrentname has been deleted from the database",1);

die;

}

//DO THE SAVE TO DB HERE

if ($action=="doedit"){

$updateset = array();

$nfoaction = $_POST['nfoaction'];

if ($nfoaction == "update"){

$nfofile = $_FILES['nfofile'];

if (!$nfofile) die("No data " . var_dump($_FILES));

if ($nfofile['size'] > 65535)

show_error_msg("NFO is too big!", "Max 65,535 bytes.",1);

$nfofilename = $nfofile['tmp_name'];

if (@is_uploaded_file($nfofilename) && @filesize($nfofilename) > 0){

@move_uploaded_file($nfofilename, "$nfo_dir/$id.nfo");

$updateset[] = "nfo = 'yes'";

}//success

}

$updateset[] = "name = " . sqlesc($name);

///screenshot

$updateset[] = "screens1 = " . sqlesc($screens1);

$updateset[] = "screens2 = " . sqlesc($screens2);

$updateset[] = "screens3 = " . sqlesc($screens3);

$updateset[] = "screens4 = " . sqlesc($screens4);

///screenshot end

$updateset[] = "descr = " . sqlesc($descr);

$updateset[] = "category = " . (0 + $type);

$updateset[] = "torrentlang = " . (0 + $language);

$updateset[] = "imdb = " . sqlesc($_POST['imdb']);

if ($CURUSER["edit_torrents"] == "yes") {

if ($_POST["banned"]) {

$updateset[] = "banned = 'yes'";

$_POST["visible"] = 0;

} else {

$updateset[] = "banned = 'no'";

}

}

$updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'";

if ($CURUSER["edit_torrents"] == "yes"){

if(get_user_class($CURUSER) > 4){

if ($_POST["sticky"] == "yes"){

$updateset[] = "sticky = 'yes'";

}else{

$updateset[] = "sticky = 'no'";

}

}

$updateset[] = "freeleech = '".$_POST["freeleech"]."'";

/// START RECOMMENDED TORRENTS ///

$updateset[] = "recommended = '" . ($_POST["recommended"] ? "yes" : "no") . "'";

// END RECOMMENDED TORRENTS ///

}

$updateset[] = "anon = '" . ($_POST["anon"] ? "yes" : "no") . "'";

//update images

$img1action = $_POST['img1action'];

if ($img1action == "update")

$updateset[] = "image1 = " .sqlesc(uploadimage(0, $row[image1], $id));

if ($img1action == "delete") {

if ($row[image1]) {

$del = unlink("".$site_config["torrent_dir"]."/images/$row[image1]");

$updateset[] = "image1 = ''";

}

}

$img2action = $_POST['img2action'];

if ($img2action == "update")

$updateset[] = "image2 = " .sqlesc(uploadimage(1, $row[image2], $id));

if ($img2action == "delete") {

if ($row[image2]) {

$del = unlink("".$site_config["torrent_dir"]."/images/$row[image2]");

$updateset[] = "image2 = ''";

}

}

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

//add image from url

if(!empty($_POST['image1url'])){

$image1url = mysql_real_escape_string($_POST['image1url']);

$image = file_put_contents("uploads/images/".$id."0.jpg", file_get_contents($image1url));

$upd_qry = "update torrents set image1 = '".$id."0.jpg' where id = '$id'";

mysql_query($upd_qry) or die(mysql_error()."<br>$upd_qry");

}else{

$image1url="";

}

if(!empty($_POST['image2url'])){

$image2url = mysql_real_escape_string($_POST['image2url']);

$image = file_put_contents("uploads/images/".$id."1.jpg", file_get_contents($image2url));

$upd_qry = "update torrents set image2 = '".$id."1.jpg' where id = '$id'";

mysql_query($upd_qry) or die(mysql_error());

}else{

$image2url="";

}

//end add image from url

$returl = "torrents-edit.php?id=$id&edited=1";

if (isset($_POST["returnto"])){

$returl .= "&returnto=" . urlencode($_POST["returnto"]);

}

write_log("Torrent $id ($name) was edited by $CURUSER[username]");

header("Location: $returl");

die();

}//END SAVE TO DB

//UPDATE CATEGORY DROPDOWN

$catdropdown = "<select name=\"type\">\n";

$cats = genrelist();

foreach ($cats as $catdropdownubrow) {

$catdropdown .= "<option value=\"" . $catdropdownubrow["id"] . "\"";

if ($catdropdownubrow["id"] == $row["category"])

$catdropdown .= " selected=\"selected\"";

$catdropdown .= ">" . htmlspecialchars($catdropdownubrow["parent_cat"]) . ": " . htmlspecialchars($catdropdownubrow["name"]) . "</option>\n";

}

$catdropdown .= "</select>\n";

//END CATDROPDOWN

//UPDATE TORRENTLANG DROPDOWN

$langdropdown = "<select name=\"language\"><option value=0>Unknown</option>\n";

$lang = langlist();

foreach ($lang as $lang) {

$langdropdown .= "<option value=\"" . $lang["id"] . "\"";

if ($lang["id"] == $row["torrentlang"])

$langdropdown .= " selected=\"selected\"";

$langdropdown .= ">" . htmlspecialchars($lang["name"]) . "</option>\n";

}

$langdropdown .= "</select>\n";

//END TORRENTLANG

$char1 = 55;

$shortname = CutName(htmlspecialchars($row["name"]), $char1);

$updateset[] = "nuked = " . sqlesc($nuked);

if ($_GET["edited"]){

show_error_msg("Edited OK","Torrent has been edited OK<br><a href='torrents-details.php?id=$id'>View This Torrent</a>",1);

}

stdhead("Edit Torrent \"$shortname\"");

begin_frame("Edit Torrent \"$shortname\"", "visible", center);

print("<BR><BR><form method=post name=\"bbform\" enctype=multipart/form-data action=\"$PHP_SELF?action=doedit\">\n");

print("<input type=\"hidden\" name=\"id\" value=\"$id\">\n");

if (isset($_GET["returnto"]))

print("<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars($_GET["returnto"]) . "\" />\n");

print("<table border=0 cellspacing=4 cellpadding=2 width=95%>\n");

echo "<tr><td align=right width=60><B>".NAME.": </b></TD><TD><input type=\"text\" name=\"name\" value=\"" . htmlspecialchars($row["name"]) . "\" size=\"60\" /></TD></TR>";

///screenshots

echo "<tr><td align=right width=60><B>Screenshot 1: </b></TD><TD><input type=\"text\" name=\"screens1\" value=\"" . htmlspecialchars($row["screens1"]) . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right width=60><B>Screenshot 2: </b></TD><TD><input type=\"text\" name=\"screens2\" value=\"" . htmlspecialchars($row["screens2"]) . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right width=60><B>Screenshot 3: </b></TD><TD><input type=\"text\" name=\"screens3\" value=\"" . htmlspecialchars($row["screens3"]) . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right width=60><B>Screenshot 4: </b></TD><TD><input type=\"text\" name=\"screens4\" value=\"" . htmlspecialchars($row["screens4"]) . "\" size=\"60\" /></TD></TR>";

///screenshots

echo "<tr><td align=right><B>".IMAGE.": </b></TD><TD><b>".IMAGE." 1:</b>&nbsp&nbsp<input type=radio name=img1action value='keep' checked>".KEEP_IMAGE."&nbsp&nbsp"."<input type=radio name=img1action value='delete'>".DELETE_IMAGE."&nbsp&nbsp"."<input type=radio name=img1action value='update'>".UPDATE_IMAGE."<br><input type=file name=image0 size=60> <br><br> <b>".IMAGE." 2:</b>&nbsp&nbsp<input type=radio name=img2action value='keep' checked>".KEEP_IMAGE."&nbsp&nbsp"."<input type=radio name=img2action value='delete'>".DELETE_IMAGE."&nbsp&nbsp"."<input type=radio name=img2action value='update'>".UPDATE_IMAGE."<BR><input type=file name=image1 size=60><br><center><b>OR</b></center></TD></TR>";

echo "<tr><td align=right rowspan=2><b>Image URL:</b></td>";

echo "<td><b>Image 1 URL:</b><br><input name=image1url size=60></td></tr>";

echo "<tr><td><b>Image 2 URL:</b><br><input name=image2url size=60</td></tr>";

echo "<tr><td align=right><B>".NFO.": </b><br></TD><TD><input type=radio name=nfoaction value='keep' checked>".KEEPCURRENT." &nbsp; <input type=radio name=nfoaction value='update'>".UPDATE_IMAGE.":";

if ($row["nfo"] == "yes"){

echo "&nbsp;&nbsp;<a href=nfo-view.php?id=".$row["id"]." target=_blank>[View Current NFO]</a>";

} else{

echo "&nbsp;&nbsp;<font color=red>No .NFO Uploaded</font>";

}

echo "<br /><input type=file name=nfofile size=60></TD></TR>";

echo "<tr><td align=right width=60><B>IMDB Link: </b></TD><TD><input type=\"text\" name=\"imdb\" value=\"" . $row["imdb"] . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right><B>".CATEGORIES.": </b></TD><TD>".$catdropdown."</TD></TR>";

echo "<tr><td align=right><B>".LANG.": </b></TD><TD>".$langdropdown."</TD></TR>";

if ($CURUSER["edit_torrents"] == "yes")

echo "<tr><td align=right><B>".BANNED.": </b></TD><TD><input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".BANNED."?<br>";

echo "<tr><td align=right><B>".VISIBLE.": </b></TD><TD><input type=\"checkbox\" name=\"visible\"" . (($row["visible"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> " . VISIBLEONMAIN . "<br>";

echo "<tr><td align=right><B>".NUKED.": </b></TD><TD><input type=\"checkbox\" name=\"nuked\"" . (($row["nuked"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ". NUKED ."<br>";

if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){

echo "<tr><td align=right><B>".FREE_LEECH.": </b></TD><TD><input type=\"checkbox\" name=\"freeleech\"" . (($row["freeleech"] == "1") ? " checked=\"checked\"" : "" ) . " value=\"1\" />".FREE_LEECH_MSG."<br>";

}

/// START RECOMMENDED TORRENTS ///

if ($site_config['RECOMMENDED_ON'] AND $CURUSER["class"] > 4){

echo "<tr><td align=right><B>".RECO_TOR.": </b></TD><TD><input type=\"checkbox\" name=\"recommended\"" . (($row["recommended"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> " . SHOW_IN_REC
Unknown User
2011-03-21 15:00:32
torrents-edit.php

<?
//

//  TorrentTrader v2.x

// This file was last updated: 03/October/2007 by TorrentialStorm

//

// http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn();

loggedinonly();

$id = (int)$_GET['id']?$_GET['id']:$_POST['id'];

if (!is_valid_id($id)) show_error_msg("Error", "Invalid ID.", 1);

$row = mysql_fetch_assoc(mysql_query("SELECT `owner` FROM `torrents` WHERE id=$id"));

$imdb = $row['imdb'];

if($CURUSER["edit_torrents"]=="no" && $CURUSER['id'] != $row['owner'])

show_error_msg("Error","You do not have permission to edit torrents",1);

function uploadimage($x, $imgname, $tid) {

global $site_config;

$maxfilesize = 512000; // 500kb

$imagesdir = "".$site_config["torrent_dir"]."/images";

$allowed_types = array(

"image/gif" => "gif",

"image/pjpeg" => "jpg",

"image/jpeg" => "jpg",

"image/jpg" => "jpg"

// Add more types here if you like

);

if (!($_FILES[image.$x]['name'] == "")) {

if ($imgname != "") {

$img = "$imagesdir/$imgname";

$del = unlink($img);

}

$y = $x + 1;

if (!array_key_exists($_FILES[image.$x]['type'], $allowed_types))

show_error_msg("Error","Invalid file type! Image $y",1);

if (!preg_match('/^(.+)\.(jpg|gif|png)$/si', $_FILES[image.$x]['name']))

show_error_msg("Invalid image", "This file TYPE is not an image!",1);

if ($_FILES[image.$x]['size'] > $maxfilesize)

show_error_msg("Error","Invalid file size! Image $y - Must be less than 500kb",1);

$uploaddir = "$imagesdir/";

$ifile = $_FILES[image.$x]['tmp_name'];

$ifilename = $tid . $x . substr($_FILES[image.$x]['name'], strlen($_FILES[image.$x]['name'])-4, 4);

$copy = copy($ifile, "".$uploaddir."".$ifilename."");

if (!$copy)

show_error_msg("Error","Error occured uploading image! - Image $y",1);

return $ifilename;

}

}//end func

//GET DATA FROM DB

$res = mysql_query("SELECT * FROM torrents WHERE id = $id");

$row = mysql_fetch_array($res);

if (!$row){

show_error_msg("Error", "This Torrent id has gone!",1);

}

$torrent_dir = $site_config["torrent_dir"];

$nfo_dir = $site_config["nfo_dir"];

//DELETE TORRENT

if ($action=="deleteit"){

$torrentid = 0 + $_POST["torrentid"];

$delreason = sqlesc($_POST["delreason"]);

$torrentname = $_POST["torrentname"];

if (!is_valid_id($torrentid))

show_error_msg("Failed", "Invalid Torrent ID",1);

if (!$delreason){

show_error_msg("Error", "Missing form data.",1);

}

deletetorrent($torrentid);

write_log($CURUSER['username']." has deleted torrent: ID:$torrentid - $torrentname - Reason: $delreason");

if ($CURUSER['id'] != $row['owner']) {

$delreason = $_POST["delreason"];

mysql_query("INSERT INTO messages (sender, receiver, added, subject, msg, unread, location) VALUES(0, ".$row['owner'].", '".get_date_time()."', 'Your torrent \'$torrentname\' has been deleted by ".$CURUSER['username']."', ".sqlesc("'$torrentname' was deleted by ".$CURUSER['username']."\n\nReason: $delreason").", 'yes', 'in')");

}

show_error_msg("Completed", "$torrentname has been deleted from the database",1);

die;

}

//DO THE SAVE TO DB HERE

if ($action=="doedit"){

$updateset = array();

$nfoaction = $_POST['nfoaction'];

if ($nfoaction == "update"){

$nfofile = $_FILES['nfofile'];

if (!$nfofile) die("No data " . var_dump($_FILES));

if ($nfofile['size'] > 65535)

show_error_msg("NFO is too big!", "Max 65,535 bytes.",1);

$nfofilename = $nfofile['tmp_name'];

if (@is_uploaded_file($nfofilename) && @filesize($nfofilename) > 0){

@move_uploaded_file($nfofilename, "$nfo_dir/$id.nfo");

$updateset[] = "nfo = 'yes'";

}//success

}

$updateset[] = "name = " . sqlesc($name);

$updateset[] = "nuked = " . sqlesc($nuked);

///screenshot

$updateset[] = "screens1 = " . sqlesc($screens1);

$updateset[] = "screens2 = " . sqlesc($screens2);

$updateset[] = "screens3 = " . sqlesc($screens3);

$updateset[] = "screens4 = " . sqlesc($screens4);

///screenshot end

$updateset[] = "descr = " . sqlesc($descr);

$updateset[] = "category = " . (0 + $type);

$updateset[] = "torrentlang = " . (0 + $language);

$updateset[] = "imdb = " . sqlesc($_POST['imdb']);

if ($CURUSER["edit_torrents"] == "yes") {

if ($_POST["banned"]) {

$updateset[] = "banned = 'yes'";

$_POST["visible"] = 0;

} else {

$updateset[] = "banned = 'no'";

}

}

$updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'";

if ($CURUSER["edit_torrents"] == "yes"){

if(get_user_class($CURUSER) > 4){

if ($_POST["sticky"] == "yes"){

$updateset[] = "sticky = 'yes'";

}else{

$updateset[] = "sticky = 'no'";

}

}

$updateset[] = "freeleech = '".$_POST["freeleech"]."'";

/// START RECOMMENDED TORRENTS ///

$updateset[] = "recommended = '" . ($_POST["recommended"] ? "yes" : "no") . "'";

// END RECOMMENDED TORRENTS ///

}

$updateset[] = "anon = '" . ($_POST["anon"] ? "yes" : "no") . "'";

//update images

$img1action = $_POST['img1action'];

if ($img1action == "update")

$updateset[] = "image1 = " .sqlesc(uploadimage(0, $row[image1], $id));

if ($img1action == "delete") {

if ($row[image1]) {

$del = unlink("".$site_config["torrent_dir"]."/images/$row[image1]");

$updateset[] = "image1 = ''";

}

}

$img2action = $_POST['img2action'];

if ($img2action == "update")

$updateset[] = "image2 = " .sqlesc(uploadimage(1, $row[image2], $id));

if ($img2action == "delete") {

if ($row[image2]) {

$del = unlink("".$site_config["torrent_dir"]."/images/$row[image2]");

$updateset[] = "image2 = ''";

}

}

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

//add image from url

if(!empty($_POST['image1url'])){

$image1url = mysql_real_escape_string($_POST['image1url']);

$image = file_put_contents("uploads/images/".$id."0.jpg", file_get_contents($image1url));

$upd_qry = "update torrents set image1 = '".$id."0.jpg' where id = '$id'";

mysql_query($upd_qry) or die(mysql_error()."<br>$upd_qry");

}else{

$image1url="";

}

if(!empty($_POST['image2url'])){

$image2url = mysql_real_escape_string($_POST['image2url']);

$image = file_put_contents("uploads/images/".$id."1.jpg", file_get_contents($image2url));

$upd_qry = "update torrents set image2 = '".$id."1.jpg' where id = '$id'";

mysql_query($upd_qry) or die(mysql_error());

}else{

$image2url="";

}

//end add image from url

$returl = "torrents-edit.php?id=$id&edited=1";

if (isset($_POST["returnto"])){

$returl .= "&returnto=" . urlencode($_POST["returnto"]);

}

write_log("Torrent $id ($name) was edited by $CURUSER[username]");

header("Location: $returl");

die();

}//END SAVE TO DB

//UPDATE CATEGORY DROPDOWN

$catdropdown = "<select name=\"type\">\n";

$cats = genrelist();

foreach ($cats as $catdropdownubrow) {

$catdropdown .= "<option value=\"" . $catdropdownubrow["id"] . "\"";

if ($catdropdownubrow["id"] == $row["category"])

$catdropdown .= " selected=\"selected\"";

$catdropdown .= ">" . htmlspecialchars($catdropdownubrow["parent_cat"]) . ": " . htmlspecialchars($catdropdownubrow["name"]) . "</option>\n";

}

$catdropdown .= "</select>\n";

//END CATDROPDOWN

//UPDATE TORRENTLANG DROPDOWN

$langdropdown = "<select name=\"language\"><option value=0>Unknown</option>\n";

$lang = langlist();

foreach ($lang as $lang) {

$langdropdown .= "<option value=\"" . $lang["id"] . "\"";

if ($lang["id"] == $row["torrentlang"])

$langdropdown .= " selected=\"selected\"";

$langdropdown .= ">" . htmlspecialchars($lang["name"]) . "</option>\n";

}

$langdropdown .= "</select>\n";

//END TORRENTLANG

$char1 = 55;

$shortname = CutName(htmlspecialchars($row["name"]), $char1);

$updateset[] = "nuked = " . sqlesc($nuked);

if ($_GET["edited"]){

show_error_msg("Edited OK","Torrent has been edited OK<br><a href='torrents-details.php?id=$id'>View This Torrent</a>",1);

}

stdhead("Edit Torrent \"$shortname\"");

begin_frame("Edit Torrent \"$shortname\"", "visible", center);

print("<BR><BR><form method=post name=\"bbform\" enctype=multipart/form-data action=\"$PHP_SELF?action=doedit\">\n");

print("<input type=\"hidden\" name=\"id\" value=\"$id\">\n");

if (isset($_GET["returnto"]))

print("<input type=\"hidden\" name=\"returnto\" value=\"" . htmlspecialchars($_GET["returnto"]) . "\" />\n");

print("<table border=0 cellspacing=4 cellpadding=2 width=95%>\n");

echo "<tr><td align=right width=60><B>".NAME.": </b></TD><TD><input type=\"text\" name=\"name\" value=\"" . htmlspecialchars($row["name"]) . "\" size=\"60\" /></TD></TR>";

///screenshots

echo "<tr><td align=right width=60><B>Screenshot 1: </b></TD><TD><input type=\"text\" name=\"screens1\" value=\"" . htmlspecialchars($row["screens1"]) . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right width=60><B>Screenshot 2: </b></TD><TD><input type=\"text\" name=\"screens2\" value=\"" . htmlspecialchars($row["screens2"]) . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right width=60><B>Screenshot 3: </b></TD><TD><input type=\"text\" name=\"screens3\" value=\"" . htmlspecialchars($row["screens3"]) . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right width=60><B>Screenshot 4: </b></TD><TD><input type=\"text\" name=\"screens4\" value=\"" . htmlspecialchars($row["screens4"]) . "\" size=\"60\" /></TD></TR>";

///screenshots

echo "<tr><td align=right><B>".IMAGE.": </b></TD><TD><b>".IMAGE." 1:</b>&nbsp&nbsp<input type=radio name=img1action value='keep' checked>".KEEP_IMAGE."&nbsp&nbsp"."<input type=radio name=img1action value='delete'>".DELETE_IMAGE."&nbsp&nbsp"."<input type=radio name=img1action value='update'>".UPDATE_IMAGE."<br><input type=file name=image0 size=60> <br><br> <b>".IMAGE." 2:</b>&nbsp&nbsp<input type=radio name=img2action value='keep' checked>".KEEP_IMAGE."&nbsp&nbsp"."<input type=radio name=img2action value='delete'>".DELETE_IMAGE."&nbsp&nbsp"."<input type=radio name=img2action value='update'>".UPDATE_IMAGE."<BR><input type=file name=image1 size=60><br><center><b>OR</b></center></TD></TR>";

echo "<tr><td align=right rowspan=2><b>Image URL:</b></td>";

echo "<td><b>Image 1 URL:</b><br><input name=image1url size=60></td></tr>";

echo "<tr><td><b>Image 2 URL:</b><br><input name=image2url size=60</td></tr>";

echo "<tr><td align=right><B>".NFO.": </b><br></TD><TD><input type=radio name=nfoaction value='keep' checked>".KEEPCURRENT." &nbsp; <input type=radio name=nfoaction value='update'>".UPDATE_IMAGE.":";

if ($row["nfo"] == "yes"){

echo "&nbsp;&nbsp;<a href=nfo-view.php?id=".$row["id"]." target=_blank>[View Current NFO]</a>";

} else{

echo "&nbsp;&nbsp;<font color=red>No .NFO Uploaded</font>";

}

echo "<br /><input type=file name=nfofile size=60></TD></TR>";

echo "<tr><td align=right width=60><B>IMDB Link: </b></TD><TD><input type=\"text\" name=\"imdb\" value=\"" . $row["imdb"] . "\" size=\"60\" /></TD></TR>";

echo "<tr><td align=right><B>".CATEGORIES.": </b></TD><TD>".$catdropdown."</TD></TR>";

echo "<tr><td align=right><B>".LANG.": </b></TD><TD>".$langdropdown."</TD></TR>";

if ($CURUSER["edit_torrents"] == "yes")

echo "<tr><td align=right><B>".BANNED.": </b></TD><TD><input type=\"checkbox\" name=\"banned\"" . (($row["banned"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ".BANNED."?<br>";

echo "<tr><td align=right><B>".VISIBLE.": </b></TD><TD><input type=\"checkbox\" name=\"visible\"" . (($row["visible"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> " . VISIBLEONMAIN . "<br>";

echo "<tr><td align=right><B>".NUKED.": </b></TD><TD><input type=\"checkbox\" name=\"nuked\"" . (($row["nuked"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> ". NUKED ."<br>";

if ($row["external"] != "yes" && $CURUSER["edit_torrents"] == "yes"){

echo "<tr><td align=right><B>".FREE_LEECH.": </b></TD><TD><input type=\"checkbox\" name=\"freeleech\"" . (($row["freeleech"] == "1") ? " checked=\"checked\"" : "" ) . " value=\"1\" />".FREE_LEECH_MSG."<br>";

}

/// START RECOMMENDED TORRENTS ///

if ($site_config['RECOMMENDED_ON'] AND $CURUSER["class"] > 4){

echo "<tr><td align=right><B>".RECO_TOR.": </b></TD><TD><input type=\"checkbox\" name=\"recommended\"" . (($row["recommended"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> " . SHOW_IN_REC
Unknown User
2011-03-21 16:04:37
hi ya i tried that its still not showing the nuke image etc on torrent details marking it nuked do u have a screenshot on how its spose to look may be my functions.php is all i can think of next

i do see this tho below--



:lol:  it stays marked that its nuked kewl so it does rember now so we a few steps forward just need the nuked image to show on browse page
Unknown User
2011-03-21 19:23:18
Ok I figured out the image problem in torrents.php add

, torrents.nuked

after torrents.external

in

if ($count) {

list($pagertop, $pagerbottom, $limit) = pager(20, $count, "torrents.php?" . $addparam);

$query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external
Unknown User
2011-03-22 02:14:36
still no image yet so does it show like the new or freeleech image when they showing ? :lol:
Unknown User
2011-03-22 05:26:01
yes.

ok try this:

change in functions:

if ($row["nuked"] == "yes")

$dispname .= " <img src='images/nuked.png' title='Nuked' border='0'>";
to:


				$res_nuked = mysql_query("SELECT nuked FROM torrents WHERE id = $id");

$row_nuked = mysql_fetch_array($res_nuked);

if ($row_nuked["nuked"] == "yes") {

$dispname .= " <img src='images/nuked.png' title='Nuked' border='0'>";

}


some strange reason it dont want to pull the info from the torrents.php  on well another query but in theory you could also use the new query to add other stuff that dont want to pull right:)

Unknown User
2011-03-22 08:48:24
thx mate, works great.



How do you put the icon on the right side instead of immediately, the torrent name
Unknown User
2012-05-11 12:55:02
this mod is like banned with aprrove or not the torrent?
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728