Skip to Content Skip to Menu

Plugin Programming Question

  • vilo
  • vilo
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
16 years 2 months ago #72851 by vilo
Plugin Programming Question was created by vilo
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

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

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
16 years 2 months ago #72874 by beat
Replied by beat on topic Re:Plugin Programming Question
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 - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

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

  • vilo
  • vilo
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
16 years 2 months ago #72926 by vilo
Replied by vilo on topic Re:Plugin Programming Question
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:1]
$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" => ""«») );[/code:1]


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum