• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

not Logged User

dr_brown

Chevereto Member
I need to set conditions to show a div block for unregistered users. And for the registered do not show anything. But I have not found the construction of

CHV \ Login :: is not LoggedUser ()

What function describes unregistered users?

PHP:
                    <?php
                    if (CHV\Login::isLoggedUser()) {
                        ?>
                    <div class="margin-10">do not show anything</div>
                    <?php
                        }else{
                    ?>
                    <div class="margin-10">show what you need</div>
                    <?php
                        }
                    ?>

How to do without else ??
 
Deutsch
Diese Funktion gibt es meiner Meinung nicht.
Aus diesem Grund empfehle ich Dir den code zu drehen....
PHP:
<?php
if (CHV\Login::isLoggedUser()) {
?>
    <div class="margin-10">show what you need</div>
<?php
}else{
?>
    <div class="margin-10">do not show anything</div>
<?php
}
?>
oder wenn Du es wirklich auf diese Art brauchst.... ( mit ! )
PHP:
<?php
if (!CHV\Login::isLoggedUser()) {
?>
    <div class="margin-10">do not show anything</div>
<?php
}else{
?>
    <div class="margin-10">show what you need</div>
<?php
}
?>

------------------------------
Translate in english
------------------------------
This feature does not exist in my opinion.
For this reason, I recommend you to turn the code ....

PHP:
<?php
if (CHV\Login::isLoggedUser()) {
?>
    <div class="margin-10">show what you need</div>
<?php
}else{
?>
    <div class="margin-10">do not show anything</div>
<?php
}
?>
or if you really need it this way .... ( with ! )
PHP:
<?php
if (!CHV\Login::isLoggedUser()) {
?>
    <div class="margin-10">do not show anything</div>
<?php
}else{
?>
    <div class="margin-10">show what you need</div>
<?php
}
?>
 
PHP:
CHV\Login::isLoggedUser()

Returns true if a logged user exists, false if otherwise. You have to compare (true or false) depending on the case.
 
Back
Top