We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Since the origional files seem to have become corrupted, here is another copy of the snippets released in the Snippet Time post over in the MODx Blog. Please remove and php start or end tags in the documents (IE <? or <?php)
      • 22221
      • 283 Posts
      Thanks Mark,

      Just be carefull, there is a "<?" tag at the beginning of SMF_UserComments that we should delete. wink
        • 18397
        • 3,250 Posts
        Quote from: Mark at Apr 06, 2006, 10:29 PM

        Please remove and php start or end tags in the documents (IE <? or <?php)
          • 10487 MODX Staff
          • 1,535 Posts
          Hi all,

          Recently, I’ve been playing about this snippet and realised that perhaps a few installation instructions might be handy for some people.

          So, here you go - feel free to comment on anything, I’m hoping that the advice is useful to people who don’t necessarily know the in’s and out’s of MODx and PHP:

          SMF UserComments setup

          Installation (if you haven’t already installed SMF and the snippet)

          1. Download and extract SMF 1.1RC2 into a folder at the root of your website.
          2. Run the SMF installer and complete all the necessary information. (The installer will try and create a database if one doesn’t exist already)
          3. Download and insert the SMF_UserComments code into a new snippet.

          Fixing SMF

          1. In your SMF install, edit lines 1782 to 1787 of Sources/load.php to be:

          // Attempt to change a few PHP settings.
           if (session_id() == '') {
          	@ini_set('session.use_cookies', true);
          	@ini_set('session.use_only_cookies', false);
          	@ini_set('url_rewriter.tags', '');
          	@ini_set('session.use_trans_sid', false);
          	@ini_set('arg_separator.output', '&');
          }


          2. Log into SMF and check the following setting in the admin (I found this caused a few issues with my setup):


          • Configuration->Server Settings->Feature Configuration Tab->Enable local storage of cookies: Set to off.

          Setting up the template

          1. Create a TV (name of your choice) and assign it to the template that will form the blog/repository pages.
          2. Use the snippet call in the TV to add the commenting to the pages.
          3. To display the forum user name instead of the logged-in user (which in most cases will be ‘anonymous’), look for the [+user+] in the default output for the snippet and change to [+forumuser+].
          4. The path back to the forum login is also hardcoded, so if you have the forum install in a sub-directory or under a different folder name then this will need editing in the snippet code as well.

          Hope that helps,

          Garry
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 22221
            • 283 Posts
            Quote from: garryn at May 16, 2006, 06:46 PM


            Fixing SMF

            1. In your SMF install, edit lines 1782 to 1787 of Sources/load.php to be:

            // Attempt to change a few PHP settings.
             if (session_id() == '') {
            	@ini_set('session.use_cookies', true);
            	@ini_set('session.use_only_cookies', false);
            	@ini_set('url_rewriter.tags', '');
            	@ini_set('session.use_trans_sid', false);
            	@ini_set('arg_separator.output', '&');
            }


            Why this mod is necessary ?

            Quote from: garryn at May 16, 2006, 06:46 PM

            Setting up the template

            1. Create a TV (name of your choice) and assign it to the template that will form the blog/repository pages.
            2. Use the snippet call in the TV to add the commenting to the pages.
            3. To display the forum user name instead of the logged-in user (which in most cases will be ‘anonymous’), look for the [+user+] in the default output for the snippet and change to [+forumuser+].
            4. The path back to the forum login is also hardcoded, so if you have the forum install in a sub-directory or under a different folder name then this will need editing in the snippet code as well.

            I don’t really undestand what is the role of the TV ?

            Thanks trying to help for this module Garry grin
              • 10487 MODX Staff
              • 1,535 Posts
              Hi,
              Why this mod is necessary ?
              SMF will always attempt to create a new session regardless of whether the forum is accessed directly or using SSI - the SSI case will conflict with MODx’s own session handling and that is why the fix is used. It basically checks to see if a session has already been started before attempting to set any values.
              I don’t really undestand what is the role of the TV ?
              The TV is just one of many ways to include the User Comments into a site. The reason I chose to use a TV is because it provides a lot of flexibility in terms of what pages have User Comments included (for example, there may some pages on a site where User Comments are not required - Site Map, Search Results etc.)

              There’s always more than one way to do things so it’s purely down to choice as to what method is used for including the User Comments.

              Hope that helps, Garry
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com
                • 22221
                • 283 Posts
                Thanks for the explanations grin

                And you know what I’ve just experimented the problem with the load.php file on my local site. Wired I didn’t notice it on my on-line site huh
                  • 33393
                  • 30 Posts
                  Does this use the forum to store comments or modx?

                  I kind of like the idea of using the forum for comments and modx for the post.
                    "Adversus solem ne loquitor." -don’t speak against the sun (don’t waste your time arguing the obvious) Something I sometimes need to be reminded of.
                    • 18397
                    • 3,250 Posts
                    Modx
                      • 20761
                      • 27 Posts
                      Is it possible to pull out a forumuser’s website in a tag like [+userwebsite+] or sth like this?