<?php

// *************************************************************** //
// *                                                             * //
// *    BIG SAM   :   Built-In Guestbook / Stand-Alone Module    * //
// *             Version 1.2.02 November, 27th 2004              * //
// *                                                             * //
// * Copyleft 2004 Georges Zadrozynski & Remi Lecoupe-Grainville * //
// *                                                             * //
// *           Homepage : http://bigsam.gezzed.net/              * //
// *    Contact : http://groups.yahoo.com/group/bigsam-users/    * //
// *                                                             * //
// *     This source is under GNU/GPL General Public License     * //
// *                                                             * //
// *************************************************************** //


/*
    BIG SAM - Built-In Guestbook / Stand-Alone Module - PHP Guestbook
    Copyright (C) Georges Zadrozynski & Remi Lecoupe-Grainville
    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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

$version "1.2.02";

    
/**********************************
    * Configuration Step 1 : Language *
    **********************************/

// Please remove all the unwanted language blocks

//ENGLISH
$langAdminError         "Administrator Error";        
$langBsGuestbook        "BIG SAM Guestbook";        
$langChPassword         "Change Password";
$langEmail              "E-mail :";
$langEntry              "Entry";
$langGbAdmin            "Guestbook Administration";
$langMessage            "Message :";
$langName               "Name :";
$langnewPassword        "New Password :";        
$langOpenError          "Error opening file !<br>Be sure writing is allowed in this directory.";
$langPassChanged        "The password has been changed.";        
$langPassError          "The new passwords don't match !";
$langPassword           "Change <i>Big Sam</i> Password";
$langRetype             "Retype new Password :";
$langSubmit             "Send the message";
$langSubmitModif        "Submit Modifications";        
$langSystemError        "System Error";        
$langSystemMessage      "System Message";        
$langWrongPassword      "Wrong Admin Password";

