@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $result = $this->getDb()->prepare(str_format("SELECT id, value AS name FROM {0} WHERE id = ?", $this->getTableName())); |
| 56 | 56 | $result->execute(array($id)); |
| 57 | 57 | if ($post = $result->fetchObject()) { |
| 58 | - return new CustomColumn ($id, $post->name, $this); |
|
| 58 | + return new CustomColumn($id, $post->name, $this); |
|
| 59 | 59 | } |
| 60 | 60 | return NULL; |
| 61 | 61 | } |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | $entryArray = array(); |
| 70 | 70 | while ($post = $result->fetchObject()) { |
| 71 | 71 | $entryPContent = str_format(localize("bookword", $post->count), $post->count); |
| 72 | - $entryPLinkArray = array(new LinkNavigation ($this->getUri($post->id))); |
|
| 72 | + $entryPLinkArray = array(new LinkNavigation($this->getUri($post->id))); |
|
| 73 | 73 | |
| 74 | - $entry = new Entry ($post->name, $this->getEntryId($post->id), $entryPContent, $this->datatype, $entryPLinkArray, "", $post->count); |
|
| 74 | + $entry = new Entry($post->name, $this->getEntryId($post->id), $entryPContent, $this->datatype, $entryPLinkArray, "", $post->count); |
|
| 75 | 75 | |
| 76 | 76 | array_push($entryArray, $entry); |
| 77 | 77 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | while ($post = $result->fetchObject()) |
| 71 | 71 | { |
| 72 | 72 | $entryPContent = str_format(localize("bookword", $post->count), $post->count); |
| 73 | - $entryPLinkArray = array(new LinkNavigation ($this->getUri($post->id))); |
|
| 73 | + $entryPLinkArray = array(new LinkNavigation($this->getUri($post->id))); |
|
| 74 | 74 | |
| 75 | 75 | $entry = new Entry($post->name, $this->getEntryId($post->id), $entryPContent, $this->datatype, $entryPLinkArray, "", $post->count); |
| 76 | 76 | |
@@ -11,18 +11,18 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | abstract class CustomColumnType extends Base |
| 13 | 13 | { |
| 14 | - const ALL_CUSTOMS_ID = "cops:custom"; |
|
| 14 | + const ALL_CUSTOMS_ID = "cops:custom"; |
|
| 15 | 15 | |
| 16 | - const CUSTOM_TYPE_TEXT = "text"; // type 1 + 2 |
|
| 17 | - const CUSTOM_TYPE_COMMENT = "comments"; // type 3 |
|
| 18 | - const CUSTOM_TYPE_SERIES = "series"; // type 4 |
|
| 16 | + const CUSTOM_TYPE_TEXT = "text"; // type 1 + 2 |
|
| 17 | + const CUSTOM_TYPE_COMMENT = "comments"; // type 3 |
|
| 18 | + const CUSTOM_TYPE_SERIES = "series"; // type 4 |
|
| 19 | 19 | const CUSTOM_TYPE_ENUM = "enumeration"; // type 5 |
| 20 | - const CUSTOM_TYPE_DATE = "datetime"; // type 6 |
|
| 21 | - const CUSTOM_TYPE_FLOAT = "float"; // type 7 |
|
| 22 | - const CUSTOM_TYPE_INT = "int"; // type 8 |
|
| 23 | - const CUSTOM_TYPE_RATING = "rating"; // type 9 |
|
| 24 | - const CUSTOM_TYPE_BOOL = "bool"; // type 10 |
|
| 25 | - const CUSTOM_TYPE_COMPOSITE = "composite"; // type 11 + 12 |
|
| 20 | + const CUSTOM_TYPE_DATE = "datetime"; // type 6 |
|
| 21 | + const CUSTOM_TYPE_FLOAT = "float"; // type 7 |
|
| 22 | + const CUSTOM_TYPE_INT = "int"; // type 8 |
|
| 23 | + const CUSTOM_TYPE_RATING = "rating"; // type 9 |
|
| 24 | + const CUSTOM_TYPE_BOOL = "bool"; // type 10 |
|
| 25 | + const CUSTOM_TYPE_COMPOSITE = "composite"; // type 11 + 12 |
|
| 26 | 26 | |
| 27 | 27 | /** @var array[integer]CustomColumnType */ |
| 28 | 28 | private static $customColumnCacheID = array(); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $result->execute(array($this->customId)); |
| 111 | 111 | if ($post = $result->fetchObject()) { |
| 112 | 112 | $json = json_decode($post->display); |
| 113 | - return (isset($json->description) && !empty($json->description)) ? $json->description : NULL; |
|
| 113 | + return (isset($json->description) && !empty($json->description))?$json->description:NULL; |
|
| 114 | 114 | } |
| 115 | 115 | return NULL; |
| 116 | 116 | } |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | // PHP pre 5.6 does not support const arrays |
| 12 | 12 | private $BOOLEAN_NAMES = array( |
| 13 | 13 | -1 => "customcolumn.boolean.unknown", // localize("customcolumn.boolean.unknown") |
| 14 | - 00 => "customcolumn.boolean.no", // localize("customcolumn.boolean.no") |
|
| 15 | - +1 => "customcolumn.boolean.yes", // localize("customcolumn.boolean.yes") |
|
| 14 | + 00 => "customcolumn.boolean.no", // localize("customcolumn.boolean.no") |
|
| 15 | + +1 => "customcolumn.boolean.yes", // localize("customcolumn.boolean.yes") |
|
| 16 | 16 | ); |
| 17 | 17 | |
| 18 | 18 | protected function __construct($pcustomId) |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $entryArray = array(); |
| 61 | 61 | while ($post = $result->fetchObject()) { |
| 62 | 62 | $entryPContent = str_format(localize("bookword", $post->count), $post->count); |
| 63 | - $entryPLinkArray = array(new LinkNavigation ($this->getUri($post->id))); |
|
| 63 | + $entryPLinkArray = array(new LinkNavigation($this->getUri($post->id))); |
|
| 64 | 64 | |
| 65 | 65 | $entry = new Entry(localize($this->BOOLEAN_NAMES[$post->id]), $this->getEntryId($post->id), $entryPContent, $this->datatype, $entryPLinkArray, "", $post->count); |
| 66 | 66 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $id = $date->format("Y-m-d"); |
| 50 | 50 | |
| 51 | 51 | $entryPContent = str_format(localize("bookword", $post->count), $post->count); |
| 52 | - $entryPLinkArray = array(new LinkNavigation ($this->getUri($id))); |
|
| 52 | + $entryPLinkArray = array(new LinkNavigation($this->getUri($id))); |
|
| 53 | 53 | |
| 54 | 54 | $entry = new Entry($date->format(localize("customcolumn.date.format")), $this->getEntryId($id), $entryPContent, $this->datatype, $entryPLinkArray, "", $post->count); |
| 55 | 55 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | public function getCustom($id) |
| 59 | 59 | { |
| 60 | - return new CustomColumn ($id, str_format(localize("customcolumn.stars", $id / 2), $id / 2), $this); |
|
| 60 | + return new CustomColumn($id, str_format(localize("customcolumn.stars", $id / 2), $id / 2), $this); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | protected function getAllCustomValuesFromDatabase() |
@@ -7,55 +7,55 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | // Silly thing because PHP forbid string concatenation in class const |
| 10 | -define ('SQL_BOOKS_LEFT_JOIN', 'left outer join comments on comments.book = books.id |
|
| 10 | +define('SQL_BOOKS_LEFT_JOIN', 'left outer join comments on comments.book = books.id |
|
| 11 | 11 | left outer join books_ratings_link on books_ratings_link.book = books.id |
| 12 | 12 | left outer join ratings on books_ratings_link.rating = ratings.id '); |
| 13 | -define ('SQL_BOOKS_ALL', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' order by books.sort '); |
|
| 14 | -define ('SQL_BOOKS_BY_PUBLISHER', 'select {0} from books_publishers_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 13 | +define('SQL_BOOKS_ALL', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' order by books.sort '); |
|
| 14 | +define('SQL_BOOKS_BY_PUBLISHER', 'select {0} from books_publishers_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 15 | 15 | where books_publishers_link.book = books.id and publisher = ? {1} order by publisher'); |
| 16 | -define ('SQL_BOOKS_BY_FIRST_LETTER', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 16 | +define('SQL_BOOKS_BY_FIRST_LETTER', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 17 | 17 | where upper (books.sort) like ? order by books.sort'); |
| 18 | -define ('SQL_BOOKS_BY_AUTHOR', 'select {0} from books_authors_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 18 | +define('SQL_BOOKS_BY_AUTHOR', 'select {0} from books_authors_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 19 | 19 | left outer join books_series_link on books_series_link.book = books.id |
| 20 | 20 | where books_authors_link.book = books.id and author = ? {1} order by series desc, series_index asc, pubdate asc'); |
| 21 | -define ('SQL_BOOKS_BY_SERIE', 'select {0} from books_series_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 21 | +define('SQL_BOOKS_BY_SERIE', 'select {0} from books_series_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 22 | 22 | where books_series_link.book = books.id and series = ? {1} order by series_index'); |
| 23 | -define ('SQL_BOOKS_BY_TAG', 'select {0} from books_tags_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 23 | +define('SQL_BOOKS_BY_TAG', 'select {0} from books_tags_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 24 | 24 | where books_tags_link.book = books.id and tag = ? {1} order by sort'); |
| 25 | -define ('SQL_BOOKS_BY_LANGUAGE', 'select {0} from books_languages_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 25 | +define('SQL_BOOKS_BY_LANGUAGE', 'select {0} from books_languages_link, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 26 | 26 | where books_languages_link.book = books.id and lang_code = ? {1} order by sort'); |
| 27 | -define ('SQL_BOOKS_BY_CUSTOM', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 27 | +define('SQL_BOOKS_BY_CUSTOM', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 28 | 28 | where {2}.book = books.id and {2}.{3} = ? {1} order by sort'); |
| 29 | -define ('SQL_BOOKS_BY_CUSTOM_BOOL_TRUE', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 29 | +define('SQL_BOOKS_BY_CUSTOM_BOOL_TRUE', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 30 | 30 | where {2}.book = books.id and {2}.value = 1 {1} order by sort'); |
| 31 | -define ('SQL_BOOKS_BY_CUSTOM_BOOL_FALSE', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 31 | +define('SQL_BOOKS_BY_CUSTOM_BOOL_FALSE', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 32 | 32 | where {2}.book = books.id and {2}.value = 0 {1} order by sort'); |
| 33 | -define ('SQL_BOOKS_BY_CUSTOM_BOOL_NULL', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 33 | +define('SQL_BOOKS_BY_CUSTOM_BOOL_NULL', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 34 | 34 | where books.id not in (select book from {2}) {1} order by sort'); |
| 35 | -define ('SQL_BOOKS_BY_CUSTOM_RATING', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 35 | +define('SQL_BOOKS_BY_CUSTOM_RATING', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 36 | 36 | left join {2} on {2}.book = books.id |
| 37 | 37 | left join {3} on {3}.id = {2}.{4} |
| 38 | 38 | where {3}.value = ? order by sort'); |
| 39 | -define ('SQL_BOOKS_BY_CUSTOM_RATING_NULL', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 39 | +define('SQL_BOOKS_BY_CUSTOM_RATING_NULL', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 40 | 40 | left join {2} on {2}.book = books.id |
| 41 | 41 | left join {3} on {3}.id = {2}.{4} |
| 42 | 42 | where ((books.id not in (select {2}.book from {2})) or ({3}.value = 0)) {1} order by sort'); |
| 43 | -define ('SQL_BOOKS_BY_CUSTOM_DATE', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 43 | +define('SQL_BOOKS_BY_CUSTOM_DATE', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 44 | 44 | where {2}.book = books.id and date({2}.value) = ? {1} order by sort'); |
| 45 | -define ('SQL_BOOKS_BY_CUSTOM_DIRECT', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 45 | +define('SQL_BOOKS_BY_CUSTOM_DIRECT', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 46 | 46 | where {2}.book = books.id and {2}.value = ? {1} order by sort'); |
| 47 | -define ('SQL_BOOKS_BY_CUSTOM_DIRECT_ID', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 47 | +define('SQL_BOOKS_BY_CUSTOM_DIRECT_ID', 'select {0} from {2}, books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 48 | 48 | where {2}.book = books.id and {2}.id = ? {1} order by sort'); |
| 49 | -define ('SQL_BOOKS_QUERY', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 49 | +define('SQL_BOOKS_QUERY', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 50 | 50 | where ( |
| 51 | 51 | exists (select null from authors, books_authors_link where book = books.id and author = authors.id and authors.name like ?) or |
| 52 | 52 | exists (select null from tags, books_tags_link where book = books.id and tag = tags.id and tags.name like ?) or |
| 53 | 53 | exists (select null from series, books_series_link on book = books.id and books_series_link.series = series.id and series.name like ?) or |
| 54 | 54 | exists (select null from publishers, books_publishers_link where book = books.id and books_publishers_link.publisher = publishers.id and publishers.name like ?) or |
| 55 | 55 | title like ?) {1} order by books.sort'); |
| 56 | -define ('SQL_BOOKS_RECENT', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 56 | +define('SQL_BOOKS_RECENT', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 57 | 57 | where 1=1 {1} order by timestamp desc limit '); |
| 58 | -define ('SQL_BOOKS_BY_RATING', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 58 | +define('SQL_BOOKS_BY_RATING', 'select {0} from books ' . SQL_BOOKS_LEFT_JOIN . ' |
|
| 59 | 59 | where books_ratings_link.book = books.id and ratings.id = ? {1} order by sort'); |
| 60 | 60 | |
| 61 | 61 | class Book extends Base |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | public $serie = NULL; |
| 106 | 106 | public $tags = NULL; |
| 107 | 107 | public $languages = NULL; |
| 108 | - public $format = array (); |
|
| 108 | + public $format = array(); |
|
| 109 | 109 | |
| 110 | 110 | |
| 111 | 111 | public function __construct($line) { |
@@ -127,24 +127,24 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | public function getEntryId() { |
| 130 | - return self::ALL_BOOKS_UUID.':'.$this->uuid; |
|
| 130 | + return self::ALL_BOOKS_UUID . ':' . $this->uuid; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - public static function getEntryIdByLetter ($startingLetter) { |
|
| 134 | - return self::ALL_BOOKS_ID.':letter:'.$startingLetter; |
|
| 133 | + public static function getEntryIdByLetter($startingLetter) { |
|
| 134 | + return self::ALL_BOOKS_ID . ':letter:' . $startingLetter; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - public function getUri () { |
|
| 138 | - return '?page='.parent::PAGE_BOOK_DETAIL.'&id=' . $this->id; |
|
| 137 | + public function getUri() { |
|
| 138 | + return '?page=' . parent::PAGE_BOOK_DETAIL . '&id=' . $this->id; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - public function getDetailUrl () { |
|
| 141 | + public function getDetailUrl() { |
|
| 142 | 142 | $urlParam = $this->getUri(); |
| 143 | - if (!is_null(GetUrlParam(DB))) $urlParam = addURLParameter($urlParam, DB, GetUrlParam (DB)); |
|
| 143 | + if (!is_null(GetUrlParam(DB))) $urlParam = addURLParameter($urlParam, DB, GetUrlParam(DB)); |
|
| 144 | 144 | return 'index.php' . $urlParam; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - public function getTitle () { |
|
| 147 | + public function getTitle() { |
|
| 148 | 148 | return $this->title; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -153,22 +153,22 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * @return Author[] |
| 155 | 155 | */ |
| 156 | - public function getAuthors () { |
|
| 156 | + public function getAuthors() { |
|
| 157 | 157 | if (is_null($this->authors)) { |
| 158 | 158 | $this->authors = Author::getAuthorByBookId($this->id); |
| 159 | 159 | } |
| 160 | 160 | return $this->authors; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - public function getAuthorsName () { |
|
| 164 | - return implode(', ', array_map(function ($author) { return $author->name; }, $this->getAuthors())); |
|
| 163 | + public function getAuthorsName() { |
|
| 164 | + return implode(', ', array_map(function($author) { return $author->name; }, $this->getAuthors())); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - public function getAuthorsSort () { |
|
| 168 | - return implode(', ', array_map(function ($author) { return $author->sort; }, $this->getAuthors())); |
|
| 167 | + public function getAuthorsSort() { |
|
| 168 | + return implode(', ', array_map(function($author) { return $author->sort; }, $this->getAuthors())); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - public function getPublisher () { |
|
| 171 | + public function getPublisher() { |
|
| 172 | 172 | if (is_null($this->publisher)) { |
| 173 | 173 | $this->publisher = Publisher::getPublisherByBookId($this->id); |
| 174 | 174 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @return Tag[] |
| 208 | 208 | */ |
| 209 | 209 | public function getTags() { |
| 210 | - if (is_null ($this->tags)) { |
|
| 210 | + if (is_null($this->tags)) { |
|
| 211 | 211 | $this->tags = array(); |
| 212 | 212 | |
| 213 | 213 | $result = parent::getDb()->prepare('select tags.id as id, name |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | public function getTagsName() { |
| 228 | - return implode(', ', array_map(function ($tag) { return $tag->name; }, $this->getTags())); |
|
| 228 | + return implode(', ', array_map(function($tag) { return $tag->name; }, $this->getTags())); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | public function getDataById($idData) |
| 279 | 279 | { |
| 280 | - $reduced = array_filter($this->getDatas(), function ($data) use ($idData) { |
|
| 280 | + $reduced = array_filter($this->getDatas(), function($data) use ($idData) { |
|
| 281 | 281 | return $data->id == $idData; |
| 282 | 282 | }); |
| 283 | 283 | return reset($reduced); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | if (empty ($this->pubdate)) { |
| 302 | 302 | return ''; |
| 303 | 303 | } |
| 304 | - $dateY = (int) substr($this->pubdate, 0, 4); |
|
| 304 | + $dateY = (int)substr($this->pubdate, 0, 4); |
|
| 305 | 305 | if ($dateY > 102) { |
| 306 | 306 | return str_pad($dateY, 4, '0', STR_PAD_LEFT); |
| 307 | 307 | } |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | public function getComment($withSerie = true) { |
| 312 | 312 | $addition = ''; |
| 313 | - $se = $this->getSerie (); |
|
| 314 | - if (!is_null ($se) && $withSerie) { |
|
| 313 | + $se = $this->getSerie(); |
|
| 314 | + if (!is_null($se) && $withSerie) { |
|
| 315 | 315 | $addition = $addition . '<strong>' . localize('content.series') . '</strong>' . str_format(localize('content.series.data'), $this->seriesIndex, htmlspecialchars($se->name)) . "<br />\n"; |
| 316 | 316 | } |
| 317 | 317 | if (preg_match('/<\/(div|p|a|span)>/', $this->comment)) |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | public function getDataFormat($format) { |
| 328 | - $reduced = array_filter($this->getDatas(), function ($data) use ($format) { |
|
| 328 | + $reduced = array_filter($this->getDatas(), function($data) use ($format) { |
|
| 329 | 329 | return $data->format == $format; |
| 330 | 330 | }); |
| 331 | 331 | return reset($reduced); |
@@ -346,11 +346,11 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | if ($relative) |
| 348 | 348 | { |
| 349 | - return $this->relativePath.'/'.$file; |
|
| 349 | + return $this->relativePath . '/' . $file; |
|
| 350 | 350 | } |
| 351 | 351 | else |
| 352 | 352 | { |
| 353 | - return $this->path.'/'.$file; |
|
| 353 | + return $this->path . '/' . $file; |
|
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | $epub->Authors($authorArray); |
| 372 | 372 | $epub->Language($this->getLanguages()); |
| 373 | - $epub->Description ($this->getComment(false)); |
|
| 373 | + $epub->Description($this->getComment(false)); |
|
| 374 | 374 | $epub->Subjects($this->getTagsName()); |
| 375 | 375 | $epub->Cover2($this->getFilePath('jpg'), 'image/jpeg'); |
| 376 | 376 | $epub->Calibre($this->uuid); |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $epub->Serie($se->name); |
| 380 | 380 | $epub->SerieIndex($this->seriesIndex); |
| 381 | 381 | } |
| 382 | - if ($config['cops_provide_kepub'] == '1' && preg_match('/Kobo/', $_SERVER['HTTP_USER_AGENT'])) { |
|
| 382 | + if ($config['cops_provide_kepub'] == '1' && preg_match('/Kobo/', $_SERVER['HTTP_USER_AGENT'])) { |
|
| 383 | 383 | $epub->updateForKepub(); |
| 384 | 384 | } |
| 385 | 385 | $epub->download($data->getUpdatedFilenameEpub()); |
@@ -404,11 +404,11 @@ discard block |
||
| 404 | 404 | if (!is_null($width)) { |
| 405 | 405 | $nw = $width; |
| 406 | 406 | if ($nw >= $w) { return false; } |
| 407 | - $nh = ($nw*$h)/$w; |
|
| 407 | + $nh = ($nw * $h) / $w; |
|
| 408 | 408 | } else { |
| 409 | 409 | $nh = $height; |
| 410 | 410 | if ($nh >= $h) { return false; } |
| 411 | - $nw = ($nh*$w)/$h; |
|
| 411 | + $nw = ($nh * $w) / $h; |
|
| 412 | 412 | } |
| 413 | 413 | } else { |
| 414 | 414 | return false; |
@@ -416,16 +416,16 @@ discard block |
||
| 416 | 416 | |
| 417 | 417 | //draw the image |
| 418 | 418 | $src_img = imagecreatefromjpeg($file); |
| 419 | - $dst_img = imagecreatetruecolor($nw,$nh); |
|
| 420 | - imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $nw, $nh, $w, $h);//resizing the image |
|
| 421 | - imagejpeg($dst_img,$outputfile,80); |
|
| 419 | + $dst_img = imagecreatetruecolor($nw, $nh); |
|
| 420 | + imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $nw, $nh, $w, $h); //resizing the image |
|
| 421 | + imagejpeg($dst_img, $outputfile, 80); |
|
| 422 | 422 | imagedestroy($src_img); |
| 423 | 423 | imagedestroy($dst_img); |
| 424 | 424 | |
| 425 | 425 | return true; |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | - public function getLinkArray () |
|
| 428 | + public function getLinkArray() |
|
| 429 | 429 | { |
| 430 | 430 | $linkArray = array(); |
| 431 | 431 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | $serie = $this->getSerie(); |
| 453 | - if (!is_null ($serie)) { |
|
| 453 | + if (!is_null($serie)) { |
|
| 454 | 454 | array_push($linkArray, new LinkNavigation($serie->getUri(), 'related', str_format(localize('content.series.data'), $this->seriesIndex, $serie->name))); |
| 455 | 455 | } |
| 456 | 456 | |
@@ -475,13 +475,13 @@ discard block |
||
| 475 | 475 | $entry = new Entry(localize('allbooks.title'), |
| 476 | 476 | self::ALL_BOOKS_ID, |
| 477 | 477 | str_format(localize('allbooks.alphabetical', $nBooks), $nBooks), 'text', |
| 478 | - array(new LinkNavigation('?page='.parent::PAGE_ALL_BOOKS)), '', $nBooks); |
|
| 478 | + array(new LinkNavigation('?page=' . parent::PAGE_ALL_BOOKS)), '', $nBooks); |
|
| 479 | 479 | array_push($result, $entry); |
| 480 | 480 | if ($config['cops_recentbooks_limit'] > 0) { |
| 481 | 481 | $entry = new Entry(localize('recent.title'), |
| 482 | 482 | self::ALL_RECENT_BOOKS_ID, |
| 483 | 483 | str_format(localize('recent.list'), $config['cops_recentbooks_limit']), 'text', |
| 484 | - array ( new LinkNavigation ('?page='.parent::PAGE_ALL_RECENT_BOOKS)), '', $config['cops_recentbooks_limit']); |
|
| 484 | + array(new LinkNavigation('?page=' . parent::PAGE_ALL_RECENT_BOOKS)), '', $config['cops_recentbooks_limit']); |
|
| 485 | 485 | array_push($result, $entry); |
| 486 | 486 | } |
| 487 | 487 | return $result; |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | public static function getBooks($n) { |
| 580 | - list ($entryArray, $totalNumber) = self::getEntryArray(self::SQL_BOOKS_ALL , array (), $n); |
|
| 580 | + list ($entryArray, $totalNumber) = self::getEntryArray(self::SQL_BOOKS_ALL, array(), $n); |
|
| 581 | 581 | return array($entryArray, $totalNumber); |
| 582 | 582 | } |
| 583 | 583 | |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | { |
| 595 | 595 | array_push($entryArray, new Entry($post->title, Book::getEntryIdByLetter($post->title), |
| 596 | 596 | str_format(localize('bookword', $post->count), $post->count), 'text', |
| 597 | - array(new LinkNavigation('?page='.parent::PAGE_ALL_BOOKS_LETTER.'&id='. rawurlencode($post->title))), '', $post->count)); |
|
| 597 | + array(new LinkNavigation('?page=' . parent::PAGE_ALL_BOOKS_LETTER . '&id=' . rawurlencode($post->title))), '', $post->count)); |
|
| 598 | 598 | } |
| 599 | 599 | return $entryArray; |
| 600 | 600 | } |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | |
| 620 | 620 | public static function getAllRecentBooks() { |
| 621 | 621 | global $config; |
| 622 | - list ($entryArray, ) = self::getEntryArray(self::SQL_BOOKS_RECENT . $config['cops_recentbooks_limit'], array(), -1); |
|
| 622 | + list ($entryArray,) = self::getEntryArray(self::SQL_BOOKS_RECENT . $config['cops_recentbooks_limit'], array(), -1); |
|
| 623 | 623 | return $entryArray; |
| 624 | 624 | } |
| 625 | 625 | |
@@ -634,9 +634,9 @@ discard block |
||
| 634 | 634 | |
| 635 | 635 | foreach ($columns as $lookup) { |
| 636 | 636 | $col = CustomColumnType::createByLookup($lookup); |
| 637 | - if (! is_null($col)) { |
|
| 637 | + if (!is_null($col)) { |
|
| 638 | 638 | $cust = $col->getCustomByBook($this); |
| 639 | - if (! is_null($cust)) { |
|
| 639 | + if (!is_null($cust)) { |
|
| 640 | 640 | array_push($result, $cust); |
| 641 | 641 | } |
| 642 | 642 | } |