| (42 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 6 : | Ligne 6 : | ||
: {{syntaxhighlight| lang=php|code= | : {{syntaxhighlight| lang=php|code= | ||
$wgUseImageMagick = false; | $wgUseImageMagick = false; | ||
}}<br> | |||
* Il faut aussi définir la commande correspondante $wgImageMagickConvertCommand | |||
: {{syntaxhighlight| lang=php|code= | |||
#sous Linux | |||
$wgImageMagickConvertCommand = '/usr/local/bin/convert';}} | |||
<br> | |||
: {{syntaxhighlight| lang=batch|code= | |||
REM sous Windows | |||
$wgImageMagickConvertCommand = 'C:/Program Files/ImageMagick/convert.exe'; | |||
}} | }} | ||
<br> | |||
: Voir {{MediaWikilink |link=Manual:$wgImageMagickConvertCommand/fr}} | |||
<br> | |||
== Comment autoriser les utilisateurs à créer un compte mediawiki == | == Comment autoriser les utilisateurs à créer un compte mediawiki == | ||
| Ligne 12 : | Ligne 27 : | ||
: {{syntaxhighlight| lang=php|code= | : {{syntaxhighlight| lang=php|code= | ||
$wgGroupPermissions['*']['createaccount'] = true; | $wgGroupPermissions['*']['createaccount'] = true; | ||
}} | }}<br> | ||
== Comment puis-je autoriser la téléversement de fichiers xls == | == Comment puis-je autoriser la téléversement de fichiers xls == | ||
| Ligne 18 : | Ligne 33 : | ||
* configurez '''$wgEnableUploads''' à '''true''' dans le fichier {{File|LocalSettings.php}} pour autoriser le téléversement | * configurez '''$wgEnableUploads''' à '''true''' dans le fichier {{File|LocalSettings.php}} pour autoriser le téléversement | ||
* Il faut ajouter l'extension "xls" au tableau "$wgFileExtensions" du fichier{{File|includes/DefaultSettings.php}}, <br> | * Il faut ajouter l'extension "xls" au tableau "$wgFileExtensions" du fichier {{File|includes/DefaultSettings.php}}, <br> | ||
:ou directement dans{{File|LocalSettings.php}}, et invalider la vérification des type MIME. | : ou directement dans {{File|LocalSettings.php}}, et invalider la vérification des type MIME. | ||
: {{syntaxhighlight| lang=php|code= | : {{syntaxhighlight| lang=php|code= | ||
$wgFileExtensions = array('svg','png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg'); | $wgFileExtensions = array('svg','png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg'); | ||
| Ligne 26 : | Ligne 40 : | ||
}} | }} | ||
* Penser à utiliser le namespace "Media" | * Penser à utiliser le namespace "Media" plutôt que "Image" pour les liens vers des fichiers à télécharger. | ||
<br> | <br> | ||
== Comment utiliser des SEF URLs avec Mediawiki == | == Comment utiliser des SEF URLs avec Mediawiki == | ||
* cf <favorites keyword=sef_url_mediawiki output=htmlshort /> | * cf <favorites keyword=sef_url_mediawiki output=htmlshort /> | ||
* modifier le fichier {{ | * modifier le fichier {{File| .htaccess}} de façon à rediriger l'adresse logique '''wiki''' vers l'adresse physique ex: MediaWiki | ||
:{{syntaxhighlight| lang= | : {{syntaxhighlight |lang=apache|code= | ||
# anything under /wiki is treated as an article title | # anything under /wiki is treated as an article title | ||
RewriteRule ^wiki/(.+)$ MediaWiki/index.php?title=$1 [PT,L,QSA] | RewriteRule ^wiki/(.+)$ MediaWiki/index.php?title=$1 [PT,L,QSA] | ||
| Ligne 38 : | Ligne 52 : | ||
* modifier le fichier {{ | * modifier le fichier {{File|LocalSettings.php}} | ||
:{{syntaxhighlight| lang=php|code= | : {{syntaxhighlight| lang=php|code= | ||
$wgScriptPath = "/MediaWiki"; | $wgScriptPath = "/MediaWiki"; | ||
$wgArticlePath = '/wiki/$1'; | $wgArticlePath = '/wiki/$1'; | ||
}} | }} | ||
<br> | |||
== Comment modifier l'icône "favicon" == | == Comment modifier l'icône "favicon" == | ||
* modifier le fichier {{File|LocalSettings.php}} | * modifier le fichier {{File|LocalSettings.php}} | ||
:{{syntaxhighlight| lang=php|code= | : {{syntaxhighlight| lang=php|code= | ||
$wgFavicon = "$wgScriptPath/favico.ico"; | $wgFavicon = "$wgScriptPath/favico.ico"; | ||
}} | }}<br> | ||
== Formater du code == | == Formater du code == | ||
* Ajouter l'extension {{favorites|like=:SyntaxHighlight GeSHi|output=css3treeviewshort|span=1}} | |||
:'''exemple pour php:''' | : '''exemple pour php:''' | ||
<pre> | |||
< syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
<?php | <?php | ||
$v = "string"; // sample initialization | |||
?> | ?> | ||
</ syntaxhighlight> | </syntaxhighlight> | ||
</pre> | |||
:{{syntaxhighlight|lang=php|code= | : {{syntaxhighlight|lang=php|code= | ||
<?php | <?php | ||
$v = "string"; // sample initialization | $v = "string"; // sample initialization | ||
?> | ?> | ||
}} | }} | ||
<br> | |||
* modifier le style de [[MediaWiki:Geshi.css]] | * modifier le style de [[MediaWiki:Geshi.css]] | ||
:{{syntaxhighlight| lang=css|code= | : {{syntaxhighlight| lang=css|code= | ||
div.mw-geshi { | div.mw-geshi { | ||
padding: 1em; | padding: 1em; | ||
margin: 1em 0; | margin: 1em 0; | ||
border: 1px dashed #2f6fab; | border: 1px dashed #2f6fab; | ||
}} | }}<br> | ||
== Ajouter un lien à une image == | == Ajouter un lien à une image == | ||
:{{syntaxhighlight |lang=text|code= | : {{syntaxhighlight |lang=text|code= | ||
[[Fichier:TortoiseSVNupgrade.png|link=http://jltryoen.fr]] | [[Fichier:TortoiseSVNupgrade.png|link=http://jltryoen.fr]] | ||
}} | }}<br> | ||
:[[Fichier:TortoiseSVNupgrade.png|link=http://jltryoen.fr]] | |||
: [[Fichier:TortoiseSVNupgrade.png|link=http://jltryoen.fr]] | |||
* '''Note:''' si le lien est vide on obtient une image non cliquable | * '''Note:''' si le lien est vide on obtient une image non cliquable | ||
<br> | |||
== Autoriser les images externes == | == Autoriser les images externes == | ||
* Modifier LocalSettings | * Modifier LocalSettings | ||
:{{syntaxhighlight |lang=php|code= | : {{syntaxhighlight |lang=php|code= | ||
# allows external images | # allows external images | ||
$wgAllowExternalImages = true; | $wgAllowExternalImages = true; | ||
}} | }} | ||
* on peut alors ajouter une image externe ex: | * on peut alors ajouter une image externe ex: | ||
:{{syntaxhighlight |lang=text|code= | : {{syntaxhighlight |lang=text|code= | ||
http://www.openoffice.org/images/AOO_logos/AOO4_website_logo.png | http://www.openoffice.org/images/AOO_logos/AOO4_website_logo.png | ||
}} | }} | ||
:=> http://www.openoffice.org/images/AOO_logos/AOO4_website_logo.png | :: => http://www.openoffice.org/images/AOO_logos/AOO4_website_logo.png | ||
== Mettre le site en maintenance == | == Mettre le site en maintenance == | ||
:{{syntaxhighlight| lang=php|code= | : {{syntaxhighlight| lang=php|code= | ||
$wgReadOnly = 'Site temporarily down for maintenance'; | $wgReadOnly = 'Site temporarily down for maintenance'; | ||
}} | }}<br> | ||
<br> | |||
[[Category:MediaWiki]] | [[Category:MediaWiki]] | ||
$wgUseImageMagick = false;
#sous Linux
$wgImageMagickConvertCommand = '/usr/local/bin/convert';
REM sous Windows
$wgImageMagickConvertCommand = 'C:/Program Files/ImageMagick/convert.exe';
$wgGroupPermissions['*']['createaccount'] = true;
$wgFileExtensions = array('svg','png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');
$wgVerifyMimeType = false;
# anything under /wiki is treated as an article title
RewriteRule ^wiki/(.+)$ MediaWiki/index.php?title=$1 [PT,L,QSA]
$wgScriptPath = "/MediaWiki";
$wgArticlePath = '/wiki/$1';
$wgFavicon = "$wgScriptPath/favico.ico";
<syntaxhighlight lang="php">
<?php
$v = "string"; // sample initialization
?>
</syntaxhighlight>
<?php
$v = "string"; // sample initialization
?>
div.mw-geshi {
padding: 1em;
margin: 1em 0;
border: 1px dashed #2f6fab;
[[Fichier:TortoiseSVNupgrade.png|link=http://jltryoen.fr]]
# allows external images
$wgAllowExternalImages = true;
http://www.openoffice.org/images/AOO_logos/AOO4_website_logo.png

$wgReadOnly = 'Site temporarily down for maintenance';