• Welcome to Simple Machines Community Forum. Please login or sign up.
December 09, 2021, 05:28:17 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


nCode Image Resizer

Started by vbgamer45, May 18, 2008, 01:43:55 PM

Previous topic - Next topic

Violat3r

Quote from: IsraelSKA on May 20, 2008, 11:10:32 AM
Im using default theme..
Im checked the code but don't work ncode.. :(

Just to clarify, have you made sure that you set image max size parameters in: "Features and Options > Layout and Options"? Its at the bottom and the first option is a drop-box asking what resize mode you want, then the 2nd option asks for the maximum size before it starts to resize the image. Its default is nothing, so you MUST first enter a max size before it will work.

ruckstande

Quote from: Violat3r on May 19, 2008, 03:03:03 PM
Quote from: IsraelSKA on May 19, 2008, 01:02:33 AM
I installed this nCode, but dont work..
i have this image in my forum, but dont show bar above the image and no resize... :(



im using smf 1.1.5

Well im using 1.1.5 to and it seems to work ok for me, you must make sure that for all custom templates that you extract the "ncode_imageresizer.js" file from the mod zip and place it inside your custom themes directory (i.e. where all your themes template files are such as index.template.php and the others). I tested it without having the .js file in the directory and no error occurred for me, its just that the resize never happened and the bar never appeared.

Quote from: ruckstande on May 19, 2008, 01:39:44 PM
Yes I am using 1.1.15 also and this isn't working for me either. I am using the Alienation theme and when I add the line to the index template.php file I get a syntax error.

The syntax error sounds to me like maybe either something in the code didnt get copied or something else like that. Make sure that you place the code JUST BEFORE the closing </head> tag in your index.template.php and that its not maybe inside another code, which i have done sometimes on accident. Also, if you just copy/pasted the code from SMF's manual install instructions....dont. Its a nice tool to have but at least for ME when i paste it all the code is mashed together. So if thats the case for you then just go into the mod zip and open the "install.mod" and copy/paste the index.template.php code from there.
Thanks, I'll try that because that is exactly what I did. I'll give it another shot

IsraelSKA

Quote from: Violat3r on May 20, 2008, 03:03:16 PM
Quote from: IsraelSKA on May 20, 2008, 11:10:32 AM
Im using default theme..
Im checked the code but don't work ncode.. :(

Just to clarify, have you made sure that you set image max size parameters in: "Features and Options > Layout and Options"? Its at the bottom and the first option is a drop-box asking what resize mode you want, then the 2nd option asks for the maximum size before it starts to resize the image. Its default is nothing, so you MUST first enter a max size before it will work.


I did...

IsraelSKA

Quote from: Violat3r on May 19, 2008, 03:03:03 PM

The syntax error sounds to me like maybe either something in the code didnt get copied or something else like that. Make sure that you place the code JUST BEFORE the closing </head> tag in your index.template.php and that its not maybe inside another code, which i have done sometimes on accident. Also, if you just copy/pasted the code from SMF's manual install instructions....dont. Its a nice tool to have but at least for ME when i paste it all the code is mashed together. So if thats the case for you then just go into the mod zip and open the "install.mod" and copy/paste the index.template.php code from there.



Yes!
nCode work in my forum...


Thanks ;)

Violat3r

lol awesome and no problem!

edi67

hi m3talc0re if you want i made some change and your version work for smf 2 beta 3.1 too ;)

http://rapidshare.com/files/116468172/ncode_imageresizer_smf_231.zip.html
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

ruckstande

Quote from: m3talc0re on May 19, 2008, 07:24:59 PM
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
I soooo don't understand. I tried copying and pasting from the .mod file and it didn't work and I had to restore the index file from a template.

Succubus Evaligan

Yuri Goddess

Violat3r

Quote from: ruckstande on May 21, 2008, 12:51:06 PM
Quote from: m3talc0re on May 19, 2008, 07:24:59 PM
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
I soooo don't understand. I tried copying and pasting from the .mod file and it didn't work and I had to restore the index file from a template.

