Custom add connection and send message buttons

11 years 1 week ago #225877 by Ntelos
Hello there,

I am trying to create 2 buttons as fields in order to load these buttons to profile. I need these buttons to be like friend request and send message from facebook.

My thoughts are these: I create a delimiter field and at description i use an image with a hyperlink on the image. Then i load this field through cb content module.

Now, for send message i assume that the URL on image will be like this:

index.php?option=com_comprofiler&act=connections&task=sendMessage&connectionid=[user_id]"

and for add contact (or connection as refers to default cb), the url on image will be like this:
index.php?option=com_comprofiler&act=connections&task=addConnection&connectionid=[user_id]"

I tried something like this but i don't get something.

Any hints?

Thank you in advance

Please Log in to join the conversation.

11 years 1 week ago #225880 by krileon
The PMS URL, if using UddeIM, is as follows.

index.php?option=com_uddeim&task=new&recip=[user_id]

The Add Connection URL is as follows.

index.php?option=com_comprofiler&act=connections&task=addConnection&connectionid=[user_id]

Note the user_id needs to be that of the displayed user, not that of your self (which is usually the case in modules, etc..). To for user_id to the displayed user_id you'd use the below (note this only works when viewing users profiles).

[cb:userdata field="user_id" user="#displayed" /]


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 6 months ago #236123 by Ntelos
Ok i got this.
Lets assume that i don't want to use a module and i want to use the delimiter field inside the profile (message button and add connection button).

How could i adjust those fields to be shown on all profiles but mine (in order not to be able to send messages to myself or try to add myself as a connection)?

Thank you in advance

Please Log in to join the conversation.

10 years 5 months ago #236198 by krileon
In that case just use the URLs provided in my previous reply as they'll correctly substitution in the profiler owners user id.


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 #236238 by Ntelos
As i told you, i created delimiter field and inside the description i used an image with the hyperlink: index.php?option=com_uddeim&task=new&recip=[user_id]

So, when i set up to show this delimiter field in the profile, i always see this field - image (also in my profile).

So the question is how to hide this field in my own profile

Please Log in to join the conversation.

10 years 5 months ago #236245 by krileon
Surround it with an IF substitution. Example as follows.

[cb:if user_id!="myid"]CONTENT HERE[/cb:if]

You'll then need to ensure CB is set to hide empty fields within CB > Configuration > Registration.

For further substitution usage information please see the below tutorial.

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

The alternative is to use CB Conditional then use a Custom Value conditional to ensure the displayed user id doesn't match the viewing users id.


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: nant

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.229 seconds

Facebook Twitter LinkedIn