Skip to Content Skip to Menu

Help needed with my plugin

  • nicholai
  • nicholai
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
17 years 2 months ago #46454 by nicholai
Help needed with my plugin was created by nicholai
Hello

I am developing a new PMS system for J!1.5.
I would like to create a plugin so CB can use my component. Please note that the plugin is created with J1.5 libraries.

I have 1 question and one problem which hold me from publishing this plugin.

The question:
Which values are required and to which url should be used in the 'Quick message' form?

The problem:
I have written a getLink() function, but somehow the link is not showed in the 'message' menu.
[code:1]function getPMSlink($toid, $fromid, $subject, $message, $kind)
{
$menu =& JSite::getMenu();
$params = $this->params;

// Find the url if used by the website to JAM
$item = $menu->getItems( 'link', 'index.php?option=com_jam&view=inbox', true);

// If we have an item, we use the used url, otherwise we use a standard one
if ($item) {
$url = 'index.php?Itemid='.$item->id;
} else {
$url = 'index.php?option=com_jam';
}

if ($kind == '1')
{
require_once( JPATH_COMPONENT_SITE.DS.'classes'.DS.'users.php');

$caption = $params->get('pmsMenuText', _UE_PM_USER);
$url = $url.'&to='.JAMUsers::getUsername( $toid, ',');
$tooltip = $params->get('pmsMenuDesc', _UE_MENU_PM_USER_DESC);
}
else
{
$caption = _UE_PM_INBOX;
$tooltip = _UE_MENU_PM_INBOX_DESC;
}

return array( 'caption' => $caption, 'url' => $url, 'tooltip' => $tooltip );
}[/code:1]

Thank you in advance B)
Nicholai

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

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
17 years 2 months ago #46492 by beat
Replied by beat on topic Re:Help needed with my plugin
First of all, welcome to Joomlapolis, and thanks for your precise and documented post.

To answer your two questions:

A) in general:

1) CB has its API for plugins and specially for PMS plugins, and best is to take a look at the pms_mypmspro plugin of CB, which integrates quite a few pms systems. Usually, CB plugins post to CB, and CB will route their post to them, while also computing and rendering the other elements of the page.

2) CB has its API for its menu structure, and for PMS menu, it's a special case, as CB should be able support multiple PMS systems simultaneously if needed, however the publishing of the plugins needs to be done accordingly.

B) in detail:

1)
[code:1]$this->_getAbsURLwithParam(array())[/code:1]
will give you the basic URL to which to post your PMS. in the array, you can include GET parameters, which will be prefixed with the plugin name/id. To get the POST or GET name for a given plugin and a given parameter, you can call
[code:1]$this->_getPagingParamName("sender"«»)
[/code:1]
and finally, to get a parameter from the request, you can use:
[code:1]$this->_getReqParam("sender", null)
[/code:1]
(sender is just an example for the codes above.

2) is it just the $link which is missing, or the whole link ? are other functions working ?
Your PMS plugin needs to be recognized by core cb, and enabled.
It's hard to tell since your method seems to return fine, it must be something else, which I can't see here.

Hope this helps. Did you also see the CB API doc from the downloads section here ?
www.joomlapolis.com/component/option,com_docman/task,doc_details/gid,16/Itemid,36/

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.

  • nicholai
  • nicholai
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
17 years 1 month ago #47546 by nicholai
Replied by nicholai on topic Re:Help needed with my plugin
Hello Beat,

I am contacting you again as I just cannot get it working.
Would you mind to take a (good) look at my code and find what the problem is?

Of course I know what I am doing regarding to the code. ;)

Thanks you in advance and regards

Attachment jam_plugin_comprofiler_v1_0.zip not found

Attachments:

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

  • nicholai
  • nicholai
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
17 years 1 month ago #47952 by nicholai
Replied by nicholai on topic Re:Help needed with my plugin
♫♪ Ping Ping ♫♪

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

  • nicholai
  • nicholai
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
17 years 4 weeks ago #48900 by nicholai
Replied by nicholai on topic Re:Help needed with my plugin
Ok

Everything seems to be working now, except for the message url in the menu's.
Ill upload the plugin to my website.

Regards

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

Moderators: beatnantkrileon
Powered by Kunena Forum