Empty commit

This commit is contained in:
Git 2013-05-15 08:00:54 +00:00
parent bdb2e4fe12
commit 53a6628206
49 changed files with 786 additions and 615 deletions

View File

@ -186,7 +186,7 @@ function music_form($GenreTags) {
$LossywebApproved = $Torrent['LossywebApproved'];
global $ReleaseTypes;
?>
<table cellpadding="3" cellspacing="1" border="0" class="layout border<? if ($this->NewTorrent) { echo ' slice'; }?>" width="100%">
<table cellpadding="3" cellspacing="1" border="0" class="layout border<? if ($this->NewTorrent) { echo ' slice'; } ?>" width="100%">
<? if ($this->NewTorrent) { ?>
<tr id="artist_tr">
<td class="label">Artist(s):</td>
@ -383,7 +383,7 @@ function show() {
</tr>
<tr id="edition_catalogue_number">
<td class="label">Catalogue number:</td>
<td><input type="text" id="remaster_catalogue_number" name="remaster_catalogue_number" size="50" value="<?=display_str($Torrent['RemasterCatalogueNumber']) ?>"<? if ($UnknownRelease) { echo ' disabled="disabled"';}?> />
<td><input type="text" id="remaster_catalogue_number" name="remaster_catalogue_number" size="50" value="<?=display_str($Torrent['RemasterCatalogueNumber']) ?>"<? if ($UnknownRelease) { echo ' disabled="disabled"';} ?> />
<p class="min_padding">This is for the catalogue number of the <strong>release</strong>.</p>
</td>
</tr>
@ -395,7 +395,7 @@ function show() {
<tr>
<td class="label">Scene:</td>
<td>
<input type="checkbox" id="scene" name="scene" <? if ($Torrent['Scene']) { echo 'checked="checked" ';}?>/>
<input type="checkbox" id="scene" name="scene" <? if ($Torrent['Scene']) { echo 'checked="checked" ';} ?>/>
<label for="scene">Check this only if this is a 'scene release'.<br />If you ripped it yourself, it is <strong>not</strong> a scene release. If you are not sure, <strong class="important_text">do not</strong> check it; you will be penalized. For information on the scene, visit <a href="http://en.wikipedia.org/wiki/Scene_%28software%29" target="_blank">Wikipedia</a>.</label>
</td>
</tr>
@ -524,7 +524,7 @@ function show() {
<?
}
?>
<input type="checkbox" id="make_trumpable" name="make_trumpable"<? if ($Torrent['LogScore'] == 99) { echo ' checked="checked"';}?> /> <label for="make_trumpable">Check this box if you want this torrent to be trumpable (subtracts 1 point).</label>
<input type="checkbox" id="make_trumpable" name="make_trumpable"<? if ($Torrent['LogScore'] == 99) { echo ' checked="checked"';} ?> /> <label for="make_trumpable">Check this box if you want this torrent to be trumpable (subtracts 1 point).</label>
<?
if (!check_perms('users_mod')) {
?> </td>
@ -720,7 +720,7 @@ function audiobook_form() {
<p class="min_padding">Contains information like the track listing, a review, a link to Discogs or MusicBrainz, etc.</p>
</td>
</tr>
<? }?>
<? } ?>
<tr>
<td class="label">Release description (optional):</td>
<td>

View File

@ -27,7 +27,7 @@
$PerPage = POSTS_PER_PAGE;
}
list($Page,$Limit) = Format::page_limit(TOPICS_PER_PAGE);
list($Page, $Limit) = Format::page_limit(TOPICS_PER_PAGE);
//---------- Get some data to start processing
@ -37,16 +37,17 @@
list($Forum,,,$Stickies) = $Cache->get_value('forums_'.$ForumID);
}
if (!isset($Forum) || !is_array($Forum)) {
$DB->query("SELECT
t.ID,
t.Title,
t.AuthorID,
t.IsLocked,
t.IsSticky,
t.NumPosts,
t.LastPostID,
t.LastPostTime,
t.LastPostAuthorID
$DB->query("
SELECT
t.ID,
t.Title,
t.AuthorID,
t.IsLocked,
t.IsSticky,
t.NumPosts,
t.LastPostID,
t.LastPostTime,
t.LastPostAuthorID
FROM forums_topics AS t
WHERE t.ForumID = '$ForumID'
ORDER BY t.IsSticky DESC, t.LastPostTime DESC
@ -65,11 +66,11 @@
// Make sure they're allowed to look at the page
if (!check_perms('site_moderate_forums')) {
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] === 0) {
json_die("failure", "unsufficient permissions to view page");
json_die("failure", "insufficient permissions to view page");
}
}
if ($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class']) {
json_die("failure", "unsufficient permissions to view page");
json_die("failure", "insufficient permissions to view page");
}
$ForumName = display_str($Forums[$ForumID]['Name']);
@ -82,7 +83,7 @@
);
}
$Pages=Format::get_pages($Page,$Forums[$ForumID]['NumTopics'],TOPICS_PER_PAGE,9);
$Pages = Format::get_pages($Page, $Forums[$ForumID]['NumTopics'], TOPICS_PER_PAGE, 9);
if (count($Forum) == 0) {
print
@ -138,7 +139,7 @@
'lastAuthorName' => $LastAuthorName == null ? '' : $LastAuthorName,
'lastReadPage' => $LastRead[$TopicID]['Page'] == null ? 0 : (int) $LastRead[$TopicID]['Page'],
'lastReadPostId' => $LastRead[$TopicID]['PostID'] == null ? 0 : (int) $LastRead[$TopicID]['PostID'],
'read' => $Read == "read"
'read' => $Read == 'read'
);
}

View File

