Hi
Can I set a fixed (not random) image as subcategory thumbnail ?
Thanks
Subcategory with fixed image
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
No, ... only if you
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
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
-
- Phoca Member
- Posts: 12
- Joined: 21 Mar 2008, 13:15
Yes, I know php and
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
...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
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Just change the foll
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
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
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
If you have changed
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
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