最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Content dependent on usergroup in MediaWiki - Stack Overflow

programmeradmin0浏览0评论

I have several user groups in LocalSettings.php:

$wgGroupPermissions["SM_p1"]["createaccount"] = false;
$wgGroupPermissions["SM_p1"]["edit"] = false;
$wgGroupPermissions["SM_p1"]["read"] = true;
$wgGroupPermissions["SM_p2"]["createaccount"] = false;
$wgGroupPermissions["SM_p2"]["edit"] = false;
$wgGroupPermissions["SM_p2"]["read"] = true;

I would like to show page content which depends on logged user with help of function #ifingroup.

I put lines of code in my main mage:

<strong>MediaWiki has been installed.</strong>

{{#ifingroup: SM_p1|Welcome, SM_p1 User!|This content is for SM_p1 users only.}}

{{#expr: 5+5 }}

Line {{#expr: 5+5 }} brings 10 as expected. But line {{#ifingroup: SM_p1|Welcome, SM_p1 User!|This content is for SM_p1 users only.}} is displayed as text.

What extension brings function #ifingroup?

I have several user groups in LocalSettings.php:

$wgGroupPermissions["SM_p1"]["createaccount"] = false;
$wgGroupPermissions["SM_p1"]["edit"] = false;
$wgGroupPermissions["SM_p1"]["read"] = true;
$wgGroupPermissions["SM_p2"]["createaccount"] = false;
$wgGroupPermissions["SM_p2"]["edit"] = false;
$wgGroupPermissions["SM_p2"]["read"] = true;

I would like to show page content which depends on logged user with help of function #ifingroup.

I put lines of code in my main mage:

<strong>MediaWiki has been installed.</strong>

{{#ifingroup: SM_p1|Welcome, SM_p1 User!|This content is for SM_p1 users only.}}

{{#expr: 5+5 }}

Line {{#expr: 5+5 }} brings 10 as expected. But line {{#ifingroup: SM_p1|Welcome, SM_p1 User!|This content is for SM_p1 users only.}} is displayed as text.

What extension brings function #ifingroup?

Share Improve this question edited Feb 15 at 15:59 hakre 198k55 gold badges446 silver badges854 bronze badges Recognized by PHP Collective asked Feb 15 at 14:45 vicovico 18.2k53 gold badges186 silver badges361 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

What extension brings function #ifingroup?

That is Extension:UserFunctions (MediaWiki).

You may have it already enabled, however this note about the namespace (and there is also something about the side-bar):

By default, functions are only enabled in NS_MEDIAWIKI namespace, for enabling them in other namespaces, see the examples below. (ebd.)

发布评论

评论列表(0)

  1. 暂无评论