Empty commit

This commit is contained in:
Git 2013-04-01 08:00:47 +00:00
parent 4429a12057
commit f6b5d6a71e
8 changed files with 367 additions and 341 deletions

View File

@ -1,5 +1,5 @@
<? <?
function compare($X, $Y){ function compare($X, $Y) {
return($Y['score'] - $X['score']); return($Y['score'] - $X['score']);
} }
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
@ -13,9 +13,11 @@ function compare($X, $Y){
$Text = NEW TEXT; $Text = NEW TEXT;
$GroupID=ceil($_GET['id']); $GroupID=ceil($_GET['id']);
if(!empty($_GET['revisionid']) && is_number($_GET['revisionid'])) { if (!empty($_GET['revisionid']) && is_number($_GET['revisionid'])) {
$RevisionID = $_GET['revisionid']; $RevisionID = $_GET['revisionid'];
} else { $RevisionID = 0; } } else {
$RevisionID = 0;
}
include(SERVER_ROOT.'/sections/torrents/functions.php'); include(SERVER_ROOT.'/sections/torrents/functions.php');
$TorrentCache = get_group_info($GroupID, true, $RevisionID); $TorrentCache = get_group_info($GroupID, true, $RevisionID);
@ -35,22 +37,22 @@ function compare($X, $Y){
$Artists = Artists::get_artist($GroupID); $Artists = Artists::get_artist($GroupID);
if($Artists) { if ($Artists) {
$DisplayName = '<span dir="ltr">'.Artists::display_artists($Artists, true).$DisplayName.'</span>'; $DisplayName = '<span dir="ltr">'.Artists::display_artists($Artists, true).$DisplayName.'</span>';
$AltName = display_str(Artists::display_artists($Artists, false)).$AltName; $AltName = display_str(Artists::display_artists($Artists, false)).$AltName;
$Title = $AltName; $Title = $AltName;
} }
if($GroupYear>0) { if ($GroupYear > 0) {
$DisplayName.=' ['.$GroupYear.']'; $DisplayName.=' ['.$GroupYear.']';
$AltName.=' ['.$GroupYear.']'; $AltName.=' ['.$GroupYear.']';
$Title.= ' ['.$GroupYear.']'; $Title.= ' ['.$GroupYear.']';
} }
if($GroupVanityHouse){ if ($GroupVanityHouse){
$DisplayName.=' [Vanity House]'; $DisplayName.=' [Vanity House]';
$AltName.=' [Vanity House]'; $AltName.=' [Vanity House]';
} }
if($GroupCategoryID == 1) { if ($GroupCategoryID == 1) {
$DisplayName.=' ['.$ReleaseTypes[$ReleaseType].']'; $DisplayName.=' ['.$ReleaseTypes[$ReleaseType].']';
$AltName.=' ['.$ReleaseTypes[$ReleaseType].']'; $AltName.=' ['.$ReleaseTypes[$ReleaseType].']';
} }
@ -86,14 +88,14 @@ function compare($X, $Y){
<div class="header"> <div class="header">
<h2><?=$DisplayName?></h2> <h2><?=$DisplayName?></h2>
<div class="linkbox"> <div class="linkbox">
<? if(check_perms('site_edit_wiki')) { ?> <? if (check_perms('site_edit_wiki')) { ?>
<a href="torrents.php?action=editgroup&amp;groupid=<?=$GroupID?>" class="brackets">Edit description</a> <a href="torrents.php?action=editgroup&amp;groupid=<?=$GroupID?>" class="brackets">Edit description</a>
<? } ?> <? } ?>
<a href="torrents.php?action=history&amp;groupid=<?=$GroupID?>" class="brackets">View history</a> <a href="torrents.php?action=history&amp;groupid=<?=$GroupID?>" class="brackets">View history</a>
<? if($RevisionID && check_perms('site_edit_wiki')) { ?> <? if ($RevisionID && check_perms('site_edit_wiki')) { ?>
<a href="/torrents.php?action=revert&amp;groupid=<?=$GroupID ?>&amp;revisionid=<?=$RevisionID ?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a> <a href="/torrents.php?action=revert&amp;groupid=<?=$GroupID ?>&amp;revisionid=<?=$RevisionID ?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a>
<? } <? }
if(Bookmarks::has_bookmarked('torrent', $GroupID)) { if (Bookmarks::has_bookmarked('torrent', $GroupID)) {
?> ?>
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark brackets" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a> <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark brackets" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a>
<? } else { ?> <? } else { ?>
@ -102,12 +104,12 @@ function compare($X, $Y){
?> ?>
<!-- <a href="#" id="recommend" class="brackets">Recommend</a> --> <!-- <a href="#" id="recommend" class="brackets">Recommend</a> -->
<? <?
if($Categories[$GroupCategoryID-1] == 'Music') { ?> if ($Categories[$GroupCategoryID-1] == 'Music') { ?>
<a href="upload.php?groupid=<?=$GroupID?>" class="brackets">Add format</a> <a href="upload.php?groupid=<?=$GroupID?>" class="brackets">Add format</a>
<? } <? }
if(check_perms('site_submit_requests')) { ?> if (check_perms('site_submit_requests')) { ?>
<a href="requests.php?action=new&amp;groupid=<?=$GroupID?>" class="brackets">Request format</a> <a href="requests.php?action=new&amp;groupid=<?=$GroupID?>" class="brackets">Request format</a>
<? }?> <? } ?>
<a href="torrents.php?action=grouplog&amp;groupid=<?=$GroupID?>" class="brackets">View log</a> <a href="torrents.php?action=grouplog&amp;groupid=<?=$GroupID?>" class="brackets">View log</a>
</div> </div>
</div> </div>
@ -116,9 +118,9 @@ function compare($X, $Y){
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated --> <div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
<div class="head"><strong>Cover</strong></div> <div class="head"><strong>Cover</strong></div>
<? <?
if ($WikiImage!="") { if ($WikiImage != "") {
$WikiImageThumb = ImageTools::wiki_image($WikiImage); $WikiImageThumb = ImageTools::wiki_image($WikiImage);
if(check_perms('site_proxy_images')) { if (check_perms('site_proxy_images')) {
$WikiImage = ImageTools::proxy_url($WikiImage); $WikiImage = ImageTools::proxy_url($WikiImage);
} }
?> ?>
@ -132,7 +134,7 @@ function compare($X, $Y){
?> ?>
</div> </div>
<? <?
if($Categories[$GroupCategoryID-1] == 'Music') { if ($Categories[$GroupCategoryID-1] == 'Music') {
$ShownWith = false; $ShownWith = false;
?> ?>
<div class="box box_artists"> <div class="box box_artists">
@ -140,13 +142,13 @@ function compare($X, $Y){
<?=(check_perms('torrents_edit')) ? '<span style="float:right;" class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets">Edit</a></span>' : ''?> <?=(check_perms('torrents_edit')) ? '<span style="float:right;" class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets">Edit</a></span>' : ''?>
</div> </div>
<ul class="stats nobullet" id="artist_list"> <ul class="stats nobullet" id="artist_list">
<? if(!empty($Artists[4]) && count($Artists[4]) > 0) { <? if (!empty($Artists[4]) && count($Artists[4]) > 0) {
print ' <li class="artists_composers"><strong class="artists_label">Composers:</strong></li>'; print ' <li class="artists_composers"><strong class="artists_label">Composers:</strong></li>';
foreach($Artists[4] as $Artist) { foreach ($Artists[4] as $Artist) {
?> ?>
<li class="artists_composers"> <li class="artists_composers">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')){
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); $DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
list($AliasID) = $DB->next_record(); list($AliasID) = $DB->next_record();
if (empty($AliasID)) { if (empty($AliasID)) {
@ -161,11 +163,11 @@ function compare($X, $Y){
} }
if (!empty($Artists[6]) && count($Artists[6]) > 0) { if (!empty($Artists[6]) && count($Artists[6]) > 0) {
print ' <li class="artists_dj"><strong class="artists_label">DJ / Compiler:</strong></li>'; print ' <li class="artists_dj"><strong class="artists_label">DJ / Compiler:</strong></li>';
foreach($Artists[6] as $Artist) { foreach ($Artists[6] as $Artist) {
?> ?>
<li class="artists_dj"> <li class="artists_dj">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')){
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); $DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
list($AliasID) = $DB->next_record(); list($AliasID) = $DB->next_record();
if (empty($AliasID)) { if (empty($AliasID)) {
@ -184,11 +186,11 @@ function compare($X, $Y){
} elseif ((count($Artists[4]) > 0) && (count($Artists[1]) > 0)) { } elseif ((count($Artists[4]) > 0) && (count($Artists[1]) > 0)) {
print ' <li class="artists_main"><strong class="artists_label">Performers:</strong></li>'; print ' <li class="artists_main"><strong class="artists_label">Performers:</strong></li>';
} }
foreach($Artists[1] as $Artist) { foreach ($Artists[1] as $Artist) {
?> ?>
<li class="artist_main"> <li class="artist_main">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')){
$AliasID = $Artist['aliasid']; $AliasID = $Artist['aliasid'];
if (empty($AliasID)) { if (empty($AliasID)) {
$AliasID = $Artist['id']; $AliasID = $Artist['id'];
@ -200,13 +202,13 @@ function compare($X, $Y){
</li> </li>
<? <?
} }
if(!empty($Artists[2]) && count($Artists[2]) > 0) { if (!empty($Artists[2]) && count($Artists[2]) > 0) {
print ' <li class="artists_with"><strong class="artists_label">With:</strong></li>'; print ' <li class="artists_with"><strong class="artists_label">With:</strong></li>';
foreach($Artists[2] as $Artist) { foreach ($Artists[2] as $Artist) {
?> ?>
<li class="artist_guest"> <li class="artist_guest">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')){
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); $DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
list($AliasID) = $DB->next_record(); list($AliasID) = $DB->next_record();
if (empty($AliasID)) { if (empty($AliasID)) {
@ -220,13 +222,13 @@ function compare($X, $Y){
<? <?
} }
} }
if(!empty($Artists[5]) && count($Artists[5]) > 0) { if (!empty($Artists[5]) && count($Artists[5]) > 0) {
print ' <li class="artists_conductors"><strong class="artists_label">Conducted by:</strong></li>'; print ' <li class="artists_conductors"><strong class="artists_label">Conducted by:</strong></li>';
foreach($Artists[5] as $Artist) { foreach ($Artists[5] as $Artist) {
?> ?>
<li class="artists_conductors"> <li class="artists_conductors">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')){
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); $DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
list($AliasID) = $DB->next_record(); list($AliasID) = $DB->next_record();
if (empty($AliasID)) { if (empty($AliasID)) {
@ -242,11 +244,11 @@ function compare($X, $Y){
} }
if (!empty($Artists[3]) && count($Artists[3]) > 0) { if (!empty($Artists[3]) && count($Artists[3]) > 0) {
print ' <li class="artists_remix"><strong class="artists_label">Remixed by:</strong></li>'; print ' <li class="artists_remix"><strong class="artists_label">Remixed by:</strong></li>';
foreach($Artists[3] as $Artist) { foreach ($Artists[3] as $Artist) {
?> ?>
<li class="artists_remix"> <li class="artists_remix">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')){
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); $DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
list($AliasID) = $DB->next_record(); list($AliasID) = $DB->next_record();
if (empty($AliasID)) { if (empty($AliasID)) {
@ -262,11 +264,11 @@ function compare($X, $Y){
} }
if (!empty($Artists[7]) && count($Artists[7]) > 0) { if (!empty($Artists[7]) && count($Artists[7]) > 0) {
print ' <li class="artists_producer"><strong class="artists_label">Produced by:</strong></li>'; print ' <li class="artists_producer"><strong class="artists_label">Produced by:</strong></li>';
foreach($Artists[7] as $Artist) { foreach ($Artists[7] as $Artist) {
?> ?>
<li class="artists_producer"> <li class="artists_producer">
<?=Artists::display_artist($Artist).' &lrm;'?> <?=Artists::display_artist($Artist).' &lrm;'?>
<? if(check_perms('torrents_edit')){ <? if (check_perms('torrents_edit')) {
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'"); $DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
list($AliasID) = $DB->next_record(); list($AliasID) = $DB->next_record();
if (empty($AliasID)) { if (empty($AliasID)) {
@ -284,7 +286,7 @@ function compare($X, $Y){
</ul> </ul>
</div> </div>
<? <?
if(check_perms('torrents_add_artist')) { ?> if (check_perms('torrents_add_artist')) { ?>
<div class="box box_addartists"> <div class="box box_addartists">
<div class="head"><strong>Add artist</strong><span style="float:right;" class="additional_add_artist"><a onclick="AddArtistField(); return false;" href="#" class="brackets">+</a></span></div> <div class="head"><strong>Add artist</strong><span style="float:right;" class="additional_add_artist"><a onclick="AddArtistField(); return false;" href="#" class="brackets">+</a></span></div>
<div class="body"> <div class="body">
@ -316,12 +318,11 @@ function compare($X, $Y){
<div class="box box_tags"> <div class="box box_tags">
<div class="head"><strong>Tags</strong></div> <div class="head"><strong>Tags</strong></div>
<? <?
if(count($Tags) > 0) { if (count($Tags) > 0) {
?> ?>
<ul class="stats nobullet"> <ul class="stats nobullet">
<? <?
foreach($Tags as $TagKey=>$Tag) { foreach ($Tags as $TagKey=>$Tag) {
?> ?>
<li> <li>
<a href="torrents.php?taglist=<?=$Tag['name']?>" style="float:left; display:block;"><?=display_str($Tag['name'])?></a> <a href="torrents.php?taglist=<?=$Tag['name']?>" style="float:left; display:block;"><?=display_str($Tag['name'])?></a>
@ -329,10 +330,10 @@ function compare($X, $Y){
<a href="torrents.php?action=vote_tag&amp;way=down&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" style="font-family: monospace;" title="Vote this tag down" class="brackets vote_tag_down">&minus;</a> <a href="torrents.php?action=vote_tag&amp;way=down&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" style="font-family: monospace;" title="Vote this tag down" class="brackets vote_tag_down">&minus;</a>
<?=$Tag['score']?> <?=$Tag['score']?>
<a href="torrents.php?action=vote_tag&amp;way=up&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" style="font-family: monospace;" title="Vote this tag up" class="brackets vote_tag_up">+</a> <a href="torrents.php?action=vote_tag&amp;way=up&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" style="font-family: monospace;" title="Vote this tag up" class="brackets vote_tag_up">+</a>
<? if(check_perms('users_warn')){ ?> <? if (check_perms('users_warn')) { ?>
<a href="user.php?id=<?=$Tag['userid']?>" title="View the profile of the user that added this tag" class="brackets view_tag_user">U</a> <a href="user.php?id=<?=$Tag['userid']?>" title="View the profile of the user that added this tag" class="brackets view_tag_user">U</a>
<? } ?> <? } ?>
<? if(empty($LoggedUser['DisableTagging']) && check_perms('site_delete_tag')){ ?> <? if (empty($LoggedUser['DisableTagging']) && check_perms('site_delete_tag')) { ?>
<span class="remove remove_tag"><a href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets" title="Remove tag">X</a></span> <span class="remove remove_tag"><a href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets" title="Remove tag">X</a></span>
<? } ?> <? } ?>
</div> </div>
@ -381,7 +382,6 @@ function compare($X, $Y){
<td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/leechers.png" alt="Leechers" title="Leechers" /></td> <td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/leechers.png" alt="Leechers" title="Leechers" /></td>
</tr> </tr>
<? <?
function filelist($Str) { function filelist($Str) {
return "</td><td>".Format::get_size($Str[1])."</td></tr>"; return "</td><td>".Format::get_size($Str[1])."</td></tr>";
} }
@ -409,14 +409,14 @@ function filelist($Str) {
$CassetteApproved, $LossymasterApproved, $LossywebApproved, $LastReseedRequest, $CassetteApproved, $LossymasterApproved, $LossywebApproved, $LastReseedRequest,
$LogInDB, $HasFile, $PersonalFL, $IsSnatched) = array_values($Torrent); $LogInDB, $HasFile, $PersonalFL, $IsSnatched) = array_values($Torrent);
if($Remastered && !$RemasterYear) { if ($Remastered && !$RemasterYear) {
$FirstUnknown = !isset($FirstUnknown); $FirstUnknown = !isset($FirstUnknown);
} }
$Reported = false; $Reported = false;
unset($ReportedTimes); unset($ReportedTimes);
$Reports = $Cache->get_value('reports_torrent_'.$TorrentID); $Reports = $Cache->get_value('reports_torrent_'.$TorrentID);
if($Reports === false) { if ($Reports === false) {
$DB->query("SELECT r.ID, $DB->query("SELECT r.ID,
r.ReporterID, r.ReporterID,
r.Type, r.Type,
@ -429,12 +429,12 @@ function filelist($Str) {
$Reports = $DB->to_array(); $Reports = $DB->to_array();
$Cache->cache_value('reports_torrent_'.$TorrentID, $Reports, 0); $Cache->cache_value('reports_torrent_'.$TorrentID, $Reports, 0);
} }
if(count($Reports) > 0) { if (count($Reports) > 0) {
$Reported = true; $Reported = true;
include(SERVER_ROOT.'/sections/reportsv2/array.php'); include(SERVER_ROOT.'/sections/reportsv2/array.php');
$ReportInfo = '<table class="reportinfo_table"><tr class="colhead_dark" style="font-weight: bold;"><td>This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? "reports" : "report").':</td></tr>'; $ReportInfo = '<table class="reportinfo_table"><tr class="colhead_dark" style="font-weight: bold;"><td>This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? "reports" : "report").':</td></tr>';
foreach($Reports as $Report) { foreach ($Reports as $Report) {
list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report; list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report;
$Reporter = Users::user_info($ReporterID); $Reporter = Users::user_info($ReporterID);
@ -442,7 +442,7 @@ function filelist($Str) {
if (array_key_exists($ReportType, $Types[$GroupCategoryID])) { if (array_key_exists($ReportType, $Types[$GroupCategoryID])) {
$ReportType = $Types[$GroupCategoryID][$ReportType]; $ReportType = $Types[$GroupCategoryID][$ReportType];
} else if(array_key_exists($ReportType,$Types['master'])) { } elseif (array_key_exists($ReportType,$Types['master'])) {
$ReportType = $Types['master'][$ReportType]; $ReportType = $Types['master'][$ReportType];
} else { } else {
//There was a type but it wasn't an option! //There was a type but it wasn't an option!
@ -494,28 +494,28 @@ function filelist($Str) {
$TorrentUploader = $Username; // Save this for "Uploaded by:" below $TorrentUploader = $Username; // Save this for "Uploaded by:" below
// similar to Torrents::torrent_info() // similar to Torrents::torrent_info()
if($Format) { $ExtraInfo.=display_str($Format); $AddExtra=' / '; } if ($Format) { $ExtraInfo.=display_str($Format); $AddExtra=' / '; }
if($Encoding) { $ExtraInfo.=$AddExtra.display_str($Encoding); $AddExtra=' / '; } if ($Encoding) { $ExtraInfo.=$AddExtra.display_str($Encoding); $AddExtra=' / '; }
if($HasLog) { $ExtraInfo.=$AddExtra.'Log'; $AddExtra=' / '; } if ($HasLog) { $ExtraInfo.=$AddExtra.'Log'; $AddExtra=' / '; }
if($HasLog && $LogInDB) { $ExtraInfo.=' ('.(int) $LogScore.'%)'; } if ($HasLog && $LogInDB) { $ExtraInfo.=' ('.(int) $LogScore.'%)'; }
if($HasCue) { $ExtraInfo.=$AddExtra.'Cue'; $AddExtra=' / '; } if ($HasCue) { $ExtraInfo.=$AddExtra.'Cue'; $AddExtra=' / '; }
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; } if ($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
if(!$ExtraInfo) { if (!$ExtraInfo) {
$ExtraInfo = $GroupName ; $AddExtra=' / '; $ExtraInfo = $GroupName ; $AddExtra=' / ';
} }
if($IsSnatched) { $ExtraInfo.=$AddExtra. Format::torrent_label('Snatched!'); $AddExtra=' / '; } if ($IsSnatched) { $ExtraInfo.=$AddExtra. Format::torrent_label('Snatched!'); $AddExtra=' / '; }
if($FreeTorrent == '1') { $ExtraInfo.=$AddExtra. Format::torrent_label('Freeleech!'); $AddExtra=' / '; } if ($FreeTorrent == '1') { $ExtraInfo.=$AddExtra. Format::torrent_label('Freeleech!'); $AddExtra=' / '; }
if($FreeTorrent == '2') { $ExtraInfo.=$AddExtra. Format::torrent_label('Neutral Leech!'); $AddExtra=' / '; } if ($FreeTorrent == '2') { $ExtraInfo.=$AddExtra. Format::torrent_label('Neutral Leech!'); $AddExtra=' / '; }
if($PersonalFL) { $ExtraInfo.=$AddExtra. Format::torrent_label('Personal Freeleech!'); $AddExtra=' / '; } if ($PersonalFL) { $ExtraInfo.=$AddExtra. Format::torrent_label('Personal Freeleech!'); $AddExtra=' / '; }
if($Reported) { $ExtraInfo.=$AddExtra. Format::torrent_label('Reported'); $AddExtra=' / '; } if ($Reported) { $ExtraInfo.=$AddExtra. Format::torrent_label('Reported'); $AddExtra=' / '; }
if(!empty($BadTags)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad Tags'); $AddExtra=' / '; } if (!empty($BadTags)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad Tags'); $AddExtra=' / '; }
if(!empty($BadFolders)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad Folders'); $AddExtra=' / '; } if (!empty($BadFolders)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad Folders'); $AddExtra=' / '; }
if(!empty($CassetteApproved)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Cassette Approved'); $AddExtra=' / '; } if (!empty($CassetteApproved)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Cassette Approved'); $AddExtra=' / '; }
if(!empty($LossymasterApproved)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Lossy Master Approved'); $AddExtra=' / '; } if (!empty($LossymasterApproved)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Lossy Master Approved'); $AddExtra=' / '; }
if(!empty($LossywebApproved)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Lossy WEB Approved'); $AddExtra = ' / '; } if (!empty($LossywebApproved)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Lossy WEB Approved'); $AddExtra = ' / '; }
if(!empty($BadFiles)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad File Names'); $AddExtra=' / '; } if (!empty($BadFiles)) { $ExtraInfo.=$AddExtra. Format::torrent_label('Bad File Names'); $AddExtra=' / '; }
if($GroupCategoryID == 1 if ($GroupCategoryID == 1
&& ($RemasterTitle != $LastRemasterTitle && ($RemasterTitle != $LastRemasterTitle
|| $RemasterYear != $LastRemasterYear || $RemasterYear != $LastRemasterYear
|| $RemasterRecordLabel != $LastRemasterRecordLabel || $RemasterRecordLabel != $LastRemasterRecordLabel
@ -545,10 +545,10 @@ function filelist($Str) {
| <a href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a> | <a href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
<? } ?> <? } ?>
| <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" title="Report">RP</a> | <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" title="Report">RP</a>
<? if($CanEdit) { ?> <? if ($CanEdit) { ?>
| <a href="torrents.php?action=edit&amp;id=<?=$TorrentID ?>" title="Edit">ED</a> | <a href="torrents.php?action=edit&amp;id=<?=$TorrentID ?>" title="Edit">ED</a>
<? } ?> <? } ?>
<? if(check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?> <? if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
| <a href="torrents.php?action=delete&amp;torrentid=<?=$TorrentID ?>" title="Remove">RM</a> | <a href="torrents.php?action=delete&amp;torrentid=<?=$TorrentID ?>" title="Remove">RM</a>
<? } ?> <? } ?>
@ -561,40 +561,38 @@ function filelist($Str) {
<td><?=number_format($Seeders)?></td> <td><?=number_format($Seeders)?></td>
<td><?=number_format($Leechers)?></td> <td><?=number_format($Leechers)?></td>
</tr> </tr>
<tr class="releases_<?=$ReleaseType?> groupid_<?=$GroupID?> edition_<?=$EditionID?> torrentdetails pad <? if(!isset($_GET['torrentid']) || $_GET['torrentid']!=$TorrentID) { ?>hidden<? } ?>" id="torrent_<?=$TorrentID; ?>"> <tr class="releases_<?=$ReleaseType?> groupid_<?=$GroupID?> edition_<?=$EditionID?> torrentdetails pad <? if (!isset($_GET['torrentid']) || $_GET['torrentid']!=$TorrentID) { ?>hidden<? } ?>" id="torrent_<?=$TorrentID; ?>">
<td colspan="5"> <td colspan="5">
<div id="release_<?=$TorrentID?>" class="no_overflow"> <div id="release_<?=$TorrentID?>" class="no_overflow">
<blockquote> <blockquote>
Uploaded by <?=Users::format_username($UserID, false, false, false)?> <?=time_diff($TorrentTime);?> Uploaded by <?=Users::format_username($UserID, false, false, false)?> <?=time_diff($TorrentTime);?>
<? if($Seeders == 0){ ?> <? if ($Seeders == 0) { ?>
<? <?
if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?> if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?>
<br /><strong>Last active: <?=time_diff($LastActive);?></strong> <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
<?} else { ?> <? } else { ?>
<br />Last active: <?=time_diff($LastActive);?> <br />Last active: <?=time_diff($LastActive); ?>
<?} ?> <? }
<? if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?>
if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time()-strtotime($LastReseedRequest)>=864000) { ?>
<br /><a href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>" class="brackets">Request re-seed</a> <br /><a href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>" class="brackets">Request re-seed</a>
<?} ?>
<? } ?> <? } ?>
<? } ?>
</blockquote> </blockquote>
</div> </div>
<? if(check_perms('site_moderate_requests')) { ?> <? if (check_perms('site_moderate_requests')) { ?>
<div class="linkbox"> <div class="linkbox">
<a href="torrents.php?action=masspm&amp;id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>" class="brackets">Mass PM snatchers</a> <a href="torrents.php?action=masspm&amp;id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>" class="brackets">Mass PM snatchers</a>
</div> </div>
<? } ?> <? } ?>
<div class="linkbox"> <div class="linkbox">
<a href="#" class="brackets" onclick="show_peers('<?=$TorrentID?>', 0);return false;">View peer list</a> <a href="#" class="brackets" onclick="show_peers('<?=$TorrentID?>', 0);return false;">View peer list</a>
<? if(check_perms('site_view_torrent_snatchlist')) { ?> <? if (check_perms('site_view_torrent_snatchlist')) { ?>
<a href="#" class="brackets" onclick="show_downloads('<?=$TorrentID?>', 0);return false;" title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a> <a href="#" class="brackets" onclick="show_downloads('<?=$TorrentID?>', 0);return false;" title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
<a href="#" class="brackets" onclick="show_snatches('<?=$TorrentID?>', 0);return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a> <a href="#" class="brackets" onclick="show_snatches('<?=$TorrentID?>', 0);return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
<? } ?> <? } ?>
<a href="#" class="brackets" onclick="show_files('<?=$TorrentID?>');return false;">View file list</a> <a href="#" class="brackets" onclick="show_files('<?=$TorrentID?>');return false;">View file list</a>
<? if($Reported) { ?> <? if ($Reported) { ?>
<a href="#" class="brackets" onclick="show_reported('<?=$TorrentID?>');return false;">View report information</a> <a href="#" class="brackets" onclick="show_reported('<?=$TorrentID?>');return false;">View report information</a>
<? } ?> <? } ?>
</div> </div>
@ -602,12 +600,12 @@ function filelist($Str) {
<div id="downloads_<?=$TorrentID?>" class="hidden"></div> <div id="downloads_<?=$TorrentID?>" class="hidden"></div>
<div id="snatches_<?=$TorrentID?>" class="hidden"></div> <div id="snatches_<?=$TorrentID?>" class="hidden"></div>
<div id="files_<?=$TorrentID?>" class="hidden"><?=$FileTable?></div> <div id="files_<?=$TorrentID?>" class="hidden"><?=$FileTable?></div>
<? if($Reported) { ?> <? if ($Reported) { ?>
<div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?></div> <div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?></div>
<? } ?> <? }
<? if(!empty($Description)) { if (!empty($Description)) {
echo '<blockquote>'.$Text->full_format($Description).'</blockquote>';} echo '<blockquote>'.$Text->full_format($Description).'</blockquote>';}
?> ?>
</td> </td>
</tr> </tr>
<? } ?> <? } ?>
@ -625,10 +623,10 @@ function filelist($Str) {
<td>Votes</td> <td>Votes</td>
<td>Bounty</td> <td>Bounty</td>
</tr> </tr>
<? foreach($Requests as $Request) { <? foreach ($Requests as $Request) {
$RequestVotes = get_votes_array($Request['ID']); $RequestVotes = get_votes_array($Request['ID']);
if($Request['BitrateList'] != "") { if ($Request['BitrateList'] != "") {
$BitrateString = implode(", ", explode("|", $Request['BitrateList'])); $BitrateString = implode(", ", explode("|", $Request['BitrateList']));
$FormatString = implode(", ", explode("|", $Request['FormatList'])); $FormatString = implode(", ", explode("|", $Request['FormatList']));
$MediaString = implode(", ", explode("|", $Request['MediaList'])); $MediaString = implode(", ", explode("|", $Request['MediaList']));
@ -645,7 +643,7 @@ function filelist($Str) {
<td><a href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$FormatString?> / <?=$BitrateString?> / <?=$MediaString?></a></td> <td><a href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$FormatString?> / <?=$BitrateString?> / <?=$MediaString?></a></td>
<td> <td>
<span id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span> <span id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span>
<? if(check_perms('site_vote')){ ?> <? if (check_perms('site_vote')) { ?>
&nbsp;&nbsp; <a href="javascript:Vote(0, <?=$Request['ID']?>)" class="brackets">+</a> &nbsp;&nbsp; <a href="javascript:Vote(0, <?=$Request['ID']?>)" class="brackets">+</a>
<? } ?> <? } ?>
</td> </td>
@ -657,12 +655,12 @@ function filelist($Str) {
<? <?
} }
$Collages = $Cache->get_value('torrent_collages_'.$GroupID); $Collages = $Cache->get_value('torrent_collages_'.$GroupID);
if(!is_array($Collages)) { if (!is_array($Collages)) {
$DB->query("SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c JOIN collages_torrents AS ct ON ct.CollageID=c.ID WHERE ct.GroupID='$GroupID' AND Deleted='0' AND CategoryID!='0'"); $DB->query("SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c JOIN collages_torrents AS ct ON ct.CollageID=c.ID WHERE ct.GroupID='$GroupID' AND Deleted='0' AND CategoryID!='0'");
$Collages = $DB->to_array(); $Collages = $DB->to_array();
$Cache->cache_value('torrent_collages_'.$GroupID, $Collages, 3600*6); $Cache->cache_value('torrent_collages_'.$GroupID, $Collages, 3600*6);
} }
if(count($Collages)>0) { if (count($Collages) > 0) {
if (count($Collages) > MAX_COLLAGES) { if (count($Collages) > MAX_COLLAGES) {
// Pick some at random // Pick some at random
$Range = range(0,count($Collages) - 1); $Range = range(0,count($Collages) - 1);
@ -701,13 +699,13 @@ function filelist($Str) {
} }
$PersonalCollages = $Cache->get_value('torrent_collages_personal_'.$GroupID); $PersonalCollages = $Cache->get_value('torrent_collages_personal_'.$GroupID);
if(!is_array($PersonalCollages)) { if (!is_array($PersonalCollages)) {
$DB->query("SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c JOIN collages_torrents AS ct ON ct.CollageID=c.ID WHERE ct.GroupID='$GroupID' AND Deleted='0' AND CategoryID='0'"); $DB->query("SELECT c.Name, c.NumTorrents, c.ID FROM collages AS c JOIN collages_torrents AS ct ON ct.CollageID=c.ID WHERE ct.GroupID='$GroupID' AND Deleted='0' AND CategoryID='0'");
$PersonalCollages = $DB->to_array(false, MYSQLI_NUM); $PersonalCollages = $DB->to_array(false, MYSQLI_NUM);
$Cache->cache_value('torrent_collages_personal_'.$GroupID, $PersonalCollages, 3600*6); $Cache->cache_value('torrent_collages_personal_'.$GroupID, $PersonalCollages, 3600*6);
} }
if(count($PersonalCollages)>0) { if (count($PersonalCollages) > 0) {
if (count($PersonalCollages) > MAX_PERS_COLLAGES) { if (count($PersonalCollages) > MAX_PERS_COLLAGES) {
// Pick some at random // Pick some at random
$Range = range(0,count($PersonalCollages) - 1); $Range = range(0,count($PersonalCollages) - 1);
@ -756,7 +754,7 @@ function filelist($Str) {
// gets the amount of comments for this group // gets the amount of comments for this group
$Results = $Cache->get_value('torrent_comments_'.$GroupID); $Results = $Cache->get_value('torrent_comments_'.$GroupID);
if($Results === false) { if ($Results === false) {
$DB->query("SELECT $DB->query("SELECT
COUNT(c.ID) COUNT(c.ID)
FROM torrents_comments as c FROM torrents_comments as c
@ -765,7 +763,7 @@ function filelist($Str) {
$Cache->cache_value('torrent_comments_'.$GroupID, $Results, 0); $Cache->cache_value('torrent_comments_'.$GroupID, $Results, 0);
} }
if(isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) { if (isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
$DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE GroupID = $GroupID AND ID <= $_GET[postid]"); $DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE GroupID = $GroupID AND ID <= $_GET[postid]");
list($PostNum) = $DB->next_record(); list($PostNum) = $DB->next_record();
list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum); list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum);
@ -781,7 +779,7 @@ function filelist($Str) {
// Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page // Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
$Catalogue = $Cache->get_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID); $Catalogue = $Cache->get_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID);
if($Catalogue === false) { if ($Catalogue === false) {
$DB->query("SELECT $DB->query("SELECT
c.ID, c.ID,
c.AuthorID, c.AuthorID,
@ -809,9 +807,8 @@ function filelist($Str) {
?> ?>
</div> </div>
<? <?
//---------- Begin printing //---------- Begin printing
foreach($Thread as $Key => $Post) { foreach ($Thread as $Key => $Post) {
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post); list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID)); list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
?> ?>

View File

@ -22,20 +22,20 @@
define('USERS_PER_PAGE', 30); define('USERS_PER_PAGE', 30);
function wrap($String, $ForceMatch = '', $IPSearch = false){ function wrap($String, $ForceMatch = '', $IPSearch = false) {
if(!$ForceMatch){ if (!$ForceMatch) {
global $Match; global $Match;
} else { } else {
$Match = $ForceMatch; $Match = $ForceMatch;
} }
if($Match == ' REGEXP '){ if ($Match == ' REGEXP ') {
if(strpos($String, '\'') !== false || preg_match('/^.*\\\\$/i', $String)){ if (strpos($String, '\'') !== false || preg_match('/^.*\\\\$/i', $String)) {
error('Regex contains illegal characters.'); error('Regex contains illegal characters.');
} }
} else { } else {
$String = db_string($String); $String = db_string($String);
} }
if($Match == ' LIKE '){ if ($Match == ' LIKE ') {
// Fuzzy search // Fuzzy search
// Stick in wildcards at beginning and end of string unless string starts or ends with | // Stick in wildcards at beginning and end of string unless string starts or ends with |
if (($String[0] != '|') && !$IPSearch) { if (($String[0] != '|') && !$IPSearch) {
@ -44,23 +44,22 @@ function wrap($String, $ForceMatch = '', $IPSearch = false){
$String = substr($String, 1, strlen($String)); $String = substr($String, 1, strlen($String));
} }
if(substr($String, -1, 1) != '|'){ if (substr($String, -1, 1) != '|') {
$String = $String.'%'; $String = $String.'%';
} else { } else {
$String = substr($String, 0, -1); $String = substr($String, 0, -1);
} }
} }
$String="'$String'"; $String="'$String'";
return $String; return $String;
} }
function date_compare($Field, $Operand, $Date1, $Date2 = ''){ function date_compare($Field, $Operand, $Date1, $Date2 = '') {
$Date1 = db_string($Date1); $Date1 = db_string($Date1);
$Date2 = db_string($Date2); $Date2 = db_string($Date2);
$Return = array(); $Return = array();
switch($Operand){ switch($Operand) {
case 'on': case 'on':
$Return []= " $Field>='$Date1 00:00:00' "; $Return []= " $Field>='$Date1 00:00:00' ";
$Return []= " $Field<='$Date1 23:59:59' "; $Return []= " $Field<='$Date1 23:59:59' ";
@ -81,18 +80,18 @@ function date_compare($Field, $Operand, $Date1, $Date2 = ''){
} }
function num_compare($Field, $Operand, $Num1, $Num2 = ''){ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
if($Num1!=0){ if ($Num1 != 0) {
$Num1 = db_string($Num1); $Num1 = db_string($Num1);
} }
if($Num2!=0){ if ($Num2 != 0) {
$Num2 = db_string($Num2); $Num2 = db_string($Num2);
} }
$Return = array(); $Return = array();
switch($Operand){ switch($Operand) {
case 'equal': case 'equal':
$Return []= " $Field='$Num1' "; $Return []= " $Field='$Num1' ";
break; break;
@ -122,7 +121,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
$OrderVals = array('inarray'=>array('Username', 'Ratio', 'IP', 'Email', 'Joined', 'Last Seen', 'Uploaded', 'Downloaded', 'Invites', 'Snatches')); $OrderVals = array('inarray'=>array('Username', 'Ratio', 'IP', 'Email', 'Joined', 'Last Seen', 'Uploaded', 'Downloaded', 'Invites', 'Snatches'));
$WayVals = array('inarray'=>array('Ascending', 'Descending')); $WayVals = array('inarray'=>array('Ascending', 'Descending'));
if(count($_GET)){ if (count($_GET)) {
$DateRegex = array('regex'=>'/\d{4}-\d{2}-\d{2}/'); $DateRegex = array('regex'=>'/\d{4}-\d{2}-\d{2}/');
$ClassIDs = array(); $ClassIDs = array();
@ -172,13 +171,13 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
$Err = $Val->ValidateForm($_GET); $Err = $Val->ValidateForm($_GET);
if(!$Err){ if (!$Err) {
// Passed validation. Let's rock. // Passed validation. Let's rock.
$RunQuery = false; // if we should run the search $RunQuery = false; // if we should run the search
if(isset($_GET['matchtype']) && $_GET['matchtype'] == 'strict'){ if (isset($_GET['matchtype']) && $_GET['matchtype'] == 'strict') {
$Match = ' = '; $Match = ' = ';
} elseif(isset($_GET['matchtype']) && $_GET['matchtype'] == 'regex') { } elseif (isset($_GET['matchtype']) && $_GET['matchtype'] == 'regex') {
$Match = ' REGEXP '; $Match = ' REGEXP ';
} else { } else {
$Match = ' LIKE '; $Match = ' LIKE ';
@ -219,12 +218,12 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
FROM users_main AS um1 JOIN users_info AS ui1 ON ui1.UserID=um1.ID '; FROM users_main AS um1 JOIN users_info AS ui1 ON ui1.UserID=um1.ID ';
if(!empty($_GET['username'])){ if (!empty($_GET['username'])) {
$Where[]='um1.Username'.$Match.wrap($_GET['username']); $Where[]='um1.Username'.$Match.wrap($_GET['username']);
} }
if(!empty($_GET['email'])){ if (!empty($_GET['email'])) {
if(isset($_GET['email_history'])){ if (isset($_GET['email_history'])) {
$Distinct = 'DISTINCT '; $Distinct = 'DISTINCT ';
$Join['he']=' JOIN users_history_emails AS he ON he.UserID=um1.ID '; $Join['he']=' JOIN users_history_emails AS he ON he.UserID=um1.ID ';
$Where[]= ' he.Email '.$Match.wrap($_GET['email']); $Where[]= ' he.Email '.$Match.wrap($_GET['email']);
@ -255,8 +254,8 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
} }
if(!empty($_GET['ip'])){ if (!empty($_GET['ip'])) {
if(isset($_GET['ip_history'])){ if (isset($_GET['ip_history'])) {
$Distinct = 'DISTINCT '; $Distinct = 'DISTINCT ';
$Join['hi']=' JOIN users_history_ips AS hi ON hi.UserID=um1.ID '; $Join['hi']=' JOIN users_history_ips AS hi ON hi.UserID=um1.ID ';
$Where[]= ' hi.IP '.$Match.wrap($_GET['ip'], '', true); $Where[]= ' hi.IP '.$Match.wrap($_GET['ip'], '', true);
@ -275,19 +274,19 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
} }
} }
if(!empty($_GET['tracker_ip'])){ if (!empty($_GET['tracker_ip'])) {
$Distinct = 'DISTINCT '; $Distinct = 'DISTINCT ';
$Join['xfu']=' JOIN xbt_files_users AS xfu ON um1.ID=xfu.uid '; $Join['xfu']=' JOIN xbt_files_users AS xfu ON um1.ID=xfu.uid ';
$Where[]= ' xfu.ip '.$Match.wrap($_GET['tracker_ip'], '', true); $Where[]= ' xfu.ip '.$Match.wrap($_GET['tracker_ip'], '', true);
} }
// if(!empty($_GET['tracker_ip'])){ // if (!empty($_GET['tracker_ip'])) {
// $Distinct = 'DISTINCT '; // $Distinct = 'DISTINCT ';
// $Join['xs']=' JOIN xbt_snatched AS xs ON um1.ID=xs.uid '; // $Join['xs']=' JOIN xbt_snatched AS xs ON um1.ID=xs.uid ';
// $Where[]= ' xs.IP '.$Match.wrap($_GET['ip']); // $Where[]= ' xs.IP '.$Match.wrap($_GET['ip']);
// } // }
if(!empty($_GET['comment'])){ if (!empty($_GET['comment'])) {
$Where[]='ui1.AdminComment'.$Match.wrap($_GET['comment']); $Where[]='ui1.AdminComment'.$Match.wrap($_GET['comment']);
} }
@ -298,91 +297,92 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
} }
if(strlen($_GET['invites1'])){ if (strlen($_GET['invites1'])) {
$Invites1 = round($_GET['invites1']); $Invites1 = round($_GET['invites1']);
$Invites2 = round($_GET['invites2']); $Invites2 = round($_GET['invites2']);
$Where[]=implode(' AND ', num_compare('Invites', $_GET['invites'], $Invites1, $Invites2)); $Where[]=implode(' AND ', num_compare('Invites', $_GET['invites'], $Invites1, $Invites2));
} }
if($_GET['disabled_invites'] == 'yes'){ if ($_GET['disabled_invites'] == 'yes') {
$Where[]='ui1.DisableInvites=\'1\''; $Where[]='ui1.DisableInvites=\'1\'';
} elseif($_GET['disabled_invites'] == 'no'){ } elseif ($_GET['disabled_invites'] == 'no') {
$Where[]='ui1.DisableInvites=\'0\''; $Where[]='ui1.DisableInvites=\'0\'';
} }
if($_GET['disabled_uploads'] == 'yes'){ if ($_GET['disabled_uploads'] == 'yes') {
$Where[]='ui1.DisableUpload=\'1\''; $Where[]='ui1.DisableUpload=\'1\'';
} elseif($_GET['disabled_uploads'] == 'no'){ } elseif ($_GET['disabled_uploads'] == 'no') {
$Where[]='ui1.DisableUpload=\'0\''; $Where[]='ui1.DisableUpload=\'0\'';
} }
if($_GET['join1']){ if ($_GET['join1']) {
$Where[]=implode(' AND ', date_compare('ui1.JoinDate', $_GET['joined'], $_GET['join1'], $_GET['join2'])); $Where[]=implode(' AND ', date_compare('ui1.JoinDate', $_GET['joined'], $_GET['join1'], $_GET['join2']));
} }
if($_GET['lastactive1']){ if ($_GET['lastactive1']) {
$Where[]=implode(' AND ', date_compare('um1.LastAccess', $_GET['lastactive'], $_GET['lastactive1'], $_GET['lastactive2'])); $Where[]=implode(' AND ', date_compare('um1.LastAccess', $_GET['lastactive'], $_GET['lastactive1'], $_GET['lastactive2']));
} }
if($_GET['ratio1']){ if ($_GET['ratio1']) {
$Decimals = strlen(array_pop(explode('.', $_GET['ratio1']))); $Decimals = strlen(array_pop(explode('.', $_GET['ratio1'])));
if(!$Decimals){ $Decimals = 0; } if (!$Decimals) {
$Decimals = 0;
}
$Where[]=implode(' AND ', num_compare("ROUND(Uploaded/Downloaded,$Decimals)", $_GET['ratio'], $_GET['ratio1'], $_GET['ratio2'])); $Where[]=implode(' AND ', num_compare("ROUND(Uploaded/Downloaded,$Decimals)", $_GET['ratio'], $_GET['ratio1'], $_GET['ratio2']));
} }
if(strlen($_GET['uploaded1'])){ if (strlen($_GET['uploaded1'])) {
$Upload1 = round($_GET['uploaded1']); $Upload1 = round($_GET['uploaded1']);
$Upload2 = round($_GET['uploaded2']); $Upload2 = round($_GET['uploaded2']);
if($_GET['uploaded']!='buffer'){ if ($_GET['uploaded']!='buffer') {
$Where[]=implode(' AND ', num_compare('ROUND(Uploaded/1024/1024/1024)', $_GET['uploaded'], $Upload1, $Upload2)); $Where[]=implode(' AND ', num_compare('ROUND(Uploaded/1024/1024/1024)', $_GET['uploaded'], $Upload1, $Upload2));
} else { } else {
$Where[]=implode(' AND ', num_compare('ROUND((Uploaded/1024/1024/1024)-(Downloaded/1024/1024/1023))', 'between', $Upload1*0.9, $Upload1*1.1)); $Where[]=implode(' AND ', num_compare('ROUND((Uploaded/1024/1024/1024)-(Downloaded/1024/1024/1023))', 'between', $Upload1*0.9, $Upload1*1.1));
} }
} }
if(strlen($_GET['downloaded1'])){ if (strlen($_GET['downloaded1'])) {
$Download1 = round($_GET['downloaded1']); $Download1 = round($_GET['downloaded1']);
$Download2 = round($_GET['downloaded2']); $Download2 = round($_GET['downloaded2']);
$Where[]=implode(' AND ', num_compare('ROUND(Downloaded/1024/1024/1024)', $_GET['downloaded'], $Download1, $Download2)); $Where[]=implode(' AND ', num_compare('ROUND(Downloaded/1024/1024/1024)', $_GET['downloaded'], $Download1, $Download2));
} }
if(strlen($_GET['snatched1'])){ if (strlen($_GET['snatched1'])) {
$Snatched1 = round($_GET['snatched1']); $Snatched1 = round($_GET['snatched1']);
$Snatched2 = round($_GET['snatched2']); $Snatched2 = round($_GET['snatched2']);
$Having[]=implode(' AND ', num_compare('Snatches', $_GET['snatched'], $Snatched1, $Snatched2)); $Having[]=implode(' AND ', num_compare('Snatches', $_GET['snatched'], $Snatched1, $Snatched2));
} }
if($_GET['enabled']!=''){ if ($_GET['enabled'] != '') {
$Where[]='um1.Enabled='.wrap($_GET['enabled'], '='); $Where[]='um1.Enabled='.wrap($_GET['enabled'], '=');
} }
if($_GET['class']!=''){ if ($_GET['class'] != '') {
$Where[]='um1.PermissionID='.wrap($_GET['class'], '='); $Where[]='um1.PermissionID='.wrap($_GET['class'], '=');
} }
if($_GET['secclass']!=''){ if ($_GET['secclass'] != '') {
$Join['ul']=' JOIN users_levels AS ul ON um1.ID=ul.UserID '; $Join['ul']=' JOIN users_levels AS ul ON um1.ID=ul.UserID ';
$Where[]='ul.PermissionID='.wrap($_GET['secclass'], '='); $Where[]='ul.PermissionID='.wrap($_GET['secclass'], '=');
} }
if($_GET['donor'] == 'yes'){ if ($_GET['donor'] == 'yes') {
$Where[]='ui1.Donor=\'1\''; $Where[]='ui1.Donor=\'1\'';
} elseif($_GET['donor'] == 'no'){ } elseif ($_GET['donor'] == 'no') {
$Where[]='ui1.Donor=\'0\''; $Where[]='ui1.Donor=\'0\'';
} }
if($_GET['warned'] == 'yes'){ if ($_GET['warned'] == 'yes') {
$Where[]='ui1.Warned!=\'0000-00-00 00:00:00\''; $Where[]='ui1.Warned!=\'0000-00-00 00:00:00\'';
} elseif($_GET['warned'] == 'no'){ } elseif ($_GET['warned'] == 'no') {
$Where[]='ui1.Warned=\'0000-00-00 00:00:00\''; $Where[]='ui1.Warned=\'0000-00-00 00:00:00\'';
} }
if($_GET['disabled_ip']){ if ($_GET['disabled_ip']) {
$Distinct = 'DISTINCT '; $Distinct = 'DISTINCT ';
if($_GET['ip_history']){ if ($_GET['ip_history']) {
if(!isset($Join['hi'])){ if (!isset($Join['hi'])) {
$Join['hi']=' JOIN users_history_ips AS hi ON hi.UserID=um1.ID '; $Join['hi']=' JOIN users_history_ips AS hi ON hi.UserID=um1.ID ';
} }
$Join['hi2']=' JOIN users_history_ips AS hi2 ON hi2.IP=hi.IP '; $Join['hi2']=' JOIN users_history_ips AS hi2 ON hi2.IP=hi.IP ';
@ -392,19 +392,19 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
} }
} }
if(!empty($_GET['passkey'])){ if (!empty($_GET['passkey'])) {
$Where[]='um1.torrent_pass'.$Match.wrap($_GET['passkey']); $Where[]='um1.torrent_pass'.$Match.wrap($_GET['passkey']);
} }
if(!empty($_GET['avatar'])){ if (!empty($_GET['avatar'])) {
$Where[]='ui1.Avatar'.$Match.wrap($_GET['avatar']); $Where[]='ui1.Avatar'.$Match.wrap($_GET['avatar']);
} }
if($_GET['stylesheet']!=''){ if ($_GET['stylesheet']!='') {
$Where[]='ui1.StyleID='.wrap($_GET['stylesheet'], '='); $Where[]='ui1.StyleID='.wrap($_GET['stylesheet'], '=');
} }
if($OrderTable[$_GET['order']] && $WayTable[$_GET['way']]){ if ($OrderTable[$_GET['order']] && $WayTable[$_GET['way']]) {
$Order = ' ORDER BY '.$OrderTable[$_GET['order']].' '.$WayTable[$_GET['way']].' '; $Order = ' ORDER BY '.$OrderTable[$_GET['order']].' '.$WayTable[$_GET['way']].' ';
} }
@ -413,16 +413,16 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
$SQL = 'SELECT '.$Distinct.$SQL; $SQL = 'SELECT '.$Distinct.$SQL;
$SQL .= implode(' ', $Join); $SQL .= implode(' ', $Join);
if(count($Where)){ if (count($Where)) {
$SQL .= ' WHERE '.implode(' AND ', $Where); $SQL .= ' WHERE '.implode(' AND ', $Where);
} }
if(count($Having)){ if (count($Having)) {
$SQL .= ' HAVING '.implode(' AND ', $Having); $SQL .= ' HAVING '.implode(' AND ', $Having);
} }
$SQL .= $Order; $SQL .= $Order;
if(count($Where)>0 || count($Join)>0 || count($Having)>0){ if (count($Where) > 0 || count($Join) > 0 || count($Having) > 0) {
$RunQuery = true; $RunQuery = true;
} }
@ -445,10 +445,10 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td class="label nobr"><span title="Date format is YYYY-MM-DD">Joined:</span></td> <td class="label nobr"><span title="Date format is YYYY-MM-DD">Joined:</span></td>
<td width="24%"> <td width="24%">
<select name="joined"> <select name="joined">
<option value="on"<? if($_GET['joined']==='on'){echo ' selected="selected"';}?>>On</option> <option value="on"<? if ($_GET['joined']==='on') {echo ' selected="selected"';}?>>On</option>
<option value="before"<? if($_GET['joined']==='before'){echo ' selected="selected"';}?>>Before</option> <option value="before"<? if ($_GET['joined']==='before') {echo ' selected="selected"';}?>>Before</option>
<option value="after"<? if($_GET['joined']==='after'){echo ' selected="selected"';}?>>After</option> <option value="after"<? if ($_GET['joined']==='after') {echo ' selected="selected"';}?>>After</option>
<option value="between"<? if($_GET['joined']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if ($_GET['joined']==='between') {echo ' selected="selected"';}?>>Between</option>
</select> </select>
<input type="text" name="join1" size="6" value="<?=display_str($_GET['join1'])?>" /> <input type="text" name="join1" size="6" value="<?=display_str($_GET['join1'])?>" />
<input type="text" name="join2" size="6" value="<?=display_str($_GET['join2'])?>" /> <input type="text" name="join2" size="6" value="<?=display_str($_GET['join2'])?>" />
@ -456,10 +456,10 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td class="label nobr">Enabled:</td> <td class="label nobr">Enabled:</td>
<td> <td>
<select name="enabled"> <select name="enabled">
<option value="" <? if($_GET['enabled']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if ($_GET['enabled']==='') {echo ' selected="selected"';}?>>Any</option>
<option value="0"<? if($_GET['enabled']==='0'){echo ' selected="selected"';}?>>Unconfirmed</option> <option value="0"<? if ($_GET['enabled']==='0') {echo ' selected="selected"';}?>>Unconfirmed</option>
<option value="1"<? if($_GET['enabled']==='1'){echo ' selected="selected"';}?>>Enabled</option> <option value="1"<? if ($_GET['enabled']==='1') {echo ' selected="selected"';}?>>Enabled</option>
<option value="2"<? if($_GET['enabled']==='2'){echo ' selected="selected"';}?>>Disabled</option> <option value="2"<? if ($_GET['enabled']==='2') {echo ' selected="selected"';}?>>Disabled</option>
</select> </select>
</td> </td>
</tr> </tr>
@ -471,22 +471,24 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td class="label nobr"><span title="Date format is YYYY-MM-DD">Last active:</span></td> <td class="label nobr"><span title="Date format is YYYY-MM-DD">Last active:</span></td>
<td width="30%"> <td width="30%">
<select name="lastactive"> <select name="lastactive">
<option value="on"<? if($_GET['lastactive']==='on'){echo ' selected="selected"';}?>>On</option> <option value="on"<? if ($_GET['lastactive']==='on') {echo ' selected="selected"';}?>>On</option>
<option value="before"<? if($_GET['lastactive']==='before'){echo ' selected="selected"';}?>>Before</option> <option value="before"<? if ($_GET['lastactive']==='before') {echo ' selected="selected"';}?>>Before</option>
<option value="after"<? if($_GET['lastactive']==='after'){echo ' selected="selected"';}?>>After</option> <option value="after"<? if ($_GET['lastactive']==='after') {echo ' selected="selected"';}?>>After</option>
<option value="between"<? if($_GET['lastactive']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if ($_GET['lastactive']==='between') {echo ' selected="selected"';}?>>Between</option>
</select> </select>
<input type="text" name="lastactive1" size="6" value="<?=display_str($_GET['lastactive1'])?>" /> <input type="text" name="lastactive1" size="6" value="<?=display_str($_GET['lastactive1'])?>" />
<input type="text" name="lastactive2" size="6" value="<?=display_str($_GET['lastactive2'])?>" /> <input type="text" name="lastactive2" size="6" value="<?=display_str($_GET['lastactive2'])?>" />
</td> </td>
<td class="label nobr">Primary Class:</td> <td class="label nobr">Primary class:</td>
<td> <td>
<select name="class"> <select name="class">
<option value="" <? if($_GET['class']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if ($_GET['class']==='') {echo ' selected="selected"';}?>>Any</option>
<? foreach($ClassLevels as $Class){ <? foreach ($ClassLevels as $Class) {
if ($Class['Secondary']) { continue; } if ($Class['Secondary']) {
continue;
}
?> ?>
<option value="<?=$Class['ID'] ?>" <? if($_GET['class']===$Class['ID']) {echo ' selected="selected"';}?>><?=Format::cut_string($Class['Name'], 10, 1, 1).' ('.$Class['Level'].')'?></option> <option value="<?=$Class['ID'] ?>"<? if ($_GET['class']===$Class['ID']) {echo ' selected="selected"';}?>><?=Format::cut_string($Class['Name'], 10, 1, 1).' ('.$Class['Level'].')'?></option>
<? } ?> <? } ?>
</select> </select>
</td> </td>
@ -498,22 +500,24 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
</td> </td>
<td class="label nobr"></td> <td class="label nobr"></td>
<td></td> <td></td>
<td class="label nobr">Secondary Class:</td> <td class="label nobr">Secondary class:</td>
<td> <td>
<select name="secclass"> <select name="secclass">
<option value="" <? if($_GET['secclass']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if ($_GET['secclass']==='') {echo ' selected="selected"';}?>>Any</option>
<? $Secondaries = array(); <? $Secondaries = array();
// Neither level nor ID is particularly useful when searching secondary classes, so let's do some // Neither level nor ID is particularly useful when searching secondary classes, so let's do some
// kung-fu to sort them alphabetically. // kung-fu to sort them alphabetically.
$fnc = function($Class1, $Class2) { return strcmp($Class1['Name'], $Class2['Name']);}; $fnc = function($Class1, $Class2) { return strcmp($Class1['Name'], $Class2['Name']);};
foreach($ClassLevels as $Class) { foreach ($ClassLevels as $Class) {
if (!$Class['Secondary']) { continue; } if (!$Class['Secondary']) {
continue;
}
$Secondaries[] = $Class; $Secondaries[] = $Class;
} }
usort($Secondaries, $fnc); usort($Secondaries, $fnc);
foreach($Secondaries as $Class) { foreach ($Secondaries as $Class) {
?> ?>
<option value="<?=$Class['ID'] ?>" <? if($_GET['secclass']===$Class['ID']) {echo ' selected="selected"';}?>><?=Format::cut_string($Class['Name'], 20, 1, 1)?></option> <option value="<?=$Class['ID'] ?>"<? if ($_GET['secclass']===$Class['ID']) {echo ' selected="selected"';}?>><?=Format::cut_string($Class['Name'], 20, 1, 1)?></option>
<? } ?> <? } ?>
</select> </select>
</td> </td>
@ -521,19 +525,19 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<tr> <tr>
<td class="label nobr">Extra:</td> <td class="label nobr">Extra:</td>
<td> <td>
<input type="checkbox" name="ip_history" id="ip_history"<? if($_GET['ip_history']){ echo ' checked="checked"'; }?> /> <input type="checkbox" name="ip_history" id="ip_history"<? if ($_GET['ip_history']) { echo ' checked="checked"'; }?> />
<label for="ip_history">IP History</label> <label for="ip_history">IP history</label>
<input type="checkbox" name="email_history" id="email_history"<? if($_GET['email_history']){ echo ' checked="checked"'; }?> /> <input type="checkbox" name="email_history" id="email_history"<? if ($_GET['email_history']) { echo ' checked="checked"'; }?> />
<label for="email_history">Email History</label> <label for="email_history">Email history</label>
</td> </td>
<td class="label nobr">Ratio:</td> <td class="label nobr">Ratio:</td>
<td width="30%"> <td width="30%">
<select name="ratio"> <select name="ratio">
<option value="equal"<? if($_GET['ratio']==='equal'){echo ' selected="selected"';}?>>Equal</option> <option value="equal"<? if ($_GET['ratio']==='equal') {echo ' selected="selected"';}?>>Equal</option>
<option value="above"<? if($_GET['ratio']==='above'){echo ' selected="selected"';}?>>Above</option> <option value="above"<? if ($_GET['ratio']==='above') {echo ' selected="selected"';}?>>Above</option>
<option value="below"<? if($_GET['ratio']==='below'){echo ' selected="selected"';}?>>Below</option> <option value="below"<? if ($_GET['ratio']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if($_GET['ratio']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if ($_GET['ratio']==='between') {echo ' selected="selected"';}?>>Between</option>
</select> </select>
<input type="text" name="ratio1" size="6" value="<?=display_str($_GET['ratio1'])?>" /> <input type="text" name="ratio1" size="6" value="<?=display_str($_GET['ratio1'])?>" />
<input type="text" name="ratio2" size="6" value="<?=display_str($_GET['ratio2'])?>" /> <input type="text" name="ratio2" size="6" value="<?=display_str($_GET['ratio2'])?>" />
@ -541,25 +545,31 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td class="label nobr">Donor:</td> <td class="label nobr">Donor:</td>
<td> <td>
<select name="donor"> <select name="donor">
<option value="" <? if($_GET['donor']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if ($_GET['donor']==='') {echo ' selected="selected"';}?>>Any</option>
<option value="yes" <? if($_GET['donor']==='yes') {echo ' selected="selected"';}?>>Yes</option> <option value="yes"<? if ($_GET['donor']==='yes') {echo ' selected="selected"';}?>>Yes</option>
<option value="no" <? if($_GET['donor']==='no') {echo ' selected="selected"';}?>>No</option> <option value="no"<? if ($_GET['donor']==='no') {echo ' selected="selected"';}?>>No</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label nobr">Comment:</td> <? if (check_perms('users_mod')) { ?>
<td class="label nobr">Staff notes:</td>
<td> <td>
<input type="text" name="comment" size="20" value="<?=display_str($_GET['comment'])?>" /> <input type="text" name="comment" size="20" value="<?=display_str($_GET['comment'])?>" />
</td> </td>
<? } else { ?>
<td class="label nobr"></td>
<td>
</td>
<? } ?>
<td class="label nobr"><span title="Units are in bytes">Uploaded:</span></td> <td class="label nobr"><span title="Units are in bytes">Uploaded:</span></td>
<td width="30%"> <td width="30%">
<select name="uploaded"> <select name="uploaded">
<option value="equal"<? if($_GET['uploaded']==='equal'){echo ' selected="selected"';}?>>Equal</option> <option value="equal"<? if ($_GET['uploaded']==='equal') {echo ' selected="selected"';}?>>Equal</option>
<option value="above"<? if($_GET['uploaded']==='above'){echo ' selected="selected"';}?>>Above</option> <option value="above"<? if ($_GET['uploaded']==='above') {echo ' selected="selected"';}?>>Above</option>
<option value="below"<? if($_GET['uploaded']==='below'){echo ' selected="selected"';}?>>Below</option> <option value="below"<? if ($_GET['uploaded']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if($_GET['uploaded']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if ($_GET['uploaded']==='between') {echo ' selected="selected"';}?>>Between</option>
<option value="buffer"<? if($_GET['uploaded']==='buffer'){echo ' selected="selected"';}?>>Buffer</option> <option value="buffer"<? if ($_GET['uploaded']==='buffer') {echo ' selected="selected"';}?>>Buffer</option>
</select> </select>
<input type="text" name="uploaded1" size="6" value="<?=display_str($_GET['uploaded1'])?>" /> <input type="text" name="uploaded1" size="6" value="<?=display_str($_GET['uploaded1'])?>" />
<input type="text" name="uploaded2" size="6" value="<?=display_str($_GET['uploaded2'])?>" /> <input type="text" name="uploaded2" size="6" value="<?=display_str($_GET['uploaded2'])?>" />
@ -567,21 +577,21 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td class="label nobr">Warned:</td> <td class="label nobr">Warned:</td>
<td> <td>
<select name="warned"> <select name="warned">
<option value="" <? if($_GET['warned']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if ($_GET['warned']==='') {echo ' selected="selected"';}?>>Any</option>
<option value="yes" <? if($_GET['warned']==='yes') {echo ' selected="selected"';}?>>Yes</option> <option value="yes"<? if ($_GET['warned']==='yes') {echo ' selected="selected"';}?>>Yes</option>
<option value="no" <? if($_GET['warned']==='no') {echo ' selected="selected"';}?>>No</option> <option value="no"<? if ($_GET['warned']==='no') {echo ' selected="selected"';}?>>No</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label nobr"># of Invites:</td> <td class="label nobr"># of invites:</td>
<td> <td>
<select name="invites"> <select name="invites">
<option value="equal"<? if($_GET['invites']==='equal'){echo ' selected="selected"';}?>>Equal</option> <option value="equal"<? if ($_GET['invites']==='equal') {echo ' selected="selected"';}?>>Equal</option>
<option value="above"<? if($_GET['invites']==='above'){echo ' selected="selected"';}?>>Above</option> <option value="above"<? if ($_GET['invites']==='above') {echo ' selected="selected"';}?>>Above</option>
<option value="below"<? if($_GET['invites']==='below'){echo ' selected="selected"';}?>>Below</option> <option value="below"<? if ($_GET['invites']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if($_GET['invites']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if ($_GET['invites']==='between') {echo ' selected="selected"';}?>>Between</option>
</select> </select>
<input type="text" name="invites1" size="6" value="<?=display_str($_GET['invites1'])?>" /> <input type="text" name="invites1" size="6" value="<?=display_str($_GET['invites1'])?>" />
<input type="text" name="invites2" size="6" value="<?=display_str($_GET['invites2'])?>" /> <input type="text" name="invites2" size="6" value="<?=display_str($_GET['invites2'])?>" />
@ -589,47 +599,49 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td class="label nobr"><span title="Units are in bytes">Downloaded:</span></td> <td class="label nobr"><span title="Units are in bytes">Downloaded:</span></td>
<td width="30%"> <td width="30%">
<select name="downloaded"> <select name="downloaded">
<option value="equal"<? if($_GET['downloaded']==='equal'){echo ' selected="selected"';}?>>Equal</option> <option value="equal"<? if ($_GET['downloaded']==='equal') {echo ' selected="selected"';}?>>Equal</option>
<option value="above"<? if($_GET['downloaded']==='above'){echo ' selected="selected"';}?>>Above</option> <option value="above"<? if ($_GET['downloaded']==='above') {echo ' selected="selected"';}?>>Above</option>
<option value="below"<? if($_GET['downloaded']==='below'){echo ' selected="selected"';}?>>Below</option> <option value="below"<? if ($_GET['downloaded']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if($_GET['downloaded']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if ($_GET['downloaded']==='between') {echo ' selected="selected"';}?>>Between</option>
</select> </select>
<input type="text" name="downloaded1" size="6" value="<?=display_str($_GET['downloaded1'])?>" /> <input type="text" name="downloaded1" size="6" value="<?=display_str($_GET['downloaded1'])?>" />
<input type="text" name="downloaded2" size="6" value="<?=display_str($_GET['downloaded2'])?>" /> <input type="text" name="downloaded2" size="6" value="<?=display_str($_GET['downloaded2'])?>" />
</td> </td>
<td class="label nobr">Disabled IP:</td> <td class="label nobr">
<label for="disabled_ip" title="Only display users that have a disabled account linked by IP address">Disabled accounts<br />linked by IP:</label>
</td>
<td> <td>
<input type="checkbox" name="disabled_ip" <? if($_GET['disabled_ip']){ echo ' checked="checked"'; }?> /> <input type="checkbox" name="disabled_ip" id="disabled_ip"<? if ($_GET['disabled_ip']) { echo ' checked="checked"'; }?> />
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label nobr">Disabled invites</td> <td class="label nobr">Disabled invites:</td>
<td> <td>
<select name="disabled_invites"> <select name="disabled_invites">
<option value="" <? if($_GET['disabled_invites']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if ($_GET['disabled_invites']==='') {echo ' selected="selected"';}?>>Any</option>
<option value="yes" <? if($_GET['disabled_invites']==='yes') {echo ' selected="selected"';}?>>Yes</option> <option value="yes"<? if ($_GET['disabled_invites']==='yes') {echo ' selected="selected"';}?>>Yes</option>
<option value="no" <? if($_GET['disabled_invites']==='no') {echo ' selected="selected"';}?>>No</option> <option value="no"<? if ($_GET['disabled_invites']==='no') {echo ' selected="selected"';}?>>No</option>
</select> </select>
</td> </td>
<td class="label nobr">Snatched:</td> <td class="label nobr">Snatched:</td>
<td width="30%"> <td width="30%">
<select name="snatched"> <select name="snatched">
<option value="equal"<? if(isset($_GET['snatched']) && $_GET['snatched']==='equal'){echo ' selected="selected"';}?>>Equal</option> <option value="equal"<? if (isset($_GET['snatched']) && $_GET['snatched']==='equal') {echo ' selected="selected"';}?>>Equal</option>
<option value="above"<? if(isset($_GET['snatched']) && $_GET['snatched']==='above'){echo ' selected="selected"';}?>>Above</option> <option value="above"<? if (isset($_GET['snatched']) && $_GET['snatched']==='above') {echo ' selected="selected"';}?>>Above</option>
<option value="below"<? if(isset($_GET['snatched']) && $_GET['snatched']==='below'){echo ' selected="selected"';}?>>Below</option> <option value="below"<? if (isset($_GET['snatched']) && $_GET['snatched']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if(isset($_GET['snatched']) && $_GET['snatched']==='between'){echo ' selected="selected"';}?>>Between</option> <option value="between"<? if (isset($_GET['snatched']) && $_GET['snatched']==='between') {echo ' selected="selected"';}?>>Between</option>
<option value="off"<? if(isset($_GET['snatched']) && $_GET['snatched']==='off'){echo ' selected="selected"';}?>>Off</option> <option value="off"<? if (isset($_GET['snatched']) && $_GET['snatched']==='off') {echo ' selected="selected"';}?>>Off</option>
</select> </select>
<input type="text" name="snatched1" size="6" value="<?=display_str($_GET['snatched1'])?>" /> <input type="text" name="snatched1" size="6" value="<?=display_str($_GET['snatched1'])?>" />
<input type="text" name="snatched2" size="6" value="<?=display_str($_GET['snatched2'])?>" /> <input type="text" name="snatched2" size="6" value="<?=display_str($_GET['snatched2'])?>" />
</td> </td>
<td class="label nobr">Disabled uploads</td> <td class="label nobr">Disabled uploads:</td>
<td> <td>
<select name="disabled_uploads"> <select name="disabled_uploads">
<option value="" <? if(isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='') {echo ' selected="selected"';}?>>Any</option> <option value=""<? if (isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='') {echo ' selected="selected"';}?>>Any</option>
<option value="yes" <? if(isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='yes') {echo ' selected="selected"';}?>>Yes</option> <option value="yes"<? if (isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='yes') {echo ' selected="selected"';}?>>Yes</option>
<option value="no" <? if(isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='no') {echo ' selected="selected"';}?>>No</option> <option value="no"<? if (isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='no') {echo ' selected="selected"';}?>>No</option>
</select> </select>
</td> </td>
</tr> </tr>
@ -642,7 +654,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td> <td>
<input type="text" name="tracker_ip" size="20" value="<?=display_str($_GET['tracker_ip'])?>" /> <input type="text" name="tracker_ip" size="20" value="<?=display_str($_GET['tracker_ip'])?>" />
</td> </td>
<td class="label nobr">Last.fm Username:</td> <td class="label nobr">Last.fm username:</td>
<td> <td>
<input type="text" name="lastfm" size="20" value="<?=display_str($_GET['lastfm'])?>" /> <input type="text" name="lastfm" size="20" value="<?=display_str($_GET['lastfm'])?>" />
</td> </td>
@ -657,48 +669,48 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td> <td>
<select name="stylesheet" id="stylesheet"> <select name="stylesheet" id="stylesheet">
<option value="">Any</option> <option value="">Any</option>
<? foreach($Stylesheets as $Style) { ?> <? foreach ($Stylesheets as $Style) { ?>
<option value="<?=$Style['ID']?>"<?Format::selected('stylesheet',$Style['ID'])?>><?=$Style['ProperName']?></option> <option value="<?=$Style['ID']?>"<?Format::selected('stylesheet',$Style['ID'])?>><?=$Style['ProperName']?></option>
<? } ?> <? } ?>
</select> </select>
</td> </td>
<td class="label nobr"><span title="Two-letter codes as defined in ISO 3166-1 alpha-2">Country Code:</span></td> <td class="label nobr"><span title="Two-letter codes as defined in ISO 3166-1 alpha-2">Country code:</span></td>
<td width="30%"> <td width="30%">
<select name="cc_op"> <select name="cc_op">
<option value="equal"<? if ($_GET['cc_op']==='equal'){ echo ' selected="selected"';}?>>Equals</option> <option value="equal"<? if ($_GET['cc_op']==='equal') { echo ' selected="selected"';}?>>Equals</option>
<option value="not_equal"<? if ($_GET['cc_op']==='not_equal'){ echo ' selected="selected"';}?>>Not Equal</option> <option value="not_equal"<? if ($_GET['cc_op']==='not_equal') { echo ' selected="selected"';}?>>Not equal</option>
</select> </select>
<input type="text" name="cc" size="2" value="<?=display_str($_GET['cc'])?>" /> <input type="text" name="cc" size="2" value="<?=display_str($_GET['cc'])?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label nobr">Type</td> <td class="label nobr">Search type:</td>
<td> <td>
<label title="A &quot;strict&quot; search uses no wildcards in search fields, and it is analogous to &#96;grep -E &quot;&circ;SEARCHTERM&#36;&quot;&#96;">Strict <input type="radio" name="matchtype" value="strict"<? if($_GET['matchtype'] == 'strict' || !$_GET['matchtype']){ echo ' checked="checked"'; } ?> /></label> | <label title="A &quot;strict&quot; search uses no wildcards in search fields, and it is analogous to &#96;grep -E &quot;&circ;SEARCHTERM&#36;&quot;&#96;">Strict <input type="radio" name="matchtype" value="strict"<? if ($_GET['matchtype'] == 'strict' || !$_GET['matchtype']) { echo ' checked="checked"'; } ?> /></label> |
<label title="A &quot;fuzzy&quot; search automatically prepends and appends wildcards to search strings, except for IP address searches, unless the search string begins or ends with a &quot;&#124;&quot; (pipe). It is analogous to a vanilla grep search (except for the pipe stuff).">Fuzzy <input type="radio" name="matchtype" value="fuzzy"<? if($_GET['matchtype'] == 'fuzzy' || !$_GET['matchtype']){ echo ' checked="checked"'; } ?> /></label> | <label title="A &quot;fuzzy&quot; search automatically prepends and appends wildcards to search strings, except for IP address searches, unless the search string begins or ends with a &quot;&#124;&quot; (pipe). It is analogous to a vanilla grep search (except for the pipe stuff).">Fuzzy <input type="radio" name="matchtype" value="fuzzy"<? if ($_GET['matchtype'] == 'fuzzy' || !$_GET['matchtype']) { echo ' checked="checked"'; } ?> /></label> |
<label title="A &quot;regex&quot; search uses MySQL's regular expression syntax.">Regex <input type="radio" name="matchtype" value="regex"<? if($_GET['matchtype'] == 'regex'){ echo ' checked="checked"'; } ?> /></label> <label title="A &quot;regex&quot; search uses MySQL's regular expression syntax.">Regex <input type="radio" name="matchtype" value="regex"<? if ($_GET['matchtype'] == 'regex') { echo ' checked="checked"'; } ?> /></label>
</td> </td>
<td class="label nobr">Order:</td> <td class="label nobr">Order:</td>
<td class="nobr"> <td class="nobr">
<select name="order"> <select name="order">
<? <?
foreach(array_shift($OrderVals) as $Cur){ ?> foreach (array_shift($OrderVals) as $Cur) { ?>
<option value="<?=$Cur?>"<? if(isset($_GET['order']) && $_GET['order'] == $Cur || (!isset($_GET['order']) && $Cur == 'Joined')) { echo ' selected="selected"'; } ?>><?=$Cur?></option> <option value="<?=$Cur?>"<? if (isset($_GET['order']) && $_GET['order'] == $Cur || (!isset($_GET['order']) && $Cur == 'Joined')) { echo ' selected="selected"'; } ?>><?=$Cur?></option>
<? }?> <? } ?>
</select> </select>
<select name="way"> <select name="way">
<? foreach(array_shift($WayVals) as $Cur){ ?> <? foreach (array_shift($WayVals) as $Cur) { ?>
<option value="<?=$Cur?>"<? if(isset($_GET['way']) && $_GET['way'] == $Cur || (!isset($_GET['way']) && $Cur == 'Descending')) { echo ' selected="selected"'; } ?>><?=$Cur?></option> <option value="<?=$Cur?>"<? if (isset($_GET['way']) && $_GET['way'] == $Cur || (!isset($_GET['way']) && $Cur == 'Descending')) { echo ' selected="selected"'; } ?>><?=$Cur?></option>
<? }?> <? } ?>
</select> </select>
</td> </td>
<td class="label nobr"># of Emails:</td> <td class="label nobr"># of emails:</td>
<td> <td>
<select name="emails_opt"> <select name="emails_opt">
<option value="equal"<? if($_GET['emails_opt']==='equal'){echo ' selected="selected"';}?>>Equal</option> <option value="equal"<? if ($_GET['emails_opt']==='equal') {echo ' selected="selected"';}?>>Equal</option>
<option value="above"<? if($_GET['emails_opt']==='above'){echo ' selected="selected"';}?>>Above</option> <option value="above"<? if ($_GET['emails_opt']==='above') {echo ' selected="selected"';}?>>Above</option>
<option value="below"<? if($_GET['emails_opt']==='below'){echo ' selected="selected"';}?>>Below</option> <option value="below"<? if ($_GET['emails_opt']==='below') {echo ' selected="selected"';}?>>Below</option>
</select> </select>
<input type="text" name="email_cnt" size="6" value="<?=display_str($_GET['email_cnt'])?>" /> <input type="text" name="email_cnt" size="6" value="<?=display_str($_GET['email_cnt'])?>" />
</td> </td>
@ -712,7 +724,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
</form> </form>
</div> </div>
<? <?
if($RunQuery){ if ($RunQuery) {
$Results = $DB->query($SQL); $Results = $DB->query($SQL);
$DB->query('SELECT FOUND_ROWS()'); $DB->query('SELECT FOUND_ROWS()');
list($NumResults) = $DB->next_record(); list($NumResults) = $DB->next_record();
@ -729,12 +741,12 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
?> ?>
</div> </div>
<div class="box pad center"> <div class="box pad center">
<h2><?=$NumResults?> results</h2> <h2><?=number_format($NumResults)?> results</h2>
<table width="100%"> <table width="100%">
<tr class="colhead"> <tr class="colhead">
<td>Username</td> <td>Username</td>
<td>Ratio</td> <td>Ratio</td>
<td>IP</td> <td>IP address</td>
<td>Email</td> <td>Email</td>
<td>Joined</td> <td>Joined</td>
<td>Last seen</td> <td>Last seen</td>
@ -745,7 +757,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
<td>Invites</td> <td>Invites</td>
</tr> </tr>
<? <?
while(list($UserID, $Username, $Uploaded, $Downloaded, $Snatched, $Class, $Email, $Enabled, $IP, $Invites, $DisableInvites, $Warned, $Donor, $JoinDate, $LastAccess) = $DB->next_record()){ ?> while (list($UserID, $Username, $Uploaded, $Downloaded, $Snatched, $Class, $Email, $Enabled, $IP, $Invites, $DisableInvites, $Warned, $Donor, $JoinDate, $LastAccess) = $DB->next_record()) { ?>
<tr> <tr>
<td><?=Users::format_username($UserID, true, true, true, true)?></td> <td><?=Users::format_username($UserID, true, true, true, true)?></td>
<td><?=Format::get_ratio_html($Uploaded, $Downloaded)?></td> <td><?=Format::get_ratio_html($Uploaded, $Downloaded)?></td>
@ -761,7 +773,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = ''){
?> ?>
<td><?=number_format((int)$Downloads)?></td> <td><?=number_format((int)$Downloads)?></td>
<td><?=is_numeric($Snatched) ? number_format($Snatched) : display_str($Snatched)?></td> <td><?=is_numeric($Snatched) ? number_format($Snatched) : display_str($Snatched)?></td>
<td><? if($DisableInvites) { echo 'X'; } else { echo number_format($Invites); } ?></td> <td><? if ($DisableInvites) { echo 'X'; } else { echo number_format($Invites); } ?></td>
</tr> </tr>
<? <?
} }

View File

@ -20,10 +20,10 @@
break; break;
case 'notify_delete': case 'notify_delete':
authorize(); authorize();
if($_GET['id'] && is_number($_GET['id'])){ if ($_GET['id'] && is_number($_GET['id'])) {
$DB->query("DELETE FROM users_notify_filters WHERE ID='".db_string($_GET['id'])."' AND UserID='$LoggedUser[ID]'"); $DB->query("DELETE FROM users_notify_filters WHERE ID='".db_string($_GET['id'])."' AND UserID='$LoggedUser[ID]'");
$ArtistNotifications = $Cache->get_value('notify_artists_'.$LoggedUser['ID']); $ArtistNotifications = $Cache->get_value('notify_artists_'.$LoggedUser['ID']);
if(is_array($ArtistNotifications) && $ArtistNotifications['ID'] == $_GET['id']) { if (is_array($ArtistNotifications) && $ArtistNotifications['ID'] == $_GET['id']) {
$Cache->delete_value('notify_artists_'.$LoggedUser['ID']); $Cache->delete_value('notify_artists_'.$LoggedUser['ID']);
} }
} }
@ -42,7 +42,6 @@
case 'edit': case 'edit':
include('edit.php'); include('edit.php');
break; break;
case 'takeedit': case 'takeedit':
include('takeedit.php'); include('takeedit.php');
break; break;
@ -94,32 +93,32 @@
//Provide public methods for Last.fm data gets. //Provide public methods for Last.fm data gets.
case 'lastfm_compare': case 'lastfm_compare':
if(isset($_GET['username'])) { if (isset($_GET['username'])) {
echo LastFM::compare_user_with($_GET['username']); echo LastFM::compare_user_with($_GET['username']);
} }
break; break;
case 'lastfm_last_played_track': case 'lastfm_last_played_track':
if(isset($_GET['username'])) { if (isset($_GET['username'])) {
echo LastFM::get_last_played_track($_GET['username']); echo LastFM::get_last_played_track($_GET['username']);
} }
break; break;
case 'lastfm_top_artists': case 'lastfm_top_artists':
if(isset($_GET['username'])) { if (isset($_GET['username'])) {
echo LastFM::get_top_artists($_GET['username']); echo LastFM::get_top_artists($_GET['username']);
} }
break; break;
case 'lastfm_top_albums': case 'lastfm_top_albums':
if(isset($_GET['username'])) { if (isset($_GET['username'])) {
echo LastFM::get_top_albums($_GET['username']); echo LastFM::get_top_albums($_GET['username']);
} }
break; break;
case 'lastfm_top_tracks': case 'lastfm_top_tracks':
if(isset($_GET['username'])) { if (isset($_GET['username'])) {
echo LastFM::get_top_tracks($_GET['username']); echo LastFM::get_top_tracks($_GET['username']);
} }
break; break;
case 'lastfm_clear_cache': case 'lastfm_clear_cache':
if(isset($_GET['username']) && isset($_GET['uid'])) { if (isset($_GET['username']) && isset($_GET['uid'])) {
echo LastFM::clear_cache($_GET['username'],$_GET['uid']); echo LastFM::clear_cache($_GET['username'],$_GET['uid']);
} }
break; break;

View File

@ -1,7 +1,11 @@
<? <?
//TODO: Redo html //TODO: Redo html
if (!check_perms('admin_manage_permissions')) { error(403); } if (!check_perms('admin_manage_permissions')) {
if(!isset($_REQUEST['userid']) || !is_number($_REQUEST['userid'])){ error(404); } error(403);
}
if (!isset($_REQUEST['userid']) || !is_number($_REQUEST['userid'])) {
error(404);
}
include(SERVER_ROOT."/classes/permissions_form.php"); include(SERVER_ROOT."/classes/permissions_form.php");
@ -22,13 +26,15 @@
authorize(); authorize();
foreach ($PermissionsArray as $Perm => $Explaination) { foreach ($PermissionsArray as $Perm => $Explaination) {
$Setting = (isset($_POST['perm_'.$Perm]))?1:0; $Setting = (isset($_POST['perm_'.$Perm])) ? 1 : 0;
$Default = (isset($Defaults[$Perm]))?1:0; $Default = (isset($Defaults[$Perm])) ? 1 : 0;
if ($Setting != $Default) { if ($Setting != $Default) {
$Delta[$Perm] = $Setting; $Delta[$Perm] = $Setting;
} }
} }
if (!is_number($_POST['maxcollages']) && !empty($_POST['maxcollages'])) { error("Please enter a valid number of extra personal collages"); } if (!is_number($_POST['maxcollages']) && !empty($_POST['maxcollages'])) {
error("Please enter a valid number of extra personal collages");
}
$Delta['MaxCollages'] = $_POST['maxcollages']; $Delta['MaxCollages'] = $_POST['maxcollages'];
$Cache->begin_transaction('user_info_heavy_'.$UserID); $Cache->begin_transaction('user_info_heavy_'.$UserID);
@ -44,10 +50,14 @@
function display_perm($Key,$Title) { function display_perm($Key,$Title) {
global $Defaults, $Permissions; global $Defaults, $Permissions;
$Perm='<input id="default_'.$Key.'" type="checkbox" disabled'; $Perm='<input id="default_'.$Key.'" type="checkbox" disabled="disabled"';
if (isset($Defaults[$Key]) && $Defaults[$Key]) { $Perm.=' checked'; } if (isset($Defaults[$Key]) && $Defaults[$Key]) {
$Perm.=' checked="checked"';
}
$Perm.=' /><input type="checkbox" name="perm_'.$Key.'" id="'.$Key.'" value="1"'; $Perm.=' /><input type="checkbox" name="perm_'.$Key.'" id="'.$Key.'" value="1"';
if (isset($Permissions[$Key]) && $Permissions[$Key]) { $Perm.=' checked'; } if (isset($Permissions[$Key]) && $Permissions[$Key]) {
$Perm.=' checked="checked"';
}
$Perm.=' /> <label for="'.$Key.'">'.$Title.'</label><br />'; $Perm.=' /> <label for="'.$Key.'">'.$Title.'</label><br />';
echo $Perm; echo $Perm;
} }
@ -66,7 +76,7 @@ function reset() {
//]]> //]]>
</script> </script>
<div class="header"> <div class="header">
<h2><?=Users::format_username($UserID, false, false, false)?> > Permissions</h2> <h2><?=Users::format_username($UserID, false, false, false)?> &gt; Permissions</h2>
<div class="linkbox"> <div class="linkbox">
<a href="#" onclick="reset();return false;" class="brackets">Defaults</a> <a href="#" onclick="reset();return false;" class="brackets">Defaults</a>
</div> </div>
@ -80,7 +90,7 @@ function reset() {
<table class="layout permission_head"> <table class="layout permission_head">
<tr> <tr>
<td class="label">Extra personal collages</td> <td class="label">Extra personal collages</td>
<td><input type="text" name="maxcollages" size="5" value="<?=($MaxCollages?$MaxCollages:'0')?>" /></td> <td><input type="text" name="maxcollages" size="5" value="<?=($MaxCollages ? $MaxCollages : '0') ?>" /></td>
</tr> </tr>
</table> </table>
<input type="hidden" name="action" value="permissions" /> <input type="hidden" name="action" value="permissions" />

View File

@ -72,13 +72,13 @@
</form> </form>
<br /> <br />
<div class="box pad center"> <div class="box pad center">
<table style="width:400px;margin:0px auto;"> <table style="width: 400px; margin: 0px auto;">
<tr class="colhead"> <tr class="colhead">
<td width="50%">Username</td> <td width="50%">Username</td>
<td>Class</td> <td>Primary class</td>
</tr> </tr>
<? <?
foreach($Results as $Result) { foreach ($Results as $Result) {
list($UserID, $Username, $Enabled, $PermissionID, $Donor, $Warned) = $Result; list($UserID, $Username, $Enabled, $PermissionID, $Donor, $Warned) = $Result;
?> ?>
<tr> <tr>

View File

@ -365,7 +365,7 @@
} }
if ($Warned == 1 && $Cur['Warned']=='0000-00-00 00:00:00' && check_perms('users_warn')) { if ($Warned == 1 && $Cur['Warned']=='0000-00-00 00:00:00' && check_perms('users_warn')) {
Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"); Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
$UpdateSet[]="Warned='".sqltime()."' + INTERVAL $WarnLength WEEK"; $UpdateSet[]="Warned='".sqltime()."' + INTERVAL $WarnLength WEEK";
$Msg = "warned for $WarnLength week(s)"; $Msg = "warned for $WarnLength week(s)";
if ($WarnReason) { $Msg.=" for $WarnReason"; } if ($WarnReason) { $Msg.=" for $WarnReason"; }
@ -431,7 +431,7 @@
$EditSummary[]="avatar status changed"; $EditSummary[]="avatar status changed";
$HeavyUpdates['DisableAvatar']=$DisableAvatar; $HeavyUpdates['DisableAvatar']=$DisableAvatar;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your avatar privileges have been disabled', "Your avatar privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your avatar privileges have been disabled', "Your avatar privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -441,7 +441,7 @@
$HeavyUpdates['DisableLeech']=$DisableLeech; $HeavyUpdates['DisableLeech']=$DisableLeech;
$HeavyUpdates['CanLeech']=$DisableLeech; $HeavyUpdates['CanLeech']=$DisableLeech;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your leeching privileges have been disabled', "Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your leeching privileges have been disabled', "Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => $DisableLeech)); Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => $DisableLeech));
} }
@ -451,7 +451,7 @@
if ($DisableInvites == 1) { if ($DisableInvites == 1) {
//$UpdateSet[]="Invites='0'"; //$UpdateSet[]="Invites='0'";
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your invite privileges have been disabled', "Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your invite privileges have been disabled', "Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
$EditSummary[]="invites status changed"; $EditSummary[]="invites status changed";
@ -463,7 +463,7 @@
$EditSummary[]="posting status changed"; $EditSummary[]="posting status changed";
$HeavyUpdates['DisablePosting']=$DisablePosting; $HeavyUpdates['DisablePosting']=$DisablePosting;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your forum posting privileges have been disabled', "Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your forum posting privileges have been disabled', "Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -472,7 +472,7 @@
$EditSummary[]="forums status changed"; $EditSummary[]="forums status changed";
$HeavyUpdates['DisableForums']=$DisableForums; $HeavyUpdates['DisableForums']=$DisableForums;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your forum privileges have been disabled', "Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your forum privileges have been disabled', "Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -481,7 +481,7 @@
$EditSummary[]="tagging status changed"; $EditSummary[]="tagging status changed";
$HeavyUpdates['DisableTagging']=$DisableTagging; $HeavyUpdates['DisableTagging']=$DisableTagging;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your tagging privileges have been disabled', "Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your tagging privileges have been disabled', "Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -490,7 +490,7 @@
$EditSummary[]="upload status changed"; $EditSummary[]="upload status changed";
$HeavyUpdates['DisableUpload']=$DisableUpload; $HeavyUpdates['DisableUpload']=$DisableUpload;
if ($DisableUpload == 1) { if ($DisableUpload == 1) {
Misc::send_pm($UserID, 0, 'Your upload privileges have been disabled', "Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your upload privileges have been disabled', "Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -500,7 +500,7 @@
$HeavyUpdates['DisableWiki']=$DisableWiki; $HeavyUpdates['DisableWiki']=$DisableWiki;
$HeavyUpdates['site_edit_wiki']=0; $HeavyUpdates['site_edit_wiki']=0;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your site editing privileges have been disabled', "Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your site editing privileges have been disabled', "Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -510,7 +510,7 @@
$EditSummary[]="PM status changed"; $EditSummary[]="PM status changed";
$HeavyUpdates['DisablePM']=$DisablePM; $HeavyUpdates['DisablePM']=$DisablePM;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your PM privileges have been disabled', "Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]."); Misc::send_pm($UserID, 0, 'Your PM privileges have been disabled', "Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url].");
} }
} }
@ -519,7 +519,7 @@
$EditSummary[]="IRC status changed"; $EditSummary[]="IRC status changed";
$HeavyUpdates['DisableIRC']=$DisableIRC; $HeavyUpdates['DisableIRC']=$DisableIRC;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."); Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled.");
} }
} }
@ -528,7 +528,7 @@
$EditSummary[]="request status changed"; $EditSummary[]="request status changed";
$HeavyUpdates['DisableRequests']=$DisableRequests; $HeavyUpdates['DisableRequests']=$DisableRequests;
if (!empty($UserReason)) { if (!empty($UserReason)) {
Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."); Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled.");
} }
} }
@ -599,12 +599,12 @@
if ($MergeStatsFrom && check_perms('users_edit_ratio')) { if ($MergeStatsFrom && check_perms('users_edit_ratio')) {
$DB->query("SELECT ID, Uploaded, Downloaded FROM users_main WHERE Username LIKE '".$MergeStatsFrom."'"); $DB->query("SELECT ID, Uploaded, Downloaded FROM users_main WHERE Username LIKE '".$MergeStatsFrom."'");
if($DB->record_count() > 0) { if ($DB->record_count() > 0) {
list($MergeID, $MergeUploaded, $MergeDownloaded) = $DB->next_record(); list($MergeID, $MergeUploaded, $MergeDownloaded) = $DB->next_record();
$DB->query("UPDATE users_main AS um JOIN users_info AS ui ON um.ID=ui.UserID SET um.Uploaded = 0, um.Downloaded = 0, ui.AdminComment = CONCAT('".sqltime()." - Stats merged into https://".NONSSL_SITE_URL."/user.php?id=".$UserID." (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment) WHERE ID = ".$MergeID); $DB->query("UPDATE users_main AS um JOIN users_info AS ui ON um.ID=ui.UserID SET um.Uploaded = 0, um.Downloaded = 0, ui.AdminComment = CONCAT('".sqltime()." - Stats merged into https://".SSL_SITE_URL."/user.php?id=".$UserID." (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment) WHERE ID = ".$MergeID);
$UpdateSet[]="Uploaded = Uploaded + '$MergeUploaded'"; $UpdateSet[]="Uploaded = Uploaded + '$MergeUploaded'";
$UpdateSet[]="Downloaded = Downloaded + '$MergeDownloaded'"; $UpdateSet[]="Downloaded = Downloaded + '$MergeDownloaded'";
$EditSummary[]="stats merged from https://".NONSSL_SITE_URL."/user.php?id=".$MergeID." (".$MergeStatsFrom.")"; $EditSummary[]="stats merged from https://".SSL_SITE_URL."/user.php?id=".$MergeID." (".$MergeStatsFrom.")";
$Cache->delete_value('users_stats_'.$UserID); $Cache->delete_value('users_stats_'.$UserID);
$Cache->delete_value('users_stats_'.$MergeID); $Cache->delete_value('users_stats_'.$MergeID);
} }
@ -620,7 +620,7 @@
$Cache->delete_value('enabled_'.$UserID); $Cache->delete_value('enabled_'.$UserID);
$DB->query("SELECT SessionID FROM users_sessions WHERE UserID='$UserID'"); $DB->query("SELECT SessionID FROM users_sessions WHERE UserID='$UserID'");
while(list($SessionID) = $DB->next_record()) { while (list($SessionID) = $DB->next_record()) {
$Cache->delete_value('session_'.$UserID.'_'.$SessionID); $Cache->delete_value('session_'.$UserID.'_'.$SessionID);
} }
$Cache->delete_value('users_sessions_'.$UserID); $Cache->delete_value('users_sessions_'.$UserID);

View File

@ -485,8 +485,8 @@ function check_paranoia_here($Setting) {
<? } ?> <? } ?>
<div class="box"> <div class="box">
<div class="head"> <div class="head">
<span style="float:left;">Profile&nbsp;-&nbsp;</span> <span style="float:left;">Profile<? if ($CustomTitle) {?>&nbsp;-&nbsp;</span>
<span class="user_title"><? if ($CustomTitle) { echo html_entity_decode($DisplayCustomTitle); } ?></span> <span class="user_title"><? echo html_entity_decode($DisplayCustomTitle); } ?></span>
<span style="float:right;"><?=!empty($Badges)?"$Badges&nbsp;&nbsp;":''?><a href="#" onclick="$('#profilediv').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets">Hide</a></span>&nbsp; <span style="float:right;"><?=!empty($Badges)?"$Badges&nbsp;&nbsp;":''?><a href="#" onclick="$('#profilediv').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets">Hide</a></span>&nbsp;
</div> </div>
<div class="pad" id="profilediv"> <div class="pad" id="profilediv">

View File

@ -470,3 +470,11 @@ tr.torrent .bookmark>a:after {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
} }
body {
-webkit-transform: rotate(0.15deg);
-o-transform: rotate(0.15deg);
transform: rotate(0.15deg);
font-smooth: always;
-webkit-font-smoothing: subpixel-antialiased;
}