01-16-2005, 03:48 PM
I noticed that when on the first page of a multiple page thread or forum it shows « First [1] and the same goes for the end [6] Last ». I know this is not a bug, but it bugged me 
So here is a code change to get rid of the « First and Last » when on the first page and last page.
- - - - - - - - - - - - - - -
Example ..
used to be like .. Pages (6): « First [1] 2 3 4 5 » Last »
with my code it would show as ... Pages (6): [1] 2 3 4 5 » Last »
and if you are on the last page .. Pages (6): « First « 2 3 4 5 [6]
- - - - - - - - - - - - - - -
Code Changes:
Open: inc/functions.php
Find: function multipage
Replace This Code ..
With this code ..
I also changed the style of my multipage pagination too .. check attached image.

So here is a code change to get rid of the « First and Last » when on the first page and last page.
- - - - - - - - - - - - - - -
Example ..
used to be like .. Pages (6): « First [1] 2 3 4 5 » Last »
with my code it would show as ... Pages (6): [1] 2 3 4 5 » Last »
and if you are on the last page .. Pages (6): « First « 2 3 4 5 [6]
- - - - - - - - - - - - - - -
Code Changes:
Open: inc/functions.php
Find: function multipage
Replace This Code ..
Code:
function multipage($count, $perpage, $page, $url)
{
global $settings, $theme, $templates, $lang;
if($count > $perpage)
{
$pages = $count / $perpage;
$pages = ceil($pages);
if($page > 1)
{
$prev = $page - 1;
eval("\\$prevpage = \\"".$templates->get("multipage_prevpage")."\\";");
}
if($page < $pages)
{
$next = $page + 1;
eval("\\$nextpage = \\"".$templates->get("multipage_nextpage")."\\";");
}
$from = ($page>4) ? ($page-4):1;
if($page == $pages)
{
$to = $pages;
}
elseif($page == $pages-1)
{
$to = $page+1;
}
elseif($page == $pages-2)
{
$to = $page+2;
}
elseif($page == $pages-3)
{
$to = $page+3;
}
else
{
$to = $page+4;
}
for($i=$from;$i<=$to;$i++)
{
$plate = "multipage_page".(($i==$page) ? "_current":"");
eval("\\$mppage .= \\"".$templates->get($plate)."\\";");
}
$lang->multipage_pages = sprintf($lang->multipage_pages, $pages);
eval("\\$start = \\"".$templates->get("multipage_start")."\\";");
eval("\\$end = \\"".$templates->get("multipage_end")."\\";");
eval("\\$multipage = \\"".$templates->get("multipage")."\\";");
return $multipage;
}
}With this code ..
Code:
function multipage($count, $perpage, $page, $url)
{
global $settings, $theme, $templates, $lang;
if($count > $perpage)
{
$pages = $count / $perpage;
$pages = ceil($pages);
if($page > 1)
{
$prev = $page - 1;
eval("\\$start = \\"".$templates->get("multipage_start")."\\";");
eval("\\$prevpage = \\"".$templates->get("multipage_prevpage")."\\";");
}
if($page < $pages)
{
$next = $page + 1;
eval("\\$nextpage = \\"".$templates->get("multipage_nextpage")."\\";");
eval("\\$end = \\"".$templates->get("multipage_end")."\\";");
}
$from = ($page>4) ? ($page-4):1;
if($page == $pages)
{
$to = $pages;
}
elseif($page == $pages-1)
{
$to = $page+1;
}
elseif($page == $pages-2)
{
$to = $page+2;
}
elseif($page == $pages-3)
{
$to = $page+3;
}
else
{
$to = $page+4;
}
for($i=$from;$i<=$to;$i++)
{
$plate = "multipage_page".(($i==$page) ? "_current":"");
eval("\\$mppage .= \\"".$templates->get($plate)."\\";");
}
$lang->multipage_pages = sprintf($lang->multipage_pages, $pages);
eval("\\$multipage = \\"".$templates->get("multipage")."\\";");
return $multipage;
}
}I also changed the style of my multipage pagination too .. check attached image.