Page 1 of 1

how to define a certain image as the gallery category image

Posted: 07 Mar 2009, 16:49
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

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

Posted: 20 Mar 2009, 09:40
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

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

Posted: 23 Mar 2009, 23:49
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

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

Posted: 01 Apr 2009, 16:33
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

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

Posted: 01 Apr 2009, 18:45
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

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

Posted: 10 Apr 2009, 23:13
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