/*

// CATALAN
// By Alfredo Prades (alfred at terrik dot net----http://www.terrik.net)
$langAdminError         = "Error del administradoe";
$langBsGuestbook        = "BIG SAM Guestbook";
$langChPassword         = "Canvi del pass";
$langEmail              = "E-mail: ";
$langEntry              = "Element: ";
$langGbAdmin            = "Administracis del llista de visites";
$langMessage            = "Mensaje: ";
$langName               = "Nom: ";
$langnewPassword        = "Nou pass: ";
$langOpenError          = "Error de escritura de ficher!<br>Verifica que es posible escriure en este directori.";
$langPassChanged        = "Se ha canviat el pass.";
$langPassError          = "Els pass no corresponen!";
$langPassword           = "Cavie el pass de <i>Big Sam</i>";
$langRetype             = "Confirme el seu nou pass: ";
$langSubmit             = "Envia ";
$langSubmitModif        = "Envia les modificacions";
$langSystemError        = "Error Sistema";
$langSystemMessage      = "Mensaje del sistema";
$langWrongPassword      = "Pass Incorrecte";

// CREOLE
// By Pascal Lombard (plombard_00 at yahoo dot fr)
$langAdminError         = "Administratir'la twompi koy'";       
$langBsGuestbook        = "BIG SAM - Livre d'Or";       
$langChPassword         = "Changi passwod'la";
$langEmail              = "Ba moin email ou :";
$langEntry              = "Ladja pawol'";
$langGbAdmin            = "Administri bagay'la";
$langMessage            = "Sa ki pawol'ou :";
$langName               = "Sa ki nomw' ti mal' ?";
$langnewPassword        = "Ba moin a bel ti passwod :"; 
$langOpenError          = "An pi pa wouvh fichier'a!<br>hs ou ni ci dwouht'la ?";
$langPassChanged        = "Passwod'la fini changi";     
$langPassError          = "Ci di passwod'la pa pareil.";
$langPassword           = "Changi passwod <i>Big Sam</i>'la";
$langRetype             = "Tapi'y enco :";
$langSubmit             = "Vwiyi pawol'la";
$langSubmitModif        = "Changi tout'ci bagay'la";    
$langSystemError        = "Systhm'la pa ka machi";      
$langSystemMessage      = "Tann'bien ! Systhm'la ka diw";       
$langWrongPassword      = "An-an, ti mal'! Sa pa passwod'la !";

// CROATIAN
// By Neven Antic (nantic at inet dot hr)
$langAdminError         = "Upravljacka GreÜka";
$langBsGuestbook        = "BIG SAM Knjiga Gostiju";
$langChPassword         = "Promijeni zaporku";
$langEmail              = "E-mail :";
$langEntry              = "Ulaz";
$langGbAdmin            = "Upravljanje Knjigom gostiju";
$langMessage            = "Poruka :";
$langName               = "Ime :";
$langnewPassword        = "Nova Zaporka :";
$langOpenError          = "GreÜka pri otvaranju dokumenta!<br>Provjerite da li je upis dozvoljen u direktorij.";
$langPassChanged        = "Zaporka je promijenjena.";
$langPassError          = "Nova zaporka nije u redu!";
$langPassword           = "Promijeni <i>Big Sam</i> Zaporku";
$langRetype             = "Ponovi novu zaporku :";
$langSubmit             = "PoÜalji poruku";
$langSubmitModif        = "Unesi promjene";
$langSystemError        = "Sustavna GreÜka";
$langSystemMessage      = "Sustavna Poruka";
$langWrongPassword      = "PogreÜna Upravljacka Zaporka";

// CZECH
// By Vladimír Jarý (vljary dot urk at centrum dot cz) 
$langAdminError         = "Chyba při administraci"; 
$langBsGuestbook        = "BIG SAM Guestbook"; 
$langChPassword         = "Změnit heslo"; 
$langEmail              = "E-mail:"; 
$langEntry              = "Záznam"; 
$langGbAdmin            = "Administrace Guestbooku"; 
$langMessage            = "Vzkaz:"; 
$langName               = "Jméno "; 
$langnewPassword        = "Nové heslo:"; 
$langOpenError          = "Chyba při otevírání souboru !<br>Ujistěte se, zda je zápis v tomto adresáři povolen."; 
$langPassChanged        = "Heslo bylo změněno."; 
$langPassError          = "Nové heslo neodpovídá !"; 
$langPassword           = "Změna hesla správce<i>Big Sam</i>a"; 
$langRetype             = "Nové heslo znovu :"; 
$langSubmit             = "Pošli vzkaz"; 
$langSubmitModif        = "Odešli změny"; 
$langSystemError        = "Systémová chyba"; 
$langSystemMessage      = "Zpráva systému"; 
$langWrongPassword      = "Špatné správcovské heslo";

// DANISH 
// By Steven Rasmussen (sr at danmedia dot dk) & Thomas H. Jxrgensen (holmen at mail dot nu)
$langAdminError         = "Administrationsfejl"; 
$langBsGuestbook        = "BIG SAM Gfstebog"; 
$langChPassword         = "Skift kodeord"; 
$langEmail              = "E-mail :"; 
$langEntry              = "Indlfg"; 
$langGbAdmin            = "Administration af gfstebogen"; 
$langMessage            = "Meddelelse :"; 
$langName               = "Navn :"; 
$langnewPassword        = "Nyt kodeord :"; 
$langOpenError          = "Fejl ved ebning af fil!<br> Kontrollir at du har skriveadgang til denne mappe."; 
$langPassChanged        = "Kodeordet er fndret."; 
$langPassError          = "De nye kodeord er ikke ens!"; 
$langPassword           = "Skift <i>Big Sam</i> kodeord"; 
$langRetype             = "Gentag nye kodeord:"; 
$langSubmit             = "Send meddelelse"; 
$langSubmitModif        = "Send fndringer"; 
$langSystemError        = "Systemfejl"; 
$langSystemMessage      = "Systembesked"; 
$langWrongPassword      = "Forkert administratorkodeord";

// DUTCH
// By Dimitri van Hees (p.vanhees at chello dot nl)
$langAdminError         = "Beheerfout";        
$langBsGuestbook        = "Gastenboek";        
$langChPassword         = "Verander wachtwoord";
$langEmail              = "E-mail :";
$langEntry              = "Entry";
$langGbAdmin            = "Gastenboek beheer";
$langMessage            = "Bericht :";
$langName               = "Naam :";
$langNewPassword        = "Nieuw wachtwoord :";        
$langOpenError          = "Fout bij openen bestand !<br>CHMOD moet 777 zijn in deze map.";
$langPassChanged        = "Het wachtwoord is veranderd.";        
$langPassError          = "Het zijn verschillende wachtwoorden !";
$langPassword           = "Verander <i>Big Sam</i> wachtwoord";
$langRetype             = "Type het nieuwe wachtwoord nogmaals :";
$langSubmit             = "Zet in gastenboek!";
$langSubmitModif        = "Breng veranderingen aan";        
$langSystemError        = "Systeemfout";        
$langSystemMessage      = "Systeembericht";        
$langWrongPassword      = "Verkeerd wachtwoord!";

// FINNISH
// By Jussi Seppä (jseppa3 at welho dot com)
$langAdminError         = "Adminvirhe";      
$langBsGuestbook        = "BIG SAM Vieraskirja";      
$langChPassword         = "Vaihda salasana";
$langEmail              = "Sähköpostisi:";
$langEntry              = "Viestisi";
$langGbAdmin            = "Hallintatyökalu";
$langMessage            = "Viesti:";
$langName               = "Nimesi:";
$langnewPassword        = "Uusi salasana :";      
$langOpenError          = "Virhe avattaessa tiedostoa!<br>Tarkista hakemiston kirjoitusoikeudet.";
$langPassChanged        = "Salasana on vaihdettu.";      
$langPassError          = "Uusi salasana ei täsmää!";
$langPassword           = "Vaihda <i>Big Sam</i> salasana";
$langRetype             = "Kirjoita uudelleen salasana:";
$langSubmit             = "Lähetä";
$langSubmitModif        = "Muuta";      
$langSystemError        = "Systeemivirhe";      
$langSystemMessage      = "Systeemiviesti";      
$langWrongPassword      = "Väärä Admin salasana";

// FRENCH (By The Big Sam Team itself ;)
$langAdminError         = "Erreur Administrateur";        
$langBsGuestbook        = "BIG SAM - Livre d'Or";        
$langChPassword         = "Changement de mot de passe";
$langEmail              = "E-mail :";
$langEntry              = "Message";
$langGbAdmin            = "Administration";
$langMessage            = "Message :";
$langName               = "Nom :";
$langnewPassword        = "Nouveau mot de passe :";        
$langOpenError          = "Erreur d'ouverture de fichier !<br>Assurez-vous d'avoir les droits d'ecriture.";
$langPassChanged        = "Le mot de passe a ete change.";        
$langPassError          = "Les mots de passe ne correspondent pas.";
$langPassword           = "Changer le mot de passe de <i>Big Sam</i>";
$langRetype             = "Confirmez le mot de passe :";
$langSubmit             = "Envoyer le message";
$langSubmitModif        = "Confirmer les modifications";        
$langSystemError        = "Erreur Systeme";        
$langSystemMessage      = "Message du Systeme";        
$langWrongPassword      = "Mauvais mot de passe";        

// GERMAN
// By Klaus-Peter Walter & Gvtz Waschk (waschk at informatik dot uni-rostock dot de)
$langAdminError         = "Administrator Fehler";        
$langBsGuestbook        = "BIG SAM G&auml;stebuch";        
$langChPassword         = "&Auml;ndere Passwort";
$langEmail              = "eMail :";
$langEntry              = "Eintrag";
$langGbAdmin            = "G&auml;stebuch Administration";
$langMessage            = "Ihre Nachricht :";
$langName               = "Name :";
$langnewPassword        = "Neues Passwort :";        
$langOpenError          = "Fehler beim &ouml;ffnen der Datei !<br>Sind Sie sicher, dass Sie die richtigen Rechte f&uuml;r dieses Verzeichnis besitzen ?";
$langPassChanged        = "Neues Passwort OK.";        
$langPassError          = "Das neue Password funktioniert nicht !";
$langPassword           = "&Auml;ndere <i>Big Sam</i> Passwort";
$langRetype             = "Wiederholen Sie das neue Passwort :";
$langSubmit             = "Nachricht abschicken";
$langSubmitModif        = "&Auml;nderungen abschicken";        
$langSystemError        = "System Fehler";        
$langSystemMessage      = "System Nachricht";        
$langWrongPassword      = "Falsches Administrator-Passwort";        

// HUNGARIAN
// By Csaba Csanaki (Csaba at Csanaki dot hu), modified by Vt K.
$langAdminError         = "Kezel&eacute;si hiba"; 
$langBsGuestbook        = "BIG SAM Vend&eacute;gk&ouml;nyv"; 
$langChPassword         = "Jelsz&oacute;v&aacute;ltoztat&aacute;s";
$langEmail              = "E-mail:";
$langEntry              = "Bejegyz&eacute;s";
$langGbAdmin            = "Vend&eacute;gk&ouml;nyv-kezel&eacute;s";
$langMessage            = "&Uuml;zenet:";
$langName               = "N&eacute;v:";
$langnewPassword        = "&Uacute;j jelsz&oacute;:"; 
$langOpenError          = "F&aacute;jl-megnyit&aacute;si hiba!<br>Ellen&#337;rizd a k&ouml;nyvt&aacute;r &iacute;r&aacute;si jog&aacute;t.";
$langPassChanged        = "A jelsz&oacute;t sikeresen megv&aacute;ltoztattad."; 
$langPassError          = "A k&eacute;t jelsz&oacute; nem egyezik!";
$langPassword           = "<i>Big Sam</i>-jelsz&oacute; megv&aacute;ltoztat&aacute;sa";
$langRetype             = "Add meg &uacute;jra a jelsz&oacute;t:";
$langSubmit             = "&Uuml;zenet k&uuml;ld&eacute;se";
$langSubmitModif        = "M&oacute;dos&iacute;t&aacute;sok &eacute;letbel&eacute;ptet&eacute;se";
$langSystemError        = "Rendszerhiba"; 
$langSystemMessage      = "Rendszer&uuml;zenet"; 
$langWrongPassword      = "Rossz jelsz&oacute;";

// INDONESIAN
// By Evi Saroinsong (m26499188 at john.petra dot ac dot id)
$langAdminError         = "Administrator Error";        
$langBsGuestbook        = "Guestbook BIG SAM";        
$langChPassword         = "Ganti Password";
$langEmail              = "E-mail :";
$langEntry              = "Entry";
$langGbAdmin            = "Administrasi Guestbook";
$langMessage            = "Pesan :";
$langName               = "Nama :";
$langnewPassword        = "Password Baru :";        
$langOpenError          = "File tidak dapat dibuka !<br>Cek lagi permission write untuk direktori ini!";
$langPassChanged        = "Password telah diganti.";        
$langPassError          = "Password baru dan verifikasinya tidak cocok";
$langPassword           = "Ganti Password <i>Big Sam</i> ";
$langRetype             = "Ketikkan password baru: ";
$langSubmit             = "Kirim Pesan";
$langSubmitModif        = "Kirim Hasil Modifikasi";        
$langSystemError        = "System Error";        
$langSystemMessage      = "Pesan dari System";        
$langWrongPassword      = "Password Adminnya Salah!";

// ITALIAN
// By Piero Mannelli (webmaster at subnet dot it)
$langAdminError         = "Errore Amministratore";
$langBsGuestbook        = "BIG SAM Guestbook";
$langChPassword         = "Cambia Password";
$langEmail              = "E-mail :";
$langEntry              = "Messaggio";
$langGbAdmin            = "Amministrazione Guestbook";
$langMessage            = "Messaggio :";
$langName               = "Nome :";
$langnewPassword        = "Nuova password :";
$langOpenError          = "Errore di apertura del file !<br>Assicurati che la directory abbia i permessi di scrittura.";
$langPassChanged        = "La password h stata cambiata.";
$langPassError          = "La nuova password non corrisponde !";
$langPassword           = "Cambia la Password di <i>Big Sam</i>";
$langRetype             = "Ripeti password :";
$langSubmit             = "Invia il messaggio";
$langSubmitModif        = "Invia modifiche";
$langSystemError        = "Errore di sistema";
$langSystemMessage      = "Messaggio di sistema";
$langWrongPassword      = "Password Amministratore Errata";

// LITHUANIAN(ISO-8859-13)
// By Andrius Kurtinaitis (andrius dot kurtinaitis at maf dot vu dot lt )
$langAdminError         = "Administravimo klaida";
$langBsGuestbook        = "Svečiř knyga";
$langChPassword         = "Keisti slaptaţodá";
$langEmail              = "El. pađtas:";
$langEntry              = "Laukas";
$langGbAdmin            = "Svečiř knygos administravimas";
$langMessage            = "Atsakymas:";
$langName               = "Vardas:";
$langnewPassword        = "Naujas slaptaţodis:";
$langOpenError          = "Negaliu atidaryti failo!<br>Ásitikink, kad tavo katalogas rađomas.";
$langPassChanged        = "Pakeitëme slaptaţodá.";
$langPassError          = "Naujieji slaptaţodţiai nesutampa!";
$langPassword           = "Pakeisti svečiř knygos slaptaţodá";
$langRetype             = "Pkartokite naujŕjá slaptaţodá:";
$langSubmit             = "Patvirtinu";
$langSubmitModif        = "Iđsaugoti pakeitimus";
$langSystemError        = "Sistemos klaida";
$langSystemMessage      = "Sistemos praneđimas";
$langWrongPassword      = "Neteisingas administratoriaus slaptaţodis";

// NORWEGIAN
// By Lasse G. Dahl (news at lassedahl dot com)
$langAdminError         = "Administrasjonsfeil";
$langBsGuestbook        = "Big Sam Gjestebok";
$langChPassword         = "Endre passord";
$langEmail              = "E-post:";
$langEntry              = "Oppf&oslash;ring";
$langGbAdmin            = "Gjestebokadministrasjon";
$langMessage            = "Melding:";
$langName               = "Navn:";
$langnewPassword        = "Nytt passord:";
$langOpenError          = "Feil ved &aring;pning av fil!<br>Kontroller at webserveren har skrivetilgang i denne katalogen.";
$langPassChanged        = "Passordet er endret.";
$langPassError          = "Passordene stemmer ikke overens!";
$langPassword           = "Endre <i>BIG SAM</I>-passord";
$langRetype             = "Gjenta passord:";
$langSubmit             = "Send din melding";
$langSubmitModif        = "Send endring";
$langSystemError        = "Systemfeil";
$langSystemMessage      = "Systemmelding";
$langWrongPassword      = "Feil administratorpassord";

// POLISH (ISO-8859-2)
// By Lukasz Razmuk (lukaszr at virgo dot com dot pl)
//                 Please add the follwing line in the header :
//                 echo ("<meta charset=iso-8859-2></head>");
$langAdminError         = "Blad Administratora";
$langBsGuestbook        = "BIG SAM ksiazka gosci";
$langChPassword         = "zmien haslo";
$langEmail              = "E-mail :";
$langEntry              = "Wpis";
$langGbAdmin            = "Administracja ksiega gosci";
$langMessage            = "Wiadomosc :";
$langName               = "Imie :";
$langnewPassword        = "Nowe haslo :";
$langOpenError          = "Blad podczas otwierania pliku!<br>SprawdL czy masz prawa zapisu do katalogu";
$langPassChanged        = "Haslo zostalo zmienione";
$langPassError          = "Wpisz dwa razy dokladnie to samo haslo!";
$langPassword           = "Zmiana <i>Big Sam</i> hasla";
$langRetype             = "Wpisz ponownie haslo :";
$langSubmit             = "Wyslij wiadomosc";
$langSubmitModif        = "Zapisz zmiany";
$langSystemError        = "Blad systemowy";
$langSystemMessage      = "Wiadomosc Systemowa";
$langWrongPassword      = "Bledne haslo administratora";

// PORTUGUESE
// By Guilherme Halls (halls at email dot com dot br)
$langAdminError         = "Erro do Administrador"; 
$langBsGuestbook        = "BIG SAM Guestbook"; 
$langChPassword         = "Alterar a senha";
$langEmail              = "E-mail :";
$langEntry              = "Entrada";
$langGbAdmin            = "Administragco do Guestbook";
$langMessage            = "Mensagem :";
$langName               = "Nome :";
$langnewPassword        = "Nova Senha :"; 
$langOpenError          = "Erro Abrindo o arquivo!<br>Certifique que o diretsrio esta com permigco para gravagco.";
$langPassChanged        = "A senha foi alterada."; 
$langPassError          = "As senhas sco diferentes !";
$langPassword           = "Mudar a senha do <i>Big Sam</i>";
$langRetype             = "Confirme a nova senha :";
$langSubmit             = "Postar a mensagem";
$langSubmitModif        = "Aplicar Modificagues"; 
$langSystemError        = "Erro no Sistema"; 
$langSystemMessage      = "Mensagem do Sistema"; 
$langWrongPassword      = "Senha incorreta";

// RUSSIAN
// By Roman Svetlov (rtype at mail dot ru)
$langAdminError         = "o[IBKA ADMINISTRATORA";      
$langBsGuestbook        = "gOSTEWAQ KNIGA BIG SAM";     
$langChPassword         = "iZMENITX PAROLX";
$langEmail              = "E-mail :";
$langEntry              = "zAPISX";
$langGbAdmin            = "aDMINISTRIROWANIE GOSTEWOJ KNIGI";
$langMessage            = "sOOB]ENIE :";
$langName               = "iMQ :";
$langnewPassword        = "HOWYJ PAROLX :";     
$langOpenError          = "o[IBKA OTKRYTIQ FAJLA !<br>wOZMOVNO ZAPRE]ENA ZAPISX W DIREKTORI@.";
$langPassChanged        = "pAROLX IZMENEN.";    
$langPassError          = "pAROLI RAZLI^NY !";
$langPassword           = "iZMENITE PAROLX <i>Big Sam</i>";
$langRetype             = "pOWTORITE NOWYJ PAROLX :";
$langSubmit             = "oSTAWITX ZAPISX";
$langSubmitModif        = "pODTWERDITX IZMENENIQ";      
$langSystemError        = "sISTEMNAQ O[IBKA";   
$langSystemMessage      = "sISTEMNOE SOOB]ENIE";        
$langWrongPassword      = "HEPRAWILXNYJ PAROLX ADMINISTRATORA";

// SERBIAN (Latin, ISO-8859-2)
// By Alex (alex at palic dot net)
$langAdminError         = "Administrativna gre1ka";
$langBsGuestbook        = "BIG SAM Knjiga gostiju";
$langChPassword         = "Promena lozinke";
$langEmail              = "E-mail :";
$langEntry              = "Ulaz";
$langGbAdmin            = "Administracija knjige gostiju";
$langMessage            = "Poruka :";
$langName               = "Ime :";
$langnewPassword        = "Nova lozinka :";
$langOpenError          = "Gre1ka pri otvaranju dokumenta!<br>Proverite da li je dozvoljeno pisati u direktorijum.";
$langPassChanged        = "Lozinka je promenjena.";
$langPassError          = "Nova lozinka nije ispravna!";
$langPassword           = "Promeni <i>Big Sam</i> lozinku";
$langRetype             = "Ponovi novu lozinku :";
$langSubmit             = "Po1alji poruku";
$langSubmitModif        = "Sa1uvaj promene";
$langSystemError        = "Sistemska gre1ka";
$langSystemMessage      = "Sistemska poruka";
$langWrongPassword      = "Pogre1na administrativna lozinka";

// SLOVAK
// By Marek Grac (xgrac at informatics dot muni dot cz)
$langAdminError         = "Chyba pri administracii";        
$langBsGuestbook        = "BIG SAM Guestbook";        
$langChPassword         = "Zmeni; heslo";
$langEmail              = "E-mail :";
$langEntry              = "Sprava";
$langGbAdmin            = "Administracia knihy nav9tev";
$langMessage            = "Sprava :";
$langName               = "Meno :";
$langnewPassword        = "Novi heslo :";        
$langOpenError          = "Chyba pri otvaranm szboru!<br>Ubezpehte sa, >e je povolen} zapis do datoviho szboru.";
$langPassChanged        = "Heslo bolo zmeneni";        
$langPassError          = "Zadani hesla nie sz rovnaki!";
$langPassword           = "Zmeni; heslo administratora <i>Big Sam</i>";
$langRetype             = "Zopakova; novi heslo :";
$langSubmit             = "Posla; spravu";
$langSubmitModif        = "Potvrdi; zmeny";        
$langSystemError        = "Systimova chyba";        
$langSystemMessage      = "Systimova sprava";
$langWrongPassword      = "Nespravne heslo administratora";

// SPANISH
// By Valery Fremaux (vf at eisti dot fr)
$langAdminError         = "Error Del Administrador";
$langBsGuestbook        = "BIG SAM Guestbook ";
$langChPassword         = "Cambio del pass";
$langEmail              = "E-mail: ";
$langEntry              = "Elemento: ";
$langGbAdmin            = "Administracisn Del Guestbook";
$langMessage            = "Mensaje: ";
$langName               = "Nombre: ";
$langnewPassword        = "Nuevo pass: ";
$langOpenError          = "Error de escritura del fichero!<br>Verifica que es possible escribir en este directorio.";
$langPassChanged        = "Se ha cambiado el pass.";
$langPassError          = "Los pass no corresponden!";
$langPassword           = "Cambie el pass de <i>Big Sam</i>";
$langRetype             = "Confirma su nuevo pass: ";
$langSubmit             = "Manda";
$langSubmitModif        = "Manda Las Modificaciones";
$langSystemError        = "Error Sistema";
$langSystemMessage      = "Mensaje del sistema";
$langWrongPassword      = "Pass Incorrecto";         
*/

    /*******************************************
    * Configuration Step 2 : Carbon Copy Email *
    *******************************************/
    
    
