Member
Member
csx   2008-01-06, 22:24
#1

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!

Member
Member
aitf311   2008-01-06, 22:50
#2

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

Member
Member
csx   2008-01-07, 00:13
#3

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

Member
Member
csx   2008-01-07, 04:50
#4

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?

Member
Member
sbillard   2008-01-07, 18:13
#5

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

Member
Member
csx   2008-01-08, 05:38
#6

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!

Member
Member
BertSimons   2008-01-08, 09:52
#7

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

`

Member
Member
csx   2008-01-08, 23:48
#8

I'll give that a shot, thanks Bert.

Member
Member
sbillard   2008-01-09, 01:45
#9

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.)

Member
Member
csx   2008-01-09, 01:49
#10

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

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.