• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Adding Additional Fields

akchev

Chevereto Member
Hi Adolfo;

I would like to add the following fields to my Chevereto installation and would appreciate if you could guide me with how I could accomplish this.

- Date of Birth
- City
- State
- Country
- Gender

I would like all fields to be required during the registration process and shown/editable in the users settings menu in case they need to make an update.

*Although some of these additional fields (such as Gender) seem like I am asking for personal customization; I believe requesting such information such as Date of Birth and Country is required by law in my country (USA) for such public/automated profiles and scripts.

To break things down; #1 you must be a minimum age to have public profiles with images available for the world to view. #2 certain images and/or content is not allowed (for the public to see) if you reside in certain counties and/or states. #3 you must be at least 18 years old for a majority of any content to be public.

**Almost all legitimate sites require such information to follow such rules and/or laws. Some do the bare minimum to ensure a larger user base by eliminating all liabilities (... with the use of "fine print") in their "Terms of Use" and "Terms of Service" - however, not all of us have thousands of dollars to fork over to an attorney to write up such a sleezy TOS to dodge lawsuits that they are guaranteed to encounter.

That said; such features are on most regular/social sites that include public photos. But for a public image hosting site with user profiles? I personally think this is a must.

Now... most people won't want this nor care. How about implementing this and allowing the Admin to enable/disable such extended fields?

Let me know what you think.

Thanks
 
Last edited:
A) Create an auxiliar table like chv_user_fields with fields like user_field_id, user_field_user_id, user_field_dob, user_field_city, etc.
B) Add custom fields to the default chv_user table like user_myfield_dob, user_myfield_city, etc.

For both alternatives you will need to create a route.settings.php override to handle the user submit values. You will also need to customize the views/settings.php theme file.

Both alternatives works very similar but in A you will need to add a join to include your custom fields for user class and any class that fetch data from the chv_users table. A is more clean than B but all those joins could be annoying at some point.

Key point for you is that the CHV\User::get functions should return something that you can use like $user['field_dob'] and auxiliar indexes like $user['age'] (which must be injected by PHP), so you can use those when doing things like get_user() or get_image()['user']
 
I may be able to accomplish 5% of this on my own. However, I am super appreciative! I will pass this along to someone I know who understands so he should be able to implement what you replied with.

Thank you very much for your time/support.
 
Back
Top