We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Yeah, that’s definitely not the same bug I ever addressed. I had to change an ini_set that was attempting to change sessions settings even though a MODx user session was already started. This is something else and just looks like SMF isn’t installed and setup yet. Have you got SMF up and running by itself?
      • 37272
      • 216 Posts
      Hi,

      Yes, I’ve had an SMF forum for months. I also have some pages I’m writing, with SMF php includes. There are no problems with this, except when I try the includes with Modx managed pages.
        • 22303 MODX Staff
        • 10,725 Posts
        Quote from: Colin at Apr 22, 2006, 12:15 PM

        Hi,

        Yes, I’ve had an SMF forum for months. I also have some pages I’m writing, with SMF php includes. There are no problems with this, except when I try the includes with Modx managed pages.
        It must require some global variables to run -- if so, you’ll need to figure out which SMF variables those are and at the beginning of your snippet, declare each one as:

        global $varname;


        and you can do it in a list like:

        global $varname1, $varname2, $varname3;


        The important part is figuring out what global variables SMF depends on being available. Global variable dependencies such as these make integration of these systems with any other system, a little painful, but you should be able to work through it by referencing the code near the lines of where the errors are being reported.
          • 37272
          • 216 Posts
          Quote from: Colin at Apr 22, 2006, 09:06 AM

          The require part creates the following error:

          Parse error: syntax error, unexpected ’<’ in /home/xxxxxx/public_html/manager/includes/document.parser.class.inc.php(696) : eval()’d code on line 1

          OK, I will try to work this out. I cannot code at all though, so we will see. Can you tell me about the above error with the php require. - What’s going on there?

          Thanks.
            • 37272
            • 216 Posts
            Hi,

            I have try things out, but I may have boobed. I’ve just remembered that "hooks" were a feature added to SMF 1.1, and I’m still running 1.0.7. - Might this be cause of the new bug?

            I wasn’t bothering with an upgrade to the RC, as I’ve had others changes to concentrate upon. I’ll sort out some tests over the next day or so.

            Thanks.
              • 25663 MODX Staff
              • 12,272 Posts
              That definitely won’t work with the pre-1.1rc series.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 37272
                • 216 Posts
                Back again! grin

                I’ve upgraded to SMF 1.1, and there are changes. if inserting SMF php includes into your webpages, you include the following at the top of your doc.

                <?php require("/home/xxxxxx/public_html/community/SSI.php"); ?>


                because of errors, I shortened this in the snippet to:

                ("/home/xxxxxx/public_html/community/SSI.php");


                I’m uncertain if that is correct, but it’s what the errors seemed to indicate I should have.

                I also have in the body:

                <? php ssi_whosOnline(); ?>


                No joy, no errors, and no output. I tried the following (only because of the errors I received with "require" code), but no change:

                ssi_whosOnline();


                I should also point out, the includes are working with webpages not controlled by Modx.

                I have no file extensions. I am using SEF URLs with aliases, just in case it’s something to do with not having php file extensions.

                Any help would be greatly appreciated.

                Thanks.
                  • 32963
                  • 1,732 Posts
                  Hi Colin,

                  I think this should do the trick. Create a snippet called SSI and add this to its content:

                  ob_start();
                  // set SSI path and file name
                  $ssi = '/home/xxxxxx/public_html/community/SSI.php'; 
                  include_once($ssi);
                  ssi_whosOnline(); // call SSI function here
                  $html = ob_get_contents();
                  ob_end_clean();
                  
                  return $html; // return html content


                  Save the snippet then add this to your document:

                  [[SSI]]

                  You can even make it a little more interesting by making the following change to the SSI snippet:

                  /**
                   * SSI Snippet 
                   * Param: &fnc - function to be called
                   */
                  
                  $fnc = isset($fnc) ? $fnc:'';
                  
                  ob_start();
                  // set SSI path and file name
                  $ssi = '/home/xxxxxx/public_html/community/SSI.php'; 
                  include_once($ssi);
                  
                  // call SSI function here
                  if (function_exists($fnc)) @$fnc();
                  
                  $html = ob_get_contents();
                  ob_end_clean();
                  
                  return $html; // return html content


                  Then add the following to your documents:

                  [[SSI? &fnc=`ssi_whosOnline`]]

                  PS. I have not tested the dynamic function calling snippet but I think it should work.
                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.
                    • 37272
                    • 216 Posts
                    Thanks for that Raymond.

                    I’ve gotten bogged down with something else. I will hopefully try this out tomorrow.

                    Thanks again. smiley
                      • 32963
                      • 1,732 Posts
                      Cool,

                      after testing I guess you can package it and release it as a snippet. Maybe something like "SMF SSI Snippet"
                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.