MediaWiki: Unterschied zwischen den Versionen

Aus crazylinux.de
Zur Navigation springen Zur Suche springen
(typo)
(update to 1.23)
 
(34 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
MediaWiki ist ein freies Wiki-Softwarepaket, welches für die Wikipedia geschrieben worden ist. Es wird als Grundlage der Non-Profit-Organisation der Wikimedia Foundation und viele andere Wikis genutzt, einschließlich dieser Webseite.
MediaWiki ist ein freies Wiki-Softwarepaket, welches für die Wikipedia geschrieben worden ist. Es wird als Grundlage der Non-Profit-Organisation der Wikimedia Foundation und viele andere Wikis genutzt, einschließlich dieser Webseite.  


http://www.mediawiki.org/
http://www.mediawiki.org/  


Folgende Erweiterungen bzw. Konfixx waren/sind relevant:
Folgende Erweiterungen bzw. Konfixx waren/sind relevant:  
=Konfiguration=
==404/Seite existiert nicht==
Ist ein Systemtext: [https://crazylinux.de/index.php?title=MediaWiki:Noarticletext&action=edit MediaWiki:Noarticletext]


<pre>
= Konfiguration  =
Diese Seite enthält momentan noch keinen Text, aber du kannst nach dem Seitentitel [[{{ns:special}}:Search/{{PAGENAME}}|suchen]] oder
diese Seite [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} bearbeiten].
</pre>


siehe auch http://bugzilla.wikimedia.org/show_bug.cgi?id=2585
== 404/Seite existiert nicht  ==


==Enabling subpages for a namespace==
Ist ein Systemtext: [https://crazylinux.de/index.php?title=MediaWiki:Noarticletext&action=edit MediaWiki:Noarticletext]
An easy way to enable subpages for a given namespace is to edit the LocalSettings.php and insert the following:
<source lang="php">Diese Seite enthält momentan noch keinen Text. Du kannst sie <span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} bearbeiten]</span>, ihren Titel auf anderen Seiten [[Special:Search/{{PAGENAME}}|suchen]] oder die zugehörigen <span class="plainlinks">[{{fullurl:{{#special:Log}}|page={{FULLPAGENAMEE}}}} Logbücher betrachten]</span>.
</source>
 
== Enabling subpages for a namespace ==
 
An easy way to enable subpages for a given namespace is to edit the LocalSettings.php and insert the following:  


<source lang="php">
<source lang="php">
Zeile 23: Zeile 22:
$wgNamespacesWithSubpages[NS_MAIN] = true;
$wgNamespacesWithSubpages[NS_MAIN] = true;
</source>
</source>
http://www.mediawiki.org/wiki/Manual:%24wgNamespacesWithSubpages
http://www.mediawiki.org/wiki/Manual:%24wgNamespacesWithSubpages


==Navigation==
== Navigation ==
http://meta.wikimedia.org/wiki/Help:Navigation_bar<br/>
 
[[MediaWiki:Sidebar]]
http://meta.wikimedia.org/wiki/Help:Navigation_bar<br> [[MediaWiki:Sidebar]]  
 
== Eliminating index.php from the url  ==


==Eliminating index.php from the url==
Das Wiki läuft direkt unter http://crazylinux.de/. Artikel sind damit unter /, also z.b. http://crazylinux.de/Apache2, erreichbar.<br> http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url  
Das Wiki läuft direkt unter http://crazylinux.de/. Artikel sind damit unter /, also z.b. http://crazylinux.de/Apache2, erreichbar.<br/>
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url


<source lang="php">
<source lang="php">
Zeile 38: Zeile 38:
## If using PHP as a CGI module, the ?title= style usually must be used.
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath      = "/$1";
$wgArticlePath      = "/$1";
</source>
</source>  
 
Zusätzlich muss noch [[Apache2|mod_rewrite]] aktiviert werden. Leider funktioniert die Regeln nicht in der .htaccess, deshalb müssen diese in die Apache-Conf


Zusätzlich muss noch [[Apache2|mod_rewrite]] aktiviert werden. Leider funktioniert die Regeln nicht in der .htaccess, deshalb müssen diese in die Apache-Conf
<source lang="apache">
<source lang="apache">
#/etc/apache2/sites-enabled/mysite.de
#/etc/apache2/sites-enabled/mysite.de
RewriteEngine on
RewriteEngine on
#forward old wiki-url to new one
RewriteRule ^/wiki/(.*)$        http://crazylinux.de/$1 [R=301,L]


# forbid bots to spider pages with certain urls that are forbidden in robots.txt anyway.
# forbid bots to spider pages with certain urls that are forbidden in robots.txt anyway.
Zeile 52: Zeile 50:
RewriteRule ^/index.php?.*$ /Hauptseite [L,QSA,gone]
RewriteRule ^/index.php?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
#allow all-pages
RewriteCond %{REQUEST_URI} !^/Spezial:Alle_Seiten
RewriteCond %{REQUEST_URI} !^/Spezial:Alle_Seiten
RewriteRule ^/(Spezial):.*?.*$ /Hauptseite [L,QSA,gone]
RewriteRule ^/(MediaWiki|Mediawiki|Spezial):.*?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{QUERY_STRING} !^$
RewriteCond %{QUERY_STRING} !^$
Zeile 65: Zeile 62:
# Don't rewrite requests for files in MediaWiki subdirectories,
# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/(images|skins|cgi-bin|extensions)/
RewriteCond %{REQUEST_URI} !^/(images|skins|cgi-bin|config|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
Zeile 71: Zeile 68:
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/opensearch_desc.php
RewriteCond %{REQUEST_URI} !^/opensearch_desc.php
RewriteCond %{REQUEST_URI} !^/profileinfo.php
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} !^/api.php
RewriteCond %{REQUEST_URI} !^/api.php
#RewriteCond %{REQUEST_URI} !^/mw-config
RewriteCond %{REQUEST_URI} !^/load.php
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]
</source>


==File Upload==
RewriteRule ^/index.php http://crazylinux.de/Hauptseite [L,QSA]</source>
 
== File Upload ==
 
<source lang="php">
<source lang="php">
#LocalSettings.php
#LocalSettings.php
$wgEnableUploads = true; // Enable uploads
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads               = true;
$wgCheckFileExtensions = false;
$wgCheckFileExtensions = false;
$wgStrictFileExtensions = false;
$wgStrictFileExtensions = false;
// Add several file types to the default array
$wgFileExtensions = array_merge( $wgFileExtensions, array( 'pdf', 'ppt','htm','zip','.zip' ) );
$wgAllowCopyUploads = true;
$wgUseImageResize              = true;
#$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
#do not do that!!
$wgVerifyMimeType = false;
</source>
</source>
http://www.mediawiki.org/wiki/Configuring_file_uploads
http://www.mediawiki.org/wiki/Configuring_file_uploads


==No Anonymous==
== No Anonymous ==
 
<source lang="php">
<source lang="php">
#LocalSettings.php
#LocalSettings.php
Zeile 103: Zeile 122:
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = false;
$wgGroupPermissions['*'    ]['edit']            = false;
</source>
</source>  
 
Desweiteren sollten natürlich die 'Actions' ausgeblendet werden: http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_remove_the_article.2Fedit_etc_tabs_for_users_who_are_not_logged_in.3F


Desweiteren sollten natürlich die 'Actions' ausgeblendet werden:
== Überschriften nummerieren/numberheadings  ==
http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_remove_the_article.2Fedit_etc_tabs_for_users_who_are_not_logged_in.3F


==Überschriften nummerieren/numberheadings==
<source lang="php">
<source lang="php">
#LocalSettings.php
#LocalSettings.php
$wgDefaultUserOptions['numberheadings'] = 1;
$wgDefaultUserOptions['numberheadings'] = 1;
</source>
== Config-Übersicht  ==
http://www.mediawiki.org/wiki/Manual:Configuration_settings
== How do I add more buttons on the edit page?  ==
For adding more toolbar buttons above the edit field, you can use JavaScript code to register them in your [[MediaWiki:common.js]]. For example, a button for source code:
<source lang="javascript">
var customizeToolbar = function() {
        /* Your code goes here */
$('#wpTextbox1').wikiEditor('addToToolbar', {
                section: 'advanced',
                group: 'format',
                tools: {
                        buttonId: {
                                label: 'Highlight SourceCode',
                                type: 'button',
                                icon: '/skins/common/images/button_image.png',
                                action: {
                                        type: 'encapsulate',
                                        options: {
                                                pre: "<syntaxhighlight lang=\"php\">",
                                                peri: "<?php\n\n?>",
                                                post: "</syntaxhighlight>"
                                        }
                                }
                        }
                }
});
};
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
        mw.loader.using( 'user.options', function () {
                if ( mw.user.options.get('usebetatoolbar') ) {
                        mw.loader.using( 'ext.wikiEditor.toolbar', function () {
                                $(document).ready( customizeToolbar );
                        } );
                }
        }
);}
</source>
</source>
==Farmer - (Multisite) Mediawiki farm==
http://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
http://www.mediawiki.org/wiki/User:IndyGreg/Farmer


==Dublin Core==
== Robots.txt  ==
<source lang="php">
 
#LocalSettings.php
http://www.mediawiki.org/wiki/Robots.txt
$wgEnableDublinCoreRdf = true;
 
</source>
= Extensions  =
 
== Auth_RemoteUser<br>  ==
 
Automatic REMOTE_USER Authentication extension automatically logs users using the REMOTE_USER environment variable. Probably you have to replace REMOTE_USER with PHP_AUTH_USER!<br>
 
apache.conf
 
<source lang="apache"><Location ~ "Spezial:Anmelden">
                #Turn on IMAP Authentication                       
                Auth_IMAP_Enabled on                               
                AuthUserFile /dev/null                             
 
                #AllowOverride none
                AuthBasicAuthoritative off
                AuthType Basic           
                AuthName Wiki-Login             
                Auth_IMAP_Authoritative on
 
                #Set the IMAP Server to which you want to connect (default=localhost):
                Auth_IMAP_Server localhost
 
                #Set the port on which the imap server is running (default=143):
                Auth_IMAP_Port 143
 
                #Turn on some extra logging (login attempts, etc.) in Apache's Error Log
                Auth_IMAP_Log off
 
                require valid-user
      </Location></source>  
 
http://www.mediawiki.org/wiki/Extension:AutomaticREMOTE_USER<br>
 
<br>
 
== Extension:SelectCategory  ==
 
The SelectCategory extension provides three functions:


==Config-Übersicht==
*It shows a list of all categories (unless a custom root category is configured) in their hierarchical structure on the edit page.
http://www.mediawiki.org/wiki/Manual:Configuration_settings
*It strips all categories linked within a page upon editing and selects them in the category list list.  
*It adds selected categories from the list to the text body of the page on saving.


http://www.mediawiki.org/wiki/Extension:SelectCategory


=Extensions=
== Syntax-Highlighting  ==
==Extension:SelectCategory==
The SelectCategory extension provides three functions:


* It shows a list of all categories (unless a custom root category is configured) in their hierarchical structure on the edit page.
This extension adds the source tag to present formatted source code.<br> http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
* It strips all categories linked within a page upon editing and selects them in the category list list.
* It adds selected categories from the list to the text body of the page on saving.


http://www.mediawiki.org/wiki/Extension:SelectCategory
== Last Updates (News)  ==


==Syntax-Highlighting==
http://www.mediawiki.org/wiki/Extension:News
This extension adds the source tag to present formatted source code.<br/>
http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi


==Last Updates (News)==
broken with 1.12.0, but quick&amp;dirty patch is available. It will use the old Parser-Class. Line $html="&lt;fieldset..."; is optional.  
http://www.mediawiki.org/wiki/Extension:News


broken with 1.12.0, see quick&dirty patch. It will use the old Parser-Class. Line $html="<fieldset..."; is optional.
/www/htdocs/wiki/extensions/News$ diff NewsRenderer.php.orig NewsRenderer.php


/www/htdocs/wiki/extensions/News$ diff NewsRenderer.php.orig NewsRenderer.php
<br> <source lang="diff">
<source lang="diff">
86a87
86a87
>              $parser = new Parser_oldPP;
>              $parser = new Parser_oldPP;
Zeile 159: Zeile 253:
>                      #$text .= $this->postfix;
>                      #$text .= $this->postfix;
>                      $html = $output->getText();
>                      $html = $output->getText();
>                      #$html = $this->templateparser->recursiveTagParse( $text, $wgTitle,  $this->templateoptions, true );
>                      #$html = $this->templateparser->recursiveTagParse( $text );
345a349
345a349
>              $html = "<fieldset class=\"special\"><legend>&Auml;nderungen</legend>". $html."</fieldset>";
>              $html = "<fieldset class=\"special\"><legend>&Auml;nderungen</legend>". $html."</fieldset>";
550a555
550a555
>                      $this->templateparser->mOptions = $this->templateoptions;
>                      $this->templateparser->mOptions = $this->templateoptions;
</source>
</source>  
 
to apply the patch save the diff as NewsRenderer.php.patch and execute


to apply the patch save the diff as NewsRenderer.php.patch and execute
  patch NewsRenderer.php &lt;NewsRenderer.php.patch
  patch NewsRenderer.php <NewsRenderer.php.patch


1 of 5 patches will not apply (don't know the reason), so you have to edit NewsRenderer.php manually. See line 337
'''&lt;fixed&gt;'''1 of 5 patches will not apply (don't know the reason), so you have to edit NewsRenderer.php manually. See line 337'''&lt;/fixed&gt;'''


==TagCloud==
== TagCloud ==
This module is intended to provide a tag cloud control for mediawiki. Each tag represents a mediawiki category, the size of the tag being determined by the number of articles on that category.<br/>
The WikiCategoryTagCloud extension allows to add tag clouds based on categories to a page.
http://www.orangedino.org/index.php?name=News&file=article&sid=1<br/>
https://www.mediawiki.org/wiki/Extension:WikiCategoryTagCloud
Download the zip archive and unarchive it. Copy the "tag_cloud.php" file to the "extension" folder in your wiki.


<source lang="php">
<source lang="php">
#LocalSettings.php
#LocalSettings.php
require_once("extensions/tag_cloud.php");
require_once "$IP/extensions/WikiCategoryTagCloud/WikiCategoryTagCloud.php";
</source>
</source>  


'''Define the pages where you are going to add the tag cloud:'''<br/>
'''Define the pages where you are going to add the tag cloud:'''<br> Edit the wiki page "[https://crazylinux.de/MediaWiki:Tagcloudpages MediaWiki:Tagcloudpages]". Put one this page all the pages where you have included your tag, one page per line.  
Edit the wiki page "[https://crazylinux.de/MediaWiki:Tagcloudpages MediaWiki:Tagcloudpages]". Put one this page all the pages where you have included your tag, one page per line.
<pre>
Hauptseite
</pre>


'''Add the CSS:'''<br/>
<pre>Hauptseite</pre>  
You should include this code into your "[https://crazylinux.de/MediaWiki:Common.css MediaWiki:Common.css]" to get the default styles. After that you can freely tweak it:
<source lang="css">
.tagcloud {
width: 98%;
text-align: center;
background-color: #FDFDFD;
border: 1px solid #EEEEEE;
padding: 15px 10px 15px 10px;
}
.tagcloud a {
color: #0052CB;
margin-left: 10px;
margin-right: 10px;
font-weight: bold;
}
</source>


'''Usage:'''<br/>
The simple way to display the cloud is to add in a page :
<pre>
<tagcloud>
</tagcloud>
</pre>


==Sitemap (Google)==
'''Usage:'''<br> The simple way to display the cloud is to add in a page&nbsp;:
http://www.mediawiki.org/wiki/Extension:Google_Sitemap
<syntaxhighlight lang="php"><tagcloud class="" linkclass="" style="border: 0px solid rgb(238, 238, 238); padding: 15px 10px; width: 98%; text-align: center;" linkstyle="font-weight:bold;">
min_size=100
increase_factor=200</tagcloud></syntaxhighlight>


== Sitemap (Google)  ==
Note: Since MediaWiki 1.6, the MediaWiki core has a Google site map generator which may be more appropriate than this extension. It is a command-line utility, and it is located at maintenance/generateSitemap.php in your MediaWiki directory. The command line is "php generatesitemap.php sitename" and is run from the maintenance directory at the server's command line interface.
Note: Since MediaWiki 1.6, the MediaWiki core has a Google site map generator which may be more appropriate than this extension. It is a command-line utility, and it is located at maintenance/generateSitemap.php in your MediaWiki directory. The command line is "php generatesitemap.php sitename" and is run from the maintenance directory at the server's command line interface.


==Top10-Pages==
https://www.mediawiki.org/wiki/Manual:GenerateSitemap.php
http://www.mediawiki.org/wiki/Extension:TopTenPages
 
 
<syntaxhighlight lang="php">$wgSitemapNamespaces = array( 0);</syntaxhighlight>
 
== Top10-Pages ==
 
http://www.mediawiki.org/wiki/Extension:TopTenPages  
<syntaxhighlight lang="php">$wgttpAlwaysStartAtOne = true;</syntaxhighlight>
 


<source lang="php">
<source lang="php">
                        if ( ! $this->listoutput )
#function efTopTenPagesRender
                                #$s[] = "<ol start='" . ( $offset == 0 ? $offset + 1 : $offset ) . "' class='special'>";
                      return "<fieldset><legend>Top 10</legend>".$parser->recursiveTagParse( "{{Special:TopTenPages/$offset/$limit}}", $frame )."</fieldset>";
                                $s[] = "<fieldset><legend>Top 10</legend><ul start='" . ( $offset == 0 ? $offset + 1 : $offset ) . "' class='special'>";
</source>


<br>


== DirList  ==


                        if ( ! $this->listoutput )
This extension lists the content of a directory in a table and creates links for downloading files.<br> http://www.mediawiki.org/wiki/Extension:DirList
                                #$s[] = '</ol>';
                                $s[] = '</ul></fieldset>';
</source>


== Extension:WikiEditor  ==
WikiEditor is an extendable framework with a set of feature-based modules that improve the user experience of editing. It is also the editing interface that Wikipedia currently uses. http://www.mediawiki.org/wiki/Extension:WikiEditor


==DirList==
<source lang="php">
This extension lists the content of a directory in a table and creates links for downloading files.<br/>
#LocalSettings.php
http://www.mediawiki.org/wiki/Extension:DirList or<br/>
# Enables use of WikiEditor by default but still allow users to disable it in preferences
http://www.mediawiki.org/wiki/Extension:FileSystemListing
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
 
# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;
# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;
# Displays a navigation column (summary) on the right side
$wgDefaultUserOptions['usenavigabletoc'] = 1;
</source>


==Restricted Page Patch==
http://conseil-recherche-innovation.net/index.php/1974/04
weitere http://www.mediawiki.org/wiki/Extension:PageSecurity


[[Kategorie:Linux]]
[[Category:Linux]] [[Category:WWW]] [[Category:HTML]] [[Category:PHP]]

Aktuelle Version vom 31. August 2014, 00:31 Uhr

MediaWiki ist ein freies Wiki-Softwarepaket, welches für die Wikipedia geschrieben worden ist. Es wird als Grundlage der Non-Profit-Organisation der Wikimedia Foundation und viele andere Wikis genutzt, einschließlich dieser Webseite.

http://www.mediawiki.org/

Folgende Erweiterungen bzw. Konfixx waren/sind relevant:

Konfiguration

404/Seite existiert nicht

Ist ein Systemtext: MediaWiki:Noarticletext

Diese Seite enthält momentan noch keinen Text. Du kannst sie <span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} bearbeiten]</span>, ihren Titel auf anderen Seiten [[Special:Search/{{PAGENAME}}|suchen]] oder die zugehörigen <span class="plainlinks">[{{fullurl:{{#special:Log}}|page={{FULLPAGENAMEE}}}} Logbücher betrachten]</span>.

Enabling subpages for a namespace

An easy way to enable subpages for a given namespace is to edit the LocalSettings.php and insert the following:

#LocalSettings.php
# Enable subpages in the main namespace
$wgNamespacesWithSubpages[NS_MAIN] = true;

http://www.mediawiki.org/wiki/Manual:%24wgNamespacesWithSubpages

Navigation

http://meta.wikimedia.org/wiki/Help:Navigation_bar
MediaWiki:Sidebar

Eliminating index.php from the url

Das Wiki läuft direkt unter http://crazylinux.de/. Artikel sind damit unter /, also z.b. http://crazylinux.de/Apache2, erreichbar.
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url

#LocalSettings.php
$wgScriptPath       = "";
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath      = "/$1";

Zusätzlich muss noch mod_rewrite aktiviert werden. Leider funktioniert die Regeln nicht in der .htaccess, deshalb müssen diese in die Apache-Conf

#/etc/apache2/sites-enabled/mysite.de
RewriteEngine on

# forbid bots to spider pages with certain urls that are forbidden in robots.txt anyway.
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteRule ^/index.php?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{REQUEST_URI} !^/Spezial:Alle_Seiten
RewriteRule ^/(MediaWiki|Mediawiki|Spezial):.*?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^/?$ /Hauptseite [L,QSA,gone]

# rules for well-behaving bots and normal browser:
RewriteCond %{REQUEST_URI} !^/files/
RewriteCond %{REQUEST_URI} !^/[i|I]cons/

# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/(images|skins|cgi-bin|config|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/(favicon.ico|sitemap.xml)
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/opensearch_desc.php
RewriteCond %{REQUEST_URI} !^/profileinfo.php
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} !^/api.php
#RewriteCond %{REQUEST_URI} !^/mw-config
RewriteCond %{REQUEST_URI} !^/load.php
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]

RewriteRule ^/index.php http://crazylinux.de/Hauptseite [L,QSA]

File Upload

#LocalSettings.php
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads                = true;
$wgCheckFileExtensions = false;
$wgStrictFileExtensions = false;

// Add several file types to the default array
$wgFileExtensions = array_merge( $wgFileExtensions, array( 'pdf', 'ppt','htm','zip','.zip' ) );

$wgAllowCopyUploads = true;
$wgUseImageResize               = true;
#$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

#do not do that!!
$wgVerifyMimeType = false;


http://www.mediawiki.org/wiki/Configuring_file_uploads

No Anonymous

#LocalSettings.php
# Permission keys given to users in each group.
# All users are implicitly in the '*' group including anonymous visitors;
# logged-in users are all implicitly in the 'user' group. These will be
# combined with the permissions of all groups that a given user is listed
# in in the user_groups table.
#
# This replaces wgWhitelistAccount and wgWhitelistEdit
#
# The following line should be commented, otherwise these settings will
# throw away the settings on DefaultSettings.php (you probably don't want this).
# With this line commented you will only overwrite the settings you explicitly
# define here (that's what you probably want).
#$wgGroupPermissions = array();
$wgGroupPermissions['*'    ]['createaccount']   = false;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = false;

Desweiteren sollten natürlich die 'Actions' ausgeblendet werden: http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_remove_the_article.2Fedit_etc_tabs_for_users_who_are_not_logged_in.3F

Überschriften nummerieren/numberheadings

#LocalSettings.php
$wgDefaultUserOptions['numberheadings'] = 1;

Config-Übersicht

http://www.mediawiki.org/wiki/Manual:Configuration_settings

How do I add more buttons on the edit page?

For adding more toolbar buttons above the edit field, you can use JavaScript code to register them in your MediaWiki:common.js. For example, a button for source code:

var customizeToolbar = function() {
        /* Your code goes here */
$('#wpTextbox1').wikiEditor('addToToolbar', {
                section: 'advanced',
                group: 'format',
                tools: {
                        buttonId: {
                                label: 'Highlight SourceCode',
                                type: 'button',
                                icon: '/skins/common/images/button_image.png',
                                action: {
                                        type: 'encapsulate',
                                        options: {
                                                pre: "<syntaxhighlight lang=\"php\">",
                                                peri: "<?php\n\n?>",
                                                post: "</syntaxhighlight>"
                                        }
                                }
                        }
                }
});
}; 

/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
        mw.loader.using( 'user.options', function () {
                if ( mw.user.options.get('usebetatoolbar') ) {
                        mw.loader.using( 'ext.wikiEditor.toolbar', function () {
                                $(document).ready( customizeToolbar );
                        } );
                }
        }
);}

http://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization

Robots.txt

http://www.mediawiki.org/wiki/Robots.txt

Extensions

Auth_RemoteUser

Automatic REMOTE_USER Authentication extension automatically logs users using the REMOTE_USER environment variable. Probably you have to replace REMOTE_USER with PHP_AUTH_USER!

apache.conf

<Location ~ "Spezial:Anmelden">
                #Turn on IMAP Authentication                        
                Auth_IMAP_Enabled on                                
                AuthUserFile /dev/null                              

                #AllowOverride none
                AuthBasicAuthoritative off
                AuthType Basic            
                AuthName Wiki-Login              
                Auth_IMAP_Authoritative on

                #Set the IMAP Server to which you want to connect (default=localhost):
                Auth_IMAP_Server localhost

                #Set the port on which the imap server is running (default=143):
                Auth_IMAP_Port 143

                #Turn on some extra logging (login attempts, etc.) in Apache's Error Log
                Auth_IMAP_Log off

                require valid-user
       </Location>

http://www.mediawiki.org/wiki/Extension:AutomaticREMOTE_USER


Extension:SelectCategory

The SelectCategory extension provides three functions:

  • It shows a list of all categories (unless a custom root category is configured) in their hierarchical structure on the edit page.
  • It strips all categories linked within a page upon editing and selects them in the category list list.
  • It adds selected categories from the list to the text body of the page on saving.

http://www.mediawiki.org/wiki/Extension:SelectCategory

Syntax-Highlighting

This extension adds the source tag to present formatted source code.
http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi

Last Updates (News)

http://www.mediawiki.org/wiki/Extension:News

broken with 1.12.0, but quick&dirty patch is available. It will use the old Parser-Class. Line $html="<fieldset..."; is optional.

/www/htdocs/wiki/extensions/News$ diff NewsRenderer.php.orig NewsRenderer.php


86a87
>               $parser = new Parser_oldPP;
107a109
>                       $this->templateparser->ClearState();
337,339c339,342
<                       #$output = $this->templateparser->parse( $text, $wgTitle, $this->templateoptions, true );
<                       $text .= $this->postfix;
<                       $html = $this->templateparser->recursiveTagParse( $text );
---
>                       $output = $this->templateparser->parse( $text, $wgTitle, $this->templateoptions, true );
>                       #$text .= $this->postfix;
>                       $html = $output->getText();
>                       #$html = $this->templateparser->recursiveTagParse( $text );
345a349
>               $html = "<fieldset class=\"special\"><legend>&Auml;nderungen</legend>". $html."</fieldset>";
550a555
>                       $this->templateparser->mOptions = $this->templateoptions;

to apply the patch save the diff as NewsRenderer.php.patch and execute

patch NewsRenderer.php <NewsRenderer.php.patch

<fixed>1 of 5 patches will not apply (don't know the reason), so you have to edit NewsRenderer.php manually. See line 337</fixed>

TagCloud

The WikiCategoryTagCloud extension allows to add tag clouds based on categories to a page. https://www.mediawiki.org/wiki/Extension:WikiCategoryTagCloud

#LocalSettings.php
require_once "$IP/extensions/WikiCategoryTagCloud/WikiCategoryTagCloud.php";

Define the pages where you are going to add the tag cloud:
Edit the wiki page "MediaWiki:Tagcloudpages". Put one this page all the pages where you have included your tag, one page per line.

Hauptseite


Usage:
The simple way to display the cloud is to add in a page :

<tagcloud class="" linkclass="" style="border: 0px solid rgb(238, 238, 238); padding: 15px 10px; width: 98%; text-align: center;" linkstyle="font-weight:bold;">
min_size=100
increase_factor=200</tagcloud>

Sitemap (Google)

Note: Since MediaWiki 1.6, the MediaWiki core has a Google site map generator which may be more appropriate than this extension. It is a command-line utility, and it is located at maintenance/generateSitemap.php in your MediaWiki directory. The command line is "php generatesitemap.php sitename" and is run from the maintenance directory at the server's command line interface.

https://www.mediawiki.org/wiki/Manual:GenerateSitemap.php


$wgSitemapNamespaces = array( 0);

Top10-Pages

http://www.mediawiki.org/wiki/Extension:TopTenPages

$wgttpAlwaysStartAtOne = true;


#function efTopTenPagesRender
                      return "<fieldset><legend>Top 10</legend>".$parser->recursiveTagParse( "{{Special:TopTenPages/$offset/$limit}}", $frame )."</fieldset>";


DirList

This extension lists the content of a directory in a table and creates links for downloading files.
http://www.mediawiki.org/wiki/Extension:DirList

Extension:WikiEditor

WikiEditor is an extendable framework with a set of feature-based modules that improve the user experience of editing. It is also the editing interface that Wikipedia currently uses. http://www.mediawiki.org/wiki/Extension:WikiEditor

#LocalSettings.php
# Enables use of WikiEditor by default but still allow users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;

# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1; 
# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1; 
# Displays a navigation column (summary) on the right side
$wgDefaultUserOptions['usenavigabletoc'] = 1;