Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.
Current version is 2.1.11, released 12 June.

Auto Refreshing for Recent Discussions Widget

edited December 2011 in Vanilla 2.0 Help

Is there a way to have Recent discussions widget to refresh itself every x seconds?
Right now the changes in the discussions don't reflect on the widget unless the user reloads the whole page.

Best Answer

  • ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    That code is on the server side and you'd need to do the refresh from the client side. That would involve some significant work in the widget.

Answers

  • I think following lines from widgets.php controls the latest discussions.
    Is there a way to add an interval to this?

        // Retrieve the latest discussions from the Vanilla API
        $resturl = vf_combine_paths($resturl, '/');
        $data = json_decode(vf_rest($resturl));
        if (!is_object($data))
            return;
    
  • ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    That code is on the server side and you'd need to do the refresh from the client side. That would involve some significant work in the widget.

Sign In or Register to comment.