coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: virgvv on April 10, 2007, 07:00:15 AM

Title: Search by album name or custom field?
Post by: virgvv on April 10, 2007, 07:00:15 AM
I was wondering if it is possible to fetch photos by album name (rather than numeric ID) and/or the text in a custom field.  The $format tags seem to have what I need, but if I understand the user manual correctly, they're used in the options array, not the source parameters.

Is there a way to do what I want without hacking the code?

Thanks!
Title: Re: Search by album name or custom field?
Post by: vuud on April 10, 2007, 03:59:19 PM
Quote from: virgvv on April 10, 2007, 07:00:15 AM
I was wondering if it is possible to fetch photos by album name (rather than numeric ID) and/or the text in a custom field.  The $format tags seem to have what I need, but if I understand the user manual correctly, they're used in the options array, not the source parameters.

Is there a way to do what I want without hacking the code?

Thanks!

Not directly.  Instead of hacking the code, I would recommend adding code to handle it on your page.  You can use CpmFetch to get a list of albums, search that, then call the normal code with the number.   At least for the album.  There is no search in a custom field as of yet.  You can now search the title and caption text though.

If you do opt to hack a search the custom fields, do it in the makesourcesql function and post a patch...  maybe I will just merge it in (thats for the latter).