- Posts: 29
- Thank you received: 2
How to find the HxW of thumbnailHxW
14 years 4 weeks ago #62059
by BRupholdt
How to find the HxW of thumbnailHxW was created by BRupholdt
I've setup an integration between HikaShop and a Joomla content construction kit. The CCK queries the HikaShop tables to get various information including the image name. In previous versions of HS, all thumbnails were in the same thumbnail folder making this approach quite simple. With the newer version though, the thumbnails are in a folder named with the dimensions.
Is the dimension information stored in the database somewhere that I can query for it to fix my integration?
If not, is there a way to create all thumbnails in a single thumbnail folder instead?
Possibly using a plugin? I'm reaching for ways to make this work again.
Is the dimension information stored in the database somewhere that I can query for it to fix my integration?
If not, is there a way to create all thumbnails in a single thumbnail folder instead?
Possibly using a plugin? I'm reaching for ways to make this work again.
Please Log in or Create an account to join the conversation.
14 years 4 weeks ago - 14 years 4 weeks ago #62060
by BRupholdt
Replied by BRupholdt on topic Re: How to find the HxW of thumbnailHxW
Here's the query I use to draw HS info into the CCK.
Code:
SQL Query:
SELECT
concat_ws('|',
convert(product_id,char),
file_path,
product_name,
db_menu.id
),
product_name
FROM db_hikashop_file
JOIN db_hikashop_product ON product_id=file_ref_id
JOIN db_menu on published = published
WHERE file_type='product'
AND db_menu.link='index.php?option=com_hikashop&view=product&layout=listing'
AND db_menu.parent_id=1
GROUP BY product_name
ORDER BY product_name,file_id desc
Last edit: 14 years 4 weeks ago by BRupholdt.
Please Log in or Create an account to join the conversation.
14 years 4 weeks ago #62166
by nicolas
Replied by nicolas on topic Re: How to find the HxW of thumbnailHxW
It's quite complex to know the thumbnails sizes available for an image by looking at the data in the database.
It can come from the Files/Images tab configuration options, it can come from a module or a menu option.
I see two simple ways to solve your issue:
1. Have HikaShop display the image. If you call the function display of the helper.image class, it will echo the HTML of the thumbnail and create the thumbnail in the correct folder if necessary.
2. Parse the thumbnail folders and see if the images have their thumbnail there.
It can come from the Files/Images tab configuration options, it can come from a module or a menu option.
I see two simple ways to solve your issue:
1. Have HikaShop display the image. If you call the function display of the helper.image class, it will echo the HTML of the thumbnail and create the thumbnail in the correct folder if necessary.
2. Parse the thumbnail folders and see if the images have their thumbnail there.
Please Log in or Create an account to join the conversation.
14 years 4 weeks ago #62286
by BRupholdt
Replied by BRupholdt on topic Re: How to find the HxW of thumbnailHxW
I'd considered parsing the folders to find the image but was hoping for a better way. I like the idea of having HS show the image but how would I go about that in a separate php file?
Please Log in or Create an account to join the conversation.
14 years 4 weeks ago #62413
by nicolas
Replied by nicolas on topic Re: How to find the HxW of thumbnailHxW
Like that:
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;
$image = hikashop_get('helper.image');
echo $image->display('myimage.png',false,'My image file', '' , '' ,180, 120);
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;
$image = hikashop_get('helper.image');
echo $image->display('myimage.png',false,'My image file', '' , '' ,180, 120);
The following user(s) said Thank You: BRupholdt
Please Log in or Create an account to join the conversation.
14 years 3 weeks ago #62494
by BRupholdt
Replied by BRupholdt on topic Re: How to find the HxW of thumbnailHxW
That worked perfectly and was a far better way than parsing for thumbnails that might not exist yet. Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.219 seconds