[SOLVED] Choose picture of folder icon of category

Phoca Gallery - image gallery extension
User avatar
spoondub
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 23 Dec 2008, 12:34
Location: Belgique
Contact:

[SOLVED] Choose picture of folder icon of category

Post 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
Last edited by spoondub on 11 Apr 2017, 10:24, edited 2 times in total.
User avatar
caro84g
Phoca Hero
Phoca Hero
Posts: 1369
Joined: 11 Feb 2008, 17:52
Location: Holland
Contact:

Re: Choose picture of folder icon of category

Post by caro84g »

Hi,

check the FAQ: https://www.phoca.cz/documents/2-phoca-g ... ories_view

Regards, Carolien
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)
User avatar
spoondub
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 23 Dec 2008, 12:34
Location: Belgique
Contact:

Re: Choose picture of folder icon of category

Post 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!
Spoon
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48694
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Choose picture of folder icon of category

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48694
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Choose picture of folder icon of category

Post by Jan »

If you find Phoca extensions useful, please support the project
webrp
Phoca Member
Phoca Member
Posts: 32
Joined: 04 Nov 2008, 01:57

Re: Choose picture of folder icon of category

Post 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 ;)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48694
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Choose picture of folder icon of category

Post by Jan »

:wink: 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
If you find Phoca extensions useful, please support the project
webrp
Phoca Member
Phoca Member
Posts: 32
Joined: 04 Nov 2008, 01:57

Re: Choose picture of folder icon of category

Post 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?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48694
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Choose picture of folder icon of category

Post by Jan »

but only one line nr.: 438 and this line (cca) is included in:
_getRandomImageRecursive
If you find Phoca extensions useful, please support the project
webrp
Phoca Member
Phoca Member
Posts: 32
Joined: 04 Nov 2008, 01:57

Re: Choose picture of folder icon of category

Post by webrp »

how can we find lines?
Post Reply