show latest topics outside the forum

hi,

how can i show the latest topics posted from a specific category in the forum outside the forum in another php page?

Comments

  • write mysql query and php code to display latest post

    grab data from Discussion,Comment,User tables

  • @VanillaFan said:
    write mysql query and php code to display latest post

    grab data from Discussion,Comment,User tables

    extremely new and unfamiliar with php :(

    btw, i'm using vanilla 2.1

  • BleistivtBleistivt Moderator
    edited August 2014

    Don't do that.

    You can retrieve the data in json Format by appending .json to the controller name in the url

    For example:
    http://vanillaforums.org/categories.json/vanilla-2-1

    Take a look at the vanilla forums wordpress plugin, which does exactly what you want:
    https://wordpress.org/plugins/vanilla-forums/

    If you are not using wordpress, a starting point would be to copy the contents of the function vf_widget_discussions from widgets.php and include the functions.php

    Another (probably easier) option would be to create a view in vanilla that just shows the DiscussionsModule and embed this into your page.

  • If you are not using wordpress, I suggest you add Latest Post List as a plugin and pull the module into your site via AJAX.

    You can request any module on your site through the module controller. Request http://forums.example.com/module/latestpostlistmodule and you will get a preformatted html string.

  • x00x00 MVP
    edited August 2014

    @hgtonight said:
    If you are not using wordpress, I suggest you add Latest Post List as a plugin and pull the module into your site via AJAX.

    You can request any module on your site through the module controller. Request http://forums.example.com/module/latestpostlistmodule and you will get a preformatted html string.

    You are probably going to want to install your plugin first

    http://vanillaforums.org/addon/latestpostlist-plugin

    Haha

  • @x00 thanks for the link. :)

Sign In or Register to comment.