Hello
I use phoca gallery 2.0.2 in joomla 1.5
Everything is ok BUT:
Is it possible to CHOOSE the picture that I WANT in the folder icon of category of phoca gallery??
Now i use Display random image as folder icon but I want one particular picture.
How can I do that?
Thanks
[SOLVED] Choose picture of folder icon of category
- spoondub
- Phoca Newbie
- Posts: 5
- Joined: 23 Dec 2008, 12:34
- Location: Belgique
- Contact:
[SOLVED] Choose picture of folder icon of category
Last edited by spoondub on 11 Apr 2017, 10:24, edited 2 times in total.
- caro84g
- Phoca Hero
- Posts: 1369
- Joined: 11 Feb 2008, 17:52
- Location: Holland
- Contact:
Re: Choose picture of folder icon of category
Please ask your support questions in the forums and not via PM - I delete those PM's
Backup before you do any major change to your website (and test first)
Backup before you do any major change to your website (and test first)
- spoondub
- Phoca Newbie
- Posts: 5
- Joined: 23 Dec 2008, 12:34
- Location: Belgique
- Contact:
Re: Choose picture of folder icon of category
Thanks for your answer
but I must choose NO for Display random image as folder icon ?
and then I don't have the same at that line 166 or 438 +-
sory I'm a beginner
but I have 3 order by rand() in category.php :
function _getRandomImage($categoryid)
function _getRandomImageRecursive($categoryid)
function _getRandomCategory($parentid)
and I have 2 order by rand() in categories.php :
function _getRandomImageRecursive($categoryid)
function _getRandomCategory($parentid)
Wich Order by rand() must I change? and in 2 folder?
I d'ont understand very wel the difference between category and category view...
Order by ordering display the first photo of the catgeory?
I try differents solutions but that doesn't go
thanks for all!
but I must choose NO for Display random image as folder icon ?
and then I don't have the same at that line 166 or 438 +-
sory I'm a beginner
but I have 3 order by rand() in category.php :
function _getRandomImage($categoryid)
function _getRandomImageRecursive($categoryid)
function _getRandomCategory($parentid)
and I have 2 order by rand() in categories.php :
function _getRandomImageRecursive($categoryid)
function _getRandomCategory($parentid)
Wich Order by rand() must I change? and in 2 folder?
I d'ont understand very wel the difference between category and category view...
Order by ordering display the first photo of the catgeory?
I try differents solutions but that doesn't go
thanks for all!
Spoon
- Jan
- Phoca Hero
- Posts: 48694
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Choose picture of folder icon of category
see:
https://www.phoca.cz/documents/2-phoca-g ... stallation for explaining what is a category view...
I am not on my PC now so I cannot say you the exact code which you should to change but you should comment the method wich get random image from category or subcategory and edit it with code which get e.g. the first image from the database (in sql query )... if you search this forum, I have paste there min. 2x how to do it exactly...
Jan
https://www.phoca.cz/documents/2-phoca-g ... stallation for explaining what is a category view...
I am not on my PC now so I cannot say you the exact code which you should to change but you should comment the method wich get random image from category or subcategory and edit it with code which get e.g. the first image from the database (in sql query )... if you search this forum, I have paste there min. 2x how to do it exactly...
Jan
If you find Phoca extensions useful, please support the project
- Jan
- Phoca Hero
- Posts: 48694
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Choose picture of folder icon of category
see:
https://www.phoca.cz/documents/2-phoca-g ... ent/24-faq
https://www.phoca.cz/documents/2-phoca-g ... ories_view
https://www.phoca.cz/documents/2-phoca-g ... ent/24-faq
https://www.phoca.cz/documents/2-phoca-g ... ories_view
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 32
- Joined: 04 Nov 2008, 01:57
Re: Choose picture of folder icon of category
well the solution is this one:
But I think it would be easier to choose some image in the category details (in phoca gallery backend administration) otherwise we will have to make sure the image we want is in 1st place by order. But for a free extension its good enough 
Code: Select all
Open file:
components/com_phocagallery/models/categories.php
Find (line 166 + -):
' ORDER BY RAND()'; and replace it to ' ORDER BY ordering';
If you want to make this change for Category View too, then Open file:
components/com_phocagallery/models/categoriy.php
Find (line 438 + -):
' ORDER BY RAND()'; and replace it to ' ORDER BY ordering';

- Jan
- Phoca Hero
- Posts: 48694
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Choose picture of folder icon of category


Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 32
- Joined: 04 Nov 2008, 01:57
Re: Choose picture of folder icon of category
Code: Select all
If you want to make this change for Category View too, then Open file:
components/com_phocagallery/models/categoriy.php
Find (line 438 + -):
' ORDER BY RAND()'; and replace it to ' ORDER BY ordering';
-function _getRandomCategory($parentid)
-function _getRandomImageRecursive($categoryid)
-function _getRandomImage($categoryid)
Where do we replace?
- Jan
- Phoca Hero
- Posts: 48694
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Choose picture of folder icon of category
but only one line nr.: 438 and this line (cca) is included in:
_getRandomImageRecursive
_getRandomImageRecursive
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 32
- Joined: 04 Nov 2008, 01:57
Re: Choose picture of folder icon of category
how can we find lines?