
Jan
benoix wrote:Hello,
I use phoca gallery Plugin in my article to show link into my gallery.
I can choose which categories I hide but I would like to do opposite. That means I would like choose which categories I want to SHOW. Because, in example, when I show a link into one categories (I hide all the others) in an article that is ok but after if I add a new categories it will be show in my article ! It will not hide.
Wich file I have to modify to do this ?
Thank
Ben
Code: Select all
else if($values[0]=='showcategories') {$show_categories = $values[1];}
Code: Select all
//--------------------------
// DISPLAYING OF CATEGORIES (link doesn't work if there is no menu link)
//--------------------------
$hideCat = trim( $hide_categories );
$hideCatArray = explode( ',', $hide_categories );
$hideCatSql = '';
if (is_array($hideCatArray)) {
foreach ($hideCatArray as $value) {
$hideCatSql .= ' AND cc.id != '. (int) trim($value) .' ';
}
}
$showCat = trim( $show_categories );
$showCatSql .= ' AND cc.id IN ('. $showCat .') ';
Code: Select all
if ($view == 'categories') {
//CATEGORIES
$queryc = 'SELECT cc.*, a.catid, COUNT(a.id) AS numlinks,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as slug'
. ' FROM #__phocagallery_categories AS cc'
. ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id'
. ' WHERE a.published = 1'
. ' AND cc.published = 1'
. ' AND cc.approved = 1'
. ' AND a.approved = 1'
. $hideCatSql
. $showCatSql
. $uniqueCatSql
. ' GROUP BY cc.id'
. ' ORDER BY cc.ordering';