Thanks for your help - siy
How to display always the same thumbnail for a category in c
-
siyman
- Phoca Member

- Posts: 13
- Joined: 20 Oct 2009, 17:12
How to display always the same thumbnail for a category in c
I've read in the faq that there is still no more need of hacking the core files because there is an option how to do it - but how? When I set up the category view to show up pictures I have no possibility to set up which ones nor to randomize this process. I need fix pictures for each category urgently. Currently phoca uses random ones and I didn't st this up (I think
)
Thanks for your help - siy
Thanks for your help - siy
- Jan
- Phoca Hero

- Posts: 49172
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to display always the same thumbnail for a category in c
Hi, in parameters component. You can set which ordering will be used for displaying image instead of folder icon. If you set e.g. ordering by order ASC then the images will be still the same, see:
https://www.phoca.cz/documents/2-phoca-g ... -menu-item
https://www.phoca.cz/documents/2-phoca-g ... -menu-item
If you find Phoca extensions useful, please support the project
-
siyman
- Phoca Member

- Posts: 13
- Joined: 20 Oct 2009, 17:12
Re: How to display always the same thumbnail for a category in c
Jan,
I'm sorry for not being able to understand your words but I can't find the option you describe. That's why could you please tell me what option (and how is it named) exactly does the stuff with the preview pictures. I tried a lot of ways to make it sticky but everytime it randomizes the chosen pictures.
Update: I've found out that the random pictures only affect empty parent-categories, e.g. Parent Category (no pictures) -> Step 2 Parent Category (empty) -> 3 Child Categories with lot of pictures inside.
The non empty categories have sticky pictures in preview but not the empty parents. Any Idea?
Update 2: In Phoca Gallery there has to be code expecially for this case: empty parent (thumbnail) which is class random();. May you give me a hint where to find it?
I'm sorry for not being able to understand your words but I can't find the option you describe. That's why could you please tell me what option (and how is it named) exactly does the stuff with the preview pictures. I tried a lot of ways to make it sticky but everytime it randomizes the chosen pictures.
Update: I've found out that the random pictures only affect empty parent-categories, e.g. Parent Category (no pictures) -> Step 2 Parent Category (empty) -> 3 Child Categories with lot of pictures inside.
The non empty categories have sticky pictures in preview but not the empty parents. Any Idea?
Update 2: In Phoca Gallery there has to be code expecially for this case: empty parent (thumbnail) which is class random();. May you give me a hint where to find it?
-
siyman
- Phoca Member

- Posts: 13
- Joined: 20 Oct 2009, 17:12
Re: How to display always the same thumbnail for a category in c
[Solved]
For giving static thumbnails I used a little hack in components/com_phocagallery/models/categories.php (because I use categoryview for previewing) on line 399 "' AND a.published = 1'." and changed the value to 0. Afterwards I unpublished every picture I wanted as thumbnail. Now these ones aren't shown in normal view but as preview thumbnails.
For giving static thumbnails I used a little hack in components/com_phocagallery/models/categories.php (because I use categoryview for previewing) on line 399 "' AND a.published = 1'." and changed the value to 0. Afterwards I unpublished every picture I wanted as thumbnail. Now these ones aren't shown in normal view but as preview thumbnails.
-
aaronrrc
- Phoca Newbie

- Posts: 8
- Joined: 10 Jan 2010, 22:11
Re: How to display always the same thumbnail for a category in c
Hi, this worked fine for previous versions of phocagallery, in 2.6.1 version I can't find that line, who knows how to display the same thumbnail on this version??? thanks in advance. 
-
siyman
- Phoca Member

- Posts: 13
- Joined: 20 Oct 2009, 17:12
Re: How to display always the same thumbnail for a category in c
I'll try to find way for you when I'm ready with updating joomla and phoca which currently has not been doneaaronrrc wrote:Hi, this worked fine for previous versions of phocagallery, in 2.6.1 version I can't find that line, who knows how to display the same thumbnail on this version??? thanks in advance.
-
aaronrrc
- Phoca Newbie

- Posts: 8
- Joined: 10 Jan 2010, 22:11
Re: How to display always the same thumbnail for a category in c
Im still looking for a solution to this, but cant find it, thanks siyman!
-
siyman
- Phoca Member

- Posts: 13
- Joined: 20 Oct 2009, 17:12
Re: How to display always the same thumbnail for a category in c
I'm sorry for disappointing you, but I can't find anything which is needed for my project - so I won't update to 2.6.2. Nevertheless I'm in will for giving you some help and just need one information for that.aaronrrc wrote:Im still looking for a solution to this, but cant find it, thanks siyman!
Jan: Where is the random image generator located for the categories preview thumbnail?
-
aaronrrc
- Phoca Newbie

- Posts: 8
- Joined: 10 Jan 2010, 22:11
Re: How to display always the same thumbnail for a category in c
Finally solved, in this version you have to change the file:
\administrator\components\com_phocagallery\libraries\phocagallery\image\imagefront.php
in the function getRandomImageRecursive, in line 401, change:
to:
Now, if you want to see the static thumbnail only as a thumbnail, not as an image in the gallery,
you can add this line:
Logically you have to unpublish and unauthorize the images that you want as thumbnails.
This line is because if you only change the first line mentioned (AND a.published = 1), the images wont be available for detail view, but will be available as thumbnail in the category view.
Siyman you did put me in the right direction with your question to Jan.
Siyman and Jan, thanks a lot for you disposition to help me!!
\administrator\components\com_phocagallery\libraries\phocagallery\image\imagefront.php
in the function getRandomImageRecursive, in line 401, change:
Code: Select all
' AND a.published = 1'.Code: Select all
' AND a.published = 0.you can add this line:
Code: Select all
' AND a.approved = 0'.This line is because if you only change the first line mentioned (AND a.published = 1), the images wont be available for detail view, but will be available as thumbnail in the category view.
Siyman you did put me in the right direction with your question to Jan.
Siyman and Jan, thanks a lot for you disposition to help me!!
- Jan
- Phoca Hero

- Posts: 49172
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: How to display always the same thumbnail for a category in c
Ok
If you find Phoca extensions useful, please support the project