Skip to Content Skip to Menu

[SOLVED] fan instead of connections

10 years 9 months ago #239722 by thewebsurfer
Replied by thewebsurfer on topic fan instead of connections

krileon wrote: There's no way to know if two users are connected or not without using CB Query Field to query the database.


ok i create a mysql field with
SELECT memberid,referenceid FROM #__comprofiler_members WHERE referenceid = {USERID} AND memberid={VIEWERID}

but the condition? should i create 2 extra field for the buttons (one with "like", one with "not like")?
there is an easier and more clean way?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239766 by krileon
Replied by krileon on topic fan instead of connections
You have no quotes in the query and those are not valid substitutions. An example of a valid query is as follows.

Code:
SELECT `email` FROM `#__users` WHERE `id` = '[user_id]'

To grab the user id of the viewing user you'll also need to use the following substitution.

[cb:userfield field="user_id" user="#me" /]

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

10 years 9 months ago #239768 by thewebsurfer
Replied by thewebsurfer on topic fan instead of connections

krileon wrote: You have no quotes in the query and those are not valid substitutions. An example of a valid query is as follows.

Code:
SELECT `email` FROM `#__users` WHERE `id` = '[user_id]'

To grab the user id of the viewing user you'll also need to use the following substitution.

[cb:userfield field="user_id" user="#me" /]

Please see the below tutorial for further substitution usage information.

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


ok but after this substitution what should i do? should i make 2 field delimiter with the 2 buttons and hiding one of them with CB substitution (testing if mysql field is empty)? this is your idea?


another little thing: could you tell me how to edit DenyConnection function for my case?
Code:
$cbCon = new cbConnection( $userid ); $cbCon->denyConnection( $userid, $connectionid );
i tried to switch userid and connectionid, but in this case doesnt work..

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

10 years 9 months ago #240048 by thewebsurfer
Replied by thewebsurfer on topic fan instead of connections
i solved in other way, thanks anyway

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

Moderators: beatnantkrileon
Powered by Kunena Forum