Announcement

Collapse
No announcement yet.

Today's posts

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

  • Today's posts

    What would be the search json code that I would use to make a search for "Today's posts" forum wide.

    TIA

  • #2
    Here's what I use....you would need to minify this obviously:

    Code:
    {
    "last":
    {
    "from": "lastDay"
    },
    "view": "topic",
    "starter_only": +1,
    "sort": {
    "lastcontent": "desc"
    },
    "exclude_type": ["vBForum_PrivateMessage", "vBForum_VisitorMessage", "vBForum_Report", "vBForum_Redirect"]
    }
    MARK.B | vBULLETIN SUPPORT

    TalkNewsUK - My vBulletin 5.6.2 Demo
    AdminAmmo - My Cloud Demo

    Comment


    • #3
      So I put your entire code into a search module. It comes up invalid Json string?

      Comment


      • #4
        search?searchJSON=%7B%22last%22%3A%7B%22from%22%3A%22lastDay%22%7D%2C%22view%22%3A%22topic %22%2C%22starter_only%22%3A+1%2C%22sort%22%3A%7B%22lastcontent%22%3A%22desc%22%7D%2C%22exc lude_type%22%3A%5B%22vBForum_PrivateMessage%22%5D%7D

        Cut and paste that it's what we use and I think its the same as Marks. I assume its for your Navbar? That's where it has to go to work.

        Comment


        • #5
          Thanks for the response. Doesn’t something need to get posted in the search module directly for the Json string?

          Comment


          • #6
            You need to turn edit site on then click navigation bar, create a item or edit a existing one then cut and paste that code into the Target URL:

            Comment


            • Carrfixr
              Carrfixr commented
              Editing a comment
              Thank you for your time. It's working now

          • #7
            So maybe someone can help me understand something. What is the difference of adding a new page with a search module and then posting that url in the nav bar,,, VS

            search?searchJSON=%7B%22last%22%3A%7B%22from%22%3A%22lastDay%22%7D%2C%22view%22%3A%22topic %22%2C%22starter_only%22%3A+1%2C%22sort%22%3A%7B%22lastcontent%22%3A%22desc%22%7D%2C%22exc lude_type%22%3A%5B%22vBForum_PrivateMessage%22%5D%7D

            the code above in the nav bar and no new page or search module? Is the end result the same?

            Comment


            • #8
              Originally posted by Carrfixr View Post
              So maybe someone can help me understand something. What is the difference of adding a new page with a search module and then posting that url in the nav bar,,, VS

              search?searchJSON=%7B%22last%22%3A%7B%22from%22%3A%22lastDay%22%7D%2C%22view%22%3A%22topic %22%2C%22starter_only%22%3A+1%2C%22sort%22%3A%7B%22lastcontent%22%3A%22desc%22%7D%2C%22exc lude_type%22%3A%5B%22vBForum_PrivateMessage%22%5D%7D

              the code above in the nav bar and no new page or search module? Is the end result the same?
              Should be. It will just show the search results page. Which is the same page used by the Advanced Search Page to show results. Modules just take the Search JSON and show it within the module framework, the underlying searching mechanism is exactly the same. A custom page just has a neater URL that can be remembered by humans.

              For Mark's JSON, the text should be one line without line breaks or spaces outside of quotes. That is what he meant by minify.

              Code:
              {"last":{"from":"lastDay"},"view":"topic","starter_only":1,"sort": {"lastcontent": "desc"},"exclude_type": ["vBForum_PrivateMessage", "vBForum_VisitorMessage", "vBForum_Report", "vBForum_Redirect"]}
              This is exactly the same as the search string above. However in the search string, the puncuation is converted to HTML Entities so the browser doesn't break things. %22 is " and %3A is :, etc... JSON isn't really written for human consumption.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API - Full / Mobile
              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment

              Related Topics

              Collapse

              Working...
              X