....continuing from previous message.....
fourth
the actual query. Few row below the line at third point there is the section for the query.
You should Find exactly these lines:
Code: Select all
if ($view == 'category') {
$query = 'SELECT cc.id, cc.alias as catalias, a.id, a.catid, a.title, a.alias, a.filename, a.description, a.extm, a.exts, a.extw, a.exth, a.extid, a.extl, a.exto,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug, '
. ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
. ' FROM #__phocagallery_categories AS cc'
. ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id'
. ' WHERE a.catid = '.(int) $catid
. ' AND a.published = 1'
. ' AND a.approved = 1'
. ' AND cc.published = 1'
. ' AND cc.approved = 1'
. $where
. $imageOrdering
. $limit;
}
So you have to add the part related to the Tag parameter. You can just overwrite these lines with the code suggested by sachiel or just add
Code: Select all
elseif ($view == 'tag') {
if ($catid > 0 ) {
$where = $where . ' AND a.catid = '.(int) $catid;
}
$query = 'SELECT cc.id, cc.alias as catalias, a.id, a.catid, a.title, a.alias, a.filename, a.description, a.extm, a.exts, a.extw, a.exth, a.extid, a.extl, a.exto,'
. ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\':\', cc.id, cc.alias) ELSE cc.id END as catslug, '
. ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug'
. ' FROM #__phocagallery_categories AS cc'
. ' LEFT JOIN #__phocagallery AS a ON a.catid = cc.id'
. ' INNER JOIN #__phocagallery_tags_ref as tr ON a.id = tr.imgid'
. ' INNER JOIN #__phocagallery_tags as t ON t.id = tr.tagid'
. ' WHERE t.title LIKE \'' . $tag_name . '\''
. ' AND a.published = 1'
. ' AND a.approved = 1'
. ' AND cc.published = 1'
. ' AND cc.approved = 1'
. ' AND t.published = 1'
. $where
. $imageOrdering
. $limit;
}
leaving all the rest unchanged.
Then I would strongly reccommend, aspecially for beginners, like me, to save the original php file somewhere because, if something goes wrong in editing the file, then the site goes to BLANK.... then baking up the original file you can restore it.
Hoping this could help, i thank very much
sachiel for the feature and
Jan for the reply
cheers
Lucas