Use CB Queries to change male/female avatars

12 years 10 months ago #168044 by mgranocchia
I tried to use CB queries to change avatar for a registered user just after registration.

if the sex field is female, for example, it executes this query:
UPDATE `dominodb`.`jos_comprofiler` SET `avatar` = 'avatars/avf.png' ;

It does work on the database, but i can't see the avatar. Is there any other field which need to be modified in order to display an avatar?

Please Log in to join the conversation.

12 years 10 months ago #168066 by krileon
The query is not valid. Please use the below. At any rate I don't suggest using CB Queries wherein CB Fields can accomplish this much simpler.
UPDATE `#__comprofiler` SET `avatar` = 'avatars/avf.png' WHERE `id` = [user_id]

It not displaying I can't advise on. The avatar supplied must be a valid path. Typically avatars are stored in the below location.

images/comprofiler/

Placing the image there then changing the fields value simply to "avf.png" would accomplish your needs, but users could easily delete it. The best approach is to have your image be a Gallery image and enable display of the gallery images. You'd then place the image at the below location.

images/comprofiler/gallery/

Once done you'd change the users field value to "gallery/avf.png".


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.243 seconds

Facebook Twitter LinkedIn