Gazelle/sections/artist/delete_similar.php

24 lines
756 B
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
authorize();
$SimilarID = db_string($_GET['similarid']);
2013-05-05 08:00:31 +00:00
if (!is_number($SimilarID) || !$SimilarID) {
2011-03-28 14:21:28 +00:00
error(404);
}
2013-05-05 08:00:31 +00:00
if (!check_perms('site_delete_tag')) {
2011-03-28 14:21:28 +00:00
error(403);
}
$DB->query("SELECT ArtistID FROM artists_similar WHERE SimilarID='$SimilarID'");
$ArtistIDs = $DB->to_array();
$DB->query("DELETE FROM artists_similar WHERE SimilarID='$SimilarID'");
$DB->query("DELETE FROM artists_similar_scores WHERE SimilarID='$SimilarID'");
$DB->query("DELETE FROM artists_similar_votes WHERE SimilarID='$SimilarID'");
foreach ($ArtistIDs as $ArtistID) {
list($ArtistID) = $ArtistID;
$Cache->delete_value('artist_'.$ArtistID); // Delete artist cache
$Cache->delete_value('similar_positions_'.$ArtistID);
}
header('Location: '.$_SERVER['HTTP_REFERER']);
?>