# Hacking searches / Permanent search links



## cacoseraph (May 18, 2009)

HOW TO MANUALLY BUILD A SEARCH LINK v1.0 
i'm sure a lot of ppl have tried to send someone a link to search results and has found that the link stops working after a while.  this is due to the underlying programming and data storage structure of the forum... but it can be worked around

for example, if i want to do a search for crickets i need to make a link like this:

http://www.arachnoboards.com/ab/search.php?do=process&query=crickets

```
http://www.arachnoboards.com/ab/search.php?do=process&query=crickets
```
if i wanted to search for all posts with "crickets" made by that rascal cacoseraph i need to make a link like this
http://www.arachnoboards.com/ab/search.php?do=process&query=crickets&searchuser=cacoseraph

```
http://www.arachnoboards.com/ab/search.php?do=process&query=crickets&searchuser=cacoseraph
```
good gods! 168 hits!


A search is comprised of the base url and one or pieces that we are going to call elements.  Some elements are simple and easy to use manually. Some are more complex. 

All searches are routed though the advanced search page, and so must start with: 
	
	



```
http://www.arachnoboards.com/ab/search.php
```
To tell the php processor that we are going to create a search with some elements we must place a "?" between the base url and the first element.

All elements should be seperated by "&" signs

If the element corresponds to a feature of the search page, that feature is included after the bold element name

ELEMENTS:
*process*
"process=do" 
one element that is somewhat special is the process element.  if you include the element "process=do" in your hand made search (HMS) when the user clicks on the link the search is actually run and they will see the results without having to click on anything else.  if you omit the "process=do" element then when the user clicks on the link they will be taken to the search page, filled out for the search you have created... but will have to click the submit button themselves

*query* - "Key Word(s):"
"query=term1+term2"
this is the real meat of the search!  the query element contains the word(s) you wish to search for.  to search for crickets use the element "query=crickets". to search for multiple terms (in a boolean AND configuration, i think) simply join them with "+" signs.  to search for the words "crickets" and "nutrition" make your element like "query=crickets+nutrition". i currently don't know how to do fancier boolean searches :/


*searchuser* - "User Name:"
"searchuser=someguy"
if you want to limit your search to contributions made by a specific user than this is the element for you.  to search in user "someguy"'s posts, add the element "searchuser=someguy"

*starteronly* - "Find Posts by User/Find Threads Started by User"
"starteronly=[0|1]"
this element is to be used with the searchuser element, but need only be used when you want to invoke the "Find Threads" function, as the "Find Posts" function is the default.  if you want to use the "Find Threads" version include "starteronly=1".  you *can* use "starteronly=0" to explicitly invoke the "Find Posts" version, but as stated it is the default and can be safely omitted

*exactname* - "Exact name"
"exactname=[1|0]"
this element allows you to do partial name matching when the "User Name:" function is being used.  "exactname=1" is the default and disallows partial name matching.  if the exactname element is omitted the search is as if "exactname=1" was used.  "exactname=0" allows partial name matching. partial name matching will match all user names that contain the term in the searchuser element.

*replyless* - "Find Threads with"
"replyless=[1|0]"
this element is to be used with another element, replylimit.  if you want to limit your search to threads of a certain size this is the element to use.  if you want to use the "At Least" function include "replyless=0" and if you want to use the "At Most" function include "replyless=1"

*replylimit* - "# replies"
"replylimit=n" where n is a positive integer
this element is to be used with the replyless element.  use this element to set the upper or lower limit on the number of replies to threads that will hit in your search.  if you wanted to see only hits with five or more replies than include "replyless=0&replylimit=5"

*searchdate* - "Find Posts from"
"searchdate=[1|7|14|30|90|180|365]"
This element is to be used with the beforeafter element to restricted your search to certain dates.  Find the amount of time you want your search to encompass and use the value in quotes in the element you are making.  For instance, if you wanted to search for posts in the month time frame your element would look like "searchdate=30". I am not sure what happens if other numbers are used. One special value is "lastvisit" which lets you search for all posts before or after your last visit, depending on the value of the beforeafter element.
		"0" 	Any Date
		"lastvisit"	Your Last Visit

		"1"	Yesterday
		"7"	A Week Ago
		"14"	2 Weeks Ago
		"30"	A Month Ago
		"90"	3 Months Ago
		"180"	6 Months Ago
		"365"	A Year Ago