// carbonCopy = 1 enables mail sending to mailRecipient. 
// mailRecipient receives a mail each times an entry is entered (if carbonCopy = 1)
// mailSubject is the subject of the mail which is sent.
$carbonCopy =         0;
$mailRecipient =     "your.mail@your.isp";
$mailSubject =        "[BIG SAM] New Guestbook Entry";


    
/********************************
    * Configuration Step 3 : Colors *
    ********************************/


// Choosing colors (Remove the unwanted color-model)

/*
// Standard (Greys, bright background)
$colorWhite    = "\"#FFFFFF\"";
$colorBlack    = "\"#000000\"";
$colorHeads    = "\"#666666\"";
$colorBody1    = "\"#EEEEEE\"";
$colorBody2    = "\"#DDDDDD\"";
*/

// The Following is the BIG SAM standard
$colorWhite    "\"#FFFFFF\"";
$colorBlack    "\"#000000\"";
$colorHeads    "\"#42426F\"";
$colorBody1    "\"#FFF8DC\"";
$colorBody2    "\"#EFE8CC\"";

// Data submission form colors
$formHeadColor    $colorHeads;
$formBodyColor    $colorBody1;
$formTailColor    $colorBody2;
$formHeadText     $colorWhite;
$formBodyText     $colorBlack;
// Guestbook entries colors
$entryHeadColor   $colorHeads;
$entryBodyColor1  $colorBody2;
$entryBodyColor2  $colorBody1;
$entryHeadText    $colorWhite;
$entryBodyText1   $colorBlack;
$entryBodyText2   $colorHeads;
// Messages colors
$adminHeadColor   $colorHeads;
$adminHeadText    $colorWhite;
$adminBodyColor1  $colorBody2;
$adminBodyText1   $colorBlack;
$adminBodyColor2  $colorBody1;
$adminBodyText2   $colorHeads;


    
/********************************
    * Configuration Step 4 : Header *
    ********************************/
    
    
function displayHeader()
    {
    global 
$version;
    
header ("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
    
?><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<!-- BIG SAM v.<?php echo $version?> * Built_In Guestbook / Stand_Alone Module * http://bigsam.gezzed.net/ -->
<html>
<head><title>Big Sam GuestBook</title></head>
<body bgcolor="#FFFFFF">
<?php
    
// You migh use an "include" (or a "require") instead of all this :
    // include ("head.inc");
    
}

    
/********************************
    * Configuration Step 5 : Footer *
    ********************************/
    
    
function displayFooter()
    {
?>
</body></html>
<?php
    
}


    
/******************************************************
    * Configuration Step 6 : Number of messages displayed *
    ******************************************************/
    

// Number of fields to be displayed simultaneously.
// To display everything, set $displayStep to 0.
$displayStep 20;


    
/***********************************************
    * Configuration Step 7 : Allow AutoLink System *
    ***********************************************/
    
// Allows URLs ans E-Mails in Guestbook text to be replaced by HTTP links.
$allowAutoLink=1;
// Replaces every "@" in text by "at". (to avoid Spam)
$at_replace=true;


    
/******************************************
    * Configuration Step 8 : Register_Globals *
    ******************************************/

// Register_Globals improvements (since version 1.2.0)
// By Hubert Hanghofer (webmaster at BierIG dot org)

// $absoluteScriptPath is the name of the current script (this file) and which
// is going to be modified by itself. This means that (theoretically) this file
// can be  placed anywhere on the system, with any fileName.

// Choose one of the following sections to be used. (These are environment
// variables, which could be different with the PHP version you're using)

$displayBegin         $_GET['displayBegin']; // We definitely missed this, thanks Shimona !

// Environment Variables for PHP, older versions
$absoluteScriptPath     $PATH_TRANSLATED// $SCRIPT_FILENAME might be used instead
$relativeScriptPath     $PHP_SELF;
$refererpage            $HTTP_REFERER;

/*
// Environment Variables for PHP, newer versions
$absoluteScriptPath     = $_SERVER["PATH_TRANSLATED"]; // "SCRIPT_FILENAME" might be used instead
$relativeScriptPath     = $_SERVER["PHP_SELF"];
$refererpage            = $_SERVER["HTTP_REFERER"];
*/


    /************************
    * End of Configuration  *
    ************************/
    
// When the php preprocessor is installed as an independant binary (as CGI).
if ($PATH_INFO!="")
    {
    
$relativeScriptPath     $PATH_INFO;
    }

// To be used when $PHP_SELF contains virtual directory reference
// (for multi-users servers, eg : free.fr, online.fr ...)
if (($SERVER_NAME=="php.proxad.net")||(($SERVER_NAME=="php3.pro.proxad.net")))
    {
    
$relativeScriptPath     substr($relativeScriptPathstrpos(substr($relativeScriptPath1), "/")+1);
    }


$theName=substr($absoluteScriptPath0strrpos($absoluteScriptPath"."));
$extension=substr($absoluteScriptPathstrrpos($absoluteScriptPath".")+1);


// The dataFile contains all the guestbook entries, and $adminpassword .
// $adminpassword is the password which will be asked for any administration
// actions. This password could be changed only if in admin mode (old 
// $adminpassword matches $admin).

// Defines the name of the database file where the entries are stored.
$dataFile "${theName}.dat.${extension}";


//******************************************************************************
// function displayForm : Display the form which enables the client to type a
// message.

function displayForm()
    {
    global 
$relativeScriptPath;
    
$borderThickness 3;

    global 
$formHeadColor;
    global 
$formBodyColor;
    global 
$formTailColor;
    global 
$formHeadText;
    global 
$formBodyText;
    
    global 
$langName;
    global 
$langEmail;
    global 
$langMessage;
    global 
$langSubmit;
    
    
// Writing HTML Code
?>
<center>
<form method="POST" action="<?php echo $relativeScriptPath?>">
<table border="0" cellspacing="0" cellpadding="3">
<tr bgcolor=<?php echo $formHeadColor?>>
<td><font color=<?php echo $formHeadText?>><b><?php echo $langName?></b></font><input name="name" size="20" maxlength="50"></td>
<td>&nbsp;</td>
<td align=right><font color=<?php echo $formHeadText?>><b><?php echo $langEmail?></b></font><input name="email" size="20" maxlength="50"></td>
</tr>
<tr bgcolor=<?php echo $formBodyColor?>><td colspan="3">
<font color=<?php echo $formBodyText?>><b><?php echo $langMessage?></b></font><br>
<center><textarea name="message" cols="60" rows="7"></textarea></center>
</td></tr>
<tr bgcolor=<?php echo $formTailColor?>><td colspan="3" align="right">
<input type="submit" value="<?php echo $langSubmit?>">
</td></tr>
</table>
</form>
</center>
<?php
    
}

//******************************************************************************
// function displayMessage displays the $errorMessage error message.

function displayMessage($errorMessage,$msgType)
    {
    global 
$adminHeadColor;
    global 
$adminHeadText;
    global 
$adminBodyColor1;
    global 
$adminBodyText1;
    global 
$adminBodyColor2;
    global 
$adminBodyText2;
    global 
$langAdminError;
    global 
$langSystemError;
    global 
$langSystemMessage;
    global 
$langBsGuestbook;

    
displayHeader();
    
    if (
$msgType=="1"$messageTitle $langAdminError// Admin Message
    
if ($msgType=="2"$messageTitle $langSystemError// System Error
    
if ($msgType=="3"$messageTitle $langSystemMessage// System Message
    
?>
    <table width="100%" height="100%"><tr><td width="100%" valign="middle" align="center">
    <table cellspacing="0" border="0" width="250"><tr><td bgcolor=<?php echo $adminHeadColor;?>>
    <font Color=<?php echo $adminHeadText;?> size="-3">&nbsp; <?php echo $langBsGuestbook;?></font><br>
    </td></tr><tr><td bgcolor=<?php echo $adminBodyColor1;?>><font color=<?php echo $adminBodyText1;?>>
    <?php echo $messageTitle;?>
    </font>
    </td></tr><tr><td bgcolor=<?php echo $adminBodyColor2;?> align="center">
    <font color=<?php echo $adminBodyText2;?>>
    <br><b><?php echo $errorMessage;?></b><br><br>
    </font></td></tr></table><p>&nbsp;</p>
    </td></tr></table>
    <?php
    displayFooter
();
    exit;
    }


//******************************************************************************
// function standardizeText filters ambiguous chains in $str

function standardizeStoredText($str)
    {
    
$str str_replace("\\'""'"$str);
    
$str str_replace("\\\"""\""$str);
    
$str htmlspecialchars($str);
    
$str str_replace("\n""<br>"$str);
    
$str str_replace("$""&#036;"$str);
    return 
$str;
    }
    

function 
standardizeDisplayedText($str)
    {
    return 
$str;
    }
    
function 
standardizeAdminText($str)
    {
    return 
$str;
    }
    
    
function 
seekHttp($rawText)
{    
    global 
$at_replace;
    
$pattern = array(
        
"/http:\/\/((\w|\.|\?|\%|=|\/|-|~|#)*)/",
        
"/mailto:((\w|\.|@|-)*)/");    
    
$replacement = array(
        
"<a href=\"http://\\1\" target=\"_blank\">http://\\1</a>",
        
"<a href=\"mailto:\\1\">\\1</a>");
    
$hyperLinkedText=preg_replace($pattern$replacement$rawText);
    if (
at_replace$hyperLinkedText str_replace("@"" at "$hyperLinkedText);
    return 
$hyperLinkedText;
}


//******************************************************************************
// function Xfopen : opens a file $fileName and locks it
function Xfopen($fileName$openMode$sharing)
    {
    global 
$langOpenError;
    
$fp=@fopen($fileName$openMode);
    if (!
$fp
        {
        
displayMessage($langOpenError,2);
        }
    if (
$sharing==true)
        {
        
$op=1;
        }
    else
        {
        
$op=2;
        }
    if (!@
flock($fp,$op))
        {
        @
flock($fp,3);
        
displayMessage("<i>flock</i> timeout",2);
        }
    return 
$fp;
    }

//******************************************************************************
// function Xfclose : unlocks the file $fp and closes it
function Xfclose($fp)
    {
    @
flock($fp,3);
    @
fclose($fp);
    }


//******************************************************************************
// function fullDisplay
function fullDisplay()
{
        global 
$displayStep,$displayBegin$maxDisplay ;
        global 
$entryHeadColor,$entryHeadText$entryBodyColor1,$entryBodyText1$entryBodyColor2,$entryBodyText2 ;
        global 
$relativeScriptPath;
        global 
$index;
        global 
$archive_mail$archive_name$archive_text$archive_date;
        global 
$allowAutoLink;

        
// Checks if $displayBegin is not too large (Thanks to Ahmet Sabri ALPER <salper at olympos dot org>)
        
if ($displayBegin>$maxDisplay)
            {
            
$displayBegin=$maxDisplay-$displayStep+1;
            }
            
        
displayHeader();
        
        
// Displays the entry form to enable the client to type a message.
        
displayForm();

        if (
$index==0)
            {
            
displayFooter();
            return;
            }

        echo (
"<p>&nbsp;</p>\n");

        
// Message arrays are displayed here :
        
        
echo "<center>\n";
        
        
// Displaying all the entries.
        
        
if ($displayStep==0)
            {
            
$displayBegin=1;
            
$displayStep=$index;
            }
        
        if (
$displayBegin==1)
            {
            
$startAt=$index $displayStep;
            if (
$startAt==0$startAt=$displayStep;
            }
        else 
            {
            
$startAt=$displayBegin+$displayStep-1;
            }
        
        
        for (
$msgNumber=$startAt $msgNumber>=$displayBegin $msgNumber--)
            {
            
?>
            <table cellspacing="0" border="0" width="600"><tr><td bgcolor=<?php echo $entryHeadColor;?>>
            <font color=<?php echo $entryHeadText?> size="-3">&nbsp; &nbsp; <?php echo $archive_date[$msgNumber]; ?> &nbsp; &nbsp;</font>
            </td></tr><tr><td bgcolor=<?php echo $entryBodyColor1?>>
            <font Color=<?php echo $entryBodyText1?>><b>
            <?php
            
if ($archive_mail[$msgNumber]!="")
                {
?>
                <?php echo $msgNumber?> :
                <a title="<?php echo standardizeDisplayedText($archive_mail[$msgNumber]); ?>"
                href="mailto:<?php echo standardizeDisplayedText($archive_mail[$msgNumber]); ?>">
                <?php echo standardizeDisplayedText($archive_name[$msgNumber]); ?></a>
                <?php }
            else 
                {
?>
                <?php echo $msgNumber?> :
                <?php echo standardizeDisplayedText($archive_name[$msgNumber]); ?>
                <?php ?>
            </b></font>
            </td></tr><tr><td bgcolor=<?php echo $entryBodyColor2?>>
            <font color=<?php echo $entryBodyText2?>>
            <b><?php
            
if ($allowAutoLink==1) echo (seekHttp(standardizeDisplayedText($archive_text[$msgNumber])));
            else echo (
standardizeDisplayedText($archive_text[$msgNumber]));
            
?></b>
            </font></td></tr></table><br><br>
            <?php
            
}
        
        echo (
"<p>&nbsp;</p>\n");
        
        for(
$i=1;$i<=$index;$i=$nextEnd+1)
            {
            
$nextBegin $i;
            
            if (
$i==1)
                {
                
$nextEnd=$index $displayStep;
                if (
$nextEnd==0$nextEnd=$displayStep;
                }
            else 
$nextEnd   $i+$displayStep-1;
            
            if (
$displayBegin==$nextBegin && $nextEnd!=$nextBegin) echo ("<tt>[</tt>$nextBegin-$nextEnd<tt>]</tt>\n");
            else if (
$displayBegin==$nextBegin && $nextEnd==$nextBegin) echo ("<tt>[</tt>$nextBegin<tt>]</tt>\n");
            else if (
$nextEnd==$nextBegin) echo ("<a href=\"$relativeScriptPath?displayBegin=$nextBegin\"><tt>[</tt>$nextBegin<tt>]</tt></a>\n");
            else echo (
"<a href=\"$relativeScriptPath?displayBegin=$nextBegin\"><tt>[</tt>$nextBegin-$nextEnd<tt>]</tt></a>\n");    
            }
        
        echo 
"</center>\n";
        
displayFooter();
}

//******************************************************************************

function readData($resetBegin)
{
    global 
$adminpassword;
    global 
$index;
    global 
$dataFile;
    global 
$archive_mail$archive_name$archive_text$archive_date;
    global 
$displayBegin$displayStep$maxDisplay;

    
// Includes automatically filled data arrays :
    
$index 0;
    
$fout=Xfopen($dataFile"r"true);
    include(
$dataFile);
    
Xfclose($fout);
    
// From now, $index will indicate the number of data entries.
    
    // Beginning of the data to be displayed, default = 1
         
if (!isset($displayBegin)) $displayBegin="";
    if (
$displayBegin=="" || $resetBegin==1
        {
        
$displayBegin $index-$displayStep+1;
        if (
$displayBegin<=0$displayBegin=1;
        }
        
    
// Sets the maximum that $displayBegin can reach
    
$maxDisplay $index;
}
//******************************************************************************




// If the Datafile does not exist, creates it.
if (!file_exists(${dataFile})) 
    {
    
$fout Xfopen($dataFile"w+"false);
    
fputs($fout"<?php\n");
    
fputs($fout"\$adminpassword = \"".md5("bigsam")."\";\n");
    
fputs($fout"\$archive_name[++\$index] = \"The BigSam Team\";\n");
    
fputs($fout"\$archive_mail[  \$index] = \"\";\n");
    
fputs($fout"\$archive_date[  \$index] = \"11th March 2001 - 12:00:00 PM\";\n");
    
fputs($fout"\$archive_text[  \$index] = \"Thank you for using Big Sam v.$version.\";\n");
    
fputs($fout"?>");
    
Xfclose ($fout);
    }

// $admin could be set via Admin-Form by POST or via URL by GET
$admin=$HTTP_POST_VARS["admin"];
if (!isset(
$admin))
        
$admin=$HTTP_GET_VARS["admin"];
else    
// assign POST-variables from Admin-Form
        
{
        
$newPassword1=$HTTP_POST_VARS["newPassword1"];
        
$newPassword2=$HTTP_POST_VARS["newPassword2"];
        
$command=$HTTP_POST_VARS["command"];
        
$index=$HTTP_POST_VARS["index"];
        }

if (!isset(
$admin))
    {
        
// assing variables from Guestbook-From
        
$name=$HTTP_POST_VARS["name"];
        
$email=$HTTP_POST_VARS["email"];
        
$message=$HTTP_POST_VARS["message"];
    if (!isset(
$name)) { $name=""$message=""; }
    if (
$name=="" || $message=="")
        {

        
/************************************************************************************
        * Use Case no 1-A
        *
        * This case is encountered when a client simply wants to add a message to the
        * guestbook. (Every variable is empty);
        ************************************************************************************/
        
readData(0);
        
fullDisplay();
        exit;
        }
    else 
        {
        
        
/********************************************************************************
        * Use Case no 1-B                                *
        *                                        *
        * Case is encountered when a client has just filled in the appropriate fields    *
        * (name, mail, message).                            *
        *    $name    = "Some Name"                            *
        *    $email   = "Some@Email"                            *
        *    $message = "Some Message"                        *
        *        Simply add message in the top of all previous messages.        *
        ********************************************************************************/
        
        
$position filesize($dataFile);
        
        
$fout Xfopen($dataFile"r+"false);
        
fseek($fout,$position-2);
        
$insert_msgdate date"dS F Y - h:i:s A" );
        
$name=standardizeStoredText($name);
        
$email=standardizeStoredText($email);
        
$message=standardizeStoredText($message);
        
fputs ($fout,"\$archive_name[++\$index] = \"$name\";\n");
        
fputs ($fout,"\$archive_mail[  \$index] = \"$email\";\n");
        
fputs ($fout,"\$archive_date[  \$index] = \"$insert_msgdate\";\n");
        
fputs ($fout,"\$archive_text[  \$index] = \"$message\";\n");
        
fputs ($fout,"\n?>");
        
Xfclose($fout);
        
        
// Sending a mail to $mailRecipient if $carbonCopy=1, with the subject $mailSubject.
        
if ($carbonCopy==1)
            {
            
$message str_replace("<br>""\n"$message);
            
$mailBody "From: $name <$email>\n$insert_msgdate\n\n$message";
            
mail($mailRecipient,$mailSubject,$mailBody,"From: $email\nReply-to: $name <$email>");
            }
        if (
strpos($refererpage"?")==false$page=$refererpage;
        else 
$page=substr($refererpage0strpos($refererpage"?"));
        
header("Location: $page?");
        exit;
        }
    }
else
    {
    
readData(0);
    if (
md5($admin)==$adminpassword
        {
        if (
$command==""
            {
    
            
displayHeader();
            
            
/************************************************************************
            * Use Case no 2-A                            *
            *                                    *
            * Admin mode (The administrator can modify password, fields, or remove    *
            * messages).                                *
            *    $admin   = $adminpassword                    *
            *        Shows a password modification form.            *
            *        Shows all messages and enables to modify/delete them.    *
            ************************************************************************/
            
            
?>
            <center><h2>BIG SAM</h2><h4><?php echo $langGbAdmin?></h4></center>
            <br>
            <?php 
            
// Display the form which enables the admin to change his password 
            
?>
            
            <center><form method="POST" action="<?php echo $relativeScriptPath?>">
            <table cellspacing="0" border="0">
            <tr><td bgcolor=<?php echo $adminHeadColor?> colspan="2"><font color=<?php echo $adminHeadText?>>
            &nbsp;<b><?php echo $langPassword?></b>.</font></td></tr>
            <tr><td align=right bgcolor=<?php echo $adminBodyColor2?>>
            <font color=<?php echo $adminBodyText2?>>&nbsp; <?php echo $langnewPassword?></font></td>
            <td align=left bgcolor=<?php echo $adminBodyColor2?>>
            <input type="password" name="newPassword1">&nbsp;</td></tr>
            <tr><td align="right" bgcolor=<?php echo $adminBodyColor2?>>
            <font color=<?php echo $adminBodyText2?>>&nbsp; <?php echo $langRetype?></font></td>
            <td align=left bgcolor=<?php echo $adminBodyColor2?>>
            <input type="password" name="newPassword2">&nbsp;</td></tr>
            <tr><td bgcolor=<?php echo $adminBodyColor1?> colspan=2 align="center">
            <input type="hidden" name="admin" value="<?php echo $admin?>">
            <input type="hidden" name="command" value="passwd">
            <input type="submit" value="<?php echo $langChPassword?>"></td></tr>
            </table>
            </form></center>
            <br><hr><br>
            <?php
            
// Message arrays are displayed here in forms in order to modify them :
            
?>
            <center><form method="POST" action="<?php echo $relativeScriptPath?>">
            <?php
            
for ($i=$i<=$index $i++)
                {
                
$msgNumber $index $i 1;
                
$str str_replace("<br>""\n"$archive_text[$msgNumber]); ?>
                <table cellspacing="0" cellpadding="3"><tr><td colspan="4" bgcolor=<?php echo $adminHeadColor?>>
                <font color=<?php echo $adminHeadText?>><b>&nbsp;
                <?php echo $langEntry?> #<?php echo $msgNumber?></b>.</font>&nbsp;</td></tr>
                <tr bgcolor=<?php echo $adminBodyColor2?>>
                    <td>&nbsp;<input type="checkbox" name="keep<?php echo $msgNumber?>" checked>&nbsp;</td>
                <td><input name="name<?php echo $msgNumber?>" value="<?php echo standardizeAdminText($archive_name[$msgNumber]);?>"></td>
                <td><input name="email<?php echo $msgNumber?>" value="<?php echo standardizeAdminText($archive_mail[$msgNumber]);?>"></td>
                <td><input name="date<?php echo $msgNumber?>" value="<?php echo standardizeAdminText($archive_date[$msgNumber]);?>"></td>
                <tr bgcolor=<?php echo $adminBodyColor1?>>
                <td colspan="4" align="center"><textarea cols="60" rows="2" name="message<?php echo $msgNumber?>"><?php echo standardizeAdminText($str);?></textarea>
                </td></tr></table>
                <br>
                <?php
                
?>
            <input type="hidden" name="admin" value="<?php echo $admin;?>">
            <input type="hidden" name="index" value="<?php echo $index;?>">
            <input type="hidden" name="command" value="modify">
            <input type="submit" value="<?php echo $langSubmitModif;?>">
            </form></center>
            <?php
            displayFooter
();
            exit;
            
            } 
        else if (
$command=="passwd")
            {
            
// Use Case no 2-B
            // Admin mode (The administrator is modifying his password.).
            //    $admin        = $adminpassword
            //    $newPassword1 = "New Password 1"
            //    $newPassword2 = "New Password 2"
            //         Check if $newPassword1 matches $newPassword2
            //         Set the $adminpassword line to :
            //         $adminpassword = "$newPassword1" in the dataFile
            
            
if($newPassword1!=$newPassword2)
                {
                
// The passwords doesn't match
                
displayMessage("$langPassError",1);
                }
            else
                {
                
// Rewrites the whole Datafile with the new password, and all the entries.
                
$fout Xfopen($dataFile"w"false);
                
fputs ($fout,"<?php\n");
                
fputs ($fout,"\$adminpassword = \"".md5($newPassword1)."\";\n");
                for (
$i=$i<=$index ; ++$i)
                    {
                    
fputs ($fout,"\$archive_name[++\$index] = \"${archive_name[$i]}\";\n");
                    
fputs ($fout,"\$archive_mail[  \$index] = \"${archive_mail[$i]}\";\n");
                    
fputs ($fout,"\$archive_date[  \$index] = \"${archive_date[$i]}\";\n");
                    
fputs ($fout,"\$archive_text[  \$index] = \"${archive_text[$i]}\";\n");
                    }
                
fputs ($fout,"?>");
                
Xfclose($fout);
                
displayMessage("$langPassChanged",3);
                exit;
                }
            }
        else if (
$command=="modify"
            {

            
/********************************************************************************
            * Use Case no 2-C                                *
            *                                        *
            * Admin mode (The administrator is updating entries).                *
            *    $admin      = $adminpassword                        *
            *    $nameXXX    = "Modified name (no XXX)"                    *
            *    $emailXXX   = "Modified email (no XXX)"                    *
            *    $messageXXX = "Modified message (no XXX)"                *
            *    $keep       = "on" or ""                        *
            *     Check if $admin matches $adminpassword.                    *
            *     Rewrites ALL the fields except when $keepXXX = ""            *
            *    Rewrites the whole Datafile with the new password, and all the entries.    *
            ********************************************************************************/

            
$fout Xfopen($dataFile"w"false);
            
fputs ($fout,"<?php\n");
            
fputs ($fout,"\$adminpassword = \"$adminpassword\";\n");    
                for (
$i=$i<=$index $i++)
                {
                
// Get values from the form, and standardize them
                
$variable=$HTTP_POST_VARS["name$i"];
                
$name=standardizeStoredText("$variable");
                
$variable=$HTTP_POST_VARS["email$i"];
                
$email=standardizeStoredText("$variable");
                
$variable=$HTTP_POST_VARS["date$i"];
                
$insert_msgdate=standardizeStoredText("$variable");
                
$variable=$HTTP_POST_VARS["message$i"];
                
$message=standardizeStoredText("$variable");

                
$variable=$HTTP_POST_VARS["keep$i"];
                if (${
variable}!="")
                    {
                    
fputs ($fout,"\$archive_name[++\$index] = \"$name\";\n");
                    
fputs ($fout,"\$archive_mail[  \$index] = \"$email\";\n");
                    
fputs ($fout,"\$archive_date[  \$index] = \"$insert_msgdate\";\n");
                    
fputs ($fout,"\$archive_text[  \$index] = \"$message\";\n");
                    }
                }    
            
fputs ($fout,"?>");
            
Xfclose($fout);
            
            if (
strpos($refererpage"?")==false$page=$refererpage;
            else 
$page=substr($refererpage0strpos($refererpage"?"));
            
header("Location: $page?");
            exit;
            }
        } 
    else 
        {
        
        
/************************************************
        * Use Case no 2-Z                *
        *                        *
        * If $admin does NOT match $adminpassword.    *
        *    $admin   != $adminpassword        *
        *    Error message : "Wrong Admin Password"    *
        ************************************************/

        
displayMessage("$langWrongPassword",1);
        }
    }
    
/* End of File */
?>