if (isset($_POST['update']) && !empty($_POST['if_focus'])) { $pdb->Execute("update " . $news->getTable() . " set if_focus=0"); $pdb->Execute("update " . $news->getTable() . " set if_focus=1 where id=" . intval($_POST['if_focus'])); } if (isset($_POST['del']) && is_array($_POST['id'])) { foreach ($_POST['id'] as $key => $val) { $attach_filename = $pdb->GetOne("select picture from {$tb_prefix}newses where id=" . $val); $attachment->deleteBySource($attach_filename); } $deleted = $news->del($_POST['id']); if (!$deleted) { flash(); } } if (isset($_POST['commend']) && is_array($_POST['id'])) { $news->saveField("if_commend", 1, $_POST['id']); flash("success"); } if (isset($_POST['cancel_commend']) && is_array($_POST['id'])) { $news->saveField("if_commend", 0, $_POST['id']); flash("success"); } if (isset($_POST['save']) && !empty($_POST['data']['news'])) { if (isset($_POST['id'])) { $id = intval($_POST['id']); } $attachment->if_orignal = false; $attachment->if_watermark = false; $attachment->if_thumb_middle = true; $vals = array(); $vals = $_POST['data']['news'];