Exemple #1
0
function import_cache_deleteall()
{
    // hack
    import_cache_get_cache_directory();
    if (db_query("LOCK TABLES import_cache WRITE")) {
        $query = "SELECT sequence_number FROM import_cache";
        $results = db_query($query);
        if ($results) {
            while ($import_cache_r = db_fetch_assoc($results)) {
                import_cache_delete($import_cache_r['sequence_number']);
            }
            db_free_result($results);
        }
        db_query("UNLOCK TABLES");
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error());
        return FALSE;
    }
}
Exemple #2
0
         if ($resultOfImport !== TRUE) {
             $listingObject->setNoRowsMessage($importError);
             echo format_error_block($importError);
         }
         if ($cfg_is_trial_run) {
             echo "<form action=\"{$PHP_SELF}\" method=\"POST\">";
             echo get_url_fields($HTTP_VARS, array('op'), array('op2'));
             echo "<input type=\"button\" class=\"button\" onclick=\"this.form.op.value='uploaded'; this.form.submit();\" value=\"" . get_opendb_lang_var('back') . "\">";
             echo "<input type=\"button\" class=\"button\" onclick=\"this.form.trial_run.value='N'; this.form.op.value='import'; this.form.submit();\" value=\"" . get_opendb_lang_var('import_items') . "\">";
             echo "</form>";
         } else {
             if (is_not_empty_array($itemImportHandler->getItemIDList())) {
                 $footer_links_r[] = array(url => 'listings.php?item_id_range=' . urlencode(get_item_id_range($itemImportHandler->getItemIDList())), text => get_opendb_lang_var('list_imported_items', 'count', count($itemImportHandler->getItemIDList())));
             }
             //Get rid of the file now!
             import_cache_delete($HTTP_VARS['ic_sequence_number']);
             echo format_footer_links($footer_links_r);
         }
         // don't need it anymore.
         unset($listingObject);
         echo _theme_footer();
     } else {
         echo _theme_header(get_opendb_lang_var('undefined_error'));
         echo "<p class=\"error\">" . get_opendb_lang_var('undefined_error') . "</p>";
         echo _theme_footer();
     }
 } else {
     //if($importPlugin !== NULL)
     echo _theme_header(get_opendb_lang_var('undefined_error'));
     echo "<p class=\"error\">" . get_opendb_lang_var('undefined_error') . " (" . $import_cache_r['plugin_name'] . ")</p>";
     echo _theme_footer();