coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Skipper on September 26, 2004, 10:02:22 PM

Title: Custom Fields searchable
Post by: Skipper on September 26, 2004, 10:02:22 PM
How do you make the custom fields so that they are searched when using the search facility?

Thanks.
Title: Re: Custom Fields searchable
Post by: stock on September 28, 2005, 08:16:44 PM
I'd like to know this too. I'm continuing to look on the forum but better not double post in the meantime or will get a telling off!

Stock

If I find anything I'll post it here
Title: Re: Custom Fields searchable
Post by: Azrayen on September 29, 2005, 12:48:23 AM
Custom fields are nammed user1 to user4 in the database.

You have to edit this line
$result = db_query("SELECT category, title, aid, keyword,description FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='" . (- $cat) . "'");

in thumbnails.php to add the fields you want to search (user1 to user4). For example to search in original fields + custom field 1, use this code :
$result = db_query("SELECT category, title, aid, keyword,description, user1 FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='" . (- $cat) . "'");


NOTICE : This code works for the search function, but I'm not sure it had not a bad influence on other functions of Coppermine. Use with caution !

Azy