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 #286652 by smFruen
Replied by smFruen on topic cbMenuItem to Field
Sorry but it not working

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 #286655 by krileon
Replied by krileon on topic cbMenuItem to Field
I've tested both queries as working properly. I don't know what more to tell you.

Outputs 1 if the DISPLAYED user is connected to the VIEWING user:
Code:
SELECT `accepted` FROM `#__comprofiler_members` WHERE `referenceid` = '[user_id]' AND `memberid` = '[cb:userdata field="user_id" user="#me" /]'

Outputs 1 if the VIEWING user is connected to the DISPLAYED user:
Code:
SELECT `accepted` FROM `#__comprofiler_members` WHERE `memberid` = '[user_id]' AND `referenceid` = '[cb:userdata field="user_id" user="#me" /]'

Both of which should be added to a regular "Query" fieldtype (not a query select). Next within Parameters > Layouts for the field set the layout as follows.

Profile Value Layout:
[cb:if FIELD_NAME="1"]I am connected to this user![/cb:if]
[cb:if FIELD_NAME!="1"]I am NOT connected to this user![/cb:if]

If you're still having problems please consult with a freelance developer to implement it for you as I've provided you with ample examples to have what you're wanting short of configuring it for you, which we do not provide here. I suggest the first query if you're using cross connections as it ensures the user has accepted your request before it outputs 1.


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 #286659 by smFruen
Replied by smFruen on topic cbMenuItem to Field
like this



Attachments:

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 #286661 by krileon
Replied by krileon on topic cbMenuItem to Field
You need to change FIELD_NAME to the name of your 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 #286663 by smFruen
Replied by smFruen on topic cbMenuItem to Field
[cb:if cb_fjernven="1"]I am connected to this user![/cb:if]
[cb:if cb_fjernven!="1"]I am NOT connected to this user![/cb:if]

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 #286665 by smFruen
Replied by smFruen on topic cbMenuItem to Field
it works fin but only

I am connected to this user! show fin

I am NOT connected to this user! done show

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

Moderators: beatnantkrileon
Powered by Kunena Forum