Instructions to upgrade @lex Guestbook version 3.* to version 3.2
1- The structure of the tables has been modified. With your database manager (i.e. phpmyadmin), run the following requests: (PLEASE NOTE that your tables names may be different, then you'd have to modify the requests below !)
ALTER TABLE `alex_livre_censure` CHANGE `id_mot` `id_mot` MEDIUMINT(11) UNSIGNED NOT NULL AUTO_INCREMENT; ALTER TABLE `alex_livre_ip` CHANGE `id_ip` `id_ip` MEDIUMINT(11) UNSIGNED NOT NULL AUTO_INCREMENT; ALTER TABLE `alex_livre_messages` CHANGE `id` `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT; ALTER TABLE `alex_livre_messages` ADD `valid` ENUM('yes', 'no') DEFAULT 'yes' NOT NULL; ALTER TABLE `alex_livre_messages` ADD INDEX (`time`); ALTER TABLE `alex_livre_sessions` CHANGE `id_user` `id_user` MEDIUMINT(11) UNSIGNED DEFAULT '0' NOT NULL; ALTER TABLE `alex_livre_sessions` CHANGE `session` `session` VARCHAR(70) NOT NULL; ALTER TABLE `alex_livre_sessions` ADD INDEX (`session`); ALTER TABLE `alex_livre_users` CHANGE `id_user` `id_user` MEDIUMINT(11) UNSIGNED NOT NULL AUTO_INCREMENT; ALTER TABLE `alex_livre_users` CHANGE `pass` `pass` VARCHAR(10) BINARY NOT NULL; ALTER TABLE `alex_livre_users` ADD INDEX (`login`); ALTER TABLE `alex_livre_users` ADD INDEX (`pass`); ALTER TABLE `alex_livre_smileys` CHANGE `id_smiley` `id_smiley` MEDIUMINT(11) UNSIGNED NOT NULL AUTO_INCREMENT;

2- Download the zipped new version and fully copy/paste the following directories and files:
"/admin/",
"/db/",
"/images/",
"/include/",
"/languages/",
"/templates/admin/",
"/templates/modelixe/ModeliXe.php",
"/add_message.php",
"/index.php",
"infos_spam.php",
3- Go now to the admin section, you'll see two new options : one asks you if'd like to validate each posted message before it actually is publicly visible, the other lets you set the maximum size of each message : set these values as you wish then click on "Save" ; this step is necessary to avoid a javascript error when the Guestbook is viewed.

4- If you haven't customized the skins, you can fully copy/paste the "/templates/skins/" directory and for you the upgrade is done. However if you did customized one or several skins, you'll have to manually edit it or them following step 5.

5- This step is necessary only for those who customized a skin and wish to retain these modifications (however is you just changed a couple of things, it maybe easier to edit the new skin with them rather than doing this...)
> In the "templates/skins" directory, select the directory containing the skin you wish to upgrade. The procedure is about the same for all skins.
> Edit the "assembly.htm" file, replacing the corresponding (looking the same) first lines with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=<mx:text id="SCRIPT_ENCODAGE"/>">
> Around line 11, look for "<script language="javascript">" until "</script>", and replace all these lines with:
<script language="javascript" type="text/javascript"> <!-- var lang_max_car = "<mx:text id="caracteres"/>"; var lang_reste = "<mx:text id="il_reste"/>"; var max_car = <mx:text id="maxi_car"/>; function storeCaret (textEl){ if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } function smiley(text){ var F = document.getElementById("form_add_guest"); if (F.message_textarea.createTextRange && F.message_textarea.caretPos) { var caretPos = F.message_textarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? ' ' + text + ' ': ' ' + text + ' '; F.message_textarea.focus(); } else { F.message_textarea.value += ' ' + text + ' '; F.message_textarea.focus(); } } function verif_mail(adresse) { var place = adresse.indexOf("@",1); var point = adresse.indexOf(".",place+1); if ((place > -1)&&(adresse.length >2)&&(point > 1)) return true; else return false; } function verif_add(){ var F = document.getElementById("form_add_guest"); var nom = F.nom.value; var message = F.message_textarea.value; <mx:bloc id="bloc_verif_mail"> var mail= F.email.value; </mx:bloc id="bloc_verif_mail"> if (!nom){ alert("<mx:text id="erreur_add_nom"/> "); return false; } else if (!message){ alert("<mx:text id="erreur_add_message"/> "); return false; } <mx:bloc id="bloc_verif_mail2"> else if (!verif_mail(mail) && mail){ alert("<mx:text id="erreur_mail"/> "); return false; } </mx:bloc id="bloc_verif_mail2"> } function script_popup(page,name,largeur,hauteur,options){ var top=(screen.height-hauteur)/2; var left=(screen.width-largeur)/2; window.open(page,name,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); } function verifCar(objet){ if (max_car > 0){ if (objet.value.length > max_car) objet.value = objet.value.substring(0, max_car); var F = document.getElementById("form_add_guest"); F.reste_car.value = lang_reste + " " + (max_car - objet.value.length) + " " + lang_max_car; } } //--> </script>

> At the end of the file, replace the existing copyright with (if your skin bears the mention "chezpierre" or was based upon it, the replacing code is after this one) :
<!-- // // Alexis Soulard 2002 - 2005 // I request you retain the full copyright notice below including the link to www.alexphpteam.com. This not only gives respect to the large amount of time given freely by the developer but also helps build interest, traffic and use of @lex Guestbook. If you refuse to include even this then support on our guestbook may be affected. --> <p align="center">Powered by <a href="http://www.alexphpteam.com/" target="_blank">@lex Guestbook</a> © - <a href="javascript: script_popup('infos_spam.php?lang=<mx:text id="lang"/>', 'down', 350, 280, 'scrollbars=yes')"><mx:text id="avis_spammeurs"/></a></p>

If the skin you are using bears the mention "chezpierre" or was based upon a "chez pierre" skin, replace the existing copyright with :
<!-- // // Alexis Soulard 2002 - 2005 // I request you retain the full copyright notice below including the link to www.alexphpteam.com. This not only gives respect to the large amount of time given freely by the developer but also helps build interest, traffic and use of @lex Guestbook. If you refuse to include even this then support on our guestbook may be affected. --> <b>___________________________________________________________<br />Powered by : <a href="http://www.alexphpteam.com" target="_blank">@lex Livre D'or</a> © - <a href="javascript: script_popup('infos_spam.php?lang=<mx:text id="lang"/>', 'down', 350, 280, 'scrollbars=yes')"><mx:text id="avis_spammeurs"/></a><br /></b>Skin design by : <a href="http://www.chez-pierre.net/" target="_blank">Un prof belge en vadrouille</a></center><br /><br /></center>
> Edit the file "add_message.htm", starting on line 70, replace the following line(s):

<tr> <td width="100%" colspan="2"> <p align="center"><mx:formField id="message_textarea" rows="8" cols="69"/></p> </td> </tr>

With:
<tr> <td width="100%" colspan="2"> <p align="center"><textarea id="message_textarea" rows="8" cols="69" onselect="verifCar(this); storeCaret(this); " onclick="verifCar(this); storeCaret(this);" onkeyup="verifCar(this); storeCaret(this);" onFocus="verifCar(this)" onKeyDown="verifCar(this)" onBlur="verifCar(this)" name="message_textarea" /></textarea><br> <mx:bloc id="bloc_max_car"> <input type="text" name="reste_car" value="<mx:text id="value_max_car"/>" size="100" style="border: 0; background: transparent; font-size: 10px; text-align: center; width: 100%" readonly /> </mx:bloc id="bloc_max_car"> </p> </td> </tr>
> Around line 5, look for this instruction: "<FORM NAME="ajouter" METHOD="post" ACTION="<mx:text id="action_url"/>" onsubmit="javascript:return verif_add();">" and replace it with:
<FORM ID="form_add_guest" METHOD="post" ACTION="<mx:text id="action_url"/>" onsubmit="javascript:return verif_add();">
You're done, you script is up to date :o)