Module to show categories ordered by date of creation

Phoca Gallery modules - modules for Phoca Gallery extension
arsouille
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 12 Jan 2015, 12:02

Module to show categories ordered by date of creation

Post by arsouille »

Hi all,
i'd like to configure PhocaGallery Image Module to show five first categories, one image per categories, ordered by date of creation desc.
For example, i have :
- cat1 created 1/12/14
- cat2 created 2/12/14
- cat3 created 3/12/14
- cat4 created 10/12/14
- cat5 created 11/12/14
- cat6 created 12/12/14
- cat7 created 5/12/14
- cat8 created 6/12/14

the module while display
img1/cat6 -- img1/cat5 -- img1/cat4 -- img1/cat8 -- img1/cat7

Do i have to rewrite default.php and the request ? or is it possible via parameters ?
arsouille
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 12 Jan 2015, 12:02

Re: Module to show categories ordered by date of creation

Post by arsouille »

I found a good but not the best request i think

Code: Select all

	$query = 'SELECT a.catid AS idcat, a.id AS idimage' 
			.'  FROM #__phocagallery AS a' 
			.'  WHERE a.catid IN (' 
      			.'	SELECT * FROM ('
          		.'		SELECT cat.id'
          		.'		FROM #__phocagallery_categories AS cat'
          		.'		WHERE cat.published = 1'
          		.'		ORDER BY cat.date DESC'
          		.'		LIMIT ' . $limit_start . ',' . $limit_count.')'
      			.'		AS temp)'
  			.'  AND a.published = 1' 
			.'  AND a.approved = 1'
			.'  GROUP BY a.catid';
Now let's go to CSS ...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Module to show categories ordered by date of creation

Post by Jan »

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