TODO / Feature list
==========================================================================
-+ delete of a link
+ stats, storage usage. With stats and valid auth display moderation
+ email import auto reply check
+ flush local storage of images
++ delete single local storage of a link
+ sorting
+ snapshots
+ bookmark js snippet
return $ret;
}
+ public function storageAmount() {
+ $ret = 0;
+
+ $_storageFolder = ABSOLUTE_PATH.'/'.LOCAL_STORAGE;
+
+ if(file_exists($_storageFolder) && is_readable($_storageFolder)) {
+ $ret = Summoner::folderSize();
+ }
+
+ return $ret;
+ }
+
/**
* Load link by given hash. Do not use Link class directly.
return $ret;
}
+
+ static function folderSize($folder) {
+ $ret = 0;
+
+ if(file_exists($folder) && is_readable($folder)) {
+ foreach (glob(rtrim($folder, '/') . '/*', GLOB_NOSORT) as $each) {
+ $ret += is_file($each) ? filesize($each) : self::folderSize($each);
+ }
+ }
+
+ return $ret;
+ }
+
+ static function humanFileSize($size,$unit="") {
+ if( (!$unit && $size >= 1<<30) || $unit == "GB")
+ return number_format($size/(1<<30),2)."GB";
+ if( (!$unit && $size >= 1<<20) || $unit == "MB")
+ return number_format($size/(1<<20),2)."MB";
+ if( (!$unit && $size >= 1<<10) || $unit == "KB")
+ return number_format($size/(1<<10),2)."KB";
+ return number_format($size)." bytes";
+ }
}
$linkAmount = $Management->linkAmount();
$tagAmount = $Management->tagAmount();
$categoryAmount = $Management->categoryAmount();
+$localStorageAmount = $Management->storageAmount();
</div>
<div class="column is-one-quarter">
<h3 class="is-size-3">Local image storage</h3>
- <p># Moderation needed: <?php echo $moderationAmount; ?></p>
+ <p>Diskspace used: <?php echo $moderationAmount; ?></p>
<p><a href="index.php?p=overview&m=category">Delete all</a></p>
</div>
<?php } ?>