A small mediawiki extension to have a variable to know if the user is connected or not.
A small mediawiki extension to have a variable to know if the user is connected or not.
Version 0.3
Version 0.4
Mathieu Loiseau
Mathieu Loiseau
This is free software licensed under the GNU General Public License. Please
This is free software licensed under the GNU General Public License. Please
...
@@ -16,7 +16,7 @@ Connected is an extension to MediaWiki that provides elements to adapt the conte
...
@@ -16,7 +16,7 @@ Connected is an extension to MediaWiki that provides elements to adapt the conte
The extension defines the following parser functions and variables:
The extension defines the following parser functions and variables:
*``LOGGEDIN`` : ``1`` if the user is logged in, ``0`` otherwise ;
*``LOGGEDIN`` : ``1`` if the user is logged in, ``0`` otherwise ;
*``USERNAME`` : the user's screen name, if they are logged in, their ip address otherwise ;
*``USERNAME`` : the user's screen name, if they are logged in, their ip address otherwise ;
*``#ifloggedin`` : displays the first parameter if the user is logged in, the second otherwise.
*``#ifloggedin`` : displays the first parameter if the user is logged in, the second otherwise. If a third parameter is provided, it can specify that this text should not be included in a div (which is default).
The extension hides the sidebar for not logged in users.
The extension hides the sidebar for not logged in users.
...
@@ -31,3 +31,6 @@ your `LocalSettings.php` file:
...
@@ -31,3 +31,6 @@ your `LocalSettings.php` file:
```php
```php
wfLoadExtension('Connected');
wfLoadExtension('Connected');
```
```
## Configuration
*`$wgConnectedPrivateCSSClass` : css class for loggedIn content
*`$wgConnectedPublicCSSClass` : css class for not loggedIn content