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 #286575 by smFruen
Replied by smFruen on topic cbMenuItem to Field
it give a 1 on the profil

and none on the profil thaht i am not in conetionen whit

but what 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 #286576 by krileon
Replied by krileon on topic cbMenuItem to Field
You can condition it with a substitution IF usage now. Example as follows.

[cb:if cb_myfield="1"]I am connected to this user![/cb:if]
[cb:if cb_myfield!="1"]I am NOT connected to this user![/cb:if]

See the below for further substitution usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/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 or Create an account to join the conversation.

  • smFruen
  • smFruen
  • OFFLINE
  • Posts: 116
  • Thanks: 5
  • Karma: 3
8 years 3 weeks ago #286620 by smFruen
Replied by smFruen on topic cbMenuItem to Field
yes but thaht not giv me a link

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 - 8 years 3 weeks ago #286627 by smFruen
Replied by smFruen on topic cbMenuItem to Field
database query

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

this work for me to remove a connection, but i dont give me nothing, when there is no connection.

I have try an try many options

can you please make me one thaht SELECT them I'm not friends with
Last edit: 8 years 3 weeks ago by smFruen.

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 #286646 by smFruen
Replied by smFruen on topic cbMenuItem to Field
the only thing working is when there is a connection.



then i put a link til remove connection


but so i need a Query just like pic 1 but one that shows only those I'm not connected with.

so i can put a link thaht say add connection
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 - 8 years 3 weeks ago #286648 by krileon
Replied by krileon on topic cbMenuItem to Field
The query outputs a 1 if the displayed user is connected to the viewing user. If you want to check if the viewing user is connected to the displayed user you just reverse the referenceid and memberid as follows. The URL to add or remove a connection I've already provided you, but you need to add the HTML to utilize them.

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

You're trying to do a query select. That's not correct. You need just a regular Query field. You then condition the query fields value either in the query fields layout parameters or in a separate Custom HTML field as shown below.

www.joomlapolis.com/forum/153-professional-member-support/234912-cbmenuitem-to-field?start=6#286576


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