MyBB Community Forums

Full Version: Search XThread field plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm new here and new to plugin devel too.
I've tried to search the docs and the forum but could not find any hint, so I'm asking directly.

I'm the admin of a forum where I've added a custom field using XThread (it's just a field that allows us moderators to tag each thread with "tags" and then hopefully build a "tag cloud" and search on them.

The objective: find a way to search the forum for messages tagged with a given tag. This function should be reachable by the users using the default search form (search.php) and also through a direct HTTP request to the appropriate URL (search.php?parametersHere)

I was thinking about extending search.php with a plugin, I've found there are many hooks in there I could use, but I cannot understand what is their purpose.
Is there a way to alter the fields shown to the user? Is there a way to alter the SQL being executed to find the results?

Hope someone can help me, thanks in advance!

PS: sorry, English is not my mother tongue...
AFAIK this is not possible because xThreads doesn't offer support for it (no sure how to explain it neither found the link where ZingaBurga told everyone it was not possible). Only way is coding a HTML search box that builds up the link for us (common method to filter threads based on xThreads thread fields).
Thank you, Omar.

Problem with XThread is docs are not very clear (to me at least) and I really can't understand if there's a way to have it display a page with every thread from every forum where the field contains a given value.

Another way (very ugly and unflexible, I Know) would be to extend the search capability of MyBB. I could write the SQL myself, but I can't the correct place to put it; altering search.php and inc/functions_search.php looks like a possible way, but I'll have to check my mods after every update, and that's awful.

Any suggestion? Thanks again!
I have no idea to be honest. Hope you find your answer.
(2012-12-06, 08:32 PM)Omar G. Wrote: [ -> ]I have no idea to be honest. Hope you find your answer.
Thank you anyway Omar, you've been very kind!
I'll post a solution if and when I find one, even if it's horrible...
I think the reason ZB has been very unforthcoming on this aspect of XThreads is due to server load. In the XThreads docs he does warn that filtering on fields with multiple values can increase server load a fair bit, and that is in a forum. I think a tag cloud set up where you are filtering all threads in all possible forums would maybe make the database fall over.

Why not use the simple mytags plugin from the mods site and using conditionals make it staff only to apply a key word? Or at least see how that works?