MyBB Community Forums

Full Version: Using $multipage in plugin template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,

I would like to use {$multipage} in the "global_first_post" template from "show first post" plugin.

Could somebody tell me where that function is implemented?
Or do I have to modify the plugin instead to make that work?
By the way, I found a way to solve this with css

#first_posts_container ~ .dependent_firstpost {
	display: block;
}
.dependent_firstpost {
	display: none;	
}

So, if first_posts_container is found on the page, the multipage menu will be display block, otherwise it will be display none.

Maybe not the best solution, as the menu will be loaded in the background, but better as nothing. Smile
There's no need to reinvent the wheel Smile
./inc/functions.php is the key file you can use to build the "pagination" in your plugin.
The following function will return a desired {$multipage} variable.

./inc/functions.php - line 1144:
function multipage($count, $perpage, $page, $url, $breadcrumb=false) {
...
}

Just call this function with all appropriate values given by your plugin.

[ETS]
Try {$GLOBALS['multipage']} inside the global_first_post template.