Empty commit

This commit is contained in:
Git 2012-08-09 08:00:19 +00:00
parent da3ab149ca
commit 14be209994
3 changed files with 34 additions and 26 deletions

View File

@ -287,8 +287,9 @@ function user_info($UserID) {
GROUP_CONCAT(ul.PermissionID SEPARATOR ',') AS Levels
FROM users_main AS m
INNER JOIN users_info AS i ON i.UserID=m.ID
JOIN users_levels AS ul ON ul.UserID = m.ID
WHERE m.ID='$UserID'");
LEFT JOIN users_levels AS ul ON ul.UserID = m.ID
WHERE m.ID='$UserID'
GROUP BY m.ID");
if($DB->record_count() == 0) { // Deleted user, maybe?
$UserInfo = array('ID'=>'','Username'=>'','PermissionID'=>0,'Artist'=>false,'Donor'=>false,'Warned'=>'0000-00-00 00:00:00','Avatar'=>'','Enabled'=>0,'Title'=>'', 'CatchupTime'=>0, 'Visible'=>'1');

View File

@ -120,20 +120,31 @@
}
if(!empty($_GET['filter_cat'])) {
$Keys = array_keys($_GET['filter_cat']);
$SS->set_filter('categoryid', $Keys);
$CategoryArray = array_keys($_GET['filter_cat']);
$Debug->log_var(array($CategoryArray, $Categories));
if(count($CategoryArray) != count($Categories)) {
foreach($CategoryArray as $Key => $Index) {
if(!isset($Categories[$Index])) {
unset($CategoryArray[$Key]);
}
}
if(count($CategoryArray) >= 1) {
$SS->set_filter('categoryid', $CategoryArray);
}
}
}
if(!empty($_GET['releases'])) {
$ReleaseArray = $_GET['releases'];
if(count($ReleaseArray) != count($ReleaseTypes)) {
foreach($ReleaseArray as $Index => $Value) {
if(!is_number($Value)) {
error(0);
if(!isset($ReleaseTypes[$Value])) {
unset($ReleaseArray[$Index]);
}
}
$SS->set_filter('releasetype', $ReleaseArray);
if(count($ReleaseArray) >= 1) {
$SS->set_filter('releasetype', $ReleaseArray);
}
}
}
@ -142,15 +153,13 @@
if(count($FormatArray) != count($Formats)) {
$FormatNameArray = array();
foreach($FormatArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Formats)) {
if(isset($Formats[$MasterIndex])) {
$FormatNameArray[$Index] = '"'.strtr($Formats[$MasterIndex], '-.', ' ').'"';
} else {
//Hax
error(0);
}
}
$Queries[]='@formatlist '.implode(' | ', $FormatNameArray);
if(count($FormatNameArray) >= 1) {
$Queries[]='@formatlist (any | '.implode(' | ', $FormatNameArray).')';
}
}
}
@ -159,15 +168,14 @@
if(count($MediaArray) != count($Media)) {
$MediaNameArray = array();
foreach($MediaArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Media)) {
if(isset($Media[$MasterIndex])) {
$MediaNameArray[$Index] = '"'.strtr($Media[$MasterIndex], '-.', ' ').'"';
} else {
//Hax
error(0);
}
}
$Queries[]='@medialist '.implode(' | ', $MediaNameArray);
if(count($MediaNameArray) >= 1) {
$Queries[]='@medialist (any | '.implode(' | ', $MediaNameArray).')';
}
}
}
@ -176,15 +184,14 @@
if(count($BitrateArray) != count($Bitrates)) {
$BitrateNameArray = array();
foreach($BitrateArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Bitrates)) {
if(isset($Bitrates[$MasterIndex])) {
$BitrateNameArray[$Index] = '"'.strtr($SS->EscapeString($Bitrates[$MasterIndex]), '-.', ' ').'"';
} else {
//Hax
error(0);
}
}
$Queries[]='@bitratelist '.implode(' | ', $BitrateNameArray);
if(count($BitrateNameArray) >= 1) {
$Queries[]='@bitratelist (any | '.implode(' | ', $BitrateNameArray).')';
}
}
}
@ -273,6 +280,7 @@
$PageLinks = get_pages($Page, $NumResults, REQUESTS_PER_PAGE);
}
$CurrentURL = get_url(array('order', 'sort'));
show_header($Title, 'requests');
?>
@ -498,7 +506,6 @@
$Requests = $SphinxResults['matches'];
$CurrentURL = get_url(array('order', 'sort'));
$Row = 'a';
$TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
foreach ($Requests as $RequestID => $Request) {

View File

@ -1 +1 @@
<? if (!check_perms('users_mod')) { error(403); } if (isset($_POST['doit'])) { authorize(); if (isset($_POST['oldtags'])) { $OldTagIDs = $_POST['oldtags']; foreach ($OldTagIDs AS $OldTagID) { if (!is_number($OldTagID)) { error(403); } } $OldTagIDs = implode(', ', $OldTagIDs); $DB->query("UPDATE tags SET TagType = 'other' WHERE ID IN ($OldTagIDs)"); } if ($_POST['newtag']) { $TagName = sanitize_tag($_POST['newtag']); $DB->query("SELECT t.ID FROM tags AS t WHERE t.Name LIKE '".$TagName."'"); list($TagID) = $DB->next_record(); if($TagID) { $DB->query("UPDATE tags SET TagType = 'genre' WHERE ID = $TagID"); } else { // Tag doesn't exist yet - create tag $DB->query("INSERT INTO tags (Name, UserID, TagType, Uses) VALUES ('".$TagName."', ".$LoggedUser['ID'].", 'genre', 0)"); $TagID = $DB->inserted_id(); } } $Cache->delete_value('genre_tags'); } show_header('Official Tags'); ?> <h2>Official Tags</h2> <div style="text-align: center"> <div style="display: inline-block;"> <form method="post"> <input type="hidden" name="action" value="official_tags" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="doit" value="1" /> <table> <tr class="colhead_dark"> <td style="font-weight: bold" style="text-align: center">Rem.</td> <td style="font-weight: bold">Tag</td> <td style="font-weight: bold">Uses</td> <td>&nbsp;&nbsp;&nbsp;</td> <td style="font-weight: bold" style="text-align: center">Rem.</td> <td style="font-weight: bold">Tag</td> <td style="font-weight: bold">Uses</td> <td>&nbsp;&nbsp;&nbsp;</td> <td style="font-weight: bold" style="text-align: center">Rem.</td> <td style="font-weight: bold">Tag</td> <td style="font-weight: bold">Uses</td> </tr> <? $i = 0; $DB->query("SELECT ID, Name, Uses FROM tags WHERE TagType='genre' ORDER BY Name ASC"); $TagCount = $DB->record_count(); $Tags = $DB->to_array(); for ($i = 0; $i < $TagCount / 3; $i++) { list($TagID1, $TagName1, $TagUses1) = $Tags[$i]; list($TagID2, $TagName2, $TagUses2) = $Tags[ceil($TagCount/3) + $i]; list($TagID3, $TagName3, $TagUses3) = $Tags[2*ceil($TagCount/3) + $i]; ?> <tr class="<?=(($i % 2)?'rowa':'rowb')?>"> <td style="text-align: center"><input type="checkbox" name="oldtags[]" value="<?=$TagID1?>" /></td> <td><?=$TagName1?></td> <td style="text-align: center"><?=$TagUses1?></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align: center"> <? if ($TagID2) { ?> <input type="checkbox" name="oldtags[]" value="<?=$TagID2?>" /> <? } ?> </td> <td><?=$TagName2?></td> <td style="text-align: center"><?=$TagUses2?></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align: center"> <? if ($TagID3) { ?> <input type="checkbox" name="oldtags[]" value="<?=$TagID3?>" /> <? } ?> </td> <td><?=$TagName3?></td> <td style="text-align: center"><?=$TagUses3?></td> </tr> <? } ?> <tr class="<?=(($i % 2)?'rowa':'rowb')?>"> <td colspan="11"><label for="newtag">New official tag: </label><input type="text" name="newtag" /></td> </tr> <tr style="border-top: thin solid"> <td colspan="11" style="text-align: center"><input type="submit" value="Submit Changes" /></td> </tr> </table> </form> </div> </div> <? show_footer(); ?>
<? if (!check_perms('users_mod')) { error(403); } if (isset($_POST['doit'])) { authorize(); if (isset($_POST['oldtags'])) { $OldTagIDs = $_POST['oldtags']; foreach ($OldTagIDs AS $OldTagID) { if (!is_number($OldTagID)) { error(403); } } $OldTagIDs = implode(', ', $OldTagIDs); $DB->query("UPDATE tags SET TagType = 'other' WHERE ID IN ($OldTagIDs)"); } if ($_POST['newtag']) { $TagName = sanitize_tag($_POST['newtag']); $DB->query("SELECT t.ID FROM tags AS t WHERE t.Name LIKE '".$TagName."'"); list($TagID) = $DB->next_record(); if($TagID) { $DB->query("UPDATE tags SET TagType = 'genre' WHERE ID = $TagID"); } else { // Tag doesn't exist yet - create tag $DB->query("INSERT INTO tags (Name, UserID, TagType, Uses) VALUES ('".$TagName."', ".$LoggedUser['ID'].", 'genre', 0)"); $TagID = $DB->inserted_id(); } } $Cache->delete_value('genre_tags'); } show_header('Official Tags'); ?> <h2>Official Tags</h2> <div style="text-align: center"> <div style="display: inline-block;"> <form method="post"> <input type="hidden" name="action" value="official_tags" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="doit" value="1" /> <table> <tr class="colhead_dark"> <td style="font-weight: bold" style="text-align: center">Remove</td> <td style="font-weight: bold">Tag</td> <td style="font-weight: bold">Uses</td> <td>&nbsp;&nbsp;&nbsp;</td> <td style="font-weight: bold" style="text-align: center">Remove</td> <td style="font-weight: bold">Tag</td> <td style="font-weight: bold">Uses</td> <td>&nbsp;&nbsp;&nbsp;</td> <td style="font-weight: bold" style="text-align: center">Remove</td> <td style="font-weight: bold">Tag</td> <td style="font-weight: bold">Uses</td> </tr> <? $i = 0; $DB->query("SELECT ID, Name, Uses FROM tags WHERE TagType='genre' ORDER BY Name ASC"); $TagCount = $DB->record_count(); $Tags = $DB->to_array(); for ($i = 0; $i < $TagCount / 3; $i++) { list($TagID1, $TagName1, $TagUses1) = $Tags[$i]; list($TagID2, $TagName2, $TagUses2) = $Tags[ceil($TagCount/3) + $i]; list($TagID3, $TagName3, $TagUses3) = $Tags[2*ceil($TagCount/3) + $i]; ?> <tr class="<?=(($i % 2)?'rowa':'rowb')?>"> <td style="text-align: center"><input type="checkbox" name="oldtags[]" value="<?=$TagID1?>" /></td> <td><?=$TagName1?></td> <td style="text-align: center"><?=$TagUses1?></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align: center"> <? if ($TagID2) { ?> <input type="checkbox" name="oldtags[]" value="<?=$TagID2?>" /> <? } ?> </td> <td><?=$TagName2?></td> <td style="text-align: center"><?=$TagUses2?></td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td style="text-align: center"> <? if ($TagID3) { ?> <input type="checkbox" name="oldtags[]" value="<?=$TagID3?>" /> <? } ?> </td> <td><?=$TagName3?></td> <td style="text-align: center"><?=$TagUses3?></td> </tr> <? } ?> <tr class="<?=(($i % 2)?'rowa':'rowb')?>"> <td colspan="11"><label for="newtag">New official tag: </label><input type="text" name="newtag" /></td> </tr> <tr style="border-top: thin solid"> <td colspan="11" style="text-align: center"><input type="submit" value="Submit Changes" /></td> </tr> </table> </form> </div> </div> <? show_footer(); ?>