Created
May 15, 2014 23:18
-
-
Save dannevang/b7f37a9edf19b0c7ea85 to your computer and use it in GitHub Desktop.
Show MODX chunk based on usergroup membership
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* ShowChunk snippet : Credit: Bob Ray */ | |
| $subChunks = explode(',', $scriptProperties['subscriberChunks']); | |
| $otherChunks = explode(',', $scriptProperties['otherChunks']); | |
| if ($modx->user->isMember('paid-members')) { | |
| foreach ($subChunks as $subChunk) { | |
| $output .= $modx->getChunk($subChunk); | |
| } | |
| } else { | |
| foreach ($otherChunks as $otherChunk) { | |
| $output .= $modx->getChunk($otherChunk); | |
| } | |
| } | |
| return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment