• 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.

Cheat Sheet: Users - MooDocs

SirMoo

💖 Chevereto Fan
This is a cheat sheet I'm compiling with basic PHP snippets for CHV. It's not fun to memorize all the code bits I need to modify simple things and since documentation is lacking, I've decided to compile my own. It's short now but I'll edit it as I go along. This one only covers user management.

PHP:
 if(!get_logged_user()) {
}

Very easy way to check if the visitor is a guest or user. If the visitor is a guest (not logged in) then the action will be displayed. This can also be used in conjunction with CHV\getSetting('enable_signups') in the event that you want to only display information if signups is enabled. Though this will have limited functionality if you don't have signups on...

PHP:
if(is_owner()) {
}
Easy way to make information displayable to the logged in user if it's their content. An example would be editable fields.

PHP:
CHV\Login::getUser()["VARIABLE-HERE"];
This queries data from the logged user pulling directly from the database as well as a few pre-fixed replies that result in modified data. This is the single most helpful command for pulling user data. Anything that is listed in _users database can be used with this by dropping the user_ prefix.

Possible variables include:
name_short_html username website image_count followers id
It's encouraged to use name_short_html over just name, but you can do what you like.

PHP:
if(is_admin()) {
}
Very simple code to use to show only specific content to admin. Simply checks the data base for admin rights.

PHP:
get_user()["VARIABLE-HERE"];
This seems to be pretty much be a variation on getUser(), but I'm not really sure the differences yet. It seems to have a list of predefined variables and not directly query the database. Maybe someone can shine some light on the differences between these two.

Possible variables include: url avatar facebook twitter website background image_count
 
Back
Top