diff --git a/.gitignore b/.gitignore index f3041e30..19db4255 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,5 @@ composer.lock www/manual/* !www/manual/index.php config/php/fpm/standardebooks.org-secrets.ini -www/patrons-circle/downloads/months -www/patrons-circle/downloads/subjects +www/bulk-downloads/months +www/bulk-downloads/subjects diff --git a/config/apache/standardebooks.org.conf b/config/apache/standardebooks.org.conf index cdee4c6b..28663ff1 100644 --- a/config/apache/standardebooks.org.conf +++ b/config/apache/standardebooks.org.conf @@ -259,15 +259,15 @@ Define webroot /standardebooks.org/web RewriteRule ^/newsletter/subscriptions/([^/\.]+?)/(confirm|delete)$ /newsletter/subscriptions/$2.php?uuid=$1 [L] # Polls - RewriteRule ^/patrons-circle/polls/([^/\.]+)$ /patrons-circle/polls/get.php?pollurlname=$1 [L] - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes/new$ /patrons-circle/polls/votes/new.php?pollurlname=$1 [L] - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes/([0-9]+)$ /patrons-circle/polls/votes/get.php?pollurlname=$1&userid=$2 [L] + RewriteRule ^/polls/([^/\.]+)$ /polls/get.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes/new$ /polls/votes/new.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes/([0-9]+)$ /polls/votes/get.php?pollurlname=$1&userid=$2 [L] RewriteCond expr "tolower(%{REQUEST_METHOD}) =~ /^get$/" - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes$ /patrons-circle/polls/votes/index.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes$ /polls/votes/index.php?pollurlname=$1 [L] RewriteCond expr "tolower(%{REQUEST_METHOD}) =~ /^post$/" - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes$ /patrons-circle/polls/votes/post.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes$ /polls/votes/post.php?pollurlname=$1 [L] # Feeds # Rewrite old links to feeds @@ -281,9 +281,10 @@ Define webroot /standardebooks.org/web DBDriver mysql DBDParams "dbname=se user=www-data" # HTTP Basic Auth configuration for: - # /patrons-circle/downloads + # /bulk-downloads # /feeds - + # /polls/votes (we will allow access to view results at /polls/votes/index.php further down) + AuthType Basic AuthName "Enter your Patrons Circle email address and leave the password empty." Require valid-user @@ -307,15 +308,23 @@ Define webroot /standardebooks.org/web " - # Specific config for /patrons-circle/downloads - + # Specific config for /bulk-downloads + # Disable HTTP Basic auth for the index and 401 pages Require all granted - ErrorDocument 401 /patrons-circle/downloads + ErrorDocument 401 /bulk-downloads + + + + # Specific config for /polls/votes + + + # Disable HTTP Basic auth for the index page + Require all granted diff --git a/config/apache/standardebooks.test.conf b/config/apache/standardebooks.test.conf index 41744f34..4085714b 100644 --- a/config/apache/standardebooks.test.conf +++ b/config/apache/standardebooks.test.conf @@ -241,15 +241,15 @@ Define webroot /standardebooks.org/web RewriteRule ^/newsletter/subscriptions/([^/\.]+?)/(confirm|delete)$ /newsletter/subscriptions/$2.php?uuid=$1 [L] # Polls - RewriteRule ^/patrons-circle/polls/([^/\.]+)$ /patrons-circle/polls/get.php?pollurlname=$1 [L] - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes/new$ /patrons-circle/polls/votes/new.php?pollurlname=$1 [L] - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes/([0-9]+)$ /patrons-circle/polls/votes/get.php?pollurlname=$1&userid=$2 [L] + RewriteRule ^/polls/([^/\.]+)$ /polls/get.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes/new$ /polls/votes/new.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes/([0-9]+)$ /polls/votes/get.php?pollurlname=$1&userid=$2 [L] RewriteCond expr "tolower(%{REQUEST_METHOD}) =~ /^get$/" - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes$ /patrons-circle/polls/votes/index.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes$ /polls/votes/index.php?pollurlname=$1 [L] RewriteCond expr "tolower(%{REQUEST_METHOD}) =~ /^post$/" - RewriteRule ^/patrons-circle/polls/([^/\.]+)/votes$ /patrons-circle/polls/votes/post.php?pollurlname=$1 [L] + RewriteRule ^/polls/([^/\.]+)/votes$ /polls/votes/post.php?pollurlname=$1 [L] # Feeds # Rewrite old links to feeds @@ -263,9 +263,10 @@ Define webroot /standardebooks.org/web DBDriver mysql DBDParams "dbname=se user=www-data" # HTTP Basic Auth configuration for: - # /patrons-circle/downloads + # /bulk-downloads # /feeds - + # /polls/votes (we will allow access to view results at /polls/votes/index.php further down) + AuthType Basic AuthName "Enter your Patrons Circle email address and leave the password empty." Require valid-user @@ -289,15 +290,23 @@ Define webroot /standardebooks.org/web " - # Specific config for /patrons-circle/downloads - + # Specific config for /bulk-downloads + # Disable HTTP Basic auth for the index and 401 pages Require all granted - ErrorDocument 401 /patrons-circle/downloads + ErrorDocument 401 /bulk-downloads + + + + # Specific config for /polls/votes + + + # Disable HTTP Basic auth for the index page + Require all granted diff --git a/lib/Poll.php b/lib/Poll.php index 575a2416..89a3387d 100644 --- a/lib/Poll.php +++ b/lib/Poll.php @@ -28,7 +28,7 @@ class Poll extends PropertiesBase{ protected function GetUrl(): string{ if($this->_Url === null){ - $this->_Url = '/patrons-circle/polls/' . $this->UrlName; + $this->_Url = '/polls/' . $this->UrlName; } return $this->_Url; diff --git a/scripts/generate-bulk-downloads b/scripts/generate-bulk-downloads index c0e6a981..2795bd97 100755 --- a/scripts/generate-bulk-downloads +++ b/scripts/generate-bulk-downloads @@ -119,7 +119,7 @@ $types = ['epub', 'epub-advanced', 'azw3', 'kepub', 'xhtml']; foreach($ebooksByMonth as $month => $ebooks){ foreach($types as $type){ $filename = 'se-ebooks-' . $month . '-' . $type . '.zip'; - $filePath = $webRoot . '/patrons-circle/downloads/months/' . $month . '/' . $filename; + $filePath = $webRoot . '/bulk-downloads/months/' . $month . '/' . $filename; // If the file doesn't exist, or if the content.opf last updated time is newer than the file modification time if(!file_exists($filePath) || filemtime($filePath) < $lastUpdatedTimestampsByMonth[$month]){ @@ -134,7 +134,7 @@ foreach($ebooksBySubject as $subject => $ebooks){ foreach($types as $type){ $urlSafeSubject = Formatter::MakeUrlSafe($subject); $filename = 'se-ebooks-' . $urlSafeSubject . '-' . $type . '.zip'; - $filePath = $webRoot . '/patrons-circle/downloads/subjects/' . $urlSafeSubject . '/'. $filename; + $filePath = $webRoot . '/bulk-downloads/subjects/' . $urlSafeSubject . '/'. $filename; // If the file doesn't exist, or if the content.opf last updated time is newer than the file modification time if(!file_exists($filePath) || filemtime($filePath) < $lastUpdatedTimestampsBySubject[$subject]){ diff --git a/templates/FeedHowTo.php b/templates/FeedHowTo.php index 53c825ab..24c91411 100644 --- a/templates/FeedHowTo.php +++ b/templates/FeedHowTo.php @@ -7,7 +7,7 @@
  • Join the Patrons Circle by making a donation to get access to all of our ebook feeds for the duration of your gift.

  • Produce an ebook for Standard Ebooks to get lifetime access to our ebook feeds. If you’ve already done that, contact us to enable your access.

  • -

    To access a feed, when prompted enter the email address you used to make your donation or on the S.E. mailing list, and leave the password field blank.

    +

    To access a feed, when prompted enter your email address and leave the password field blank.

    Organizations and projects

    diff --git a/templates/Footer.php b/templates/Footer.php index 4435f112..20890c2a 100644 --- a/templates/Footer.php +++ b/templates/Footer.php @@ -20,7 +20,7 @@ GitHub
  • - Bulk downloads + Bulk downloads
  • Ebook Feeds diff --git a/www/patrons-circle/downloads/index.php b/www/bulk-downloads/index.php similarity index 95% rename from www/patrons-circle/downloads/index.php rename to www/bulk-downloads/index.php index 89d35dfd..32a2b80c 100644 --- a/www/patrons-circle/downloads/index.php +++ b/www/bulk-downloads/index.php @@ -29,7 +29,7 @@ try{ catch(Safe\Exceptions\ApcuException $ex){ // Nothing in the cache, generate the files - $files = glob(WEB_ROOT . '/patrons-circle/downloads/months/*/*.zip'); + $files = glob(WEB_ROOT . '/bulk-downloads/months/*/*.zip'); rsort($files); foreach($files as $file){ @@ -49,7 +49,7 @@ catch(Safe\Exceptions\ApcuException $ex){ } $obj->Month = $date->format('Y-m'); - $obj->Url = '/patrons-circle/downloads/months/' . $obj->Month . '/' . basename($file); + $obj->Url = '/bulk-downloads/months/' . $obj->Month . '/' . basename($file); $obj->Size = Formatter::ToFileSize(filesize($file)); // The count of ebooks in each file is stored as a filesystem attribute @@ -98,12 +98,12 @@ try{ } catch(Safe\Exceptions\ApcuException $ex){ // Nothing in the cache, generate the files - $files = glob(WEB_ROOT . '/patrons-circle/downloads/subjects/*/*.zip'); + $files = glob(WEB_ROOT . '/bulk-downloads/subjects/*/*.zip'); sort($files); foreach($files as $file){ $obj = new stdClass(); - $obj->Url = '/patrons-circle/downloads/' . basename($file); + $obj->Url = '/bulk-downloads/' . basename($file); $obj->Size = Formatter::ToFileSize(filesize($file)); $obj->Updated = new DateTime('@' . filemtime($file)); @@ -160,7 +160,7 @@ catch(Safe\Exceptions\ApcuException $ex){

    Patrons circle members can download zip files containing all of the ebooks that were released in a given month of Standard Ebooks history. You can join the Patrons Circle with a small donation in support of our continuing mission to create free, beautiful digital literature.

    These zip files contain each ebook in every format we offer, and are updated once daily with the latest versions of each ebook.

    -

    If you’re a Patrons Circle member, when prompted enter your email address and leave the password blank to download these files.

    +

    If you’re a Patrons Circle member, when prompted enter your email address and leave the password field blank to download these files.

    Downloads by subject

    diff --git a/www/donate/index.php b/www/donate/index.php index eb6af1d9..3cc58444 100644 --- a/www/donate/index.php +++ b/www/donate/index.php @@ -47,7 +47,7 @@ require_once('Core.php');
  • -

    Access to bulk ebook downloads to easily download entire months’ worth of ebooks at once.

    +

    Access to bulk ebook downloads to easily download entire months’ worth of ebooks at once.

  • The ability to submit a book for inclusion on our Wanted Ebooks list, once per quarter. (Submissions must conform to our collections policy and are subject to approval.)

    @@ -146,7 +146,7 @@ require_once('Core.php');

    Get access to our OPDS, Atom, and RSS ebook feeds for use by your organization for the duration of your sponsorship. We can also produce different kinds of feeds to meet your needs, like ONIX feeds.

  • -

    Get access to bulk ebook downloads to easily download large categories of ebooks, all at once.

    +

    Get access to bulk ebook downloads to easily download large categories of ebooks, all at once.

  • To inquire about sponsorship options, contact the Standard Ebooks Editor-in-Chief.

    diff --git a/www/ebooks/index.php b/www/ebooks/index.php index e35c6399..b79f80d7 100644 --- a/www/ebooks/index.php +++ b/www/ebooks/index.php @@ -151,7 +151,7 @@ catch(Exceptions\InvalidCollectionException $ex){ href="/ebooks/?page=&" rel="next" aria-disabled="true">Next -

    We also have bulk ebook downloads available, as well as ebook catalog feeds for use directly in your ereader app or RSS reader.

    +

    We also have bulk ebook downloads available, as well as ebook catalog feeds for use directly in your ereader app or RSS reader.

    0 && $query == '' && sizeof($tags) == 0 && $collection === null && $page == 1){ ?> diff --git a/www/patrons-circle/index.php b/www/patrons-circle/index.php deleted file mode 100644 index e964abde..00000000 --- a/www/patrons-circle/index.php +++ /dev/null @@ -1,3 +0,0 @@ -End !== null){ ?>

    This poll closes on End->format('F j, Y g:i A') ?>.

    +

    If you’re a Patrons Circle member, when prompted enter your email address and leave the password field blank to vote.

    Vote now View results diff --git a/www/polls/index.php b/www/polls/index.php new file mode 100644 index 00000000..050fcace --- /dev/null +++ b/www/polls/index.php @@ -0,0 +1,40 @@ += End order by Created desc', [], 'Poll'); + +$openPolls = Db::Query('select * from Polls where (End is null or utc_timestamp() <= End) and (Start is null or Start <= utc_timestamp()) order by Created desc', [], 'Poll'); + +?> 'Polls', 'highlight' => '', 'description' => 'The various polls active at Standard Ebooks.']) ?> +

    +
    +

    Polls

    +

    Periodically members of the Standard Ebooks Patrons Circle vote on the next ebook from the Wanted Ebook List to enter immediate production.

    +

    Anyone can join the Patrons Circle by making a small donation in support of our mission of producing beautiful digital literature, for free distribution.

    + 0){ ?> +
    +

    Open polls

    + +
    + + 0){ ?> +
    +

    Past polls

    + +
    + +
    +
    + diff --git a/www/patrons-circle/polls/votes/get.php b/www/polls/votes/get.php similarity index 100% rename from www/patrons-circle/polls/votes/get.php rename to www/polls/votes/get.php diff --git a/www/patrons-circle/polls/votes/index.php b/www/polls/votes/index.php similarity index 100% rename from www/patrons-circle/polls/votes/index.php rename to www/polls/votes/index.php diff --git a/www/patrons-circle/polls/votes/new.php b/www/polls/votes/new.php similarity index 100% rename from www/patrons-circle/polls/votes/new.php rename to www/polls/votes/new.php diff --git a/www/patrons-circle/polls/votes/post.php b/www/polls/votes/post.php similarity index 90% rename from www/patrons-circle/polls/votes/post.php rename to www/polls/votes/post.php index 8be7d858..21b34041 100644 --- a/www/patrons-circle/polls/votes/post.php +++ b/www/polls/votes/post.php @@ -43,7 +43,7 @@ catch(Exceptions\SeException $ex){ // Access via form; 303 redirect to the form, which will emit a 400 BAD REQUEST http_response_code(303); - header('Location: /patrons-circle/polls/' . HttpInput::Str(GET, 'pollurlname', false) . '/votes/new'); + header('Location: /polls/' . HttpInput::Str(GET, 'pollurlname', false) . '/votes/new'); } else{ // Access via REST api; 400 BAD REQUEST