ConPresso Newsletter Modul ConPresso Warenkorb-Modul ConPresso Formular-Modul ConPresso Galerie/Slideshow-Modul ConPresso Bildskalierungs-Modul ConPresso Menü-Modul ConPresso Mobilseiten-Modul ConPresso Feature-Suche-Modul viele weitere Conpresso Module

News  News

Die Seite befindet sich gerade in einer Umstrukturierungsphase. Daher sind einige Funktionen nicht erreichbar. Bei Bedarf nehmen Sie einfach Kontakt mit uns auf.

enhanced delete

=== OPEN / ÖFFNE ===

_include/tab_files.php

=== FIND / FINDE ===

Code:
echo '<table class="ruler" style="width: 100%;"><thead>';


=== INSERT BEFORE / DAVOR EINFÜGEN ===
Code:
// start part 1 of 3 enhanced delete by m.roesel ***********************************************
echo '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
echo '<input type="hidden" name="action" value="del">';
// end part 1 of 3 enhanced delete by m.roesel ***********************************************


=== FIND / FINDE ===
Code:
         .'" onClick="return confirm(\''.$q.'\')">'
         .'<img src="'.SKIN_URL.'pic_del.gif" class="pic_" '
            .'alt="'.  ($show_only_images ? ___('delete image') : ___('delete file')).'" '
            .'title="'.($show_only_images ? ___('delete image') : ___('delete file')).'" />'
         .'</a>'); 


=== REPLACE WITH / ERSETZEN MIT ===
Code:
// start part 2 of 3 enhanced delete by m.roesel ***********************************************
         .'" >'
         .'<img src="'.SKIN_URL.'pic_del.gif" class="pic_" '
            .'alt="'.  ($show_only_images ? ___('delete image') : ___('delete file')).'" '
            .'title="'.($show_only_images ? ___('delete image') : ___('delete file')).'" />'
         .'</a>'); 
    echo '<input type="checkbox" name="files[]" value="'.htmlspecialchars($db->v('id')).'#CPO#'.htmlspecialchars($db->v('datei')).'">';
// end part 2 of 3 enhanced delete by m.roesel ***********************************************


=== FIND / FINDE ===
Code:
echo '</tbody></table>';


=== REPLACE WITH / ERSETZEN MIT ===
Code:
// start part 3 of 3 enhanced delete by m.roesel ***********************************************
echo '<tr><td></td><td><button type="submit" /><img align="absmiddle" src="'.SKIN_URL.'pic_del.gif" />'.__('selected').'</button></td><td></td><td></td></tr>';
echo '</tbody></table>';
echo '</form>';
// end part 3 of 3 enhanced delete by m.roesel ***********************************************

=== OPEN / ÖFFNE ===

_includesite/i_manage_files.php

=== FIND / FINDE ===

Code:
case 'del':
    $db = new DB;
    $db->query("SELECT datei, format FROM ".CPO_DATA." "
              ."WHERE id='".$_GET['id']."'");
    while ($db->next_record()) {
        $datei = $db->v('datei');
        $format = $db->v('format');
    }

    $query_del = "DELETE FROM ".CPO_DATA." "
                ."WHERE id='".$_GET['id']."'";
    DEBUG(1, $query_del, __FILE__, __LINE__);
    $db->query($query_del);

    @unlink (CPO_BASEDIR.'_data/'.$_GET['file']);

    switch ($format) {
    case 1:
        $message[] = sprintf(___('The file %s was successfully deleted.'), '<em>'.htmlspecialchars($datei).'</em>');
        break;
    case 2:
        $message[] = sprintf(___('The image %s was successfully deleted.'), '<em>'.htmlspecialchars($datei).'</em>');
        break;
    }
   
    logaction('delete file', $_GET['file']);
    $_GET['id'] = '';

    break;


