mediawiki

How to check if user is Sysop using Php in Mediawiki?

我的未来我决定 提交于 2019-12-20 01:45:13
问题 I am trying to add a div to my sidebar and I only want this block to show to administrators. How can I check if a user is an administrator in php? I am trying to add this to myskin.php file and dont know how to do it. I have been using something like this to check if a user is logged in, <?php if($this->data['loggedin']) { ?> Is there anything similar to that to check if that user is a sysop? 回答1: The code in the answer by *blackops_programmer* checks whether the user can protect pages. Per

How to redirect Mediawiki Short URL with no title to Main Page?

戏子无情 提交于 2019-12-19 11:46:11
问题 I've implemented Short URL for my mediawiki and I have these in htaccess that works: RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d RewriteRule ^/?w/images/thumb

Adding CSS or JS file to MediaWiki?

梦想与她 提交于 2019-12-19 02:32:28
问题 I've been following some tutorials at mediawiki.org but I didn't make it. I need to add a new CSS or JS code to be available in all my wiki (basically be cause I need to add some div tags). Can you guys help me? Appreciate that. 回答1: You can edit the CSS or JS files used by your wiki at the page names: MediaWiki:Common.css MediaWiki:Common.js For instance, here is the Common.css used by Wikipedia. There are also similar pages used for specific themes. For instance, if your wiki is using the

Wikimedia Commons API search images by (latitude, longitude)

随声附和 提交于 2019-12-18 08:18:13
问题 I would like to retrieve images from Wikimedia Commons to display on a map. This means that given a pair (latitude, longitude) I would like to find pictures around this point. After a day of searching and trying I have still no idea whether this is possible or not. In particular I have read MediaWiki API Main page, the API reference and some examples. So my question is: is it possible to retrieve pictures with a pair of geographical coordinates? If yes, how? 回答1: Yeah, that's possible. On

Open-source parser code for Mediawiki markup [closed]

旧巷老猫 提交于 2019-12-18 05:56:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm interested in selectively parsing Mediawiki XML markup to generate a customized HTML page that's some subset of the HTML produced by the actual PHP Mediawiki render engine. I want it for BzReader, an offline Mediawiki compressed dump reader written in C#. So a C# parser would be ideal, but any good code

Embedding Recent Changes on Main Page on MediaWiki

梦想与她 提交于 2019-12-18 05:52:44
问题 I am a complete and total newbie with MediaWiki. I would like to find a way to include Recent Changes directly on the Main Page, without having to have the user navigate to the recent changes page. What are my options for this? Thanks! 回答1: One way would be to put {{Special:RecentChanges}} in [[Main_Page]]. 回答2: The News extension (available at http://www.mediawiki.org/wiki/Extension:News ) is a way to do this very simply, and can be customized so that the entire recent changes page is not

Embedding Recent Changes on Main Page on MediaWiki

泄露秘密 提交于 2019-12-18 05:52:24
问题 I am a complete and total newbie with MediaWiki. I would like to find a way to include Recent Changes directly on the Main Page, without having to have the user navigate to the recent changes page. What are my options for this? Thanks! 回答1: One way would be to put {{Special:RecentChanges}} in [[Main_Page]]. 回答2: The News extension (available at http://www.mediawiki.org/wiki/Extension:News ) is a way to do this very simply, and can be customized so that the entire recent changes page is not

MediaWiki authentication with credentials of a Windows domain

人走茶凉 提交于 2019-12-17 21:37:17
问题 I wish to create a wiki page for internal use within my company. Ideally, I would like it to verify logins against our company windows domain, so that the user does not have to create a new account specifically for the wiki in order to to access it. So, users currently log into a domain when they log into their computer in work in the morning. I want to use these credentials in my webpage to verify that the user should be allowed to edit the page ? I want the users login to be maintained so

How to retrieve data from Wikipedia API using JSON?

 ̄綄美尐妖づ 提交于 2019-12-17 19:47:07
问题 Here I am fetching the data from Wikipedia using following code. but it is not working for me. var playListURL = 'http://en.wikipedia.org/w/api.php?format=json&action=query&titles=India&prop=revisions&rvprop=content&callback=?'; $.getJSON(playListURL ,function(data) { $.each(data.pages, function(i, item) { alert(i); }); }); DEMO LINK :- http://jsfiddle.net/rushijogle/dyeqy/ 回答1: Use the following code to get the data: $.getJSON(playListURL ,function(data) { $.each(data.query.pages, function(i

How to parse Wikipedia XML with PHP?

走远了吗. 提交于 2019-12-17 19:29:46
问题 How to parse Wikipedia XML with PHP? I tried it with simplepie, but I got nothing. Here is a link which I want to get its data. http://en.wikipedia.org/w/api.php?action=query&generator=allpages&gaplimit=2&gapfilterredir=nonredirects&gapfrom=Re&prop=revisions&rvprop=content&format=xml Edit code: <?php define("EMAIL_ADDRESS", "youlichika@hotmail.com"); $ch = curl_init(); $cv = curl_version(); $user_agent = "curl ${cv['version']} (${cv['host']}) libcurl/${cv['version']} ${cv['ssl_version']} zlib