Created page with '{{stub}} '''MediaWiki''' is the software that powers websites like Wikipedia and, more modestly, various wikis that we run or where we collaborate. Unless you care abou…' |
|||
| (22 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= MediaWiki = | |||
'''MediaWiki''' is the software from the [https://wikimediafoundation.org/our-work/mediawiki/ MediaWiki foundation] that powers websites like [[Wikipedia]] or [[laussy.org]], as well as other various [[wiki]]s that we run or where we collaborate. | |||
Unless you care about the underlying technical details, there is little to know about MediaWiki besidesthe pun on ''media'' and ''wiki'' to make up the names of both the organization and its product. If you care about the software, read on. | |||
This page is ''not'' about the [[wiki]] itself, which is the language to feed MediaWiki with. | |||
== Principle == | |||
This is a long process that dispatch data back and forth from the [[database]] and format the output to the screen. | |||
Mediawiki, the software that organizes the data and arrange its transformation into [[HTML]], distributes its content into different ''namespaces''. The main content is in the ''Main'' namespace which ha no prefix. On most [[Wiki]]s, you have the User: and the Talk: namespaces. | |||
This is an example of a database querry for [[BlogTitles]]: | |||
<syntaxhighlight lang="sql"> | |||
SELECT p.page_id, p.page_title, wp.wlp_title, wp.wlp_updated, wp.wlp_authors | |||
FROM page p | |||
JOIN wikilog_posts wp ON p.page_id = wp.wlp_page | |||
WHERE p.page_namespace = 100 | |||
AND wp.wlp_authors LIKE '%Fabrice%' | |||
ORDER BY wp.wlp_updated DESC | |||
LIMIT 50; | |||
+---------+-----------------------------------------+---------------------------------+----------------+--------------------------+ | |||
| page_id | page_title | wlp_title | wlp_updated | wlp_authors | | |||
+---------+-----------------------------------------+---------------------------------+----------------+--------------------------+ | |||
| 17627 | Sotito's_Garden/The_ideal_garden | The ideal garden | 20250330133252 | a:1:{s:7:"Fabrice";i:2;} | | |||
| 18328 | Fabrice/Brooding_from_the_Cyclades | Brooding from the Cyclades | 20250301151028 | a:1:{s:7:"Fabrice";i:2;} | | |||
| 17653 | Fabrice/828_days_into_the_3rd_World_War | 828 days into the 3rd World War | 20250301151018 | a:1:{s:7:"Fabrice";i:2;} | | |||
| 17584 | Fabrice/Two_years_of_war_in_Ukraine | Two years of war in Ukraine | 20250301151007 | a:1:{s:7:"Fabrice";i:2;} | | |||
| 16855 | Fabrice/Napoleon,_Hitler,_Prigozhin | Napoleon, Hitler, Prigozhin | 20250301150957 | a:1:{s:7:"Fabrice";i:2;} | | |||
+---------+-----------------------------------------+---------------------------------+----------------+--------------------------+ | |||
</syntaxhighlight> | |||
{{stub}} | {{stub}} | ||
== Problems and Solutions == | |||
=== Double Redirects === | |||
A double redirect is when you redirect (refer to) a page which itself redirects to another. In that case, to avoid infinite loops, the user typically gets confronted with the annoying . The pages can be identified through the [[Special:DoubleRedirects]] and (even worse case) [[Special:BrokenRedirects]] pages. This can be fixed, e.g., Page A → Page B → Page C should be such that Page A → Page C, so that no unnecessary transit by Page B is necessary. This can be done by hand, or if there are many, it can be automatized by setting <tt>$wgFixDoubleRedirects</tt> to true. You may have to run <tt>php maintenance/runJobs.php</tt> yourself. | |||
= | == Extension(s) == | ||
=== Installation === | |||
Downloading from [https://www.mediawiki.org/wiki/Manual:Extensions MediaWiki's Extensions web] and following the instruction is the basic way. More convenient is: | |||
<pre> | |||
cd extensions/ | |||
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/YouTube | |||
</pre> | |||
Then check the version: | |||
<pre> | |||
cd YouTube | |||
git tab | |||
</pre> | |||
Look for a tag like <tt>REL1_43</tt>, and if present: | |||
<pre> | |||
git checkout REL1_43 | |||
</pre> | |||
And then add in <tt>LocalSettings.php</tt> the link to new functionalities: <tt>wfLoadExtension( 'YouTube' );</tt> | |||
=== Mainstream Extensions === | |||
* [[MediaWiki's Google maps]] to implement [[Google maps]]. | |||
* [[Blog:Hacks/mp3_files_in_mediawiki_without_flash|mp3 player]] with [[html]]5. | |||
* [[Blog:Notes/Mediawiki_Extension_News|News]] to announce noteworthy changes in our [[news]]. | |||
=== My Extensions === | |||
* [[wz]]: Walter Zorn's tooltips for MediaWiki. | |||
* [[BlogTitles]]: My revival of [https://www.mediawiki.org/wiki/Extension:Wikilog Wikilog] for recent versions (1.43 in my case) of MediaWiki. | |||
== Tuning and hacks == | |||
* [[Blog:Hacks/A_simple_way_to_quote_from_bibTeX_in_MediaWiki|A simple way to quote from bibTeX in MediaWiki]]. | |||
* [[Blog:Hacks/Starting_a_counter_in_mediawiki_without_extension|Starting a counter in mediawiki without extension]]. | |||
== To try == | |||
* ImageMap [http://www.mediawiki.org/wiki/Imagemap] (to integrate with [[wz]]). | |||
* pdfhandler [http://www.mediawiki.org/wiki/Extension:PdfHandler] to display our papers. | |||
* Slideshare to display our presentations. | |||
== To do == | |||
* Better audio player with jQuery, e.g., https://jplayer.org/latest/demo-07/. | |||
= See also = | == See also == | ||
* [[MediaWiki tips and tricks|Tips and tricks]] | * [[MediaWiki tips and tricks|Tips and tricks]] | ||
* [[MediaWiki troubleshoots and problems|Troubleshoots and problems]] | |||
* [[MediaWiki templates|Our templates]] | |||
= Links = | == Links == | ||
* http://www.mediawiki.org | * http://www.mediawiki.org | ||
MediaWiki is the software from the MediaWiki foundation that powers websites like Wikipedia or laussy.org, as well as other various wikis that we run or where we collaborate.
Unless you care about the underlying technical details, there is little to know about MediaWiki besidesthe pun on media and wiki to make up the names of both the organization and its product. If you care about the software, read on.
This page is not about the wiki itself, which is the language to feed MediaWiki with.
This is a long process that dispatch data back and forth from the database and format the output to the screen.
Mediawiki, the software that organizes the data and arrange its transformation into HTML, distributes its content into different namespaces. The main content is in the Main namespace which ha no prefix. On most Wikis, you have the User: and the Talk: namespaces.
This is an example of a database querry for BlogTitles:
SELECT p.page_id, p.page_title, wp.wlp_title, wp.wlp_updated, wp.wlp_authors
FROM page p
JOIN wikilog_posts wp ON p.page_id = wp.wlp_page
WHERE p.page_namespace = 100
AND wp.wlp_authors LIKE '%Fabrice%'
ORDER BY wp.wlp_updated DESC
LIMIT 50;
+---------+-----------------------------------------+---------------------------------+----------------+--------------------------+
| page_id | page_title | wlp_title | wlp_updated | wlp_authors |
+---------+-----------------------------------------+---------------------------------+----------------+--------------------------+
| 17627 | Sotito's_Garden/The_ideal_garden | The ideal garden | 20250330133252 | a:1:{s:7:"Fabrice";i:2;} |
| 18328 | Fabrice/Brooding_from_the_Cyclades | Brooding from the Cyclades | 20250301151028 | a:1:{s:7:"Fabrice";i:2;} |
| 17653 | Fabrice/828_days_into_the_3rd_World_War | 828 days into the 3rd World War | 20250301151018 | a:1:{s:7:"Fabrice";i:2;} |
| 17584 | Fabrice/Two_years_of_war_in_Ukraine | Two years of war in Ukraine | 20250301151007 | a:1:{s:7:"Fabrice";i:2;} |
| 16855 | Fabrice/Napoleon,_Hitler,_Prigozhin | Napoleon, Hitler, Prigozhin | 20250301150957 | a:1:{s:7:"Fabrice";i:2;} |
+---------+-----------------------------------------+---------------------------------+----------------+--------------------------+
This page is still largely in progress.
A double redirect is when you redirect (refer to) a page which itself redirects to another. In that case, to avoid infinite loops, the user typically gets confronted with the annoying . The pages can be identified through the Special:DoubleRedirects and (even worse case) Special:BrokenRedirects pages. This can be fixed, e.g., Page A → Page B → Page C should be such that Page A → Page C, so that no unnecessary transit by Page B is necessary. This can be done by hand, or if there are many, it can be automatized by setting $wgFixDoubleRedirects to true. You may have to run php maintenance/runJobs.php yourself.
Downloading from MediaWiki's Extensions web and following the instruction is the basic way. More convenient is:
cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/YouTube
Then check the version:
cd YouTube git tab
Look for a tag like REL1_43, and if present:
git checkout REL1_43
And then add in LocalSettings.php the link to new functionalities: wfLoadExtension( 'YouTube' );