mediawiki

How do I find out how many edits a user has for my MediaWiki extension?

依然范特西╮ 提交于 2019-12-13 08:56:27
问题 I'm writing an extension that will allow me to add the magic words: CURRENTUSER , CURRENTUSERREALNAME , CURRENTUSERLANGABBR , CURRENTUSERGROUPS , and now I want to add CURRENTUSEREDITCOUNT and CURRENTUSEREDITCOUNTALL . That section of my code is currently: function wfGetCustomVariable(&$parser,&$cache,&$index,&$ret) { switch ($index) { case MAG_CURRENTUSER: $parser->disableCache(); # Mark this content as uncacheable $ret = $GLOBALS['wgUser']->getName(); break; case MAG_CURRENTUSERREALNAME:

How can I save a whole MediaWiki wiki without shell access?

╄→尐↘猪︶ㄣ 提交于 2019-12-13 08:20:55
问题 I'd like to save a whole wiki site (not Wikipedia, but a smaller wiki), with all of its text and media. I'm using a Windows system. I'd prefer the simplest solution. 回答1: Use dumpgenerator.py from WikiTeam e.g. to save complete XML histories and images: python dumpgenerator.py http://wiki.domain.org --xml --images 来源: https://stackoverflow.com/questions/49305470/how-can-i-save-a-whole-mediawiki-wiki-without-shell-access

Implementing filterable table script in mediawiki?

梦想的初衷 提交于 2019-12-13 07:52:16
问题 This person has managed to integrate a script (from here http://www.javascripttoolbox.com/lib/table/documentation.php) into their mediawiki. See: http://offene-naturfuehrer.de/web/Kategorie:Filtertabellen I don't understand how they've done it! The original script to create filterable tables is linked to on that page. Yet I have no idea how they've utilized it as they've not called it in the header.. I really want to use a filterable table like this in my mediawiki site. What do I do?! 回答1:

Creating a force directional visualisation of how pages link to each other in a mediawki installation

删除回忆录丶 提交于 2019-12-13 06:26:19
问题 I have a MediaWiki installation, and I would like to create a force-directional style visualisation of which pages connect to each other. The MediaWiki installation is not very big, under about 100 pages. Any ideas on where to start? I would, ideally, not like to use JQuery. I did a Google search, but I do not really have a clue of what to do first. If anyone could point me in the right direction, then it is much appreciated. 回答1: Like this one ? D3.js is a great library to work with 来源:

How to login programmatically to mediawiki website

荒凉一梦 提交于 2019-12-13 05:11:18
问题 Hello There is a website built with MW 1.18.2, which requires users to log in - without this you cannot access any page in it. I have valid credentials to log in manually from browser, but I need to be able to do the same from my windows forms application (C#): when user clicks on a button I have to show (or navigate to) certain page from the website, and for that I have to login programmatically first. I have found the examples in PHP and JScript but being newbie in that web staff I have no

Mediawiki API - limit search (srsearch) to particular category

人盡茶涼 提交于 2019-12-13 04:47:54
问题 Is there a way to limit Mediawiki's srsearch facility to a particular category? For example is it possible to restrict the below search /w/api.php?action=query&list=search&format=json&srsearch=relativity to the Category:Alert_Einstein category? 回答1: Depends on what search engine you are using. CirrusSearch, for example, can do that with the incategory: keyword. 来源: https://stackoverflow.com/questions/34387550/mediawiki-api-limit-search-srsearch-to-particular-category

Get depictions from Wikimedia Commons

巧了我就是萌 提交于 2019-12-13 04:26:45
问题 Wikimedia Commons has a new feature to describe what a picture depicts. Example: Question How to get the "depicts" of a given image, as JSON, using either a wikimedia-android-data-client library call or a REST HTTP request? 回答1: You can use some of the Wikibase APIs (exactly which or how is not well-documented at the moment, I think). E.g. https://commons.wikimedia.org/w/api.php?action=wbgetclaims&format=jsonfm&entity=M78893847 { "claims": { "P180": [ { "mainsnak": { "snaktype": "value",

How to add an onload script for MediaWiki

淺唱寂寞╮ 提交于 2019-12-13 04:15:12
问题 I installed a mediawiki and my version is 1.21.1 , now I want to add some code when the page is onload using javascript. I have searched on the Internet and found we can put our scripts on the Common.js file, but I don't found Common.js in my wiki project. I have searched the whole directory and still did not find it. Anyone could tell me how to achieve my goal? 回答1: brightbyte's answer, which worked: Enter MediaWiki:Common.js into the search box of your wiki. It will tell you the page doesn

PHP function is not defined error and syntax error of misplaced </p> in generated HTML

断了今生、忘了曾经 提交于 2019-12-13 03:55:02
问题 To solve a tricky wiki search problem we've implemented a Javascript solution in a PHP file. Unfortunately, I have two problems. One is that the function is not being called and secondly I see a syntax error in the Error Console that I cannot solve. First, here is the code within the PHP file: $htmlOut .= <<<ENDOFBLOCK <script language="javascript"> function appendAndSubmit(){ var platform1 = document.getElementById( 'p1').checked; var platform2 = document.getElementById( 'p2').checked; var

Adding meeting action points in MediaWiki and viewing them in another page

点点圈 提交于 2019-12-13 03:47:33
问题 In the minutes of a meeting we want to be able to place action points in the text. Then we want easily to be able to print a list of action points, e.g. via another page. So the minutes will be: blah blah blah #AP1 ... blah blah blah #AP2... blah And then we want a list like this: #AP1 #AP2 How would we do this? Is there e.g. a solution with templates or an extension? 回答1: You can do it without an extension, though the syntax is a bit verbose - probably can simplified further for ease of note