Be sure writing is allowed in this directory."; $langPassChanged = "The password has been changed."; $langPassError = "The new passwords don't match !"; $langPassword = "Change Big Sam Password"; $langRetype = "Retype new Password :"; $langSubmit = "Send the message"; $langSubmitModif = "Submit Modifications"; $langSystemError = "System Error"; $langSystemMessage = "System Message"; $langWrongPassword = "Wrong Admin Password"; /* // FRENCH $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 !
Assurez-vous d'avoir les droits d'écriture."; $langPassChanged = "Le mot de passe a été changé."; $langPassError = "Les mots de passe ne correspondent pas."; $langPassword = "Changer le mot de passe de Big Sam"; $langRetype = "Confirmez le mot de passe :"; $langSubmit = "Envoyer le message"; $langSubmitModif = "Confirmer les modifications"; $langSystemError = "Erreur Système"; $langSystemMessage = "Message du Système"; $langWrongPassword = "Mauvais mot de passe"; // GERMAN // By Klaus-Peter Walter $langAdminError = "Administrator Fehler"; $langBsGuestbook = "BIG SAM Gästebuch"; $langChPassword = "Ändere Passwort"; $langEmail = "eMail :"; $langEntry = "Eintrag"; $langGbAdmin = "Gästebuch Administration"; $langMessage = "Ihre Nachricht :"; $langName = "Name :"; $langnewPassword = "Neus Passwort :"; $langOpenError = "Fehler beim öffnen der Datei !
Sind Sie sicher, daß Sie die richtigen Rechte für dieses Verzeichnis besitzen ?"; $langPassChanged = "Neus Passwort OK."; $langPassError = "Das neue Password funktioniert nicht !"; $langPassword = "Ändere Big Sam Passwort"; $langRetype = "Wiederholen Sie das neue Passwort :"; $langSubmit = "Nachricht abschicken"; $langSubmitModif = "Änderungen abschicken"; $langSystemError = "System Fehler"; $langSystemMessage = "System Nachricht"; $langWrongPassword = "Falsches Administrator-Passwort"; //SPANISH //By Valéry Frémaux (vf@eisti.fr) $langAdminError = "Error Del Administrador"; $langBsGuestbook = "BIG SAM Guestbook "; $langChPassword = "Cambio del pass"; $langEmail = "E-mail: "; $langEntry = "Elemento: "; $langGbAdmin = "Administración Del Guestbook"; $langMessage = "Mensaje: "; $langName = "Nombre: "; $langnewPassword = "Nuevo pass: "; $langOpenError = "Error de escritura del fichero!
Verifica que es possible escribir en este directorio."; $langPassChanged = "Se ha cambiado el pass."; $langPassError = "Los pass no corresponden!"; $langPassword = "Cambie el pass de Big Sam"; $langRetype = "Confirma su nuevo pass: "; $langSubmit = "Manda "; $langSubmitModif = "Manda Las Modificaciones"; $langSystemError = "Error Sistema"; $langSystemMessage = "Mensaje del sistema"; $langWrongPassword = "Pass Incorrecto"; // DUTCH // By Dimitri van Hees (p.vanhees@chello.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 !
CHMOD moet 777 zijn in deze map."; $langPassChanged = "Het wachtwoord is veranderd."; $langPassError = "Het zijn verschillende wachtwoorden !"; $langPassword = "Verander Big Sam wachtwoord"; $langRetype = "Type het nieuwe wachtwoord nogmaals :"; $langSubmit = "Zet in gastenboek!"; $langSubmitModif = "Breng veranderingen aan"; $langSystemError = "Systeemfout"; $langSystemMessage = "Systeembericht"; $langWrongPassword = "Verkeerd wachtwoord!"; //ITALIAN // By Piero Mannelli (webmaster@subnet.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 !
Assicurati che la directory abbia i permessi di scrittura."; $langPassChanged = "La password è stata cambiata."; $langPassError = "La nuova password non corrisponde !"; $langPassword = "Cambia la Password di Big Sam"; $langRetype = "Ripeti password :"; $langSubmit = "Invia il messaggio"; $langSubmitModif = "Invia modifiche"; $langSystemError = "Errore di sistema"; $langSystemMessage = "Messaggio di sistema"; $langWrongPassword = "Password Amministratore Errata"; // DANISH // By Steven Rasmussen (sr@danmedia.dk) $langAdminError ="Administration Fejl"; $langBsGuestbook ="Big Sam Guestbook"; $langChPassword ="Skift kode"; $langEmail = "E-mail :"; $langEntry = "Entry"; $langGbAdmin ="Guestbook Administration"; $langMessage ="Meddelse :"; $langName = "Navn :"; $langnewPassword = "Ny Kode :"; $langOpenError = "Fejl ved Åbning af fil!
Vær sikker på at du har tilladelse at åbne bibliotekket"; $langPassChanged ="Koden er blevet ændret."; $langPassError = "De nye koder passer ikke sammen !"; $langPassword = "Skift BØLLE-BOP & Flying Superkids Guestbook Password"; $langRetype = "Genskriv Kode :"; $langSubmit = "Send din Meddelse"; $langSubmitModif ="Indsend Modification"; $langSystemError ="System Fejl"; $langSystemMessage ="System Meddelse"; $langWrongPassword ="Forkert Administrator kode"; // PORTUGUESE // By Guilherme Halls (halls@email.com.br) $langAdminError = "Erro do Administrador"; $langBsGuestbook = "BIG SAM Guestbook"; $langChPassword = "Alterar a senha"; $langEmail = "E-mail :"; $langEntry = "Entrada"; $langGbAdmin = "Administração do Guestbook"; $langMessage = "Mensagem :"; $langName = "Nome :"; $langnewPassword = "Nova Senha :"; $langOpenError = "Erro Abrindo o arquivo!
Certifique que o diretório está com permição para gravação."; $langPassChanged = "A senha foi alterada."; $langPassError = "As senhas são diferentes !"; $langPassword = "Mudar a senha do Big Sam"; $langRetype = "Confirme a nova senha :"; $langSubmit = "Postar a mensagem"; $langSubmitModif = "Aplicar Modificações"; $langSystemError = "Erro no Sistema"; $langSystemMessage = "Mensagem do Sistema"; $langWrongPassword = "Senha incorreta"; */ /******************************************* * 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 =1; $mailRecipient =""; $mailSubject =""; /******************************** * 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 = "\"#000000\""; $colorBody1 = "\"#CCCCCC\""; $colorBody2 = "\"#999999\""; // 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"); echo ("\n"); echo ("\n"); // You migh use and include instead of all this : // include ("head.inc"); ?> Welcome to my guestbook.






