mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 06:45:14 -04:00
Define variable
This commit is contained in:
parent
34d00a582d
commit
173386dddf
1 changed files with 2 additions and 1 deletions
|
@ -45,6 +45,7 @@ try{
|
||||||
// Pick a random tag from this ebook, and get ebooks in the same tag
|
// Pick a random tag from this ebook, and get ebooks in the same tag
|
||||||
$carousel = [];
|
$carousel = [];
|
||||||
$ebooks = [];
|
$ebooks = [];
|
||||||
|
$carouselTag = null;
|
||||||
if(sizeof($ebook->Tags) > 0){
|
if(sizeof($ebook->Tags) > 0){
|
||||||
$carouselTag = $ebook->Tags[rand(0, sizeof($ebook->Tags) - 1)];
|
$carouselTag = $ebook->Tags[rand(0, sizeof($ebook->Tags) - 1)];
|
||||||
$ebooks = Library::GetEbooksByTag(strtolower($carouselTag->Name));
|
$ebooks = Library::GetEbooksByTag(strtolower($carouselTag->Name));
|
||||||
|
@ -324,7 +325,7 @@ catch(Exceptions\InvalidEbookException $ex){
|
||||||
|
|
||||||
<? if(sizeof($carousel) > 0){ ?>
|
<? if(sizeof($carousel) > 0){ ?>
|
||||||
<aside id="more-ebooks">
|
<aside id="more-ebooks">
|
||||||
<h2>More free <?= strtolower($carouselTag->Name) ?> ebooks</h2>
|
<h2>More free<? if($carouselTag !== null){ ?> <?= strtolower($carouselTag->Name) ?><? } ?> ebooks</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<? foreach($carousel as $carouselEbook){ ?>
|
<? foreach($carousel as $carouselEbook){ ?>
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue