[pmwiki-users] FmtPageList undefined
adam overton
a at plus1plus1plus.org
Mon Jul 20 18:26:48 CDT 2009
hi Patrick
thanks for the advice
i just tried it, and my error messages go away, but it's not quite
working.
i've tried it with the code below, which ends up spitting out
something semi-unreadable: ??3P??
(the ?'s are some sort of binary-esque symbol)
# i've tried loading both pagelist.php and stdconfig.php beforehand
(one and then the other)
//include_once('scripts/pagelist.php');
include_once('scripts/stdconfig.php');
$argsx = "group=Test";
$optx = array('o' => $argsx, 'fmt' => 'csv');
$pagelistTest = FmtPageList('$MatchList', $pagename, $optx, 0);
# or using the PowerTools pagelist function:
//$pagelistTest = MxPageList($pagename, "group=Test");
echo $pagelistTest;
this all at the very very bottom of config.php beneath everything as
suggested.
and, something like the following still works fine, running at the
same time:
$FmtPV['$blamtest'] = 'MxPageList($pn, "group=Test")'; # works
perfect, show a csv-list of pages in the group 'Test'
do i need to convert or treat the output? or is pagelist still
looking for something else to load beforehand?
thanks a bunch
adam
On 20 Jul 2009, at 3:50 AM, Patrick R. Michaud wrote:
> On Mon, Jul 20, 2009 at 12:16:28AM -0700, adam overton wrote:
>> Call to undefined function fmtpagelist()
>>
>> i'm guessing that scripts/pagelist.php is being defined after
>> config.php has
>> been loaded. is that correct?
>
> Correct.
>
>> is there a way to be able to use the FmtPageList function within
>> config or one
>> of my own recipes?
>
> In your recipe, do
>
> include_once('scripts/pagelist.php');
>
> Note, however, that pagelist.php may itself depend on other things
> being loaded. The generic "correct" approach is to either handle
> things
> in an action after everything has been loaded (preferred), or else
> force a load of the entire standard configuration with:
>
> include_once('scripts/stdconfig.php');
>
> Pm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090720/ff570cb7/attachment.html
More information about the pmwiki-users
mailing list