tr('Network condition'), 'documentation' => 'PluginNetworkCondition', 'description' => tr('Display content based on the user\'s IP address'), 'prefs' => ['wikiplugin_networkcondition'], 'iconname' => 'computer', 'introduced' => 11, 'body' => tr('Content to display conditionally.'), 'params' => [ 'ipv4list' => [ 'required' => false, 'name' => tra('IPv4 List'), 'description' => tra("Comma-separated list of IPv4 addresses to match against the visitor's address."), 'since' => '11.0', 'default' => '', 'filter' => 'text', 'separator' => ',', ], ], ]; } function wikiplugin_networkcondition($data, $params) { global $tikilib; $ip = $tikilib->get_ip_address(); if (! empty($params['ipv4list'])) { $list = $params['ipv4list']; if (! is_array($list)) { $list = explode(',', $params['ipv4list']); } if (! in_array($ip, $list)) { return ''; } } return $data; }