$p = $this->parseVariables($this->fluidbookSettings->gamify_coins_pages);
foreach ($p as $range => $coins) {
$pages = ArrayUtil::parseRange($range);
- foreach ($pages as $page) {
- if ($this->isDoublePage() && $page % 2 === 1 && $page > 1) {
- continue;
+ if ($this->isDoublePage()) {
+ $evenPages = [];
+ foreach ($pages as $page) {
+ if ($page % 2 === 1) {
+ $page--;
+ }
+ $evenPages[] = $page;
}
+ $pages = array_unique($evenPages);
+ }
+
+
+ foreach ($pages as $page) {
$this->config->set('gamifyCoins.visit_page_' . $page, $coins);
}
}