=== REPLACE WITH / ERSETZEN MIT ===
Code:
// start part 1 of 1 enhanced delete by m.roesel ***********************************************
case 'del':
   $db = new DB;
   $articles = array();
   // fetch all articles and states
   $db->query("SELECT nr, titel, artikel_archiv, freigabe, pub_datum, verfallsdatum FROM ".CPO_NEWS);
   while ($db->next_record()) {
      $nr = $db->v('nr');
      $articleData[$nr]['title'] = $db->v('titel');
      $articleData[$nr]['state'] = __('online');
      $articleData[$nr]['color'] = 'red';
      if ($db->v('pub_datum') >= date('Y-m-d H:i:s')) {
         $articleData[$nr]['state'] = 'not published yet';
         $articleData[$nr]['color'] = 'red';
      }
      if ($db->v('verfallsdatum') <= date('Y-m-d H:i:s')) {
         $articleData[$nr]['state'] = __('expired');
         $articleData[$nr]['color'] = 'red';
      }
      if ($db->v('artikel_archiv') == 5) {
         $articleData[$nr]['state'] = __('old article version');
         $articleData[$nr]['color'] = 'green';
      }
      if ($db->v('artikel_archiv') == 9) {
         $articleData[$nr]['state'] = __('deleted article');
         $articleData[$nr]['color'] = 'green';
      }
   }
   $multimode = false;

   if (isset($_GET['id']) && isset($_GET['file'])) {
      $query4files = ($show_only_images) ? "SELECT article_id FROM ".CPO_CONTENT_IMAGES." WHERE image_id=".$_GET['id'] : "SELECT article_id FROM ".CPO_CONTENT_FILES." WHERE file_id=".$_GET['id'];
      $query4articles = "SELECT article_id FROM ".CPO_CONTENT_HTML." WHERE html like '%".$_GET['file']."%'";
      $fileNameColonString = htmlspecialchars($_GET['file']);
      $givenFileIDs[] = $_GET['id'];
   } elseif (isset($_POST['files'])) {
      $multimode = (count($_POST['files']) > 1) ? true : false ;
      foreach($_POST['files'] AS $givenFile)  {
         $givenFileInfo=explode('#CPO#',$givenFile);
         $givenFiles[$givenFileInfo[0]]=$givenFileInfo[1];
         $givenFileIDs[]=$givenFileInfo[0];
         $givenFileNames[]=$givenFileInfo[1];
         $message .= '['.$givenFileInfo[0].'] '.$givenFileInfo[1].'<br />';
      }
      $fileIdString = implode(',',$givenFileIDs);
      $fileNameString = implode("%' OR  html like '%",$givenFileNames);
      $fileNameColonString = implode(", ",$givenFileNames);
      $query4files = ($show_only_images) ? "SELECT article_id FROM ".CPO_CONTENT_IMAGES." WHERE image_id IN (".$fileIdString.")" : "SELECT article_id FROM ".CPO_CONTENT_FILES." WHERE file_id IN (".$fileIdString.")";
      $query4articles = "SELECT article_id FROM ".CPO_CONTENT_HTML." WHERE html like '%".$fileNameString."%'";
   }
   // messages
    switch ($show_only_images) {
    case true:
      $m_stilused = ($multimode) ? __('The images are still used in the following article(s).') : __('The image is still used in the following article(s).');
      $m_unused = ($multimode) ? __('The images %s seem to be unused.') : __('The image %s seems to be unused.');
      $m_confirm = ($multimode) ? __('Are you sure you want to delete the images %s?') : __('Are you sure you want to delete the image %s?');
        break;
    case false:
      $m_stilused = ($multimode) ? __('The files are still used in the following article(s).') : __('The file is still used in the following article(s).');
      $m_unused = ($multimode) ? __('The files %s seem to be unused.') : __('The file %s seems to be unused.');
      $m_confirm = ($multimode) ? __('Are you sure you want to delete the files %s?') : __('Are you sure you want to delete the file %s?');
        break;
    }

   $db->query($query4files);
   while ($db->next_record()) $articles[$db->v('article_id')] = $db->v('article_id');
   $db->query($query4articles);
   while ($db->next_record()) $articles[$db->v('article_id')] = $db->v('article_id');
   if (count($articles) > 0 )   {
      $message = '<span style="color:red">'. $m_stilused  .'</span><br />';
      foreach ($articles AS $articleID)  {
         $message .= '['.$articleID.'] <span style="color:'.$articleData[$articleID]['color'].'">'.$articleData[$articleID]['title'].' - '.__('Status').': '.$articleData[$articleID]['state'].'</span><br />';
      }
   } else {
      $message = '<span style="color:green">' . sprintf( $m_unused , '<em>' . $fileNameColonString . '</em>') . '</span><br />';
   }
   
   $message .=  sprintf( $m_confirm, '<em>'.$fileNameColonString.'</em>');
   $message .= '<br /><br />';
   $message .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
   $message .= '<input type="hidden" name="action" value="reallydelete">';
   foreach ($givenFileIDs AS $hiddenfileID)$message .= '<input type="hidden" name="id[]" value="'.$hiddenfileID.'" />';
   $message .= '<input type="submit" name="yes" value="'.___('Yes, delete').'" />&nbsp;';
   $message .= '<input type="submit" name="no" value="'.___('No, do not delete').'" />';
   $message .= '</form>';
   include(CPO_BASEDIR.'_include/message.php');
   break;
case 'reallydelete':
    $db = new DB;
   $idString=implode(',',$_POST['id']);
    $db->query("SELECT datei FROM ".CPO_DATA." "
              ."WHERE id IN (".$idString.")");
    while ($db->next_record()) {
        $datei[] = $db->v('datei');
    }
   $nameString= implode(', ',$datei);
   if (isset($_POST['no'])) {
      $message[] = __('Aborted by user. No file was deleted.');
      break;
   }

   $query_del = "DELETE FROM ".CPO_DATA." "
                ."WHERE id IN (".$idString.")";
    DEBUG(1, $query_del, __FILE__, __LINE__);
    $db->query($query_del);

    foreach ($datei AS $dateiName) @unlink (CPO_BASEDIR.'_data/'.$dateiName);

    switch ($show_only_images) {
    case true:
        $message[] = sprintf(__('The image(s) %s was successfully deleted.'), '<em>'.$nameString.'</em>');
        break;
    case false:
      $message[] = sprintf(__('The file(s) %s was successfully deleted.'), '<em>'.$nameString.'</em>');
        break;
    }
   
    logaction('delete files', $nameString);
    $_POST['id'] = '';

    break;
// end part 1 of 1 enhanced delete by m.roesel ***********************************************



und wer noch in den Genuß deutscher Texte kommen will macht noch folgendes:

=== OPEN / ÖFFNE ===

_include/lang/deutsch/common.inc.php

=== FIND / FINDE ===

Code:
'' => '');


=== INSERT BEFORE / DAVOR EINFÜGEN ===
Code:
// start part 1 of 1 enhanced delete by m.roesel ***********************************************
'The images are still used in the following article(s).'
=> 'Die Bilder werden derzeit in folgendem Artikel benutzt.',
'The image is still used in the following article(s).'
=> 'Das Bild wird derzeit in folgendem Artikel benutzt.',
'The images %s seem to be unused.'
=> 'Die Bilder %s scheinen derzeit nicht benutzt zu werden.',
'The image %s seems to be unused.'
=> 'Das Bild %s scheint derzeit nicht benutzt zu werden.',
'Are you sure you want to delete the images %s?'
=> 'Sind Sie sicher, daß Sie die Bilder %s löschen wollen?',
'Are you sure you want to delete the image %s?'
=> 'Sind Sie sicher, daß Sie das Bild %s löschen wollen?',
'The files are still used in the following article(s).'
=> 'Die Dateien werden derzeit in folgendem Artikel benutzt.',
'The file is still used in the following article(s).'
=> 'Die Datei wird derzeit in folgendem Artikel benutzt.',
'The files %s seem to be unused.'
=> 'Die Dateien %s scheinen derzeit nicht benutzt zu werden.',
'The file %s seems to be unused.'
=> 'Die Datei %s scheint derzeit nicht benutzt zu werden.',
'Are you sure you want to delete the files %s?'
=> 'Sind Sie sicher, daß Sie die Dateien %s löschen wollen?',
'Are you sure you want to delete the file %s?'
=> 'Sind Sie sicher, daß Sie die Datei %s löschen wollen?',
'selected'
=> 'ausgewählte',
'The image(s) %s was successfully deleted.'
=> 'Das bzw. die Bilder %s wurden erfolgreich gelöscht.',
'The file(s) %s was successfully deleted.'
=> 'Die Datei(en) %s wurden erfolgreich gelöscht.',
'online'
=> 'online',
'not published yet'
=> 'noch nicht veröffentlicht',
'expired'
=> 'verfallen',
'old article version'
=> 'veraltete Artikelversion',
'deleted article'
=> 'gelöschte Artikelversion',
'Aborted by user. No file was deleted.'
=> 'Abbruch durch Benutzer. Keine Datei wurde gelöscht.',
// end part 1 of 1 enhanced delete by m.roesel ***********************************************