Announcement

Collapse
No announcement yet.

Datastore in widgets

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

  • [CMS] Datastore in widgets

    Can I use the datastore in a widget?
    If so, how one must proceed there.
    A small tutorial would be nice.

    Thanks
    Greetz Bitti

  • #2
    *bump*
    Greetz Bitti

    Comment


    • #3
      I don't know how to answer that question. You can use the datastore by including DIR . '/includes/class_datastore.php' and calling the appropriate functions. The question is what do you want to do with the datastore?
      Please- I'm not tech support. Don't send your problem reports to me unless I've asked you to.

      Comment


      • #4
        If you just want to access the datastore most of the cache's are in the vbulletin object. you could (if you wanted the forums cache) do this:

        PHP Code:

        global $vbulletin//not sure if its avaliable in scope or not?
        print_r($vbulletin->forumcache); 
        Some of my Mods:
        Advanced IP Ban Manager (vb3.6+ version) - Fine grained control over blocking trouble makers.
        Advanced IP Ban Manager (vb4 version) - Fine grained control over blocking trouble makers.
        Use Original thread for Comments - Uses the original thread for comments for any forum threads promoted to CMS articles.
        Custom Friendly Urls - Allows customisation of forum urls from the admin CP.

        Comment


        • #5
          Originally posted by Carnage- View Post
          If you just want to access the datastore most of the cache's are in the vbulletin object. you could (if you wanted the forums cache) do this:

          PHP Code:

          global $vbulletin//not sure if its avaliable in scope or not?
          print_r($vbulletin->forumcache); 
          Thanks that's it
          Greetz Bitti

          Comment


          • #6
            We're trying to get away from global. You can also say vB::$vbulletin->
            Please- I'm not tech support. Don't send your problem reports to me unless I've asked you to.

            Comment


            • #7
              Should I use fetch function to retrive data form CMS widget?
              Code:
              vB::$vbulletin->datastore->fetch()
              I want to fetch "maxonline" value from datastore, and show in front-page.

              Comment


              • #8
                Yes, that would be an appropriate call to get data.
                Please- I'm not tech support. Don't send your problem reports to me unless I've asked you to.

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X