stryd_one Posted December 7, 2008 Report Share Posted December 7, 2008 First: Newbies, just use this: http://www.midibox.org/forum/index.php?action=search;advanced;search=Thought this may be useful. Props to AudioCommander for finding this. I'm just filling in some extra info...First, the basic URL:http://www.midibox.org/forum/index.php?action=search2;advanced;search=<blah>Put your search term where it says <blah>, so if you wanted to find all posts where someone mentioned the word "foo", it looks like this:search=fooIf you want part of a word, you can use an asterisk as a wildcard like so:search=foo*If you want to use multiple search terms, you can specify them like this:search=foo+barOr for exact terms, you can use quotes:search="unsigned char foo"If you use multiple terms, you can tell the search how to use them as such:searchtype=1 is "Match all words"searchtype=2 is "Match any word"EG:search=foo+bar;searchtype=2If you want to search for posts by a certain user, use 'userspec' like so:search=foo+bar;userspec=stryd_oneor if you're not sure of the nick exactly:search=foo+bar;userspec=stryd*If you want to see messages of a certain post date, you can use 'minage' and 'maxage', so if you wanted to see stuff from last month, you might do:search=foo+bar;minage=30;maxage=60To see posts between 30 and 60 days of ageYou can push maxage out to '9999' to get everything back to the beginning of the forum.If you want to see the entire posts in your results (not just the summary) do this:search=foo+bar;show_complete=1If you only want to search for your text in the subject, try:search=foo+bar;subject_only=1To control the sorting of your hits, use the 'sort' parameter as such:'sort=relevance|desc' is Most relevant results first'sort=numReplies|desc' is Largest topics first'sort=numReplies|asc' is Smallest topics first'sort=ID_MSG|desc' is Most recent topics first'sort=ID_MSG|asc' is Oldest topics firstFor example to sort by most recent posts do:search=foo+bar;sort=ID_MSG|descAnd to specify which boards to search, use 'brd=' as such:'brd=1,36,33,37' is the 'Top' section of the forum'brd=1' is Latest News'brd=36' is Bulk Orders'brd=33' is Frequent Writer Lounge'brd=37' is Programmers Lounge'brd=14,15' is the 'Archive' section of the forum'brd=14' is Parts Archive'brd=15' is MIDIbox of the Week'brd=29,26,27,28,35,5,2,3,4,6,7' is the 'Construction' section of the forum'brd=29' is MIDIbox HUIs'brd=26' is MIDIbox SID'brd=27' is MIDIbox FM'brd=28' is MIDIbox SEQ'brd=35' is MIDIbox User Projects'brd=5' is MIDIfication'brd=2' is Design Concepts'brd=3' is Parts Questions'brd=4' is Testing/Troubleshooting'brd=6' is Tips & Tricks'brd=7' is MIDIbox Documentation Project'brd=32,31,12,13,38' is the 'Miscellaneous' section of the forum'brd=32' is Sale Requests'brd=31' is Fleamarket'brd=12' is Miscellaneous'brd=13' is Songs & Sounds'brd=38' is Trash Can'brd=16,17,18,19,20,21,22,23,24' is the 'Multilingual' section of the forum'brd=16' is Nordisk'brd=17' is Nederlands'brd=18' is Deutsch'brd=19' is Français'brd=20' is Italiano'brd=21' is Español'brd=22' is Greek'brd=23' is Russian'brd=24' is Others'brd=28,25,10,11' is the 'Software' section of the forum'brd=8' is MIDIbox Tools & MIOS Studio'brd=25' is MIOS programming ©'brd=10' is MIOS programming (Assembler)'brd=11' is MIOS toy of the weekSo, for a big example of all of the options... Let's say you want posts by me, but you can't remember if I'm stryd_one or stryd_1... You want to search for posts where the word 'bitfield' or 'bitfields' or any word starting with 'bit' (in case i made a typo, like 'bitfeild', or said 'bit field') is used, but only in the subject... And posts only in the 'Software' section of the forum... excluding posts in the last 30 days, and only going back one year maximum... sorted to show the most recent posts first, and returning the full post as a result.... (phew) here's your example URL:http://www.midibox.org/forum/index.php?action=search2;advanced;search=bitfield+bitfields+bit*;searchtype=2;userspec=stryd*;minage=30;maxage=365;show_complete=1;subject_only=1;sort=ID_MSG|desc;brd=28,25,10,11Enjoy! Quote Link to comment Share on other sites More sharing options...
Max Romantschuk Posted December 9, 2008 Report Share Posted December 9, 2008 Couldn't all the forum search forms use HTTP GET instead of HTTP POST? This way you only have to do a search, and copy-paste the URL instead of having to know the query string variable names. Shouldn't be a huge change, right? (I can help out if need be. :) ) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted December 9, 2008 Author Report Share Posted December 9, 2008 It would be nice! You'd have to take that up with the SMF guys... Quote Link to comment Share on other sites More sharing options...
Max Romantschuk Posted December 9, 2008 Report Share Posted December 9, 2008 I took a look at the SMF forum sources. The bad news is the form submission method in hard coded in the (rather convoluted) code.The good news is that it seems like there are only a few places where the actual search forms are. I should be able to do the needed modifications pretty quickly.I grepped the source tree for lines containing both method= and search2 (the search result action). These came up: max@tor:~/tmp.smf_forum$ grep -R "method=" * | grep search2 SSI.php: <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '"> Themes/babylon/index.template.php: <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;"> Themes/default/PersonalMessage.template.php: <form action="', $scripturl, '?action=pm;sa=search2" method="post" accept-charset="', $context['character_set'], '" name="pmSearchForm"> Themes/default/index.template.php: <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;"> Themes/default/Search.template.php: <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform"> Themes/default/Search.template.php: <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;"> I'm fairly sure that simply changing method="post" to method="get" should render all search forms to use HTTP GET parameters in the query string. Is there a develoment/staging instance of this forum where this could be tested? Testing on my own machine is sort of tricky as I'd have to set up Apache, PHP, and a suitable database, as well as populate it with data... :) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted December 9, 2008 Author Report Share Posted December 9, 2008 You'd have to take that up with the SMF guys...Wrong forum dude! Quote Link to comment Share on other sites More sharing options...
Max Romantschuk Posted December 10, 2008 Report Share Posted December 10, 2008 Maybe so. I have contacted Simple Machines with this suggestion. But it could be a long time before that change is implemented, if ever. Hopefully soon! :) Quote Link to comment Share on other sites More sharing options...
stryd_one Posted December 10, 2008 Author Report Share Posted December 10, 2008 Nice one! Quote Link to comment Share on other sites More sharing options...
Twin-X Posted December 12, 2008 Report Share Posted December 12, 2008 Search query's needs to be parsed that is why post instead of get is used.We have some hacks running that make use of the parsing as these hacks remember typed words that are being searched like the tagging option for example.But most of all i really like to keep things at default as much as possible. This way i can upgrade whenever i like instead of going to a hideous phase of reapplying each hack again after an update. Also we now use 3 templates so i have to do this x 3 Quote Link to comment Share on other sites More sharing options...
Max Romantschuk Posted December 17, 2008 Report Share Posted December 17, 2008 I got a reply from simplemachines:Search URLs are currently base64encoded to help prevent abuse,particularly Denial of Service attacks, of the search system. There is away to get a URL, however.The link tree/breadcrumbs at the top of the search results page, if youcopy the link from the link that says "search results" it will act as alink to re-perform that search.It does seem to work like that, not perfect, but better than nothing... :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.