Doc /

Astuces pour PmWiki



Je viens de faire (5 Avril 2017) une mise à jour de sécurité de PmWiki

vers 2.2.96

A noter que ca n'avait pas été nécessaire pour ce motif depuis la 2.2.51 du 8 Mai 2013

La procédure est la suivante:

Déjà, être inscrit sur la liste (au moins) pour avoir la nouvelle. Pmwiki-users est bien aussi.

Télécharger la dernière version à partir du lien indiqué dans le mail

Extraire les fichiers dans un répertoire local (chez vous)

Ouvrir dans Dolphin ou tout programme équivalent le répertoire pmwiki ainsi obtenu (dans mon cas liaison fish/ssh)

Copier son contenu dans le répertoire pmwiki du serveur web (chez nous htdocs/pmwiki)

Durée du transfert: moins d'une minute, il y a 1.3 Mo de fichiers.

C'est tout

PmWiki est conçu pour qu'aucune mise à jour n'écrase un fichier créé par l'utilisateur

Si ca n'a pas été fait récemment, faire avant quand même une sauvegarde de htdocs/pmwiki/wiki.d qui contient les pages du site.

Du coup (le CULTe) nous sommes passés de 2.2.63 à 2.2.96

Mass uploading of photos

Say you want to make a tutorial with many photos, writing the "Attach" thing lot of times is boring. You can make this in a snap with a small script and some cleverness.

  • First locate the photos and give them a reasonable size. If you use kde (for me with openSUSE Leap 42.2), simply install "kim", the kde image management system. It gives you the ability to manage photos selected with a right click, and context menu that show for example "compress and resize". Choose "web", and the size you want, "do not override" and it writes your images in the given size and same name prefixed by "web_".
  • in this same folder, uses the script below, then copy/paste the result in your wiki page.
# written in march 20 2017 by Jean-Daniel Dodin
# feel free to use at will

# this script takes a list of photo files (regexp) and
# makes a txt page to be copied to pmwiki

for I ; do

#trace du travail
echo $I ;

#ajout du lien dans l'index
echo -e "%width=200%Attach:"$I"\n" >> pmwiki.txt ;

done ;

  • upload the images with ftp/fish, whatever. To know where the photos must be, on my version there is a folder for each group in /pmwiki/upload/groupname. To be sure, attach one example photo with the usual pmwiki method and look to see if it's in the expected folder. If yes, copy all your images there. Beware name collision...

that's all, you get all the images in your page, you only have to setup the page.


On Friday 05 February 2010 04:46:53, Randy Brown wrote :
> > I would find it useful to have a button on my edit form that is similar to
> >  save-and-edit, except it would also show a preview (maybe called a "view"
> >  since it's not "pre" to anything). Is there a simple way to do that?
You can always display a preview below the edit form (works with edit and with 
save&edit) by adding to config.php :
  if($action == 'edit') $_REQUEST['preview'] = 1;

> This sounds great, can we have a preview just when 'save and edit' is used
> > rather than edit?
Yes, instead of the line above, use this one:
   if(@$_REQUEST['postedit']>'') $_REQUEST['preview'] = 1;


Pour ne pas avoir de bouton éditer en mode edition

ajouter à la page Site.PageFootMenu la première et la dernière ligne ci-dessous:

(:if1 !equal {$Action} edit:)
*%rel=nofollow%[[{*$FullName}?action=edit | $[Edit] ]]
*%rel=nofollow%[[{*$FullName}?action=diff | $[Page History] ]]
*%rel=nofollow accesskey=$[ak_source]%[[{*$FullName}?action=source | $[Source] ]]
*%rel=nofollow accesskey=$[ak_upload]%[[{*$FullName}?action=upload | $[Attach File] ]]
*%rel=nofollow%[[Site.Search?q=link={*$FullName} | $[Backlinks] ]]
*%rel=nofollow%[[Site.Search?q={*$Group}/ | $[List Group] ]]
(:if auth admin:)
(:if !equal {$Action} edit:)
*%rel=nofollow%[[{*$FullName}?action=attr| $[Attributes] ]]
*%rel=nofollow%[[{*$Group}.GroupAttributes| $[Group Attributes] ]]

->''$[Page last modified on] {*$LastModified}''

!!Redirection du index.html
Name the content of text index.html

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html><head><meta http-equiv="Refresh" content="0;
 You will be redirected in a moment otherwise klik the nekt link
 <a href="">Website GEWIS</a>

AND replace (TWICE!!)by YOUR adress of the pmwiki.php!!!!

Replace Website GEWIS by your name of the website

Second possibility

Name the content into index.php

 /* Browser redirect */


Replace again the path by where your wiki lives!

This are TWO different possibilities one with HMTL and the second with PHP


Formatage des listes

The source code block is to be considered... as a block :) You need to explicitely bind it to the item in order to prevent list breaks:

# blupp blupp blupp\\
(:source lang=html4strict:)
several lines

# blipp blipp

fixing forgotten blanks in head of lines

I find (by chance) a very nice solution, and tracked the problem...

  • solution:

May be this only works in the triad skin? Edit the text, do "preview". In this mode all the lines are wrapped except the offending ones. These one don't wrap and god through the right window side, easy to see. Remember, in normal view the window is expended as much as necessary to fit the offendig line, so it's difficult to see which is what.

  • tracking the problem.

I have two different problems:

one very difficult to get. from mediawiki source, I had lines like this

 some sort of line with blank in front   other sort of line  continuing

the "\" was taken into account *before* the blank, giving one only long line. Using fixed the problem

I had several

   * list line

that is lists with several blancs in front *in the source*. This is not good in PmWiki (but works in mediawiki). It's difficult to find because having blanks in the text you read is normal everywhere except in pmwiki source..

anyway easy to find with the first item

Bouton imprimer dans la page

%item rel=nofollow class=print accesskey='$[ak_print]'%

[[{$FullName}?action=print | $[Print] ]]

légendes et images flottantes