Installation du plug-in sur votre blog
Tout d’abord, pour plus de renseignements sur ce que sont les pavatars, et le fonctionnement du coeur du plug-in, ce billet vous décrira ce que vous avez à savoir.
Afin d’installer ce plug-in, vous devrez le récupérer à cette adresse. Un pavatar par défaut est déjà défini dans le dossier. Si vous voulez le modifier, il faut changer l’image “pavatars/default.png”. Celui par défaut est tiré d’une illustration de Hexley, la mascotte de DarwinOS.
Maintenant, uploadez le dossier “pavatars” sur votre serveur, à l’adresse “/dotclear/ecrire/tools”, comme ici:
Pensez bien à mettre le dossier “pavatars” contenant les fichiers PHP, et pas seulement celui contenant “default.png”, sinon ça ne fonctionnera pas.
Maintenant, il faut récupérer le fichier “post.php”, qui se trouve normalement dans le dossier “/dotclear/themes/default/, mais cela dépend de votre installation de dotClear. Si vous avez plusieurs thèmes, il faudra certainement répéter cette opération pour chaque thème.
Ouvrez ce fichier, et repérez les lignes servant à l’affichage des commentaires, qui ressemblent de base à cela:
<?php while ($comments->fetch()) : /* Boucle de commentaires */ // On met le numéro du commentaire dans une variable $co_num = $comments->int_index+1; ?> <p id="c<?php dcCommentID(); ?>" class="comment-info"> <span class="comment-number"><a href="#c<?php dcCommentID(); ?>"><?php echo $co_num; ?>.</a></span> Le <?php dcCommentDate(); ?> à <?php dcCommentTime(); ?>, par <strong><?php dcCommentAuthor(); ?></strong></p> <?php /* on affiche le commentaire */ ?> <?php dcCommentContent(); ?> <div class="spacer"> </div> </blockquote> <?php endwhile; ?>
On va ajouter ce petit bout de code (personnellement, je l’ajoute juste en dessous de la ligne “<?php /* on affiche le commentaire */ ?>”):
<blockquote> <?php dcPavatars::displayPavatar(); ?>
Voilà, enregistrez et remettez le fichier “post.php” à sa place, et normalement, tout fonctionne à présent
Installing this plug-in on your dotClear blog
For informations on what are pavatars, and how the kernel of this plug-in works, take a look at this article, which describes usefull informations.
The first thing to do is to download the plug-in at this address, and to unzip it. A default pavatar (done from an illustration of Hexley the platypus) is given in the package. If you want another default pavatar, change the image “pavatars/default.png”.
Now, you can upload the folder “pavatars” on your website (take the folder which contains the php files, not the one which only contains the default pavatar
), at “/doctclear/ecrire/tools” (may depend on your installation), like this:
Now, find the file “post.php”, which may be at “/dotclear/themes/default”, depending on your installation. If you use multiple themes, you’ll have to repeat these operations for each theme.
Download and open the file, and search the code which displays comments. By default, this code looks like this:
<?php while ($comments->fetch()) : /* Boucle de commentaires */ // On met le numéro du commentaire dans une variable $co_num = $comments->int_index+1; ?> <p id="c<?php dcCommentID(); ?>" class="comment-info"> <span class="comment-number"><a href="#c<?php dcCommentID(); ?>"><?php echo $co_num; ?>.</a></span> Le <?php dcCommentDate(); ?> à <?php dcCommentTime(); ?>, par <strong><?php dcCommentAuthor(); ?></strong></p> <?php /* on affiche le commentaire */ ?> <?php dcCommentContent(); ?> <div class="spacer"> </div> </blockquote> <?php endwhile; ?>
We will now add this line:
<blockquote> <?php dcPavatars::displayPavatar(); ?>
Personnaly, I put this line just below of the “<?php /* on affiche le commentaire */ ?>”line.
Save the file, put it back where you found it, and everything should work now

2 commentaires pour “[dotClear & Pavatar] plug-in pavatar, v0.2”
Exemple de pavatar.
Et le pavatar par défaut