Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount! Get 20% off now with code SPOOKY-2024!

[SOLVED] cbMenuItem to Field

  • smFruen
  • smFruen
  • OFFLINE
  • Posts: 116
  • Thanks: 5
  • Karma: 3
8 years 3 weeks ago - 8 years 3 weeks ago #286534 by smFruen
[SOLVED] cbMenuItem to Field was created by smFruen
cbMenuItem to Field

how do i get a fiels to, reportuser

and a field to add/remove connection

it is normaly only from cbMenuItem
Last edit: 8 years 3 weeks ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 3 weeks ago #286559 by krileon
Replied by krileon on topic cbMenuItem to Field
You want one of the menu links to be a field? The URL for those actions are as follows. You could link to them using a Custom HTML field, but there isn't going to be any conditional checks (e.g. hide add connection if already connected).

Add Connection:
index.php?option=com_comprofiler&view=addconnection&connectionid=[user_id]

Remove Connection:
index.php?option=com_comprofiler&view=removeconnection&connectionid=[user_id]

Report User:
index.php?option=com_comprofiler&view=reportuser&uid=[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 or Create an account to join the conversation.

  • smFruen
  • smFruen
  • OFFLINE
  • Posts: 116
  • Thanks: 5
  • Karma: 3
8 years 3 weeks ago #286560 by smFruen
Replied by smFruen on topic cbMenuItem to Field
Thanks

the

Add Connection:
index.php?option=com_comprofiler&view=addconnection&connectionid=[user_id]

Remove Connection:
index.php?option=com_comprofiler&view=removeconnection&connectionid=[user_id]

can it be i one , so if the user is Connected it Remove Connection, and if not i add

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 3 weeks ago #286569 by krileon
Replied by krileon on topic cbMenuItem to Field
There's no way to condition if the users are connected or not at this time easily. The only way to do it is a custom query to the _comprofiler_members table and see if they're connected using a CB Query Field then using an IF substitution on that query field.


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 or Create an account to join the conversation.

  • smFruen
  • smFruen
  • OFFLINE
  • Posts: 116
  • Thanks: 5
  • Karma: 3
8 years 3 weeks ago #286571 by smFruen
Replied by smFruen on topic cbMenuItem to Field
i have install CB Query Field

what do i do now

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 3 weeks ago - 8 years 3 weeks ago #286573 by krileon
Replied by krileon on topic cbMenuItem to Field
You need to write a database query to check _comprofiler_members table for a connection between the viewing user and the displayed user. Example as follows; adjust as needed.

Code:
SELECT `accepted` FROM `#__comprofiler_members` WHERE `referenceid` = '[user_id]' AND `memberid` = '[cb:userdata field="user_id" user="#me" /]'

That should return a 1 if the viewing user is connected to the displayed user otherwise should be 0 or null.


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.
Last edit: 8 years 3 weeks ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum