Skip to main content
For reference only. Please use a different board for new questions

Using 404 caching for images

More
11 years 7 months ago #1229 by redactie
The width is hard code in the index.php of the 404 scripts.

the component does not support multiple images so if you want to have a thumb and a large image you will need to edit the layouts and compile your own image link.

Please Log in to join the conversation.

More
11 years 7 months ago #1237 by mackelito
Found the width/height just after posting hehe..

Can change the script so that it creates 2 versions of the images?
imgname and imgname-thumb

And then I´ll just change in the layouts :)

Please Log in to join the conversation.

More
11 years 7 months ago #1238 by redactie
quick and dirty is to have two instances of the scripts.

ROOT/img/large/index.php

ROOT/img/thumb/index.php

Please Log in to join the conversation.

More
11 years 7 months ago #1239 by mackelito
Well.. what can I say... I like your dirty idea! ;)
thx!

Please Log in to join the conversation.

More
11 years 7 months ago - 11 years 7 months ago #1240 by mackelito
What about the xhelper file?
Do I need to add something?

I wanted to have my structure like:
/product-images/large
/product-images/thumbs

Will that be a problem? Because I can´t get it to work :P
Last edit: 11 years 7 months ago by mackelito.

Please Log in to join the conversation.

More
11 years 7 months ago #1245 by redactie

mackelito wrote:
I wanted to have my structure like:
/product-images/large
/product-images/thumbs


what did you do/change?

first in the index.php of the 404 caching script ( you have two of them) the $basedir should reflect the path to the image location. so they should be 'product-images/large' and 'product-images/thumb'

From the components database you can only get one image url formated (in the xhelpers.php)
Code:
define ('DF_IMAGE','concat("https://img.example.com/product-images/large/",`feed_id`,"/",`items_id`,".jpg")');

If you want to use the other one you will need to create it using php

so where the template says

$item (or $row )

it becomes

' img.example.com/product-images/thumbs/'.$item .'/'.$item.'.jpg'

Please Log in to join the conversation.

Time to create page: 0.948 seconds