Page 1 of 1

I need some help modifying this query

Posted: 27 Jun 2011, 16:50
by falconX
Hi first i would like to thank your guys for this awesome extension it helped me a lot on my project

Now i want someone to help me modify this query so it shows only pictures from the same name as the category name of phoca to the joomla category so if the name of the joomla category is potatoes and i have a phoca category by the name of potatoes display pictures from the potatoes gallery is this possible

I was thinking if i tweek this peace of code in the php file of the module it might work but im not really good at this :x im still a newbie

Here is the code:
is around line 517 i hope it helps :|

Code: Select all

if ($image_ordering == 9) {
	$imageOrdering = ' ORDER BY RAND()'; 
} else {
	$imageOrdering = ' ORDER BY a.'.PhocaGalleryOrdering::getOrderingString($image_ordering);
}


$image = '';
$query = 'SELECT cc.id AS idcat, a.id AS idimage'
.' FROM #__phocagallery_categories AS cc'
.' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id'
.' WHERE a.published = 1'
.' AND a.approved = 1'
.' AND cc.published = 1'
.' AND cc.id IN ('.$implodeAllowedCategoriesArray.')' // not images from not accessable categories
.$imageOrdering
.' LIMIT ' . $limit_start . ',' . $limit_count ;

Re: I need some help modifying this query

Posted: 29 Jun 2011, 13:42
by Jan
Hi, sorry, but I am not on my PC now to test :-( so cannot give any clue advice there :-(