I use revolution1
the code does not work is that
please respond with the correct code and running and only professionals MODx, the code is very simple is not productive to lose all this time.
the code does not work and was posted by Bob Ray
<? php
/ * * Snippet ingroup /
$ output = "";
if ($ MODx-> user-> isMember (’Group’)) {
$ output = $ MODx-> GetChunk (’chunk1’);
} Else if ($ MODx-> user-> isMember (’GroupB’)) {
$ output = $ MODx-> GetChunk (’chunk2’);
Else {}
$ output = $ MODx-> GetChunk (’chunk3’);
}
return $ output;
?>
also fails
<?php
$user =& $modx->user;
if ($user->isMember(’membres’) {
$output = $modx->getChunk(’membres’);
} elseif ($user->isMember(’administrateurs’) {
$output = $modx->getChunk(’administrateurs’);
} elseif ($user->isMember(’employés’) {
$output = $modx->getChunk(’employés’);
} else {
$output = $modx->getChunk(’offline’);
}
return $output;
?>
thank you very much
All the user groups and chunk names have to exist and be spelled correctly (they're case sensitive).
It's also possible that the accented characters are causing trouble. And if the user groups and member groups were just created, you may have to clear the site cache, flush permissions, and flush sessions before the code will work (and maybe clear browser cache and cookies as well).
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODx info for everyone:
http://bobsguides.com/MODx.html