query( "UPDATE " . PREFIX . "_static SET {$field}='{$value}' WHERE id='{$id}'" );
}
msg( "info", $lang['db_ok'], $lang['db_ok_1'].$t1, $_SESSION['admin_referrer'] );
}
if( $k_mass ) {
echoheader( "options", $lang['mass_head'] );
echo <<
HTML;
echofooter();
exit();
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Подтвреждение удаления
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if( $action == "mass_delete" ) {
echoheader( "options", $lang['mass_head'] );
echo <<
HTML;
echofooter();
exit();
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Удаление новостей
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
elseif( $action == "do_mass_delete" ) {
$deleted_articles = 0;
foreach ( $selected_news as $id ) {
$id = intval( $id );
$deleted_articles ++;
$db->query( "DELETE FROM " . PREFIX . "_static WHERE id='$id'" );
$db->query( "SELECT name, onserver FROM " . PREFIX . "_static_files WHERE static_id = '$id'" );
while ( $row = $db->get_row() ) {
if( $row['onserver'] ) {
@unlink( ROOT_DIR . "/uploads/files/" . $row['onserver'] );
} else {
$url_image = explode( "/", $row['name'] );
if( count( $url_image ) == 2 ) {
$folder_prefix = $url_image[0] . "/";
$dataimages = $url_image[1];
} else {
$folder_prefix = "";
$dataimages = $url_image[0];
}
@unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . $dataimages );
@unlink( ROOT_DIR . "/uploads/posts/" . $folder_prefix . "thumbs/" . $dataimages );
}
}
$db->query( "DELETE FROM " . PREFIX . "_static_files WHERE static_id = '$id'" );
}
if( count( $selected_news ) == $deleted_articles ) {
msg( "info", $lang['mass_static_delete'], $lang['mass_delok'], $_SESSION['admin_referrer'] );
} else {
msg( "error", $lang['mass_notok'], "$deleted_articles $lang[mass_i] " . count( $selected_news ) . " $lang[mass_notok_1]", $_SESSION['admin_referrer'] );
}
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ничего не выбрано
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
else {
msg( "info", $lang['mass_noact'], $lang['mass_noact_1'], $_SESSION['admin_referrer'] );
}
?>