Announcement

Collapse
No announcement yet.

Text Link For Searching One Forum?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Text Link For Searching One Forum?

    All of the news on my website is added to a specific news forum, and I'd like to allow my visitors to search that forum for pre-defined criteria via a text link. For example, I'd like to put something up like "Click here to find all previous news articles about the Toyota Forerunner." By clicking on the link, the visitor would automatically be brought to a list of search results for "Toyota Forerunner" in that specific forum only.

    Hopefully this is possible. If I just do a search from within vBulletin, it sets up a unique ID for the search, which I obviously can't use for the text link. Any help would be much appreciated. Thanks!

  • #2
    You can append the search.php function with an include statement which will then only return threads from that category.

    Code:
    <td class="vbmenu_option">
    <a href="http://www.yourdomain.com/your-forum/search.php?$session[sessionurl]do=getnew&include=x,y">
    $vbphrase[new_posts_in_news]</a>
    </td>
    Change the x,y to be the forumID's you want new threads returned from and add a new phrase too if you want to. In the example code above I show a new phrase as new_posts_in_news. You can substitue the $vbphrase for your text as above if you don't want to use a phrase.
    Last edited by TheMusicMan; Sat 27th May '06, 7:27am.
    John

    Comment


    • #3
      Hmm, I'm not sure I understand. This link would be on a non-vB webpage, so I don't think your code would work. And it sounds like you're searching for just new posts. I'd like to have the link bring up ALL search results, regardless of how old they are.

      Comment


      • #4
        Use a link like this:
        Code:
        http://www.yoursite.com/forum/search.php?do=process&query=Toyota%20Forerunner&forumchoice
        Code:
        []=X
        with X being the forumid number.
        See this thread for more options: http://www.vbulletin.com/forum/showthread.php?t=107955
        Last edited by Colin F; Sat 27th May '06, 8:16am.
        Best Regards
        Colin Frei

        Please don't contact me per PM.

        Comment


        • #5
          Excellent, that's exactly what I needed. On a side note, is there any way to search for an exact match of two words with a space? For example, "Toyota Forerunner" instead of just "Toyota" and "Forerunner". I tried using a %20 in the URL and adding exactname=1, but it still seems to search for both words separately.

          Comment


          • #6
            Try surrounding the query string with quotes, like "Toyota%20Forerunner"
            Best Regards
            Colin Frei

            Please don't contact me per PM.

            Comment


            • #7
              One more question. How would I go about searching for a term that has an amperstand (&) within it or a ruman numeral after it (II, IV, etc.). There are titles I need to search for specifically, such as "Dungeons & Dragons" or "King Louis V", but trying either of these provides no results even though it should. Do I need to configure my search settings to index words that are 1 character in length to make this work?

              Comment


              • #8
                Possibly the length is causing this, yes.
                Try setting your minimum word length to 1 and then rebuild your search index.
                Best Regards
                Colin Frei

                Please don't contact me per PM.

                Comment

                Loading...
                Working...
                X