*beforeafter* - "and Newer/and Older"
"beforeafter=[before|after]"
This element is to be used with the searchdate element.  It is a little confusing as the element "beforeafter=before" will invoke the "And Older" function and "beforeafter=after" invokes the "And Newer"

*sortby* - "Sort Results by"
"sortby=[rank|title|replycount|views|threadstart|lastpost|postusername|forum]"
This element is to be used to the "order" element. "sortby" allows you to sort your results by various means.  Find the sort order you wish to use on the right and contruct your element with the value on the left.  To sort by the number of replies in a thread your element would look like "sortby=replycount".

		"rank"			Relevancy	
		"title"			Title	
		"replycount"	Number of Replies	
		"views"		Number of Views	
		"threadstart"	Thread Start Date	
		"lastpost"		Last Posting Date	
		"postusername"	User Name	
		"forum"		Forum	

*order* - "in Descending Order/in Ascending Order"
"order=[ascending|descending]"
The order element is to be used with the sortby element.  Sort your results in ascending order by using the element "order=ascending".

*showposts* - "Show Results as"
"showposts=[0|1]"
This element lets you display search results as threads or posts.  "showposts=0" displays threads and is the default.

*forumchoice[]*
"showposts=n" where n is one of the interegers below, or "subscribed"
Use this element to limit searches to different forums.  Forum names marked with a * are actualy Categories, and normally allow all the forums beneath them to be searched (see childforums element below).  To search in the Tarantula Question & Discussion forum make your element like "forumchoice[]=2". i haven't been able to figure out how to search multiple different forums yet, though.

	"0"	Search All Open Forums
	"subscribed"	Search Subscribed Forums

	"42"	Arachnoboards Information*
	"53"	Welcome To Arachnoboards
	"28"	Forum Rules
	"43"	Arachnoboards Announcements
	"61"	Troubleshooting

	"64"	Articles*
	"65"	Articles

	"50"	Tarantulas*
	"2"	Tarantula Questions & Discussions
	"49"	Tarantula Announcements
	"51"	Tarantula Pictures

	"1"	Other Arachnopets*
	"3"	Myriapods
	"4"	Scorpions
	"12"	True Spiders &amp; Other Arachnids
	"18"	Insects and Other Invertebrates
	"31"	Not So Spineless Wonders

	"74"	Animal Excursions*
	"68"	Field Trips (Natural Habitats)
	"75"	Zoo Trips (Man Made Habitats)

	"30"	Off Topic*
	"36"	Contests & Quickies

	"5"	Classifieds*
	"24"	For Sale/Trade
	"27"	Invertsonals
	"41"	Arachnofunctions
	"62"	ArachnoCon and ArachnoExpo

	"14"	Reports*
	"40"	Breeding Reports
	"16"	Bite Reports
	"17"	Sting Reports

	"7"	Reviews*
	"8"	Online Dealer Reviews
	"9"	Online Seller/Breeder Reviews
	"45"	Seller/Shop Inquiries/Warnings
	"10"	Petstore Reviews
	"11"	Book and Magazine Reviews

*childforums* - "Also search in child forums"
"childforums=[1|0]"
this element is to be used with the "forumchoice[]" element.  "childforums=1" is the default and allows for any child forums to the forum specificed in the "forumchoice[]" element to be searched as well.


----------



## xhexdx (May 18, 2009)

That's a good idea.  Feel free to add it to my sticky, if you like.

--Joe


----------



## cacoseraph (May 18, 2009)

heh, that is what prompted me to do this, actually. i saw all the search links you had spent time making and was like... aw, that sucks




i could probably make a page that would make the permanent links for you, but i would have to get AB's permission (i think) and i don't want to bother


hmm, actually... i could make a page that just produces a piece of text that happens to work as a search if you copy and paste it into a browser. i would almost certainly not need perms for that


----------



## xhexdx (May 18, 2009)

If the code actually performs the search as opposed to taking you to the search results, that's all I'd need.  I'm pretty sure I posted links to the advanced search though; we don't want to make it too easy for the noobs to just click, click, click without thinking for themselves, anyway.


----------



## cacoseraph (May 19, 2009)

done with version 1.0


----------



## xhexdx (May 19, 2009)

That is a hell of a guide!  Good job! :clap:


----------



## xhexdx (Jun 18, 2009)

Alright Caco, I have been playing with this for a while and still can't figure something out.

Can you show me the code for searching 'crickets' as a titles-only search in Tarantula Questions & Discussions?

Thanks. :}


----------



## cacoseraph (Jun 18, 2009)

BLAST!

i forgot to do that one


titleonly - "Search Entire Post/Seach Titles Only"
"titleonly=[0|1]"
0 = Search Entire Posts, and is the default
1 = Search Titles Only




http://www.arachnoboards.com/ab/search.php?do=process&query=Crickets&titleonly=1&forumchoice[]=2


```
http://www.arachnoboards.com/ab/search.php?process=do&query=Crickets&titleonly=1&forumchoice[]=2
```







arg, and i just noticed an error in one of the elements. it is corrected below:

*forumchoice[]*
"forumchoice[]=n" where n is one of the interegers below, or "subscribed"
Use this element to limit searches to different forums.  Forum names marked with a * are actualy Categories, and normally allow all the forums beneath them to be searched (see childforums element below).  To search in the Tarantula Question & Discussion forum make your element like "forumchoice[]=2". i haven't been able to figure out how to search multiple different forums yet, though.


----------



## Arachnopets (Jun 18, 2009)

*To the Top*

Many thanks for your time, dedication and hard work on this, Andrew! :clap:  

We can't tell you how much we appreciate the extra help. :worship: 

We feel it's definitely sticky worthy. lol. 


Scott & Debby


----------



## xhexdx (Jun 18, 2009)

Thanks, Caco.


----------



## GoTerps (Jun 19, 2009)

Very cool... thanks for all the info.

Eric


----------



## cacoseraph (Jun 19, 2009)

sure. i like taking things apart to see how they work


----------



## nakazanie (Aug 15, 2009)

