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
[ADDON]Use external image for poster
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2012-08-06 21:01:06
I wrote this as they only have the option of uploading images to the image folder as far as posters.

I personally removed that option and  then coded in just the option to add external images.

add external url image

first run this in the sql

alter table torrents add `poster` varchar(255) character set utf8 collate utf8_bin NOT NULL default 'images/noposter.png';
then under this in your torrent-upload.php




print ("<tr><td align='right'>" . T_("TORRENT_NAME") . ": </td><td align='left'><input type='text' name='name' size='60' value='" . $_POST['name'] . "' /><br />".T_("THIS_WILL_BE_TAKEN_TORRENT")." n</td></tr>");





add this



print ("<tr><td align='right'>" . T_("EXTERNAL_POSTER") . ": </td><td align='left'><input type='text' name='poster' size='60' value='" . $_POST['poster'] . "' /><br /> n</td></tr>");








then in your main query replace this





$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");



$id = mysql_insert_id();





with this



$poster = unesc($_POST['poster']);

$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, poster, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($poster).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");



$id = mysql_insert_id();





Now I made the poster show under the name in the description but put it where you want I guess in the poster details



torrent-details.php



change the main query from

 //GET ALL MYSQL VALUES FOR THIS TORRENT

$res = SQL_Query_exec("SELECT torrents.anon, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");

$row = mysql_fetch_assoc($res);





to this

//GET ALL MYSQL VALUES FOR THIS TORRENT

$res = SQL_Query_exec("SELECT torrents.anon, torrents.seeders, torrents.poster,torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.poster, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");

$row = mysql_fetch_assoc($res);






then as I said you can change this part as you see fit.Iadded this





if ($row["poster"]!='') {

echo "<center><table border='0' width='100%'>";

tr("<center><img src='".$row["poster"]."' alt='Poster' title='Poster' /></center>",1);

echo "</center></table >";

}





above the download box



//download box

echo "<center><table border='0' width='100%'><tr><td><div id='downloadbox'>";





last but least add this to your languages/english.php file







$LANG["EXTERNAL_POSTER"] = "external poster";




Moved to v2.08 Completed - Mostvotedplaya
Unknown User
2012-12-01 21:50:13
Didn't work on tt 2.08..

upload field worked fine but upon upload "database error" followed the guide to the tee..
Unknown User
2012-12-01 22:55:41
"karl_brit, post: 87116":
Didn't work on tt 2.08..

upload field worked fine but upon upload "database error" followed the guide to the tee..
well if you got that DID NOT FOLLOW RIGHT...

anyway posting about that error does NO good without the error from sqlerr ............................................................... siteurl/admincp.php?action=sqlerr

my guess you tried to add to db something the an field did not exist.. wrong order................
Unknown User
2012-12-22 10:16:09
looks good I will try it tomorrow
Unknown User
2013-04-27 13:25:17
working perfect here
Unknown User
2013-04-27 18:25:07
TBV MOD LOL
Unknown User
2013-08-10 12:11:03
[color=rgb(40,40,40)]then as I said you can change this part as you see fit.Iadded this[/color]

[color=rgb(0,0,136)]if[/color] [color=rgb(102,102,0)]([/color]$row[color=rgb(102,102,0)][[/color][color=rgb(0,136,0)]"poster"[/color][color=rgb(102,102,0)]]!=[/color][color=rgb(0,136,0)]''[/color][color=rgb(102,102,0)])[/color] [color=rgb(102,102,0)]{[/color]

echo [color=rgb(0,136,0)]"<center><table border='0' width='100%'>"[/color][color=rgb(102,102,0)];[/color]
tr[color=rgb(102,102,0)]([/color][color=rgb(0,136,0)]"<center><img src='"[/color][color=rgb(102,102,0)].[/color]$row[color=rgb(102,102,0)][[/color][color=rgb(0,136,0)]"poster"[/color][color=rgb(102,102,0)]].[/color][color=rgb(0,136,0)]"' alt='Poster' title='Poster' /></center>"[/color][color=rgb(102,102,0)],[/color][color=rgb(0,102,102)]1[/color][color=rgb(102,102,0)]);[/color]
echo [color=rgb(0,136,0)]"</center></table >"[/color][color=rgb(102,102,0)];[/color]
[color=rgb(102,102,0)]}[/color]

[color=rgb(40,40,40)]above the download box[/color]
[color=rgb(136,0,0)]//download box[/color]
echo [color=rgb(0,136,0)]"<center><table border='0' width='100%'><tr><td><div id='downloadbox'>"[/color][color=rgb(102,102,0)];[/color]

sorry did not understand this part ondi have to put this code?
Unknown User
2013-08-10 20:17:06
you basically put that any place you think looks good... I put it after

echo "<center><h1>" . $shortname . "</h1></center>";on 2.08Dont know what is is under 2.08 or CARE!!!

"Demon, post: 90146":
TBV MOD LOL
^^ Banned user LOL!!!
2021-12-15 18:40:17
thank you, ALSO WORKS WITH VERSION (Torrent trader 3.0)  :love  :love  :love  :thumb  :thumb  :thumb  :thumb
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728