Prevent the merging of non-music groups

Include empty values in cache debug table

Clear cache when replying to staff pm
This commit is contained in:
What.CD 2011-05-22 08:00:06 +00:00
parent faa6c0c055
commit 2ddca2c7b4
5 changed files with 13 additions and 9 deletions

View File

@ -107,7 +107,7 @@ public function get_value($Key, $NoCache=false) {
}
$Return = $this->get($Key);
if ($Return && !$NoCache) {
if ($Return !== false && !$NoCache) {
$this->CacheHits[$Key] = $Return;
}
$this->Time+=(microtime(true)-$StartTime)*1000;

View File

@ -234,7 +234,6 @@
$ModBar[] = '<a href="staffpm.php">'.$NumStaffPMs.' Staff PMs</a>';
}
}
if(check_perms('admin_reports')) {
$NumTorrentReports = $Cache->get_value('num_torrent_reportsv2');
if ($NumTorrentReports === false) {

View File

@ -39,6 +39,7 @@
if ($IsFLS) {
// FLS/Staff
$DB->query("UPDATE staff_pm_conversations SET Date='".sqltime()."', Unread=true, Status='Open' WHERE ID=$ConvID");
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
} else {
// User
$DB->query("UPDATE staff_pm_conversations SET Date='".sqltime()."', Unread=true, Status='Unanswered' WHERE ID=$ConvID");

View File

@ -29,9 +29,12 @@
die();
}
list($Name) = $DB->next_record();
$DB->query("SELECT Name FROM torrents_group WHERE ID = ".$GroupID);
list($NewName) = $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 = get_artists(array($OldGroupID, $GroupID));
show_header();

View File

@ -10,17 +10,18 @@
if($NewGroupID == $GroupID) {
error('Old group ID is the same as new group ID!');
}
$DB->query("SELECT ID FROM torrents_group WHERE ID='$NewGroupID'");
$DB->query("SELECT CategoryID, Name FROM torrents_group WHERE ID='$NewGroupID'");
if($DB->record_count()==0) {
error('Target group does not exist.');
}
list($CategoryID, $NewName) = $DB->next_record();
if($Categories[$CategoryID-1] != 'Music') {
error('Only music groups can be merged.');
}
//Everything is legit, let's just confim they're not retarded
if(empty($_POST['confirm'])) {
$DB->query("SELECT Name FROM torrents_group WHERE ID = ".$GroupID);
list($Name) = $DB->next_record();
$DB->query("SELECT Name FROM torrents_group WHERE ID = ".$NewGroupID);
list($NewName) = $DB->next_record();
$Artists = get_artists(array($GroupID, $NewGroupID));