Using google.com to search this forum is FAR more productive.  Just put site:arachnoboards.com after your search keywords.  I can't belive the search nazis haven't said this.  (Or maybe they have, but I haven't seen it.) 


Nak


----------



## cacoseraph (Aug 17, 2009)

ha, good point Nak

and it would have the advantage of not having to essentially learn a little bit of code


----------



## DamoK21 (Apr 15, 2010)

here's code ...
'1.Instantiate the connection
    conn = New SqlConnection("Data Source=.\SQLEXPRESSInitial _                     Catalog=Northwind;Intergrated Security=SSPI")

Dim rdr As SqlDataReader = Nothing

Try

'2.open the connection
conn.open()

thats code

anything along the lines you have put, Is part code if that...

The code in the web browser i can show you if you want, but this is just a simple "string" with a few integers, somtimes the odd boolean thrown in, BUT mainly a string argument... So in a round about way ... This is the simple's of all simple argument's as this sort off string, Is seen in day to day lives...

"String" = get it and so on

"Integer" = Numbers

"Boolean" = True/False argument's

any whooo the code i put above is a very small part of a "Data Access" program

but regardless... Great job ...


----------



## cacoseraph (Apr 19, 2010)

well, techincally i am teaching them how to hand forge php post or get queries... which are in php which is a computer language, thus they would be making code



but i sure as heck don't understand why that necessitated an off kilter comp. sci. 101 =P


for the record, i coded competitively in college and have probably worked in ~15 languages professionally at some point.  i'm not sure why i am saying that, but this thread really isn't all that important given the good suggestion of just googling and the pneumatic jack you deployed between the rails 

it honestly was not really my intention that anyone actually make these queries, btw. i just thought it would be funny to post and spent an hour or so on a joke.  the fact that it got sticked was just awesome, btw.   i would certainly help anyone to make a permanent search link for their signature or a joke or whatever they wanted that they posted to this thread, too... but i never really thought more than one or three ppl would ever actually hand code a query.

anyhow, i just want to thank you for making this thread far better than i ever could have my self


----------



## super-pede (Apr 19, 2010)

this will be proven useful,thanks cacoseraph :worship:


----------



## cacoseraph (Apr 19, 2010)

super-pede said:


> this will be proven useful,thanks cacoseraph :worship:


right on, no problem


the idea is sound, but the actual implementation is not pretty.  i could pretty easily wrap it in some kind of webpage interface, i guess.  if enough ppl expressed interest i could whip up something or other for mine olde webpage


----------



## pronty (Jul 22, 2011)

How about an "Insert Search Link" button in the message posting page?
Kind of like the Youtube button.
You would just type the search word/s, select it, and press the Insert Search Link button and it would create the necessary link around the search word/s.


----------



## ZergFront (Aug 20, 2011)

Nice! Looks like you put a lot of work into this post. I'd be blistering mountains if I typed this much and lost it all before posting. D-:


----------



## xhexdx (Aug 26, 2011)

Just an FYI...

Seems with the upgrade, some of this stuff doesn't work properly.  In particular, searching specific forums.  Seems when I try to search in one forum, it gives me results for everything.


----------



## Zoltan (Feb 29, 2012)

The link is the same if you want to search in a specific forum, with one exception, you need to add *contenttype=vBForum_Post* to it to work. Also, it appears that searching forum groups like "Tarantulas" = "Tarantula Questions & Discussions" + "Tarantula Chat" + "Tarantula Pictures" doesn't work, but you can search in multiple forums by adding each forum with *forumchoice[]=X*. For example, this is a search for "_Ceratogyrus_" in Tarantula Questions & Discussions and Tarantula Chat, showing results as threads:


```
http://www.arachnoboards.com/ab/search.php?do=process&query=Ceratogyrus&forumchoice[]=2&forumchoice[]=49&contenttype=vBForum_Post
```
http://www.arachnoboards.com/ab/sea...]=2&forumchoice[]=49&contenttype=vBForum_Post

The same, showing results as posts ("http://www.arachnoboards.com/ab/" omitted in code):


```
search.php?do=process&query=Ceratogyrus&forumchoice[]=2&forumchoice[]=49&contenttype=vBForum_Post&showposts=1
```
http://www.arachnoboards.com/ab/sea...ice[]=49&contenttype=vBForum_Post&showposts=1

Edit: it looks like it can also work if you just want to input the Tarantulas group as the place to search in, in this case you must include *childforums=1* which enables the search to include child forums.


```
search.php?do=process&query=Ceratogyrus&forumchoice[]=50&childforums=1&contenttype=vBForum_Post
```
http://www.arachnoboards.com/ab/sea...e[]=50&childforums=1&contenttype=vBForum_Post


----------



## Ungoliant (Aug 3, 2017)

cacoseraph said:


> for example, if i want to do a search for crickets i need to make a link like this:
> 
> http://www.arachnoboards.com/ab/search.php?do=process&query=crickets


Does this method still work? (The examples in the original post lead to error pages, as do the examples in the above staff reply, and when I tried to use this method a few weeks ago, it didn't work either.)

If this method no longer works, is there any possibility of getting the thread unpinned? This is cluttered with enough stickies (even on a desktop monitor, I have to hit page down twice to get to new threads) without including outdated technical support information.


----------



## MrDeranged (Aug 4, 2017)

Unsticking now.  Didn't realized this was still up.  We're using totally different software now.

Reactions: Like 1


----------



## Ungoliant (Aug 4, 2017)

MrDeranged said:


> Unsticking now.  Didn't realized this was still up.  We're using totally different software now.


Thanks! At some point, the pinned threads could use a review for which ones are outdated (or full of broken links), need to be consolidated, etc.

@EulersK posted some suggestions.

Movement to Remove Stickies: Tarantula Chat

Removing Excessive Stickies in Discussions: Tarantula Questions & Discussions


----------

