Размер файла: 2.64Kb
<?php
# author Drk in
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );
# meta
$title = 'Удалить';
$tl = 'Удалить <span style="color:red;">* Внимание при нажатие кнопки удалится сразу</span>';
# admin
system::access('admin');
$cache = isset( $_GET['cache'] ) ? htmlspecialchars($_GET['cache']): null;
$view = isset( $_GET['view'] ) ? htmlspecialchars($_GET['view']): null;
$like = isset( $_GET['like'] ) ? htmlspecialchars($_GET['like']): null;
$dizlike = isset( $_GET['dizlike'] ) ? htmlspecialchars($_GET['dizlike']): null;
$download = isset( $_GET['download'] ) ? htmlspecialchars($_GET['download']): null;
if( $cache == 'ok' ):
if (file_exists(cache.'_cookies/')): # cookies
foreach (glob(cache.'_cookies/*') as $file):
@unlink($file);
endforeach;
endif;
if (file_exists(cache.'_mod/')): # mod
foreach (glob(cache.'_mod/*') as $file):
@unlink($file);
endforeach;
endif;
if (file_exists(cache.'_search/')): # search
foreach (glob(cache.'_search/*') as $file):
@unlink($file);
endforeach;
endif;
if (file_exists(cache.'_tag/')): # tag
foreach (glob(cache.'_tag/*') as $file):
@unlink($file);
endforeach;
endif;
if (file_exists(cache.'_user/')): # user
foreach (glob(cache.'_user/*') as $file):
@unlink($file);
endforeach;
endif;
if (file_exists(cache.'_watch/')): # watch
foreach (glob(cache.'_watch/*') as $file):
@unlink($file);
endforeach;
endif;
system::header('?','Кэш удален',1);
endif;
if( $view == 'ok' ):
DB :: $dbh -> query("TRUNCATE `view`");
system::header('?','Просмотры удалены',1);
endif;
if( $like == 'ok' ):
DB :: $dbh -> query("TRUNCATE `like`");
system::header('?','Лайки удалены',1);
endif;
if( $dizlike == 'ok' ):
DB :: $dbh -> query("TRUNCATE `dizlike`");
system::header('?','Дизлайки удалены',1);
endif;
if( $download == 'ok' ):
DB :: $dbh -> query("TRUNCATE `download`");
system::header('?','Скачано удалено',1);
endif;
# head
require_once ( head );
echo '
<div class="tl"><a href ="?cache=ok"> - Кэш </a></div>
<div class="tl"><a href ="?view=ok"> - Просмотры </a></div>
<div class="tl"><a href ="?like=ok"> - Лайки </a></div>
<div class="tl"><a href ="?dizlike=ok"> - Дизлайки </a></div>
<div class="tl"><a href ="?download=ok"> - Скачано </a></div>
<div class="tl"><a href ="/admin"> - Назад </a></div>';
# foot
require_once ( foot ) ;
?>