MyBB Community Forums

Full Version: Page Numbers ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I was wondering if there was an easy change to have the way the page numbers show?

It always shows the first 5 pages in forums.
[Image: 8a159a8.jpg]

I would also like to add with it showing the last 3 as well.
[Image: 8av75so.jpg]

If someone can give me the code changes need to do this, that would be great.

Thanks in advance Smile
Still looking for help on this.. maybe this is a tuff one to do?

Hope not Sad
Could someone tell me if the changes would be in the showthread.php or forumdisplay.php ?

If i can narrow it down, i may be able to figure it out myself.
I was told by someone that this should be a very easy mod to do, but he has not had enough time yet to take a look at mybb.

However, he is a wizard with phpbb Big Grin
Its in functions.php, the 'multipage()' function.
I actually thought it did that by default?? Either way, it's a good idea.
Thanks a lot LeX.. awesome to here from you m8.

Do you mean the file in the inc/functions.php ?

If so, i am lost.
It seams its coded in a way i do not understand.

How do i get it to list the last 3 page numbers?
I can not copy the existing code and just change the numbers and copy it again from the looks of it.

function multipage($count, $perpage, $page, $url)
{
	global $theme, $templates, $lang, $mybb;

	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;
	}
}

The changes are needed in the above code.. right?

Thanks for responding guys
Still needing help guys.. please do not leave me hanging Sad
Still needing help
Do you have time to help yet LeX- ?

Thanks bro
So I figured I have to make the changes somewhere in there. I get that it's doing a count from the 4th page on to the last...

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;

Is it possible to throw a page handler above this loop for the last page as a URL?

		else
		{
			$to = $pages;
		}
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;
	}

Pages: 1 2