ManageMediaWiki: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
 
(67 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Definition ==
== Introduction ==


This is a maintenace page in french where we write down things we did to this and a few other wikis we host. Plus other useful information for things we may implement in the future .... I will change stuff to English gradually when I feel like - [[User:Daniel K. Schneider|Daniel K. Schneider]])
This is a messy maintenace page (some lines in french) where we write down things we did to this and a few other wikis we host. Plus other useful information for things we may implement in the future .... '''Most information is outdated !!!'''. This is for internal use and I'll improve this for a larger audience when I'll feel like - [[User:Daniel K. Schneider|Daniel K. Schneider]])
 
Also (or rather) read:
 
* [[Mediawiki]] (high-level information, in particular about good extensions)
* [[Mediawiki installation]] (should become the page to consult .... but I am not sure if I can find the motivation - [[User:Daniel K. Schneider|Daniel K. Schneider]] 11:01, 29 September 2011 (CEST))


== Testing ==
== Testing ==


See the [[Testing Sandbox]] for some tests that I intend to stay a bit. New users should just use the ordinary [[SandBox]]
Administrators of this wiki should use the [[Testing Sandbox]] for tests that are intended to stay a bit. New users should just use the ordinary [[SandBox]].
 
== Layout and boxes ==
 
=== Change the navigation bar to the left ===
 
