Page 1 of 1

Display only the images which have a description

Posted: 10 Dec 2010, 00:25
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

Re: Display only the images which have a description

Posted: 12 Dec 2010, 00:56
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