Custom add connection and send message buttons

10 years 5 months ago #236331 by Ntelos
I used this:
[cb:if user_id!="myid"][cb:userfield field="cb_pm" /][/cb:if]

in the cb content module but i see no field neither to me nor to other profiles.

Maybe it has to do that i have sef joomla's default feature enabled?

Please Log in to join the conversation.

10 years 5 months ago - 10 years 5 months ago #236353 by krileon
Your substitute needs to be setup for it to display the displayed users information. As is it's setup to display self, which it can't even due as your IF statement excludes self. This means your field substitution would become the following.

[cb:userfield field="cb_pm" user="#displayed" /]

Please see the below tutorial for further substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb


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.

10 years 5 months ago #236388 by Ntelos
Ok i read the link you sent me and i think that the proper code for me to use is this:
[cb:if user_id!="myid" && user="#displayed"][cb:userfield field="cb_pm" user="#displayed" /][/cb:if]

but with this i don't see the field again.
What am i doing wrong?

Please Log in to join the conversation.

10 years 5 months ago #236433 by krileon
If you use the user variable you need to use it as follows.

[cb:if user="#displayed" username="test"]This is Test being displayed.[/cb:if]

Please read the tutorial carefully. This example and more are provided at the bottom.


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.

10 years 5 months ago #236499 by Ntelos
Ok, i got it.

I used this for Send pm to user button:

[cb:if user="#displayed" user_id!="myid"][cb:userfield field="cb_pm" /][/cb:if]

inside the module and it works just fine!

As for friend request i tried the same though:
[cb:if user="#displayed" user_id!="myid"][cb:userfield field="cb_friendrequest" /][/cb:if]

without any success. I suppose that i have to use this:
[cb:if user="#displayed" user_id!="myid"] my field [/cb:if], in order to show my field to all users but myself. If i use [cb:userfield field="cb_friendrequest" /] inside if statement then i get nothing.

cb_friendrequest is actually a delimiter field and inside the field's description i use this:
<p><a href="index.php?option=com_comprofiler&amp;act=connections&amp;task=addConnection&amp;connectionid=[user_id]" title="Add contact"><img src="images/add-contact.png" border="0" alt="Add Contact Button" title="Add Contact Button" width="100" height="25" /></a></p>

and then i try to load this field in profile through cb content module.

How should i make this work?

Also, what should i see if the friend request is sent properly and how the user will see if there are friend requests pending?

Thank you in advance

Please Log in to join the conversation.

10 years 5 months ago #236517 by krileon
You need to ensure your substitutions have a target user. The below should work.

[cb:userfield field="cb_pm" user="#displayed" /]

and

[cb:userfield field="cb_friendrequest" user="#displayed" /]

When you click the add connection link, as it's a direct link, it should just display a message that connection request was sent. The user it was sent to will have pending connection requests in either the login module (if enabled) or in the CB Workflows module (if installed and displayed). They'll also receive a private message if you've UddeIM installed, configured, and Connections configured to use PMS.


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.248 seconds

Facebook Twitter LinkedIn