* To make changes to the sidebar, you always should start trying to modify just [[MediaWiki:Sidebar]] in your wiki
* [http://www.mediawiki.org/wiki/Manual:Navigation_bar Navigation bar help]
 
Syntax is more powerful in more recent versions, e.g. with version 1.14 you may change the positions of portlets.
 
On 09:49, 31 July 2009 (UTC), we had:
<pre>
* SEARCH
 
* navigation and help
** mainpage|Mainpage
** EduTech_Wiki:About|about
<!-- ** portal-url|portal -->
<!-- ** currentevents-url|currentevents -->
** randompage-url|randompage
** helppage|Help
** Help:Editing rules|Editing rules
** Blog:DKS|Blog (D.K.S.)
 
* categorytree-portlet
 
* TOOLBOX
 
* LANGUAGES
 
* big brother
** Special:Newpages|New Pages
** recentchanges-url|recentchanges
** Special:Guestbook|Guestbook
** Special:Popularpages|Popular Pages
** Special:WhosOnline|Who is online ?
 
* TECFA links
** http://tecfa.unige.ch/ |TECFA
** http://tecfaseed.unige.ch/door/ |TECFA Portal
</pre>
 
Another example from [http://edutechwiki.unige.ch/fr/ EduTechWiki/fr] using the vector skin, dated 10:13, 20 August 2010 (UTC):
<pre>
* Via Google
 
* navigation
 
** mainpage|Mainpage
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|Help
** Guidelines:Règles d'édition|Règles d'édition
 
* categorytree-portlet
 
* coll-print_export
 
* TOOLBOX
 
* LANGUAGES
 
* Big brother
** Special:Newpages|Nouvelles pages
** Special:Popularpages|Pages populaires
** Special:WhosOnline|Qui est en ligne?
** Special:Allpages|Toutes les pages
</pre>
 
===Add a banner to the sidebar (PHP) - solution 1===
You can add one or more banners to the sidebar by hacking your ''skins/Monobook.php'' or skin/Vector.php
Adapted from: [http://www.mediawiki.org/wiki/Manual:Navigation_bar#Advanced_customization dvanced_customization]
 
Find (line 526 for Vector.php / MW 1.16.0:
<source lang="php">
?>
<!-- panel -->
<div id="mw-panel" class="noprint">
<!-- logo -->
<div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey( 'p-logo' ) ?>></a></div>
<!-- /logo -->
<?php $this->renderPortals( $this->data['sidebar'] ); ?>
 
</div>
<!-- /panel -->
</source>
 
Include before the last div and after the renderPortals line:
<source lang="php">
?>
<!-- begin of banner1 -->
<div class='generated-sidebar portlet'>
<h5><?php $this->msg('sidebar-banner1-headingtext') ?></h5>
<div style="border: 1px solid #B0B0B0; background-color: #FFFFFF;">
<a href="<?php $this->msg('sidebar-banner1-url') ?>">
<img width="100%" title="<?php $this->msg('sidebar-banner1-alttext') ?>"
alt="<?php $this->msg('sidebar-banner1-alttext') ?>"
src="<?php $this->msg('sidebar-banner1-imgsrc') ?>" /></a>
</div></div>
<!-- end of banner1 -->
 
</div>
<!-- /panel -->
</source>
 
I then removed the line with the heading text.
 
Now in your Wiki, create three or four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)
 
{| class="prettytable"
! parameter
! value
|-
| <tt>sidebar-banner1-headingtext</tt>
| The text that will be displayed as the banner heading ("advertisement", "sponsor" etc.)
|-
| <tt>sidebar-banner1-url</tt>
| The destination URL of this banner
|-
| <tt>sidebar-banner1-alttext</tt>
| Content of the '''alt=""''' parameter of an HTML <img> tag: any title for the destination site
|-
| <tt>sidebar-banner1-imgsrc</tt>
| Content of the '''src=""''' parameter of an HTML <img> tag: the URL of the banner image. It may be the address of an image uploaded to your Wiki ([http://www.mediawiki.org/wiki/Help:Magic_words magic words] may be used, e.g. <tt><nowiki>{{filepath:banner1.png}}</nowiki></tt>), or the address of an external image. E.g. MediaWiki:Sidebar-banner1-imgsrc has the contents.
<nowiki>{{SCRIPTPATH}}</nowiki>/tecfa/Logo_TECFA.png
tecfa is a subdirectory of the main (root) mediawiki directory.
|}
 
To add more banners, just repeat the process renaming "banner1" to "banner2" etc.
 
=== Add a banner to the sidebar (PHP) - solution 2 ===
 
I finally found it easier to write an extension to do this job. Not much is needed. I also use this hook to add a google search box .... You even could position the portlet by editing Mediawiki:Sidebar. By default, stuff goes to the end.
<source lang ="php">
<?php
/**
* SidebarBannerBox
* CREDITS: Idea shamelessly copied from http://www.mediawiki.org/wiki/Extension:SidebarDonateBox
* @file
* @ingroup Extensions
* @author Daniel K. Schneider (http://www.mediawiki.org/wiki/User:Daniel_K._Schneider)
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
 
if ( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );
 
$wgExtensionCredits['parserhook'][] = array (
'path' => __FILE__,
'name' => 'SidebarBannerBox',
'url' => 'http://mediawiki.org/wiki/Extension:SidebarBannerBox',
'version' => '0.1',
'author' => "[http://mediawiki.org/wiki/User:Daniel_K._Schneider Daniel K. Schneider]",
'descriptionmsg' => 'Adds banner(s) to the sidebar',
); // should be properly localized
 
 
$wgHooks['SkinBuildSidebar'][] = 'efSidebarBannerBox';
 
function efSidebarBannerBox( $skin, &$bar ) {
  global $egSidebarBannerBoxContent, $wgScriptPath;
// CHANGE this according to your needs
        $out = '<div class="sidebar_banner">';
$out .= '<a href="http://tecfa.unige.ch/">';
$out .= '<img title="TECFA - Educational Technology Unit - UniGE"';
$out .= 'alt="TECFA - Educational Technology Unit - Home page" ';
$out .= 'src="' . $wgScriptPath . '/tecfa/Logo_TECFA.png" /></a>';
$out .= '</div>';


== Layout et boxes ==
        $out .= '<div class="sidebar_banner">';
$out .= '<a href="http://tecfa.unige.ch/maltt">';
$out .= '<img title="Master of Science in Learning and Teaching Technologies"';
$out .= 'alt="Master of Science in Learning and Teaching Technologies" ';
$out .= 'src="' . $wgScriptPath . '/tecfa/LOGO_MALTT.png" /></a>';
$out .= '</div>';


===Toolbox===
        $out .= '<div class="sidebar_banner">';
$out .= '<a href="http://tecfa.unige.ch/formcont/">';
$out .= '<img title="Cours de formation continue offerts par TECFA, Université de Genève"';
$out .= 'alt="Cours de formation continue offerts par TECFA, Université de Genève" ';
$out .= 'src="' . $wgScriptPath . '/tecfa/fclogored3.png" /></a>';
$out .= '</div>';


*Modifier directement dans le skin du template utilise. habituellement /skin/monobook.php
*Lors du upgrade, il faudra rajouter les logos+liens supplémentaires, de même que le petit hack pour affichier le lien meetings uniquement pour les administrateurs du wiki (si jamais, j'ai joue sur l'id des utilisateurs et utilise la fonction pour checker si on est identifies:


  $this->data['loggedin']==1 && ($_SESSION['wsUserID'] == 1 ||...)
$bar['TECFA Links'] = $out;
return true;
}


===Modifier la barre de navigation===


* Pour [http://meta.wikimedia.org/wiki/Help:Navigation_bar changer les liens dans la sidebar], il suffit de se rendre à la page [[MediaWiki:Sidebar]] (j'ai mis en commentaire certaines pages qui ne me sembles pas utiles)
</source>


=== Skins ===
=== Skins ===


* Pour ajouter des styles spécifiques à des templates etc. il faut '''editer''' la page. Donc '''ne PAS éditer les fichiers source sur le serveur''' !)
* I suggest to use the '''Monobook''' or '''Vector''' skins. Vector is a derivative of Monobook only officially distributed I believe since MW 1.16 (2010). Other skins are not as well supported. E.g. some extensions just won't work with other skins.
[[MediaWiki:Common.css]]
* To restyle some CSS ''class'' or ''id'' you should first try to do it via [[MediaWiki:Common.css]]. Do not edit CSS files in the server (if you can avoid). This makes maintenance much easier.
 
;Support for mobiles
 
In LocalSettings.php:
$wgHandheldStyle='chick/main.css';
$wgHandheldForIPhone=true;
 
... may not be good enough (e.g. on an Android, only affects the Opera browser if set to mobile browsing). See also http://www.mediawiki.org/wiki/Extension:MobileSkin
 
; Change of user's default skins (important if you change it !)
 
Execute the following maintenance script (example arguments)
php userOptions.php skin --old "monobook" --new "vector"


=== Images ===
=== Images ===
Line 34: Line 243:
* http://meta.wikimedia.org/wiki/Fixing_transparent_PNGs (faudrait le faire !!)
* http://meta.wikimedia.org/wiki/Fixing_transparent_PNGs (faudrait le faire !!)


; Images externes:
; Inclusion of external images:


Pour avoir des images externes il fallait reconfiguer le Wiki (dans LocalSettings.php: $wgAllowExternalImages = true;)
If you want users to be able to include external images you will have to reconfigure the Wiki in LocalSettings.php:  
$wgAllowExternalImages = true;


Ensuite il suffit de mettre l'URL tel quel dans le texte
* See explanations in http://meta.wikimedia.org/wiki/Help:Images_and_other_uploaded_files#Embedding_external_images


* Cf. les explication dans http://meta.wikimedia.org/wiki/Help:Images_and_other_uploaded_files#Embedding_external_images
In edutechwiki this is forbidden, but we do use it with closed-for-writing educational wikis


C.f. biorousso modèle:img pour une macro qui aide l'affichage
; Images for navigation:
 
; Images pour la navigation:
* http://meta.wikimedia.org/wiki/Template:Clickpic (template)
* http://meta.wikimedia.org/wiki/Template:Clickpic (template)


=== SVG Image Support ===
=== SVG Image Support ===


La situation n'est pas encore claire:
Should work


; Upload de SVG et traduction devrait en principe marcher (à configurer ??)
* http://meta.wikimedia.org/wiki/SVG_image_support
* http://meta.wikimedia.org/wiki/SVG_image_support
* Ok works


; Dessiner dans le wiki (en projet):
; Draw SVG in the wiki
* Doesn't seem to work yet - [[User:Daniel K. Schneider|Daniel K. Schneider]] 09:49, 31 July 2009 (UTC)
* http://meta.wikimedia.org/wiki/SVG_whiteboard
* http://meta.wikimedia.org/wiki/SVG_whiteboard


== Configuration et upgrades ==
== Mediawiki configuration and upgrades ==
 
=== Downloads of Mediawiki software ===


=== Downloads de Mediawiki software ===
* http://www.mediawiki.org/wiki/MediaWiki
* http://www.mediawiki.org/wiki/MediaWiki
* Alternatively, download from Subversion (SVN):
* http://www.mediawiki.org/wiki/Download_from_SVN


=== Fichier de configuration ===
Alternatively, download from GIT. Read:
* http://www.mediawiki.org/wiki/Download_from_Git
 
=== Configuration file ===


* Plusieurs choses doivent etre configurés dans LocalSettings.php
All configurations are done in the LocalSettings.php file (sits in the root directory)


Par exemple:
* At some point, it is really important to read http://www.mediawiki.org/wiki/Manual:Configuration_settings


* Types de fichiers acceptés:
For example:
* Accepted file types (easy to understand)
  $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'pdf', 'mp3', 'svg', 'doc', 'xls', 'ppt', 'pub', 'txt', 'ps', 'zip' );
  $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'pdf', 'mp3', 'svg', 'doc', 'xls', 'ppt', 'pub', 'txt', 'ps', 'zip' );
* Permissions (c.f. plus loin)
* Localization and file cache (that would require some reading ...)
$wgUseFileCache = true;
$wgFileCacheDirectory = "$IP/cache";
$wgCacheDirectory = $IP/Cache
 
=== Mediawiki major upgrades - procedure ===
 
* It's always a good idea to read the UPGRADE file that sits in the root of a distribution. Since I never had problems with upgrading (at least in the last 2 years) I just do it without backup. (but I do have a daily backup of ''all'' files in all systems...)


=== WikiMedia Upgrades majeurs - procédure ===
'''Step 1: Backup all mediawikis'''


*Lire les instructions dans le fichier UPGRADE à la racine.
Do it if you don't have a high-end backup service in your institution !
; Sauvegardes
  mysqlshow -p // in case you forgot the db name
*Sauvegarder la base de données:
   mysqldump -p base_de_donnees > fichier.sql
   mysqldump -p base_de_donnees > fichier.sql


Ne '''pas perdre''' les répertoires et fichiers suivants:
'''Step 2: Upgrade preparation'''
# le répertoire avec les fichiers uploadés: images
 
# le fichier LocalSettings.php
Put the running wiki into read-only mode: IN Localsettings.php, set 
# le fichier AdminSettings.php
  $wgReadOnly = 'Upgrading to MediaWiki 1.XX.0';
# le fichier ExtensionFunctions.php
 
# Dans le répertoire includes, les fichier pour renommer les users
Here are some principles of what is involved in the next steps
* Install the new release in a '''new''' directory
* Copy all images, extensions etc. to the new directory (see below)
* Edit and copy LocalSettings.php. Once in a while you might consult the new (and ''not'' used) default configuration file.
* You may have to '''upgrade extension'''s or remove them
* In case you made modifications to the skin, edit the new skins/XXX/XXX.php and add your custom stuff. This may be difficult, since this script changes a lot over the years....
 
'''Do not loose the''' following directories and files.
# Upload directory: images
# LocalSettings.php
# In the directory includes you may have some extra files (old style extensions). A good occasions to get rid of these .....
#* SpecialRenameuser.php
#* SpecialRenameuser.php
#* SpecialRenameuser.i18n.php
#* SpecialRenameuser.i18n.php
#* SpecialRenameuser_body.php
#* SpecialRenameuser_body.php
# le répertoire des extensions
# Directory extensions
# le repertoire /(f)mediawiki/skins/monobook/tecfa: a l'interieur se trouvent les differents logo
#*a l'interieur se trouvent egalement les fichier originaux du logo
#* le fichier /(f)mediawiki/skins/Monobook.php. Modifications effectuées:
#*le logo edutech
#*les deux logos en bas à gauche
#*le petit hack pour afficher la page Meetings (plus maintenant)
#*La boite pour Google search
... generally fixing the skin is the worst part besides making sure that certain extensions are up-to-date.


; Préparation Upgrade
'''Step 3: Uncompress the archive and copy old files'''
* Déarchiver la nouvelle version dans un répertoire nouveau
* Recopier le répertoire images, extensions etc. (voir ci-dessus)
* Editer/recopier LocalSettings (et controler si rien n'est à changer !)
* Quoter les extensions (éventuellement, en tout cas faut de temps à autre les mettre à jour !)
* Reporter les modifications dans skins/Monobook.php


; Commandes préparation (à peu près)
Make sure to copy setup and media files as shown below. I suggest that you keep a file with that kind of commands. Then just copy/paste 4 times / year. '''Alternatively, use GIT as explained above'''.
Donc le nouveau install est dans mediawiki-new


Mediawiki en:
Decompress mediawiki tar archive:
  gtar zxf mediawiki-xxx
  cd /path/to/your/mediawiki
tar zxf mediawiki-xxx
  mv mediawiki-xxx mediawiki-new
  mv mediawiki-xxx mediawiki-new
  chown R xxx:yyy mediawiki-new
  chown R xxx:yyy mediawiki-new


Alternatively you directly can:
mkdir /path/to/your/mediawiki-new
tar xvzf mediawiki-1.XXX.XX.tar.gz -C /path/to/your/mediawiki-new --strip-components=1
chown -R xxx:yyy mediawiki-new
Then make sure that you copy all the media files and extensions. Depending on your installation you may have more than the most important "images" directory, e.g. a directory where you put the logo.
  cp -rp mediawiki/images/ mediawiki-new/
  cp -rp mediawiki/images/ mediawiki-new/
  cp -p mediawiki/LocalSettings.php mediawiki-new/
  cp -p mediawiki/LocalSettings.php mediawiki-new/
cp -p mediawiki/AdminSettings.php mediawiki-new/
cp -p mediawiki/ExtensionFunctions.php mediawiki-new/
  cp -rp mediawiki/extensions mediawiki-new/
  cp -rp mediawiki/extensions mediawiki-new/
  cp -rp mediawiki/skins/monobook/tecfa mediawiki-new/skins/monobook/
  cp -rp mediawiki/tecfa/ mediawiki-new/
cp -p mediawiki-new/skins/MonoBook.php mediawiki-new/skins/MonoBook.php.ORI
 
cp -p mediawiki/skins/MonoBook.php mediawiki-new/skins/MonoBook.php
'''Step 4: Swap old and new and update'''


* Arreter le serveur Web et bouger les 2 install
Stop the server and swap the two installs. You also can perform the whole upgrade in the new directory and then swap at the very end of the procedure.
  mv mediawiki mediawiki.old
  mv mediawiki mediawiki.old
  mv mediawiki-new mediawiki
  mv mediawiki-new mediawiki
Line 131: Line 348:
  mkdir cache
  mkdir cache
  chown x:y cache
  chown x:y cache
php maintenance/update.php


Mediawiki fr:
'''Mediawiki fr and other Mediawikis''', same procedure, e.g:


  gtar zxf mediawiki-xxx
  tar xvzf mediawiki-1.17.0.tar.gz -C /data/portails/fmediawiki-new/ --strip-components=1
mv mediawiki-xxx fmediawiki-new
  chown xxx:yyy fmediawiki-new
  chown xxx:yyy fmediawiki-new


  cp -rp fmediawiki/images/ fmediawiki-new/
  cp -rp fmediawiki/images/ fmediawiki-new/
  cp -p fmediawiki/LocalSettings.php fmediawiki-new/
  cp -p fmediawiki/LocalSettings.php fmediawiki-new/
cp -p fmediawiki/AdminSettings.php fmediawiki-new/
cp -p fmediawiki/ExtensionFunctions.php fmediawiki-new/
  cp -rp fmediawiki/extensions fmediawiki-new/
  cp -rp fmediawiki/extensions fmediawiki-new/
  cp -rp fmediawiki/skins/monobook/tecfa fmediawiki-new/skins/monobook/
  cp -rp fmediawiki/tecfa/ fmediawiki-new/
cp -p fmediawiki-new/skins/MonoBook.php fmediawiki-new/skins/MonoBook.php.ORI
cp -p fmediawiki/skins/MonoBook.php fmediawiki-new/skins/MonoBook.php


Copy the Monobook.php file from the English version or fix it manually.
Fix the skin file (Monobook of vector) if you made manual extensions. But you can do this later.


* Arreter le serveur Web et bouger les 2 install
* Stop serveur Web (if you like) and exchange old with new
  mv fmediawiki fmediawiki.old
  mv fmediawiki fmediawiki.old
  mv fmediawiki-new fmediawiki
  mv fmediawiki-new fmediawiki
  cd fmediawiki
  cd fmediawiki
mkdir cache
  chown x:y cache
  chown x:y cache


* Ensuite lancer le script de mise à jour en ligne de commande (PAS via le Web !!!)
* '''Important''': Launch the upgrade script. It is critical to do so, else many new extensions or even the wiki just won't work...
  > php maintenance/update.php
php maintenance/update.php
 
'''Step 5: Clean up and upgrade extensions'''
 
; Restart
* Start web server again (if you stopped it, I usually don't bother)
* Comment the line: $wgReadOnly = 'Upgrading to MediaWiki 1.16.0';
 
; Extensions
 
Repair extensions and upgrade these (while most often these extensions will still work, it's always a good idea to upgrade for both security and functionality)
* Since we run several Mediawikis on the same machine, I use the following strategy
mkdir /path-to/portals/extensions17
* Install each new/updated extension in this new directory
* Test with one install
* Some extensions my change parameter names (!!). Make sure to change these in each LocalSetting.php
* Then link from each /path-to/portals/mediawiki-xxx/extensions folder
rm CategoryTree
ln -s ../../extensions17/CategoryTree
rm CheckUser
ln -s ../../extensions17/CheckUser
rm Cite
ln -s ../../extensions17/Cite
rm Collection
ln -s ../../extensions17/Collection
rm ConfirmEdit
ln -s ../../extensions17/ConfirmEdit
rm DiscussionThreading
ln -s ../../extensions17/DiscussionThreading
rm SyntaxHighlight_GeSHi
ln -s ../../extensions17/SyntaxHighlight_GeSHi
rm WhosOnline
ln -s ../../extensions17/WhosOnline/
rm WikiEditor
ln -s ../../extensions17/WikiEditor
rm WYSIWYG
  ln -s ../../extensions17/WYSIWYG
 
....
 
; Examine features of LocalSettings
* Compare old LocalSettings.php with include/DefaultSettings.php. Often, new mediawiki versions include new interesting option or sometimes deprecate some.
** Make changes (I suggest to look at this at least once / year)
** See also: http://www.mediawiki.org/wiki/Manual:Configuration_settings
 
=== Minor Mediawiki upgrades - procedure ===


* Relancer le serveur Web
Minor upgrades are just some kind of patches, for example 1.6.5 to 1.6.6, only php code is replaced. See also patches below.
* Réparer les extensions (vérifier s'il y a des upgrades)
* Comparer l'ancien LocalSettings.php avec include/DefaultSettings.php
** Si nécessaire faire des changements
** Voir aussi: http://www.mediawiki.org/wiki/Manual:Configuration_settings
* Compare the skin Monobook.php.ORI (the new one) with Monobook.php (your old one). '''Often''' you have to take the new one and replicate manually your changes, e.g. logos and such !!


=== WikiMedia Upgrades minors - procédure ===
Read [http://www.mediawiki.org/wiki/Manual:Upgrading Manual:Upgrading]


* Par ex. 1.6.5 à 1.6.6
; Installation
* Décomprimer l'archive qq. par
* Uncompress the archive somewhere
* chown -R owner:group *
* chown -R owner:group *
* Wikiwiz et autre custom stuff: il faut '''saver'''
* Save some custom stuff, e.g.
index.php
:index.php
includes/SpecialPage.php
:includes/SpecialPage.php
skins/Monobook.php
:skins/Monobook.php
languages/Messages.php (ou fichier équivalent pour autres langues)
:languages/Messages.php (maybe)
* Copier tout l'arbre nouveau sur l'ancien
* Copy files on top of old tree
* Virer le répertoire config ?
* Fix your "custom" pages
* Ensuite comparer les pages "custom" et restituer l'ancienne ou changer la nouvelle...
 
; Updating script
Run:
php maintenance/update.php


=== Application de patch ===
=== Upgrading with a unified patch ===


* First check if they don't overwrite the typical files you should save (see above)
* First check if they don't overwrite the typical files you should save (see above)
* The use gnu patch. Put the file in the mediawiki directory and type something like:
* For unified patches, you must use gnu patch which is default under Linux.  
 
Put the file in the mediawiki directory and if you feel safe, type something like:
   
   
patch -p1 < mediawiki-1.13.1.patch
or
  gpatch -p1 < mediawiki-1.13.1.patch
  gpatch -p1 < mediawiki-1.13.1.patch


The "p1" argument strips the first component of the file path.
The "p1" argument strips the first component of the file path.
'''You may use a more conservative strategy:'''
(1) This time we assume that the patch file remains in some src directory, e.g.:
cd /data/portails/src
(2) Then do a dry run:
patch --dry-run --verbose -p1 --directory=/data/portails/mediawiki < mediawiki-1.16.1.patch > tmp.text
Then examine tmp.text (e.g. check if it overwrites critical files and which lines)
(3a) Apply the patch
patch --verbose -p1 --directory=/data/portails/mediawiki < mediawiki-1.16.1.patch
(3b) Do it with a save copy of each file (you later can remove these *.save files)
patch --backup --suffix=.save --verbose -p1 --directory=/data/portails/mediawiki < mediawiki-1.16.1.patch
Then you should test and finally you can remove the save files
find /data/portails/mediawiki -name "*.save"
find /data/portails/fmediawiki -name "*.save" -exec rm {} \;


=== Cool URL===
=== Cool URL===


* Petit tuto pour modier le .htaccess et avoir ainsi des [http://meta.wikimedia.org/wiki/Using_a_very_short_URL cool url] (ca evite d'avoir l'index.php dans l'url)
Mediawiki URLs are ugly by default, but it's easy to change this:
* Enfin DKS a fait plus simple: [http://meta.wikimedia.org/wiki/Rewrite_rules Eliminating index.php]. La solution est la suivante:
 
* Read [http://meta.wikimedia.org/wiki/Using_a_very_short_URL cool url] (more difficult)
* Read [http://meta.wikimedia.org/wiki/Rewrite_rules Eliminating index.php]. (adopted for edutech wiki)
   
   
Dans httpd.conf:
In httpd.conf:


   Redirect /portails/mediawiki  "http://edutechwiki.unige.ch/en"
   Redirect /portails/mediawiki  "http://edutechwiki.unige.ch/en"
Line 212: Line 493:
  &lt; /VirtualHost &gt;
  &lt; /VirtualHost &gt;


Ensuite dans LocalSettings.php:
Then in LocalSettings.php:


  $wgSitename        = "EduTech Wiki";
  $wgSitename        = "EduTech Wiki";
Line 225: Line 506:
  $wgArticlePath      = "/en/$1";
  $wgArticlePath      = "/en/$1";


Donc on ne reecrit pas les pages très spéciales (genre pour éditer), mais les autres (avec un alias).
Therefore only "normal" pages look nice. Special pages remain ugly, but this doesn't matter IMHO.
 
Also consider excluding all or most special pages in robots.txt. No reason that these should be indexed and they '''really''' eat away CPU cycles if you need another argument.


=== Language strings for the Wiki ===


aussi: Inclure les pages spéciales "mediawiki" dans robots.txt. Pas de raison à ce que ce soit indexé.
Depends on the installation !!


=== Les language strings pour le Wiki ===
If you are using database message ($wgUseDatabaseMessages is true, the default), then the Special:Allmessages page lists all the navigation box. Display the messages, then click on it (will open a page for the message) and EDIT.


Cela dépend de l'installation !!
If you are '''not''' using database messages, you can edit the languages/Language.php file (for English) or languages/LanguageXX.php for non-English languages, where XX is the two-letter language code for your language.


If you are using database message ($wgUseDatabaseMessages is true, the default), then the Special:Allmessages page lists all the navigation box. Display the messages, then click on it (will open a page for the message) and EDIT. /DKS cela m'a pris 1/2 heure ....
Finally, some strings (E.g. the copyright messages) can be set as variables in the LocalSettings.php file


If you aren't using database messages, you can edit the languages/Language.php file (for English) or languages/LanguageXX.php for non-English languages, where XX is the two-letter language code for your language.
=== Interwiki links to other languages ===
In order to create interwiki links to another wiki, e.g. for other language versions like in wikipedia, you will have to edit a database table:


Finally, some strings (E.g. the copyright messages) can be set as variables in the LocalSettings.php file
* Read [http://www.mediawiki.org/wiki/Manual:Interwiki#Interwiki_links_to_other_languages Interwiki_links_to_other_languages]


=== Life time of a session ===
=== Life time of a session ===
* Change /usr/local/lib/php.ini
* Change /usr/local/lib/php.ini
   ; Modif DKS augmenter le lifetime d'une session à 3600 secondes pour Mediawiki editing !
   ; Modif DKS augmenter le lifetime d'une session à 3600 secondes pour Mediawiki editing !
Line 247: Line 533:


See: [http://examples.anotherwebcom.com/wikis/MediaWiki/Category:Top_Contributors_%28MW%29]
See: [http://examples.anotherwebcom.com/wikis/MediaWiki/Category:Top_Contributors_%28MW%29]
=== Search ===
* Default MySQL search is both very slow and plain dumb
* Therefore I added a a simple google box (manually in the skin)
To do:
* Install Lucene
Maybe test this "easy setup" (Will try this after we move edutech wiki to faster brand new server - End of Aug. 2009)
* http://www.mediawiki.org/wiki/Extension:EzMwLucene
* http://www.mediawiki.org/wiki/Extension:MWSearch




Line 278: Line 576:
  require_once( "includes/DefaultSettings.php" );
  require_once( "includes/DefaultSettings.php" );
* Finalement faire des alias Apache s'il en a (sinon ca crée un problème je pense)
* Finalement faire des alias Apache s'il en a (sinon ca crée un problème je pense)
== Site Maps ==
Google and other search engines may not find all pages. To help, you can create a sitemap that you then can register with Google and others. To do so, use something like:
/PATH-TO/mediawiki/maintenance/generateSitemap.php --server http://edutechwiki.unige.ch --urlpath http://edutechwiki.unige.ch/sitemap
If it works, put it in your crontab, e.g. a daily can do. E.g. you could edit /etc/crontab and add
06 6  * * *  A_USER /usr/bin/php /PATH-TO/mediawiki/maintenance/generateSitemap.php --server http://edutechwiki.unige.ch --urlpath http://edutechwiki.unige.ch/sitemap  --fspath /web/sitemap
Read: http://www.mediawiki.org/wiki/Manual:GenerateSitemap.php


== Access rights et user management ==
== Access rights et user management ==
Line 374: Line 683:
== Export / import to mediawiki ==
== Export / import to mediawiki ==


=== Exportation ===
Several import/export tools to mediawiki exist. All of these need some manual tuning.
 
=== Export ===


; The collection extension
; The collection extension
* exports to Open Office - best bet currently - [[User:Daniel K. Schneider|Daniel K. Schneider]] 15:00, 17 June 2009 (UTC)
* exports to PDF and Open Office - best bet currently -
* See [[Mediawiki collection extension installation]]
[[User:Daniel K. Schneider|Daniel K. Schneider]] 15:00, 17 June 2009 (UTC)


; Other
; Other
Line 394: Line 707:


* http://en.wikipedia.org/wiki/Wikipedia:Tools/Editing_tools
* http://en.wikipedia.org/wiki/Wikipedia:Tools/Editing_tools
** Liste des outils html2wiki et word2wiki, etc.
** List of editing tools and filters like html2wiki and word2wiki, etc.
 
 
=== Mass import pictures ===
 
Let's say that you have two wikis and wish to import all pictures from one to the other without overwriting existing files that have the same name.
 
In the source wiki, copy all images to a temp directory, e.g. under unix:
find . -name thumb -prune -or \( -name *.png -or -name *.jpg -or -name *.gif \) -exec cp -rp {} /tmp/images \;
Remove the ones you dont really need
 
In the target wiki, go to maintenance/ and use the importImages.php script roughly like this:
php importImages.php --extensions=jpg,gif,png,svg --user=WikiSysop --dry /tmp/images
Remove "--dry" if you feel safe :)


=== Importation into Wiki links===
=== Import to Wiki links===


* http://de.wikipedia.org/wiki/Wikipedia:Helferlein/Word2MediaWikiPlus Word  to Wiki
* http://de.wikipedia.org/wiki/Wikipedia:Helferlein/Word2MediaWikiPlus Word  to Wiki
* http://www.dwheeler.com/html2wikipedia/ HTML to Wiki
* http://www.dwheeler.com/html2wikipedia/ HTML to Wiki
* http://diberri.dyndns.org/wikipedia/html2wiki/ OnLine HTML to Wiki !
* http://diberri.dyndns.org/wikipedia/html2wiki/ OnLine HTML to Wiki !
* http://www-math.cudenver.edu/~jmandel/latex2wiki/ Online Latex to Mediawiki converter ([http://en.wikipedia.org/wiki/User:Jmath666/latex2wiki User:Jmath666/latex2wiki]
* http://www.wikiwaves.org/index.php/Converting_Latex_to_Wiki Converting Latex to Wiki


=== HTML import ===
=== HTML import ===
Line 409: Line 737:


; Online forms
; Online forms
[http://diberri.dyndns.org/wikipedia/html2wiki/  online form] based on Dave's Perl script
* [http://diberri.dyndns.org/wikipedia/html2wiki/  online form] based on Dave's Perl script
* [http://toolserver.org/~diberri/cgi-bin/html2wiki/index.cgi online form] based on Dave's Perl script
* [http://labs.seapine.com/htmltowiki.cgi HTMLtoWIki] On-line form from Seapine Labs (uses David's HTML::WikiConverter).
* [http://labs.seapine.com/htmltowiki.cgi HTMLtoWIki] On-line form from Seapine Labs (uses David's HTML::WikiConverter).
* [http://www.ebruni.it/en/software/os/i_love_wiki/index.mpl Emiliano Bruni's form] (an other on-line tool based on HTML::WikiConverter).
* [http://www.ebruni.it/en/software/os/i_love_wiki/index.mpl Emiliano Bruni's form] (an other on-line tool based on HTML::WikiConverter).
Line 415: Line 744:


Another solution is to load HTML into OpenOffice and then convert. This is most useful when you got many pictures, e.g. SPSS output.
Another solution is to load HTML into OpenOffice and then convert. This is most useful when you got many pictures, e.g. SPSS output.
=== PDF 2 Wiki ===
(only if you just have a PDF, since you will have to do a lot of wiki formatting)
* http://mail.ywambrussels.be/sskcwiki/pdf2wiki.php (online form, works fine, but needs separate picture extraction and manual formatting)
* http://www.ywamkb.net/kb/index.php/User:Kevin_pdf2wiki


=== Word 2 Wiki ===
=== Word 2 Wiki ===


; '''Word2MediaWikiPlus'''
See [http://www.mediawiki.org/wiki/Word_macros Word macros] at Mediawiki.org. It lists several tools. However, currently (09:35, 30 July 2009 (UTC)) we believe that it is probably easier to open a word file in Open Office and then export from there (the Wiki filter is included in OO).
 
==== Word2MediaWikiPlus ====
* [http://www.mediawiki.org/wiki/Extension:Word2MediaWikiPlus Extension:Word2MediaWikiPlus]. Convert Microsoft Word document content to MediaWiki markup. This is a Word Visual Basic macro. Usage requires a running copy of Microsoft Word that supports Visual Basic macros (Word 2000 or greater). This is an enhancement of the Word2MediaWiki converter.
* [http://www.mediawiki.org/wiki/Extension:Word2MediaWikiPlus Extension:Word2MediaWikiPlus]. Convert Microsoft Word document content to MediaWiki markup. This is a Word Visual Basic macro. Usage requires a running copy of Microsoft Word that supports Visual Basic macros (Word 2000 or greater). This is an enhancement of the Word2MediaWiki converter.
* [[User:Daniel K. Schneider|Daniel K. Schneider]] has tested this and it works.
* [[User:Daniel K. Schneider|Daniel K. Schneider]] has tested this and it works.
Line 437: Line 775:
* You can enter the category the article will belong to
* You can enter the category the article will belong to


; '''Word2MediaWiki.NET'''
==== Word2MediaWiki.NET ====
 
(not updated since 2008 ?)
* [http://word2mediawikidotnet.codeplex.com/ Word2MediaWiki.NET]
* [http://word2mediawikidotnet.codeplex.com/ Word2MediaWiki.NET]
* I had a brief look at it. It installs ok on Windows Vista and Word 2007
* I had a brief look at it. It installs ok on Windows Vista and Word 2007
Line 444: Line 782:
* Doesn't do image and tables conversion (Beta 2) - [[User:Daniel K. Schneider|Daniel K. Schneider]] 19:33, 10 March 2009 (UTC)
* Doesn't do image and tables conversion (Beta 2) - [[User:Daniel K. Schneider|Daniel K. Schneider]] 19:33, 10 March 2009 (UTC)


; Open in OpenOffice
==== Microsoft Office Word Add-in For MediaWiki ====
* see below
 
* [http://www.microsoft.com/download/en/details.aspx?id=12298 Microsoft Office Word Add-in For MediaWiki] at Microsoft for Office 2007 and 2010
* Dated 10/27/2010.
* Usage: "Save as" (but see below)
 
As of July 2019:
* [https://www.microsoft.com/en-us/download/details.aspx?id=12298 download] is the same, but the registry is wrong. This can be fixed.
* Read https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/using-microsoft-office-word-add-in-for-mediawiki/449726c2-6d08-45e1-919a-4b5082ab4b5b
* I.e. do the following
 
    Run the Registry Editor (regedit.exe)
    Navigate the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Word\Text Converters\OOXML Converters\Export\MediaWiki
    export that key to a file
    Open the file with notepad and change the "14.0" to "15.0" and save the file
    Import the registry file
 
If you are running the 64 bit edition of Windows, do the same thing for HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Word\Text Converters\OOXML Converters\Export\MediaWiki
 
Also do ti for 16.0 in both cases ....
 
==== Via Open Office ====
Open the word file in OpenOffice and then export from there (see below)


=== Export from OpenOffice ===
=== Export from OpenOffice ===
Line 455: Line 814:
* Open this HTML in Open Office
* Open this HTML in Open Office
* Save as wiki. It will have links to the png's produced by SPSS
* Save as wiki. It will have links to the png's produced by SPSS
* Tables are shaky though (only one level)  
* Tables are shaky though (only one level)


== Cache ==
== Cache ==


=== Internal cache===
Read http://www.mediawiki.org/wiki/Manual:Cache
Change LocalSettings.php
 
=== PHP Cache ===
(used for edutechwiki)
 
A PHP cache allows to cache php code files. To use this, install a PHP chaching extensions. This has nothing to do with a MediaWiki installation.
Read http://www.mediawiki.org/wiki/Manual:Cache#PHP_caching.
 
E.g. on Ubuntu, install APC first:
apt-get install php-apc
apache2ctl restart
 
Then:
$wgMainCacheType = CACHE_ACCEL;
 
=== Internal messaging cache ===
 
For localization (messages) cache (new in 1.16):
$wgCacheDirectory = "$IP/cache";
 
=== Internal file cache ===
(used for edutechwiki)
 
For File caching, change LocalSettings.php


  $wgUseFileCache = true;
  $wgUseFileCache = true;
  $wgFileCacheDirectory = "$IP/cache";
  $wgFileCacheDirectory = "{$wgCacheDirectory}/html";
 
=== Purging cached files ===
 
Don't know exactly what this affects, but it's good voodoo when some page contents don't refresh as they should...


(1) Empty cache for a single page
(1) Empty cache for a single page
Line 540: Line 925:
See [[Special:Version]] for installed extensions. Note that some just
See [[Special:Version]] for installed extensions. Note that some just
show up indirectly in the tag list.
show up indirectly in the tag list.
See also:
* https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
* https://www.mediawiki.org/wiki/Help:Magic_words


=== editor extension ===
=== editor extension ===
Line 548: Line 937:


=== FCKEditor ===
=== FCKEditor ===
'''This is a dead project, only use it on older Mediawiki installations that you can't upgrade'''


Not installed on english edutech wiki, but in wikis that we use for teaching.
Was never installed on english edutech wiki, but in wikis that we use for teaching.
Out-of-the box install now works ok with version mediawiki 13.x - [[User:Daniel K. Schneider|Daniel K. Schneider]] 10:55, 23 February 2009 (UTC)
Out-of-the box install now worked ok with version mediawiki 13.x - [[User:Daniel K. Schneider|Daniel K. Schneider]] 10:55, 23 February 2009 (UTC)


; FCKeditor
; FCKeditor
* http://www.mediawiki.org/wiki/Extension:FCKeditor_(Official)
* http://www.mediawiki.org/wiki/Extension:FCKeditor_(Official)
* installed on french Edutechwiki for example, works more or less ok. A simple to install version will exist for MW 1.16 (fall 2009).
* Had it installed on french Edutechwiki for example, worked more or less ok.  
* http://mediawiki.fckeditor.net/
* http://mediawiki.fckeditor.net/


The advantage of this extensions is that it produces wiki code (not html). Makes it easy to hand edit stuff if needed.
The advantage of this extensions is that it produces wiki code (not html). Makes it easy to hand edit stuff if needed.
===Visual editor===
This is the new official Wikimedia Wysywig editor. So far it needs a bleeding edge installation (i.e. 1.22/wmf4+ or better). A stable MediaWiki distribution is expected by the
end of 2013. That being said, it is available on Wikipedia.en and Mediawiki.org for user who do edit with a login.
It requires a Parsoid server.
Read:
* [http://www.mediawiki.org/wiki/Extension:VisualEditor Extension:VisualEditor]
* [http://www.mediawiki.org/wiki/Parsoid Parsoid]
* [http://slopjong.de/2012/10/31/how-to-install-the-latest-nodejs-in-ubuntu/  How to install the latest node.js on Ubuntu?],  (needed for Parsoid)


=== Wiki blog ===
=== Wiki blog ===
Line 607: Line 1,009:


* Anti-Spam Login Creation
* Anti-Spam Login Creation
* http://www.mediawiki.org/wiki/Extension:ConfirmEdit (a http://en.wikipedia.org/wiki/Captcha extension to create logins)
* Read [[Spam]] article. It will explain how we use the ConfirmEdit / Recaptcha extension


=== Cite et Special:Cite, Page Authors ===
=== Cite et Special:Cite, Page Authors ===
Line 624: Line 1,026:
  <nowiki><pageby/></nowiki>
  <nowiki><pageby/></nowiki>
* I suggest to use the following (made an emacs macro of course, since typing is too long)
* I suggest to use the following (made an emacs macro of course, since typing is too long)
  <nowiki><pageby nominor="false" comments="false"/></nowiki>
  <nowiki><!-- <pageby nominor="false" comments="false"/> --></nowiki>


=== MetaUML ===
=== MetaUML ===
Line 948: Line 1,350:
Works well with ''Mac OS 10.4'' and ''Windows XP'' (using Firefox 1.5+). Nice syntax highlighting. Moderately easy to install.  
Works well with ''Mac OS 10.4'' and ''Windows XP'' (using Firefox 1.5+). Nice syntax highlighting. Moderately easy to install.  
# Get and install all the necessary downloads at [http://www.djini.de/software/mwjed/ mwjed] (including [http://java.sun.com/j2se/1.4.2/ JRE 1.4.2], [http://www.jedit.org jEdit 4.2 final] and the dependent plugins [http://plugins.jedit.org/plugins/?XML XML] and [http://plugins.jedit.org/plugins/?JakartaCommons JakartaCommons])
# Get and install all the necessary downloads at [http://www.djini.de/software/mwjed/ mwjed] (including [http://java.sun.com/j2se/1.4.2/ JRE 1.4.2], [http://www.jedit.org jEdit 4.2 final] and the dependent plugins [http://plugins.jedit.org/plugins/?XML XML] and [http://plugins.jedit.org/plugins/?JakartaCommons JakartaCommons])
# create a directory <code>$HOME/.jedit/mwjed/_family</code>
# extract <code>$HOME/.jedit/jars/MwJed.jar</code> into a new directory
# create a directory <code>$HOME/.jedit/MwJed/_family</code>
# extract <code>$HOME/.jedit/jars/mwapi.jar</code> into a new directory
# extract <code>$HOME/.jedit/jars/mwapi.jar</code> into a new directory
# find and copy <code>common.family</code> and <code>common.site</code> into <code>$HOME/.jedit/mwjed/_family/</code> and rename accordingly (<code>NAME.family</code> and <code>NAME.site</code>
# find and copy <code>common.family</code> and <code>common.site</code> into <code>$HOME/.jedit/MwJed/_family/</code> and rename accordingly (<code>NAME.family</code> and <code>NAME.site</code>
# adapt these two files for the mediawiki you wish to edit
# adapt these two files for the mediawiki you wish to edit
# add ''edit'' link on [http://www.djini.de/software/mwjed/ mwjed homepage] to your bookmarks within either Firefox 1.5+ or Safari.
# add ''edit'' link on [http://www.djini.de/software/mwjed/ mwjed homepage] to your bookmarks within either Firefox 1.5+ or Safari.
Line 993: Line 1,396:
Do no remove messages etc. This plugin is really tricky and does not show any useful error messages when something goes wrong. See Utilities->Troubleshooting->Activity Log
Do no remove messages etc. This plugin is really tricky and does not show any useful error messages when something goes wrong. See Utilities->Troubleshooting->Activity Log


== Other useful tools ==
== Other ==


* L'extension Copy+ pour Firefox permet de copier coller URL + Titre en format MediaWiki
Parameters for the index.php page


* [http://blog.freebase.com/2008/02/18/mining-knowledge-from-wikipedia-announcing-wex/ Mining knowledge from Wikipedia: Announcing WEX]
* http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php
** http://download.freebase.com/wex/
 
(very useful to know ...)


== Wiki readers (books) ==
== Wiki readers (books) ==
Line 1,064: Line 1,468:
* http://meta.wikimedia.org/wiki/Wikipedia_is_an_MMORPG
* http://meta.wikimedia.org/wiki/Wikipedia_is_an_MMORPG


 
[[Category:Help]]
[[Category: TECFA meetings]]
[[Category:Mediawiki documentation]]
[[Category: Help]]

Latest revision as of 12:46, 15 July 2019

Introduction

This is a messy maintenace page (some lines in french) where we write down things we did to this and a few other wikis we host. Plus other useful information for things we may implement in the future .... Most information is outdated !!!. This is for internal use and I'll improve this for a larger audience when I'll feel like - Daniel K. Schneider)

Also (or rather) read:

Testing

Administrators of this wiki should use the Testing Sandbox for tests that are intended to stay a bit. New users should just use the ordinary SandBox.

Layout and boxes

Change the navigation bar to the left

Syntax is more powerful in more recent versions, e.g. with version 1.14 you may change the positions of portlets.

On 09:49, 31 July 2009 (UTC), we had:

* SEARCH

* navigation and help
** mainpage|Mainpage
** EduTech_Wiki:About|about
<!-- ** portal-url|portal -->
<!-- ** currentevents-url|currentevents --> 
** randompage-url|randompage
** helppage|Help
** Help:Editing rules|Editing rules
** Blog:DKS|Blog (D.K.S.)

* categorytree-portlet

* TOOLBOX

* LANGUAGES

* big brother
** Special:Newpages|New Pages
** recentchanges-url|recentchanges
** Special:Guestbook|Guestbook
** Special:Popularpages|Popular Pages
** Special:WhosOnline|Who is online ?

* TECFA links
** http://tecfa.unige.ch/ |TECFA
** http://tecfaseed.unige.ch/door/ |TECFA Portal

Another example from EduTechWiki/fr using the vector skin, dated 10:13, 20 August 2010 (UTC):

* Via Google

* navigation

** mainpage|Mainpage
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|Help
** Guidelines:Règles d'édition|Règles d'édition

* categorytree-portlet

* coll-print_export

* TOOLBOX

* LANGUAGES

* Big brother
** Special:Newpages|Nouvelles pages
** Special:Popularpages|Pages populaires
** Special:WhosOnline|Qui est en ligne?
** Special:Allpages|Toutes les pages

Add a banner to the sidebar (PHP) - solution 1

You can add one or more banners to the sidebar by hacking your skins/Monobook.php or skin/Vector.php Adapted from: dvanced_customization

Find (line 526 for Vector.php / MW 1.16.0:

?>
		<!-- panel -->
			<div id="mw-panel" class="noprint">
				<!-- logo -->
					<div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey( 'p-logo' ) ?>></a></div>
				<!-- /logo -->
				<?php $this->renderPortals( $this->data['sidebar'] ); ?>

 </div>
	<!-- /panel -->

Include before the last div and after the renderPortals line:

?>
	<!-- begin of banner1 -->
	<div class='generated-sidebar portlet'>
	<h5><?php $this->msg('sidebar-banner1-headingtext') ?></h5>
	<div style="border: 1px solid #B0B0B0; background-color: #FFFFFF;">
	<a href="<?php $this->msg('sidebar-banner1-url') ?>">
	<img width="100%" title="<?php $this->msg('sidebar-banner1-alttext') ?>" 
		alt="<?php $this->msg('sidebar-banner1-alttext') ?>" 
		src="<?php $this->msg('sidebar-banner1-imgsrc') ?>" /></a>
	</div></div>
	<!-- end of banner1 -->

		</div>
	<!-- /panel -->

I then removed the line with the heading text.

Now in your Wiki, create three or four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)

parameter value
sidebar-banner1-headingtext The text that will be displayed as the banner heading ("advertisement", "sponsor" etc.)
sidebar-banner1-url The destination URL of this banner
sidebar-banner1-alttext Content of the alt="" parameter of an HTML <img> tag: any title for the destination site
sidebar-banner1-imgsrc Content of the src="" parameter of an HTML <img> tag: the URL of the banner image. It may be the address of an image uploaded to your Wiki (magic words may be used, e.g. {{filepath:banner1.png}}), or the address of an external image. E.g. MediaWiki:Sidebar-banner1-imgsrc has the contents.
{{SCRIPTPATH}}/tecfa/Logo_TECFA.png

tecfa is a subdirectory of the main (root) mediawiki directory.

To add more banners, just repeat the process renaming "banner1" to "banner2" etc.

Add a banner to the sidebar (PHP) - solution 2

I finally found it easier to write an extension to do this job. Not much is needed. I also use this hook to add a google search box .... You even could position the portlet by editing Mediawiki:Sidebar. By default, stuff goes to the end.

<?php
/**
 * SidebarBannerBox
 * CREDITS: Idea shamelessly copied from http://www.mediawiki.org/wiki/Extension:SidebarDonateBox
 * @file
 * @ingroup Extensions
 * @author Daniel K. Schneider (http://www.mediawiki.org/wiki/User:Daniel_K._Schneider)
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

if ( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );

$wgExtensionCredits['parserhook'][] = array (
	'path' => __FILE__,
	'name' => 'SidebarBannerBox',
	'url' => 'http://mediawiki.org/wiki/Extension:SidebarBannerBox',
	'version' => '0.1',
	'author' => "[http://mediawiki.org/wiki/User:Daniel_K._Schneider Daniel K. Schneider]",
	'descriptionmsg' => 'Adds banner(s) to the sidebar', 
); // should be properly localized


$wgHooks['SkinBuildSidebar'][] = 'efSidebarBannerBox';

function efSidebarBannerBox( $skin, &$bar ) {
  global $egSidebarBannerBoxContent, $wgScriptPath;
	// CHANGE this according to your needs
        $out = '<div class="sidebar_banner">';
	$out .= '<a href="http://tecfa.unige.ch/">';
	$out .= '<img title="TECFA - Educational Technology Unit - UniGE"';
	$out .= 'alt="TECFA - Educational Technology Unit - Home page" ';
	$out .= 'src="' . $wgScriptPath . '/tecfa/Logo_TECFA.png" /></a>';
	$out .= '</div>';

        $out .= '<div class="sidebar_banner">';
	$out .= '<a href="http://tecfa.unige.ch/maltt">';
	$out .= '<img title="Master of Science in Learning and Teaching Technologies"';
	$out .= 'alt="Master of Science in Learning and Teaching Technologies" ';
	$out .= 'src="' . $wgScriptPath . '/tecfa/LOGO_MALTT.png" /></a>';
	$out .= '</div>';

        $out .= '<div class="sidebar_banner">';
	$out .= '<a href="http://tecfa.unige.ch/formcont/">';
	$out .= '<img title="Cours de formation continue offerts par TECFA, Université de Genève"';
	$out .= 'alt="Cours de formation continue offerts par TECFA, Université de Genève" ';
	$out .= 'src="' . $wgScriptPath . '/tecfa/fclogored3.png" /></a>';
	$out .= '</div>';


	$bar['TECFA Links'] = $out;
	return true;
}

Skins

  • I suggest to use the Monobook or Vector skins. Vector is a derivative of Monobook only officially distributed I believe since MW 1.16 (2010). Other skins are not as well supported. E.g. some extensions just won't work with other skins.
  • To restyle some CSS class or id you should first try to do it via MediaWiki:Common.css. Do not edit CSS files in the server (if you can avoid). This makes maintenance much easier.
Support for mobiles

In LocalSettings.php:

$wgHandheldStyle='chick/main.css';
$wgHandheldForIPhone=true;

... may not be good enough (e.g. on an Android, only affects the Opera browser if set to mobile browsing). See also http://www.mediawiki.org/wiki/Extension:MobileSkin

Change of user's default skins (important if you change it !)

Execute the following maintenance script (example arguments)

php userOptions.php skin --old "monobook" --new "vector"

Images

Inclusion of external images

If you want users to be able to include external images you will have to reconfigure the Wiki in LocalSettings.php:

$wgAllowExternalImages = true;

In edutechwiki this is forbidden, but we do use it with closed-for-writing educational wikis

Images for navigation

SVG Image Support

Should work

Draw SVG in the wiki

Mediawiki configuration and upgrades

Downloads of Mediawiki software

Alternatively, download from GIT. Read:

Configuration file

All configurations are done in the LocalSettings.php file (sits in the root directory)

For example:

  • Accepted file types (easy to understand)
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ogg', 'pdf', 'mp3', 'svg', 'doc', 'xls', 'ppt', 'pub', 'txt', 'ps', 'zip' );
  • Localization and file cache (that would require some reading ...)
$wgUseFileCache = true;
$wgFileCacheDirectory = "$IP/cache";
$wgCacheDirectory = $IP/Cache

Mediawiki major upgrades - procedure

  • It's always a good idea to read the UPGRADE file that sits in the root of a distribution. Since I never had problems with upgrading (at least in the last 2 years) I just do it without backup. (but I do have a daily backup of all files in all systems...)

Step 1: Backup all mediawikis

Do it if you don't have a high-end backup service in your institution !

 mysqlshow -p // in case you forgot the db name
 mysqldump -p base_de_donnees > fichier.sql

Step 2: Upgrade preparation

Put the running wiki into read-only mode: IN Localsettings.php, set

 $wgReadOnly = 'Upgrading to MediaWiki 1.XX.0';

Here are some principles of what is involved in the next steps

  • Install the new release in a new directory
  • Copy all images, extensions etc. to the new directory (see below)
  • Edit and copy LocalSettings.php. Once in a while you might consult the new (and not used) default configuration file.
  • You may have to upgrade extensions or remove them
  • In case you made modifications to the skin, edit the new skins/XXX/XXX.php and add your custom stuff. This may be difficult, since this script changes a lot over the years....

Do not loose the following directories and files.

  1. Upload directory: images
  2. LocalSettings.php
  3. In the directory includes you may have some extra files (old style extensions). A good occasions to get rid of these .....
    • SpecialRenameuser.php
    • SpecialRenameuser.i18n.php
    • SpecialRenameuser_body.php
  4. Directory extensions

Step 3: Uncompress the archive and copy old files

Make sure to copy setup and media files as shown below. I suggest that you keep a file with that kind of commands. Then just copy/paste 4 times / year. Alternatively, use GIT as explained above.

Decompress mediawiki tar archive:

cd /path/to/your/mediawiki
tar zxf mediawiki-xxx
mv mediawiki-xxx mediawiki-new
chown R xxx:yyy mediawiki-new

Alternatively you directly can:

mkdir /path/to/your/mediawiki-new
tar xvzf mediawiki-1.XXX.XX.tar.gz -C /path/to/your/mediawiki-new --strip-components=1
chown -R xxx:yyy mediawiki-new

Then make sure that you copy all the media files and extensions. Depending on your installation you may have more than the most important "images" directory, e.g. a directory where you put the logo.

cp -rp mediawiki/images/ mediawiki-new/
cp -p mediawiki/LocalSettings.php mediawiki-new/
cp -rp mediawiki/extensions mediawiki-new/
cp -rp mediawiki/tecfa/ mediawiki-new/

Step 4: Swap old and new and update

Stop the server and swap the two installs. You also can perform the whole upgrade in the new directory and then swap at the very end of the procedure.

mv mediawiki mediawiki.old
mv mediawiki-new mediawiki
cd mediawiki
mkdir cache
chown x:y cache
php maintenance/update.php

Mediawiki fr and other Mediawikis, same procedure, e.g:

tar xvzf mediawiki-1.17.0.tar.gz -C /data/portails/fmediawiki-new/ --strip-components=1
chown xxx:yyy fmediawiki-new
cp -rp fmediawiki/images/ fmediawiki-new/
cp -p fmediawiki/LocalSettings.php fmediawiki-new/
cp -rp fmediawiki/extensions fmediawiki-new/
cp -rp fmediawiki/tecfa/ fmediawiki-new/

Fix the skin file (Monobook of vector) if you made manual extensions. But you can do this later.

  • Stop serveur Web (if you like) and exchange old with new
mv fmediawiki fmediawiki.old
mv fmediawiki-new fmediawiki
cd fmediawiki
chown x:y cache
  • Important: Launch the upgrade script. It is critical to do so, else many new extensions or even the wiki just won't work...
php maintenance/update.php

Step 5: Clean up and upgrade extensions

Restart
  • Start web server again (if you stopped it, I usually don't bother)
  • Comment the line: $wgReadOnly = 'Upgrading to MediaWiki 1.16.0';
Extensions

Repair extensions and upgrade these (while most often these extensions will still work, it's always a good idea to upgrade for both security and functionality)

  • Since we run several Mediawikis on the same machine, I use the following strategy
mkdir /path-to/portals/extensions17
  • Install each new/updated extension in this new directory
  • Test with one install
  • Some extensions my change parameter names (!!). Make sure to change these in each LocalSetting.php
  • Then link from each /path-to/portals/mediawiki-xxx/extensions folder
rm CategoryTree
ln -s ../../extensions17/CategoryTree
rm CheckUser
ln -s ../../extensions17/CheckUser
rm Cite 
ln -s ../../extensions17/Cite
rm Collection
ln -s ../../extensions17/Collection
rm ConfirmEdit
ln -s ../../extensions17/ConfirmEdit
rm DiscussionThreading
ln -s ../../extensions17/DiscussionThreading
rm SyntaxHighlight_GeSHi
ln -s ../../extensions17/SyntaxHighlight_GeSHi
rm WhosOnline
ln -s ../../extensions17/WhosOnline/
rm WikiEditor
ln -s ../../extensions17/WikiEditor
rm WYSIWYG
ln -s ../../extensions17/WYSIWYG
....
Examine features of LocalSettings

Minor Mediawiki upgrades - procedure

Minor upgrades are just some kind of patches, for example 1.6.5 to 1.6.6, only php code is replaced. See also patches below.

Read Manual:Upgrading

Installation
  • Uncompress the archive somewhere
  • chown -R owner:group *
  • Save some custom stuff, e.g.
index.php
includes/SpecialPage.php
skins/Monobook.php
languages/Messages.php (maybe)
  • Copy files on top of old tree
  • Fix your "custom" pages
Updating script

Run:

php maintenance/update.php

Upgrading with a unified patch

  • First check if they don't overwrite the typical files you should save (see above)
  • For unified patches, you must use gnu patch which is default under Linux.

Put the file in the mediawiki directory and if you feel safe, type something like:

patch -p1 < mediawiki-1.13.1.patch

or

gpatch -p1 < mediawiki-1.13.1.patch

The "p1" argument strips the first component of the file path.

You may use a more conservative strategy:

(1) This time we assume that the patch file remains in some src directory, e.g.:

cd /data/portails/src

(2) Then do a dry run:

patch --dry-run --verbose -p1 --directory=/data/portails/mediawiki < mediawiki-1.16.1.patch > tmp.text

Then examine tmp.text (e.g. check if it overwrites critical files and which lines)

(3a) Apply the patch

patch --verbose -p1 --directory=/data/portails/mediawiki < mediawiki-1.16.1.patch

(3b) Do it with a save copy of each file (you later can remove these *.save files)

patch --backup --suffix=.save --verbose -p1 --directory=/data/portails/mediawiki < mediawiki-1.16.1.patch

Then you should test and finally you can remove the save files

find /data/portails/mediawiki -name "*.save" 
find /data/portails/fmediawiki -name "*.save" -exec rm {} \;

Cool URL

Mediawiki URLs are ugly by default, but it's easy to change this:

In httpd.conf:

  Redirect /portails/mediawiki  "http://edutechwiki.unige.ch/en"
  Redirect /mediawiki  "http://edutechwiki.unige.ch/en"
  Redirect /portails/fmediawiki "http://edutechwiki.unige.ch/fr"

<VirtualHost *:80>
       ServerName edutechwiki.unige.ch
       DocumentRoot "/data/portails/edutechwiki"
   # ALIASES for edutechwiki: THREE alias for each WIKI
   Alias /mediawiki "/data/portails/mediawiki"
   Alias /en "/data/portails/mediawiki/index.php"
   Alias /en/index.php "/data/portails/mediawiki/index.php"
   Alias /fmediawiki "/data/portails/fmediawiki"
   Alias /fr "/data/portails/fmediawiki/index.php"
   Alias /fr/index.php "/data/portails/fmediawiki/index.php"
< /VirtualHost >	

Then in LocalSettings.php:

$wgSitename         = "EduTech Wiki";
$wgScriptPath	    = "/mediawiki";
$wgScript           = "$wgScriptPath/index.php";
$wgRedirectScript   = "$wgScriptPath/redirect.php";
## If using PHP as a CGI module, use the ugly URLs
#   $wgArticlePath      = "$wgScript/$1";
# DKS 3/2006
$wgArticlePath      = "/en/$1";

Therefore only "normal" pages look nice. Special pages remain ugly, but this doesn't matter IMHO.

Also consider excluding all or most special pages in robots.txt. No reason that these should be indexed and they really eat away CPU cycles if you need another argument.

Language strings for the Wiki

Depends on the installation !!

If you are using database message ($wgUseDatabaseMessages is true, the default), then the Special:Allmessages page lists all the navigation box. Display the messages, then click on it (will open a page for the message) and EDIT.

If you are not using database messages, you can edit the languages/Language.php file (for English) or languages/LanguageXX.php for non-English languages, where XX is the two-letter language code for your language.

Finally, some strings (E.g. the copyright messages) can be set as variables in the LocalSettings.php file

Interwiki links to other languages

In order to create interwiki links to another wiki, e.g. for other language versions like in wikipedia, you will have to edit a database table:

Life time of a session

  • Change /usr/local/lib/php.ini
 ; Modif DKS augmenter le lifetime d'une session à 3600 secondes pour Mediawiki editing !
 ; session.gc_maxlifetime = 1440
 session.gc_maxlifetime = 3600

See: [1]

Search

  • Default MySQL search is both very slow and plain dumb
  • Therefore I added a a simple google box (manually in the skin)

To do:

  • Install Lucene

Maybe test this "easy setup" (Will try this after we move edutech wiki to faster brand new server - End of Aug. 2009)


Copie mediawiki sur PC / Windows

See also: WAMP, a probably updated English version of this section

  • Attention, il faut PHP 5.x pour Mediawiki 1.7 !!
    • Easyphp ne le fait pas, mais on peut upgrader:
    • Vider le répertoire ./php et ensuite le remplir avec le zip: http://www.php.net/downloads.php
    • IMPORTANT: Il faut editer php.ini et charger explicitement php_mysql (pour php 4 c'était pas le cas)
extensions_dir = "./ext"
extensions = php_mysql.dll

mysqldump -p base_de_donnees > fichier.sql
par ex. mysqldump -p wikimedia > /tmp/wikimedia.sql
    • Ensuite transférer sur le PC.
  • Importation:
    • Je suggère d'utiliser mysql en ligne de commande (alternativement augmenter LARGEMENT tous les paramètres dans php.ini)
    • Se trouve dans c:\program files\Easyphp-XX\mysql\bin\mysql.exe
mysql.exe base_de_donnees -u root -p < c:\tmp\wikimedia.sql               ... attendre un bon moment ;)
  • Ensuite copier les fichiers PHP
  • Adapter LocalSettings.php
    • changer mot de passe de la bd (j'utilise root sur mon pc ... juste pour jouer ca va)
    • changer $IP
    • Vérifier le include path (les anciens, genre Mediawiki 1.5 était fait pour Unix)
$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) );
require_once( "includes/DefaultSettings.php" );
  • Finalement faire des alias Apache s'il en a (sinon ca crée un problème je pense)

Site Maps

Google and other search engines may not find all pages. To help, you can create a sitemap that you then can register with Google and others. To do so, use something like:

/PATH-TO/mediawiki/maintenance/generateSitemap.php --server http://edutechwiki.unige.ch --urlpath http://edutechwiki.unige.ch/sitemap

If it works, put it in your crontab, e.g. a daily can do. E.g. you could edit /etc/crontab and add

06 6   * * *   A_USER /usr/bin/php /PATH-TO/mediawiki/maintenance/generateSitemap.php --server http://edutechwiki.unige.ch --urlpath http://edutechwiki.unige.ch/sitemap  --fspath /web/sitemap

Read: http://www.mediawiki.org/wiki/Manual:GenerateSitemap.php

Access rights et user management

Détruire un utilisateur

L'utilisateur n'a jamais rien édité (et UNIQUEMENT dans ce cas)
  • SAUF si l'utilisateur n'a jamais rien édité. Dans ce cas on peut simplement l'enlever de la base de données.
  • Dans le répertoire maintanace il y a un script pour tuer tous les utilisateurs qui n'ont jamais édité une page (faudrait l'adapter pour tuer un utilisateur ...)
 php removeUnusedAccounts.php --help
L'utilisateur à édité
  • Il faut utiliser un script pour reassigner ses pages:
./maintenance/reassignEdits.php --help
  • Ensuite seulement, on peut le tuer !

Rename a user

Needs an extension (installed on edutechwiki eng/fr)

Kill a page page forever

  • Use with spam pages (for the others it's better to keep them in the db)
./maintenance/nukePage.php

Login obligatoire

cf. LocalSettings.php

Access rights per page

(le problème va surtout se poser dans le contexte d'autres cultures que celle de TECFA)

Permissions et groupes

  • On peut les définir le fichier de config
  • Exemple pour un Wiki assez ouvert:
$wgGroupPermissions['*']['edit']            = false;
$wgGroupPermissions['*']['createaccount']   = true;
$wgGroupPermissions['*']['read']            = true;
  • Permissions read-only pour guests ET logins (group=user), seuls eleve et sysop peuvent editer etc.
$wgGroupPermissions['*']['edit']            = false;
$wgGroupPermissions['*']['createaccount']   = true;
$wgGroupPermissions['*']['read']            = true;
$wgGroupPermissions['*']['edit']            = false;

$wgGroupPermissions['user' ]['move']            = false;
$wgGroupPermissions['user' ]['read']            = true;
$wgGroupPermissions['user' ]['edit']            = false;
$wgGroupPermissions['user' ]['createpage']      = false;
$wgGroupPermissions['user' ]['createtalk']      = false;
$wgGroupPermissions['user' ]['upload']          = false;
$wgGroupPermissions['user' ]['reupload']        = false;
$wgGroupPermissions['user' ]['reupload-shared'] = false;
$wgGroupPermissions['user' ]['minoredit']       = false;

$wgGroupPermissions['sysop' ]['move']            = true;
$wgGroupPermissions['sysop' ]['read']            = true;
$wgGroupPermissions['sysop' ]['edit']            = true;
$wgGroupPermissions['sysop' ]['createpage']      = true;
$wgGroupPermissions['sysop' ]['createtalk']      = true;
$wgGroupPermissions['sysop' ]['upload']          = true;
$wgGroupPermissions['sysop' ]['reupload']        = true;
$wgGroupPermissions['sysop' ]['reupload-shared'] = true;
$wgGroupPermissions['sysop' ]['minoredit']       = true;

$wgGroupPermissions['eleve']['move']            = true;
$wgGroupPermissions['eleve']['read']            = true;
$wgGroupPermissions['eleve']['edit']            = true;
$wgGroupPermissions['eleve']['createpage']      = true;
$wgGroupPermissions['eleve']['createtalk']      = true;
$wgGroupPermissions['eleve']['upload']          = true;
$wgGroupPermissions['eleve']['reupload']        = true;
$wgGroupPermissions['eleve']['reupload-shared'] = true;
$wgGroupPermissions['eleve']['minoredit']       = true;


See also extensions to create category or user-based permissions.

Export / import to mediawiki

Several import/export tools to mediawiki exist. All of these need some manual tuning.

Export

The collection extension

Daniel K. Schneider 15:00, 17 June 2009 (UTC)

Other

Editing tools


Mass import pictures

Let's say that you have two wikis and wish to import all pictures from one to the other without overwriting existing files that have the same name.

In the source wiki, copy all images to a temp directory, e.g. under unix:

find . -name thumb -prune -or \( -name *.png -or -name *.jpg -or -name *.gif \) -exec cp -rp {} /tmp/images \;

Remove the ones you dont really need

In the target wiki, go to maintenance/ and use the importImages.php script roughly like this:

php importImages.php --extensions=jpg,gif,png,svg --user=WikiSysop --dry /tmp/images

Remove "--dry" if you feel safe :)

Import to Wiki links

HTML import

Batch script
Online forms

Another solution is to load HTML into OpenOffice and then convert. This is most useful when you got many pictures, e.g. SPSS output.

PDF 2 Wiki

(only if you just have a PDF, since you will have to do a lot of wiki formatting)

Word 2 Wiki

See Word macros at Mediawiki.org. It lists several tools. However, currently (09:35, 30 July 2009 (UTC)) we believe that it is probably easier to open a word file in Open Office and then export from there (the Wiki filter is included in OO).

Word2MediaWikiPlus

  • Extension:Word2MediaWikiPlus. Convert Microsoft Word document content to MediaWiki markup. This is a Word Visual Basic macro. Usage requires a running copy of Microsoft Word that supports Visual Basic macros (Word 2000 or greater). This is an enhancement of the Word2MediaWiki converter.
  • Daniel K. Schneider has tested this and it works.
Installation
  • Get http://www.beadsoft.net/files/Word2MediaWikiPlus.zip
  • Change Macro security level in Word, in Word 2003 (english) do:
    • Open Tools -> Options -> Security Tab
    • Click on the Macro Security button (lower right)
    • Set Security level to "Medium"
    • Set Trusted Publishers to "Trust all installed ..." and Trust access to Visual Basic
  • Install the macro: Click
  • You can revert "Trust acces to Visual Basic" after this.
Post installation configuration
  • Once the macro is installed, you can define the URL of your Wiki (2 versions)
  • MS Photo editor doesn't exist anymore in Office 2003. You can reinstall it from an old Office version if you have it still around (http://support.microsoft.com/kb/817095)
Upload
  • You have to cut and paste, but the macro will launch the probable page in your wiki. If it doesn't exist you can create it.
  • You can enter the category the article will belong to

Word2MediaWiki.NET

(not updated since 2008 ?)

  • Word2MediaWiki.NET
  • I had a brief look at it. It installs ok on Windows Vista and Word 2007
  • To run, look in the Word 2007 add-ins tab.
  • Doesn't do image and tables conversion (Beta 2) - Daniel K. Schneider 19:33, 10 March 2009 (UTC)

Microsoft Office Word Add-in For MediaWiki

As of July 2019:

   Run the Registry Editor (regedit.exe)
   Navigate the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Word\Text Converters\OOXML Converters\Export\MediaWiki
   export that key to a file
   Open the file with notepad and change the "14.0" to "15.0" and save the file
   Import the registry file

If you are running the 64 bit edition of Windows, do the same thing for HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Word\Text Converters\OOXML Converters\Export\MediaWiki

Also do ti for 16.0 in both cases ....

Via Open Office

Open the word file in OpenOffice and then export from there (see below)

Export from OpenOffice

I like Open Office even less than word. I really don't understand how to use style in an efficient way, e.g. like in FrameMaker. What I always resent is that with software like Word or OpenOffice it is always difficult to find a stylesheet that contains just the tags you need for a given task. E.g. 50 tags for a book and maybe 15 for a Wikipage. Then when you write, you just use these styles. PERIOD.

However, starting version version 2.3 there is a relatively decent export to MediaWiki format. (Menu File->Export). It's not great, but ok. I this for example to create wiki text from SPSS:

  • Export from SPSS to HTML
  • Open this HTML in Open Office
  • Save as wiki. It will have links to the png's produced by SPSS
  • Tables are shaky though (only one level)

Cache

Read http://www.mediawiki.org/wiki/Manual:Cache

PHP Cache

(used for edutechwiki)

A PHP cache allows to cache php code files. To use this, install a PHP chaching extensions. This has nothing to do with a MediaWiki installation. Read http://www.mediawiki.org/wiki/Manual:Cache#PHP_caching.

E.g. on Ubuntu, install APC first:

apt-get install php-apc
apache2ctl restart

Then:

$wgMainCacheType = CACHE_ACCEL;

Internal messaging cache

For localization (messages) cache (new in 1.16):

$wgCacheDirectory = "$IP/cache";

Internal file cache

(used for edutechwiki)

For File caching, change LocalSettings.php

$wgUseFileCache = true;
$wgFileCacheDirectory = "{$wgCacheDirectory}/html";

Purging cached files

Don't know exactly what this affects, but it's good voodoo when some page contents don't refresh as they should...

(1) Empty cache for a single page

 ?action=purge

(2) Empty all: Emtpy the "objectcache" table

TRUNCATE TABLE objectcache;

Memcache

Read http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/docs/memcached.txt?view=markup

  • For solaris, both libevent and memcache are available at www.sunfreeware.com
  • IMPORTANT: A firewall must be installed for the memcache port. Else anyone can read/write to it - DKS

run with the -v flag to see mistakes :)

Cache externe avec Squid

A faire
  • logfiles format (apache style dans squid ou encore faire un forward pour Apache)
  • perfomance tuning.
  • Mise à jour: version 2.6
Config approximative dans Apache http.conf
  • Apache n'est plus visible à l'extérieur.
 NameVirtualHost 127.0.0.1:80
 <VirtualHost 127.0.0.1:80>
 	ServerName tecfaX.unige.ch
 <VirtualHost 127.0.0.1:80>
     ServerName edutechwiki.unige.ch
Config approximative de squid
http_port 129.194.9.48:80
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
# acl to_localhost dst 127.0.0.0/8
acl CONNECT method CONNECT
acl Safe_ports port 80		# http
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
httpd_accel_host 127.0.0.1 # same machine
httpd_accel_port 80
httpd_accel_single_host on
httpd_accel_uses_host_header on
Changement dans la config des Wiki
  • IMPORTANT dans Localsettings.php
$wgUseSquid = true;

$wgSquidServers = array('127.0.0.1');

  • La boite "top contributors" empeche le cache de fonctionner, donc on censure:
Fichier: extensions/awc/top_ten/config.php
define (nav_menu, false);
Links

Autres pointeurs cache

Installed extensions and templates

This may not be up-to-date or just not documented on purpose ;) See Special:Version for installed extensions. Note that some just show up indirectly in the tag list.

See also:

editor extension

  • WikiEd is an alternative because it supports pasting formatted text, e.g. from MS-Word (including tables). An in-browser text editor that adds enhanced text processing functions to Wikipedia and other MediaWiki edit pages.

Currently it works only for Mozilla browsers like Firefox and SeaMonkey. Works fine. Although personally I prefer to use emacs through "It's all text" (on Windows) or directly in Ubuntu.

FCKEditor

This is a dead project, only use it on older Mediawiki installations that you can't upgrade

Was never installed on english edutech wiki, but in wikis that we use for teaching. Out-of-the box install now worked ok with version mediawiki 13.x - Daniel K. Schneider 10:55, 23 February 2009 (UTC)

FCKeditor

The advantage of this extensions is that it produces wiki code (not html). Makes it easy to hand edit stuff if needed.

Visual editor

This is the new official Wikimedia Wysywig editor. So far it needs a bleeding edge installation (i.e. 1.22/wmf4+ or better). A stable MediaWiki distribution is expected by the end of 2013. That being said, it is available on Wikipedia.en and Mediawiki.org for user who do edit with a login.

It requires a Parsoid server.

Read:

Wiki blog

Forum extension for the discussion page

This is really useful if you use the wiki for assigments. Allows Q/R (tutoring support). Without you are in trouble since students can't use wiki for threaded discussion ....

Alternative:

Forum extensions

In case you need a real forum (e.g. phpbb-like), there are other extensions:

E.g. try one of these:

Various PDF export options

php.ini

max_execution_time = 600
max_input_time = 600
memory_limit = 100M

httpd.conf

Timeout 600

Semantic Wiki

  • A local production to visualize links with Java (disabled now, since size was too big)

SVGViz

Confirm Edit

  • Anti-Spam Login Creation
  • Read Spam article. It will explain how we use the ConfirmEdit / Recaptcha extension

Cite et Special:Cite, Page Authors

Cite
require_once( "extensions/Cite/Cite.php" );
Special
Cite.
require_once( "extensions/Cite/SpecialCite.php" );
PageBy
  • This will list authors.
<pageby/>
  • I suggest to use the following (made an emacs macro of course, since typing is too long)
<!-- <pageby nominor="false" comments="false"/> -->

MetaUML

This is more complicated.

Step: Make sure that latex, dvips, gs (ghostscript), and convert (ImageMagick) installed and available in the PATH. Depending on how the system is installed, this also means to fix the path of the Apache webserver.

It probably would be a good idea to install livetex, but since I found I binary for (older) teTex I went with this. texTex in /opt/sfw wasn't correctly installed. Got a new version from http://www.sunfreeware.com/. This package installs in /usr/local

gunzip tetex-3.0-sol10-sparc-local.gz
pkgadd -d tetex-3.0-sol10-sparc-local

teTex now should be installed and there is some postinstall work to do

  • Add /usr/local/teTeX/bin/sparc-sun-solaris2.10 to the path.
  • Configure
texconfig conf

Step: Install texvc (maybe not needed). This is a standard Mediawiki script to render Latex math fragments.

Step: Fix some configuration variables. Some documentation on variables is here:

You have to make sure that all these variables are defined:

$wgUseTeX	    = true;
$wgMathPath         = "{$wgUploadPath}/math";
$wgMathDirectory    = "{$wgUploadDirectory}/math";
$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";
$wgImageMagickIdentifyCommand="/usr/local/bin/identify";
$wgImageMagickConvertCommand = "/usr/local/bin/convert";
$wgDvipsCommand="/usr/local/teTeX/bin/sparc-sun-solaris2.10/dvips";

Step: Install MetaUML, UML for LaTeX/MetaPost

This works.

tag clouds, navigation, who did what

See e.g. the The big picture page for examples.

Top ten pages
<TopTenPages>20</TopTenPages>
Top contributors (by Rob Church)
<topcontributors/>
Tag Cloud (by Orange Dino, http://www.orangedino.org)
<tagcloud></tagcloud>

Templates

Liste des templates utilisé dans ce wiki
  • ATTENTION: Me semble qu'utiliser un éditeur externe ne marche pas bien ...
Problème avec les templates
  • Ils sont reliés à un problème du système de caching (ne sais pas où).
  • Redémarrer le serveur résout le problème
  • Autre alternative: au lieu de {{incomplete}}, utiliser {{subst:incomplete}}. Cela substitue en dur avec les désavantage évident que (a) tout changement global n'aura pas d'effet et (b) cela ajouter du code HTML dans la page ... ; FAQ entry * http://meta.wikimedia.org/wiki/Help:A_quick_guide_to_templates *I edited the template, so why didn't the page it is used on change? :There are some caching bugs. One way to force refresh is to do edit on the page in which the template appears, and to then click on Save page without having changed anything - there is no need to fill in the Summary field since there will not be any history of this as a change generated. Alternatively, refreshing by pressing Ctrl and F5 often helps. other way is edit bookmark and add <nowiki>&action=purge

to the URL.

New Extensions etc.

Others


Bots

Wikipedia:Bots

References et citations

Pas clair quel systeme va s'imposer sur les Wikipedia. voir:

More ambitious projects that aim to support citation networks (and data more generally)
Harward references

Il faudrait se demander si on ne veut pas utiliser le system "Harward" de certains parse extensions....

Bibliography management

List of extensions to install / test

(some of these already may have been installed .... )

User management
People
Who is online
Chat
Shoutbox
  • There is no Wikimedia shoutbox as far as I can tell
  • But one might try to include standalone shoutboxes with an i-frame (in a skin file, no tested)
Some code that looks ok
Navigation / Information Organization
Assembly / In/oc/transclusions
Special contents
Blogs

There doesn't seem to be another decent blog with update code. See also http://www.gossamer-threads.com/lists/wiki/mediawiki/137413 E.g.

An other trick is to use transclusions from the talk page, and then maybe use a talk page extension to have threads.

{{ :{{TALKPAGENAME}} }}

Wikia does a probably good extension, but I couldn't find any code:

Feeds
Import feeds

Extensions docs and parser extensions

  • Il faudrait faire un inventaire de ce qu'on aimerai avoir et inclure ici la liste complete (templates et autres). La situation n'est pas du tout claire pour moi -- DSchneider. Si j'ai bien compris:
  1. extensions avec des balises wikitext (xml)
  2. extensions avec des pages spéciales
  3. extensions avec des templates
    • hacks anciens, comme Harvard ou citation
    • ParserFunctions ajoutent un "vrai" langage de controle dans le parser, ne marchent qu'avec 1.7 ??

Documentation:

Extension categories:

Wikitech

External editors

Perl / GTK

Perl-based reference implementation

  • DSchneider uses this on his Linux box, not that difficult to install. Wiki serves a special mime type that calls the perl script which in turn works with any UTF-8 capable editor (I use Gnu Emacs).
  • Did not manage to get this working on Win XP (maybe some problem with the GTK library).
Configuration of Emacs
  • Alternatively, one could use a Firefox extension that pipes all forms editing into emacs (see the next solution).

It's all text

Install this Firefox extension. It will allow you to edit any HTML text field with your chosen external editor. It will save edited text to the wiki editing form which then needs to be saved. This solution is not compatible with the Wiked Greasemonkey script, so you have to turn Greasemonkey off)

Read How to open articles in your text editor for more details

Daniel K. Schneider uses this strategy for his windows vista laptops (together with GNU emacs 22.3.1 for win32.

If your editor is Gnu emacs: It's important to set the environment to UTF-8 (Menu->options->Mule->Set Languate environment). Then save with Menu->Options->Save.

MwJed plugin for jEdit

MwJed plugin is available for jEdit with Firefox or Safari Works well with Mac OS 10.4 and Windows XP (using Firefox 1.5+). Nice syntax highlighting. Moderately easy to install.

  1. Get and install all the necessary downloads at mwjed (including JRE 1.4.2, jEdit 4.2 final and the dependent plugins XML and JakartaCommons)
  2. extract $HOME/.jedit/jars/MwJed.jar into a new directory
  3. create a directory $HOME/.jedit/MwJed/_family
  4. extract $HOME/.jedit/jars/mwapi.jar into a new directory
  5. find and copy common.family and common.site into $HOME/.jedit/MwJed/_family/ and rename accordingly (NAME.family and NAME.site
  6. adapt these two files for the mediawiki you wish to edit
  7. add edit link on mwjed homepage to your bookmarks within either Firefox 1.5+ or Safari.
  8. restart jEdit
  9. within jEdit select Plugins>MwJed>Log in and select the mediawiki you wish to edit (the one with the NAME given in step 4
  10. open mediawiki page you wish to edit in your browser and select bookmark link created in step 6. The page will load into jEdit.

For more detailed instructions see mwjed homepage and modkwiki.net's help page

Windows (jEdit 4.3pre 10)
  • Modified in jEdit download preferences to install jars in the installation directory
  • Installed the plugin in the installation directory
  • Create a new directory mwjed under c:\Documents and Settings\USER\.jEdit, then a subdirectory called "_family"
  • Extract the files commons.family and commons.site from /jars/mwapi.jar into this _family directory (use any unzip program). Then rename them to something like edutech_en.*

A typical config *.family file should look like this:

## configuration for a whole wiki family

# identification
name	 edutechwiki

# languages
multilingual 	true
defaultLanguage 	en
supportedLanguage 	en
supportedLanguage 	fr

A typical config file for a wiki site:

# identification
family	edutechwiki
language en

# network
protocol	http://
hostName	edutechwiki.unige.ch
rawPath	        /mediawiki/index.php
prettyPath	/en/
apiPath	        /mediawiki/api.php

Do no remove messages etc. This plugin is really tricky and does not show any useful error messages when something goes wrong. See Utilities->Troubleshooting->Activity Log

Other

Parameters for the index.php page

(very useful to know ...)

Wiki readers (books)

Best bet

See:

Works well, also ordering books from PediaPress - Daniel K. Schneider 15:00, 17 June 2009 (UTC).

Legacy links

Global Links
German wiki links
Manually / German method
Filters / Exporters
  • flexbisonparse module ??
  • flexbisonparse
Generators
Examples

Humor