File size: 5.56Kb
<?php
include ('../config.php');
$page = 'sysf';
include ('session.php');
if (isset($_POST, $_POST['delete']) and is_array($_POST['delete']) and count($_POST['delete']) >
0) {
$details = array();
foreach ($_POST['delete'] as $func => $value) {
switch ($func):
case 'count':
$files = glob('../db/count/*.dat');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in File Counts Section!';
unset($files, $count, $file);
break;
case 'hits':
$files = glob('../db/dlcount/*.log');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in File Hits Section!';
unset($files, $count, $file);
break;
case 'rate':
if (file_exists('../db/rating.dat')) {
file_put_contents('../db/rating.dat', '<?php $rating=array(); ?>');
$details[] = 'Rating Data Cleared';
}
break;
case 'prev':
include ('fm_func.php');
$count = rmdirr('../scr/');
$dirs=array('scr','scr/img','scr/vid','scr/thm','scr/apk','scr/jar');
foreach($dirs as $dir){
mkdir('../'.$dir,0777);
}
$details[] = 'All files deleted in All Preview Files Section!';
unset($dirs,$dir,$count);
break;
case 'apk':
if (!isset($_POST['delete']['prev'])) {
$files = glob('../scr/apk/*');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in APK Preview Cache Section!';
unset($files, $count, $file);
}
break;
case 'img':
if (!isset($_POST['delete']['prev'])) {
$files = glob('../scr/img/*');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in Image Preview Cache Section!';
unset($files, $count, $file);
}
break;
case 'jar':
if (!isset($_POST['delete']['prev'])) {
$files = glob('../scr/jar/*');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in JAR Files Preview Cache Section!';
unset($files, $count, $file);
}
break;
case 'thm':
if (!isset($_POST['delete']['prev'])) {
$files = glob('../scr/thm/*');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in Themes Preview Cache Section!';
unset($files, $count, $file);
}
break;
case 'vid':
if (!isset($_POST['delete']['prev'])) {
$files = glob('../scr/vid/*');
$count = count($files);
if ($count > 0) {
foreach ($files as $file) {
unlink($file);
}
}
$details[] = $count . ' files deleted in Vid Preview Cache Section!';
unset($files, $count, $file);
}
break;
endswitch;
}
}
?>
<?php
include ($config->real() . $config->header);
if ($layout == 'web') { ?>
<div class="wrap">
<div style="float: left; width: 18%; margin-bottom: 5px;" class="container">
<?php include ('sidebar.php'); ?>
</div>
<div style="float: right; width:80%;">
<div class="container"><div class="title">Details</div>
<?php if($layout=='web'){
echo '<div style="padding:5px;">';
}?>
<?php
if(@is_array($details)){
foreach($details as $detail){
echo'<div class="item"><img src="' . $config->installdir .
'/customization/item.png" /> '.$detail.'</div>';
}
}
?>
</div>
<?php if($layout=='web'){
echo '</div>';
}
?>
<?php
} ?>
<div class="container"><div class="title">Clear System Data</div>
<?php if ($layout == 'web') {
echo '<div style="padding:5px;">';
} ?>
Select System Files to remove:<br />
<form action="sysfiles.php" method="post">
<div class="item"><strong>File Count</strong>: <input name="delete[count]" type="checkbox" value="true" /><br />Delete Files that store the count of files in each directory!</div>
<div class="item"><strong>File Downloads</strong>: <input name="delete[hits]" type="checkbox" value="true" /><br />Delete Files that stores the number of times each files has been downloaded!</div>
<div class="item"><strong>File Ratings</strong>: <input name="delete[rate]" type="checkbox" value="true" /><br />Clear all data related to file ratings!</div>
<div class="item"><strong>All Preview Images</strong>: <input name="delete[prev]" type="checkbox" value="true" /><br />Delete files which are cache files for the preview images!</div>
<div class="item"><strong>APK Preview Images</strong>: <input name="delete[apk]" type="checkbox" value="true" /><br />Delete files which are cache files for the APK type files preview images!</div>
<div class="item"><strong>Pictures Preview Images</strong>: <input name="delete[img]" type="checkbox" value="true" /><br />Delete files which are cache files for the IMAGE type files preview images!</div>
<div class="item"><strong>Jar Preview Images</strong>: <input name="delete[jar]" type="checkbox" value="true" /><br />Delete files which are cache files for the JAR type files preview images!</div>
<div class="item"><strong>Themes Preview Images</strong>: <input name="delete[thm]" type="checkbox" value="true" /><br />Delete files which are cache files for the THEMES type files preview images!</div>
<div class="item"><strong>Videos Preview Images</strong>: <input name="delete[vid]" type="checkbox" value="true" /><br />Delete files which are cache files for the VIDEO type files preview images!</div>
<!--<div class="item"><strong></strong>: <input name="delete[]" type="checkbox" value="true" /><br /></div>-->
<div style="text-align: center;"><input type="submit" value="Delete" /></div>
</form>
</div>
<?php if ($layout == 'web') {
echo '</div></div></div>';
}
?>
<?php
include ($config->real() . $config->footer); ?>