diff --git a/sections/collages/take_delete.php b/sections/collages/take_delete.php index 345ab93f..5d8f895f 100644 --- a/sections/collages/take_delete.php +++ b/sections/collages/take_delete.php @@ -3,24 +3,24 @@ $CollageID = $_POST['collageid']; -if(!is_number($CollageID) || !$CollageID) { +if (!is_number($CollageID) || !$CollageID) { error(404); } $DB->query("SELECT Name, CategoryID, UserID FROM collages WHERE ID='$CollageID'"); list($Name, $CategoryID, $UserID) = $DB->next_record(MYSQLI_NUM, false); -if(!check_perms('site_collages_delete') && $UserID != $LoggedUser['ID']) { +if (!check_perms('site_collages_delete') && $UserID != $LoggedUser['ID']) { error(403); } $Reason = trim($_POST['reason']); -if(!$Reason) { - error("You must enter a reason!"); +if (!$Reason) { + error('You must enter a reason!'); } $DB->query("SELECT GroupID FROM collages_torrents WHERE CollageID='$CollageID'"); -while(list($GroupID) = $DB->next_record()) { +while (list($GroupID) = $DB->next_record()) { $Cache->delete_value('torrents_details_'.$GroupID); $Cache->delete_value('torrent_collages_'.$GroupID); $Cache->delete_value('torrent_collages_personal_'.$GroupID); @@ -35,7 +35,7 @@ $DB->query("UPDATE collages SET Deleted = '1' WHERE ID='$CollageID'"); } -Misc::write_log("Collage ".$CollageID." (".$Name.") was deleted by ".$LoggedUser['Username'].": ".$Reason); +Misc::write_log("Collage $CollageID ($Name) was deleted by ".$LoggedUser['Username'].': '.$Reason); $Cache->delete_value('collage_'.$CollageID); header('Location: collages.php'); diff --git a/sections/reportsv2/ajax_new_report.php b/sections/reportsv2/ajax_new_report.php index 04095a36..9d7d054d 100644 --- a/sections/reportsv2/ajax_new_report.php +++ b/sections/reportsv2/ajax_new_report.php @@ -162,22 +162,24 @@ uploaded by
was reported by for the reason:
-query("SELECT r.ID - FROM reportsv2 AS r - LEFT JOIN torrents AS t ON t.ID=r.TorrentID - WHERE r.Status != 'Resolved' - AND t.GroupID=$GroupID"); +query(" + SELECT r.ID + FROM reportsv2 AS r + LEFT JOIN torrents AS t ON t.ID=r.TorrentID + WHERE r.Status != 'Resolved' + AND t.GroupID=$GroupID"); $GroupOthers = ($DB->record_count() - 1); if ($GroupOthers > 0) { ?>
There 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrents in this group
-query("SELECT t.UserID - FROM reportsv2 AS r - JOIN torrents AS t ON t.ID=r.TorrentID - WHERE r.Status != 'Resolved' - AND t.UserID=$UploaderID"); +query(" + SELECT t.UserID + FROM reportsv2 AS r + JOIN torrents AS t ON t.ID=r.TorrentID + WHERE r.Status != 'Resolved' + AND t.UserID=$UploaderID"); $UploaderOthers = ($DB->record_count() - 1); if ($UploaderOthers > 0) { ?> @@ -186,20 +188,21 @@ query("SELECT DISTINCT req.ID, - req.FillerID, - um.Username, - req.TimeFilled - FROM requests AS req - LEFT JOIN torrents AS t ON t.ID=req.TorrentID - LEFT JOIN reportsv2 AS rep ON rep.TorrentID=t.ID - JOIN users_main AS um ON um.ID=req.FillerID - WHERE rep.Status != 'Resolved' - AND req.TimeFilled > '2010-03-04 02:31:49' - AND req.TorrentID=$TorrentID"); + $DB->query(" + SELECT DISTINCT req.ID, + req.FillerID, + um.Username, + req.TimeFilled + FROM requests AS req + LEFT JOIN torrents AS t ON t.ID=req.TorrentID + LEFT JOIN reportsv2 AS rep ON rep.TorrentID=t.ID + JOIN users_main AS um ON um.ID=req.FillerID + WHERE rep.Status != 'Resolved' + AND req.TimeFilled > '2010-03-04 02:31:49' + AND req.TorrentID=$TorrentID"); $Requests = ($DB->record_count()); if ($Requests > 0) { - while(list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) { + while (list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) { ?>
used this torrent to fill this request @@ -244,44 +247,45 @@ query("SELECT - tg.Name, - tg.ID, - CASE COUNT(ta.GroupID) - WHEN 1 THEN aa.ArtistID - WHEN 0 THEN '0' - ELSE '0' - END AS ArtistID, - CASE COUNT(ta.GroupID) - WHEN 1 THEN aa.Name - WHEN 0 THEN '' - ELSE 'Various Artists' - END AS ArtistName, - tg.Year, - t.Time, - t.Remastered, - t.RemasterTitle, - t.RemasterYear, - t.Media, - t.Format, - t.Encoding, - t.Size, - t.HasCue, - t.HasLog, - t.LogScore, - t.UserID AS UploaderID, - uploader.Username - FROM torrents AS t - LEFT JOIN torrents_group AS tg ON tg.ID=t.GroupID - LEFT JOIN torrents_artists AS ta ON ta.GroupID=tg.ID AND ta.Importance='1' - LEFT JOIN artists_alias AS aa ON aa.AliasID=ta.AliasID - LEFT JOIN users_main AS uploader ON uploader.ID=t.UserID - WHERE t.ID='$ExtraID' - GROUP BY tg.ID"); + $DB->query(" + SELECT + tg.Name, + tg.ID, + CASE COUNT(ta.GroupID) + WHEN 1 THEN aa.ArtistID + WHEN 0 THEN '0' + ELSE '0' + END AS ArtistID, + CASE COUNT(ta.GroupID) + WHEN 1 THEN aa.Name + WHEN 0 THEN '' + ELSE 'Various Artists' + END AS ArtistName, + tg.Year, + t.Time, + t.Remastered, + t.RemasterTitle, + t.RemasterYear, + t.Media, + t.Format, + t.Encoding, + t.Size, + t.HasCue, + t.HasLog, + t.LogScore, + t.UserID AS UploaderID, + uploader.Username + FROM torrents AS t + LEFT JOIN torrents_group AS tg ON tg.ID=t.GroupID + LEFT JOIN torrents_artists AS ta ON ta.GroupID=tg.ID AND ta.Importance='1' + LEFT JOIN artists_alias AS aa ON aa.AliasID=ta.AliasID + LEFT JOIN users_main AS uploader ON uploader.ID=t.UserID + WHERE t.ID='$ExtraID' + GROUP BY tg.ID"); list($ExtraGroupName, $ExtraGroupID, $ExtraArtistID, $ExtraArtistName, $ExtraYear, $ExtraTime, $ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record()); @@ -289,13 +293,12 @@ if ($ExtraGroupName) { if ($ArtistID == 0 && empty($ArtistName)) { - $ExtraLinkName = "$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : "")." [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : "")." ".($ExtraHasLog == '1' ? " (Log: $ExtraLogScore %)" : "")." (".number_format($ExtraSize/(1024*1024), 2)." MB)"; + $ExtraLinkName = "$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')." [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : '').' '.($ExtraHasLog == '1' ? " (Log: $ExtraLogScore %)" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)'; } elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') { - $ExtraLinkName = "Various Artists - $ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : "")." [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : "")." ".($ExtraHasLog == '1' ? " (Log: $ExtraLogScore %)" : "")." (".number_format($ExtraSize/(1024*1024), 2)." MB)"; + $ExtraLinkName = "Various Artists - $ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')." [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : '')." ".($ExtraHasLog == '1' ? " (Log: $ExtraLogScore %)" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)'; } else { - $ExtraLinkName = "$ExtraArtistName - $ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : "")." [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : "")." ".($ExtraHasLog == '1' ? " (Log: $ExtraLogScore %)" : "")." (".number_format($ExtraSize/(1024*1024), 2)." MB)"; + $ExtraLinkName = "$ExtraArtistName - $ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : '')." [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : '').' '.($ExtraHasLog == '1' ? " (Log: $ExtraLogScore %)" : '').' ('.number_format($ExtraSize / (1024 * 1024), 2).' MB)'; } - ?> ')?> @@ -366,7 +369,7 @@ Warning /> + /> - /> + /> @@ -97,9 +99,9 @@ Total Storage: Used Storage: - (%) + (%) Free Storage: - (%) + (%) Cached Scripts: @@ -123,7 +125,7 @@ Hits No scripts cached.'; } $Row = 'a'; // For the pretty colours @@ -142,4 +144,4 @@ ?>
- \ No newline at end of file + diff --git a/sections/tools/data/registration_log.php b/sections/tools/data/registration_log.php index 256a1458..ec1aa62c 100644 --- a/sections/tools/data/registration_log.php +++ b/sections/tools/data/registration_log.php @@ -1,5 +1,7 @@ '".time_minus(3600*24*3)."'"; + $RS .= " i.JoinDate > '".time_minus(3600 * 24 * 3)."'"; } $RS .= " ORDER BY i.Joindate DESC LIMIT $Limit"; $QueryID = $DB->query($RS); @@ -78,7 +87,7 @@ ?> @@ -94,7 +103,7 @@ Registered next_record()) { + while (list($UserID, $IP, $IPCC, $Email, $Username, $PermissionID, $Uploaded, $Downloaded, $Enabled, $Donor, $Warned, $Joined, $Uses, $InviterID, $InviterIP, $InviterIPCC, $InviterEmail, $InviterUsername, $InviterPermissionID, $InviterUploaded, $InviterDownloaded, $InviterEnabled, $InviterDonor, $InviterWarned, $InviterJoined, $InviterUses) = $DB->next_record()) { $Row = ($IP == $InviterIP) ? 'a' : 'b'; ?> @@ -120,15 +129,20 @@
-
+ +
+ + - +

There have been no new registrations in the past 72 hours.

- diff --git a/sections/tools/data/service_stats.php b/sections/tools/data/service_stats.php index 720278ab..7df07b84 100644 --- a/sections/tools/data/service_stats.php +++ b/sections/tools/data/service_stats.php @@ -1,11 +1,13 @@ flush(); } $DB->query('SHOW GLOBAL STATUS'); -$DBStats =$DB->to_array('Variable_name'); +$DBStats = $DB->to_array('Variable_name'); $MemStats = $Cache->getStats(); View::show_header("Service Stats"); @@ -22,11 +24,11 @@ Threads (Active) Cache: - (100.000%) + (100.000%) - 0.7) { echo ' class="invalid" '; } ?>>Database: - (%) + 0.7) { echo ' class="invalid" '; } ?>>Database: + (%) Connections @@ -49,8 +51,8 @@ - 0.85) { echo ' class="invalid" title="Evictions begin when storage exceeds 85%" '; } ?>>Cache Storage: - (%) + 0.85) { echo ' class="invalid" title="Evictions begin when storage exceeds 85%" '; } ?>>Cache Storage: + (%) Utilities @@ -88,66 +90,66 @@ Database: - + Get/Select (Success) - >Cache: - (%) + >Cache: + (%) Database: - (100.000%) + (100.000%) Set/Insert (Success) Cache: - (100.000%) + (100.000%) Database: - (100.000%) + (100.000%) Increment/Decrement (Success) - >Cache Increment: - (%) + >Cache Increment: + (%) - >Cache Decrement: - (%) + >Cache Decrement: + (%) CAS/Update (Success) - 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 unnecessary 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: - ( 0) { echo number_format(($MemStats['cas_hits']/($MemStats['cas_hits']+$MemStats['cas_misses']))*100, 3); } else { echo '0.000'; }?>%) + 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: + ( 0) { echo number_format(($MemStats['cas_hits'] / ($MemStats['cas_hits'] + $MemStats['cas_misses'])) * 100, 3); } else { echo '0.000'; }?>%) Database: - (100.000%) + (100.000%) Deletes (Success) - >Cache: - (%) + >Cache: + (%) Database: - (100.000%) + (100.000%) Special - $MemStats['uptime']/7*24*3600) { echo ' class="invalid" title="Flushing the cache on a regular basis defeats the benefits of it, look into using cache transactions, or deletes instead of global flushing where possible." '; } ?>>Cache Flushes: + $MemStats['uptime'] / 7 * 24 * 3600) { echo ' class="invalid" title="Flushing the cache on a regular basis defeats the benefits of it, look into using cache transactions, or deletes instead of global flushing where possible." '; } ?>>Cache Flushes: - 0) { echo ' class="invalid" '; } ?>>Cache Evicted: + 0) { echo ' class="invalid" '; } ?>>Cache Evicted: - $DBStats['Questions']['Value']/7500) { echo ' class="invalid" title="1/7500 queries is allowed to be slow to minimize performance impact." '; } ?>>Database Slow: + $DBStats['Questions']['Value'] / 7500) { echo ' class="invalid" title="1/7500 queries is allowed to be slow to minimize performance impact." '; } ?>>Database Slow: @@ -178,100 +180,100 @@ Total Reads - >Cache: - /s + >Cache: + /s Database: - /s + /s Total Writes - >Cache: - /s + >Cache: + /s Database: - /s + /s Get/Select Cache: - /s + /s Database: - /s + /s Set/Insert Cache: - /s + /s Database: - /s + /s Increment/Decrement Cache Increment: - /s + /s Cache Decrement: - /s + /s CAS/Updates Cache: - /s + /s Database: - /s + /s Deletes Cache: - /s + /s Database: - /s + /s Special Cache Flushes: - /s + /s Cache Evicted: - /s + /s Database Slow: - /s + /s Data Read Cache: - /s + /s Database: - /s + /s Data Write Cache: - /s + /s Database: - /s + /s diff --git a/sections/tools/data/torrent_stats.php b/sections/tools/data/torrent_stats.php index 8aa5063c..c9d72363 100644 --- a/sections/tools/data/torrent_stats.php +++ b/sections/tools/data/torrent_stats.php @@ -1,5 +1,7 @@ get_value('new_torrent_stats')) { @@ -32,10 +34,10 @@
  • Total size:
  • Total files:

  • -
  • Mean torrents per user:
  • -
  • Mean torrent size:
  • -
  • Mean files per torrent:
  • -
  • Mean filesize:
  • +
  • Mean torrents per user:
  • +
  • Mean torrent size:
  • +
  • Mean files per torrent:
  • +
  • Mean filesize:
  • @@ -52,17 +54,17 @@
  • Size this week:
  • Files this week:

  • -
  • Torrents per day this week:
  • -
  • Size per day this week:
  • -
  • Files per day this week:
  • +
  • Torrents per day this week:
  • +
  • Size per day this week:
  • +
  • Files per day this week:

  • Torrents this month:
  • Size this month:
  • Files this month:

  • -
  • Torrents per day this month:
  • -
  • Size per day this month:
  • -
  • Files per day this month:
  • +
  • Torrents per day this month:
  • +
  • Size per day this month:
  • +
  • Files per day this month:
  • diff --git a/sections/tools/data/user_flow.php b/sections/tools/data/user_flow.php index 57daf3e7..20179523 100644 --- a/sections/tools/data/user_flow.php +++ b/sections/tools/data/user_flow.php @@ -1,35 +1,37 @@ get_value('users_timeline')) { $DB->query("SELECT DATE_FORMAT(JoinDate,'%b \'%y') AS Month, COUNT(UserID) FROM users_info GROUP BY Month ORDER BY JoinDate DESC LIMIT 1, 12"); $TimelineIn = array_reverse($DB->to_array()); $DB->query("SELECT DATE_FORMAT(BanDate,'%b \'%y') AS Month, COUNT(UserID) FROM users_info GROUP BY Month ORDER BY BanDate DESC LIMIT 1, 12"); $TimelineOut = array_reverse($DB->to_array()); - foreach($TimelineIn as $Month) { + foreach ($TimelineIn as $Month) { list($Label,$Amount) = $Month; if ($Amount > $Max) { $Max = $Amount; } } - foreach($TimelineOut as $Month) { + foreach ($TimelineOut as $Month) { list($Label,$Amount) = $Month; if ($Amount > $Max) { $Max = $Amount; } } - foreach($TimelineIn as $Month) { + foreach ($TimelineIn as $Month) { list($Label,$Amount) = $Month; $Labels[] = $Label; - $InFlow[] = number_format(($Amount/$Max)*100,4); + $InFlow[] = number_format(($Amount / $Max) * 100, 4); } - foreach($TimelineOut as $Month) { + foreach ($TimelineOut as $Month) { list($Label,$Amount) = $Month; - $OutFlow[] = number_format(($Amount/$Max)*100,4); + $OutFlow[] = number_format(($Amount / $Max) * 100, 4); } - $Cache->cache_value('users_timeline',array($Labels,$InFlow,$OutFlow,$Max),mktime(0,0,0,date('n')+1,2)); + $Cache->cache_value('users_timeline',array($Labels,$InFlow,$OutFlow,$Max),mktime(0,0,0,date('n') + 1,2)); } } //End timeline generation @@ -38,7 +40,8 @@ define('DAYS_PER_PAGE', 100); list($Page,$Limit) = Format::page_limit(DAYS_PER_PAGE); -$RS = $DB->query("SELECT +$RS = $DB->query(" + SELECT SQL_CALC_FOUND_ROWS j.Date, DATE_FORMAT(j.Date,'%Y-%m') AS Month, @@ -102,14 +105,14 @@ $DB->set_query_id($RS); ?>
    - +
    User Flow vs. Time
    @@ -124,7 +127,7 @@ Net Growth next_record()) { + while (list($Date, $Month, $Joined, $Manual, $Ratio, $Inactivity) = $DB->next_record()) { $TotalOut = $Ratio + $Inactivity + $Manual; $TotalGrowth = $Joined - $TotalOut; ?> diff --git a/sections/tools/managers/bans.php b/sections/tools/managers/bans.php index 31ac5e2f..8a19df4c 100644 --- a/sections/tools/managers/bans.php +++ b/sections/tools/managers/bans.php @@ -130,7 +130,7 @@ next_record()) { +while (list($ID, $Start, $End, $Reason) = $DB->next_record()) { $Row = ($Row === 'a' ? 'b' : 'a'); $Start=long2ip($Start); $End=long2ip($End); diff --git a/sections/tools/managers/eb_alter.php b/sections/tools/managers/eb_alter.php index a399b2ed..5284cba0 100644 --- a/sections/tools/managers/eb_alter.php +++ b/sections/tools/managers/eb_alter.php @@ -1,32 +1,43 @@ query('DELETE FROM email_blacklist WHERE ID='.$_POST['id']); } else { //Edit & Create, Shared Validation $Val->SetFields('email', '1','string','The email must be set', array('minlength'=>1)); $Val->SetFields('comment', '0','string','The description has a max length of 255 characters', array('maxlength'=>255)); - $Err=$Val->ValidateForm($_POST); // Validate the form - if($Err){ error($Err); } + $Err = $Val->ValidateForm($_POST); // Validate the form + if ($Err) { + error($Err); + } - $P=array(); - $P=db_array($_POST); // Sanitize the form + $P = array(); + $P = db_array($_POST); // Sanitize the form - if($_POST['submit'] == 'Edit'){ //Edit - if(!is_number($_POST['id']) || $_POST['id'] == ''){ error(0); } - $DB->query("UPDATE email_blacklist SET - Email='$P[email]', - Comment='$P[comment]', - UserID='$LoggedUser[ID]', - Time='".sqltime()."' + if ($_POST['submit'] == 'Edit') { //Edit + if (!is_number($_POST['id']) || $_POST['id'] == '') { + error(0); + } + $DB->query(" + UPDATE email_blacklist + SET + Email='$P[email]', + Comment='$P[comment]', + UserID='$LoggedUser[ID]', + Time='".sqltime()."' WHERE ID='$P[id]'"); } else { //Create - $DB->query("INSERT INTO email_blacklist - (Email, Comment, UserID, Time) VALUES - ('$P[email]','$P[comment]','$LoggedUser[ID]','".sqltime()."')"); + $DB->query(" + INSERT INTO email_blacklist (Email, Comment, UserID, Time) + VALUES + ('$P[email]','$P[comment]','$LoggedUser[ID]','".sqltime()."')"); } } diff --git a/sections/tools/managers/official_tags.php b/sections/tools/managers/official_tags.php index 5c320207..8acbdad7 100644 --- a/sections/tools/managers/official_tags.php +++ b/sections/tools/managers/official_tags.php @@ -1,5 +1,7 @@ query("SELECT t.ID FROM tags AS t WHERE t.Name LIKE '".$TagName."'"); list($TagID) = $DB->next_record(); - if($TagID) { + if ($TagID) { $DB->query("UPDATE tags SET TagType = 'genre' WHERE ID = $TagID"); } else { // Tag doesn't exist yet - create tag $DB->query("INSERT INTO tags (Name, UserID, TagType, Uses) VALUES ('".$TagName."', ".$LoggedUser['ID'].", 'genre', 0)"); @@ -36,7 +40,7 @@

    Official Tags Manager

    -
    +
    @@ -44,17 +48,17 @@ - - - + + + - - - + + + - - - + + + to_array(); for ($i = 0; $i < $TagCount / 3; $i++) { list($TagID1, $TagName1, $TagUses1) = $Tags[$i]; - list($TagID2, $TagName2, $TagUses2) = $Tags[ceil($TagCount/3) + $i]; - list($TagID3, $TagName3, $TagUses3) = $Tags[2*ceil($TagCount/3) + $i]; + list($TagID2, $TagName2, $TagUses2) = $Tags[ceil($TagCount / 3) + $i]; + list($TagID3, $TagName3, $TagUses3) = $Tags[2 * ceil($TagCount / 3) + $i]; ?> - - + + - + - - + - - + - - + + - - + +
    RemoveTagUsesRemoveTagUses    RemoveTagUsesRemoveTagUses    RemoveTagUsesRemoveTagUses
           +        +
    + +
    + +
    diff --git a/sections/tools/managers/permissions_list.php b/sections/tools/managers/permissions_list.php index 5b32d3b9..40f20675 100644 --- a/sections/tools/managers/permissions_list.php +++ b/sections/tools/managers/permissions_list.php @@ -18,24 +18,30 @@ function confirmDelete(id) {
    query("SELECT p.ID,p.Name,p.Level,p.Secondary,COUNT(u.ID)+COUNT(DISTINCT l.UserID) +$DB->query("SELECT + p.ID, + p.Name, + p.Level, + p.Secondary, + COUNT(u.ID)+COUNT(DISTINCT l.UserID) FROM permissions AS p - LEFT JOIN users_main AS u ON u.PermissionID=p.ID - LEFT JOIN users_levels AS l ON l.PermissionID=p.ID - GROUP BY p.ID ORDER BY p.Secondary ASC, p.Level ASC"); -if($DB->record_count()) { + LEFT JOIN users_main AS u ON u.PermissionID=p.ID + LEFT JOIN users_levels AS l ON l.PermissionID=p.ID + GROUP BY p.ID + ORDER BY p.Secondary ASC, p.Level ASC"); +if ($DB->record_count()) { ?> - + -next_record()) { ?> +next_record()) { ?> - +
    Name LevelUser CountUser count Actions
    Edit @@ -44,9 +50,11 @@ function confirmDelete(id) {
    - +

    There are no permission classes.

    - +
    $URLRegex)); $Err = $Val->ValidateForm($_POST); // Validate the form -if($Err){ // if something didn't validate +if ($Err) { // if something didn't validate error($Err); header('Location: '.$_SERVER['HTTP_REFERER']); exit; @@ -24,9 +24,9 @@ // Get torrent ID $URLRegex = '/torrents\.php\?id=([0-9]+)$/i'; preg_match($URLRegex, $URL, $Matches); -$GroupID=$Matches[1]; +$GroupID = $Matches[1]; -if(empty($GroupID) || !is_number($GroupID)) { +if (empty($GroupID) || !is_number($GroupID)) { error(404); } diff --git a/sections/tools/managers/recommend_list.php b/sections/tools/managers/recommend_list.php index d334717b..ce1723d8 100644 --- a/sections/tools/managers/recommend_list.php +++ b/sections/tools/managers/recommend_list.php @@ -1,18 +1,19 @@ query("SELECT - tr.GroupID, - tr.UserID, - tg.Name, - tg.ArtistID, - ag.Name +$DB->query(" + SELECT + tr.GroupID, + tr.UserID, + tg.Name, + tg.ArtistID, + ag.Name FROM torrents_recommended AS tr - JOIN torrents_group AS tg ON tg.ID=tr.GroupID - LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID + JOIN torrents_group AS tg ON tg.ID=tr.GroupID + LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID ORDER BY tr.Time DESC LIMIT 10 "); @@ -20,7 +21,7 @@