1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hacking searches / Permanent search links

Discussion in 'Tarantula Questions & Discussions' started by cacoseraph, May 18, 2009.

  1. cacoseraph

    cacoseraph ArachnoGod Old Timer

    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:

    if i wanted to search for all posts with "crickets" made by that rascal cacoseraph i need to make a link like this
    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:
    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

    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):"
    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:"
    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"
    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"
    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"
    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"
    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"
    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"
    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"
    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"
    This element lets you display search results as threads or posts. "showposts=0" displays threads and is the default.

    "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 & 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"
    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.
    Last edited: May 19, 2009
  2. That's a good idea. Feel free to add it to my sticky, if you like.

  3. cacoseraph

    cacoseraph ArachnoGod Old Timer

    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
  4. 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. ;)
  5. cacoseraph

    cacoseraph ArachnoGod Old Timer

    done with version 1.0
  6. That is a hell of a guide! Good job! :clap:
  7. 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. :}
  8. cacoseraph

    cacoseraph ArachnoGod Old Timer


    i forgot to do that one

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



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

    "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.
  9. Arachnopets

    Arachnopets Arachnoboards Team Staff Member

    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
  10. GoTerps

    GoTerps Arachnoking Old Timer

    Very cool... thanks for all the info.

  11. cacoseraph

    cacoseraph ArachnoGod Old Timer

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

    nakazanie Arachnosquire

    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.)

  13. cacoseraph

    cacoseraph ArachnoGod Old Timer

    ha, good point Nak

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

    DamoK21 Arachnosquire

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

    Dim rdr As SqlDataReader = Nothing


    '2.open the connection

    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 ...
  15. cacoseraph

    cacoseraph ArachnoGod Old Timer

    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 :D
  16. super-pede

    super-pede Arachnobaron

    this will be proven useful,thanks cacoseraph :worship:
  17. cacoseraph

    cacoseraph ArachnoGod Old Timer

    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
  18. pronty

    pronty Haunting Spider Old Timer

    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.
  19. 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-: