Commit graph

25 commits

Author SHA1 Message Date
Mike Colagrosso
03ed3c2257 Add Ebook::DownloadUrl for web and feed downloads
This commit adds a rewrite rule for ebook downloads of the form:

```
/ebooks/some-author/some-book/downloads/some-filename.epub
```

to `www/ebooks/download.php`. That file handles the logic of whether to
show a thank you page before beginning the download.

Download URLs in RSS, Atom, and OPDS feeds follow the same pattern, but
they have a query string parameter `?source=feed` to always skip the
thank you page.
2025-04-25 14:31:44 -05:00
Alex Cabal
124e8343fc Completely type hint template functions and switch to named arguments 2025-03-04 20:32:20 -06:00
Alex Cabal
806939ca49 Replace Template::Emit...() functions with more generic function 2024-12-18 13:14:16 -06:00
Alex Cabal
77ce4cc6b4 Make titlecasing in <h1> and page titles consistent 2024-12-13 14:16:39 -06:00
Mike Colagrosso
1ab95df084 Add placeholders for ebooks 2024-12-13 11:46:36 -06:00
Alex Cabal
c65035630f Add public domain day banner 2024-11-27 12:52:37 -06:00
Alex Cabal
b536ebdaee Add blog post for Public Domain Day 2025 2024-11-26 23:14:26 -06:00
Alex Cabal
84f4b2b0bf Add donation drive aside to download page 2024-11-25 12:03:26 -06:00
Alex Cabal
8546039b97 Comment formatting 2024-11-15 21:40:56 -06:00
Alex Cabal
1449148989 Switch logged in user to static typed variable instead of in $GLOBALS 2024-11-10 23:05:31 -06:00
Alex Cabal
c35c47b793 Add DateTimeFormat enum 2024-11-08 16:41:15 -06:00
Alex Cabal
be5574eaec Move enums into their own namespace 2024-11-08 16:34:21 -06:00
Mike Colagrosso
c85db527cf Get ebook from DB for downloads 2024-11-04 13:16:56 -06:00
Mike Colagrosso
2098b265a8 Rename the constructor Ebook::__construct() to static Ebook::FromFilesystem()
Also added `GetFoo()` methods for all the derived properties like `GetUrl()`, `GetHasDownloads()`, etc. Removed that logic from the constructor so that it's reusable in `Ebook::FromFilesystem()` and `Ebook::GetByIdentifier()`
2024-11-04 13:16:56 -06:00
Mike Colagrosso
008ffc8ccd Fix PHPStan errors 2024-06-29 15:27:30 -05:00
Alex Cabal
6af2717773 Fix broken Unix timestamp formatting 2024-06-25 10:51:48 -05:00
Alex Cabal
97821d0dc3 Remove last traces of date functions in favor of DateTimeImmutable 2024-06-13 13:11:42 -05:00
Alex Cabal
a9eab552ab Flesh out some PHPDocs, and consistently name enums 2024-05-14 15:40:56 -05:00
Alex Cabal
70ae877dd8 Bump PHPStan check level to max and add final round of type hints 2024-05-13 10:48:05 -05:00
Alex Cabal
110c091a7b Define some constants to make HTTP input code less wordy 2024-05-12 12:29:30 -05:00
Alex Cabal
ee7c8343dd Convert some constants to enums 2024-05-11 21:51:06 -05:00
Alex Cabal
7cf3148536 Add safe function 2024-03-16 13:39:36 -05:00
Alex Cabal
bb80fb206d Remove dead code path 2024-03-16 13:39:03 -05:00
Alex Cabal
ff8cc6554d Catch exception in download script 2024-02-28 09:04:05 -06:00
Alex Cabal
9437beaee9 Add thank-you page to ebook downloads 2024-02-26 13:34:44 -06:00