Extension:EditSubpages
From MediaWiki.org
|
EditSubpages Release status: stable |
|
|---|---|
| Implementation | User rights |
| Description | Allows sysops to unlock pages for anonymous editing |
| Author(s) | Ryan Schmidt (Skizzerz Talk) |
| Version | 2.2 |
| MediaWiki | 1.6+ |
| Download | Subversion Usage Changelog |
| Hooks used | |
Contents |
[edit] What can this extension do?
This extension restricts editing of all but a few pages and their subpages by anonymous users. Sysops (or whatever group has the 'editinterface' permission) can add pages to MediaWiki:Unlockedpages to open them for anonymous editing.
[edit] Usage
Add pages to be unlocked to MediaWiki:Unlockedpages in a bulleted list (they may be links). Any line that isn't part of a bulleted list is treated as a comment. Example:
* [[Unlocked page 1]] # Comment. Note that declaring the namespace matters * [[Help:Unlocked page 2]] * [[Talk:Unlocked page 3]] This is a comment too :). Unlike page 1, which has both the content and talk page unlocked, page 3 only has an unlocked talk page. * [[Unlocked page 4/subpage]] # this will only unlock subpages of this subpage, so page 4 itself # uneditable by anons.
This will allow anonymous users (or any user lacking the 'edit' permission) to edit that page and all subpages of it (e.g. Unlocked page 1, Unlocked page 1/Subpage, etc.), as well as their respective talk pages. If you declare a talk page, it will not make the respective content page editable. To prevent talk pages from being edited but allow the content pages to be, simply protect the talk page.
This will also allow the anonymous users to create new pages that are sub-pages of the unlocked page.
[edit] Extended Syntax
Note: This is a pending change and has not been implemented yet and is subject to change or be removed.
The extended syntax (also known as flags), allows you to control exactly how each unlocked page works. The way of utilizing this is as follows:
* [[Unlocked page|flags|alternate text (optional)]] # ex: * [[Somepage/sub/subpage|+b-t|unlocks base pages but does not unlock talk pages]] * [[HELLO|+in-c]] # The above unlocks HELLO, Hello, Help:Hello, User:HEllO, etc., but does not allow creation of new pages
| Flag | Description | Flag | Description |
|---|---|---|---|
| +s* | Unlocks subpages of the page | -s | Does not unlock subpages of the page |
| +b | Unlocks basepages of the page | -b* | Does not unlock basepages of the page |
| +u | Apply these restrictions to both users and anons | -u* | Only apply these restrictions to anons |
| +v* | Allow viewing of the pages | -v | Prevent pages from being viewed |
| $wgEditSubpagesReadRestrict must be set to true for v to work | |||
| +c* | Allow creation of new pages | -c | Do not allow creation of new pages |
| +t* | Unlock the talk page as well | -t | Do not unlock the talk page as well |
| +e* | Allow editing of unlocked pages | -e | do not allow editing of unlocked pages |
| +i | Case insensitive | -i* | case sensitive |
| +n | Namespace inspecific | -n* | Namespace specific |
| +r | Treated as a regex fragment | -r* | Treated as a string |
| +w | Allow wildcards * and ? | -w* | Does not allow wildcards |
| +w does not work with +r set. * means "0 or more characters", ? means "0 or 1 characters" Literal * and ? must be escaped with \ (like \* and \?. \\ produces a literal backslash) |
|||
| +l | Treat as SQL LIKE statement | -l* | do not treat as SQL LIKE statement |
[edit] Download instructions
Please download the code from Subversion and place it in the $IP/extension/EditSubpages folder of your wiki. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
[edit] Installation
To install this extension, add the following to LocalSettings.php:
require_once("$IP/extensions/EditSubpages/EditSubpages.php");
[edit] Changelog
- Version 2.2
- Fixed bug that did not allow anonymous users to save unlocked pages.
- Version 2.1
- Fixed author field in the extension credits.
- Version 2.0
- Switched to using userCan hook. Fixed namespace issue. Fixed incompatibility with Extension:ConfirmAccount. Now works for versions of MediaWiki 1.6.0+. This will probably be the final release of this extension unless more major bugs are discovered.
- Version 1.2.2
- Fixed major bug that did not unlock Talk pages when they were explicitly declared. If you have any earlier version, please upgrade to this version for correct functionality!
- Version 1.2.1
- Fixed major bug that prevented any pages from being unlocked. If you have version 1.2, upgrade to this version!
- Version 1.2
- Used strpos instead of regex for faster processing and less memory usage. Bugfixes. Moved into Subversion
- Version 1.1
- Added ability to use comments and talk pages are now unlocked as well.
- Version 1.0
- Initial creation

