We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36451
    • 264 Posts
    Hi all,

    I use the original MemberCheck Snippet from 0.9.1 and I get this parse error:

    ----8<-----snip------

    Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ’}’ in /Users/Uwe/projekte/www.ibaw.org/manager/includes/document.parser.class.inc.php(691) : eval()’d code on line 65

    ---------snap--8<----

    Snippetcall: [[MemberCheck? &groups=`Mitglieder` &chunk=`MemberNavTitel`]]

    The chunk exists, Webusergroup exists, Webuserlogin works like a charm... But this snippet missed somewhat on line 65 - but what?

    My environment: FF 1.5, MacOS X (Tiger), XAMPP Mac 0.5 (www.apachefriends.org)

    Can someone help ? Sorry for the german english.
      • 25663 MODX Staff
      • 12,272 Posts
      What does the MemberNavTitel chunk look like?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 36451
        • 264 Posts
        Quote from: rthrash at Mar 02, 2006, 08:27 AM

        What does the MemberNavTitel chunk look like?

        My MemberNavTitel chunk:

        <h3>Member Menu</h3>


        Nothing else...
          • 25663 MODX Staff
          • 12,272 Posts
          And the page renders fine without the snippet on there, right? If so, what’s on lines 65 (and a couple leading up to it I suppose, too)?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 36451
            • 264 Posts
            Quote from: rthrash at Mar 02, 2006, 09:17 AM

            And the page renders fine without the snippet on there, right?
            Right.
            Quote from: rthrash at Mar 02, 2006, 09:17 AM

            If so, what’s on lines 65 (and a couple leading up to it I suppose, too)?
            Ryan, YOU wrote this snippet smiley)) Ok, lines 60 - 75:

            60 # turn comma-delimited list of groups into an array
            61 $groups = explode(',', $groups);
            62 
            63 if (!class_exists('MemberCheck')) {
            64 	class MemberCheck {
            65		static $instance = NULL;
            66 		var $allGroups = NULL;
            67 		var $debug;
            68 
            69 		function getInstance($debug=false) {
            70 			global $modx;
            71 			if (self::$instance == NULL) {
            72 				self::$instance= new MemberCheck($debug);
            73 			}
            74 			return self::$instance;
            75 		}
            
            


            Seems to be ok, but I’m not a PHP Guru... huh
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Could it be an issue with the version of PHP you are using?
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 25663 MODX Staff
                • 12,272 Posts
                Actually, I wrote the function version of it, Jason made it classified. wink

                I suspect it’s definitely a PHP version issue... hmmm.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 10487 MODX Staff
                  • 1,535 Posts
                  I have a feeling that it will only run under PHP5.

                  Only I just came across this: http://www.zend.com/php5/andi-book-excerpt.php. Look at item 10 under ’New Object-Oriented Features’.

                  I might be completely wrong, perhaps Jason could clarify. wink

                  Cheers, Garry
                    Garry Nutting
                    Senior Developer
                    MODX, LLC

                    Email: [email protected]
                    Twitter: @garryn
                    Web: modx.com
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Ooops. Try it after changing the keyword static to just var and let me know if that works in PHP4. It should still work once static is changed to var, as that is indeed a PHP 5 only language feature, but that’s the only one I see off hand.
                      • 36451
                      • 264 Posts
                      Quote from: OpenGeek at Mar 02, 2006, 10:55 AM

                      Try it after changing the keyword static to just var and let me know if that works in PHP4.
                      Line 65 is ok, the script causes a parse error on line 71 now:
                      ----8<-----snip------
                      Parse error: parse error, unexpected T_IS_EQUAL, expecting ’(’ in /Users/Uwe/projekte/www.ibaw.org/manager/includes/document.parser.class.inc.php(691) : eval()’d code on line 71
                      ---------snap--8<----
                      My PHP is 4.4.1 (local) and 4.4.2 (online). I think, we are on the right way, thank you guys!