[solved]{$my->id} wouldn't compare

aijosh

Member
Hello,

I'm editing a custom detail view and want to show a div only to logged in users.
I can see the values returned if I echo them
(0 when not logged in)
but The problem is that the value returned doesn't work in my if statement.
PHP:
 <?php
                         $loggedin =  '{$my->id}';
$loggedin =  (string)$loggedin;
          if ($loggedin ==  "0"){
                             echo '<div> You must be logged in to see this</div><a class="btn btn-mini btn-primary" href="/login">Login</a>';
         }?>

I tried comparing logged in users id with itself and it still doesn't work.
 
Placeholders only work in "evaled" code, ie. code snippets you directly enter in a field in the Fabrik backend, where Fabrik will then run that snippet through our placeholder replacement before doing an "eval($code)". For straight up PHP files, it won't work, as we don't "eval" those, we just use PHP's require/include to directly execute the files. We don't read the file content in and eval it.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top