' . $page . ' (current)'; } $link = _addPageNumber($url, $page); $li = "
  • "; if (!empty($icon)) { $li .= ""; } else { $li .= $page; } $li .= "
  • "; return $li; } function getPagination($total, $link = "", $maxVisible = 10, $infinityScrollGetFromSelector = "", $infinityScrollAppendIntoSelector = "", $loadOnScroll = false, $showOnly = '') { global $global, $advancedCustom; if ($total < 2) { return ''; } $page = getCurrentPage(); if ($total < $page) { $page = $total; } //var_dump($page, $total, getCurrentPage());exit; $isInfiniteScroll = !empty($infinityScrollGetFromSelector) && !empty($infinityScrollAppendIntoSelector); $uid = uniqid(); if ($total < $maxVisible) { $maxVisible = $total; } if (empty($link)) { $link = getSelfURI(); if (preg_match("/(current=[0-9]+)/i", $link, $match)) { $link = str_replace($match[1], "current=_pageNum_", $link); } else { $link .= (parse_url($link, PHP_URL_QUERY) ? '&' : '?') . 'current=_pageNum_'; } } if ($isInfiniteScroll) { $link = addQueryStringParameter($link, 'isInfiniteScroll', getCurrentPage()); } if (!empty($showOnly)) { $link = addQueryStringParameter($link, 'showOnly', $showOnly); } $class = ''; if (!empty($infinityScrollGetFromSelector) && !empty($infinityScrollAppendIntoSelector)) { $class = "infiniteScrollPagination{$uid} hidden"; } if ($isInfiniteScroll && $page > 1) { return ""; } $pag = ' '; if ($isInfiniteScroll) { $content = file_get_contents($global['systemRootPath'] . 'objects/functiongetPagination.php'); $pag .= str_replace( ['$uid', '$webSiteRootURL', '$infinityScrollGetFromSelector', '$infinityScrollAppendIntoSelector', '$loadMore', '$loadOnScroll'], [$uid, $global['webSiteRootURL'], $infinityScrollGetFromSelector, $infinityScrollAppendIntoSelector, __('Load More'), (!empty($loadOnScroll) ? 'true' : 'false')], $content ); } return $pag; }