Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hacking MediaWiki (for users)

Hacking MediaWiki (for users)

Presented at Linux Users of Victoria usergroup, 2008.

Brianna Laugher

November 05, 2008
Tweet

More Decks by Brianna Laugher

Other Decks in Technology

Transcript

  1. Brianna Laugher Linux Users of Victoria November 2008 meeting Hacking

    MediaWiki (For Users) http://www.mediawiki.org/
  2. • Me: 2005—now Wikimedia editor, Wikimedia Commons administrator ~ 2

    years, frustrated wannabe hacker • You: Use MediaWiki outside of Wikimedia, comfortable with basic editing Who are we?
  3. • MediaWiki/Wikimedia • Wiki structure • Magic words, access levels

    • User JS/CSS – Gadgets • “Uselang” hack Outline
  4. Open­source (GPL) wiki engine software (uses LAMP) MediaWiki Wikimedia MediaWiki

    Name of a social movement; also US charity (Wikimedia Foundation)
  5. “Front” page + talk page • Main, Project, Help •

    Template • Category • Special* • Image, Media* • MediaWiki (* = psuedo namespace) Namespaces Help:Namespaces
  6. Special:Upload Image namespace ­> File (soon!) [[Image:foo.jpg]] to embed [[:Image:foo.jpg]]

    to link to image page, not embed [[Media:foo.jpg]] to link to file directly Images (uploaded files)
  7. “System [interface] messages” Edit MediaWiki: pages to overrride defaults (sysops

    only) Search on Special:Allmessages to find the right message/page MediaWiki namespace Manual:System message
  8. About the sidebar... MediaWiki:Mainpage Main Page Move search box to

    top for usability Delete defaults, Add your own links
  9. Modify an existing one: User:Foo/monobook.css,js Myskin – empty to start

    with Skins – roll your own Your user page Name of skin. Must start with lowercase
  10. Look like {{CAPS TEMPLATES}} Especially used in templates ­ context.

    • Time, revision related • Stats! {{NUMBEROFARTICLES}} {{NUMBEROFEDITS}} {{NUMBEROFUSERS}} {{PAGESINCATEGORY:Foo}} Variables Help:Magic words
  11. Special:ListGroupRights • “Anonymous”/IP editor • (registered) User • ­> Autoconfirmed!

    • Sysop (==”admin”) • Bureaucrat • Bot User access levels Manual:User rights
  12. Time ­ $wgAutoConfirmAge Edit count ­ $wgAutoConfirmCount After passing both,

    User automatically graduates to Autoconfirmed (On Wikipedia thought to be ~ 4 days) Autoconfirmed?
  13. Massively simplify user JS/CSS sharing: no more copying user subpages

    MediaWiki:Gadgets­definition ­> New Preferences tab JS/CSS Gadgets Extension:Gadgets
  14. Gadget rec: HotCat Instead of this: [[Category:Melbourne Cricket Ground]] Try

    this: http://commons.wikimedia.org/wiki/ MediaWiki:Gadget­HotCat.js
  15. (This is not really recommended...) Use it to make different

    versions of special pages, eg upload form Uselang parameter overrides user language prefs Special:Upload?uselang=fr – I can see the French version of the form without changing my prefs “Uselang” hack http://commons.wikimedia.org/wiki/ Commons:Redesigning_the_upload_form
  16. What if I make a link to Special:Upload?uselang=blah ? For

    each message 'Foo', MW checks • MediaWiki:Foo/blah (localised message) • MediaWiki:Foo (localised default wiki lang message) • MessagesBlah.php file (MW defaults) “Uselang” hack http://commons.wikimedia.org/wiki/ Commons:Redesigning_the_upload_form
  17. • http://mediawiki.org is half­decent now • Still lots of info

    on http://meta.wikimedia.org/ • IRC is popular: irc://irc.freenode.net/mediawiki • MLs: mediawiki-l • Forum: http://mwusers.com/ (unofficial) Support
  18. Questions? Brianna Laugher [email protected] These slides are dual­licensed GFDL1.2+, CC­BY­SA­3.0.

    Screenshots are GFDL/GPL, WMF logo is all rights reserved, MediaWiki logo is public domain. Thankyou! http://brianna.modernthings.org/