Osclass Themes and Osclass Plugins

Profile picture feature of Osclass

Profile pictures (avatar) in Osclass

User feature to upload custom avatar was missing in osclass for decades, there has been bunch of free plugins, but all of them has solved this gap just partially. Usual problem of plugins was no image optimization, lack of functionalities, hard integration into theme. Nowadays solid classified website cannot work without complex solution for users to upload their profile picture or logo.

Enable profile pictures

By default, avatars are disabled for users. You can simply enable it in Oc-admin > Settings > User settings:

PHP classified script - enable user avatar

 

There click on "Enable users to upload their profile picture" and then save button.

PHP classified script - user avatar settings

Users now can upload profile pictures in their account. For integration into your theme please use Sigma theme (user-profile.php) as reference, all functions are included in osclass core, it is just about correct placement of them into theme.

 

Upload new avatar for user

Go to your classifieds website and login as user. Go to User account > Account (My profile) section

PHP classified script - upload new profile picture

You should now see new section for profile pictures upload. Let's upload new avatar. Click on "Upload new picture" button. You will be prompted first to select image from your computer.

PHP classified script - preview avatar

In new expanded area you can crop your image simply by moving one of corners up and down. Dimension (aspect) of selector can be set in Oc-admin > Users > User settings, field "Profile picture size". Recommended size is 240x240, but depending on your theme and needs it can be changed to whatever value (240x200, 128x128, ...).

Crop window can be simply moved by holding mouse in middle of this box. Preview (expected) output is shown above this box.

You can also rotate image if required or cancel avatar upload process. In that case original image is not changed.

It is also possible to zoom picture simply by scrolling up or down with your mouse.

PHP classified script - crop, zoom or rotate avatar

 

Once you are OK with results, click on "Save" button to save newly created profile picture for user.

PHP classified script - save new user profile picture

User's profile picture is used by default on different places, like user's card on published listing or when placing comment on existing listing. Theme authors may use it on numerous other places, like header bar, listing card etc.

2031 views