\n"); echo ("Z powodu pojawiania siê codziennie
ogromnej ilo¶ci wpisów reklamowych oraz nie do mnie adresowanych,
postanowi³am zawiesiæ mo¿liwo¶æ wpisywania siê do ksiêgi go¶ci.

Jola Lipka\n"); echo ("\n"); } //****************************************************************************** // 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(); echo ("
"); echo ("
"); echo ("  $langBsGuestbook
"); echo ("
"); if ($msgType=="1") // Admin Message echo ("  $langAdminError"); if ($msgType=="2") // System Error echo ("  $langSystemError"); if ($msgType=="3") // System Message echo ("  $langSystemMessage"); echo (""); echo ("
"); echo (""); echo ("
$errorMessage

"); echo ("

 

\n"); echo ("
"); 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", "
", $str); $str = str_replace("$", "$", $str); return $str; } function standardizeDisplayedText($str) { return ($str); } function standardizeAdminText($str) { return $str; } function seekHttp($rawText) { $pattern=array( "/http:\/\/((\w|\.|\?|\%|=|\/)*)/", "/mailto:((\w|\.|@)*)/"); $replacement=array( "http://\\1", "\\1"); $hyperlinkedText=preg_replace($pattern, $replacement, $rawText); return $hyperlinkedText; } //****************************************************************************** // function Xfopen : opens a file $fileName and locks it function Xfopen($fileName, $openMode, $sharing) { global $langOpenError; $fp=fopen($fileName, $openMode); if ($fp<0) { displayMessage($langOpenError,2); } if ($sharing==true) { $op=1; } else { $op=2; } if (!flock($fp,$op)) { flock($fp,3); displayMessage("flock 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 ; global $entryHeadColor,$entryHeadText, $entryBodyColor1,$entryBodyText1, $entryBodyColor2,$entryBodyText2 ; global $relativeScriptPath; global $index; global $archive_mail, $archive_name, $archive_text, $archive_date; global $allowAutoLink; displayHeader(); // Displays the entry form to enable the client to type a message. displayForm(); if ($index==0) { displayFooter(); return; } echo ("

 

\n"); // Message arrays are displayed here : echo "
\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--) { echo ("
"); echo ("    $archive_date[$msgNumber]    "); echo ("
"); echo (""); if ($archive_mail[$msgNumber]!="") { echo ("$msgNumber : ".standardizeDisplayedText($archive_name[$msgNumber]).""); } else { echo ("$msgNumber : ".standardizeDisplayedText($archive_name[$msgNumber])); } echo (""); echo ("
"); echo (""); if ($allowAutoLink==1) echo ("".seekHttp(standardizeDisplayedText($archive_text[$msgNumber])).""); else echo ("".standardizeDisplayedText($archive_text[$msgNumber]).""); echo ("


\n"); } echo ("

 

\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 ("[$nextBegin-$nextEnd]\n"); else if ($displayBegin==$nextBegin && $nextEnd==$nextBegin) echo ("[$nextBegin]\n"); else if ($nextEnd==$nextBegin) echo ("[$nextBegin]\n"); else echo ("[$nextBegin-$nextEnd]\n"); } echo "
\n"; displayFooter(); } //****************************************************************************** function readData($resetBegin) { global $adminpassword; global $index; global $dataFile; global $archive_mail, $archive_name, $archive_text, $archive_date; global $displayBegin, $displayStep; // 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; } } //****************************************************************************** // If the Datafile does not exist, creates it. if (!file_exists(${dataFile})) { $fout = Xfopen($dataFile, "w+", false); fputs($fout, ""); Xfclose ($fout); } if (!isset($admin)) { 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 { $pos0 = eregi('www.',$message); $pos1 = eregi('http',$message); $pos2 = eregi('href',$message); $pos3 = eregi('kossakowski',$message); //echo "pos:".$pos0; if(($pos0=='1') || ($pos1=='1') || ($pos2=='1') || ($pos3=='1') ) { readData(0); fullDisplay(); } 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. $mailBody = "From: $name <$email>\n$insert_msgdate\n$message"; if ($carbonCopy==1) { //mail($mailRecipient,$mailSubject,$mailBody,"From: $email\nReply-to: $name <$email>"); } if (strpos($HTTP_REFERER, "?")==false) $page=$HTTP_REFERER; else $page=substr($HTTP_REFERER, 0, strpos($HTTP_REFERER, "?")); header("Location: $page?"); exit; } } } else { readData(0); if ($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. * ************************************************************************/ echo("

BIG SAM

$langGbAdmin

\n"); echo("
\n"); // Display the form which enables the admin to change his password echo ("
\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("
\n"); echo (" $langPassword.
"); echo ("  $langnewPassword"); echo (" 
"); echo ("  $langRetype"); echo (" 
\n"); echo ("\n"); echo ("\n"); echo ("
\n"); echo ("
\n"); echo("


\n"); // Message arrays are displayed here in forms in order to modify them : echo ("
\n"); for ($i=1 ; $i<=$index ; $i++) { $msgNumber = $index - $i + 1; $str = str_replace("
", "\r\n", $archive_text[$msgNumber]); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n
\n"); echo (" "); echo ("$langEntry #$msgNumber. 
  
\n
\n"); } echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("
\n"); 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,""); 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,""); Xfclose($fout); if (strpos($HTTP_REFERER, "?")==false) $page=$HTTP_REFERER; else $page=substr($HTTP_REFERER, 0, strpos($HTTP_REFERER, "?")); 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); } } ?>