ZenphotoCMS Forum
Custom search via PHP string? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Custom search via PHP string? (/thread-2043.html)



Custom search via PHP string? - csx - 2008-01-06

First off, I just want to say that PHP is something I don't understand that well. That being said:

Is there a way to define a custom search within a PHP string?
Example:

What I am trying to do is upon arrival to the index.php page a search result of the albums with the tag "featured" all show up. Make sense? Any help would be appreciated!




Custom search via PHP string? - aitf311 - 2008-01-06

You could do a redirect to index.php?p=search&words=featured




Custom search via PHP string? - csx - 2008-01-07

Hah, good idea. I'll give that a shot. Thanks.




Custom search via PHP string? - csx - 2008-01-07

Ok... maybe i'm not executing this right, but by forwarding the site to index.php?p=search&words=featured, it seems to load to the search.php page with the results, not the index.php which has a custom layout and all? Any ideas?




Custom search via PHP string? - sbillard - 2008-01-07

Searching always involves the search page. You could modify that page to fit your scheme.




Custom search via PHP string? - csx - 2008-01-08

That's what I thought. Unfortunately I need to use the search page as a search page. What I'm trying to do is somehow flag an album as featured, then pull in all featured albums to the index page. Is there any simple way of doing this? Thanks for the help!




Custom search via PHP string? - BertSimons - 2008-01-08

you could put a condition inside the loop in your album.php/index.php
to do such things I use an unused field like 'location' and fill in on the admin page 'featured' as location for the album.
within the loop on the album php I check with getAlbumPlace() and only the albums which have 'featured' get printed
`

//do your regular album things here

`




Custom search via PHP string? - csx - 2008-01-08

I'll give that a shot, thanks Bert.




Custom search via PHP string? - sbillard - 2008-01-09

There seem to be a number of uses for a custom field. I think we will add such a field to the database so you won't have to reuse a standard field (and possibly get undesired side effects.)




Custom search via PHP string? - csx - 2008-01-09

That would be great! Can we expect this change in the near future? Thanks!