Skip to content

Commit

Permalink
#20 - Change NextPrev URL to '?page=' instead of "from"
Browse files Browse the repository at this point in the history
  • Loading branch information
Moc committed Sep 27, 2022
1 parent 9946a5d commit 7ae4160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cookbook_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ public function renderOverviewTable($recipes, $parm = array())
$text .= e107::getParser()->parseTemplate($template['start'], true, $sc);

// Nextprev when using Grid overview
if($key == 'overview_grid' && isset($parm['from']))
if($key == 'overview_grid' && isset($parm['page']))
{
$count = count($recipes);
$page = $parm['from'];
$page = $parm['page'];
$perPage = e107::getPlugPref('cookbook', 'gridview_itemspp', 10);
$from = ($page - 1) * $perPage;
$total = ceil($count / $perPage);
Expand Down
4 changes: 2 additions & 2 deletions cookbook_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,13 @@ function sc_grid_nextprev($parm = array())
{
$count = $this->var['recipecount'];

$page = empty($_GET['from']) ? 1 : (int) $_GET['from'];
$page = empty($_GET['page']) ? 1 : (int) $_GET['page'];
$perPage = e107::getPlugPref('cookbook', 'gridview_itemspp', 10);

$from = ($page - 1) * $perPage;
$total = ceil($count / $perPage);
$options = array('type' => 'page', 'navcount' => 4);

return e107::getForm()->pagination(e_REQUEST_SELF.'?from=[FROM]', $total, $page, $perPage, $options);
return e107::getForm()->pagination(e_REQUEST_SELF.'?page=[FROM]', $total, $page, $perPage, $options);
}
}
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
if($overview_format == "overview_grid")
{
$parm = array();
$from = empty($_GET['from']) ? 1 : (int) $_GET['from'];
$page = empty($_GET['page']) ? 1 : (int) $_GET['page'];

$parm['from'] = $from;
$parm['page'] = $page;
}

// Individual recipe
Expand Down

0 comments on commit 7ae4160

Please sign in to comment.