Page 1 of 2
[SOLVED] Choose picture of folder icon of category
Posted: 23 Dec 2008, 12:53
by spoondub
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
Re: Choose picture of folder icon of category
Posted: 23 Dec 2008, 15:53
by caro84g
Re: Choose picture of folder icon of category
Posted: 23 Dec 2008, 21:37
by spoondub
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!
Re: Choose picture of folder icon of category
Posted: 25 Dec 2008, 00:05
by Jan
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
Re: Choose picture of folder icon of category
Posted: 26 Dec 2008, 03:03
by Jan
Re: Choose picture of folder icon of category
Posted: 27 Dec 2008, 19:47
by webrp
well the solution is this one:
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';
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

Re: Choose picture of folder icon of category
Posted: 28 Dec 2008, 02:17
by Jan

the problem is not adding such feature into the system, the problem is about count of such options... so it is very easy to add this parameter into all parameters but on my paper there are cca 300 - 500 feature request parameters, I think if I will iplement them all, nobody wants to go through these parameters

Jan
Re: Choose picture of folder icon of category
Posted: 28 Dec 2008, 07:16
by webrp
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';
hummm file category.php has 3 functions with that line:
-function _getRandomCategory($parentid)
-function _getRandomImageRecursive($categoryid)
-function _getRandomImage($categoryid)
Where do we replace?
Re: Choose picture of folder icon of category
Posted: 29 Dec 2008, 18:19
by Jan
but only one line nr.: 438 and this line (cca) is included in:
_getRandomImageRecursive
Re: Choose picture of folder icon of category
Posted: 29 Dec 2008, 19:24
by webrp
how can we find lines?