Plugin - NFO Imager

shwetha17

Member
May 24, 2018
785
0
16
This builds on Soupnazi's original NFO plugin idea

After failing to get that to work reliably on all browsers and operating systems (due to character-set and formatting issues) I decided to write this which renders and then displays NFOs as images

It uses a pre-rendered version of an original fixed-pitch CGA 8 x 8 pixel character set (code page 437) and an EGA 9 x 8 pixel version is also included - Extra character sets can be added by creating additional pre-rendered images (see config.php for more info)

The image format (PNG/GIF/JPEG) and the display colours (full RGB) are configurable (Again see config.php for more info)

Requires PHP 5 and GD 1.8 or later (or 2.0.28 if using GIF support)

It's available for download here - http://kitty-kode.com/kode/rutorrent/plugins/nfo_img.tar.gz

One thing I haven't managed but which I would like is to be able to make the image right-clickable so it can be 'Saved as' - Is this possible? If so how do I accomplish it with JS and the RuTorrent code?

Oh - And if anyone wants to translate the language files I'll update the archive

Version history/Changelog -

1.0 - Initial release
1.1 - Added 'Save Image...' button
1.2 - Fixed the path in get_img

2011-05-02 - Updated archive with ES translation (thanks Xenus!)
 

jith45

Member
May 25, 2018
960
0
16
One thing I haven't managed but which I would like is to be able to make the image right-clickable so it can be 'Saved as' - Is this possible? If so how do I accomplish it with JS and the RuTorrent code?
$("#nfoimg_html img").bind("contextmenu",function(e) { e.stopImmediatePropagation(); });
 

somus1735

Member
May 25, 2018
833
0
16
Thanks for that Novik

Sadly it didn't work for me though ('e.stopImmediatePropagation is not a function')

But it put me on the right track and after a bit of searching I found 'stopPropagation()' and that did it

I've also implemented a 'Save Image...' button which provides the real name of the NFO file and the name of the torrent - If using the button then the file name will be formatted as 'filename.nfo.(torrent-name).png' - But if using a right-click it will come up as 'get_img.php.png'

I've updated the archive and the link in the first post will now get the newer version with both these features
 

jith45

Member
May 25, 2018
960
0
16
Great plugin! Thanks.


ES translation
Code:
theUILang.showNfoImg = "Ver NFO...";
theUILang.nfoImgNotFound = "No se pudo encontrar archivo NFO";
theUILang.nfoImgNotFoundTitle = "No encontrado";
theUILang.nfoImgError = "Ocurrió un error: ";
theUILang.nfoImgErrorTitle = "Error";
 

dsouvik215

Member
May 25, 2018
896
0
16
I can't find this version anywhere in the SVN? Also, i downloaded the tar from the link but when i installed it, it's not working? Just shows me a blank box.
 

shwetha17

Member
May 24, 2018
785
0
16
It isn't in the SVN - And being a non-core/third-party plugin I think it's probably unlikely to be - I'm not sure whether it's in the Wiki or not (I think that would probably be down to Wonslung)

The blank window could be caused by your system not having GD/PHP-GD installed - I had similar silent-failure problems on a box without it

Make sure that you're running at least PHP 5 and have GD/PHP-GD version 1.8 or later (or 2.0.28 if you want GIF support)

You can install PHP-GD on CentOS with
Code:
yum install gd php-gdand I suspect that on Debian or Ubuntu it would be
Code:
apt-get install gd php-gdThere are likely similar commands for other distros but I don't know what they'd be I'm afraid
 

somus1735

Member
May 25, 2018
833
0
16
Hey Kitty, I've installed the GD (OS is Ubuntu), but i still get the blank screen with the word "Checking"
 

jith45

Member
May 25, 2018
960
0
16
When I click save I get
Quote
Not Found

The requested URL /plugins/nfo_img/get_img.php was not found on this server.​

This is because it tries to download using this link:
http://myseedboxip/plugins/nfo_img/get_img.php?id=5EDCFDA8F7556E2BE81926793B47F83BF8964711&save=save
while it should be
http://myseedboxip/rtorrent/plugins/nfo_img/get_img.php?id=5EDCFDA8F7556E2BE81926793B47F83BF8964711&save=save
To fix this I removed the trailing slash from line
Code:
'<form name="nfo_img2" method="GET" action="/plugins/nfo_img/get_img.php" style="padding-top: 8px;">'+in init.js
I changed it to
Code:
'<form name="nfo_img2" method="GET" action="plugins/nfo_img/get_img.php" style="padding-top: 8px;">'+Now it works just fine..

I also have a feature request, similar to the one I posted about the "normal" NFO plugin:
http://forums.rutorrent.org/index.php?topic=1370.0
I hope you can do something about it...
Cheers and thanks - useful plugin!!
 

das329717

Member
May 25, 2018
928
0
16
Thanks ChriZathens

I've updated the archive with your change

I'll have a look at your request but I don't (yet) know how to add an entry to the 'files' or 'filemanager' menus