Image for a period of time

2 years 6 months ago #326562 by galanopd
Image for a period of time was created by galanopd
Hi,

How can I put a small image on top of the user canvas e.g. an image with the letter "N", for other users to know that he/she is a new member. This image will apply to ALL new members automatically and will be removed automatically e.g. after one year or six months.

Thank you

Please Log in to join the conversation.

2 years 6 months ago #326571 by krileon
Replied by krileon on topic Image for a period of time
There isn't a way to directly place something on top of the canvas background anymore. It causes too many conflicts with the responsive styling for canvas (when viewed on mobile) with things overlapping on top of the avatar. You can use the canvas info/status positions to add things where their name is or just put the icon next to their name in the canvas.

As for it being visible for a limited period of time you can use CB Conditional for that. Example as follows.

Field: Custom > Code
Code:
$dateDiff = \CBLib\Application\Application::Date( 'now' )->diff( '[registerdate]' );

if ( ! $dateDiff ) {
	return 0;
}

return $dateDiff->days;
Operator: Greater Than
Value: 365

The above lets you directly condition against the difference in days between when they registered and the current date. So conditioning against 365 in this example give us 1 year. You can change that to whatever you like in days.

In a future release there will directly be condition options for configuring easy date comparisons, but for now as shown above you need to use PHP and relevant APIs.


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.
The following user(s) said Thank You: galanopd

Please Log in to join the conversation.

2 years 6 months ago #326581 by galanopd
Replied by galanopd on topic Image for a period of time
Thank you Kyle,

I will try to implement it this way and hopefully make it work.

Please Log in to join the conversation.

2 years 6 months ago #326614 by galanopd
Replied by galanopd on topic Image for a period of time
Works fine as expected!

Just a minor thing I have noticed. Although I have added image "alt" and "title" when mouse over, i see nothing.

Please Log in to join the conversation.

2 years 6 months ago #326618 by krileon
Replied by krileon on topic Image for a period of time

Just a minor thing I have noticed. Although I have added image "alt" and "title" when mouse over, i see nothing.

If you're using a Custom HTML field CB has nothing to do with how you structure your HTML. If using an Image field then you can supply a custom title under Parameters > Image Display using the Title parameter. For Image fields alt is automatically added and is just the image filename.


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.

2 years 6 months ago - 2 years 6 months ago #326620 by galanopd
Replied by galanopd on topic Image for a period of time
Yes, I use type:Html because I can't find a way to select a specific image if I use type:Image. What I do in this case, is to use a specific image to appear to all new members and then disappear after a certain period of time. This has nothing to do with the user. It is an automated procedure by the system. So, if I have understood well, a type:Image allows the user to upload an image, etc. In my case the image is just one and not related to the user's will on his profile.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 1.110 seconds

Facebook Twitter LinkedIn