We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36451
    • 264 Posts
    Quote from: yoomai at Mar 03, 2006, 02:37 AM

    Line 65 is ok, the script causes a parse error on line 71 now:

    Please help me, I have no idea huh how to fix this error.
      • 10487 MODX Staff
      • 1,535 Posts
      Hi yoomai,

      The error is caused by the ’self::instance’ calls. Now, after having a quick look, I believe that this prefix can be removed and replaced with ’$instance’.

      Oh, and don’t forget to make the page uncacheable, else you’ll scratch your head for ten minutes like I just did. wink

      EDIT: please see here for my modified php4-compatible version.

      Cheers, Garry
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 36451
        • 264 Posts
        Quote from: garryn at Mar 03, 2006, 04:42 PM

        I’ve attached a patched version of MemberCheck, I’ve tested it and it appears to work as intended. Could you do the honours and give me a second opinion smiley
        Yes, that one works! Thank you, Garry!! aka PHP Superhero wink
          • 27285
          • 29 Posts
          hi!


          I installed membercheck_php4 and it works fine! My only problem is the not working &ph-function!

          What can I do to solve the problem and show a specific snippet if the visitor has not the right to see the content of the chunk, which is protected by "MemberCheck"?


          Thx for your reply!
            • 10487 MODX Staff
            • 1,535 Posts
            Hi simon79,

            I recently revisited the Membercheck snippet and made a few more tweaks to my modded version, one of them was adding in the missing placeholder functionality.

            I have now uploaded this to the repository: http://www.modxcms.com/MemberCheck-PHP-4-861.html

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

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 27285
              • 29 Posts
              Hi Garry!


              Thanks for your quick reply!

              Can I use a chunk called "&ph=`CHUNK-NAME`" to set this chunk as placeholder which displays e.g. "You can only see the full content, if you´re logged in!".

              Sorry for my english! wink
                • 10487 MODX Staff
                • 1,535 Posts
                Hi Simon79,

                No, use &chunk to specify the chunk name, and &ph to specify the placeholder name, for example:
                [[MemberCheck? &groups=`Site Admins` &chunk=`myChunk` &ph=`myPlaceholder`]]

                The above call would output the ’myChunk’ chunk if the user was a member of the Site Admins group, and would output the content to [+myPlaceholder+].

                So, you just place the [+myPlaceholder+] in your page where you would like the chunk to be outputted.
                  Garry Nutting
                  Senior Developer
                  MODX, LLC

                  Email: [email protected]
                  Twitter: @garryn
                  Web: modx.com
                  • 27285
                  • 29 Posts
                  Hi Garry!


                  Is there a possibility to show a specific text to not logged in visitors? E.g. "You have to login to see ..."
                    • 7923
                    • 4,213 Posts
                    Quote from: simon79 at Jul 29, 2006, 04:55 AM

                    Is there a possibility to show a specific text to not logged in visitors? E.g. "You have to login to see ..."
                    Use the "Unauthorized page" setting at MODx system configurations to point to the document which has that info.

                    EDIT: Now that I read it again, I may have misunderstood what you mean, so please expain more.


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 27285
                      • 29 Posts
                      Hi doze!


                      I want to split my content into two parts:

                      The first part (e.g. my document contains a list of 10 points) as "preview" shows point 1 + 2.

                      At point 3 I insert the chunk containing the rest of the list. My intention is that only logged in users can see the full list. Other visitors should see a message "You have to login to see the rest of the document!" at the point I insert the MemberCheck-chunk. But only visitors get this message, logged-in users see the complete document without the "You have to login..." message.

                      I hope you can follow my description! wink