Would you mind posting your current index.template.php (the one with the added code for this mod) so maybe we can see visually what may be wrong.

neotan

Quote from: ruckstande on May 21, 2008, 12:51:06 PM
Quote from: m3talc0re on May 19, 2008, 07:24:59 PM
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
I soooo don't understand. I tried copying and pasting from the .mod file and it didn't work and I had to restore the index file from a template.


I copied the replacement code from install.mod instead and it worked well


mycorollas

for any of you that have the Resample Big Attached Images Mod also

the Resample Big Attached Images Mod relies on the input in the max height and width of posts setting
since you have to set the settings to 0 for this mod to work, they obviously can't work together

sooooo

what I did was change the Post.php file in sources (the file Resample Big Attached Images Mod adds its code to)
and find the line that Resample Big Attached Images Mod added


$maxWidth = $modSettings['max_image_width'];
$maxHeight = $modSettings['max_image_height'];


and replace it with


$maxWidth = $modSettings['ncode_imageresizer_max_width'];
$maxHeight = $modSettings['ncode_imageresizer_max_height'];


which will then also (pertinently) resize attachments as well as images in the post to what ever you chose in the admin setting for this mod

worked great for me in 1.1.5 :D

DistantJ

I liked this, but I'd like to be able to change the border colour to black. Since the text colour of my forum is white, it's unreadable on the border!

Violat3r

June 18, 2008, 02:18:54 AM #33 Last Edit: June 18, 2008, 02:22:15 AM by Violat3r
Are you talking about that bar at the top where it displays the text? You want that box to be black? If so, find this line in your index.template.php:
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */


Now change the hex code that is #fefee1 to #000000 if you want completely black or any other darker shade or w/e color you want, but it must be a hex color code. Although if your interested, i made my own modification for my forum and your welcome to try it out; find that same line and change the part to:

background-image:url(', $settings['images_url'], '/imageresizeback.gif); background-repeat:repeat-x; /* the bgcolor behind the text and image */

Then place the attached image in your themes image folder. The other attached image is an example of what mine looks like:

DistantJ

Aha, it's CSS. Brilliant, thank you for your instructions and supplying me with the image :) really good of you to go out of your way to do that! :)

Violat3r

meh, it was a simple copy/paste of my already existing code lol. Not really much work involved, but thank you anyway! =D

Afro

June 20, 2008, 01:22:38 PM #36 Last Edit: June 20, 2008, 01:34:57 PM by sam_milla
Hello,
I initially installed ncode_image resizer mod.
Then i decided to uninstall it .
After editing the files, these errors started appearing on my forum error log from all angles..

8: Undefined index: ncode_imageresizer_warning_filesize
File: /home/afrowall/public_html/Themes/default/languages/ModSettings.english-utf8.php (main_above sub template - eval?)
Line: 320
==
8: Undefined index: ncode_imageresizer_warning_fullsize
File: /home/afrowall/public_html/Themes/default/Admin.template.php (main_above sub template - eval?)
Line: 322
==

8: Undefined index: ncode_imageresizer_warning_no_filesize
File: /home/afrowall/public_html/Themes/dilbermc/BoardIndex.template.php (main_above sub template - eval?)
Line: 321

.There are more but all of them seems to be connected to

8: Undefined index: ncode_imageresizer_warning_no_filesize.
and ((main_above sub template - eval?))

please what am i supposed to do about that?

Violat3r

Did you get any errors at all when you clicked the uninstall button? Or did it just say "Test Successful" for all of them?

Afro

I did not install this mod properly in the first place.
that was why i decided to remove it.
I was very inexperienced when i installed it but i know better now.
I dont use the default theme, so i always have to modify some more files with each mod i install.
I will have to go to the mod again and see the files it execute.the try to work on them and see what happens. i will be back with my results.

Afro

ok, i have fixed it now,..thanks to ye all.

Advertisement: