<?php
/*
    CREATIVE COMMONS - Attribution-No Derivative Works 3.0 Germany:
    - You may not alter, transform, or build upon this work.
    - Dieses Werk darf nicht bearbeitet oder in anderer Weise verändert werden.
*/
  // Variablen definieren
    
    global $DB_PREFIX;
    global $Path;
    include('guestbook/functions.php');
    $ImportFehler = '0';
    $FileName = 'guestbook.csv';
  // Datei checken
    if ( !$datei = fopen($Path."/".$FileName, 'r') )
       { echo 'Error: File not Found! ('.$FileName.')<br /><br />'; }
    else
    {
      // Alte Datensätze löschen
        if ( $_SESSION["ImportOverwriteGuestbook"] )
        {
          $SQL = "DELETE FROM ".DB_PREFIX."guestbook";
          $resultat = mysql_query($SQL);
          if ( $resultat ) { echo $L_Old_guestbook_entries_were_deleted.'<br />'; }
          else  { echo '<span class="ERROR">'.$_ERROR_Old_guestbook_entries_NOT_deleted.'</span><br />'; }
        }
      // Neue Datensätze importieren
        include ('functions/import/'.$Version.'/guestbook.php');

        if ( $ImportFehler=='0' ) { echo $L_Guestbook_successfully_imported.'<br />'; }
        else { echo '<span class="ERROR">'.$L_ERROR_Guestbook_NOT_imported.' ('.$ImportFehler.')</span><br />'; }
      }
    echo '<br />';
?>
