Page 1 of 1

Random Category Thumbnail (Order Ascending when viewing cat)

Posted: 20 Mar 2011, 21:57
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.

Re: Random Category Thumbnail (Order Ascending when viewing

Posted: 21 Mar 2011, 02:38
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 :)

Re: Random Category Thumbnail (Order Ascending when viewing

Posted: 25 Mar 2011, 15:17
by Jan
Ok