We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19677
    • 4 Posts
    Hello all, I am new user to both MODx and SMF. I have searched the board and I have yet to find a true solution for displaying the Recent Topics to say, the Home page of MODx. Can someone correct me of my ignorance?

    MODx is really a fabolous application BTW, look forward to all future developments!
      • 10487 MODX Staff
      • 1,535 Posts
      Hi, first of all, welcome to the MODx community smiley

      To get you started, what you will need to do is create a snippet that includes the SMF SSI.php and then you can utilise the SSI function, ssi_RecentTopics(). The code below illustrates the basic construct of the snippet:
      /**
      * Snippet: Show SMF recent posts
      *
      */
      
      $basePath = $modx->getConfig['base_path'];
      
      //-- CHANGE THIS TO THE FOLDER PATH OF YOUR SMF INSTALL
      $smfPath = 'forums/';
      
      include_once $basePath.$smfPath.'SSI.php';
      
      return ssi_RecentTopics();

      Check out the function definition in SSI.php for the additional options you can set when calling the ssi_RecentTopics function. The above is only the basic output.

      Hope that helps,

      Garry
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 19677
        • 4 Posts
        Gary,
        Thanks for the welcome and the speedy reply. I tried your method, and I seem to get the same error that I did with my original code. Here is the debug output:

        Error: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time.
        File: /community/Sources/Load.php
        Line: 1786 
        Line 1786 source: @ini_set('session.use_trans_sid', false);


        Any thoughts? I’m still learning the flow of everything involved with MODx. The lack of limitation is fabolous!
          • 10487 MODX Staff
          • 1,535 Posts
          Hi,

          Oops! I should’ve known that would happen ... check out the ’Fixing SMF’ section in the tutorial I wrote on setting up the SMF UserComments snippet - the same modifications to SMF apply to any SSI application.

          Hope that helps,

          Garry
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 19677
            • 4 Posts
            Garry,
            Thank you so much for your time. Everything works perfect now! I really appreciate it!