Log in

View Full Version : Does [attach] forum images [img] need an extra query to show?


ThorstenA
08-14-2008, 04:22 PM
I am planing to use massive bbcodes, are there extra queries need to show images from [img] posts?

Example: This picture is an attachment.
85456
Now when I link to this attachment using [img]https://vborg.vbsupport.ru/attachment.php?attachmentid=85456&thumb=1&d=1218734503, is an extra query needed?

Images are in database, not in file system.

Marco van Herwaarden
08-15-2008, 06:14 AM
If you use the img-tag to link to a local image using attachment.php, then yes it will add queries.

If you link to an image file (ie. www.somesite.com/image.jpg (http://www.somesite.com/image.jpg)) then it will not add a query.

ThorstenA
08-15-2008, 06:25 AM
If you use the img-tag to link to a local image using attachment.php, then yes it will add queries.

If you link to an image file (ie. www.somesite.com/image.jpg (http://www.somesite.com/image.jpg)) then it will not add a query.

If I have one post with lets say 5 [ img ] bbcodes to different images from 3 different posts. Will it then add 1 query, 3 queries or 5 queries? Thanks.

Opserty
08-15-2008, 08:56 AM
attachment.php will act as its own seperate page, so it will run the queries its needs to. Essentially, it is as though someone is visiting the page and its output is the attachment.

ThorstenA
08-15-2008, 09:05 AM
So it will then only add 1 query to fetch all images regardeless how many [ img ] bbcodes I use. That's okay.

Opserty
08-15-2008, 09:07 AM
It doesn't "Add" a query, these queries are executed on an entirely different page. Its like someone has clicked a link to the page.

ThorstenA
08-15-2008, 09:12 AM
Yes, that's okay. I wrote my announcement cms (https://vborg.vbsupport.ru/showthread.php?t=188087) and want to inform users how much more queries are executed when importing this modification. So I will say them, that 1 query is executed if attachments are in database and there are [ img ] bbcodes within posts that are redirections to thumbnails.

Marco van Herwaarden
08-16-2008, 11:51 AM
No, attachment.php might add more then 1 query.