<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi<br>
<br>
Peter Bowers wrote:
<blockquote
 cite="mid:784f80490902232303u17bc8b21yde99c6a52fcb000b@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">On Mon, Feb 23, 2009 at 9:36 PM, Ed W <span
 dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:lists@wildgooses.com">lists@wildgooses.com</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Given
that the goal is to enhance the sitemap.php recipe to support:<br>
    <br>
...<br>
How best should I design my markup so that I can scan for these things.<br>
  </blockquote>
  <div><br>
Use PTVs.&nbsp; The name of the variable is something consistent across all
pages so you can scan for it.&nbsp; If it doesn't exist then you have some
appropriate default chosen.<br>
  </div>
  </div>
</blockquote>
<br>
This seems like a sensible choice - I just thought it seemed at odds
with some of the other page markup, but it does seem simpler at least<br>
&nbsp;<br>
<blockquote
 cite="mid:784f80490902232303u17bc8b21yde99c6a52fcb000b@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Assuming
you recommend instead using pagevars rather than writing vars<br>
to the page file, can you perhaps spend a few seconds explaining the<br>
ReadVar function and how it picks out the pagevars because it's rather<br>
alluding me how it actually functions right now...<br>
  </blockquote>
  <div><br>
Er...&nbsp; Where are you finding the ReadVar function?&nbsp; Do you mean
PageVar()?&nbsp; Why not just use the function as it stands?&nbsp; You can do a
quick CondAuth() ahead of time if you need to check authorizations...<br>
  </div>
  </div>
</blockquote>
<br>
Yes, sorry, PageVar()<br>
<br>
However, my reading of this function is that PageVar uses ReadPage
*iff* the page is a reference to a page in another group (or at least
that's how I read that regexp in the middle).&nbsp; For everything else it's
going to cascade into PageTextVar, which then uses the read function
"RetrieveAuthPage" which respects read authentication.&nbsp; This would
appear to mean that I couldn't read the text vars for pages that don't
have open read permissions?<br>
<br>
<br>
<blockquote
 cite="mid:784f80490902232303u17bc8b21yde99c6a52fcb000b@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <div>If you do need to understand the internals of PageVar or
PageTextVar try putting in some of those echo statements I recommended
earlier, figure out the majority of it, and if you have specific
questions go ahead and post them.<br>
  </div>
  </div>
</blockquote>
<br>
I think I can now see that the key function is just that loop which
does the preg_replace which seems to be slicing out all text vars which
match a pattern<br>
<br>
In my case I guess I can just to an exact regexp match looking for the
stuff I want on each page!<br>
<br>
Q: Are there any meta functions for investigating of any named markup
exists on a given page? ie instead of me hardcoding the regexp to see
if there is any "(:redirect:)" markup on a page is it possible to ask
pmwiki what the redirect markup looks like and if there is any on this
page?<br>
<br>
Thanks<br>
<br>
Ed W<br>
</body>
</html>