Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


Plugin Programming Question
Date: 2008/09/01 07:17 By: vilo Status: CB Doc subscriber  
Karma: 0  
Fresh Joomlapolitan

Posts: 13
graphgraph
It is clear to me how to program simple plugin in PHP, that can be then placed anywhere on Profile page manually using CB's back end Tab Manager. I know how to write setup xml file and simple plugin in PHP that does what I want it to do.

However my question to plugin programmers here is what code do I have to use within plugin PHP code to place plugin under EXISTING tab. In other words how do I go about adding contents of my plugin under "Contact Info" tab.

I already have under "Contact Info" tab "Name:" field. Name field is not coming from the content of the plugin but from the content of the field (designed in CB Field Manager.)

My question then is this: How do I write the code within my plugin PHP that would place the content of my pluging in the second line of the "Contact Info" tab, right under the name field.

I am not familiar with logic that sends/adds content of my plugin on the fly to existing elements of the Profile page.

Any direction on how to go about this would be greatly appreciated.
thank you

Post edited by: vilo, at: 2008/09/01 07:19
Click here to see the profile of this user The administrator has disabled public write access.

Re:Plugin Programming Question
Date: 2008/09/01 11:55 By: beat Status: Admin  
Karma: 244  
Admin

Posts: 4066
graphgraph
Take example on the core simpleboard forum plugin: it has status fields, which are defined in the XML file, and implemented in a small PHP class.
Beat - Developer on Community Builder core Team
- If you like CB and this forum, you will love Nick's CB 1.1 reference manual ! : Click here to Get it now
- Would like to help us move faster ? Get it, and/or help us spend more time coding by helping others in this forum, many thanks
Click here to see the profile of this user The administrator has disabled public write access.

Re:Plugin Programming Question
Date: 2008/09/01 22:27 By: vilo Status: CB Doc subscriber  
Karma: 0  
Fresh Joomlapolitan

Posts: 13
graphgraph
First, thanks for replying. I really appreciate it.

I have been looking through the simpleboard plugin (which I am using for FireBoard) and many other plugins (Flags,Stocks,iplog,gender) and unfortunately I could not figure out complete logic for adding stuff to existing item out of them.

Specifically in simpleboard plugin that you mentioned all of the references to the code that I think allows adding stuff to existing tab are commented and not in the use.
Only reference to the word "status" in simpleboard plugin is in function _setStatusMenuSBstats, which is commented and not in use.

Still, this code is referring to _UE_MENU_STATUS which is "Status", where in my original post I was inquiring about adding stuff to existing tab "Contact Info" which is _UE_CONTACT_INFO_HEADER.

I see the code that seems to be in charge of doing this but when I implement it, it does nothing. The code I am trying to use for testing is:

Code:

  $menuitem = array();  $menuitem["_UE_CONTACT_INFO_HEADER"]["_UE_NAME"]["_UE_NAME"]=null; $this->addMenu( array(    "position"    => "menuList" ,                             "arrayPos"    => $menuitem ,                             "caption"    => "Something" ,                              "url"        => "" ,                             "target"    => "" ,                             "img"        => "" ,                             "alt"        => "" ,                             "tooltip"    => "") );




I would expect the above code to change the value of the Name field under "Contact Info" to "Something" from whatever it is now. Am I missing something or am I using the code in a wrong way?

I am mainly interested in 2 things:
1. Changing value of existing field from my plugin.
2. Adding completely new line(s) under "Contact Info" (not Status).
That is, adding stuff to existing tabs, not creating the new ones.

thanks for any help on this
P.S. I am using already 1.2 RC2

Post edited by: vilo, at: 2008/09/02 00:56
Click here to see the profile of this user The administrator has disabled public write access.

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login