query(" SELECT Name FROM torrents_group WHERE ID = $OldGroupID"); if (!$DB->has_results()) { //Trying to move to an empty group? I think not! set_message('That group does not exist!'); header('Location: '.$_SERVER['HTTP_REFERER']); die(); } list($Name) = $DB->next_record(); $DB->query(" SELECT CategoryID, Name FROM torrents_group WHERE ID = $GroupID"); list($CategoryID, $NewName) = $DB->next_record(); if ($Categories[$CategoryID - 1] != 'Music') { error('Target must be a music group.'); } $Artists = Artists::get_artists(array($OldGroupID, $GroupID)); View::show_header(); ?>

Change Group Confirm!

You are attempting to move the torrent with ID from the group:

  • -

Into the group:

  • -
query("UPDATE torrents SET GroupID = '$GroupID' WHERE ID = $TorrentID"); // Delete old torrent group if it's empty now $DB->query(" SELECT COUNT(ID) FROM torrents WHERE GroupID = '$OldGroupID'"); list($TorrentsInGroup) = $DB->next_record(); if ($TorrentsInGroup == 0) { $DB->query(" UPDATE torrents_comments SET GroupID = '$GroupID' WHERE GroupID = '$OldGroupID'"); $Cache->delete_value("torrent_comments_{$GroupID}_catalogue_0"); $Cache->delete_value("torrent_comments_$GroupID"); Torrents::delete_group($OldGroupID); } else { Torrents::update_hash($OldGroupID); } Torrents::update_hash($GroupID); Misc::write_log("Torrent $TorrentID was edited by " . $LoggedUser['Username']); // TODO: this is probably broken Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "merged group $OldGroupID", 0); $DB->query(" UPDATE group_log SET GroupID = $GroupID WHERE GroupID = $OldGroupID"); $Cache->delete_value("torrents_details_$GroupID"); $Cache->delete_value("torrent_download_$TorrentID"); header("Location: torrents.php?id=$GroupID"); } ?>