Slideshow - Parent Category

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
morpheus
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 19 Jul 2009, 10:53

Slideshow - Parent Category

Post by morpheus »

Hi,

Is there a way to slideshow on the parent category - i.e. all sub categories within a parent category ?

Given that you can only specify one unique cateory and when I specify a parent one I just get blank content, there seems to be no internal mechanism to know that it has sub categories to use, which is a shame. Is there anyway to get round this ?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Slideshow - Parent Category

Post by Jan »

Hi, only specifed category can be displayed, but you can customize it in the code, so the script will take images from other categories. SQL query needs to be changed :(

Jan
If you find Phoca extensions useful, please support the project
mel_rince
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 21 Jul 2009, 23:22

Re: Slideshow - Parent Category

Post by mel_rince »

i did the modification, want to post it here just in case somebody else need it...
in phocagalleryslideshow.php, starting from line 72:

Code: Select all

			$id = explode(',', $id);
			if (count($id)) {
			
				$c = time() * rand(0,10);							
				$query     = ' SELECT a.filename'
						   . ' FROM #__phocagallery_categories AS cc'
						   . ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id'
						   . ' WHERE cc.published = 1 AND a.published = 1 AND ';
						   $match_id = array();
						   foreach ($id as $target) {
						   		if ((int)$target > 0)
									$match_id[] = 'a.catid = '.(int)$target;
						   }
							$query .= '('.implode(' OR ', $match_id).')';
and for the parameter, just use comma to separate the ids
e.g. {pgslideshow id=1,2,3|...}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Slideshow - Parent Category

Post by Jan »

Ok, thank you for this improvement.

Jan
If you find Phoca extensions useful, please support the project
morpheus
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 19 Jul 2009, 10:53

Re: Slideshow - Parent Category

Post by morpheus »

Thanks for the modification.
Much appreciated.

:-)
webs4travel
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 02 Oct 2011, 16:43

Re: Slideshow - Parent Category

Post by webs4travel »

Hi,

This mod is just what I was looking form, but does not seem to work on most recwent version. Could anyone help me with the same for most recent version of phocagalleryslideshow?

Thanks in advance

Nicola
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Slideshow - Parent Category

Post by Jan »

Hi, Phoca Gallery Slideshíow plugin is a plugin, not a mod (module) an it works with most recent Joomla!

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