mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 19:06:27 +00:00
Empty commit
This commit is contained in:
parent
205cbc3630
commit
633a1b6b43
@ -31,7 +31,7 @@
|
|||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT AliasID, ArtistID, Name, Redirect
|
SELECT AliasID, ArtistID, Name, Redirect
|
||||||
FROM artists_alias
|
FROM artists_alias
|
||||||
WHERE Name = '".$DBAliasName."'");
|
WHERE Name = '$DBAliasName'");
|
||||||
if ($DB->has_results()) {
|
if ($DB->has_results()) {
|
||||||
while (list($CloneAliasID, $CloneArtistID, $CloneAliasName, $CloneRedirect) = $DB->next_record(MYSQLI_NUM, false)) {
|
while (list($CloneAliasID, $CloneArtistID, $CloneAliasName, $CloneRedirect) = $DB->next_record(MYSQLI_NUM, false)) {
|
||||||
if (!strcasecmp($CloneAliasName, $AliasName)) {
|
if (!strcasecmp($CloneAliasName, $AliasName)) {
|
||||||
@ -43,8 +43,8 @@
|
|||||||
if ($CloneRedirect != 0) {
|
if ($CloneRedirect != 0) {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
UPDATE artists_alias
|
UPDATE artists_alias
|
||||||
SET ArtistID='".$ArtistID."', Redirect=0
|
SET ArtistID = '$ArtistID', Redirect=0
|
||||||
WHERE AliasID='".$CloneAliasID."'");
|
WHERE AliasID = '$CloneAliasID'");
|
||||||
Misc::write_log("Redirection for the alias $CloneAliasID ($DBAliasName) for the artist $ArtistID was removed by user $LoggedUser[ID] ($LoggedUser[Username])");
|
Misc::write_log("Redirection for the alias $CloneAliasID ($DBAliasName) for the artist $ArtistID was removed by user $LoggedUser[ID] ($LoggedUser[Username])");
|
||||||
} else {
|
} else {
|
||||||
error('No changes were made as the target alias did not redirect anywhere.');
|
error('No changes were made as the target alias did not redirect anywhere.');
|
||||||
@ -56,7 +56,10 @@
|
|||||||
}
|
}
|
||||||
if (!$CloneAliasID) {
|
if (!$CloneAliasID) {
|
||||||
if ($Redirect) {
|
if ($Redirect) {
|
||||||
$DB->query("SELECT ArtistID, Redirect FROM artists_alias WHERE AliasID = $Redirect");
|
$DB->query("
|
||||||
|
SELECT ArtistID, Redirect
|
||||||
|
FROM artists_alias
|
||||||
|
WHERE AliasID = $Redirect");
|
||||||
if (!$DB->has_results()) {
|
if (!$DB->has_results()) {
|
||||||
error('Cannot redirect to a nonexistent artist alias.');
|
error('Cannot redirect to a nonexistent artist alias.');
|
||||||
}
|
}
|
||||||
@ -73,7 +76,10 @@
|
|||||||
VALUES ($ArtistID, '$DBAliasName', $Redirect, ".$LoggedUser['ID'].')');
|
VALUES ($ArtistID, '$DBAliasName', $Redirect, ".$LoggedUser['ID'].')');
|
||||||
$AliasID = $DB->inserted_id();
|
$AliasID = $DB->inserted_id();
|
||||||
|
|
||||||
$DB->query("SELECT Name FROM artists_group WHERE ArtistID = ".$ArtistID);
|
$DB->query("
|
||||||
|
SELECT Name
|
||||||
|
FROM artists_group
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
list($ArtistName) = $DB->next_record(MYSQLI_NUM, false);
|
list($ArtistName) = $DB->next_record(MYSQLI_NUM, false);
|
||||||
|
|
||||||
Misc::write_log("The alias $AliasID ($DBAliasName) was added to the artist $ArtistID (".db_string($ArtistName).") by user ".$LoggedUser['ID'].' ('.$LoggedUser['Username'].')');
|
Misc::write_log("The alias $AliasID ($DBAliasName) was added to the artist $ArtistID (".db_string($ArtistName).") by user ".$LoggedUser['ID'].' ('.$LoggedUser['Username'].')');
|
||||||
|
@ -13,39 +13,58 @@
|
|||||||
error('Blank artist name.');
|
error('Blank artist name.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("SELECT ag.ArtistID FROM artists_group AS ag WHERE ag.Name LIKE '$Artist2Name'");
|
$DB->query("
|
||||||
|
SELECT ag.ArtistID
|
||||||
|
FROM artists_group AS ag
|
||||||
|
WHERE ag.Name LIKE '$Artist2Name'");
|
||||||
list($Artist2ID) = $DB->next_record();
|
list($Artist2ID) = $DB->next_record();
|
||||||
|
|
||||||
if (!empty($Artist2ID)) { // artist was found in the database
|
if (!empty($Artist2ID)) { // artist was found in the database
|
||||||
|
|
||||||
// Let's see if there's already a similar artists field for these two
|
// Let's see if there's already a similar artists field for these two
|
||||||
$DB->query("SELECT
|
$DB->query("
|
||||||
s1.SimilarID
|
SELECT s1.SimilarID
|
||||||
FROM artists_similar AS s1
|
FROM artists_similar AS s1
|
||||||
JOIN artists_similar AS s2 ON s1.SimilarID=s2.SimilarID
|
JOIN artists_similar AS s2 ON s1.SimilarID = s2.SimilarID
|
||||||
WHERE s1.ArtistID='$Artist1ID' AND s2.ArtistID='$Artist2ID'");
|
WHERE s1.ArtistID = '$Artist1ID'
|
||||||
|
AND s2.ArtistID = '$Artist2ID'");
|
||||||
list($SimilarID) = $DB->next_record();
|
list($SimilarID) = $DB->next_record();
|
||||||
|
|
||||||
if ($SimilarID) { // The similar artists field already exists, just update the score
|
if ($SimilarID) { // The similar artists field already exists, just update the score
|
||||||
$DB->query("UPDATE artists_similar_scores SET Score=Score+200 WHERE SimilarID='$SimilarID'");
|
$DB->query("
|
||||||
|
UPDATE artists_similar_scores
|
||||||
|
SET Score = Score + 200
|
||||||
|
WHERE SimilarID = '$SimilarID'");
|
||||||
} else { // No, it doesn't exist - create it
|
} else { // No, it doesn't exist - create it
|
||||||
$DB->query("INSERT INTO artists_similar_scores (Score) VALUES ('200')");
|
$DB->query("
|
||||||
|
INSERT INTO artists_similar_scores (Score)
|
||||||
|
VALUES ('200')");
|
||||||
$SimilarID = $DB->inserted_id();
|
$SimilarID = $DB->inserted_id();
|
||||||
$DB->query("INSERT INTO artists_similar (ArtistID, SimilarID) VALUES ('$Artist1ID', '$SimilarID')");
|
$DB->query("
|
||||||
$DB->query("INSERT INTO artists_similar (ArtistID, SimilarID) VALUES ('$Artist2ID', '$SimilarID')");
|
INSERT INTO artists_similar (ArtistID, SimilarID)
|
||||||
|
VALUES ('$Artist1ID', '$SimilarID')");
|
||||||
|
$DB->query("
|
||||||
|
INSERT INTO artists_similar (ArtistID, SimilarID)
|
||||||
|
VALUES ('$Artist2ID', '$SimilarID')");
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("SELECT SimilarID FROM artists_similar_votes WHERE SimilarID='$SimilarID' AND UserID='$UserID' AND Way='up'");
|
$DB->query("
|
||||||
|
SELECT SimilarID
|
||||||
|
FROM artists_similar_votes
|
||||||
|
WHERE SimilarID = '$SimilarID'
|
||||||
|
AND UserID = '$UserID'
|
||||||
|
AND Way = 'up'");
|
||||||
if (!$DB->has_results()) {
|
if (!$DB->has_results()) {
|
||||||
$DB->query("INSERT INTO artists_similar_votes (SimilarID, UserID, way) VALUES ('$SimilarID', '$UserID', 'up')");
|
$DB->query("
|
||||||
|
INSERT INTO artists_similar_votes (SimilarID, UserID, way)
|
||||||
|
VALUES ('$SimilarID', '$UserID', 'up')");
|
||||||
}
|
}
|
||||||
|
|
||||||
$Cache->delete_value('artist_'.$Artist1ID); // Delete artist cache
|
$Cache->delete_value("artist_$Artist1ID"); // Delete artist cache
|
||||||
$Cache->delete_value('artist_'.$Artist2ID); // Delete artist cache
|
$Cache->delete_value("artist_$Artist2ID"); // Delete artist cache
|
||||||
$Cache->delete_value('similar_positions_'.$Artist1ID); // Delete artist's similar map cache
|
$Cache->delete_value("similar_positions_$Artist1ID"); // Delete artist's similar map cache
|
||||||
$Cache->delete_value('similar_positions_'.$Artist2ID); // Delete artist's similar map cache
|
$Cache->delete_value("similar_positions_$Artist2ID"); // Delete artist's similar map cache
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
header('Location: '.$_SERVER['HTTP_REFERER']);
|
header('Location: '.$_SERVER['HTTP_REFERER']);
|
||||||
?>
|
?>
|
||||||
|
@ -51,15 +51,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($ArtistID == $NewArtistID) {
|
if ($ArtistID == $NewArtistID) {
|
||||||
error("You cannot merge an artist with itself.");
|
error('You cannot merge an artist with itself.');
|
||||||
}
|
}
|
||||||
if (isset($_POST['confirm'])) {
|
if (isset($_POST['confirm'])) {
|
||||||
// Get the information for the cache update
|
// Get the information for the cache update
|
||||||
$DB->query("SELECT DISTINCT GroupID FROM torrents_artists WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
SELECT DISTINCT GroupID
|
||||||
|
FROM torrents_artists
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
$Groups = $DB->collect('GroupID');
|
$Groups = $DB->collect('GroupID');
|
||||||
$DB->query("SELECT DISTINCT RequestID FROM requests_artists WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
SELECT DISTINCT RequestID
|
||||||
|
FROM requests_artists
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
$Requests = $DB->collect('RequestID');
|
$Requests = $DB->collect('RequestID');
|
||||||
$DB->query("SELECT DISTINCT UserID FROM bookmarks_artists WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
SELECT DISTINCT UserID
|
||||||
|
FROM bookmarks_artists
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
$BookmarkUsers = $DB->collect('UserID');
|
$BookmarkUsers = $DB->collect('UserID');
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT DISTINCT ct.CollageID
|
SELECT DISTINCT ct.CollageID
|
||||||
@ -75,7 +84,7 @@
|
|||||||
WHERE ArtistID = $NewArtistID");
|
WHERE ArtistID = $NewArtistID");
|
||||||
$NewArtistGroups = $DB->collect('GroupID');
|
$NewArtistGroups = $DB->collect('GroupID');
|
||||||
$NewArtistGroups[] = '0';
|
$NewArtistGroups[] = '0';
|
||||||
$NewArtistGroups = implode(',',$NewArtistGroups);
|
$NewArtistGroups = implode(',', $NewArtistGroups);
|
||||||
|
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT DISTINCT RequestID
|
SELECT DISTINCT RequestID
|
||||||
@ -83,7 +92,7 @@
|
|||||||
WHERE ArtistID = $NewArtistID");
|
WHERE ArtistID = $NewArtistID");
|
||||||
$NewArtistRequests = $DB->collect('RequestID');
|
$NewArtistRequests = $DB->collect('RequestID');
|
||||||
$NewArtistRequests[] = '0';
|
$NewArtistRequests[] = '0';
|
||||||
$NewArtistRequests = implode(',',$NewArtistRequests);
|
$NewArtistRequests = implode(',', $NewArtistRequests);
|
||||||
|
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT DISTINCT UserID
|
SELECT DISTINCT UserID
|
||||||
@ -91,7 +100,7 @@
|
|||||||
WHERE ArtistID = $NewArtistID");
|
WHERE ArtistID = $NewArtistID");
|
||||||
$NewArtistBookmarks = $DB->collect('UserID');
|
$NewArtistBookmarks = $DB->collect('UserID');
|
||||||
$NewArtistBookmarks[] = '0';
|
$NewArtistBookmarks[] = '0';
|
||||||
$NewArtistBookmarks = implode(',',$NewArtistBookmarks);
|
$NewArtistBookmarks = implode(',', $NewArtistBookmarks);
|
||||||
|
|
||||||
// Merge all of this artist's aliases onto the new artist
|
// Merge all of this artist's aliases onto the new artist
|
||||||
$DB->query("
|
$DB->query("
|
||||||
@ -105,51 +114,59 @@
|
|||||||
SET ArtistID = $NewArtistID
|
SET ArtistID = $NewArtistID
|
||||||
WHERE ArtistID = $ArtistID
|
WHERE ArtistID = $ArtistID
|
||||||
AND GroupID NOT IN ($NewArtistGroups)");
|
AND GroupID NOT IN ($NewArtistGroups)");
|
||||||
$DB->query("DELETE FROM torrents_artists WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
DELETE FROM torrents_artists
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
$DB->query("
|
$DB->query("
|
||||||
UPDATE IGNORE requests_artists
|
UPDATE IGNORE requests_artists
|
||||||
SET ArtistID = $NewArtistID
|
SET ArtistID = $NewArtistID
|
||||||
WHERE ArtistID = $ArtistID
|
WHERE ArtistID = $ArtistID
|
||||||
AND RequestID NOT IN ($NewArtistRequests)");
|
AND RequestID NOT IN ($NewArtistRequests)");
|
||||||
$DB->query("DELETE FROM requests_artists WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
DELETE FROM requests_artists
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
$DB->query("
|
$DB->query("
|
||||||
UPDATE IGNORE bookmarks_artists
|
UPDATE IGNORE bookmarks_artists
|
||||||
SET ArtistID = $NewArtistID
|
SET ArtistID = $NewArtistID
|
||||||
WHERE ArtistID = $ArtistID
|
WHERE ArtistID = $ArtistID
|
||||||
AND UserID NOT IN ($NewArtistBookmarks)");
|
AND UserID NOT IN ($NewArtistBookmarks)");
|
||||||
$DB->query("DELETE FROM bookmarks_artists WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
DELETE FROM bookmarks_artists
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
|
|
||||||
// Cache clearing
|
// Cache clearing
|
||||||
if (!empty($Groups)) {
|
if (!empty($Groups)) {
|
||||||
foreach ($Groups as $GroupID) {
|
foreach ($Groups as $GroupID) {
|
||||||
$Cache->delete_value('groups_artists_'.$GroupID);
|
$Cache->delete_value("groups_artists_$GroupID");
|
||||||
Torrents::update_hash($GroupID);
|
Torrents::update_hash($GroupID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($Requests)) {
|
if (!empty($Requests)) {
|
||||||
foreach ($Requests as $RequestID) {
|
foreach ($Requests as $RequestID) {
|
||||||
$Cache->delete_value('request_artist_'.$RequestID);
|
$Cache->delete_value("request_artist_$RequestID");
|
||||||
Requests::update_sphinx_requests($RequestID);
|
Requests::update_sphinx_requests($RequestID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($BookmarkUsers)) {
|
if (!empty($BookmarkUsers)) {
|
||||||
foreach ($BookmarkUsers as $UserID) {
|
foreach ($BookmarkUsers as $UserID) {
|
||||||
$Cache->delete_value('notify_artists_'.$UserID);
|
$Cache->delete_value("notify_artists_$UserID");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($Collages)) {
|
if (!empty($Collages)) {
|
||||||
foreach ($Collages as $CollageID) {
|
foreach ($Collages as $CollageID) {
|
||||||
$Cache->delete_value('collage_'.$CollageID);
|
$Cache->delete_value("collage_$CollageID");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$Cache->delete_value('artist_'.$ArtistID);
|
$Cache->delete_value("artist_$ArtistID");
|
||||||
$Cache->delete_value('artist_'.$NewArtistID);
|
$Cache->delete_value("artist_$NewArtistID");
|
||||||
$Cache->delete_value('artist_groups_'.$ArtistID);
|
$Cache->delete_value("artist_groups_$ArtistID");
|
||||||
$Cache->delete_value('artist_groups_'.$NewArtistID);
|
$Cache->delete_value("artist_groups_$NewArtistID");
|
||||||
|
|
||||||
// Delete the old artist
|
// Delete the old artist
|
||||||
$DB->query("DELETE FROM artists_group WHERE ArtistID = $ArtistID");
|
$DB->query("
|
||||||
|
DELETE FROM artists_group
|
||||||
|
WHERE ArtistID = $ArtistID");
|
||||||
|
|
||||||
Misc::write_log("The artist $ArtistID ($ArtistName) was made into a non-redirecting alias of artist $NewArtistID ($NewArtistName) by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].')');
|
Misc::write_log("The artist $ArtistID ($ArtistName) was made into a non-redirecting alias of artist $NewArtistID ($NewArtistName) by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].')');
|
||||||
|
|
||||||
|
@ -6,7 +6,10 @@
|
|||||||
error(0);
|
error(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("SELECT Name, Description, TagList, UserID, CategoryID, Locked, MaxGroups, MaxGroupsPerUser, Featured FROM collages WHERE ID='$CollageID'");
|
$DB->query("
|
||||||
|
SELECT Name, Description, TagList, UserID, CategoryID, Locked, MaxGroups, MaxGroupsPerUser, Featured
|
||||||
|
FROM collages
|
||||||
|
WHERE ID = '$CollageID'");
|
||||||
list($Name, $Description, $TagList, $UserID, $CategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Featured) = $DB->next_record();
|
list($Name, $Description, $TagList, $UserID, $CategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Featured) = $DB->next_record();
|
||||||
$TagList = implode(', ', explode(' ', $TagList));
|
$TagList = implode(', ', explode(' ', $TagList));
|
||||||
|
|
||||||
@ -33,18 +36,20 @@
|
|||||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
<input type="hidden" name="collageid" value="<?=$CollageID?>" />
|
<input type="hidden" name="collageid" value="<?=$CollageID?>" />
|
||||||
<table id="edit_collage" class="layout">
|
<table id="edit_collage" class="layout">
|
||||||
<? if (check_perms('site_collages_delete') || ($CategoryID == 0 && $UserID == $LoggedUser['ID'] && check_perms('site_collages_renamepersonal'))) { ?>
|
<? if (check_perms('site_collages_delete') || ($CategoryID == 0 && $UserID == $LoggedUser['ID'] && check_perms('site_collages_renamepersonal'))) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Name</td>
|
<td class="label">Name</td>
|
||||||
<td><input type="text" name="name" size="60" value="<?=$Name?>" /></td>
|
<td><input type="text" name="name" size="60" value="<?=$Name?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<? }
|
<?
|
||||||
|
}
|
||||||
if ($CategoryID > 0 || check_perms('site_collages_delete')) { ?>
|
if ($CategoryID > 0 || check_perms('site_collages_delete')) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Category</strong></td>
|
<td class="label"><strong>Category</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="category">
|
<select name="category">
|
||||||
<? foreach ($CollageCats as $CatID => $CatName) {
|
<?
|
||||||
|
foreach ($CollageCats as $CatID => $CatName) {
|
||||||
if (!check_perms('site_collages_delete') && $CatID == 0) {
|
if (!check_perms('site_collages_delete') && $CatID == 0) {
|
||||||
// Only mod-type get to make things personal
|
// Only mod-type get to make things personal
|
||||||
continue;
|
continue;
|
||||||
@ -55,7 +60,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Description</td>
|
<td class="label">Description</td>
|
||||||
<td>
|
<td>
|
||||||
@ -66,12 +71,13 @@
|
|||||||
<td class="label">Tags</td>
|
<td class="label">Tags</td>
|
||||||
<td><input type="text" name="tags" size="60" value="<?=$TagList?>" /></td>
|
<td><input type="text" name="tags" size="60" value="<?=$TagList?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<? if ($CategoryID == 0) { // CategoryID == 0 is for "personal" collages ?>
|
<? if ($CategoryID == 0) { // CategoryID == 0 is for "personal" collages ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><span title="A "featured" personal collage will be listed first on your profile, along with a preview of the included torrents.">Featured</span></td>
|
<td class="label"><span title="A "featured" personal collage will be listed first on your profile, along with a preview of the included torrents.">Featured</span></td>
|
||||||
<td><input type="checkbox" name="featured"<?=($Featured ? ' checked="checked"' : '')?> /></td>
|
<td><input type="checkbox" name="featured"<?=($Featured ? ' checked="checked"' : '')?> /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<? }
|
<?
|
||||||
|
}
|
||||||
if (check_perms('site_collages_delete')) { ?>
|
if (check_perms('site_collages_delete')) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Locked</td>
|
<td class="label">Locked</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user