Add action to remove unused tags

This commit is contained in:
Dendy 2020-12-24 01:57:52 +01:00
parent d3c559a23a
commit e6c41fa25a
Signed by: dendy
GPG Key ID: 0168B35FFD7F608F
3 changed files with 13 additions and 2 deletions

View File

@ -78,7 +78,11 @@ if(isset($_GET["t"]) and is_array($_GET["t"])){
<?php
include("include/header.php");
echo "<h2>Woah</h2>";
echo("<h2>Utilities</h2>");
echo("<a href='actions/delete-unused.php?_back=" . $BASE_PATH . $_SERVER['PHP_SELF'] . "'>Delete unused tags</a>");
echo("<h2>Tag files</h2>");
echo("<div class='paths'>");
echo("<a href='" . $BASE_PATH . "/admin.php?l=" . dirname($dir) . "'><-</a><br/>\n");

View File

@ -1,6 +1,6 @@
<?php
$tmsu = "tmsu -D drw/.tmsu/db ";
$tmsu = "tmsu -D /strg/drw/.tmsu/db ";
$BASE_ROUTE = "";
@ -22,4 +22,8 @@ if(!isset($_SESSION["login"])){
$exclude_query = $exclude_query . $alone_exclude_query;
$alone_exclude_query = "'" . $alone_exclude_query . "'";
}
$_IS_LOGGED = $_SESSION["login"] === "true";
$_IS_ADMIN = $_SESSION["username"] === "admin";
?>

View File

@ -33,6 +33,9 @@
exec($tmsu . "files -c '" . addcslashes($tag . $exclude_query, '(..)') . "'", $count);
echo("<a href='http://" . $_SERVER['HTTP_HOST'] . "/tag.php?t=" . $tag . "'>(" . $count[0] .") " . $tag ."</a>, ");
}
echo("<br/><br/>");
echo("<");
?>
</body>
</html>