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('The destination torrent 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('Destination torrent group must be in the "Music" category.'); } $Artists = Artists::get_artists(array($OldGroupID, $GroupID)); View::show_header(); ?>

Torrent Group ID Change Confirmation

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) { // TODO: votes etc! $DB->query(" UPDATE comments SET PageID = '$GroupID' WHERE Page = 'torrents' AND PageID = '$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"); } ?>