XF 1.2 Passing search criteria via URL's

Marcel

Active member
Hi

When on vBulletin, I composed a handful of custom links to the search URL.
They were pretty much so our members had a quick link to a custom search with particular criteria.

For example "All new photo sharing threads", which showed all unread threads in forum x, y and z.
We also had an "Unanswered sharing threads", which showed all threads from x, y and z with 0 replies.

It helps build our community spirit by having these, as members can quickly identify those threads that are needing responses etc

So is it possible to build a custom URL based on search parameters, like this?
Here are a couple of the links we used to use on vB

{removed}/forums/search.php?do=process&replyless=1&replylimit=0&searchdate=7&beforeafter=after&sortby=lastpost&showposts=0&forumchoice[]=5&childforums=1&exclude=67,69

{removed}/forums/search.php?do=process&replyless=1&replylimit=99999&searchdate=30&beforeafter=after&sortby=lastpost&showposts=0&forumchoice[]=8&childforums=1

{removed}/forums/search.php?do=process&searchdate=30&beforeafter=after&sortby=lastpost&showposts=0&prefixchoice[]=critique&forumchoice[]=5&childforums=1


Thanks.
 
A quick check of the search form suggests these are the field names: keywords, title_only, users, date, reply_count, nodes[], child_nodes, order.

I just posted this on another thread as a similar question came up yesterday, but it also applies here so I'll post the same examples:

For example, a hard coded URL to search for threads started by me would be:http://xenforo.com/community/search/search?users=brogan&user_content=thread

For threads started by me in the Suggestions forum it would be: http://xenforo.com/community/search/search?users=brogan&user_content=thread&nodes[]=18
 
Thanks, you two :)

I found the above while browsing last night in bed (Not sure why I didn't find it before).
We can use that to some extent for a couple of our search links.
How do I expand the nodes[] parameter/array to include more forums, and child forums?

Also, the problem we have is that we don't want to search for a specific string of text, or a specific user. We just want to pull all threads with that criteria.
For the other links, we would need other criteria such as

maximum replies, date ranges etc.

From what I can see looking at the search files I think I'm going to need to do this via a plugin arent I?
 
A quick check of the search form suggests these are the field names: keywords, title_only, users, date, reply_count, nodes[], child_nodes, order.

I just posted this on another thread as a similar question came up yesterday, but it also applies here so I'll post the same examples:

For example, a hard coded URL to search for threads started by me would be:http://xenforo.com/community/search/search?users=brogan&user_content=thread

For threads started by me in the Suggestions forum it would be: http://xenforo.com/community/search/search?users=brogan&user_content=thread&nodes[]=18
How would you properly structure those links in the templates? I'm stuck:

Code:
<a href="{xen:link search/member, '', 'user_id={$visitor.user_id}, '', 'user_content=thread'}">Your Threads</a>
 
@JJJ If you just want to pull the threads with that criteria (with no username or no query), then unfortunately not (I'm pretty sure, anyway).
I ended up doing it the harder way and created my own plugin for it.
 
Great old thread. I'm trying to relegate the search to only resources.
The XF link for resources 2100 is https://jeep-cj.com/community/search/10878/?q=2100&t=resource&o=relevance
How would I hard code this?
Thanks,

src1.webp

This takes me to the generic search page. https://jeep-cj.com/community/search?keywords=2100&t=resource&o=relevance becomes https://jeep-cj.com/community/search?keywords=2100&t=resource&o=relevance when entered.

and this takes me to a forum search. https://jeep-cj.com/community/search/search?keywords=2100&t=resource&o=relevance becomes https://jeep-cj.com/community/search/10888/?q=2100&o=relevance when entered.
 
Last edited:
Any thoughts as to why this does not work or is this expected behavior?
https://jeep-cj.com/community/search/search?keywords=2100&amp;t=resource&amp;o=relevance[
 
Last edited:
Back
Top Bottom