Display only the images which have a description

Phoca Gallery modules - modules for Phoca Gallery extension
vlester
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 12 Nov 2009, 02:52

Display only the images which have a description

Post by vlester »

Hello,

I would like to display image, title and also description in the module. I added the description field in the default.php file without difficulty but now I'm having trouble for the following thing.
All my images don't have a description and, for esthetic reasons,I would like the module to display only the images which have a description (to avoid blank).
So I tried to modify the mod_phocagallery_image.php file by adding "a.description IS NOT NULL" to the request (line 545) but it didn't work.

Code: Select all

	
$query = 'SELECT cc.id, cc.title as nomcat, cc.alias as catalias, a.id, a.catid, a.title, a.alias, a.filename, a.description, a.extm, a.exts,a.extl, a.exto, a.extw, a.exth, a.extid,'
	. ' 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.id in (' . $imageIds . ')'
	. ' AND a.description IS NOT NULL'
	.$imageOrdering;
Any idea why ?

Thanks a lot for your support
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Display only the images which have a description

Post by Jan »

Hi, maybe try to do a condition in php or try to check if it is empty != '' (<> '' or similar, see the mysql syntax)

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