Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Wanderen

Newbie
  
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Wanderen's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. Переходя на следующие страницы, предыдущие страницы имеют ссылку с пустым href="" https://sumkiplus.ru/sumki/chemodany/chemodany-plastikovye?page=2 И еще можно вручную прописать любой номер страницы ?page=1000 и страница откроется, а должна быть 404-ая. Сам pagination.php <?php // * @copyright OPENCART.PRO 2011 - 2017. // * @forum http://forum.opencart.pro // * @source See SOURCE.txt for source and other copyright. // * @license GNU General Public License version 3; see LICENSE.txt class Pagination { public $total = 0; public $page = 1; public $limit = 20; public $num_links = 5; public $url = ''; public $text_first = '|<'; public $text_last = '>|'; public $text_next = '>'; public $text_prev = '<'; public function render() { $total = $this->total; if ($this->page < 1) { $page = 1; } else { $page = $this->page; } if (!(int)$this->limit) { $limit = 10; } else { $limit = $this->limit; } $num_links = $this->num_links; $num_pages = ceil($total / $limit); $this->url = str_replace('%7Bpage%7D', '{page}', $this->url); $output = '<ul class="pagination">'; if ($page > 1) { $output .= '<li><a href="' . str_replace(array('&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>'; if ($page - 1 === 1) { $output .= '<li><a href="' . str_replace(array('&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>'; } else { $output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>'; } } if ($num_pages > 1) { if ($num_pages <= $num_links) { $start = 1; $end = $num_pages; } else { $start = $page - floor($num_links / 2); $end = $page + floor($num_links / 2); if ($start < 1) { $end += abs($start) + 1; $start = 1; } if ($end > $num_pages) { $start -= ($end - $num_pages); $end = $num_pages; } } for ($i = $start; $i <= $end; $i++) { if ($page == $i) { $output .= '<li class="active"><span>' . $i . '</span></li>'; } elseif($i == 1) { $output .= '<li><a href="' . str_replace('&', '&', rtrim( str_replace('page={page}', '', $tmp_url), '?&')) . '">' . $i . '</a> '; } else { if ($i === 1) { $output .= '<li><a href="' . str_replace('&', '&', rtrim( str_replace('page={page}', '', $tmp_url), '?&')) . '">' . $i . '</a> '; } else { $output .= '<li><a href="' . str_replace('{page}', $i, $this->url) . '">' . $i . '</a>'; } } } } if ($page < $num_pages) { $output .= '<li><a href="' . str_replace('{page}', $page + 1, $this->url) . '">' . $this->text_next . '</a></li>'; $output .= '<li><a href="' . str_replace('{page}', $num_pages, $this->url) . '">' . $this->text_last . '</a></li>'; } $output .= '</ul>'; if ($num_pages > 1) { return $output; } else { return ''; } } }
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.