Instructions to upgrade your AlexGuestbook
version 4.0.* or above to version 5.0


This update features numerous new possibilities, that's why we bring it up as version 5. It's also our way to mark the change from AlexPHPTeam to AlexGuestbook.
The list of changes and corrections to the script is in the changelog_en.txt file.
All informations, updates and support for the script are available on www.alexguestbook.net


Before making any changes, make a backup of your database (and of your skins, if you modified them).

We strongly recommend to install the skins included in this new version and to modify these if necessary. Upgrading an old skin is possible (second part of this page) but it's absolutely not recommended ! The changes are numerous, there's an important risk of making mistakes.


  1. Before starting, make sure you've downloaded the zip with the new version.

  2. Using your FTP software, send all files to your server (replace all existing files), except the "setup.php" file, files in the "config/" and "templates/" folders. However, in this folder : copy and replace also the content of the "templates/admin/ folder.

  3. The structure of the tables in the database has changed. Using your favorite database management software (i.e. phpmyadmin), execute the following requests.
    Attention, the names of your tables might be different, names used here are the default ones. You might also need to change the options values, which here are the default choices.

    Code: Select all
    RENAME TABLE `alex_livre_ip` TO `alex_livre_ban` ;
    ALTER TABLE `alex_livre_ban` CHANGE `id_ip` `id_ban` MEDIUMINT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ;
    ALTER TABLE `alex_livre_ban` ADD `pseudo` VARCHAR( 40 ) NOT NULL , ADD `email` VARCHAR( 150 ) NOT NULL ;
    ALTER TABLE `alex_livre_users` CHANGE `gestion_ip` `gestion_bannissement` TINYINT( 1 ) NOT NULL DEFAULT '0';

    CREATE TABLE `alex_livre_config` (
    `nom_config` varchar(255) NOT NULL,
    `valeur_config` varchar(255),
    KEY `nom_config` (`nom_config`)
    ) Type=MyISAM;
    INSERT INTO `alex_livre_config` VALUES ('langue', 'francais');
    INSERT INTO `alex_livre_config` VALUES ('skin_to_use', 'AguestNew');
    INSERT INTO `alex_livre_config` VALUES ('temps_session', '1800');
    INSERT INTO `alex_livre_config` VALUES ('send_mail', '1');
    INSERT INTO `alex_livre_config` VALUES ('temps_ip_post', '60');
    INSERT INTO `alex_livre_config` VALUES ('format_date', 'd/m/Y');
    INSERT INTO `alex_livre_config` VALUES ('admin_valide_messages', '0');
    INSERT INTO `alex_livre_config` VALUES ('admin_envoyer_remerciement', '0');
    INSERT INTO `alex_livre_config` VALUES ('admin_add_code_securite', '0');
    INSERT INTO `alex_livre_config` VALUES ('admin_bannir_mot', '0');
    INSERT INTO `alex_livre_config` VALUES ('url_interdites', '1');
    INSERT INTO `alex_livre_config` VALUES ('url_cliquables', '0');
    INSERT INTO `alex_livre_config` VALUES ('color_txt_code', '#000000');
    INSERT INTO `alex_livre_config` VALUES ('color_background_code', '#FFFFFF');
    INSERT INTO `alex_livre_config` VALUES ('champ_pseudo', '0');
    INSERT INTO `alex_livre_config` VALUES ('champ_email', '0');
    INSERT INTO `alex_livre_config` VALUES ('champ_site', '0');
    INSERT INTO `alex_livre_config` VALUES ('champ_pays', '0');
    INSERT INTO `alex_livre_config` VALUES ('champ_note', '0');
    INSERT INTO `alex_livre_config` VALUES ('champ_ville', '0');
    INSERT INTO `alex_livre_config` VALUES ('ok_aff_moteur', '1');
    INSERT INTO `alex_livre_config` VALUES ('nb_pages', '10');
    INSERT INTO `alex_livre_config` VALUES ('cut_mots', '75');
    INSERT INTO `alex_livre_config` VALUES ('maxi_car', '1500');
    INSERT INTO `alex_livre_config` VALUES ('nb_max_smileys', '20');
    INSERT INTO `alex_livre_config` VALUES ('url_recharger', 'index.php');
    INSERT INTO `alex_livre_config` VALUES ('extension_url', '');
    INSERT INTO `alex_livre_config` VALUES ('decalage_horaire', '0');
    INSERT INTO `alex_livre_config` VALUES ('autoriser_smileys', '1');
    INSERT INTO `alex_livre_config` VALUES ('inclure_livre', '0');
    INSERT INTO `alex_livre_config` VALUES ('fichier_inclusion', '');
    INSERT INTO `alex_livre_config` VALUES ('donner_focus', '0');
    INSERT INTO `alex_livre_config` VALUES ('lien_admin', '1');
    INSERT INTO `alex_livre_config` VALUES ('lien_accueil', '1');
    INSERT INTO `alex_livre_config` VALUES ('chemin_lien_accueil', '/');
    INSERT INTO `alex_livre_config` VALUES ('symbole_champ_obligatoire', '*');
    INSERT INTO `alex_livre_config` VALUES ('symbole_champ_prive', '[P]');

  4. From the guestbook folder on your host' server, download to your computer the "config/config_base.php" file with your FTP software.

    Open this file with a text editor. Its content should look like this :

    <?php
    $database_type = "MySQL";

    $f_mysql_host = "localhost";
    $f_mysql_user = "root";
    $f_mysql_pass = "****";
    $f_mysql_base = "guestbook";

    $name_table['alex_livre_sessions'] = "alex_livre_sessions";
    $name_table['alex_livre_users'] = "alex_livre_users";
    $name_table['alex_livre_messages'] = "alex_livre_messages";
    $name_table['alex_livre_censure'] = "alex_livre_censure";
    $name_table['alex_livre_ip'] = "alex_livre_ip";
    $name_table['alex_livre_ban'] = "alex_livre_ban";
    $name_table['alex_livre_smileys'] = "alex_livre_smileys";
    $name_table['alex_img_verif_add'] = "alex_img_verif_add";
    $name_table['alex_livre_txt_lang'] = "alex_livre_txt_lang";
    $name_table['alex_livre_config'] = "alex_livre_config";
    ?>

    Replace the crossed out line by the one below, in red.
    Then add the second red line at the end of the file.
    Save the file then re-upload it to the server. Check that the old file has been replaced (if necessary, first delete the file on the server before uploading the modified one).

  5. Go to the admin part of your guestbook, look at the new available options, set these options to your taste, then click on the "save" button. This step is necessary to avoid further problems.

  6. On the server, delete both the /config/config.php and /config/test files.

  7. If you did not modify your skins, you can upload the entire "/templates/skins/" folder, replacing the old one. This method is strongly recommended (the code of the skins has changed a lot !) and furthermore, all skins are now xhtml valid.

    If you wish to keep your old skins, you must upgrade them. If not, this update is now done for you.



Steps to upgrade an old skin :

Let's remind you that it's strongly recommended to adapt a new skin to your needs instead of trying to upgrade an already modified old skin.

Before upgrading your skin, be sure it's at the version 4.0.5 level. If it's not yet the case, see the instructions in the file Instructions to upgrade from version 4.0.4 to version 4.0.5.

OK, it's done, your script is up to date :o)