Peter Poelman
11-01-2004, 01:27 PM
As some of you may have noticed, attaching large images breaks the phpBB layout.
[DSC00580.JPG left]There is a way to make the "phpBB attachment MOD" do thumbnails, but I didn't like the way attachments get all their meta-info displayed. Nice for zip files and the like, not for images. They should be a natural part of the layout.
Luckily I had some code lying around I wrote for the school website I built a while ago. At that site we use phpBB as a sort of content management system, and the code allows for some flexibility when attaching images.
From now on, if you attach an image, you can give it a place in your message by enclosing the name in square brackets anywhere. So if you attach an image called 'DSC000237.jpg' then if you put '[dsc000237.jpg]' in the text, this gets replaced with the image. (The name is not case sensitive). The image will be resized if it is wider than 500 pixels, clickable for those that want to see the original image. Unless you put 'noframe' after it (i.e. '[dsc000237.jpg noframe]' ), the image will be placed inside a narrow white frame that also holds the attachment description.
[DSC00579.JPG]
If you say '[dsc000237.jpg left]' or '[dsc000237.jpg right]', the image will be inserted to the left or the right of the text flow, and resized to be 200 pixels wide. Again, you can add 'noframe' after the left or right to make the frame disappear.
Any images not mentioned in the text get shown at the bottom of the message, two side by side.
I've added a few pictures with this message so you get the idea. For the curious: it's a school in Eastern Germany, redesigned by Friendensreich Hundertwasser.
[DSC00580.JPG left]There is a way to make the "phpBB attachment MOD" do thumbnails, but I didn't like the way attachments get all their meta-info displayed. Nice for zip files and the like, not for images. They should be a natural part of the layout.
Luckily I had some code lying around I wrote for the school website I built a while ago. At that site we use phpBB as a sort of content management system, and the code allows for some flexibility when attaching images.
From now on, if you attach an image, you can give it a place in your message by enclosing the name in square brackets anywhere. So if you attach an image called 'DSC000237.jpg' then if you put '[dsc000237.jpg]' in the text, this gets replaced with the image. (The name is not case sensitive). The image will be resized if it is wider than 500 pixels, clickable for those that want to see the original image. Unless you put 'noframe' after it (i.e. '[dsc000237.jpg noframe]' ), the image will be placed inside a narrow white frame that also holds the attachment description.
[DSC00579.JPG]
If you say '[dsc000237.jpg left]' or '[dsc000237.jpg right]', the image will be inserted to the left or the right of the text flow, and resized to be 200 pixels wide. Again, you can add 'noframe' after the left or right to make the frame disappear.
Any images not mentioned in the text get shown at the bottom of the message, two side by side.
I've added a few pictures with this message so you get the idea. For the curious: it's a school in Eastern Germany, redesigned by Friendensreich Hundertwasser.