[pmwiki-devel] Pagelist count problem

Hans design5 at softflow.co.uk
Sun May 13 05:00:55 CDT 2007

Saturday, May 12, 2007, 10:52:19 PM, Hans wrote on other list:

> In foxforum.zip the foxforum.php script has a function FoxBreakPageList
> to create a breakpage display of a pagelist of pages with forum posts.
> This will display a number of pages, set by a $PostsPerPage variable,
> and a series of links to the other "subpages".
> The function also calculates the parameters for count=$From..$To of
> the pagelist.
> This works for the ForumX version which uses one page per post.
> The pagelist uses fmt=#include to display the posts for one topic.

I am just looking at how to generalise the function, so it could be
used as a recipe for any pagelist to be broken into parts.
But I am finding one big problem:

The BreakPageList function needs an accurate count of the pages
the pagelist displays. How can I get that in  a general solution?
(:pagelist .... fmt=count :) is no help here as it only displays the
count, but this can't be used in a function.

For the forum I use

$FoxPageCount = count(ListPages("/^$page-\\d*$/"));

which counts specific pages in the group, specified by a name pattern.
This is no use in a general solution, where we don't know what kind of
pages pagelist lists.

Is there a method to get an accurate pagelist count for use in a
function called by markup which will determine the pagelist output by
specifying the variables used in  (:pagelist .....  count=$From..$To:)


More information about the pmwiki-devel mailing list