We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    Very interesting. I’ll have to look into this script...
      My Snippets
      -> PopUpChunk v1.0
      • 25046
      • 194 Posts
      This snippet looks like it is EXACTLY what I need! However, I have difficulty getting it to work.
      When I do the snippet call I get the following error message:

      « MODx Parse Error » MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error » PHP error debug
      Error: Unknown(/home/myweb/www/myweb2.com/assetssnippets/flexiblesiteindex/FlexibleSiteIndex.class.php): failed to open stream: No such file or directory

      I’m not a programmer but it seems there is a problem in the file directory structure above where there is a missing slash between assets and snippets. But how does one correct that?

      Thanks!
        • 22797
        • 134 Posts
        Quote from: ricksterv4n1x8 at Jan 28, 2009, 10:17 AM

        When I do the snippet call I get the following error message:

        « MODx Parse Error » MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error » PHP error debug
          Error:  Unknown(/home/myweb/www/myweb2.com/assetssnippets/flexiblesiteindex/FlexibleSiteIndex.class.php): failed to open stream: No such file or directory   

        I’m not a programmer but it seems there is a problem in the file directory structure above where there is a missing slash between assets and snippets. But how does one correct that?

        Most likely, the solution is to simply put a slash in the associated parameter in the snippet. In your case, it’s probably the base_dir parameter. Here’s a part of the documentation (http://wiki.modxcms.com/index.php/FlexibleSiteIndex):

        base_dir
            * Options: [string]
            * Default Value: $modx->config[’rb_base_dir’]
            * Explanation: The base directory of the assets folder

        snippets_dir
            * Options: [string]
            * Default Value: snippets/
            * Explanation: The snippets folder name: slash at end is REQUIRED; No slash at beginning

        fsi_dir
            * Options: [string]
            * Default Value: flexiblesiteindex/
            * Explanation: The flexiblesiteindex folder name: slash at end is REQUIRED; No slash at beginning

          • 22797
          • 134 Posts
          Quote from: paulb at Jan 28, 2009, 10:34 AM
          In your case, it’s probably the base_dir parameter.
          base_dir
          * Default Value: $modx->config[’rb_base_dir’]

          If the value in the snippet currently looks like the default value above, you can add the slash like this:

          $modx->config['rb_base_dir'] . '/'

          That’s a period, single quote, slash, single quote. In the context of the snippet, it will look like this:
          'base_dir'=> isset ($base_dir) ? $base_dir : $modx->config['rb_base_dir'] . '/', // the base directory of the MODx assets
            • 25046
            • 194 Posts
            Thanks Paul for the quick reply.

            I changed that line and now there is no error message. Progress! However, all I get now is a completely empty page (the page where the output of the snippet should be). For example:

            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
            <HTML><HEAD>
            <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
            <BODY></BODY></HTML>


            If I remove the snippet call from the page, the page displays properly using my template.

            My snippet call is [[FlexibleSiteIndex]], I am using Modx 0.9.6.3 and I am using Version: 2.0 of the snippet (with the modified line discussed above). I have tried the snippet call using a chunk instead of regular documents but still no luck. I have also tried this with weblinks.

            Any suggestions on what I am doing wrong would be appreciated.

            Thanks!
              • 22797
              • 134 Posts
              I’m not sure what the problem would be. I’d first recommend going through the documentation to ensure you set up the template variables correctly, and that the names of the template variables exactly match the parameters in the snippet. That’s the most likely culprit. Similarly, double check the parameters for things like the database table prefix, and anything else that may be affected by customized names or paths that you may have implemented. Another idea would be to type the full path to the locations, rather than using the modx setting as a part of the path. Something along these lines:
              'base_dir'=> isset ($base_dir) ? $base_dir : '/home/myweb/www/myweb2.com/assets/',

              if that represents the actual path.

              Also, the snippet is written and tested in a PHP 5.0+ environment. I can’t guarantee it will work in environments that use PHP 4.x. That’s another potential source of the problem.
                • 25046
                • 194 Posts
                Thanks Paul,

                I rechecked everything and all looks in order to me. I also tried typing in the full path but with no luck.

                I can thus only assume it relates to the PHP version. We are using 4.4.4.

                However, I’d be interested if others are successful making it work with 4.x and, if so, I will keep on experimenting.

                Rick
                  • 22797
                  • 134 Posts
                  Quote from: ricksterv4n1x8 at Jan 28, 2009, 12:05 PM
                  I can thus only assume it relates to the PHP version. We are using 4.4.4.
                  Some parts of the code definitely use some object-oriented constructs that were not available until the 5.0 releases. The code could be modified for 4.x releases, but I’m afraid I don’t have the time or inclination to do that. If there’s any chance you could upgrade to 5.0+ you’ll be better off all the way around, not just for this snippet, but for other things too. You could ask your internet service provider what the options are as far as that goes.
                    • 25046
                    • 194 Posts
                    No problem. Your program is very appealing so I will check into it with my ISP.

                    Thanks for all your help.
                      • 25046
                      • 194 Posts
                      I have now upgraded to PHP Version 5.2.9 but, sadly, the snippet still does not work for me. I have got the same problems I was experiencing before.