@ -79,7 +79,7 @@
$CurURL = "inbox.php?".$CurURL."&";
}
$Pages = Format::get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
$Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
$JsonMessages = array();
while (list($ConvID, $Subject, $Unread, $Sticky, $ForwardedID, $ForwardedName, $SenderID, $Username, $Donor, $Warned, $Enabled, $Date) = $DB->next_record()) {

View File

@ -203,6 +203,7 @@
'title' => $Title,
'year' => (int) $Year,
'image' => $Image,
'bbDescription' => $Description,
'description' => $Text->full_format($Description),
'musicInfo' => $JsonMusicInfo,
'catalogueNumber' => $CatalogueNumber,

View File

@ -39,6 +39,7 @@ function error_out($reason = '') {
if ($LoggedUser['CustomForums']) {
unset($LoggedUser['CustomForums']['']);
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
}
$ViewingOwn = ($UserID == $LoggedUser['ID']);
$ShowUnread = ($ViewingOwn && (!isset($_GET['showunread']) || !!$_GET['showunread']));
@ -56,7 +57,7 @@ function error_out($reason = '') {
$sql .= '
LEFT JOIN forums AS f ON f.ID = t.ForumID
WHERE p.AuthorID = '.$UserID.'
AND ((f.MinClassRead <= '.$LoggedUser['EffectiveClass'];
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
if (!empty($RestrictedForums)) {
$sql.='
AND f.ID NOT IN (\''.$RestrictedForums.'\')';
@ -137,12 +138,19 @@ function error_out($reason = '') {
JOIN forums AS f ON f.ID = t.ForumID
LEFT JOIN forums_last_read_topics AS l ON l.UserID = '.$UserID.' AND l.TopicID = t.ID
WHERE p.AuthorID = '.$UserID.'
AND f.MinClassRead <= '.$LoggedUser['EffectiveClass'];
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
if (!empty($RestrictedForums)) {
$sql.='
AND f.ID NOT IN (\''.$RestrictedForums.'\')';
}
$sql .= ')';
if (!empty($PermittedForums)) {
$sql.='
OR f.ID IN (\''.$PermittedForums.'\')';
}
$sql .= ')';
if ($ShowUnread) {
$sql.='

View File

@ -452,7 +452,7 @@ function compare($X, $Y) {
</td>
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
<td><?=number_format($Torrent['Snatched'])?></td>
<td<?=($Torrent['Seeders']==0)?' class="r00"':''?>><?=number_format($Torrent['Seeders'])?></td>
<td<?=(($Torrent['Seeders'] == 0) ? ' class="r00"' : '')?>><?=number_format($Torrent['Seeders'])?></td>
<td><?=number_format($Torrent['Leechers'])?></td>
</tr>
<?
@ -461,7 +461,7 @@ function compare($X, $Y) {
if (!empty($TorrentList)) { ?>
</table>
</div>
<?}
<? }
$TorrentDisplayList = ob_get_clean();
@ -596,7 +596,7 @@ function compare($X, $Y) {
<? $OpenGroup = true;
}
?>
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if (in_array($GroupID.$OptionID,$ZIPList)) { echo ' disabled="disabled"'; }?>><?=$OptName?></option>
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if (in_array($GroupID.$OptionID, $ZIPList)) { echo ' disabled="disabled"'; } ?>><?=$OptName?></option>
<?
}
?>
@ -608,7 +608,7 @@ function compare($X, $Y) {
<option value="1"<? if ($ZIPPrefs == 1) { echo ' selected="selected"'; } ?>>Prefer Best Seeded</option>
<option value="2"<? if ($ZIPPrefs == 2) { echo ' selected="selected"'; } ?>>Prefer Bonus Tracks</option>
</select>
<input type="submit" style="width:210px" value="Download" />
<input type="submit" style="width: 210px;" value="Download" />
</form>
</div>
</div>
@ -673,7 +673,7 @@ function compare($X, $Y) {
$First = false;
}
$FontSize = (ceil((((($Score - 2)/$Max - 2) * 4)))) + 8;
$FontSize = (ceil((((($Score - 2) / $Max - 2) * 4)))) + 8;
?>
<li>
@ -947,7 +947,7 @@ function require(file, callback) {
<div id="artistcomments" class="linkbox">
<a name="comments"></a>
<?
$Pages = Format::get_pages($Page,$Results,TORRENT_COMMENTS_PER_PAGE,9,'#comments');
$Pages = Format::get_pages($Page, $Results, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
echo $Pages;
?>
</div>
@ -967,7 +967,7 @@ function require(file, callback) {
</colgroup>
<tr class="colhead_dark">
<td colspan="<?=(Users::has_avatars_enabled() ? 2 : 1)?>">
<div style="float:left;"><a class="post_id" href='artist.php?id=<?=$ArtistID?>&amp;postid=<?=$PostID?>#post<?=$PostID?>'>#<?=$PostID?></a>
<div style="float: left;"><a class="post_id" href='artist.php?id=<?=$ArtistID?>&amp;postid=<?=$PostID?>#post<?=$PostID?>'>#<?=$PostID?></a>
<strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');" class="brackets">Quote</a>
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
@ -977,7 +977,7 @@ function require(file, callback) {
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');" class="brackets">Delete</a>
<? } ?>
</div>
<div id="bar<?=$PostID?>" style="float:right;">
<div id="bar<?=$PostID?>" style="float: right;">
<a href="reports.php?action=report&amp;type=artist_comment&amp;id=<?=$PostID?>" class="brackets">Report</a>
<? if (check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
$AuthorInfo = Users::user_info($AuthorID);

View File

@ -314,19 +314,19 @@ function compare($X, $Y) {
$Page1 = array_slice($Collage, 0, $CollageCovers);
foreach ($Page1 as $Group) {
echo $Group;
}?>
} ?>
</ul>
</div>
<? if ($NumGroups > $CollageCovers) { ?>
<div class="linkbox pager" style="clear: left;" id="pageslinksdiv">
<span id="firstpage" class="invisible"><a href="#" class="pageslink" onclick="collageShow.page(0, this); return false;">&lt;&lt; First</a> | </span>
<span id="prevpage" class="invisible"><a href="#" id="prevpage" class="pageslink" onclick="collageShow.prevPage(); return false;">&lt; Prev</a> | </span>
<? for ($i=0; $i < $NumGroups/$CollageCovers; $i++) { ?>
<span id="pagelink<?=$i?>" class="<?=(($i>4)?'hidden':'')?><?=(($i==0)?' selected':'')?>"><a href="#" class="pageslink" onclick="collageShow.page(<?=$i?>, this); return false;"><?=$CollageCovers*$i+1?>-<?=min($NumGroups,$CollageCovers*($i+1))?></a><?=($i != ceil($NumGroups/$CollageCovers)-1)?' | ':''?></span>
<? for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) { ?>
<span id="pagelink<?=$i?>" class="<?=(($i > 4) ? 'hidden' : '')?><?=(($i == 0) ? ' selected' : '')?>"><a href="#" class="pageslink" onclick="collageShow.page(<?=$i?>, this); return false;"><?=($CollageCovers * $i + 1)?>-<?=min($NumGroups, $CollageCovers * ($i + 1))?></a><?=(($i != ceil($NumGroups / $CollageCovers) - 1) ? ' | ' : '')?></span>
<? } ?>
<span id="nextbar" class="<?=($NumGroups/$CollageCovers > 5)?'hidden':''?>"> | </span>
<span id="nextbar" class="<?=(($NumGroups / $CollageCovers > 5) ? 'hidden' : '')?>"> | </span>
<span id="nextpage"><a href="#" class="pageslink" onclick="collageShow.nextPage(); return false;">Next &gt;</a></span>
<span id="lastpage" class="<?=ceil($NumGroups/$CollageCovers)==2?'invisible':''?>"> | <a href="#" id="lastpage" class="pageslink" onclick="collageShow.page(<?=ceil($NumGroups/$CollageCovers)-1?>, this); return false;">Last &gt;&gt;</a></span>
<span id="lastpage" class="<?=(ceil($NumGroups / $CollageCovers) == 2 ? 'invisible' : '')?>"> | <a href="#" id="lastpage" class="pageslink" onclick="collageShow.page(<?=(ceil($NumGroups / $CollageCovers) - 1)?>, this); return false;">Last &gt;&gt;</a></span>
</div>
<script type="text/javascript">
collageShow.init(<?=json_encode($CollagePages)?>);

View File

@ -70,15 +70,16 @@
$BookmarkJoin = '';
}
$BaseSQL = $SQL = "SELECT SQL_CALC_FOUND_ROWS
c.ID,
c.Name,
c.NumTorrents,
c.TagList,
c.CategoryID,
c.UserID
$BaseSQL = $SQL = "
SELECT SQL_CALC_FOUND_ROWS
c.ID,
c.Name,
c.NumTorrents,
c.TagList,
c.CategoryID,
c.UserID
FROM collages AS c
$BookmarkJoin
$BookmarkJoin
WHERE Deleted = '0'";
if ($BookmarkView) {
@ -187,7 +188,7 @@
<td class="label">Categories:</td>
<td>
<? foreach ($CollageCats as $ID=>$Cat) { ?>
<input type="checkbox" value="1" name="cats[<?=$ID?>]" id="cats_<?=$ID?>"<? if (in_array($ID, $Categories)) { echo ' checked="checked"'; }?> />
<input type="checkbox" value="1" name="cats[<?=$ID?>]" id="cats_<?=$ID?>"<? if (in_array($ID, $Categories)) { echo ' checked="checked"'; } ?> />
<label for="cats_<?=$ID?>"><?=$Cat?></label>&nbsp;&nbsp;
<? } ?>
</td>
@ -195,8 +196,8 @@
<tr id="search_name_description">
<td class="label">Search in:</td>
<td>
<input type="radio" name="type" value="c.name" <? if ($Type == 'c.name') { echo 'checked="checked" '; }?>/> Names&nbsp;&nbsp;
<input type="radio" name="type" value="description" <? if ($Type == 'description') { echo 'checked="checked" '; }?>/> Descriptions
<input type="radio" name="type" value="c.name" <? if ($Type == 'c.name') { echo 'checked="checked" '; } ?>/> Names&nbsp;&nbsp;
<input type="radio" name="type" value="description" <? if ($Type == 'description') { echo 'checked="checked" '; } ?>/> Descriptions
</td>
</tr>
<tr id="order_by">
@ -263,7 +264,7 @@
<? } ?>
<br /><br />
<?
$Pages = Format::get_pages($Page,$NumResults,COLLAGES_PER_PAGE,9);
$Pages = Format::get_pages($Page, $NumResults, COLLAGES_PER_PAGE, 9);
echo $Pages;
?>
</div>

View File

@ -415,7 +415,7 @@ function compare($X, $Y) {
<? $OpenGroup = true;
}
?>
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if (in_array($GroupID.$OptionID,$ZIPList)) { echo ' disabled="disabled"'; }?>><?=$OptName?></option>
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if (in_array($GroupID.$OptionID, $ZIPList)) { echo ' disabled="disabled"'; } ?>><?=$OptName?></option>
<?
}
?>
@ -585,16 +585,16 @@ function compare($X, $Y) {
$Page1 = array_slice($Collage, 0, $CollageCovers);
foreach ($Page1 as $Group) {
echo $Group;
}?>
} ?>
</ul>
</div>
<? if ($NumGroups > $CollageCovers) { ?>
<? if ($NumGroups > $CollageCovers) { ?>
<div class="linkbox pager" style="clear: left;" id="pageslinksdiv">
<span id="firstpage" class="invisible"><a href="#" class="pageslink" onclick="collageShow.page(0, this); return false;"><strong>&lt;&lt; First</strong></a> | </span>
<span id="prevpage" class="invisible"><a href="#" class="pageslink" onclick="collageShow.prevPage(); return false;"><strong>&lt; Prev</strong></a> | </span>
<? for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) { ?>
<? for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) { ?>
<span id="pagelink<?=$i?>" class="<?=(($i > 4) ? 'hidden' : '')?><?=(($i == 0) ? 'selected' : '')?>"><a href="#" class="pageslink" onclick="collageShow.page(<?=$i?>, this); return false;"><strong><?=$CollageCovers * $i + 1?>-<?=min($NumGroups,$CollageCovers * ($i + 1))?></strong></a><?=(($i != ceil($NumGroups / $CollageCovers) - 1) ? ' | ' : '')?></span>
<? } ?>
<? } ?>
<span id="nextbar" class="<?=($NumGroups / $CollageCovers > 5) ? 'hidden' : ''?>"> | </span>
<span id="nextpage"><a href="#" class="pageslink" onclick="collageShow.nextPage(); return false;"><strong>Next &gt;</strong></a></span>
<span id="lastpage" class="<?=(ceil($NumGroups / $CollageCovers) == 2 ? 'invisible' : '')?>"> | <a href="#" class="pageslink" onclick="collageShow.page(<?=ceil($NumGroups / $CollageCovers) - 1?>, this); return false;"><strong>Last &gt;&gt;</strong></a></span>
@ -602,7 +602,7 @@ function compare($X, $Y) {
<script type="text/javascript">//<![CDATA[
collageShow.init(<?=json_encode($CollagePages)?>);
//]]></script>
<? }
<? }
} ?>
<table class="torrent_table grouping cats" id="discog_table">
<tr class="colhead_dark">

View File

@ -26,7 +26,7 @@
$DB->query("SELECT FOUND_ROWS()");
list($Results) = $DB->next_record();
$Pages=Format::get_pages($Page,$Results,$PerPage, 11);
$Pages = Format::get_pages($Page, $Results, $PerPage, 11);
$DB->set_query_id($Comments);
$GroupIDs = $DB->collect('GroupID');

View File

@ -29,28 +29,29 @@
$Header = 'Request comments made by ' . ($Self ? 'you' : Users::format_username($UserID, false, false, false));
}
$Comments = $DB->query("SELECT
SQL_CALC_FOUND_ROWS
rc.AuthorID,
r.ID as RequestID,
r.Title,
rc.ID as PostID,
rc.Body,
rc.AddedTime,
rc.EditedTime,
rc.EditedUserID as EditorID
FROM requests as r
JOIN requests_comments as rc ON rc.RequestID = r.ID
$ExtraJoin
$Conditions
GROUP BY rc.ID
ORDER BY rc.AddedTime DESC
LIMIT $Limit;");
$Comments = $DB->query("
SELECT
SQL_CALC_FOUND_ROWS
rc.AuthorID,
r.ID as RequestID,
r.Title,
rc.ID as PostID,
rc.Body,
rc.AddedTime,
rc.EditedTime,
rc.EditedUserID as EditorID
FROM requests as r
JOIN requests_comments as rc ON rc.RequestID = r.ID
$ExtraJoin
$Conditions
GROUP BY rc.ID
ORDER BY rc.AddedTime DESC
LIMIT $Limit;");
$Count = $DB->record_count();
$DB->query("SELECT FOUND_ROWS()");
list($Results) = $DB->next_record();
$Pages=Format::get_pages($Page,$Results,$PerPage, 11);
$Pages = Format::get_pages($Page, $Results, $PerPage, 11);
View::show_header($Title,'bbcode');
$DB->set_query_id($Comments);
@ -97,4 +98,4 @@
</div>
</div>
<?
View::show_footer();
View::show_footer();

View File

@ -30,7 +30,8 @@
}
}
$Comments = $DB->query("SELECT
$Comments = $DB->query("
SELECT
SQL_CALC_FOUND_ROWS
tc.AuthorID,
t.ID,
@ -52,7 +53,7 @@
$DB->query("SELECT FOUND_ROWS()");
list($Results) = $DB->next_record();
$Pages=Format::get_pages($Page,$Results,$PerPage, 11);
$Pages = Format::get_pages($Page, $Results, $PerPage, 11);
$DB->set_query_id($Comments);
$GroupIDs = $DB->collect('GroupID');

View File

@ -154,7 +154,7 @@
<? } ?>
<div class="linkbox pager">
<?
$Pages = Format::get_pages($Page,$Forums[$ForumID]['NumTopics'],TOPICS_PER_PAGE,9);
$Pages = Format::get_pages($Page, $Forums[$ForumID]['NumTopics'], TOPICS_PER_PAGE, 9);
echo $Pages;
?>
</div>

View File

@ -104,9 +104,9 @@
<tr>
<td><strong>Search in:</strong></td>
<td>
<input type="radio" name="type" id="type_title" value="title" <? if ($Type == 'title') { echo 'checked="checked" '; }?>/>
<input type="radio" name="type" id="type_title" value="title" <? if ($Type == 'title') { echo 'checked="checked" '; } ?>/>
<label for="type_title">Titles</label>
<input type="radio" name="type" id="type_body" value="body" <? if ($Type == 'body') { echo 'checked="checked" '; }?>/>
<input type="radio" name="type" id="type_body" value="body" <? if ($Type == 'body') { echo 'checked="checked" '; } ?>/>
<label for="type_body">Post bodies</label>
</td>
</tr>

View File

@ -205,7 +205,7 @@
</div>
</div>
<?
$Pages = Format::get_pages($Page,$ThreadInfo['Posts'],$PerPage,9);
$Pages = Format::get_pages($Page, $ThreadInfo['Posts'], $PerPage, 9);
echo $Pages;
?>
</div>
@ -236,7 +236,7 @@
$Votes[$i] = 0;
}
}
$Cache->cache_value('polls_'.$ThreadID, array($Question,$Answers,$Votes,$Featured,$Closed), 0);
$Cache->cache_value('polls_'.$ThreadID, array($Question, $Answers, $Votes, $Featured, $Closed), 0);
}
if (!empty($Votes)) {
@ -290,7 +290,7 @@
<? }
if ($Votes[0] > 0) {
?>
<li>(Blank) (<?=number_format((float)($Votes[0] / $TotalVotes * 100),2)?>%)</li>
<li>(Blank) (<?=number_format((float)($Votes[0] / $TotalVotes * 100), 2)?>%)</li>
<li class="graph">
<span class="left_poll"></span>
<span class="center_poll" style="width: <?=round(($Votes[0] / $MaxVotes) * 750)?>px;"></span>

View File

@ -94,7 +94,7 @@
<td class="col_avatar avatar" valign="top">
<?=Users::show_avatar($Avatar, $Username, $HeavyInfo['DisableAvatars'])?>
</td>
<? }?>
<? } ?>
<td valign="top">
<input type="hidden" name="friendid" value="<?=$FriendID?>" />

View File

@ -83,7 +83,7 @@
$CurURL = "inbox.php?".$CurURL."&amp;";
}
$Pages=Format::get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
$Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
echo $Pages;
?>
</div>
@ -167,7 +167,7 @@
<? } ?>
</tr>
<? }
}?>
} ?>
</table>
<input type="submit" name="read" value="Mark as read" />&nbsp;
<input type="submit" name="unread" value="Mark as unread" />&nbsp;

View File

@ -17,7 +17,7 @@
<tr>
<td class="label"><strong>Search for:</strong></td>
<td>
<input type="text" name="search" size="60"<?=!empty($_GET['search']) ? ' value="'.display_str($_GET['search']).'"' : '' ?> />
<input type="text" name="search" size="60"<?=(!empty($_GET['search']) ? ' value="'.display_str($_GET['search']).'"' : '')?> />
&nbsp;
<input type="submit" value="Search log" />
</td>
@ -29,7 +29,7 @@
<? if ($TotalMatches > LOG_ENTRIES_PER_PAGE) { ?>
<div class="linkbox">
<?
$Pages = Format::get_pages($Page,$TotalMatches,LOG_ENTRIES_PER_PAGE,9);
$Pages = Format::get_pages($Page, $TotalMatches, LOG_ENTRIES_PER_PAGE, 9);
echo $Pages;?>
</div>
<? } ?>
@ -98,15 +98,15 @@
$UserID = 0;
$User = '';
$URL = '';
if ($MessageParts[$i + 1] == "user") {
if ($MessageParts[$i + 1] == 'user') {
$i++;
if (is_numeric($MessageParts[$i + 1])) {
$UserID = $MessageParts[++$i];
}
$URL = "user $UserID ".'(<a href="user.php?id='.$UserID.'">'.substr($MessageParts[++$i],1,-1)."</a>)";
} elseif (in_array($MessageParts[$i - 1], array('deleted','uploaded','edited','created','recovered'))) {
$URL = "user $UserID ".'(<a href="user.php?id='.$UserID.'">'.substr($MessageParts[++$i], 1, -1)."</a>)";
} elseif (in_array($MessageParts[$i - 1], array('deleted', 'uploaded', 'edited', 'created', 'recovered'))) {
$User = $MessageParts[++$i];
if (substr($User,-1) == ':') {
if (substr($User, -1) == ':') {
$User = substr($User, 0, -1);
$Colon = true;
}
@ -120,37 +120,37 @@
$DB->set_query_id($Log);
$URL = $Usernames[$User] ? '<a href="user.php?id='.$UserID.'">'.$User."</a>".($Colon ? ':' : '') : $User;
}
$Message = $Message." by ".$URL;
$Message = "$Message by $URL";
break;
case "uploaded":
if ($Color === false) {
$Color = 'green';
}
$Message = $Message." ".$MessageParts[$i];
$Message = $Message.' '.$MessageParts[$i];
break;
case "deleted":
if ($Color === false || $Color === 'green') {
$Color = 'red';
}
$Message = $Message." ".$MessageParts[$i];
$Message = $Message.' '.$MessageParts[$i];
break;
case "edited":
if ($Color === false) {
$Color = 'blue';
}
$Message = $Message." ".$MessageParts[$i];
$Message = $Message.' '.$MessageParts[$i];
break;
case "un-filled":
if ($Color === false) {
$Color = '';
}
$Message = $Message." ".$MessageParts[$i];
$Message = $Message.' '.$MessageParts[$i];
break;
case "marked":
if ($i == 1) {
$User = $MessageParts[$i - 1];
if (!isset($Usernames[$User])) {
$DB->query("SELECT ID FROM users_main WHERE Username = _utf8 '".$User."' COLLATE utf8_bin");
$DB->query("SELECT ID FROM users_main WHERE Username = _utf8 '$User' COLLATE utf8_bin");
list($UserID) = $DB->next_record();
$Usernames[$User] = $UserID ? $UserID : '';
$DB->set_query_id($Log);
@ -173,10 +173,10 @@
}
break;
default:
$Message = $Message." ".$MessageParts[$i];
$Message = $Message.' '.$MessageParts[$i];
}
}
$Row = ($Row == 'a') ? 'b' : 'a';
$Row = (($Row == 'a') ? 'b' : 'a');
?>
<tr class="row<?=$Row?>" id="log_<?=$ID?>">
<td class="nobr">

View File

@ -81,12 +81,12 @@
$Enabled = '0';
}
$ipcc = Tools::geoip($_SERVER['REMOTE_ADDR']);
$IPcc = Tools::geoip($_SERVER['REMOTE_ADDR']);
$DB->query("INSERT INTO users_main
(Username,Email,PassHash,torrent_pass,IP,PermissionID,Enabled,Invites,Uploaded,ipcc) VALUES
('".db_string(trim($_POST['username']))."','".db_string($_POST['email'])."','".db_string(Users::make_crypt_hash($_POST['password']))."','".db_string($torrent_pass)."','".db_string($_SERVER['REMOTE_ADDR'])."','".$Class."','".$Enabled."','".STARTING_INVITES."', '524288000', '$ipcc')");
('".db_string(trim($_POST['username']))."','".db_string($_POST['email'])."','".db_string(Users::make_crypt_hash($_POST['password']))."','".db_string($torrent_pass)."','".db_string($_SERVER['REMOTE_ADDR'])."','".$Class."','".$Enabled."','".STARTING_INVITES."', '524288000', '$IPcc')");
$UserID = $DB->inserted_id();
@ -122,9 +122,10 @@
// Manage invite trees, delete invite
if ($InviterID !== NULL) {
$DB->query("SELECT
TreePosition, TreeID, TreeLevel
FROM invite_tree WHERE UserID='$InviterID'");
$DB->query("
SELECT TreePosition, TreeID, TreeLevel
FROM invite_tree
WHERE UserID='$InviterID'");
list($InviterTreePosition, $TreeID, $TreeLevel) = $DB->next_record();
// If the inviter doesn't have an invite tree
@ -133,28 +134,33 @@
$DB->query("SELECT MAX(TreeID)+1 FROM invite_tree");
list($TreeID) = $DB->next_record();
$DB->query("INSERT INTO invite_tree
(UserID, InviterID, TreePosition, TreeID, TreeLevel)
$DB->query("
INSERT INTO invite_tree
(UserID, InviterID, TreePosition, TreeID, TreeLevel)
VALUES ('$InviterID', '0', '1', '$TreeID', '1')");
$TreePosition = 2;
$TreeLevel = 2;
} else {
$DB->query("SELECT
TreePosition
$DB->query("
SELECT TreePosition
FROM invite_tree
WHERE TreePosition>'$InviterTreePosition'
AND TreeLevel<='$TreeLevel'
AND TreeID='$TreeID'
AND TreeLevel<='$TreeLevel'
AND TreeID='$TreeID'
ORDER BY TreePosition
LIMIT 1");
list($TreePosition) = $DB->next_record();
if ($TreePosition) {
$DB->query("UPDATE invite_tree SET TreePosition=TreePosition+1 WHERE TreeID='$TreeID' AND TreePosition>='$TreePosition'");
$DB->query("
UPDATE invite_tree
SET TreePosition=TreePosition+1
WHERE TreeID='$TreeID'
AND TreePosition>='$TreePosition'");
} else {
$DB->query("SELECT
TreePosition+1
$DB->query("
SELECT TreePosition+1
FROM invite_tree
WHERE TreeID='$TreeID'
ORDER BY TreePosition DESC
@ -164,22 +170,22 @@
$TreeLevel++;
// Create invite tree record
$DB->query("INSERT INTO invite_tree
(UserID, InviterID, TreePosition, TreeID, TreeLevel) VALUES
('$UserID', '$InviterID', '$TreePosition', '$TreeID', '$TreeLevel')");
$DB->query("
INSERT INTO invite_tree (UserID, InviterID, TreePosition, TreeID, TreeLevel)
VALUES ('$UserID', '$InviterID', '$TreePosition', '$TreeID', '$TreeLevel')");
}
} else { // No inviter (open registration)
$DB->query("SELECT MAX(TreeID) FROM invite_tree");
list($TreeID) = $DB->next_record();
$TreeID++;
$InviterID = 0;
$TreePosition=1;
$TreeLevel=1;
$TreePosition = 1;
$TreeLevel = 1;
}
include(SERVER_ROOT.'/classes/class_templates.php');
$TPL=NEW TEMPLATE;
$TPL = NEW TEMPLATE;
$TPL->open(SERVER_ROOT.'/templates/new_registration.tpl');
$TPL->set('Username',$_REQUEST['username']);
@ -189,7 +195,7 @@
Misc::send_email($_REQUEST['email'],'New account confirmation at '.SITE_NAME,$TPL->get(),'noreply');
Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $torrent_pass));
$Sent=1;
$Sent = 1;
}

View File

@ -11,7 +11,7 @@
list($Type) = $DB->next_record();
if (!check_perms('admin_reports')) {
if (check_perms('site_moderate_forums')) {
if (!in_array($Type, array('collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) {
if (!in_array($Type, array('artist_comment', 'collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) {
ajax_error();
}
} elseif (check_perms('project_team')) {
@ -21,11 +21,12 @@
}
}
$DB->query("UPDATE reports
SET Status='Resolved',
ResolvedTime='".sqltime()."',
ResolverID='".$LoggedUser['ID']."'
WHERE ID='".db_string($ReportID)."'");
$DB->query("
UPDATE reports
SET Status='Resolved',
ResolvedTime='".sqltime()."',
ResolverID='".$LoggedUser['ID']."'
WHERE ID='".db_string($ReportID)."'");
$Channels = array();
@ -35,7 +36,7 @@
$Cache->decrement('num_update_reports');
}
if (in_array($Type, array('collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) {
if (in_array($Type, array('artist_comment', 'collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) {
$Channels[] = '#forumreports';
$Cache->decrement('num_forum_reports');
}
@ -45,7 +46,7 @@
list($Remaining) = $DB->next_record();
foreach ($Channels as $Channel) {
send_irc("PRIVMSG $Channel :Report $ReportID resolved by ".preg_replace("/^(.{2})/", "$", $LoggedUser['Username'])." on site (".(int)$Remaining." remaining).");
send_irc("PRIVMSG $Channel :Report $ReportID resolved by ".preg_replace("/^(.{2})/", "$", $LoggedUser['Username']).' on site ('.(int)$Remaining.' remaining).');
}
$Cache->delete_value('num_other_reports');

View File

@ -13,85 +13,136 @@
$Short = $_POST['type'];
$Type = $Types[$Short];
$ID = $_POST['id'];
if ($Short == "request_update") {
if ($Short == 'request_update') {
if (empty($_POST['year']) || !is_number($_POST['year'])) {
error('Year must be specified.');
header('Location: reports.php?action=report&type=request_update&id='.$ID);
die();
}
$Reason = "[b]Year[/b]: ".$_POST['year'].".\n\n";
$Reason = '[b]Year[/b]: '.$_POST['year'].".\n\n";
// If the release type is somehow invalid, return "Not given"; otherwise, return the release type.
$Reason .= "[b]Release Type[/b]: ".((empty($_POST['releasetype']) || !is_number($_POST['releasetype']) || $_POST['releasetype'] == 0) ? 'Not given' : $ReleaseTypes[$_POST['releasetype']]).". \n\n";
$Reason .= "[b]Additional Comments[/b]: ".$_POST['comment'];
$Reason .= '[b]Release type[/b]: '.((empty($_POST['releasetype']) || !is_number($_POST['releasetype']) || $_POST['releasetype'] == 0) ? 'Not given' : $ReleaseTypes[$_POST['releasetype']]).". \n\n";
$Reason .= '[b]Additional comments[/b]: '.$_POST['comment'];
} else {
$Reason = $_POST['reason'];
}
switch ($Short) {
case "request" :
case "request_update" :
case 'request' :
case 'request_update' :
$Link = 'requests.php?action=view&id='.$ID;
break;
case "user" :
case 'user' :
$Link = 'user.php?id='.$ID;
break;
case "collage" :
case 'collage' :
$Link = 'collages.php?id='.$ID;
break;
case "thread" :
case 'thread' :
$Link = 'forums.php?action=viewthread&threadid='.$ID;
break;
case "post" :
$DB->query("SELECT p.ID, p.TopicID, (SELECT COUNT(ID) FROM forums_posts WHERE forums_posts.TopicID = p.TopicID AND forums_posts.ID<=p.ID) AS PostNum FROM forums_posts AS p WHERE ID=".$ID);
case 'post' :
$DB->query("
SELECT
p.ID,
p.TopicID,
( SELECT COUNT(ID)
FROM forums_posts
WHERE forums_posts.TopicID = p.TopicID
AND forums_posts.ID<=p.ID
) AS PostNum
FROM forums_posts AS p
WHERE ID=".$ID);
list($PostID,$TopicID,$PostNum) = $DB->next_record();
$Link = "forums.php?action=viewthread&threadid=".$TopicID."&post=".$PostNum."#post".$PostID;
$Link = 'forums.php?action=viewthread&threadid='.$TopicID.'&post='.$PostNum.'#post'.$PostID;
break;
case "requests_comment" :
$DB->query("SELECT rc.RequestID, rc.Body, (SELECT COUNT(ID) FROM requests_comments WHERE ID <= ".$ID." AND requests_comments.RequestID = rc.RequestID) AS CommentNum FROM requests_comments AS rc WHERE ID=".$ID);
case 'requests_comment' :
$DB->query("
SELECT
rc.RequestID,
rc.Body,
( SELECT COUNT(ID)
FROM requests_comments
WHERE ID <= $ID
AND requests_comments.RequestID = rc.RequestID
) AS CommentNum
FROM requests_comments AS rc
WHERE ID=".$ID);
list($RequestID, $Body, $PostNum) = $DB->next_record();
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
$Link = "requests.php?action=view&id=".$RequestID."&page=".$PageNum."#post".$ID."";
$Link = 'requests.php?action=view&id='.$RequestID.'&page='.$PageNum.'#post'.$ID;
break;
case "torrents_comment" :
$DB->query("SELECT tc.GroupID, tc.Body, (SELECT COUNT(ID) FROM torrents_comments WHERE ID <= ".$ID." AND torrents_comments.GroupID = tc.GroupID) AS CommentNum FROM torrents_comments AS tc WHERE ID=".$ID);
case 'torrents_comment' :
$DB->query("
SELECT
tc.GroupID,
tc.Body,
( SELECT COUNT(ID)
FROM torrents_comments
WHERE ID <= $ID
AND torrents_comments.GroupID = tc.GroupID
) AS CommentNum
FROM torrents_comments AS tc
WHERE ID=".$ID);
list($GroupID, $Body, $PostNum) = $DB->next_record();
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
$Link = "torrents.php?id=".$GroupID."&page=".$PageNum."#post".$ID;
$Link = 'torrents.php?id='.$GroupID.'&page='.$PageNum.'#post'.$ID;
break;
case "artist_comment" :
$DB->query("SELECT ac.ArtistID, ac.Body, (SELECT COUNT(ID) FROM artist_comments WHERE ID <= ".$ID." AND artist_comments.ArtistID = ac.ArtistID) AS CommentNum FROM artist_comments AS ac WHERE ID=".$ID);
case 'artist_comment' :
$DB->query("
SELECT
ac.ArtistID,
ac.Body,
( SELECT COUNT(ID)
FROM artist_comments
WHERE ID <= $ID
AND artist_comments.ArtistID = ac.ArtistID
) AS CommentNum
FROM artist_comments AS ac
WHERE ID=".$ID);
list($ArtistID, $Body, $PostNum) = $DB->next_record();
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
$Link = "artist.php?id=".$ArtistID."&page=".$PageNum."#post".$ID;
$Link = 'artist.php?id='.$ArtistID.'&page='.$PageNum.'#post'.$ID;
break;
case "collages_comment" :
$DB->query("SELECT cc.CollageID, cc.Body, (SELECT COUNT(ID) FROM collages_comments WHERE ID <= ".$ID." AND collages_comments.CollageID = cc.CollageID) AS CommentNum FROM collages_comments AS cc WHERE ID=".$ID);
case 'collages_comment' :
$DB->query("
SELECT
cc.CollageID,
cc.Body,
( SELECT COUNT(ID)
FROM collages_comments
WHERE ID <= $ID
AND collages_comments.CollageID = cc.CollageID
) AS CommentNum
FROM collages_comments AS cc
WHERE ID=".$ID);
list($CollageID, $Body, $PostNum) = $DB->next_record();
$PerPage = POSTS_PER_PAGE;
$PageNum = ceil($PostNum / $PerPage);
$Link = "collage.php?action=comments&collageid=".$CollageID."&page=".$PageNum."#post".$ID;
$Link = 'collage.php?action=comments&collageid='.$CollageID.'&page='.$PageNum.'#post'.$ID;
break;
}
$DB->query("INSERT INTO reports
(UserID, ThingID, Type, ReportedTime, Reason)
VALUES
(".db_string($LoggedUser['ID']).", ".$ID." , '".$Short."', '".sqltime()."', '".db_string($Reason)."')");
$DB->query('
INSERT INTO reports
(UserID, ThingID, Type, ReportedTime, Reason)
VALUES
('.db_string($LoggedUser['ID']).", $ID , '$Short', '".sqltime()."', '".db_string($Reason)."')");
$ReportID = $DB->inserted_id();
$Channels = array();
if ($Short == "request_update") {
$Channels[] = "#requestedits";
if ($Short == 'request_update') {
$Channels[] = '#requestedits';
$Cache->increment('num_update_reports');
}
if (in_array($Short, array('collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment'))) {
$Channels[] = "#forumreports";
$Channels[] = '#forumreports';
}
foreach ($Channels as $Channel) {
send_irc("PRIVMSG ".$Channel." :".$ReportID." - ".$LoggedUser['Username']." just reported a ".$Short.": https://".SSL_SITE_URL."/".$Link." : ".strtr($Reason, "\n", " "));
send_irc("PRIVMSG $Channel :$ReportID - ".$LoggedUser['Username']." just reported a $Short: https://".SSL_SITE_URL."/$Link : ".strtr($Reason, "\n", ' '));
}
$Cache->delete_value('num_other_reports');

View File

@ -410,7 +410,7 @@
</form>
</td>
</tr>
<? }?>
<? } ?>
<tr id="bounty">
<td class="label">Bounty</td>
<td id="formatted_bounty"><?=Format::get_size($RequestVotes['TotalBounty'])?></td>
@ -473,7 +473,7 @@
}
//Get the cache catalogue
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
//---------- Get some data to start processing
@ -481,11 +481,11 @@
$Catalogue = Requests::get_comment_catalogue($RequestID, $CatalogueID);
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
$Thread = array_slice($Catalogue,((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)%THREAD_CATALOGUE),TORRENT_COMMENTS_PER_PAGE,true);
$Thread = array_slice($Catalogue, ((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) % THREAD_CATALOGUE), TORRENT_COMMENTS_PER_PAGE, true);
?>
<div class="linkbox"><a name="comments"></a>
<?
$Pages=Format::get_pages($Page,$Results,TORRENT_COMMENTS_PER_PAGE,9,'#comments');
$Pages = Format::get_pages($Page, $Results, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
echo $Pages;
?>
</div>
@ -515,7 +515,7 @@
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');" class="brackets">Delete</a>
<? } ?>
</div>
<div id="bar<?=$PostID?>" style="float:right;">
<div id="bar<?=$PostID?>" style="float: right;">
<a href="reports.php?action=report&amp;type=requests_comment&amp;id=<?=$PostID?>" class="brackets">Report</a>
<? if (check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
$AuthorInfo = Users::user_info($AuthorID);

View File

@ -327,7 +327,7 @@ foreach ($Categories as $CatKey => $CatName) {
<?=(((!$Submitted) || !empty($ReleaseArray) && in_array($Key, $ReleaseArray)) ? ' checked="checked" ' : '')?>
/> <?=$Val?>
<? $i++;
}?>
} ?>
</td>
</tr>
<tr id="format_list">
@ -339,7 +339,7 @@ foreach ($Categories as $CatKey => $CatName) {
<input type="checkbox" name="formats[]" value="<?=$Key?>"
<?=(((!$Submitted) || !empty($FormatArray) && in_array($Key, $FormatArray)) ? ' checked="checked" ' : '')?>
/> <?=$Val?>
<? }?>
<? } ?>
</td>
</tr>
<tr id="bitrate_list">
@ -351,7 +351,7 @@ foreach ($Categories as $CatKey => $CatName) {
<input type="checkbox" name="bitrates[]" value="<?=$Key?>"
<?=(((!$Submitted) || !empty($BitrateArray) && in_array($Key, $BitrateArray)) ? ' checked="checked" ' : '')?>
/> <?=$Val?>
<? }?>
<? } ?>
</td>
</tr>
<tr id="media_list">
@ -363,7 +363,7 @@ foreach ($Categories as $CatKey => $CatName) {
<input type="checkbox" name="media[]" value="<?=$Key?>"
<?=(((!$Submitted) || !empty($MediaArray) && in_array($Key, $MediaArray)) ? ' checked="checked" ' : '')?>
/> <?=$Val?>
<? }?>
<? } ?>
</td>
</tr>
<tr>

View File

@ -72,7 +72,7 @@
} else {
$CurURL = 'staffpm.php?'.$CurURL.'&';
}
$Pages=Format::get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
$Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
$Row = 'a';

View File

@ -87,7 +87,7 @@
?>
<div class="linkbox">
<?
$Pages = Format::get_pages($Page,$Results,USERS_PER_PAGE,11) ;
$Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11) ;
echo $Pages;
?>
</div>

View File

@ -123,7 +123,7 @@
<tr><td colspan="2"><strong>CAS/Update (Success)</strong></td></tr>
<tr>
<td<? if ($MemStats['cas_hits'] > 0 && $MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses']) < 0.7) { echo ' class="invalid" title="More than 30% of the issued CAS commands were unnecessarily wasting time and resources." '; } elseif ($MemStats['cas_hits'] == 0) { echo ' class="notice" title="Disable CAS with the -C parameter and save resources since it is not used." '; } ?>>Cache:</td>
<td><?=number_format($MemStats['cas_hits'])?> <span style="float: right;">(<? if ($MemStats['cas_hits'] > 0) { echo number_format(($MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses'])) * 100, 3); } else { echo '0.000'; }?>%)</span></td>
<td><?=number_format($MemStats['cas_hits'])?> <span style="float: right;">(<? if ($MemStats['cas_hits'] > 0) { echo number_format(($MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses'])) * 100, 3); } else { echo '0.000'; } ?>%)</span></td>
</tr>
<tr>
<td>Database:</td>

View File

@ -6,28 +6,34 @@
define('USERS_PER_PAGE', 50);
list($Page,$Limit) = Format::page_limit(USERS_PER_PAGE);
$RS = $DB->query("SELECT
SQL_CALC_FOUND_ROWS
m.ID,
m.Username,
m.Uploaded,
m.Downloaded,
m.PermissionID,
m.Enabled,
i.Donor,
i.Warned,
i.JoinDate,
i.RatioWatchEnds,
i.RatioWatchDownload,
m.RequiredRatio
$RS = $DB->query("
SELECT
SQL_CALC_FOUND_ROWS
m.ID,
m.Username,
m.Uploaded,
m.Downloaded,
m.PermissionID,
m.Enabled,
i.Donor,
i.Warned,
i.JoinDate,
i.RatioWatchEnds,
i.RatioWatchDownload,
m.RequiredRatio
FROM users_main AS m
LEFT JOIN users_info AS i ON i.UserID=m.ID
LEFT JOIN users_info AS i ON i.UserID=m.ID
WHERE i.RatioWatchEnds != '0000-00-00 00:00:00'
AND m.Enabled = '1'
ORDER BY i.RatioWatchEnds ASC LIMIT $Limit");
AND m.Enabled = '1'
ORDER BY i.RatioWatchEnds ASC
LIMIT $Limit");
$DB->query("SELECT FOUND_ROWS()");
list($Results) = $DB->next_record();
$DB->query("SELECT COUNT(UserID) FROM users_info WHERE BanDate != '0000-00-00 00:00:00' AND BanReason = '2'");
$DB->query("
SELECT COUNT(UserID)
FROM users_info
WHERE BanDate != '0000-00-00 00:00:00'
AND BanReason = '2'");
list($TotalDisabled) = $DB->next_record();
$DB->set_query_id($RS);
@ -38,7 +44,7 @@
</div>
<div class="linkbox">
<?
$Pages=Format::get_pages($Page,$Results,USERS_PER_PAGE,11) ;
$Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
echo $Pages;
?>
</div>
@ -56,7 +62,7 @@
<td>Lifespan</td>
</tr>
<?
while (list($UserID, $Username, $Uploaded, $Downloaded, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $RatioWatchEnds, $RatioWatchDownload, $RequiredRatio)=$DB->next_record()) {
while (list($UserID, $Username, $Uploaded, $Downloaded, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $RatioWatchEnds, $RatioWatchDownload, $RequiredRatio) = $DB->next_record()) {
$Row = ($Row == 'b') ? 'a' : 'b';
?>
@ -66,7 +72,7 @@
<td><?=Format::get_size($Downloaded)?></td>
<td><?=Format::get_ratio_html($Uploaded, $Downloaded)?></td>
<td><?=number_format($RequiredRatio, 2)?></td>
<td><? if (($Downloaded * $RequiredRatio) > $Uploaded) { echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);}?></td>
<td><? if (($Downloaded * $RequiredRatio) > $Uploaded) { echo Format::get_size(($Downloaded * $RequiredRatio) - $Uploaded);} ?></td>
<td><?=Format::get_size($Downloaded - $RatioWatchDownload)?></td>
<td><?=time_diff($Joined,2)?></td>
<td><?=time_diff($RatioWatchEnds)?></td>

View File

@ -112,7 +112,7 @@
<? } ?>
<div class="linkbox">
<?
$Pages = Format::get_pages($Page,$Results,DAYS_PER_PAGE,11) ;
$Pages = Format::get_pages($Page, $Results, DAYS_PER_PAGE, 11) ;
echo $Pages;
?>
</div>

View File

@ -6,15 +6,17 @@
list ($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE);
View::show_header('Manage email blacklist');
$DB->query("SELECT
SQL_CALC_FOUND_ROWS
eb.ID,
eb.UserID,
eb.Time,
eb.Email,
eb.Comment
$DB->query("
SELECT
SQL_CALC_FOUND_ROWS
eb.ID,
eb.UserID,
eb.Time,
eb.Email,
eb.Comment
FROM email_blacklist AS eb
ORDER BY eb.Time DESC LIMIT $Limit");
ORDER BY eb.Time DESC
LIMIT $Limit");
$Results = $DB->to_array(false, MYSQLI_ASSOC, false);
$DB->query("SELECT FOUND_ROWS()");
list ($NumResults) = $DB->next_record();
@ -48,7 +50,7 @@
<td><input type="submit" value="Create" /></td>
</form>
</tr>
<?
<?
foreach ($Results as $Result) {
?>
@ -68,7 +70,7 @@
</td>
</form>
</tr>
<? }?>
<? } ?>
</table>
<div class="linkbox pager">
<br />

View File

@ -44,7 +44,7 @@
?>
<div class="linkbox">
<?
$Pages=Format::get_pages($Page,$Results,USERS_PER_PAGE, 11) ;
$Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
echo $Pages;
?>
</div>

View File

@ -646,7 +646,7 @@ function header_link($SortKey,$DefaultWay = 'DESC') {
}
// List of pages
$Pages = Format::get_pages($Page,$TorrentCount,TORRENTS_PER_PAGE);
$Pages = Format::get_pages($Page, $TorrentCount, TORRENTS_PER_PAGE);
// Gets tacked onto torrent download URLs
$DownloadString = '&amp;authkey='.$LoggedUser['AuthKey'].'&amp;torrent_pass='.$LoggedUser['torrent_pass'];

View File

@ -283,7 +283,7 @@ function compare($X, $Y) {
<?
if (check_perms('torrents_add_artist')) { ?>
<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">
<form class="add_form" name="artists" action="torrents.php" method="post">
<div id="AddArtists">
@ -320,8 +320,8 @@ function compare($X, $Y) {
foreach ($Tags as $TagKey=>$Tag) {
?>
<li>
<a href="torrents.php?taglist=<?=$Tag['name']?>" style="float:left; display:block;"><?=display_str($Tag['name'])?></a>
<div style="float:right; display:block; letter-spacing: -1px;" class="edit_tags_votes">
<a href="torrents.php?taglist=<?=$Tag['name']?>" style="float: left; display: block;"><?=display_str($Tag['name'])?></a>
<div style="float: right; display: block; letter-spacing: -1px;" class="edit_tags_votes">
<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']?>
<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>
@ -611,7 +611,7 @@ function filelist($Str) {
$i = 0;
?>
<div class="box">
<div class="head"><span style="font-weight: bold;">Requests (<?=number_format(count($Requests))?>)</span> <a href="#" style="float:right;" onclick="$('#requests').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets">Show</a></div>
<div class="head"><span style="font-weight: bold;">Requests (<?=number_format(count($Requests))?>)</span> <a href="#" style="float: right;" onclick="$('#requests').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets">Show</a></div>
<table id="requests" class="request_table hidden">
<tr class="colhead">
<td>Format / Bitrate / Media</td>
@ -621,20 +621,20 @@ function filelist($Str) {
<? foreach ($Requests as $Request) {
$RequestVotes = Requests::get_votes_array($Request['ID']);
if ($Request['BitrateList'] != "") {
$BitrateString = implode(", ", explode("|", $Request['BitrateList']));
$FormatString = implode(", ", explode("|", $Request['FormatList']));
$MediaString = implode(", ", explode("|", $Request['MediaList']));
if ($Request['BitrateList'] != '') {
$BitrateString = implode(', ', explode('|', $Request['BitrateList']));
$FormatString = implode(', ', explode('|', $Request['FormatList']));
$MediaString = implode(', ', explode('|', $Request['MediaList']));
if ($Request['LogCue']) {
$FormatString .= ' - '.$Request['LogCue'];
}
} else {
$BitrateString = "Unknown";
$FormatString = "Unknown";
$MediaString = "Unknown";
$BitrateString = 'Unknown';
$FormatString = 'Unknown';
$MediaString = 'Unknown';
}
?>
<tr class="requestrows <?=(++$i%2?'rowa':'rowb')?>">
<tr class="requestrows <?=(++$i % 2 ? 'rowa' : 'rowb')?>">
<td><a href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$FormatString?> / <?=$BitrateString?> / <?=$MediaString?></a></td>
<td>
<span id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span>
@ -651,25 +651,31 @@ function filelist($Str) {
}
$Collages = $Cache->get_value('torrent_collages_'.$GroupID);
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();
$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) > MAX_COLLAGES) {
// Pick some at random
$Range = range(0,count($Collages) - 1);
$Range = range(0, count($Collages) - 1);
shuffle($Range);
$Indices = array_slice($Range, 0, MAX_COLLAGES);
$SeeAll = ' <a href="#" onclick="$(\'.collage_rows\').toggle(); return false;">(See all)</a>';
} else {
$Indices = range(0, count($Collages)-1);
$Indices = range(0, count($Collages) - 1);
$SeeAll = '';
}
?>
<table class="collage_table" id="collages">
<tr class="colhead">
<td width="85%"><a href="#">&uarr;</a>&nbsp;This album is in <?=number_format(count($Collages))?> collage<?=((count($Collages)>1) ? 's' : '')?><?=$SeeAll?></td>
<td width="85%"><a href="#">&uarr;</a>&nbsp;This album is in <?=number_format(count($Collages))?> collage<?=((count($Collages) > 1) ? 's' : '')?><?=$SeeAll?></td>
<td># torrents</td>
</tr>
<? foreach ($Indices as $i) {
@ -695,9 +701,15 @@ function filelist($Str) {
$PersonalCollages = $Cache->get_value('torrent_collages_personal_'.$GroupID);
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);
$Cache->cache_value('torrent_collages_personal_'.$GroupID, $PersonalCollages, 3600*6);
$Cache->cache_value('torrent_collages_personal_'.$GroupID, $PersonalCollages, 3600 * 6);
}
if (count($PersonalCollages) > 0) {
@ -708,13 +720,13 @@ function filelist($Str) {
$Indices = array_slice($Range, 0, MAX_PERS_COLLAGES);
$SeeAll = ' <a href="#" onclick="$(\'.personal_rows\').toggle(); return false;">(See all)</a>';
} else {
$Indices = range(0, count($PersonalCollages)-1);
$Indices = range(0, count($PersonalCollages) - 1);
$SeeAll = '';
}
?>
<table class="collage_table" id="personal_collages">
<tr class="colhead">
<td width="85%"><a href="#">&uarr;</a>&nbsp;This album is in <?=number_format(count($PersonalCollages))?> personal collage<?=((count($PersonalCollages)>1) ? 's' : '')?><?=$SeeAll?></td>
<td width="85%"><a href="#">&uarr;</a>&nbsp;This album is in <?=number_format(count($PersonalCollages))?> personal collage<?=((count($PersonalCollages) > 1) ? 's' : '')?><?=$SeeAll?></td>
<td># torrents</td>
</tr>
<? foreach ($Indices as $i) {
@ -742,7 +754,7 @@ function filelist($Str) {
?>
<div class="box">
<div class="head"><a href="#">&uarr;</a>&nbsp;<strong><?=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info' )?></strong></div>
<div class="body"><? if ($WikiBody!="") { echo $WikiBody; } else { echo "There is no information on this torrent."; } ?></div>
<div class="body"><? if ($WikiBody != '') { echo $WikiBody; } else { echo 'There is no information on this torrent.'; } ?></div>
</div>
<?
// --- Comments ---
@ -750,16 +762,20 @@ function filelist($Str) {
// gets the amount of comments for this group
$Results = $Cache->get_value('torrent_comments_'.$GroupID);
if ($Results === false) {
$DB->query("SELECT
COUNT(c.ID)
FROM torrents_comments as c
WHERE c.GroupID = '$GroupID'");
$DB->query("
SELECT COUNT(c.ID)
FROM torrents_comments as c
WHERE c.GroupID = '$GroupID'");
list($Results) = $DB->next_record();
$Cache->cache_value('torrent_comments_'.$GroupID, $Results, 0);
}
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($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum);
} else {
@ -767,15 +783,16 @@ function filelist($Str) {
}
//Get the cache catalogue
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
$CatalogueLimit=$CatalogueID*THREAD_CATALOGUE . ', ' . THREAD_CATALOGUE;
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
$CatalogueLimit = $CatalogueID * THREAD_CATALOGUE . ', ' . THREAD_CATALOGUE;
//---------- Get some data to start processing
// 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);
if ($Catalogue === false) {
$DB->query("SELECT
$DB->query("
SELECT
c.ID,
c.AuthorID,
c.AddedTime,
@ -783,21 +800,21 @@ function filelist($Str) {
c.EditedUserID,
c.EditedTime,
u.Username
FROM torrents_comments as c
FROM torrents_comments as c
LEFT JOIN users_main AS u ON u.ID=c.EditedUserID
WHERE c.GroupID = '$GroupID'
ORDER BY c.ID
LIMIT $CatalogueLimit");
WHERE c.GroupID = '$GroupID'
ORDER BY c.ID
LIMIT $CatalogueLimit");
$Catalogue = $DB->to_array(false,MYSQLI_ASSOC);
$Cache->cache_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID, $Catalogue, 0);
}
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
$Thread = array_slice($Catalogue,((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)%THREAD_CATALOGUE),TORRENT_COMMENTS_PER_PAGE,true);
$Thread = array_slice($Catalogue, ((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) % THREAD_CATALOGUE), TORRENT_COMMENTS_PER_PAGE, true);
?>
<div class="linkbox"><a name="comments"></a>
<?
$Pages=Format::get_pages($Page,$Results,TORRENT_COMMENTS_PER_PAGE,9,'#comments');
$Pages = Format::get_pages($Page, $Results, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
echo $Pages;
?>
</div>
@ -816,7 +833,7 @@ function filelist($Str) {
</colgroup>
<tr class="colhead_dark">
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1?>">
<div style="float:left;"><a class="post_id" href="torrents.php?id=<?=$GroupID?>&amp;postid=<?=$PostID?>#post<?=$PostID?>">#<?=$PostID?></a>
<div style="float: left;"><a class="post_id" href="torrents.php?id=<?=$GroupID?>&amp;postid=<?=$PostID?>#post<?=$PostID?>">#<?=$PostID?></a>
<strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');" class="brackets">Quote</a>
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
@ -826,7 +843,7 @@ function filelist($Str) {
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');" class="brackets">Delete</a>
<? } ?>
</div>
<div id="bar<?=$PostID?>" style="float:right;">
<div id="bar<?=$PostID?>" style="float: right;">
<a href="reports.php?action=report&amp;type=torrents_comment&amp;id=<?=$PostID?>" class="brackets">Report</a>
<? if (check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
$AuthorInfo = Users::user_info($AuthorID);

View File

@ -254,15 +254,15 @@ function header_link($SortKey,$DefaultWay="DESC") {
$DB->query("
INSERT IGNORE INTO temp_sections_torrents_user
SELECT
t.GroupID,
t.ID AS TorrentID,
$Time AS Time,
tg.CategoryID,
t.Seeders,
t.Leechers,
t.Snatched,
CONCAT_WS(' ', GROUP_CONCAT(aa.Name SEPARATOR ' '), ' ', tg.Name, ' ', tg.Year, ' ') AS Name,
t.Size
t.GroupID,
t.ID AS TorrentID,
$Time AS Time,
tg.CategoryID,
t.Seeders,
t.Leechers,
t.Snatched,
CONCAT_WS(' ', GROUP_CONCAT(aa.Name SEPARATOR ' '), ' ', tg.Name, ' ', tg.Year, ' ') AS Name,
t.Size
FROM $From
JOIN torrents_group AS tg ON tg.ID=t.GroupID
LEFT JOIN torrents_artists AS ta ON ta.GroupID=tg.ID
@ -274,15 +274,17 @@ function header_link($SortKey,$DefaultWay="DESC") {
$Words = array_unique(explode(' ', db_string($_GET['search'])));
}
$SQL = "SELECT SQL_CALC_FOUND_ROWS
GroupID, TorrentID, Time, CategoryID
$SQL = "
SELECT SQL_CALC_FOUND_ROWS
GroupID, TorrentID, Time, CategoryID
FROM temp_sections_torrents_user";
if (!empty($Words)) {
$SQL .= "
WHERE Name LIKE '%".implode("%' AND Name LIKE '%", $Words)."%'";
}
$SQL .= "
ORDER BY $Order $Way LIMIT $Limit";
ORDER BY $Order $Way
LIMIT $Limit";
}
$DB->query($SQL);
@ -299,7 +301,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
View::show_header($User['Username'].'\'s '.$Action.' torrents','voting');
$Pages=Format::get_pages($Page,$TorrentCount,TORRENTS_PER_PAGE);
$Pages = Format::get_pages($Page, $TorrentCount, TORRENTS_PER_PAGE);
?>

View File

@ -907,7 +907,6 @@
} else {
$SQL.=" AND (FromYear=0 AND ToYear=0) ";
}
$SQL.=" AND UserID != '".$LoggedUser['ID']."' ";
$DB->query($SQL);

View File

@ -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 width="24%">
<select name="joined">
<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="after"<? if ($_GET['joined']==='after') {echo ' selected="selected"';}?>>After</option>
<option value="between"<? if ($_GET['joined']==='between') {echo ' selected="selected"';}?>>Between</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="after"<? if ($_GET['joined']==='after') {echo ' selected="selected"';} ?>>After</option>
<option value="between"<? if ($_GET['joined']==='between') {echo ' selected="selected"';} ?>>Between</option>
</select>
<input type="text" name="join1" size="6" value="<?=display_str($_GET['join1'])?>" />
<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>
<select name="enabled">
<option value=""<? if ($_GET['enabled']==='') {echo ' selected="selected"';}?>>Any</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="2"<? if ($_GET['enabled']==='2') {echo ' selected="selected"';}?>>Disabled</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="1"<? if ($_GET['enabled']==='1') {echo ' selected="selected"';} ?>>Enabled</option>
<option value="2"<? if ($_GET['enabled']==='2') {echo ' selected="selected"';} ?>>Disabled</option>
</select>
</td>
</tr>
@ -471,10 +471,10 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr"><span title="Date format is YYYY-MM-DD">Last active:</span></td>
<td width="30%">
<select name="lastactive">
<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="after"<? if ($_GET['lastactive']==='after') {echo ' selected="selected"';}?>>After</option>
<option value="between"<? if ($_GET['lastactive']==='between') {echo ' selected="selected"';}?>>Between</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="after"<? if ($_GET['lastactive']==='after') {echo ' selected="selected"';} ?>>After</option>
<option value="between"<? if ($_GET['lastactive']==='between') {echo ' selected="selected"';} ?>>Between</option>
</select>
<input type="text" name="lastactive1" size="6" value="<?=display_str($_GET['lastactive1'])?>" />
<input type="text" name="lastactive2" size="6" value="<?=display_str($_GET['lastactive2'])?>" />
@ -482,13 +482,13 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr">Primary class:</td>
<td>
<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) {
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>
</td>
@ -503,7 +503,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr">Secondary class:</td>
<td>
<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();
// Neither level nor ID is particularly useful when searching secondary classes, so let's do some
// kung-fu to sort them alphabetically.
@ -517,7 +517,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
usort($Secondaries, $fnc);
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>
</td>
@ -525,19 +525,19 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<tr>
<td class="label nobr">Extra:</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>
<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>
</td>
<td class="label nobr">Ratio:</td>
<td width="30%">
<select name="ratio">
<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="below"<? if ($_GET['ratio']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if ($_GET['ratio']==='between') {echo ' selected="selected"';}?>>Between</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="below"<? if ($_GET['ratio']==='below') {echo ' selected="selected"';} ?>>Below</option>
<option value="between"<? if ($_GET['ratio']==='between') {echo ' selected="selected"';} ?>>Between</option>
</select>
<input type="text" name="ratio1" size="6" value="<?=display_str($_GET['ratio1'])?>" />
<input type="text" name="ratio2" size="6" value="<?=display_str($_GET['ratio2'])?>" />
@ -545,9 +545,9 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr">Donor:</td>
<td>
<select name="donor">
<option value=""<? if ($_GET['donor']==='') {echo ' selected="selected"';}?>>Any</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=""<? if ($_GET['donor']==='') {echo ' selected="selected"';} ?>>Any</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>
</select>
</td>
</tr>
@ -565,11 +565,11 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr"><span title="Units are in gibibytes (the base 2 sibling of gigabytes)">Uploaded:</span></td>
<td width="30%">
<select name="uploaded">
<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="below"<? if ($_GET['uploaded']==='below') {echo ' selected="selected"';}?>>Below</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="equal"<? if ($_GET['uploaded']==='equal') {echo ' selected="selected"';} ?>>Equal</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="between"<? if ($_GET['uploaded']==='between') {echo ' selected="selected"';} ?>>Between</option>
<option value="buffer"<? if ($_GET['uploaded']==='buffer') {echo ' selected="selected"';} ?>>Buffer</option>
</select>
<input type="text" name="uploaded1" size="6" value="<?=display_str($_GET['uploaded1'])?>" />
<input type="text" name="uploaded2" size="6" value="<?=display_str($_GET['uploaded2'])?>" />
@ -577,9 +577,9 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr">Warned:</td>
<td>
<select name="warned">
<option value=""<? if ($_GET['warned']==='') {echo ' selected="selected"';}?>>Any</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=""<? if ($_GET['warned']==='') {echo ' selected="selected"';} ?>>Any</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>
</select>
</td>
</tr>
@ -588,10 +588,10 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr"># of invites:</td>
<td>
<select name="invites">
<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="below"<? if ($_GET['invites']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if ($_GET['invites']==='between') {echo ' selected="selected"';}?>>Between</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="below"<? if ($_GET['invites']==='below') {echo ' selected="selected"';} ?>>Below</option>
<option value="between"<? if ($_GET['invites']==='between') {echo ' selected="selected"';} ?>>Between</option>
</select>
<input type="text" name="invites1" size="6" value="<?=display_str($_GET['invites1'])?>" />
<input type="text" name="invites2" size="6" value="<?=display_str($_GET['invites2'])?>" />
@ -599,10 +599,10 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr"><span title="Units are in gibibytes (the base 2 sibling of gigabytes)">Downloaded:</span></td>
<td width="30%">
<select name="downloaded">
<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="below"<? if ($_GET['downloaded']==='below') {echo ' selected="selected"';}?>>Below</option>
<option value="between"<? if ($_GET['downloaded']==='between') {echo ' selected="selected"';}?>>Between</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="below"<? if ($_GET['downloaded']==='below') {echo ' selected="selected"';} ?>>Below</option>
<option value="between"<? if ($_GET['downloaded']==='between') {echo ' selected="selected"';} ?>>Between</option>
</select>
<input type="text" name="downloaded1" size="6" value="<?=display_str($_GET['downloaded1'])?>" />
<input type="text" name="downloaded2" size="6" value="<?=display_str($_GET['downloaded2'])?>" />
@ -611,7 +611,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<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>
<input type="checkbox" name="disabled_ip" id="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>
</tr>
@ -619,19 +619,19 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr">Disabled invites:</td>
<td>
<select name="disabled_invites">
<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="no"<? if ($_GET['disabled_invites']==='no') {echo ' selected="selected"';}?>>No</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="no"<? if ($_GET['disabled_invites']==='no') {echo ' selected="selected"';} ?>>No</option>
</select>
</td>
<td class="label nobr">Snatched:</td>
<td width="30%">
<select name="snatched">
<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="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="off"<? if (isset($_GET['snatched']) && $_GET['snatched']==='off') {echo ' selected="selected"';}?>>Off</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="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="off"<? if (isset($_GET['snatched']) && $_GET['snatched']==='off') {echo ' selected="selected"';} ?>>Off</option>
</select>
<input type="text" name="snatched1" size="6" value="<?=display_str($_GET['snatched1'])?>" />
<input type="text" name="snatched2" size="6" value="<?=display_str($_GET['snatched2'])?>" />
@ -639,9 +639,9 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr">Disabled uploads:</td>
<td>
<select name="disabled_uploads">
<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="no"<? if (isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='no') {echo ' selected="selected"';}?>>No</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="no"<? if (isset($_GET['disabled_uploads']) && $_GET['disabled_uploads']==='no') {echo ' selected="selected"';} ?>>No</option>
</select>
</td>
</tr>
@ -677,8 +677,8 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr"><span title="Two-letter codes as defined in ISO 3166-1 alpha-2">Country code:</span></td>
<td width="30%">
<select name="cc_op">
<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="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>
</select>
<input type="text" name="cc" size="2" value="<?=display_str($_GET['cc'])?>" />
</td>
@ -708,9 +708,9 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
<td class="label nobr"># of emails:</td>
<td>
<select name="emails_opt">
<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="below"<? if ($_GET['emails_opt']==='below') {echo ' selected="selected"';}?>>Below</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="below"<? if ($_GET['emails_opt']==='below') {echo ' selected="selected"';} ?>>Below</option>
</select>
<input type="text" name="email_cnt" size="6" value="<?=display_str($_GET['email_cnt'])?>" />
</td>
@ -736,7 +736,7 @@ function num_compare($Field, $Operand, $Num1, $Num2 = '') {
?>
<div class="linkbox">
<?
$Pages=Format::get_pages($Page,$NumResults,USERS_PER_PAGE,11);
$Pages = Format::get_pages($Page, $NumResults, USERS_PER_PAGE, 11);
echo $Pages;
?>
</div>

View File

@ -143,16 +143,18 @@ function user_dupes_table($UserID) {
if (!is_number($UserID)) {
error(403);
}
$DB->query("SELECT d.ID, d.Comments, SHA1(d.Comments) AS CommentHash
FROM dupe_groups AS d
JOIN users_dupes AS u ON u.GroupID = d.ID
WHERE u.UserID = $UserID");
$DB->query("
SELECT d.ID, d.Comments, SHA1(d.Comments) AS CommentHash
FROM dupe_groups AS d
JOIN users_dupes AS u ON u.GroupID = d.ID
WHERE u.UserID = $UserID");
if (list($GroupID, $Comments, $CommentHash) = $DB->next_record()) {
$DB->query("SELECT m.ID
FROM users_main AS m
JOIN users_dupes AS d ON m.ID = d.UserID
WHERE d.GroupID = $GroupID
ORDER BY m.ID ASC");
$DB->query("
SELECT m.ID
FROM users_main AS m
JOIN users_dupes AS d ON m.ID = d.UserID
WHERE d.GroupID = $GroupID
ORDER BY m.ID ASC");
$DupeCount = $DB->record_count();
$Dupes = $DB->to_array();
} else {
@ -168,10 +170,10 @@ function user_dupes_table($UserID) {
<input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?=$CommentHash?>" />
<div class="box" id="l_a_box">
<div class="head">
<a href="#l_a_box"><strong>&uarr;</strong></a> <?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a>
<a href="#l_a_box"><strong>&uarr;</strong></a> <?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2) ? '' : 's')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a>
</div>
<table width="100%" class="layout hidden linkedaccounts">
<?=$DupeCount?'<tr>':''?>
<?=$DupeCount ? '<tr>' : ''?>
<?
$i = 0;
foreach ($Dupes as $Dupe) {
@ -180,30 +182,31 @@ function user_dupes_table($UserID) {
$DupeInfo = Users::user_info($DupeID);
?>
<td align="left"><?=Users::format_username($DupeID, true, true, true, true)?>
<a href="user.php?action=dupes&amp;dupeaction=remove&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;userid=<?=$UserID?>&amp;removeid=<?=$DupeID?>" onclick="return confirm('Are you sure you wish to remove <?=$DupeInfo['Username']?> from this group?');" class="brackets">x</a></td>
<a href="user.php?action=dupes&amp;dupeaction=remove&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;userid=<?=$UserID?>&amp;removeid=<?=$DupeID?>" onclick="return confirm('Are you sure you wish to remove <?=$DupeInfo['Username']?> from this group?');" class="brackets">x</a>
</td>
<?
if ($i == 5) {
$i = 0;
echo "</tr><tr>";
echo "\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>";
}
}
if ($DupeCount) {
for ($j = $i; $j < 5; $j++) {
echo '<td>&nbsp;</td>';
echo "\t\t\t\t\t\t<td>&nbsp;</td>";
}
?>
</tr>
<? } ?>
<tr>
<td colspan="5" align="left" style="border-top: thin solid"><strong>Comments:</strong></td>
<td colspan="5" align="left" style="border-top: thin solid;"><strong>Comments:</strong></td>
</tr>
<tr>
<td colspan="5" align="left">
<div id="dupecomments" class="<?=$DupeCount?'':'hidden'?>"><?=$Text->full_format($Comments);?></div>
<div id="editdupecomments" class="<?=$DupeCount?'hidden':''?>">
<textarea name="dupecomments" onkeyup="resize('dupecommentsbox');" id="dupecommentsbox" cols="65" rows="5" style="width:98%;"><?=display_str($Comments)?></textarea>
<div id="dupecomments" class="<?=$DupeCount ? '' : 'hidden'?>"><?=$Text->full_format($Comments);?></div>
<div id="editdupecomments" class="<?=$DupeCount ? 'hidden' : ''?>">
<textarea name="dupecomments" onkeyup="resize('dupecommentsbox');" id="dupecommentsbox" cols="65" rows="5" style="width: 98%;"><?=display_str($Comments)?></textarea>
</div>
<span style="float:right; font-style: italic;"><a href="#" onclick="$('#dupecomments').toggle(); $('#editdupecomments').toggle(); resize('dupecommentsbox'); return false;" class="brackets">Edit linked account comments</a></span>
<span style="float: right; font-style: italic;"><a href="#" onclick="$('#dupecomments').toggle(); $('#editdupecomments').toggle(); resize('dupecommentsbox'); return false;" class="brackets">Edit linked account comments</a></span>
</td>
</tr>
</table>

View File

@ -12,28 +12,37 @@
</div>
</div>
<?
$DB->query("SELECT ID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear FROM users_notify_filters WHERE UserID='$LoggedUser[ID]' UNION ALL SELECT NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL");
$DB->query("
SELECT ID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear, RecordLabels
FROM users_notify_filters
WHERE UserID='$LoggedUser[ID]'
UNION ALL
SELECT NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL");
$i = 0;
$NumFilters = $DB->record_count()-1;
$NumFilters = $DB->record_count() - 1;
$Notifications = $DB->to_array();
foreach ($Notifications as $N) { //$N stands for Notifications
$N['Artists'] = implode(', ', explode('|', substr($N['Artists'],1,-1)));
$N['Tags'] = implode(', ', explode('|', substr($N['Tags'],1,-1)));
$N['NotTags'] = implode(', ', explode('|', substr($N['NotTags'],1,-1)));
$N['ReleaseTypes'] = explode('|', substr($N['ReleaseTypes'],1,-1));
$N['Categories'] = explode('|', substr($N['Categories'],1,-1));
$N['Formats'] = explode('|', substr($N['Formats'],1,-1));
$N['Encodings'] = explode('|', substr($N['Encodings'],1,-1));
$N['Media'] = explode('|', substr($N['Media'],1,-1));
if ($N['FromYear'] == 0) { $N['FromYear'] = ''; }
if ($N['ToYear'] == 0) { $N['ToYear'] = ''; }
$N['Artists'] = implode(', ', explode('|', substr($N['Artists'], 1, -1)));
$N['Tags'] = implode(', ', explode('|', substr($N['Tags'], 1, -1)));
$N['NotTags'] = implode(', ', explode('|', substr($N['NotTags'], 1, -1)));
$N['ReleaseTypes'] = explode('|', substr($N['ReleaseTypes'], 1, -1));
$N['Categories'] = explode('|', substr($N['Categories'], 1, -1));
$N['Formats'] = explode('|', substr($N['Formats'], 1, -1));
$N['Encodings'] = explode('|', substr($N['Encodings'], 1, -1));
$N['Media'] = explode('|', substr($N['Media'], 1, -1));
$N['RecordLabels'] = implode(', ', explode('|', substr($N['RecordLabels'], 1, -1)));
if ($N['FromYear'] == 0) {
$N['FromYear'] = '';
}
if ($N['ToYear'] == 0) {
$N['ToYear'] = '';
}
$i++;
if ($i > $NumFilters && $NumFilters > 0) { ?>
<h3>Create a new notification filter</h3>
<? } elseif ($NumFilters>0) { ?>
<? } elseif ($NumFilters > 0) { ?>
<h3>
<a href="feeds.php?feed=torrents_notify_<?=$N['ID']?>_<?=$LoggedUser['torrent_pass']?>&amp;user=<?=$LoggedUser['ID']?>&amp;auth=<?=$LoggedUser['RSS_Auth']?>&amp;passkey=<?=$LoggedUser['torrent_pass']?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;name=<?=urlencode($N['Label'])?>"><img src="<?=STATIC_SERVER?>/common/symbols/rss.png" alt="RSS feed" /></a>
<?=display_str($N['Label'])?>
@ -48,10 +57,10 @@
<table <?=($i <= $NumFilters) ? 'id="filter_'.$N['ID'].'" class="layout hidden"' : 'class="layout"'?>>
<? if ($i > $NumFilters) { ?>
<tr>
<td class="label"><strong>Label</strong></td>
<td class="label"><strong>Notification filter name</strong></td>
<td>
<input type="text" name="label<?=$i?>" style="width: 100%" />
<p class="min_padding">A label/name for the filter set to tell different filters apart.</p>
<input type="text" name="label<?=$i?>" style="width: 100%;" />
<p class="min_padding">A name for the notification filter set to tell different filters apart.</p>
</td>
</tr>
<tr>
@ -65,23 +74,22 @@
<tr>
<td class="label"><strong>One of these artists</strong></td>
<td>
<textarea name="artists<?=$i?>" style="width:100%" rows="5"><?=display_str($N['Artists'])?></textarea>
<textarea name="artists<?=$i?>" style="width: 100%;" rows="5"><?=display_str($N['Artists'])?></textarea>
<p class="min_padding">Comma-separated list &mdash; e.g. <em>Pink Floyd, Led Zeppelin, Neil Young</em></p>
<input type="checkbox" name="excludeva<?=$i?>" id="excludeva_<?=$N['ID']?>"<? if ($N['ExcludeVA'] == '1') { echo ' checked="checked"';} ?> />
<label for="excludeva_<?=$N['ID']?>">Exclude Various Artists releases</label>
</td>
</tr>
<tr>
</tr> <tr>
<td class="label"><strong>At least one of these tags</strong></td>
<td>
<textarea name="tags<?=$i?>" style="width:100%" rows="2"><?=display_str($N['Tags'])?></textarea>
<textarea name="tags<?=$i?>" style="width: 100%;" rows="2"><?=display_str($N['Tags'])?></textarea>
<p class="min_padding">Comma-separated list &mdash; e.g. <em>rock, jazz, pop</em></p>
</td>
</tr>
<tr>
<td class="label"><strong>None of these tags</strong></td>
<td>
<textarea name="nottags<?=$i?>" style="width:100%" rows="2"><?=display_str($N['NotTags'])?></textarea>
<textarea name="nottags<?=$i?>" style="width: 100%;" rows="2"><?=display_str($N['NotTags'])?></textarea>
<p class="min_padding">Comma-separated list &mdash; e.g. <em>rock, jazz, pop</em></p>
</td>
</tr>

View File

@ -15,6 +15,7 @@
$MediaList = '';
$FromYear = 0;
$ToYear = 0;
$RecordLabels = '';
$HasFilter = false;
if ($_POST['formid'] && is_number($_POST['formid'])) {
@ -25,12 +26,12 @@
$Artists = explode(',', $_POST['artists'.$FormID]);
$ParsedArtists = array();
foreach ($Artists as $Artist) {
if (trim($Artist) != "") {
if (trim($Artist) != '') {
$ParsedArtists[] = db_string(trim($Artist));
}
}
if (count($ParsedArtists) > 0) {
$ArtistList = '|'.implode("|", $ParsedArtists).'|';
$ArtistList = '|'.implode('|', $ParsedArtists).'|';
$HasFilter = true;
}
}
@ -114,7 +115,21 @@
if ($_POST['toyear'.$FormID] && is_number($_POST['toyear'.$FormID])) {
$ToYear = trim($_POST['toyear'.$FormID]);
} else {
$ToYear = date('Y')+3;
$ToYear = date('Y') + 3;
}
}
if ($_POST['record_labels'.$FormID]) {
$RLs = explode(',', $_POST['record_labels'.$FormID]);
$ParsedRLs = array();
foreach ($RLs as $RL) {
if (trim($RL) != '') {
$ParsedRLs[] = db_string(trim($RL));
}
}
if (count($ParsedRLs) > 0) {
$RecordLabels = '|'.implode('|', $ParsedRLs).'|';
$HasFilter = true;
}
}
@ -135,25 +150,30 @@
$NotTagList = str_replace('||','|',$NotTagList);
if ($_POST['id'.$FormID] && is_number($_POST['id'.$FormID])) {
$DB->query("UPDATE users_notify_filters SET
Artists='$ArtistList',
ExcludeVA='$ExcludeVA',
NewGroupsOnly='$NewGroupsOnly',
Tags='$TagList',
NotTags='$NotTagList',
ReleaseTypes='$ReleaseTypeList',
Categories='$CategoryList',
Formats='$FormatList',
Encodings='$EncodingList',
Media='$MediaList',
FromYear='$FromYear',
ToYear='$ToYear'
WHERE ID='".$_POST['id'.$FormID]."' AND UserID='$LoggedUser[ID]'");
$DB->query("
UPDATE users_notify_filters
SET
Artists='$ArtistList',
ExcludeVA='$ExcludeVA',
NewGroupsOnly='$NewGroupsOnly',
Tags='$TagList',
NotTags='$NotTagList',
ReleaseTypes='$ReleaseTypeList',
Categories='$CategoryList',
Formats='$FormatList',
Encodings='$EncodingList',
Media='$MediaList',
FromYear='$FromYear',
ToYear='$ToYear',
RecordLabels='$RecordLabels'
WHERE ID='".$_POST['id'.$FormID]."'
AND UserID='$LoggedUser[ID]'");
} else {
$DB->query("INSERT INTO users_notify_filters
(UserID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear)
$DB->query("
INSERT INTO users_notify_filters
(UserID, Label, Artists, ExcludeVA, NewGroupsOnly, Tags, NotTags, ReleaseTypes, Categories, Formats, Encodings, Media, FromYear, ToYear, RecordLabels)
VALUES
('$LoggedUser[ID]','".db_string($_POST['label'.$FormID])."','$ArtistList','$ExcludeVA','$NewGroupsOnly','$TagList', '$NotTagList', '$ReleaseTypeList','$CategoryList','$FormatList','$EncodingList','$MediaList', '$FromYear', '$ToYear')");
('$LoggedUser[ID]','".db_string($_POST['label'.$FormID])."','$ArtistList','$ExcludeVA','$NewGroupsOnly','$TagList', '$NotTagList', '$ReleaseTypeList','$CategoryList','$FormatList','$EncodingList','$MediaList', '$FromYear', '$ToYear', '$RecordLabels')");
}
$Cache->delete_value('notify_filters_'.$LoggedUser['ID']);

View File

@ -168,7 +168,7 @@ function check_paranoia_here($Setting) {
$DB->query("SELECT FriendID FROM friends WHERE UserID='$LoggedUser[ID]' AND FriendID='$UserID'");
if ($DB->record_count() == 0) { ?>
<a href="friends.php?action=add&amp;friendid=<?=$UserID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Add to friends</a>
<? }?>
<? } ?>
<a href="reports.php?action=report&amp;type=user&amp;id=<?=$UserID?>" class="brackets">Report user</a>
<?
@ -491,9 +491,9 @@ function check_paranoia_here($Setting) {
<? } ?>
<div class="box">
<div class="head">
<span style="float: left;">Profile<? if ($CustomTitle) {?>&nbsp;-&nbsp;</span>
<span style="float: left;">Profile<? if ($CustomTitle) { ?>&nbsp;-&nbsp;</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 class="pad" id="profilediv">
<? if (!$Info) { ?>
@ -510,19 +510,20 @@ function check_paranoia_here($Setting) {
if ($Snatched > 4 && check_paranoia_here('snatched')) {
$RecentSnatches = $Cache->get_value('recent_snatches_'.$UserID);
if (!is_array($RecentSnatches)) {
$DB->query("SELECT
g.ID,
g.Name,
g.WikiImage
FROM xbt_snatched AS s
INNER JOIN torrents AS t ON t.ID=s.fid
INNER JOIN torrents_group AS g ON t.GroupID=g.ID
WHERE s.uid='$UserID'
AND g.CategoryID='1'
AND g.WikiImage <> ''
GROUP BY g.ID
ORDER BY s.tstamp DESC
LIMIT 5");
$DB->query("
SELECT
g.ID,
g.Name,
g.WikiImage
FROM xbt_snatched AS s
INNER JOIN torrents AS t ON t.ID=s.fid
INNER JOIN torrents_group AS g ON t.GroupID=g.ID
WHERE s.uid='$UserID'
AND g.CategoryID='1'
AND g.WikiImage <> ''
GROUP BY g.ID
ORDER BY s.tstamp DESC
LIMIT 5");
$RecentSnatches = $DB->to_array();
$Artists = Artists::get_artists($DB->collect('ID'));
@ -555,18 +556,19 @@ function check_paranoia_here($Setting) {
if ($Uploads > 4 && check_paranoia_here('uploads')) {
$RecentUploads = $Cache->get_value('recent_uploads_'.$UserID);
if (!is_array($RecentUploads)) {
$DB->query("SELECT
g.ID,
g.Name,
g.WikiImage
FROM torrents_group AS g
INNER JOIN torrents AS t ON t.GroupID=g.ID
WHERE t.UserID='$UserID'
AND g.CategoryID='1'
AND g.WikiImage <> ''
GROUP BY g.ID
ORDER BY t.Time DESC
LIMIT 5");
$DB->query("
SELECT
g.ID,
g.Name,
g.WikiImage
FROM torrents_group AS g
INNER JOIN torrents AS t ON t.GroupID=g.ID
WHERE t.UserID='$UserID'
AND g.CategoryID='1'
AND g.WikiImage <> ''
GROUP BY g.ID
ORDER BY t.Time DESC
LIMIT 5");
$RecentUploads = $DB->to_array();
$Artists = Artists::get_artists($DB->collect('ID'));
foreach ($RecentUploads as $Key => $UploadInfo) {
@ -592,28 +594,36 @@ function check_paranoia_here($Setting) {
<?
}
$DB->query("SELECT ID, Name FROM collages WHERE UserID='$UserID' AND CategoryID='0' AND Deleted='0' ORDER BY Featured DESC, Name ASC");
$DB->query("
SELECT ID, Name
FROM collages
WHERE UserID='$UserID'
AND CategoryID='0'
AND Deleted='0'
ORDER BY Featured DESC, Name ASC");
$Collages = $DB->to_array();
$FirstCol = true;
foreach ($Collages as $CollageInfo) {
list($CollageID, $CName) = $CollageInfo;
$DB->query("SELECT ct.GroupID,
tg.WikiImage,
tg.CategoryID
$DB->query("
SELECT ct.GroupID,
tg.WikiImage,
tg.CategoryID
FROM collages_torrents AS ct
JOIN torrents_group AS tg ON tg.ID=ct.GroupID
WHERE ct.CollageID='$CollageID'
ORDER BY ct.Sort LIMIT 5");
ORDER BY ct.Sort
LIMIT 5");
$Collage = $DB->to_array();
?>
<table class="layout recent" id="collage<?=$CollageID?>_box" cellpadding="0" cellspacing="0" border="0">
<tr class="colhead">
<td colspan="5">
<span style="float:left;">
<span style="float: left;">
<a href="#collage<?=$CollageID?>_box"><strong>&uarr;</strong></a> <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
</span>
<span style="float:right;">
<a href="#" onclick="$('#collage<?=$CollageID?>_box .images').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets"><?=$FirstCol?'Hide':'Show'?></a>
<span style="float: right;">
<a href="#" onclick="$('#collage<?=$CollageID?>_box .images').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets"><?=$FirstCol ? 'Hide' : 'Show' ?></a>
</span>
</td>
</tr>
@ -638,8 +648,6 @@ function check_paranoia_here($Setting) {
}
// Linked accounts
if (check_perms('users_mod')) {
include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
@ -663,7 +671,8 @@ function check_paranoia_here($Setting) {
// Requests
if (empty($LoggedUser['DisableRequests']) && check_paranoia_here('requestsvoted_list')) {
$DB->query("SELECT
$DB->query("
SELECT
r.ID,
r.CategoryID,
r.Title,
@ -674,7 +683,7 @@ function check_paranoia_here($Setting) {
FROM requests AS r
LEFT JOIN users_main AS u ON u.ID=UserID
LEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID
WHERE r.UserID = ".$UserID."
WHERE r.UserID = $UserID
AND r.TorrentID = 0
GROUP BY r.ID
ORDER BY Votes DESC");
@ -689,7 +698,7 @@ function check_paranoia_here($Setting) {
<div id="requests" class="request_table hidden">
<table cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
<tr class="colhead_dark">
<td style="width:48%;">
<td style="width: 48%;">
<strong>Request name</strong>
</td>
<td>
@ -768,18 +777,20 @@ function check_paranoia_here($Setting) {
$IsFLS = $LoggedUser['ExtraClasses'][41];
if (check_perms('users_mod', $Class) || $IsFLS) {
$UserLevel = $LoggedUser['EffectiveClass'];
$DB->query("SELECT
SQL_CALC_FOUND_ROWS
ID,
Subject,
Status,
Level,
AssignedToUser,
Date,
ResolverID
FROM staff_pm_conversations
WHERE UserID = $UserID AND (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."')
ORDER BY Date DESC");
$DB->query("
SELECT
SQL_CALC_FOUND_ROWS
ID,
Subject,
Status,
Level,
AssignedToUser,
Date,
ResolverID
FROM staff_pm_conversations
WHERE UserID = $UserID
AND (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."')
ORDER BY Date DESC");
if ($DB->record_count()) {
$StaffPMs = $DB->to_array();
?>
@ -799,10 +810,10 @@ function check_paranoia_here($Setting) {
// Get assigned
if ($AssignedToUser == '') {
// Assigned to class
$Assigned = ($Level == 0) ? "First Line Support" : $ClassLevels[$Level]['Name'];
$Assigned = ($Level == 0) ? 'First Line Support' : $ClassLevels[$Level]['Name'];
// No + on Sysops
if ($Assigned != 'Sysop') {
$Assigned .= "+";
$Assigned .= '+';
}
} else {
@ -813,7 +824,7 @@ function check_paranoia_here($Setting) {
if ($ResolverID) {
$Resolver = Users::format_username($ResolverID, true, true, true, true);
} else {
$Resolver = "(unresolved)";
$Resolver = '(unresolved)';
}
?>
@ -841,7 +852,7 @@ function check_paranoia_here($Setting) {
<div class="box">
<div class="head">Forum warnings</div>
<div class="pad">
<div id="forumwarningslinks" class="AdminComment box" style="width:98%;"><?=$Text->full_format($ForumWarnings)?></div>
<div id="forumwarningslinks" class="AdminComment box" style="width: 98%;"><?=$Text->full_format($ForumWarnings)?></div>
</div>
</div>
<br />
@ -862,8 +873,8 @@ function check_paranoia_here($Setting) {
</div>
<div id="staffnotes" class="pad">
<input type="hidden" name="comment_hash" value="<?=$CommentHash?>" />
<div id="admincommentlinks" class="AdminComment box" style="width:98%;"><?=$Text->full_format($AdminComment)?></div>
<textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width:98%;"><?=display_str($AdminComment)?></textarea>
<div id="admincommentlinks" class="AdminComment box" style="width: 98%;"><?=$Text->full_format($AdminComment)?></div>
<textarea id="admincomment" onkeyup="resize('admincomment');" class="AdminComment hidden" name="AdminComment" cols="65" rows="26" style="width: 98%;"><?=display_str($AdminComment)?></textarea>
<a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Toggle edit</a>
<script type="text/javascript">
resize('admincomment');
@ -893,7 +904,7 @@ function check_paranoia_here($Setting) {
<?
}
if (check_perms('users_promote_below', $Class) || check_perms('users_promote_to', $Class-1)) {
if (check_perms('users_promote_below', $Class) || check_perms('users_promote_to', $Class - 1)) {
?>
<tr>
<td class="label">Primary class:</td>
@ -937,11 +948,12 @@ function check_paranoia_here($Setting) {
<td class="label">Secondary classes:</td>
<td>
<?
$DB->query("SELECT p.ID, p.Name, l.UserID
FROM permissions AS p
LEFT JOIN users_levels AS l ON l.PermissionID = p.ID AND l.UserID = '$UserID'
WHERE p.Secondary = 1
ORDER BY p.Name");
$DB->query("
SELECT p.ID, p.Name, l.UserID
FROM permissions AS p
LEFT JOIN users_levels AS l ON l.PermissionID = p.ID AND l.UserID = '$UserID'
WHERE p.Secondary = 1
ORDER BY p.Name");
$i = 0;
while (list($PermID, $PermName, $IsSet) = $DB->next_record()) {
$i++;
@ -1068,7 +1080,7 @@ function check_paranoia_here($Setting) {
<input type="checkbox" name="Warned"<? if ($Warned != '0000-00-00 00:00:00') { ?> checked="checked"<? } ?> />
</td>
</tr>
<? if ($Warned=='0000-00-00 00:00:00') { // user is not warned ?>
<? if ($Warned == '0000-00-00 00:00:00') { // user is not warned ?>
<tr>
<td class="label">Expiration:</td>
<td>
@ -1122,7 +1134,11 @@ function check_paranoia_here($Setting) {
</td>
</tr>
<? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) {
$DB->query("SELECT DISTINCT Email, IP FROM users_history_emails WHERE UserID = ".$UserID." ORDER BY Time ASC");
$DB->query("
SELECT DISTINCT Email, IP
FROM users_history_emails
WHERE UserID = $UserID
ORDER BY Time ASC");
$Emails = $DB->to_array();
?>
<tr>

View File

@ -45,18 +45,24 @@ function ShowIPs(rowname) {
<?
list($Page,$Limit) = Format::page_limit(IPS_PER_PAGE);
$TrackerIps = $DB->query("SELECT IP, fid, tstamp FROM xbt_snatched WHERE uid = ".$UserID." AND IP != '' ORDER BY tstamp DESC LIMIT $Limit");
$TrackerIps = $DB->query("
SELECT IP, fid, tstamp
FROM xbt_snatched
WHERE uid = $UserID
AND IP != ''
ORDER BY tstamp DESC
LIMIT $Limit");
$DB->query("SELECT FOUND_ROWS()");
list($NumResults) = $DB->next_record();
$DB->set_query_id($TrackerIps);
$Pages=Format::get_pages($Page,$NumResults,IPS_PER_PAGE,9);
$Pages = Format::get_pages($Page, $NumResults, IPS_PER_PAGE, 9);
?>
<div class="thin">
<div class="header">
<h2>Tracker IP address history for <a href="/user.php?id=<?=$UserID?>"><?=$Username?></a></h2>
<h2>Tracker IP address history for <a href="user.php?id=<?=$UserID?>"><?=$Username?></a></h2>
</div>
<div class="linkbox"><?=$Pages?></div>
<table>

View File

@ -7,11 +7,9 @@
error(403);
}
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
$UserID = empty($_GET['userid']) ? $LoggedUser['ID'] : $_GET['userid'];
if (!is_number($UserID)) {
error(0);
@ -33,47 +31,50 @@
if ($LoggedUser['CustomForums']) {
unset($LoggedUser['CustomForums']['']);
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
}
$ViewingOwn = ($UserID == $LoggedUser['ID']);
$ShowUnread = ($ViewingOwn && (!isset($_GET['showunread']) || !!$_GET['showunread']));
$ShowGrouped = ($ViewingOwn && (!isset($_GET['group']) || !!$_GET['group']));
if ($ShowGrouped) {
$sql = 'SELECT
SQL_CALC_FOUND_ROWS
MAX(p.ID) AS ID
$sql = '
SELECT
SQL_CALC_FOUND_ROWS
MAX(p.ID) AS ID
FROM forums_posts AS p
LEFT JOIN forums_topics AS t ON t.ID = p.TopicID';
LEFT JOIN forums_topics AS t ON t.ID = p.TopicID';
if ($ShowUnread) {
$sql.='
LEFT JOIN forums_last_read_topics AS l ON l.TopicID = t.ID AND l.UserID = '.$LoggedUser['ID'];
LEFT JOIN forums_last_read_topics AS l ON l.TopicID = t.ID AND l.UserID = '.$LoggedUser['ID'];
}
$sql .= '
LEFT JOIN forums AS f ON f.ID = t.ForumID
LEFT JOIN forums AS f ON f.ID = t.ForumID
WHERE p.AuthorID = '.$UserID.'
AND ((f.MinClassRead <= '.$LoggedUser['EffectiveClass'];
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
if (!empty($RestrictedForums)) {
$sql.='
AND f.ID NOT IN (\''.$RestrictedForums.'\')';
AND f.ID NOT IN (\''.$RestrictedForums.'\')';
}
$sql .= ')';
if (!empty($PermittedForums)) {
$sql.='
OR f.ID IN (\''.$PermittedForums.'\')';
OR f.ID IN (\''.$PermittedForums.'\')';
}
$sql .= ')';
if ($ShowUnread) {
$sql .= '
AND ((t.IsLocked=\'0\' OR t.IsSticky=\'1\')
AND (l.PostID<t.LastPostID OR l.PostID IS NULL))';
AND ((t.IsLocked=\'0\' OR t.IsSticky=\'1\')
AND (l.PostID<t.LastPostID OR l.PostID IS NULL))';
}
$sql .= '
GROUP BY t.ID
ORDER BY p.ID DESC LIMIT '.$Limit;
ORDER BY p.ID DESC
LIMIT '.$Limit;
$PostIDs = $DB->query($sql);
$DB->query("SELECT FOUND_ROWS()");
list($Results) = $DB->next_record();
if ($Results > $PerPage*($Page-1)) {
if ($Results > $PerPage * ($Page - 1)) {
$DB->set_query_id($PostIDs);
$PostIDs = $DB->collect('ID');
$sql = '
@ -102,28 +103,28 @@
$Posts = $DB->query($sql);
}
} else {
$sql = 'SELECT
SQL_CALC_FOUND_ROWS';
$sql = '
SELECT SQL_CALC_FOUND_ROWS';
if ($ShowGrouped) {
$sql.=' * FROM (SELECT';
}
$sql .= '
p.ID,
p.AddedTime,
p.Body,
p.EditedUserID,
p.EditedTime,
ed.Username,
p.TopicID,
t.Title,
t.LastPostID,';
p.ID,
p.AddedTime,
p.Body,
p.EditedUserID,
p.EditedTime,
ed.Username,
p.TopicID,
t.Title,
t.LastPostID,';
if ($UserID == $LoggedUser['ID']) {
$sql .= '
l.PostID AS LastRead,';
l.PostID AS LastRead,';
}
$sql .= '
t.IsLocked,
t.IsSticky
t.IsLocked,
t.IsSticky
FROM forums_posts as p
LEFT JOIN users_main AS um ON um.ID = p.AuthorID
LEFT JOIN users_info AS ui ON ui.UserID = p.AuthorID
@ -132,16 +133,25 @@
JOIN forums AS f ON f.ID = t.ForumID
LEFT JOIN forums_last_read_topics AS l ON l.UserID = '.$UserID.' AND l.TopicID = t.ID
WHERE p.AuthorID = '.$UserID.'
AND f.MinClassRead <= '.$LoggedUser['EffectiveClass'];
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
if (!empty($RestrictedForums)) {
$sql.='
AND f.ID NOT IN (\''.$RestrictedForums.'\')';
AND f.ID NOT IN (\''.$RestrictedForums.'\')';
}
$sql .= ')';
if (!empty($PermittedForums)) {
$sql.='
OR f.ID IN (\''.$PermittedForums.'\')';
}
$sql .= ')';
if ($ShowUnread) {
$sql.='
AND ((t.IsLocked=\'0\' OR t.IsSticky=\'1\') AND (l.PostID<t.LastPostID OR l.PostID IS NULL)) ';
AND ( (t.IsLocked=\'0\' OR t.IsSticky=\'1\')
AND (l.PostID<t.LastPostID OR l.PostID IS NULL)
) ';
}
$sql .= '
@ -150,7 +160,8 @@
if ($ShowGrouped) {
$sql.='
) AS sub
GROUP BY TopicID ORDER BY ID DESC';
GROUP BY TopicID
ORDER BY ID DESC';
}
$sql.=' LIMIT '.$Limit;
@ -226,7 +237,7 @@
?>
<div class="linkbox">
<?
$Pages=Format::get_pages($Page, $Results, $PerPage, 11);
$Pages = Format::get_pages($Page, $Results, $PerPage, 11);
echo $Pages;
?>
</div>

View File

@ -27,18 +27,19 @@
$ShowUnread = (!isset($_GET['showunread']) && !isset($HeavyInfo['SubscriptionsUnread']) || isset($HeavyInfo['SubscriptionsUnread']) && !!$HeavyInfo['SubscriptionsUnread'] || isset($_GET['showunread']) && !!$_GET['showunread']);
$ShowCollapsed = (!isset($_GET['collapse']) && !isset($HeavyInfo['SubscriptionsCollapse']) || isset($HeavyInfo['SubscriptionsCollapse']) && !!$HeavyInfo['SubscriptionsCollapse'] || isset($_GET['collapse']) && !!$_GET['collapse']);
$sql = 'SELECT
SQL_CALC_FOUND_ROWS
MAX(p.ID) AS ID
FROM (SELECT TopicID
FROM users_subscriptions
WHERE UserID = '.$LoggedUser['ID'].') AS s
LEFT JOIN forums_last_read_topics AS l ON s.TopicID = l.TopicID AND l.UserID = '.$LoggedUser['ID'].'
JOIN forums_topics AS t ON t.ID = s.TopicID
JOIN forums_posts AS p ON t.ID = p.TopicID
JOIN forums AS f ON f.ID = t.ForumID
$sql = '
SELECT SQL_CALC_FOUND_ROWS
MAX(p.ID) AS ID
FROM ( SELECT TopicID
FROM users_subscriptions
WHERE UserID = '.$LoggedUser['ID'].'
) AS s
LEFT JOIN forums_last_read_topics AS l ON s.TopicID = l.TopicID AND l.UserID = '.$LoggedUser['ID'].'
JOIN forums_topics AS t ON t.ID = s.TopicID
JOIN forums_posts AS p ON t.ID = p.TopicID
JOIN forums AS f ON f.ID = t.ForumID
WHERE p.ID <= IFNULL(l.PostID,t.LastPostID)
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
AND ((f.MinClassRead <= '.$LoggedUser['Class'];
if (!empty($RestrictedForums)) {
$sql.=' AND f.ID NOT IN (\''.$RestrictedForums.'\')';
}
@ -51,7 +52,7 @@
$sql .= '
AND IF(l.PostID IS NULL OR (t.IsLocked = \'1\' && t.IsSticky = \'0\'), t.LastPostID, l.PostID) < t.LastPostID';
AND IF(l.PostID IS NULL OR (t.IsLocked = \'1\' && t.IsSticky = \'0\'), t.LastPostID, l.PostID) < t.LastPostID';
$sql .= ' OR (t.AuthorID != '.$LoggedUser['ID'].' AND l.PostID IS NULL)';
}
@ -63,31 +64,32 @@
$DB->query('SELECT FOUND_ROWS()');
list($NumResults) = $DB->next_record();
if ($NumResults > $PerPage*($Page-1)) {
if ($NumResults > $PerPage * ($Page - 1)) {
$DB->set_query_id($PostIDs);
$PostIDs = $DB->collect('ID');
$sql = 'SELECT
f.ID AS ForumID,
f.Name AS ForumName,
p.TopicID,
t.Title,
p.Body,
t.LastPostID,
t.IsLocked,
t.IsSticky,
p.ID,
um.ID,
um.Username,
ui.Avatar,
p.EditedUserID,
p.EditedTime,
ed.Username AS EditedUsername
$sql = '
SELECT
f.ID AS ForumID,
f.Name AS ForumName,
p.TopicID,
t.Title,
p.Body,
t.LastPostID,
t.IsLocked,
t.IsSticky,
p.ID,
um.ID,
um.Username,
ui.Avatar,
p.EditedUserID,
p.EditedTime,
ed.Username AS EditedUsername
FROM forums_posts AS p
LEFT JOIN forums_topics AS t ON t.ID = p.TopicID
LEFT JOIN forums AS f ON f.ID = t.ForumID
LEFT JOIN users_main AS um ON um.ID = p.AuthorID
LEFT JOIN users_info AS ui ON ui.UserID = um.ID
LEFT JOIN users_main AS ed ON ed.ID = um.ID
LEFT JOIN forums_topics AS t ON t.ID = p.TopicID
LEFT JOIN forums AS f ON f.ID = t.ForumID
LEFT JOIN users_main AS um ON um.ID = p.AuthorID
LEFT JOIN users_info AS ui ON ui.UserID = um.ID
LEFT JOIN users_main AS ed ON ed.ID = um.ID
WHERE p.ID IN ('.implode(',',$PostIDs).')
ORDER BY f.Name ASC, t.LastPostID DESC';
$DB->query($sql);
@ -95,7 +97,7 @@
?>
<div class="thin">
<div class="header">
<h2><?='Subscribed topics'.($ShowUnread?' with unread posts':'')?></h2>
<h2><?='Subscribed topics'.($ShowUnread ? ' with unread posts' : '')?></h2>
<div class="linkbox">
<?
@ -112,7 +114,7 @@
}
if ($NumResults) {
?>
<a href="#" onclick="Collapse();return false;" id="collapselink" class="brackets"><?=$ShowCollapsed?'Show':'Hide'?> post bodies</a>&nbsp;&nbsp;&nbsp;
<a href="#" onclick="Collapse();return false;" id="collapselink" class="brackets"><?=$ShowCollapsed ? 'Show' : 'Hide' ?> post bodies</a>&nbsp;&nbsp;&nbsp;
<?
}
?>
@ -132,7 +134,7 @@
?>
<div class="linkbox">
<?
$Pages=Format::get_pages($Page,$NumResults,$PerPage, 11);
$Pages = Format::get_pages($Page, $NumResults, $PerPage, 11);
echo $Pages;
?>
</div>
@ -148,17 +150,17 @@
</colgroup>
<tr class="colhead_dark">
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1 ?>">
<span style="float:left;">
<span style="float: left;">
<a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$ForumName?></a> &gt;
<a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a>
<? if ($PostID < $LastPostID && !$Locked) { ?>
<span class="new">(New!)</span>
<? } ?>
</span>
<span style="float:left;" class="last_read" title="Jump to last read">
<a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID.($PostID?'&amp;postid='.$PostID.'#post'.$PostID:'')?>"></a>
<span style="float: left;" class="last_read" title="Jump to last read">
<a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID.($PostID ? '&amp;postid='.$PostID.'#post'.$PostID : '')?>"></a>
</span>
<span id="bar<?=$PostID ?>" style="float:right;">
<span id="bar<?=$PostID ?>" style="float: right;">
<a href="#" onclick="Subscribe(<?=$TopicID?>);return false;" id="subscribelink<?=$TopicID?>" class="brackets">Unsubscribe</a>
&nbsp;
<a href="#">&uarr;</a>
@ -190,7 +192,5 @@
<? } // else -- if (empty($NumResults)) ?>
</div>
<?
View::show_footer();
?>

View File

@ -85,8 +85,8 @@
<tr>
<td class="label"><strong>Search in:</strong></td>
<td>
<input type="radio" name="type" value="Title" <? if ($Type == 'w.Title') { echo 'checked="checked" '; }?>/> Title
<input type="radio" name="type" value="Body" <? if ($Type == 'w.Body') { echo 'checked="checked" '; }?>/> Body
<input type="radio" name="type" value="Title" <? if ($Type == 'w.Title') { echo 'checked="checked" '; } ?>/> Title
<input type="radio" name="type" value="Body" <? if ($Type == 'w.Body') { echo 'checked="checked" '; } ?>/> Body
</td>
<td class="label"><strong>Order by:</strong></td>
<td>

View File

@ -137,8 +137,14 @@ var autocomp = {
listener.set(li,'mouseover',function() {
autocomp.highlight(this.i);
});
listener.set(li,'click',function() {
window.location = autocomp.id + '.php?id='+this.artistid;
listener.set(li,'click',function(e) {
var location = autocomp.id + '.php?id='+this.artistid;
if(e.button == 0) {
window.open(location, '_self');
} else if(e.button == 1) {
var win = window.open(location, '_blank');
win.focus();
}
});
this.list.appendChild(li);
}

View File

@ -80,25 +80,31 @@ img {
/* Styles generated by the BBCode parser */
span.size1 { font-size:0.75em; }
span.size2 { font-size:1em; }
span.size3 { font-size:1.25em; }
span.size4 { font-size:1.5em; }
span.size5 { font-size:1.75em; }
span.size6 { font-size:2em; }
span.size7 { font-size:2.25em; }
span.size8 { font-size:2.5em; }
span.size9 { font-size:2.75em; }
span.size10 { font-size:3em; }
span.size1 { font-size: 0.75em; }
span.size2 { font-size: 1em; }
span.size3 { font-size: 1.25em; }
span.size4 { font-size: 1.5em; }
span.size5 { font-size: 1.75em; }
span.size6 { font-size: 2em; }
span.size7 { font-size: 2.25em; }
span.size8 { font-size: 2.5em; }
span.size9 { font-size: 2.75em; }
span.size10 { font-size: 3em; }
ul.thin { margin:0px 0px 0px 25px; padding:0px; }
ul.thin li { margin:0px 0px; padding:0px; }
ul.thin {
margin: 0px 0px 0px 25px;
padding: 0px;
}
ul.thin li {
margin: 0px 0px;
padding: 0px;
}
/* Layout (Every page) */
#header {
width: 100%;
min-width:740px;
min-width: 740px;
padding: 0px 0 0 0;
background: url('images/woodhead.png') repeat-x;
margin-bottom: 15px;
@ -106,7 +112,7 @@ ul.thin li { margin:0px 0px; padding:0px; }
#content {
width: 94%;
min-width:740px;
min-width: 740px;
background-color: #C1965C;
margin: 0px auto 0px auto;
padding: 0.6em;
@ -568,7 +574,7 @@ ul.poll li.graph {
}
.filter_torrents option {
padding-right:8px;
padding-right: 8px;
}
.cat_list {
@ -576,56 +582,56 @@ ul.poll li.graph {
}
.cat_list tr td {
border:none;
border: none;
}
.select_container {
margin:5px;
margin: 5px;
}
.torrent_table tr {
vertical-align:top;
vertical-align: top;
}
.group {
font-weight:bold;
background-color:#B48648;
font-weight: bold;
background-color: #B48648;
}
.group_torrent {
background-color:#DDB47C;
background-color: #DDB47C;
}
.group_torrent span {
float:right;
float: right;
}
.torrent {
font-weight:bold;
background-color:#C3995F;
font-weight: bold;
background-color: #C3995F;
}
.torrent span {
font-weight:normal;
float:right;
font-weight: normal;
float: right;
}
.torrent_table div.tags {
font-weight:normal;
font-weight: normal;
}
.torrent_table tr .center {
vertical-align:middle;
text-align:center;
vertical-align: middle;
text-align: center;
}
.torrent_table td .small {
width:20px;
width: 20px;
}
.torrent_table a img {
border:none;
border: none;
}
.torrent_table table {
width:94%;
width: 94%;
margin: 10px;
}
@ -635,12 +641,12 @@ ul.poll li.graph {
}
.nobr {
white-space:nowrap;
white-space: nowrap;
}
.advanced_search {
text-align:right;
padding-bottom:5px;
text-align: right;
padding-bottom: 5px;
}
/* Layout (Forums) */
@ -656,7 +662,7 @@ ul.poll li.graph {
.read_locked{background: url(images/locked_read.png) no-repeat center center;}
.unread{background: url(images/unread.png) no-repeat center center;}
.read{background: url(images/read.png) no-repeat center center;}
strong.quoteheader{color:#492801;}
strong.quoteheader{color: #492801;}
table.forum_post {
margin: 10px 0px;
@ -694,30 +700,30 @@ tr.unreadpm {
/* Layout (Permission Page) */
.permission_head {
width:400px;
margin-left:auto;
margin-right:auto;
width: 400px;
margin-left: auto;
margin-right: auto;
}
.permissions {
width:930px;
margin-left:auto;
margin-right:auto;
width: 930px;
margin-left: auto;
margin-right: auto;
}
.permission_container {
float:left;
width:300px;
padding:5px;
float: left;
width: 300px;
padding: 5px;
}
.permission_container input {
margin:0px 3px 5px 0px;
vertical-align:top;
margin: 0px 3px 5px 0px;
vertical-align: top;
}
.submit_container {
clear:both;
text-align:right;
clear: both;
text-align: right;
}
/* Layout (Invite tree) */
@ -772,9 +778,9 @@ ul .invitetree {
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
z-index: 1001;
-moz-opacity: 0.8;
opacity:.80;
opacity: 0.80;
filter: alpha(opacity=80);
}
@ -786,7 +792,7 @@ ul .invitetree {
width: 90%;
height: 90%;
padding: 0px;
z-index:1002;
z-index: 1002;
overflow: auto;
}

View File

@ -199,8 +199,7 @@ div#AddArtists a {
z-index: 25;
display: block;
position: fixed;
background: transparent url('../rippy/rippy.png') no-repeat bottom
center;
background: transparent url('../rippy/rippy.png') no-repeat bottom center;
color: black;
text-align: center;
width: 190px;
@ -275,23 +274,20 @@ span.secondary_class {
}
.headerSort span {
background: url("../common/table-order.png") no-repeat scroll right
-38px transparent;
background: url("../common/table-order.png") no-repeat scroll right -38px transparent;
padding: 0px 20px 0 0;
}
.headerSortDown span {
background: url("../common/table-order.png") no-repeat scroll right 4px
transparent;
background: url("../common/table-order.png") no-repeat scroll right 4px transparent;
}
.headerSortUp span {
background: url("../common/table-order.png") no-repeat scroll right
-79px transparent;
background: url("../common/table-order.png") no-repeat scroll right -79px transparent;
}
.album_votes {
text-align: center
text-align: center;
}
.favoritecount {
@ -413,13 +409,13 @@ tr.torrent .bookmark>a:after {
overflow:hidden;
}
.float_left {
float:left;
float: left;
}
.float_right {
float:right;
float: right;
}
.float_clear {
clear:both;
clear: both;
}
.group_image + .group_info {
margin-left: 100px;
@ -463,7 +459,7 @@ tr.torrent .bookmark>a:after {
}
/* Fix long overflow for Opera (doesn't support word-break). */
.reportinfo_table {
table-layout:fixed;
table-layout: fixed;
}
/* Wrap release info for consistent DOM and to limit table expansion. */
.no_overflow {

View File

@ -18,8 +18,8 @@ input#file, input[type="file"]{color:#000}
textarea#quickpost{margin:0; padding:0}
/* GENERAL */
.box, #content table tr td{background:#373737; margin-bottom:15px}
.pad{padding:10px}
.box, #content table tr td{background: #373737; margin-bottom: 15px;}
.pad{padding: 10px;}
.sidebar .box{position:relative}
.sidebar img{max-width:228px}
@ -32,25 +32,25 @@ textarea#quickpost{margin:0; padding:0}
.label{width:15%}
/* wrapper */
#wrapper{width:980px; margin:0 auto}
#wrapper{width: 980px; margin: 0 auto;}
/* header layout */
#header{position:relative; overflow:visible; height:110px; z-index:4}
#logo{width:94px; height:74px; position:absolute; top:8px; left:0; background-repeat:no-repeat; background-image:url(images/logo.png)}
#logo a{width:94px; height:74px; display:block}
#header{position: relative; overflow: visible; height: 110px; z-index: 4;}
#logo{width: 94px; height: 74px; position: absolute; top: 8px; left: 0; background-repeat: no-repeat; background-image: url(images/logo.png);}
#logo a{width: 94px; height: 74px; display: block;}
/* menu */
#menu{margin:0 0 0 105px; padding:0 249px 7px 0; border-bottom:1px solid #353535; overflow:hidden}
#menu *{text-transform:lowercase}
#menu ul{list-style:none; margin:0; padding:0}
#menu ul li{float:left; margin:2px 6px 0; text-align:center}
#menu ul li a{padding:12px 4px 3px; font-weight:bold; display:block; text-decoration:none; color:#FFF}
#menu ul li:hover{background:#353535}
#menu ul li:hover a{color:#FFF}
#menu{margin: 0 0 0 105px; padding: 0 249px 7px 0; border-bottom: 1px solid #353535; overflow: hidden;}
#menu *{text-transform: lowercase;}
#menu ul{list-style: none; margin: 0; padding: 0;}
#menu ul li{float: left; margin: 2px 6px 0; text-align: center;}
#menu ul li a{padding: 12px 4px 3px; font-weight: bold; display: block; text-decoration: none; color: #FFF;}
#menu ul li:hover{background: #353535;}
#menu ul li:hover a{color: #FFF;}
/* active menu item */
#index #nav_index a, #torrents #nav_torrents a, #collage #nav_collages a, #requests #nav_requests a, #forums #nav_forums a, #top10 #nav_top10 a, #rules #nav_rules a, #kb #nav_wiki a, #wiki #nav_wiki a, #staff #nav_staff a, #chat #nav_irc a
{background:#5AF}
{background: #5AF;}
/* sprite */
#userinfo_username li:first-child, #userinfo_major li:first-child, #userinfo_minor li:first-child, #userinfo_username li:first-child:hover, #userinfo_major li:first-child:hover, #userinfo_minor li:first-child:hover,

View File

@ -1228,8 +1228,8 @@ strong.quoteheader {
/* Toolbox */
.permission_container {
float:left;
width:33.3%;
float: left;
width: 33.3%;
}
/* TORRENTS */
@ -1239,7 +1239,7 @@ strong.quoteheader {
}
.main_column .torrent_table .torrent {
background-color:#f6f6f6;
background-color: #f6f6f6;
}
.main_column .torrent_table .pad blockquote {

View File

@ -722,8 +722,8 @@ tr.group_torrent {
}
.torrent span {
font-weight:normal;
float:right;
font-weight: normal;
float: right;
}
.nobr {
@ -879,7 +879,9 @@ form tr {
background-color: #D1F0FD;
}
#site_debug .hidden { display: none; }
#site_debug .hidden {
display: none;
}
.center {
text-align: center;