• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

[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
 
Back
Top