Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

phpBB image resizer

Resizes images which exceed the page width in phpBB forums.

When images are posted in a phpBB forum thread which exceed the page width, the layout can get pretty messed up. This script sets a maximum width on the images. The images are shown in their original size when you click on them.






Jun 13, 2006
Ed Smilde User

Finally! This is what I need!

 
Jan 9, 2006
Grauw Script's author

Heh, just some fun. Oh goody.

 
Jan 9, 2006
Grauw Script's author

Hi Glodenox,

I added the title change when clicking, but I’m not able to read the rest of your code (between for j=0; j < and > maxWidth). It seems that userscripts.org’s comment system accepts HTML, and breaks miserably when you provide invalid HTML such as yours with unescaped <’s.

I wonder what this means for security... Surely I can make a script this way which catches your login data and sends them to a server of mine?

Ehehehe… \^_^/

 
Jan 7, 2006
Glodenox User

I added some more tags by accident because I didn't understand where to put a comment...
I could no longer remove the tags which were placed twice or more :(

However, about the userscript:
I added two extra lines of code (and some lines with closing tags of course):

for (j=0; j<aimg>
// only change things if the width is longer than it may be
if (aImg[j].width > maxWidth) {

and a bit further in the code:
// change title when clicked at image for original size and vice versa
if (event.currentTarget.style.maxWidth == 'none') {
event.currentTarget.style.maxWidth = maxWidth + 'px';
event.currentTarget.title = 'Click for the original size';
} else {
event.currentTarget.style.maxWidth = 'none';
event.currentTarget.title = 'Click for the restricted size';
}

You could comment on this script if you were logged in.