【发布时间】:2014-09-17 07:49:18
【问题描述】:
我有一个 PHP 脚本,可以在我的 MediaWiki 上显示员工列表。我还有一个特殊页面,您可以在其中管理哪些用户是员工,效果非常好。但是,当您在特殊页面上进行后端更改时,更改不会显示在 wiki 页面上,它会在其中插入标签,直到您编辑该页面,并且什么都不更改,然后保存。
这只能是因为我使用了错误的钩子。我正在尝试改用这个钩子,但它似乎不起作用:http://www.mediawiki.org/wiki/Manual:Hooks/ArticlePageDataBefore
现在我正在使用这个钩子。仅仅改变变量名是行不通的:
$wgHooks['ParserFirstCallInit'][] = 'wfEmployeesParserInit';
// Hook our callback function into the parser
function wfEmployeesParserInit( Parser $parser ) {
// When the parser sees the <sample> tag, it executes
// the wfEmployeesRender function (see below)
$parser->setHook( 'employees', 'wfEmployeesRender' );
// Always return true from this function. The return value does not denote
// success or otherwise have meaning - it just must always be true.
return true;
}
// Execute
function wfEmployeesRender( $input, array $args, Parser $parser, PPFrame $frame ) {
...
【问题讨论】:
标签: php mediawiki mediawiki-extensions