Random Category Thumbnail (Order Ascending when viewing cat)

Phoca Gallery - image gallery extension
Zachary
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Mar 2011, 21:45

Random Category Thumbnail (Order Ascending when viewing cat)

Post by Zachary »

I have a setup as follows(shown below), using Image Only view (showing thumbnails for each category).
I would like to show a random thumbnail where the subcategory is concerned, while still keeping OrderingAscending in place.

Basically, when you view January, it shows Image 01 because that is the first image from January.
If ordering is set to random, January's images order Image 15, Image 03, Image 07, Image 12, Image 02 etc and the thumbnail for January is the first random image.

What I would like is some sort of tweak that I can do, where the ordering for January is OrderingAscending, as shown, but the thumbnail for the January Category is selected at random. If it is a complex hack, point me in the right direction and I would be very grateful. I realise PhocaGallery is a hugely complex plugin (in my opinion) as I have looked through the source but to no avail.

Kind Regards,
Zachary.

My Current Setup:

Code: Select all

Parent Category [2011] ----> Sub Category [January] ----> Image 01
                      ¬                             ----> Image 02
                      ¬                             ----> Image 03
                      ¬                             ----> Image 04
                      ¬
                      -----> Sub Category [February]----> Image 01
                      ¬                             ----> Image 02
                      ¬                             ----> Image 03
                      ¬                             ----> Image 04
                      ¬
etc.
Last edited by Zachary on 21 Mar 2011, 03:42, edited 1 time in total.
Zachary
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 20 Mar 2011, 21:45

Re: Random Category Thumbnail (Order Ascending when viewing

Post by Zachary »

Fixed it.

Navigate to /components/com_phocagallery/views/categories/view.html.php

Find: (Line ~200)

Code: Select all

if ($tmpl['categoriesimageordering'] != 10) {
Change to:

Code: Select all

if ($tmpl['categoriesimageordering'] != 10) {
$categoriesImageOrdering = "";


Navigate to /components/com_phocagallery/views/category/view.html.php

Find: (Line ~650)

Code: Select all

// Image next to Category in Categories View in Category View is ordered by Random as default
phocagalleryimport('phocagallery.ordering.ordering');
$categoryImageOrdering = PhocaGalleryOrdering::getOrderingString($tmpl['categoryimageordering']);
$categoryImageOrderingCV = PhocaGalleryOrdering::getOrderingString($tmpl['categoryimageorderingcv']);
Change to:

Code: Select all

// Image next to Category in Categories View in Category View is ordered by Random as default
phocagalleryimport('phocagallery.ordering.ordering');
$categoryImageOrdering = "";
$categoryImageOrderingCV = "";
Thanks anyway :)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Random Category Thumbnail (Order Ascending when viewing

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply