| View previous topic :: View next topic |
Rotsblok
Joined: 20 Jan 2010 Posts: 1
|
Posted: Wed Jan 20, 2010 2:36 am Post subject: post topic in phpBB3 when a new article is placed in wiki |
|
|
|
Hi,
I'm using your nice extension which is working perfectly, when I wanted something more..
I have searched the net for it but couldnt find anythin.. So I tried to build it myself..
I'm trying to make a topic when a new article is made in the wiki. But for this I need to connect to my other db where phpBB is located..
As my knowledge of php is limited to cut & paste and hope for the best, I was wondering if someone could make it for me, or give me directions on how to do it... |
|
| Back to top |
|
|
root Site Admin
Joined: 24 Jun 2005 Posts: 432
|
Posted: Wed Jan 20, 2010 10:40 am Post subject: |
|
|
|
The great news is that what you want can be done.
MediaWiki has a hook you can use to call your code.
http://www.mediawiki.org/wiki/Manual:Hooks/ArticleInsertComplete
So in your LocalSettings.php you would add at the bottom.
| Code: | | $wgHooks['ArticleInsertComplete'][] = 'fnMyHook'; |
the fnMyHook is the name of your function. So if you named it something like InsertNewPostInPHPBB. Then the code would be
| Code: | | $wgHooks['ArticleInsertComplete'][] = 'InsertNewPostInPHPBB'; |
Then you create your function.
| Code: | function fnMyHook( &$article, &$user, $text, $summary, $minoredit,
$watchthis, $sectionanchor, &$flags, $revision ) { ... } |
using the InsertNewPostInPHPBB name I used above it would be.
| Code: | function InsertNewPostInPHPBB( &$article, &$user, $text, $summary, $minoredit,
$watchthis, $sectionanchor, &$flags, $revision )
{ ... } |
Where the ... is you would then have your code to connect to your phpBB database and the code to add a new topic.
To match the MW plug-in format. Your function would be in it's own file in the extensions directory. ("MyFunctions.php") and you would include it via the include_once() method in LocalSettings.php |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
alexisBlue v1.2 // Theme Created By: Andrew Charron and Web Hosting Bluebook
|
|
Powered by phpBB © 2001, 2002 phpBB Group |
|
|
|
|