vBcode for Simple Search

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ataraxia
    Member
    • Jun 2000
    • 63

    vBcode for Simple Search

    Is there a way to construct a vBcode that will conduct a simple search?

    For example, suppose I want to post a code in message that would do a simple search on, say, "XYZ" such as:

    Code:
    [search]XYZ[/search]
    to create a line that might look like this:

    "The other day I searched the forums on XYZ and found...."

    Here is the BIG question: what is the URL for a simple, ("all forums") search that can contain the search term as a parameter?

    Thanks
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    Originally posted by ataraxia
    Here is the BIG question: what is the URL for a simple, ("all forums") search that can contain the search term as a parameter?
    This URL seems to work:

    http://www.vbulletin.com/forum/search.php?do=process&showposts=0&query=XYZ

    Comment

    • ataraxia
      Member
      • Jun 2000
      • 63

      #3
      Originally posted by Jake Bunce
      Yes, that works... sorta. (Thanks!)

      The problem is that it produces a list of threads containing the search word in simple posting date order.

      Is there some parameter that could be added to the URL so that it would order the list by the number of times the search word appears in each thread (rather than posting date order? The idea here is that the threads with the highest number of occurences of the search word are probably the most relevant.

      Any ideas?

      Thanks

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        http://www.vbulletin.com/forum/search.php?do=process&showposts=0&sortby=rank&order=descending&query=XYZ

        Comment

        • ataraxia
          Member
          • Jun 2000
          • 63

          #5
          Originally posted by Jake Bunce
          http://www.vbulletin.com/forum/search.php?do=process&showposts=0&sortby=rank&order=descending&query=XYZ
          Ah! I see-- it's largely just MySQL query language. Thanks!

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            Actually I got those parameters from the source code of the search form. Apparently vBulletin will take them as POST (via the form) or REQUEST (via the URL).

            Comment

            • Andy
              Senior Member
              • Jan 2002
              • 5886
              • 4.1.x

              #7
              Hi Jake,

              Is there anyway to do a search for a particular member who started the thread in a specified forum?

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                To search for a username, add this to the URL:

                &searchuser=USERNAME&starteronly=1&exactname=1

                Where USERNAME is the username for which you want to search.

                I don't know how to specify specific forums yet. I have been trying to find that out.

                Comment

                • Andy
                  Senior Member
                  • Jan 2002
                  • 5886
                  • 4.1.x

                  #9
                  So I played around with you tip a little. By adding that it just fills out the form in the search.php page. A user still has to submit the search by clicking on the Search Now button. Is there anyway to make the search string a link that bypasses the the search page and the need to click on Search Now and just displays the results?

                  Comment

                  • Jake Bunce
                    Senior Member
                    • Dec 2000
                    • 46598
                    • 3.6.x

                    #10
                    I meant add that text to the end of the URL I posted earlier in this thread:

                    http://www.vbulletin.com/forum/search.php?do=process&showposts=0&query=XYZ

                    This URL goes straight to the search instead of filling out the form.

                    Comment

                    • Andy
                      Senior Member
                      • Jan 2002
                      • 5886
                      • 4.1.x

                      #11
                      Thanks Jake, that works great.

                      Now only if we can select a single forum that would be very useful.

                      Comment

                      • Andy
                        Senior Member
                        • Jan 2002
                        • 5886
                        • 4.1.x

                        #12
                        Got it...

                        &forumchoice=FORUMNUMBER

                        Comment

                        • Andy
                          Senior Member
                          • Jan 2002
                          • 5886
                          • 4.1.x

                          #13
                          Here is the complete link as an example.



                          Code:
                          http://www.vbulletin.com/forum/search.php?do=process&showposts=0&searchuser=Andy&starteronly=1&exactname=1%&forumchoice=56
                          It would be nice if the "Search This Forum" function would display all threads started by the member entered in the box. Anyone know how to modify the showthread template to do this?

                          Comment

                          • ataraxia
                            Member
                            • Jun 2000
                            • 63

                            #14
                            Show results as POSTS rather than threads?

                            Is there a way to construct the search URL so that it will display a listing of the POSTS (not threads) which have the highest number of occurences of the searchwords in descending order?

                            This is somewhat like choosing "Posts" in the "Show Results as ()Threads ()Posts" option in "Advanced Search".

                            Thanks!

                            Comment

                            • Jake Bunce
                              Senior Member
                              • Dec 2000
                              • 46598
                              • 3.6.x

                              #15
                              Originally posted by ataraxia
                              Is there a way to construct the search URL so that it will display a listing of the POSTS (not threads) which have the highest number of occurences of the searchwords in descending order?
                              http://www.yoursite.com/forum/search.php?do=process&showposts=1&sortby=rank&order=descending&query=search_words

                              Also see this thread.

                              Comment

                              Related Topics

                              Collapse

                              Working...