Support » Plugins and Hacks » Hide part of post unless logged in

Viewing 1 replies (of 1 total)
  • This is what I have tried so far:
    1) EZStatic plugin
    – installed and checked “Execute page content between <?php ?> as PHP.”
    – added this code to the post:
    <?php
    if ($user_login) {
    echo "Message1";
    } else {
    echo "Message2";
    }
    ?>

    – this did not work: even though I was logged in it displayed Message2. when I logged out it still displayed Message2.

    2) PHPExec plugin
    – tried the same code as above but enclosed the code in <phpcode> tags as indicated by the plugin
    – this did not work either: even though I was logged in it displayed Message2. when I logged out it still displayed Message2.


    So what code do I use to detect whether the user is logged in or not??

Viewing 1 replies (of 1 total)
  • The topic ‘Hide part of post unless logged in’ is closed to new replies.