[pmwiki-users] How to list pages that have a page password
Patrick R. Michaud
pmichaud at pobox.com
Thu Apr 10 10:00:36 CDT 2008
On Wed, Apr 09, 2008 at 07:53:24PM -0500, Randy wrote:
> I want to use pagelist to list password-protected pages -
> specifically, where $PasswdRead begins with ****
>
> I can successfully make conditions:
> (:if eq '****' {(substr '{{*$FullName}$PasswdRead}' 0 4)} :) the page
> has a password!
> (:if eq '***X' {(substr '{{*$FullName}$PasswdRead}' 0 4)} :) this line
> should not appear (it just proves the condition isn't always true)
You really don't need {*$FullName} here -- just use {*$PasswdRead}.
It's the '*' that gives us the full name of the current page. Thus:
(:if eq '****' {(substr '{*$PasswdRead}' 0 4)} :) has a password
> But in a pagelist, this fails:
> (:pagelist group=Public if="eq '****' {(substr '{{=*$FullName}
> $PasswdRead}' 0 4)}" :)
The problem here is that {=*$FullName} isn't valid syntax,
as it looks as though you're looking for both the currently
displayed page ('*') and the current page in the pagelist ('=').
But this is also a place where you don't need to explicitly add
$FullName -- just use the '=' directly on the $PasswdRead variable.
Thus:
(:pagelist group=Public if="eq '****' {(substr '{=$PasswdRead}' 0 4)}" :)
Pm
More information about the pmwiki-users
mailing list