MyBB Community Forums

Full Version: (solved) How to start? (I need hooks when posting, changing and deleting articles)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

Several months ago I started a project for the synchronisation of a newsserver with a forum. Until now I used phpbb. But since phpbb doesn't support "real" threads I thinking about using another software.

Question now is how easy I can switch my existing development to another API.

I have two requests:

1. I need a possibility to add some kind of hook when articles are posted, changed or deleted (so that I can reproduce this change on the newsserver). Is there any functionality I can use for that? (Whenever an articles is created I want to do the same onto the newsserver - same with deleting and changing)

2. I need a possibility to add, change or delete articles from an external API. Is there an existing API I can use?

3. (of the two requests) :-) I need a possibility to add additional data to the message table. I need to add the message-id. Is there any functionality I can use for that or do I have to add the field on my own?

Thanks!

Michael
To generate the data for your external news server couldn't you just use an RSS feed? For example: http://community.mybboard.net/misc.php?a...yndication

Then you could quite easily write a PHP script to act as an API to do the rest.
Hi!
(2010-04-09, 12:20 AM)TimB. Wrote: [ -> ]To generate the data for your external news server couldn't you just use an RSS feed?
Thanks for your answer. But this isn't enough. I want to synchronize even changes in articles or when they are deleted. Additionally I want to synchronize even groups that aren't open to anybody.

Is there any function that is called whenever a change is done? Maybe the notification system?

Michael
Hi!

I looked into the sample plugin, changed it and collected several hooks:
$plugins->add_hook("datahandler_post_update", "syncom_update");
$plugins->add_hook("datahandler_post_insert_post", "syncom_insert");
$plugins->add_hook("datahandler_post_insert_thread_post", "syncom_insert");
$plugins->add_hook("class_moderation_delete_post_start", "syncom_delete");
$plugins->add_hook("class_moderation_delete_thread_start", "syncom_delete_thread");
It seems to me as if it is much easier to extend the functionality of MyBB than of phpbb3 - that doesn't have any really working hook system.

Michael