Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How to integrate with SMF ?

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1640 Views
  • pjssms
    Avatar
    Community Member
    49 Posts

    How to integrate with SMF ? Link to this post

    I am using one function call in php from smf that is SSI that allows me to show th elast messages from the forum in another page.

    How can this be used with siverstripe ?

  • Matt Hardwick
    Avatar
    Community Member
    61 Posts

    Re: How to integrate with SMF ? Link to this post

    Edit your /mysite/code/Page.php (or if you've made your own page class edit that).

    On the top line after the opening PHP tag include SSI.php
    for example:

    include("/var/www/html/smf/SSI.php");

    Then before the final } add this:

    function Content()
    {
    $content = $this->Content;
    $content = str_replace('[[recentPosts]]', ssi_recentPosts(), $content);
    return $content;
    }

    Then add [[recentPosts]] somewhere on your content, and you should get the function recentPosts returned. Of course you can name it something else and call a different function.

    If you're interested my Page.php looks like this:
    http://pastebin.com/f11794065

    If you get stuck let me know.

    1640 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.