Skip to Content Skip to Menu

New: Callback functions / Hooks in uddeIM API

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
11 years 2 months ago - 11 years 2 months ago #232548 by slabbi
The uddeIM API has been improved:

You can register callback functions (hooks) for certain actions, e.g. one callback fires when the user opens his inbox or saves a message.

This feature is experimental and available in the development branch (see SVN sticky Joomlapolis.com). The FAQ.pdf already contains a description how to use the callback functions. Currently only a basic set of events are supported so please feel free to make suggestions for further events you like to see supported.

Please give feedback when you test this feature.

The trunk on Joomlacode.org is currently stable which means that you can use it on productive sites even when it is not recommended (it is not the final uddeIM 3.2 and the final version may have additional features).

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer
Last edit: 11 years 2 months ago by slabbi.

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

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
11 years 2 months ago - 11 years 2 months ago #232549 by slabbi
From the FAQ:

uddeIM 3.2 (API version 5+) supports callback functions. In order to use a callback function you have to register a hook first.

Registering a hook is simple; the following example registers a hook that is called whenever a user opens his inbox:
Code:
$uddeim = new uddeIMAPI(); $uddeim->registerHook(‘onInbox’, ‘myFunctionInbox’);

You have to implement a callback function that looks like this:
Code:
function myFunctionInbox($params) { echo "myFunctionInbox"; var_dump($params); }

Some hooks return parameters. Generally all parameters are passed by using an array. The array in the example above contains
Code:
[ “userid” => userid of user who opens the inbox ]

to "myFunctionInbox".

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer
Last edit: 11 years 2 months ago by slabbi.

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

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
11 years 1 month ago #234732 by slabbi
Nobody interested in testing this new feature?

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

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

  • rorshack
  • rorshack
  • OFFLINE
  • Posts: 15
  • Thanks: 2
  • Karma: 0
10 years 2 months ago #248255 by rorshack
Replied by rorshack on topic New: Callback functions / Hooks in uddeIM API
I'm interested! I would like to create a plug-in that does not allow users belonging to a certain group to compose messages. Is it possible to do this using a hook?

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

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
10 years 2 months ago #248256 by slabbi
No, sorry. Currently I have only implemented a few hooks. Please refer to the dev section in the FAQ that explains all hooks.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

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

  • rorshack
  • rorshack
  • OFFLINE
  • Posts: 15
  • Thanks: 2
  • Karma: 0
10 years 2 months ago #248262 by rorshack
Replied by rorshack on topic New: Callback functions / Hooks in uddeIM API
Can you please tell me where can I find the plug_uddeim_hooks? I couldn't find it anywhere! :dry:

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

Moderators: beatnantslabbikrileon
Powered by Kunena Forum