Skip to Content Skip to Menu

New Tab - Mutual Connections

  • ckayfish
  • ckayfish
  • OFFLINE
  • Posts: 34
  • Thanks: 1
  • Karma: 44
15 years 2 months ago #110778 by ckayfish
Replied by ckayfish on topic Re:New Tab - Mutual Connections
Luff wrote:

Thanks for the update, working out fine so far and added a lot of improvements.
However I am trying to add some additional information to the mutual connection shown, besides avatar and username I would like to add the information about the connections gender which is stored in a custom field cb_gender.
How can I get the plugin to call the information from the database? Once I have the information available I think it is not an issue to get the information displayed by myself. I assume the field needs to be added to the $query first before you can use the value, but when I added this I lost all displayed mutual connections, even though they were available.
If you can assist me with my problem would be really great! Thanks!


In mutualconns.php, line 50 (the first line of the query) is

[code:1]$query = "SELECT m.*,u.name,u.username,c.avatar,c.avatarapproved, u.id "[/code:1]
Since #__comprofiler is being aliased with "c", to add the standard named gender field, change this line to
[code:1]$query = "SELECT m.*,u.name,u.username,c.avatar,c.avatarapproved, c.cb_gender, u.id "[/code:1]

This of course just makes the value of cb_gender available for each result, but does nothing to display it. You would use $mutual->cb_gender to discover what the gender each for result.

I will consider adding an icon to represent gender as an option in the next release. I have already started looking at this, and have it working. What other items should be optional (online status etc.)



In the above image, Female is the title of the image/icon that the mouse is hovering

Post edited by: ckayfish, at: 2009/09/11 02:34

Tips for understanding and solving your issue - Props to Krileon for creating this.
My Opensource CB Plugins: Mutual Connections and MYCB Cookie available here
Attachments:

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

Moderators: beatnantkrileon
Powered by Kunena Forum