public function ToolsPanel()
{
...
if ($this->IsAdmin())
{
if (isset($_POST['SimpleDownloadMonitor_Update']) && (isset($_POST['SimpleDownloadMonitor_HideIds']) && is_array($_POST['SimpleDownloadMonitor_HideIds']) || isset($_POST['SimpleDownloadMonitor_ShowIds']) && is_array($_POST['SimpleDownloadMonitor_ShowIds'])))
{
$this->HideDownloads($_POST['SimpleDownloadMonitor_ShowIds'], $_POST['SimpleDownloadMonitor_HideIds']);
}
if (isset($_POST['SimpleDownloadMonitor_Delete']) && isset($_POST['SimpleDownloadMonitor_DeleteIds']) && is_array($_POST['SimpleDownloadMonitor_DeleteIds']))
...
protected function HideDownloads($show_ids, $hide_ids = array())
{
global $wpdb;
$downloads = $this->table_downloads();
if ($show_ids)
{
$show_ids = implode(',', array_map('intval', $show_ids));
$sql = "UPDATE ${downloads} SET hide_from_sidebar=0, last_date=last_date WHERE id IN (${show_ids})";
// The last_date is used to prevent automatic update to current_timestamp
$wpdb->query($sql);
}
if ($hide_ids)
{
$hide_ids = implode(',', array_map('intval', $hide_ids));
$sql = "UPDATE ${downloads} SET hide_from_sidebar=1, last_date=last_date WHERE id IN (${hide_ids})";
// The last_date is used to prevent automatic update to current_timestamp
$wpdb->query($sql);
}
//wp_redirect($_SERVER['REQUEST_URI']);
//die();
}
protected function ErrorMessage($code, $message, $shortmessage)
{
// added
do_action('sdmon_download_error');
$code = intval($code);
...