Empty commit

This commit is contained in:
Git 2013-09-17 08:00:49 +00:00
parent 69e1208c2a
commit cd85d0ef21
5 changed files with 65 additions and 58 deletions

View File

@ -359,12 +359,13 @@ function authorize($Ajax = false) {
error(404);
}
$StripPostKeys = array_fill_keys(array('password', 'cur_pass', 'new_pass_1', 'new_pass_2', 'verifypassword', 'confirm_password', 'ChangePassword', 'Password'), true);
$Cache->cache_value('php_' . getmypid(), array(
'start' => sqltime(),
'document' => $Document,
'query' => $_SERVER['QUERY_STRING'],
'get' => $_GET,
'post' => $_POST), 600);
'post' => array_diff_key($_POST, $StripPostKeys)), 600);
require(SERVER_ROOT.'/sections/'.$Document.'/index.php');
$Debug->set_flag('completed module execution');

View File

@ -139,7 +139,7 @@
<div class="pad"><?=$Text->full_format($Description)?></div>
</div>
<div class="box box_info box_statistics_collage_torrents">
<div class="head"><strong>Stats</strong></div>
<div class="head"><strong>Statistics</strong></div>
<ul class="stats nobullet">
<li>Artists: <?=number_format($NumArtists)?></li>
<li>Subscribers: <?=number_format((int)$Subscribers)?></li>
@ -148,7 +148,7 @@
</ul>
</div>
<div class="box box_contributors">
<div class="head"><strong>Top contributors</strong></div>
<div class="head"><strong>Top Contributors</strong></div>
<div class="pad">
<ol style="padding-left: 5px;">
<?
@ -263,22 +263,23 @@
<?
if ($CollageCovers != 0) { ?>
<div id="coverart" class="box">
<div class="head" id="coverhead"><strong>Cover art</strong></div>
<div class="head" id="coverhead"><strong>Cover Art</strong></div>
<ul class="collage_images" id="collage_page0">
<?
$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++) { ?>
<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>
<? } ?>
<? 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>
@ -286,7 +287,8 @@
<script type="text/javascript">//<![CDATA[
collageShow.init(<?=json_encode($CollagePages)?>);
//]]></script>
<? }
<?
}
} ?>
<table class="artist_table grouping cats" id="discog_table">
<tr class="colhead_dark">
@ -299,5 +301,5 @@
<?
View::show_footer();
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
$Cache->cache_value("collage_$CollageID", array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
?>

View File

@ -384,7 +384,7 @@
</div>
<? } ?>
<div class="box box_info box_statistics_collage_torrents">
<div class="head"><strong>Stats</strong></div>
<div class="head"><strong>Statistics</strong></div>
<ul class="stats nobullet">
<li>Torrents: <?=number_format($NumGroups)?></li>
<? if (!empty($TopArtists)) { ?>
@ -396,7 +396,7 @@
</ul>
</div>
<div class="box box_tags">
<div class="head"><strong>Top tags</strong></div>
<div class="head"><strong>Top Tags</strong></div>
<div class="pad">
<ol style="padding-left: 5px;">
<?
@ -405,30 +405,30 @@
</ol>
</div>
</div>
<? if (!empty($TopArtists)) { ?>
<? if (!empty($TopArtists)) { ?>
<div class="box box_artists">
<div class="head"><strong>Top artists</strong></div>
<div class="head"><strong>Top Artists</strong></div>
<div class="pad">
<ol style="padding-left: 5px;">
<?
uasort($TopArtists, 'compare');
$i = 0;
foreach ($TopArtists as $ID => $Artist) {
$i++;
if ($i > 10) {
break;
}
uasort($TopArtists, 'compare');
$i = 0;
foreach ($TopArtists as $ID => $Artist) {
$i++;
if ($i > 10) {
break;
}
?>
<li><a href="artist.php?id=<?=$ID?>"><?=$Artist['name']?></a> (<?=number_format($Artist['count'])?>)</li>
<?
}
}
?>
</ol>
</div>
</div>
<? } ?>
<? } ?>
<div class="box box_contributors">
<div class="head"><strong>Top contributors</strong></div>
<div class="head"><strong>Top Contributors</strong></div>
<div class="pad">
<ol style="padding-left: 5px;">
<?
@ -492,7 +492,8 @@
c.AddedTime
FROM comments AS c
LEFT JOIN users_main AS um ON um.ID = c.AuthorID
WHERE c.Page = 'collages' AND c.PageID = $CollageID
WHERE c.Page = 'collages'
AND c.PageID = $CollageID
ORDER BY c.ID DESC
LIMIT 15");
$CommentList = $DB->to_array(false, MYSQLI_NUM);
@ -542,22 +543,23 @@
<?
if ($CollageCovers != 0) { ?>
<div id="coverart" class="box">
<div class="head" id="coverhead"><strong>Cover art</strong></div>
<div class="head" id="coverhead"><strong>Cover Art</strong></div>
<ul class="collage_images" id="collage_page0">
<?
$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>
@ -565,7 +567,8 @@
<script type="text/javascript">//<![CDATA[
collageShow.init(<?=json_encode($CollagePages)?>);
//]]></script>
<? }
<?
}
} ?>
<table class="torrent_table grouping cats" id="discog_table">
<tr class="colhead_dark">
@ -584,5 +587,5 @@
<?
View::show_footer();
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
$Cache->cache_value("collage_$CollageID", array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
?>

View File

@ -52,12 +52,12 @@ function get_fls() {
m.LastAccess,
i.SupportFor
FROM users_info AS i
JOIN users_main AS m ON m.ID=i.UserID
JOIN permissions AS p ON p.ID=m.PermissionID
JOIN users_main AS m ON m.ID = i.UserID
JOIN permissions AS p ON p.ID = m.PermissionID
JOIN users_levels AS l ON l.UserID = i.UserID
WHERE l.PermissionID = ' . FLS_TEAM . '
ORDER BY m.Username');
$FLS = $DB->to_array(false, MYSQLI_BOTH, array(3,'Paranoia'));
$FLS = $DB->to_array(false, MYSQLI_BOTH, array(3, 'Paranoia'));
$Cache->cache_value('fls', $FLS, 180);
}
return $FLS;
@ -70,12 +70,13 @@ function get_fls() {
* @return string the text of the generated SQL query
*/
function generate_staff_query($StaffLevel) {
global $Classes;
if ($StaffLevel == 'forum_staff') {
$PName = ''; // only needed for full staff
$PLevel = 'p.Level < 700';
$PLevel = 'p.Level < ' . $Classes[MOD]['Level'];
} elseif ($StaffLevel == 'staff') {
$PName = 'p.Name,';
$PLevel = 'p.Level >= 700';
$PLevel = 'p.Level >= ' . $Classes[MOD]['Level'];
}
$SQL = "
@ -88,15 +89,15 @@ function generate_staff_query($StaffLevel) {
m.LastAccess,
i.SupportFor
FROM users_main AS m
JOIN users_info AS i ON m.ID=i.UserID
JOIN permissions AS p ON p.ID=m.PermissionID
WHERE p.DisplayStaff='1'
JOIN users_info AS i ON m.ID = i.UserID
JOIN permissions AS p ON p.ID = m.PermissionID
WHERE p.DisplayStaff = '1'
AND $PLevel
ORDER BY p.Level";
if (check_perms('users_mod')) {
$SQL.= ', m.LastAccess ASC';
$SQL .= ', m.LastAccess ASC';
} else {
$SQL.= ', m.Username';
$SQL .= ', m.Username';
}
return $SQL;
}
@ -112,13 +113,13 @@ function get_forum_staff() {
if (!check_perms('users_mod')) {
if (($ForumStaff = $Cache->get_value('forum_staff')) === false) {
$DB->query(generate_staff_query('forum_staff'));
$ForumStaff = $DB->to_array(false, MYSQLI_BOTH, array(3,'Paranoia'));
$ForumStaff = $DB->to_array(false, MYSQLI_BOTH, array(3, 'Paranoia'));
$Cache->cache_value('forum_staff', $ForumStaff, 180);
}
} else {
if (($ForumStaff = $Cache->get_value('forum_staff_mod_view')) === false) {
$DB->query(generate_staff_query('forum_staff'));
$ForumStaff = $DB->to_array(false, MYSQLI_BOTH, array(3,'Paranoia'));
$ForumStaff = $DB->to_array(false, MYSQLI_BOTH, array(3, 'Paranoia'));
$Cache->cache_value('forum_staff_mod_view', $ForumStaff, 180);
}
}
@ -136,13 +137,13 @@ function get_staff() {
if (!check_perms('users_mod')) {
if (($Staff = $Cache->get_value('staff')) === false) {
$DB->query(generate_staff_query('staff'));
$Staff = $DB->to_array(false, MYSQLI_BOTH, array(4,'Paranoia'));
$Staff = $DB->to_array(false, MYSQLI_BOTH, array(4, 'Paranoia'));
$Cache->cache_value('staff', $Staff, 180);
}
} else {
if (($Staff = $Cache->get_value('staff_mod_view')) === false) {
$DB->query(generate_staff_query('staff'));
$Staff = $DB->to_array(false, MYSQLI_BOTH, array(4,'Paranoia'));
$Staff = $DB->to_array(false, MYSQLI_BOTH, array(4, 'Paranoia'));
$Cache->cache_value('staff_mod_view', $Staff, 180);
}
}

View File

@ -52,28 +52,28 @@
}
switch ($CurrentOrder) {
case 'username' :
case 'username':
$OrderBy = "um.Username";
break;
case 'email' :
case 'email':
$OrderBy = "um.Email";
break;
case 'joined' :
case 'joined':
$OrderBy = "ui.JoinDate";
break;
case 'lastseen' :
case 'lastseen':
$OrderBy = "um.LastAccess";
break;
case 'uploaded' :
case 'uploaded':
$OrderBy = "um.Uploaded";
break;
case 'downloaded' :
case 'downloaded':
$OrderBy = "um.Downloaded";
break;
case 'ratio' :
case 'ratio':
$OrderBy = "(um.Uploaded / um.Downloaded)";
break;
default :
default:
$OrderBy = "um.ID";
break;
}
@ -89,15 +89,15 @@
JoinDate,
LastAccess
FROM users_main as um
LEFT JOIN users_info AS ui ON ui.UserID=um.ID
LEFT JOIN users_info AS ui ON ui.UserID = um.ID
WHERE ui.Inviter = '$UserID'
ORDER BY $OrderBy $CurrentSort");
$Invited = $DB->to_array();
$JSIncludes = "";
$JSIncludes = '';
if (check_perms('users_mod') || check_perms('admin_advanced_user_search')) {
$JSIncludes = "invites";
$JSIncludes = 'invites';
}
View::show_header('Invites', $JSIncludes);