Browse Source

#declare(strict_types=1);

biotorrents 4 months ago
parent
commit
24ef500b33
55 changed files with 91 additions and 83 deletions
  1. 1
    0
      classes/artists.class.php
  2. 1
    1
      classes/autoenable.class.php
  3. 1
    0
      classes/bencode.class.php
  4. 1
    0
      classes/bencodedecode.class.php
  5. 1
    0
      classes/bencodetorrent.class.php
  6. 1
    0
      classes/bookmarks.class.php
  7. 0
    5
      classes/browse.class.php
  8. 1
    0
      classes/charts.class.php
  9. 1
    0
      classes/collages.class.php
  10. 1
    0
      classes/comments.class.php
  11. 1
    0
      classes/commentsview.class.php
  12. 1
    0
      classes/debug.class.php
  13. 1
    1
      classes/donations.class.php
  14. 1
    0
      classes/donationsview.class.php
  15. 1
    0
      classes/env.class.php
  16. 1
    0
      classes/format.class.php
  17. 1
    0
      classes/forums.class.php
  18. 1
    0
      classes/image.class.php
  19. 1
    0
      classes/inbox.class.php
  20. 1
    0
      classes/invite_tree.class.php
  21. 1
    0
      classes/lockedaccounts.class.php
  22. 1
    0
      classes/mass_user_bookmarks_editor.class.php
  23. 1
    0
      classes/mass_user_torrents_editor.class.php
  24. 1
    0
      classes/misc.class.php
  25. 1
    0
      classes/paranoia.class.php
  26. 1
    0
      classes/permissions.class.php
  27. 1
    0
      classes/proxies.class.php
  28. 1
    0
      classes/reports.class.php
  29. 1
    0
      classes/revisionhistory.class.php
  30. 1
    0
      classes/revisionhistoryview.class.php
  31. 1
    0
      classes/sitehistory.class.php
  32. 1
    0
      classes/sitehistoryview.class.php
  33. 1
    0
      classes/slaves.class.php
  34. 1
    0
      classes/sphinxql.class.php
  35. 1
    0
      classes/sphinxqlquery.class.php
  36. 1
    0
      classes/sphinxqlresult.class.php
  37. 1
    0
      classes/subscriptions.class.php
  38. 1
    0
      classes/tags.class.php
  39. 1
    0
      classes/templates.class.php
  40. 1
    0
      classes/testing.class.php
  41. 1
    0
      classes/testingview.class.php
  42. 1
    0
      classes/time.class.php
  43. 1
    0
      classes/top10view.class.php
  44. 1
    0
      classes/torrentsdl.class.php
  45. 1
    0
      classes/tracker.class.php
  46. 1
    0
      classes/twofa.class.php
  47. 1
    0
      classes/u2f.class.php
  48. 1
    0
      classes/useragent.class.php
  49. 1
    0
      classes/userrank.class.php
  50. 1
    0
      classes/validate.class.php
  51. 1
    0
      classes/zip.class.php
  52. 1
    0
      design/views/page.php
  53. 39
    44
      gazelle.sql
  54. 1
    0
      rules.php
  55. 0
    32
      sections/stats/users.php

+ 1
- 0
classes/artists.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Artists
4 5
 {

+ 1
- 1
classes/autoenable.class.php View File

@@ -1,6 +1,6 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3
-# todo: Check strict equality gently
4 4
 class AutoEnable
5 5
 {
6 6
     // Constants for database values

+ 1
- 0
classes/bencode.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * If we're running a 32bit PHP version, we use small objects to store ints.

+ 1
- 0
classes/bencodedecode.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * The decode class is simple and straightforward. The only thing to

+ 1
- 0
classes/bencodetorrent.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 # todo: Replace this with https://github.com/OPSnet/bencode-torrent
4 5
 

+ 1
- 0
classes/bookmarks.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Bookmarks
4 5
 {

+ 0
- 5
classes/browse.class.php View File

@@ -1,5 +0,0 @@
1
-<?php
2
-
3
-class Browse
4
-{
5
-}

+ 1
- 0
classes/charts.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class GOOGLE_CHARTS
4 5
 {

+ 1
- 0
classes/collages.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Collages
4 5
 {

+ 1
- 0
classes/comments.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Comments
4 5
 {

+ 1
- 0
classes/commentsview.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class CommentsView
4 5
 {

+ 1
- 0
classes/debug.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 // Debug info for developers
4 5
 ini_set('max_execution_time', 600);

+ 1
- 1
classes/donations.class.php View File

@@ -8,7 +8,7 @@ class Donations
8 8
 {
9 9
     private static $IsSchedule = false;
10 10
 
11
-    public static function regular_donate($UserID, $DonationAmount, $Source, $Reason, $Currency = 'EUR')
11
+    public static function regular_donate($UserID, $DonationAmount, $Source, $Reason, $Currency = 'USD')
12 12
     {
13 13
         self::donate(
14 14
             $UserID,

+ 1
- 0
classes/donationsview.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class DonationsView
4 5
 {

+ 1
- 0
classes/env.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * ENV

+ 1
- 0
classes/format.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Format
4 5
 {

+ 1
- 0
classes/forums.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Forums
4 5
 {

+ 1
- 0
classes/image.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 if (!extension_loaded('gd')) {
4 5
     error('GD Extension not loaded.');

+ 1
- 0
classes/inbox.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Inbox
4 5
 {

+ 1
- 0
classes/invite_tree.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class INVITE_TREE
4 5
 {

+ 1
- 0
classes/lockedaccounts.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * Class to manage locked accounts

+ 1
- 0
classes/mass_user_bookmarks_editor.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 //require_once 'mass_user_torrents_editor.class.php';
4 5
 

+ 1
- 0
classes/mass_user_torrents_editor.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * Abstract class

+ 1
- 0
classes/misc.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Misc
4 5
 {

+ 1
- 0
classes/paranoia.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 // Note: at the time this file is loaded, check_perms is not defined.
4 5
 // Don't call check_paranoia in /classes/script_start.php without ensuring check_perms has been defined

+ 1
- 0
classes/permissions.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Permissions
4 5
 {

+ 1
- 0
classes/proxies.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 // Useful: http://www.robtex.com/cnet/
4 5
 $AllowedProxies = array(

+ 1
- 0
classes/reports.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Reports
4 5
 {

+ 1
- 0
classes/revisionhistory.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class RevisionHistory
4 5
 {

+ 1
- 0
classes/revisionhistoryview.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class RevisionHistoryView
4 5
 {

+ 1
- 0
classes/sitehistory.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class SiteHistory
4 5
 {

+ 1
- 0
classes/sitehistoryview.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class SiteHistoryView
4 5
 {

+ 1
- 0
classes/slaves.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Slaves
4 5
 {

+ 1
- 0
classes/sphinxql.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 if (!extension_loaded('mysqli')) {
4 5
     error('Mysqli Extension not loaded.');

+ 1
- 0
classes/sphinxqlquery.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class SphinxqlQuery
4 5
 {

+ 1
- 0
classes/sphinxqlresult.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class SphinxqlResult
4 5
 {

+ 1
- 0
classes/subscriptions.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Subscriptions
4 5
 {

+ 1
- 0
classes/tags.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * Tags Class

+ 1
- 0
classes/templates.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 // Example :
4 5
 // $TPL = new TEMPLATE;

+ 1
- 0
classes/testing.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Testing
4 5
 {

+ 1
- 0
classes/testingview.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class TestingView
4 5
 {

+ 1
- 0
classes/time.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 if (!extension_loaded('date')) {
4 5
     error('Date extension not loaded.');

+ 1
- 0
classes/top10view.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class Top10View
4 5
 {

+ 1
- 0
classes/torrentsdl.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * Class for functions related to the features involving torrent downloads

+ 1
- 0
classes/tracker.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 // TODO: Turn this into a class with nice functions like update_user, delete_torrent, etc.
4 5
 class Tracker

+ 1
- 0
classes/twofa.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class TwoFactorAuth
4 5
 {

+ 1
- 0
classes/u2f.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 # https://github.com/Yubico/php-u2flib-server/blob/master/src/u2flib_server/U2F.php
4 5
 

+ 1
- 0
classes/useragent.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class UserAgent
4 5
 {

+ 1
- 0
classes/userrank.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 class UserRank
4 5
 {

+ 1
- 0
classes/validate.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /**
4 5
  * Validate

+ 1
- 0
classes/zip.class.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 /*************************************************************************|
4 5
 |--------------- Zip class -----------------------------------------------|

+ 1
- 0
design/views/page.php View File

@@ -1,4 +1,5 @@
1 1
 <?php
2
+#declare(strict_types=1);
2 3
 
3 4
 $ENV = ENV::go();
4 5
 

+ 39
- 44
gazelle.sql View File

@@ -103,7 +103,7 @@ CREATE TABLE `artists_group` (
103 103
   `ArtistID` int NOT NULL AUTO_INCREMENT,
104 104
   `Name` varchar(255) NOT NULL DEFAULT '',
105 105
   `ORCiD` varchar(20) NOT NULL DEFAULT '', -- todo
106
-  `RevisionID` int DEFAULT NULL, -- todo: 12 vs. 10?
106
+  `RevisionID` int DEFAULT NULL,
107 107
   `LastCommentID` int NOT NULL DEFAULT '0',
108 108
   PRIMARY KEY (`ArtistID`,`Name`),
109 109
   KEY `RevisionID` (`RevisionID`)
@@ -179,7 +179,7 @@ CREATE TABLE `bookmarks_torrents` (
179 179
   `UserID` int NOT NULL,
180 180
   `GroupID` int NOT NULL,
181 181
   `Time` datetime,
182
-  `Sort` int NOT NULL DEFAULT '0', -- todo: 11 vs. 10?
182
+  `Sort` int NOT NULL DEFAULT '0',
183 183
   UNIQUE KEY `groups_users` (`GroupID`,`UserID`),
184 184
   KEY `UserID` (`UserID`),
185 185
   KEY `GroupID` (`GroupID`)
@@ -567,7 +567,7 @@ CREATE TABLE `log` (
567 567
 
568 568
 -- 2020-03-09
569 569
 CREATE TABLE `misc` (
570
-  `ID` int NOT NULL AUTO_INCREMENT, -- todo: 11 vs. 10?
570
+  `ID` int NOT NULL AUTO_INCREMENT,
571 571
   `Name` varchar(64) NOT NULL,
572 572
   `First` text,
573 573
   `Second` text,
@@ -590,7 +590,7 @@ CREATE TABLE `news` (
590 590
 
591 591
 -- 2020-03-09
592 592
 CREATE TABLE `new_info_hashes` (
593
-  `TorrentID` int NOT NULL, -- todo: 11 vs. 10?
593
+  `TorrentID` int NOT NULL,
594 594
   `InfoHash` binary(20) DEFAULT NULL,
595 595
   PRIMARY KEY (`TorrentID`),
596 596
   KEY `InfoHash` (`InfoHash`)
@@ -601,8 +601,8 @@ CREATE TABLE `ocelot_query_times` (
601 601
   `buffer` enum('users','torrents','snatches','peers') NOT NULL,
602 602
   `starttime` datetime,
603 603
   `ocelotinstance` datetime,
604
-  `querylength` int NOT NULL, -- todo: 11 vs. 10?
605
-  `timespent` int NOT NULL, -- todo
604
+  `querylength` int NOT NULL,
605
+  `timespent` int NOT NULL,
606 606
   UNIQUE KEY `starttime` (`starttime`)
607 607
 ) ENGINE=InnoDB CHARSET=utf8mb4;
608 608
 
@@ -623,7 +623,7 @@ CREATE TABLE `permissions` (
623 623
 
624 624
 -- 2020-03-09
625 625
 CREATE TABLE `pm_conversations` (
626
-  `ID` int NOT NULL AUTO_INCREMENT, -- todo: 12 vs. 10?
626
+  `ID` int NOT NULL AUTO_INCREMENT,
627 627
   `Subject` varchar(255) DEFAULT NULL,
628 628
   PRIMARY KEY (`ID`)
629 629
 ) ENGINE=InnoDB CHARSET=utf8mb4;
@@ -631,14 +631,14 @@ CREATE TABLE `pm_conversations` (
631 631
 -- 2020-03-09
632 632
 CREATE TABLE `pm_conversations_users` (
633 633
   `UserID` int NOT NULL DEFAULT '0',
634
-  `ConvID` int NOT NULL DEFAULT '0', -- todo: 12 vs. 10?
634
+  `ConvID` int NOT NULL DEFAULT '0',
635 635
   `InInbox` enum('1','0') NOT NULL,
636 636
   `InSentbox` enum('1','0') NOT NULL,
637 637
   `SentDate` datetime,
638 638
   `ReceivedDate` datetime,
639 639
   `UnRead` enum('1','0') NOT NULL DEFAULT '1',
640 640
   `Sticky` enum('1','0') NOT NULL DEFAULT '0',
641
-  `ForwardedTo` int NOT NULL DEFAULT '0', -- todo: 12 vs. 10?
641
+  `ForwardedTo` int NOT NULL DEFAULT '0',
642 642
   PRIMARY KEY (`UserID`,`ConvID`),
643 643
   KEY `InInbox` (`InInbox`),
644 644
   KEY `InSentbox` (`InSentbox`),
@@ -652,8 +652,8 @@ CREATE TABLE `pm_conversations_users` (
652 652
 
653 653
 -- 2020-03-09
654 654
 CREATE TABLE `pm_messages` (
655
-  `ID` int NOT NULL AUTO_INCREMENT, -- todo: 12 vs. 10?
656
-  `ConvID` int NOT NULL DEFAULT '0', -- todo
655
+  `ID` int NOT NULL AUTO_INCREMENT,
656
+  `ConvID` int NOT NULL DEFAULT '0',
657 657
   `SentDate` datetime,
658 658
   `SenderID` int NOT NULL DEFAULT '0',
659 659
   `Body` text,
@@ -809,14 +809,14 @@ CREATE TABLE `site_history` (
809 809
 
810 810
 -- 2020-03-09
811 811
 CREATE TABLE `slaves` (
812
-  `UserID` int NOT NULL DEFAULT '0', -- todo: 11 vs. 10?
813
-  `OwnerID` int NOT NULL DEFAULT '0', -- todo
812
+  `UserID` int NOT NULL DEFAULT '0',
813
+  `OwnerID` int NOT NULL DEFAULT '0',
814 814
   PRIMARY KEY (`UserID`)
815 815
 ) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_swedish_ci;
816 816
 
817 817
 -- 2020-03-09
818 818
 CREATE TABLE `sphinx_a` (
819
-  `gid` int DEFAULT NULL, -- todo: 11 vs. 10?
819
+  `gid` int DEFAULT NULL,
820 820
   `aname` text,
821 821
   KEY `gid` (`gid`)
822 822
 ) ENGINE=InnoDB CHARSET=utf8mb4;
@@ -859,7 +859,7 @@ CREATE TABLE `sphinx_delta` (
859 859
 -- 2020-03-09
860 860
 CREATE TABLE `sphinx_index_last_pos` (
861 861
   `Type` varchar(16) NOT NULL DEFAULT '', -- todo: 16 vs. 25 vs. 50?
862
-  `ID` int DEFAULT NULL, -- todo: 11 vs. 10?
862
+  `ID` int DEFAULT NULL,
863 863
   PRIMARY KEY (`Type`)
864 864
 ) ENGINE=InnoDB CHARSET=utf8mb4;
865 865
 
@@ -867,8 +867,8 @@ CREATE TABLE `sphinx_index_last_pos` (
867 867
 CREATE TABLE `sphinx_requests` (
868 868
   `ID` int unsigned NOT NULL,
869 869
   `UserID` int unsigned NOT NULL DEFAULT '0',
870
-  `TimeAdded` int unsigned NOT NULL, -- todo: 12 vs. 10?
871
-  `LastVote` int unsigned NOT NULL, -- todo
870
+  `TimeAdded` int unsigned NOT NULL,
871
+  `LastVote` int unsigned NOT NULL,
872 872
   `CategoryID` int NOT NULL,
873 873
   `Title` varchar(255) DEFAULT NULL,
874 874
   `Title2` varchar(255) DEFAULT NULL,
@@ -878,7 +878,7 @@ CREATE TABLE `sphinx_requests` (
878 878
   `CatalogueNumber` varchar(50) NOT NULL,
879 879
   `FillerID` int unsigned NOT NULL DEFAULT '0',
880 880
   `TorrentID` int unsigned NOT NULL DEFAULT '0',
881
-  `TimeFilled` int unsigned NOT NULL, -- todo: 12 vs. 10?
881
+  `TimeFilled` int unsigned NOT NULL,
882 882
   `Visible` binary(1) NOT NULL DEFAULT '1',
883 883
   `Bounty` bigint unsigned NOT NULL DEFAULT '0',
884 884
   `Votes` int unsigned NOT NULL DEFAULT '0',
@@ -897,8 +897,8 @@ CREATE TABLE `sphinx_requests` (
897 897
 CREATE TABLE `sphinx_requests_delta` (
898 898
   `ID` int unsigned NOT NULL,
899 899
   `UserID` int unsigned NOT NULL DEFAULT '0',
900
-  `TimeAdded` int unsigned DEFAULT NULL, -- todo: 12 vs. 10?
901
-  `LastVote` int unsigned DEFAULT NULL, -- todo
900
+  `TimeAdded` int unsigned DEFAULT NULL,
901
+  `LastVote` int unsigned DEFAULT NULL,
902 902
   `CategoryID` tinyint DEFAULT NULL,
903 903
   `Title` varchar(255) DEFAULT NULL,
904 904
   `Title2` varchar(255) DEFAULT NULL,
@@ -908,7 +908,7 @@ CREATE TABLE `sphinx_requests_delta` (
908 908
   `CatalogueNumber` varchar(50) DEFAULT NULL,
909 909
   `FillerID` int unsigned NOT NULL DEFAULT '0',
910 910
   `TorrentID` int unsigned NOT NULL DEFAULT '0',
911
-  `TimeFilled` int unsigned DEFAULT NULL, -- todo: 12 vs. 10?
911
+  `TimeFilled` int unsigned DEFAULT NULL,
912 912
   `Visible` binary(1) NOT NULL DEFAULT '1',
913 913
   `Bounty` bigint unsigned NOT NULL DEFAULT '0',
914 914
   `Votes` int unsigned NOT NULL DEFAULT '0',
@@ -924,14 +924,14 @@ CREATE TABLE `sphinx_requests_delta` (
924 924
 
925 925
 -- 2020-03-09
926 926
 CREATE TABLE `sphinx_t` (
927
-  `id` int NOT NULL, -- todo: 11 vs. 10?
928
-  `gid` int NOT NULL, -- todo
929
-  `uid` int NOT NULL, -- todo
927
+  `id` int NOT NULL,
928
+  `gid` int NOT NULL,
929
+  `uid` int NOT NULL,
930 930
   `size` bigint NOT NULL,
931
-  `snatched` int NOT NULL, -- todo: 11 vs. 10?
932
-  `seeders` int NOT NULL, -- todo
933
-  `leechers` int NOT NULL, -- todo
934
-  `time` int NOT NULL, -- todo
931
+  `snatched` int NOT NULL,
932
+  `seeders` int NOT NULL,
933
+  `leechers` int NOT NULL,
934
+  `time` int NOT NULL,
935 935
   `freetorrent` tinyint NOT NULL,
936 936
   `media` varchar(25) NOT NULL,
937 937
   `container` varchar(25) NOT NULL,
@@ -947,12 +947,12 @@ CREATE TABLE `sphinx_t` (
947 947
 
948 948
 -- 2020-03-09
949 949
 CREATE TABLE `sphinx_tg` (
950
-  `id` int NOT NULL, -- todo: 11 vs. 10?
950
+  `id` int NOT NULL,
951 951
   `name` varchar(255) DEFAULT NULL,
952 952
   `Title2` varchar(255) DEFAULT NULL,
953 953
   `namejp` varchar(255) DEFAULT NULL,
954 954
   `tags` varchar(500) DEFAULT NULL,
955
-  `year` smallint DEFAULT NULL, -- todo: 6 vs. 4?
955
+  `year` smallint DEFAULT NULL,
956 956
   `cnumber` varchar(50) DEFAULT NULL,
957 957
   `studio` varchar(255) DEFAULT NULL,
958 958
   `series` varchar(255) DEFAULT NULL,
@@ -983,15 +983,15 @@ CREATE TABLE `staff_blog_visits` (
983 983
 
984 984
 -- 2020-03-09
985 985
 CREATE TABLE `staff_pm_conversations` (
986
-  `ID` int NOT NULL AUTO_INCREMENT, -- todo: 11 vs. 10?
986
+  `ID` int NOT NULL AUTO_INCREMENT,
987 987
   `Subject` text,
988
-  `UserID` int DEFAULT NULL, -- todo: 11 vs. 10?
988
+  `UserID` int DEFAULT NULL,
989 989
   `Status` enum('Open','Unanswered','Resolved') DEFAULT NULL,
990
-  `Level` int DEFAULT NULL, -- todo: 11 vs. 10?
991
-  `AssignedToUser` int DEFAULT NULL, -- todo
990
+  `Level` int DEFAULT NULL,
991
+  `AssignedToUser` int DEFAULT NULL,
992 992
   `Date` datetime DEFAULT NULL,
993 993
   `Unread` tinyint DEFAULT NULL,
994
-  `ResolverID` int DEFAULT NULL, -- todo: 11 vs. 10?
994
+  `ResolverID` int DEFAULT NULL,
995 995
   PRIMARY KEY (`ID`),
996 996
   KEY `StatusAssigned` (`Status`,`AssignedToUser`),
997 997
   KEY `StatusLevel` (`Status`,`Level`)
@@ -999,17 +999,17 @@ CREATE TABLE `staff_pm_conversations` (
999 999
 
1000 1000
 -- 2020-03-09
1001 1001
 CREATE TABLE `staff_pm_messages` (
1002
-  `ID` int NOT NULL AUTO_INCREMENT, -- todo: 11 vs. 10?
1003
-  `UserID` int DEFAULT NULL, -- todo
1002
+  `ID` int NOT NULL AUTO_INCREMENT,
1003
+  `UserID` int DEFAULT NULL,
1004 1004
   `SentDate` datetime DEFAULT NULL,
1005 1005
   `Message` text,
1006
-  `ConvID` int DEFAULT NULL, -- todo: 11 vs. 10?
1006
+  `ConvID` int DEFAULT NULL,
1007 1007
   PRIMARY KEY (`ID`)
1008 1008
 ) ENGINE=InnoDB CHARSET=utf8mb4;
1009 1009
 
1010 1010
 -- 2020-03-09
1011 1011
 CREATE TABLE `staff_pm_responses` (
1012
-  `ID` int NOT NULL AUTO_INCREMENT, -- todo: 11 vs. 10?
1012
+  `ID` int NOT NULL AUTO_INCREMENT,
1013 1013
   `Message` text,
1014 1014
   `Name` text,
1015 1015
   PRIMARY KEY (`ID`)
@@ -1345,11 +1345,6 @@ CREATE TABLE `users_freeleeches` (
1345 1345
   KEY `Expired_Time` (`Expired`,`Time`)
1346 1346
 ) ENGINE=InnoDB CHARSET=utf8mb4;
1347 1347
 
1348
-CREATE TABLE `users_geodistribution` (
1349
-  `Code` varchar(2) NOT NULL,
1350
-  `Users` int NOT NULL
1351
-) ENGINE=InnoDB CHARSET=utf8mb4;
1352
-
1353 1348
 CREATE TABLE `users_history_emails` (
1354 1349
   `UserID` int NOT NULL,
1355 1350
   `Email` varchar(255) DEFAULT NULL,

+ 1
- 0
rules.php View File

@@ -1,3 +1,4 @@
1 1
 <?php
2
+declare(strict_types=1);
2 3
 
3 4
 require 'classes/script_start.php';

+ 0
- 32
sections/stats/users.php View File

@@ -1,37 +1,5 @@
1 1
 <?php
2 2
 
3
-if (!list($Countries, $Rank, $CountryUsers, $CountryMax, $CountryMin, $LogIncrements) = $Cache->get_value('geodistribution')) {
4
-    $DB->query('
5
-      SELECT Code, Users
6
-      FROM users_geodistribution');
7
-
8
-    $Data = $DB->to_array();
9
-    $Count = $DB->record_count() - 1;
10
-    $CountryMinThreshold = Min($Count, 30);
11
-    $CountryMax = ceil(log(Max(1, $Data[0][1])) / log(2)) + 1;
12
-    $CountryMin = floor(log(Max(1, $Data[$CountryMinThreshold][1])) / log(2));
13
-
14
-    $CountryRegions = array('RS' => array('RS-KM')); // Count Kosovo as Serbia as it doesn't have a TLD
15
-    foreach ($Data as $Key => $Item) {
16
-        list($Country, $UserCount) = $Item;
17
-        $Countries[] = $Country;
18
-        $CountryUsers[] = number_format((((log($UserCount) / log(2)) - $CountryMin) / ($CountryMax - $CountryMin)) * 100, 2);
19
-        $Rank[] = round((1 - ($Key / $Count)) * 100);
20
-
21
-        if (isset($CountryRegions[$Country])) {
22
-            foreach ($CountryRegions[$Country] as $Region) {
23
-                $Countries[] = $Region;
24
-                $Rank[] = end($Rank);
25
-            }
26
-        }
27
-    }
28
-    reset($Rank);
29
-
30
-    for ($i = $CountryMin; $i <= $CountryMax; $i++) {
31
-        $LogIncrements[] = Format::human_format(pow(2, $i));
32
-    }
33
-    $Cache->cache_value('geodistribution', array($Countries, $Rank, $CountryUsers, $CountryMax, $CountryMin, $LogIncrements), 0);
34
-}
35 3
 
36 4
 if (!$ClassDistribution = $Cache->get_value('class_distribution')) {
37 5
     $DB->query("

Loading…
Cancel
Save