if (zen_not_null($dross)) { $string = "Product debris corresponding to the following product_id(s) cannot be deleted by EasyPopulate:\n"; foreach ($dross as $products_id => $langer) { $string .= $products_id . "\n"; } $string .= "It is recommended that you delete this corrupted data using phpMyAdmin.\n\n"; write_debug_log($string); $messageStack->add(EASYPOPULATE_MSGSTACK_DROSS_DELETE_FAIL, 'caution'); } else { $messageStack->add(EASYPOPULATE_MSGSTACK_DROSS_DELETE_SUCCESS, 'success'); } } else { // elseif ($_GET['dross'] == 'check') // we can choose a config option: check always, or only on clicking a button // default action when not deleting existing debris is to check for it and alert when discovered.. $dross = ep_get_dross(); if (zen_not_null($dross)) { $messageStack->add(sprintf(EASYPOPULATE_MSGSTACK_DROSS_DETECTED, count($dross), zen_href_link(FILENAME_EASYPOPULATE, 'dross=delete')), 'caution'); } } /** * Changes planned for below * 1) 1 input field for local and server updating * 2) default to update directly from HDD, with option to upload to temp, or update from temp * 3) List temp files with upload, delete, etc options * 4) Auto detecting of mods - display list of (only) installed mods, with check-box to include in download * 5) may consider an auto-splitting feature if it can be done. * Will detect speed of server, safe_mode etc and determine what splitting level is required (can be over-ridden of course) */ // all html templating is now below here. ?>
function ep_purge_dross() { $dross = array(); $dross = ep_get_dross(); foreach ($dross as $products_id => $langer) { zen_remove_product($products_id); } }