mirror of
https://github.com/standardebooks/web.git
synced 2025-07-20 22:33:57 -04:00
Move items out of the 'patrons-circle' folder into the root
This commit is contained in:
parent
12b79b5dcd
commit
76a4c34688
17 changed files with 95 additions and 39 deletions
|
@ -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){
|
|||
<? } ?>
|
||||
<p><a href="/about#patrons-circle">Patrons circle members</a> can download zip files containing all of the ebooks that were released in a given month of Standard Ebooks history. You can <a href="/donate#patrons-circle">join the Patrons Circle</a> with a small donation in support of our continuing mission to create free, beautiful digital literature.</p>
|
||||
<p>These zip files contain each ebook in every format we offer, and are updated once daily with the latest versions of each ebook.</p>
|
||||
<p>If you’re a Patrons Circle member, when prompted enter your email address and leave the password blank to download these files.</p>
|
||||
<p>If you’re a Patrons Circle member, when prompted enter your email address and leave the password field blank to download these files.</p>
|
||||
|
||||
<section id="downloads-by-subject">
|
||||
<h2>Downloads by subject</h2>
|
|
@ -47,7 +47,7 @@ require_once('Core.php');
|
|||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>Access to <a href="/patrons-circle/downloads">bulk ebook downloads</a> to easily download entire months’ worth of ebooks at once.</p>
|
||||
<p>Access to <a href="/bulk-downloads">bulk ebook downloads</a> to easily download entire months’ worth of ebooks at once.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>The ability to submit a book for inclusion on our <a href="/contribute/wanted-ebooks">Wanted Ebooks list</a>, once per quarter. (Submissions must conform to our <a href="/contribute/collections-policy">collections policy</a> and are subject to approval.)</p>
|
||||
|
@ -146,7 +146,7 @@ require_once('Core.php');
|
|||
<p>Get access to our OPDS, Atom, and RSS <a href="/feeds">ebook feeds</a> for use by your organization for the duration of your sponsorship. We can also produce different kinds of feeds to meet your needs, like <abbr class="acronym">ONIX</abbr> feeds.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Get access to <a href="/patrons-circle/downloads">bulk ebook downloads</a> to easily download large categories of ebooks, all at once.</p>
|
||||
<p>Get access to <a href="/bulk-downloads">bulk ebook downloads</a> to easily download large categories of ebooks, all at once.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>To inquire about sponsorship options, contact the <a href="/about#editor-in-chief">Standard Ebooks Editor-in-Chief</a>.</p>
|
||||
|
|
|
@ -151,7 +151,7 @@ catch(Exceptions\InvalidCollectionException $ex){
|
|||
<a<? if($page < ceil($totalEbooks / $perPage)){ ?> href="/ebooks/?page=<?= $page + 1 ?><? if($queryString != ''){ ?>&<?= $queryString ?><? } ?>" rel="next"<? }else{ ?> aria-disabled="true"<? } ?>>Next</a>
|
||||
</nav>
|
||||
<? } ?>
|
||||
<p class="feeds-alert">We also have <a href="/patrons-circle/downloads">bulk ebook downloads</a> available, as well as <a href="/feeds">ebook catalog feeds</a> for use directly in your ereader app or RSS reader.</p>
|
||||
<p class="feeds-alert">We also have <a href="/bulk-downloads">bulk ebook downloads</a> available, as well as <a href="/feeds">ebook catalog feeds</a> for use directly in your ereader app or RSS reader.</p>
|
||||
<? if(sizeof($ebooks) > 0 && $query == '' && sizeof($tags) == 0 && $collection === null && $page == 1){ ?>
|
||||
<?= Template::ContributeAlert() ?>
|
||||
<? } ?>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<?
|
||||
header('Location: /donate#patrons-circle');
|
||||
exit();
|
|
@ -21,6 +21,7 @@ catch(Exceptions\SeException $ex){
|
|||
<? if($poll->End !== null){ ?>
|
||||
<p class="center-notice">This poll closes on <?= $poll->End->format('F j, Y g:i A') ?>.</p>
|
||||
<? } ?>
|
||||
<p><i>If you’re a Patrons Circle member, when prompted enter your email address and leave the password field blank to vote.</i></p>
|
||||
<p class="button-row narrow">
|
||||
<a href="<?= $poll->Url ?>/votes/new" class="button">Vote now</a>
|
||||
<a href="<?= $poll->Url ?>/votes" class="button">View results</a>
|
40
www/polls/index.php
Normal file
40
www/polls/index.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?
|
||||
require_once('Core.php');
|
||||
|
||||
$pastPolls = Db::Query('select * from Polls where utc_timestamp() >= 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');
|
||||
|
||||
?><?= Template::Header(['title' => 'Polls', 'highlight' => '', 'description' => 'The various polls active at Standard Ebooks.']) ?>
|
||||
<main>
|
||||
<section class="narrow">
|
||||
<h1>Polls</h1>
|
||||
<p>Periodically members of the <a href="/about#patrons-circle">Standard Ebooks Patrons Circle</a> vote on the next ebook from the <a href="/contribute/wanted-ebooks">Wanted Ebook List</a> to enter immediate production.</p>
|
||||
<p>Anyone can <a href="/donate#patrons-circle">join the Patrons Circle</a> by making a small donation in support of our mission of producing beautiful digital literature, for free distribution.</p>
|
||||
<? if(sizeof($openPolls) > 0){ ?>
|
||||
<section id="open-polls">
|
||||
<h2>Open polls</h2>
|
||||
<ul>
|
||||
<? foreach($openPolls as $poll){ ?>
|
||||
<li>
|
||||
<p><a href="<?= $poll->Url ?>"><?= Formatter::ToPlainText($poll->Name) ?></a></p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<? } ?>
|
||||
<? if(sizeof($pastPolls) > 0){ ?>
|
||||
<section id="ended-polls">
|
||||
<h2>Past polls</h2>
|
||||
<ul>
|
||||
<? foreach($pastPolls as $poll){ ?>
|
||||
<li>
|
||||
<p><a href="<?= $poll->Url ?>"><?= Formatter::ToPlainText($poll->Name) ?></a></p>
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<? } ?>
|
||||
</section>
|
||||
</main>
|
||||
<?= Template::Footer() ?>
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue