how to define a certain image as the gallery category image

Phoca Gallery - image gallery extension
mbaier
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Mar 2009, 03:09
Location: Switzerland

how to define a certain image as the gallery category image

Post by mbaier »

hello - we're having trouble with the fact that phocagallery choses random images that are being displayed for each category. we've found and implemented a fix that should change this image from random to "ASC" (which i guess means ascending based on the filename) - but that does not work either.

// We need to get a list of all phocagallery in the given category
$query = 'SELECT id, filename' .
' FROM #__phocagallery' .
' WHERE catid = '.(int) $categoryid.
' AND published = 1'.
' ORDER BY id ASC'; <<<<<-----------------------------------------
$images = $this->_getList($query, 0, 1);

we also read the FAQ:

read the FAQ: https://www.phoca.cz/documents/2-phoca-g ... ories_view

and we changed the files accordingly, but still the wrong files are being displayed. it should work so that the first file/image (file Nr. 1 within a category) should be displayed, right ?

has anyhone had the same problem ?

many thanks for your help
marc
mbaier
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Mar 2009, 03:09
Location: Switzerland

Re: how to define a certain image as the gallery category image

Post by mbaier »

BUMP

Jan - do you have an answer for our problem. Is it really not possible to define a fixed image that is being displayed for a certain category ?

thanks for your help
marc
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how to define a certain image as the gallery category image

Post by Jan »

Hi, order by ID ASC means that it will be find the first image ordered by ID (so the ID), if you set e.g. by ORDER ASC, then the first image which have the ordering 1,...

Jan
If you find Phoca extensions useful, please support the project
mbaier
Phoca Member
Phoca Member
Posts: 21
Joined: 04 Mar 2009, 03:09
Location: Switzerland

Re: how to define a certain image as the gallery category image

Post by mbaier »

Hi Jan - is there no way to define a specific image to be displayed for a specific category ? Since we re-installed our gallery we did not include the "order by ID ASC" - "hack" anymore

Thanks
Marc
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how to define a certain image as the gallery category image

Post by Jan »

Hi, you should save your hack and copy it after upgrade back to the gallery. No there is not such function, so only this hack needs to be done :-(

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: how to define a certain image as the gallery category image

Post by Jan »

https://www.phoca.cz/documents/2-phoca-g ... ent/24-faq

components/com_phocagallery/models/categories.php
components/com_phocagallery/models/category.php
If you find Phoca extensions useful, please support the project
Post Reply