Skip to Content Skip to Menu

New Tab - Mutual Connections

  • ckayfish
  • ckayfish
  • OFFLINE
  • Posts: 34
  • Thanks: 1
  • Karma: 44
15 years 5 months ago #102933 by ckayfish
New Tab - Mutual Connections was created by ckayfish
I decided to get my hands dirty and write a plugin/tab. For my first one I decided to go with a tab that displays a list of Mutual Connections, which are connections shared by the owner of the profile being viewed and the person viewing the profile.

I had found a copy of one that “hacks” the existing connections tab to create two groups of connections, the first displays mutual connections, and then displayed remaining connections for that user. I never applied this to even a test site, as I recall it was for CB1.0, plus I hate the idea of hacking a core tab.

I am pleased that after only a few hours I have a tab that:
  • Installs and works without errors :)
  • Does not display the tab (returns null) when viewing your own profile or when viewed by a non-member
  • States either:
  • --- You do not have any connections in common with this member
  • --- You only have one connection in common with this member
  • --- You have x connections in common with this member
  • --- (I will likely make these parameters in the tab, including an option to not show this statement)
  • Lists the usernames of all common connections (if any) with a link to their profile
On my site, I plan to display this tab directly below my existing connections tab (middle DIV) likely as CSV. I do not plan to show the avatar/image, but I have a feeling others may want to so will consider making it an option. What else would people want this to do, what display options would you want, should other fields be optional?

Also, if there is an existing tab that does this, please let me know but I couldn’t find one. Although I do have a use for this, my first desire was simply to create a tab, any tab, using the CB API that is J1.5 native

Post edited by: ckayfish, at: 2009/06/23 19:36

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

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
15 years 5 months ago #102948 by nant
Replied by nant on topic Re:New Tab - Mutual Connections
Very nice idea - good luck!

If you need any help with CB API just ask ;)

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

  • ckayfish
  • ckayfish
  • OFFLINE
  • Posts: 34
  • Thanks: 1
  • Karma: 44
15 years 5 months ago #102985 by ckayfish
Replied by ckayfish on topic Re:New Tab - Mutual Connections
I do have one question: What is the second value passed to the params->get function? Eg, the '3' here. I have seen 1, 0, 3 and DESC used. Are these default values, and for a text parameter would you enter the default here? Is there a document/API overview I could review?

[code:1]$params = $this->params;
$showtext = $params->get('mcShowtext', 3);[/code:1]

In my plugin, it shows this value until I edit/save the tab after install.

I'm attaching an alpha release here in order to get feedback from anyone who has time to look at it (features,. Also attached is a pic showing what it look like when I view a profile that I show 3 mutual connections with.

I also suppose I am suppose to get feedback on the plugin name from the CB team.

And yes, the final will be shared with the community. Pretty simple thing really, maybe a total of 4 hours most of it learning.

Update: Alpha version removed. Check thread for later post that includes beta

Post edited by: ckayfish, at: 2009/06/26 03:03

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.

  • jayray
  • jayray
  • OFFLINE
  • Posts: 8
  • Thanks: 0
  • Karma: 2
15 years 4 months ago #103043 by jayray
Replied by jayray on topic Re:New Tab - Mutual Connections
Great idea. I'm going to take a look at this. Keep up the good work :)

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
15 years 4 months ago #103054 by nant
Replied by nant on topic Re:New Tab - Mutual Connections
ckayfish wrote:

I do have one question: What is the second value passed to the params->get function? Eg, the '3' here. I have seen 1, 0, 3 and DESC used. Are these default values, and for a text parameter would you enter the default here? Is there a document/API overview I could review?

[code:1]$params = $this->params;
$showtext = $params->get('mcShowtext', 3);[/code:1]

In my plugin, it shows this value until I edit/save the tab after install.


The second parameter is the default value to use in case no value is present for parameter.

Original API document is here:

www.joomlapolis.com/component/option,com_docman/task,doc_details/gid,16/Itemid,36/

and even though it needs to be drastically updated its the best starting point.

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

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

The second parameter is the default value to use in case no value is present for parameter.

Original API document is here:

www.joomlapolis.com/component/option,com_docman/task,doc_details/gid,16/Itemid,36/

and even though it needs to be drastically updated its the best starting point.


Huge help; thanks! I did look for this document (as I recalled seeing it a while ago) but for some reason didn't check the download section. I've gone through most of it now and have a much better understanding of the API and see how pwerfull it really is. Eg, event handlers :)

Thanks again, and I should have this plugin cleaned up as soon as I have a couple hours.

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

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

Moderators: beatnantkrileon
Powered by Kunena Forum