0){ $queryStringParams['tags'] = $tags; } // If we're passed string values that are the same as the defaults, don't include them in the query string so that we can have cleaner query strings in the navigation footer. if($view != Enums\ViewType::Grid){ $queryStringParams['view'] = $view->value; } if($sort != Enums\EbookSortType::Default){ $queryStringParams['sort'] = $sort->value; } if($perPage !== EBOOKS_PER_PAGE){ $queryStringParams['per-page'] = $perPage; } if($page > 1){ $queryStringParams['page'] = $page; } ksort($queryStringParams); // If all we did was select one tag, redirect the user to `/subjects/` instead of `/ebooks?tag[0]=`. /** @var string $requestUri */ $requestUri = $_SERVER['REQUEST_URI'] ?? ''; if(sizeof($tags) == 1 && $query == '' && preg_match('|^/ebooks|iu', $requestUri)){ unset($queryStringParams['tags']); $queryStringWithoutTags = http_build_query($queryStringParams); $url = '/subjects/' . $tags[0]; if($queryStringWithoutTags != ''){ $url .= '?' . $queryStringWithoutTags; } header('Location: ' . $url); exit(); } // We only have one tag, change the page URL used for back/next links to `/subjects/`. if(sizeof($tags) == 1 && $query == ''){ $pageUrl = '/subjects/' . $tags[0]; unset($queryStringParams['tags']); } $queryString = http_build_query($queryStringParams); unset($queryStringParams['page']); $queryStringWithoutPage = http_build_query($queryStringParams); $canonicalUrl = SITE_URL . $pageUrl; if($queryString != ''){ $canonicalUrl .= '?' . $queryString; } $result = Ebook::GetAllByFilter($query != '' ? $query : null, $tags, $sort, $page, $perPage, Enums\EbookReleaseStatusFilter::All); $ebooks = $result['ebooks']; $totalEbooks = $result['ebooksCount']; $pageTitle = 'Browse Standard Ebooks'; $pageHeader = 'Browse Ebooks'; $pages = ceil($totalEbooks / $perPage); if($page > 1){ $pageTitle .= ', page ' . $page; } if($pages > 0 && $page > $pages){ throw new Exceptions\PageOutOfBoundsException(); } } catch(Exceptions\PageOutOfBoundsException){ $url = '/ebooks?page=' . $pages; if($queryStringWithoutPage != ''){ $url .= '&' . $queryStringWithoutPage; } header('Location: ' . $url); exit(); } ?>

No ebooks matched your filters. You can try different filters, or browse all of our ebooks.

0){ ?>

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

0 && $query == '' && sizeof($tags) == 0 && $page == 1){ ?>