예제 #1
0
 function __perform_refresh_thumbnails_batch()
 {
     if ($this->_batchlimit > 0) {
         $results = fetch_file_cache_rs('ITEM');
         if ($results) {
             while ($file_cache_r = db_fetch_assoc($results)) {
                 // its not a case of only a thumbnail, if not even the source exists
                 if (file_cache_get_cache_file($file_cache_r) !== FALSE && file_cache_get_cache_file_thumbnail($file_cache_r) === FALSE) {
                     // in this case we want to refresh the URL, so TRUE as last parameter idicates overwrite
                     if (file_cache_save_thumbnail_file($file_cache_r, $errors)) {
                         $this->_processed++;
                     } else {
                         $this->_failures++;
                     }
                     // don't process anymore this time around.
                     if ($this->_processed >= $this->_batchlimit) {
                         break;
                     }
                 }
             }
             db_free_result($results);
         }
     }
     $this->_remaining = fetch_file_cache_missing_thumbs_cnt('ITEM');
 }
예제 #2
0
파일: index.php 프로젝트: horrabin/opendb
                echo get_op_confirm_form($PHP_SELF, "Are you sure you want to delete cache files?", array('type' => $ADMIN_TYPE, 'op' => 'delete'));
            } else {
                $HTTP_VARS['op'] = '';
            }
        }
    }
}
if ($HTTP_VARS['op'] == '') {
    echo "<p>";
    if (fetch_file_cache_new_item_attribute_cnt() > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=job&job=update\">Update</a>] ";
    }
    if (fetch_file_cache_refresh_cnt('ITEM') > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=job&job=refresh\">Refresh</a>] ";
    }
    if (fetch_file_cache_missing_thumbs_cnt('ITEM') > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=job&job=refresh_thumbnails\">Refresh Thumbnails</a>] ";
    }
    // the item attribute orphan count is really slow, so do not use it.
    if (fetch_file_cache_missing_file_cnt('ITEM') > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=delete\">Delete Orphans</a>] ";
    }
    echo "</p>";
    if (strlen($HTTP_VARS['order_by']) == 0) {
        $HTTP_VARS['order_by'] = 'cache_date';
    }
    $listingObject = new HTML_Listing($PHP_SELF, $HTTP_VARS);
    $listingObject->setNoRowsMessage(get_opendb_lang_var('no_items_found'));
    $listingObject->startListing();
    //$listingObject->addHeaderColumn('Sequence. No.', 'sequence_number');
    $listingObject->addHeaderColumn('URL', 'url');