- $counter--;
- if ($counter >= 1) {
- $handle = fopen(VAR_FILES . $md5 . '_count', 'w');
- fwrite($handle, $counter);
- fclose($handle);
- }
- elseif ($counter == 0) {
- if (file_exists(VAR_FILES . $md5 . '_count')) {
- unlink(VAR_FILES . $md5 . '_count');
- }
- $new_name = jirafeau_detect_collision($md5 . '_' . $file_name, VAR_TRASH);
- rename(VAR_FILES . $md5, VAR_TRASH . $new_name);
- }
+ if(!empty($delete_code) && $delete_code == $link_code) {
+ jirafeau_delete($link_name);
+ require(JIRAFEAU_ROOT . 'lib/template/header.php');
+ echo '<div class="message"><p>' . _('File has been deleted.') . '</p></div>';
+ require(JIRAFEAU_ROOT . 'lib/template/footer.php');
+ exit;
+ }