diff --git a/lib/Ebook.php b/lib/Ebook.php index 888e4b5e..35d6e9fc 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -1951,7 +1951,7 @@ class Ebook{ inner join EbookTags et using (EbookId) where et.TagId = ? and et.EbookId != ? - order by RAND() + order by rand() limit ? ', [$relatedTag->TagId, $ebook->EbookId, $count], Ebook::class); } @@ -1960,7 +1960,7 @@ class Ebook{ SELECT * from Ebooks where EbookId != ? - order by RAND() + order by rand() limit ? ', [$ebook->EbookId, $count], Ebook::class); } diff --git a/lib/Enums/ArtworkFilterType.php b/lib/Enums/ArtworkFilterType.php index 0293eaee..ee1231ae 100644 --- a/lib/Enums/ArtworkFilterType.php +++ b/lib/Enums/ArtworkFilterType.php @@ -2,13 +2,30 @@ namespace Enums; enum ArtworkFilterType: string{ - case Admin = 'admin'; // Show all artwork, regardless of status. - case All = 'all'; // Show all artwork, but only approved artwork if the logged-in user is not an admin. - case Approved = 'approved'; // Show all approved artwork. - case ApprovedInUse = 'approved_in_use'; // Show all approved that is in-use. - case ApprovedNotInUse = 'approved_not_in_use'; // Show all approved that is not in-use. - case ApprovedSubmitter = 'approved_submitter'; // Show all approved artwork, plus unverified artwork which the logged-in user has submitted. - case Declined = 'declined'; // Show only declined artwork. - case Unverified = 'unverified'; // Show only unverified artwork. - case UnverifiedSubmitter = 'unverified_submitter'; // Show only unverified artwork that the logged-in user has submitted. + /** Show all artwork, regardless of status. */ + case Admin = 'admin'; + + /** Show all artwork, but only approved artwork if the logged-in user is not an admin. */ + case All = 'all'; + + /** Show all approved artwork. */ + case Approved = 'approved'; + + /** Show all approved that is in-use. */ + case ApprovedInUse = 'approved_in_use'; + + /** Show all approved that is not in-use. */ + case ApprovedNotInUse = 'approved_not_in_use'; + + /** Show all approved artwork, plus unverified artwork which the logged-in user has submitted. */ + case ApprovedSubmitter = 'approved_submitter'; + + /** Show only declined artwork. */ + case Declined = 'declined'; + + /** Show only unverified artwork. */ + case Unverified = 'unverified'; + + /** Show only unverified artwork that the logged-in user has submitted. */ + case UnverifiedSubmitter = 'unverified_submitter'; } diff --git a/lib/Enums/DateTimeFormat.php b/lib/Enums/DateTimeFormat.php index 5312e3e2..000fb314 100644 --- a/lib/Enums/DateTimeFormat.php +++ b/lib/Enums/DateTimeFormat.php @@ -2,11 +2,24 @@ namespace Enums; enum DateTimeFormat: string{ - case Sql = 'Y-m-d H:i:s'; // `2022-01-05 23:42:12` - case Iso = 'Y-m-d\TH:i:s\Z'; // `2022-01-05T23:42:12Z` - case FullDateTime = 'F j, Y g:i a'; // `January 5, 2022 2:04 pm` - case Ical = 'Ymd\THis\Z'; //20220105T234212Z - case Html = 'Y-m-d\TH:i:s'; // `2022-01-05T23:42:12` - case Rss = 'r'; // `D, d M Y H:i:s` + /** Like `2022-01-05 23:42:12`. */ + case Sql = 'Y-m-d H:i:s'; + + /** Like `2022-01-05T23:42:12Z`. */ + case Iso = 'Y-m-d\TH:i:s\Z'; + + /** Like `January 5, 2022 2:04 pm`. */ + case FullDateTime = 'F j, Y g:i a'; + + /** Like `20220105T234212Z`. */ + case Ical = 'Ymd\THis\Z'; + + /** Like `2022-01-05T23:42:12`. */ + case Html = 'Y-m-d\TH:i:s'; + + /** Like `Sat, 5 Jan 2022 23:42:12 +0000`. */ + case Rss = 'r'; + + /** Like `1641426132`. */ case UnixTimestamp = 'U'; } diff --git a/lib/Enums/HttpCode.php b/lib/Enums/HttpCode.php index afa489fe..20d58acd 100644 --- a/lib/Enums/HttpCode.php +++ b/lib/Enums/HttpCode.php @@ -7,8 +7,12 @@ enum HttpCode: int{ case Accepted = 202; case NoContent = 204; - case MovedPermanently = 301; // Permanent redirect - case Found = 302; // Temporary redirect + /** Permanent redirect. */ + case MovedPermanently = 301; + + /** Temporary redirect. */ + case Found = 302; + case SeeOther = 303; case BadRequest = 400;