[img width="300"]

Use this forum to ask questions about how to use this website, or to make any general comments about how it works
Post Reply
mcds
Posts: 802
Joined: April 7th, 2012, 4:25 pm

[img width="300"]

Post by mcds » February 1st, 2013, 7:05 pm

Curious about using a 3rd party to host photos ...

I set up a free account on photobucket.

Is there a way for a poster to augment the [img] tag as, say [img width="300"], so that the image is displayed smaller than it actually is, yet allow the reader to click on the image to see it at its fullsize?

It would be sweet to have [img width="" and height=""][/img] be what is inserted by default when clicking the Img button during composition of the post. If both remained "", then the image would be displayed per usual.

User avatar
kepPNW
Posts: 6411
Joined: June 21st, 2012, 9:55 am
Location: Salmon Creek

Re: [img width="300"]

Post by kepPNW » February 2nd, 2013, 6:30 am

I agree, that'd be very nice indeed. I don't think I've ever seen named elements in bbs tags, though. (I'd also like to have a title= element on Url tags, sometimes!) Closest this board comes is a couple of comma-delimited elements in the Flash tag.

You might look at the guts of one of my TRs (visible by hitting the Quote button) for one possible workaround. You can upload multiple sizes to photobucket, embed the smaller size here, and have it link to the larger one. It's a lot of code to do manually, so I wrote a little app that stitches it all together for me given just a couple selections. Best I've come up with, so far.
Karl
Back on the trail, again...

mcds
Posts: 802
Joined: April 7th, 2012, 4:25 pm

Re: [img width="300"]

Post by mcds » February 5th, 2013, 12:00 pm

I think the resizing is built into bbcode, just a matter of enabling it

http://www.bbcode.org/reference.php

Full version:
[img width={width} height={height} ...]{url}[/img]

Another variant (shorthand):
[img={width}x{height}]{url}[/img]

User avatar
kepPNW
Posts: 6411
Joined: June 21st, 2012, 9:55 am
Location: Salmon Creek

Re: [img width="300"]

Post by kepPNW » February 5th, 2013, 3:49 pm

mcds wrote:I think the resizing is built into bbcode, just a matter of enabling it
Well shoot! That'd sure make life easier. (Although it also forces every user to download more bits than otherwise, assuming most won't click on but a few for enlargements. Yeah, that's the geezer in me talkin', there. ;))
Karl
Back on the trail, again...

Lurch
Posts: 1270
Joined: May 28th, 2008, 10:03 pm
Location: Aurora
Contact:

Re: [img width="300"]

Post by Lurch » February 6th, 2013, 8:02 am

mcds wrote: Another variant (shorthand):
[img={width}x{height}]{url}[/img]
Custom bbcode must be put in by an admin, not just 'turned on' it's just a simplified shorthand for what can be extra complicated html

Personally I would probably go with:

bbcode:

Code: Select all

[thumb={NUMBER}]{URL}[/thumb]
html:

Code: Select all

<a href="{URL}"><img style="max-width:{NUMBER}px;" src="{URL}" alt="Image" /></a>
If you put width and height in, than people will need to shrink both accordingly or risk distorting their image. Using only the width only should let the code resize the other accordingly to maintain the correct ratio, it also creates a link to the full rez image. The "number" could also be hardcoded to whatever is appropriate, like 300px or so?

User avatar
Eric Peterson
Posts: 4097
Joined: May 11th, 2009, 5:39 am
Location: Oregon
Contact:

Re: [img width="300"]

Post by Eric Peterson » February 6th, 2013, 8:06 am

I think Martell has a phpBB3 add on that auto resizes. I would like to know which one actually
for a small forum I have test running on tff.com :)

Lurch
Posts: 1270
Joined: May 28th, 2008, 10:03 pm
Location: Aurora
Contact:

Re: [img width="300"]

Post by Lurch » February 6th, 2013, 8:21 am

I know you can set a max size in the ACP, but I don't think that will resize automagically for you.

A simple css tweak will do it and not have to deal with the php

User avatar
Martell
Posts: 2045
Joined: May 28th, 2008, 10:03 pm
Location: SW Portland

Re: [img width="300"]

Post by Martell » February 6th, 2013, 3:07 pm

I think Lurch is on the right track with creating a thumb tag rather than trying to figure out how to override img.
-Dan
Site Tech Helper

mcds
Posts: 802
Joined: April 7th, 2012, 4:25 pm

Re: [img width="300"]

Post by mcds » February 8th, 2013, 4:33 pm

http://www.w3schools.com/cssref/pr_dim_max-width.asp

Code: Select all

[thumb={STR}]{URL}[/thumb]

Code: Select all

<a href="{URL}"><img style="max-width:{STR};max-height:{STR};" src="{URL}" alt="Image" /></a>

Post Reply