Subcategory with fixed image

Phoca Gallery - image gallery extension
castep
Phoca Member
Phoca Member
Posts: 12
Joined: 21 Mar 2008, 13:15

HiCan I set a

Post by castep »

Hi
Can I set a fixed (not random) image as subcategory thumbnail ?

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

No, ... only if you

Post by Jan »

No, ... only if you know php and sql, you can change the SQL query...

or you change the parameters to folder icon and you replace the folder icon with your image

Jan
If you find Phoca extensions useful, please support the project
castep
Phoca Member
Phoca Member
Posts: 12
Joined: 21 Mar 2008, 13:15

Yes, I know php and

Post by castep »

Yes, I know php and mysql. Can you give me more details?
...about the second choice, if i replace the folder icon, that image will be the same for all subcategory... indeed, I need a different (but not random) image for each subcategory.

Castep
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Just change the foll

Post by Jan »

Just change the following code:

IN: components\com_phocagallery\models\category.php
ROW: 231

$query = 'SELECT id, filename' .
' FROM #__phocagallery' .
' WHERE catid = '.(int) $categoryid.
' AND published = 1'.
' ORDER BY RAND()';


to your own, e.g. you want the first picture of the category will be displayed:

$query = 'SELECT id, filename' .
' FROM #__phocagallery' .
' WHERE catid = '.(int) $categoryid.
' AND published = 1'.
' ORDER BY ordering';


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

If you have changed

Post by Jan »

If you have changed it in categories.php (image next to category in categories view) and in category.php ('folder image' in category view) you should get the first image, not random ???

I am trying it and it works...

did you change the _getRandomImageRecursive method?... Is there an image in your subcategory?

Jan
If you find Phoca extensions useful, please support the project
Post Reply