PDA

View Full Version : Search multiple content types in one search


Strike3ForumsMH
12-10-2011, 02:02 PM
I'd like to include a link in my navigation so that my member can see the newest posts and blog entries in the past day/24 hours. So combining the Newest Blogs and Newest Posts searches into one.

I can do this with advanced search but didn't know if I could provide a link to do it or if anyone has seen any modifications that allow this type of thing.

Any help would be appreciated.

Thanks!

kh99
12-10-2011, 04:33 PM
I think you should be able to use a url like search.php?do=getdaily&type[]=1&type[]=19

The type array can be one or more of the following:

1 Posts
3 Forums
5 Group Messages
7 Groups
11 Visitor Messages
19 Blog Entries
20 Blog Comments
24 Articles
26 Static Pages

Strike3ForumsMH
12-13-2011, 03:01 AM
Thanks for the help Kevin but I didn't have any luck with it, it seemed to ignore new blog entries for some reason and in the search preferences listing (showing what was searched for), it only listed new posts. I had tried something similar to no avail.

Can anyone try what Kevin posted and see if it works for their forum?

Thanks!

kh99
12-13-2011, 01:10 PM
Sorry, you're right of course, it doesn't work. I was looking at the code where it processes the 'type' parameter, but I missed the fact that it doesn't work if do="getdaily". But I think this works: search.php?do=process&type[]=1&type[]=19&searchdate=1&beforeafter=after&sortby=dateline&order=descending

Strike3ForumsMH
12-14-2011, 01:02 AM
Maybe my forum is different or its changed on a release, but I think blog entries are type 20. After changing that and using everything you gave me, it works like a charm! Thanks!

search.php?do=process&type[]=1&type[]=20&searchdate=1&beforeafter=after&sortby=dateline&order=descending

kh99
12-14-2011, 01:16 AM
Yeah, I meant to mention that the right thing to do would be to call some functions to look up those numbers using the corresponding strings, but I was hoping they'd end up being the same as mine.

tbworld
07-15-2013, 11:40 PM
Thanks guys. I was trying to help someone else out and this set me straight. I know it was an old thread, but credit should be given. :)