[pmwiki-users] using ReadPage (was "rss feed marked up to html")
Maria McKinley
parody at u.washington.edu
Fri May 7 17:38:46 CDT 2010
Patrick R. Michaud wrote:
> On Thu, May 06, 2010 at 11:56:18PM -0700, Maria McKinley wrote:
>> Hello there,
>>
>> See if rephrasing my question helps. I am currently suing this code by Roman:
>>
>> $FeedFmt['rss']['item']['description'] = 'FeedText';
>>
>> function FeedText($pagename, &$page, $tag) {
>> $p = ReadPage($pagename);
>> $content = MarkupToHTML($pagename, $p['text']);
>> return "<$tag><![CDATA[$content]]></$tag>";
>> }
>>
>> I was wondering if there is someway to limit the array that is
>> returned by ReadPage, do that it only pulls the content up to
>>>> div1end<<[[#blogend]]?
>
> Try the following instead:
>
> function FeedText($pagename, &$page, $tag) {
> $text = RetrieveAuthSection($pagename, '##blogend');
> $content = MarkupToHTML($pagename, $text);
> return "<$tag><![CDATA[$content]]></$tag>";
> }
>
> The '##blogend' argument says to read from the beginning of the page
> to just before the line containing the [[#blogend]] marker. See
> http://www.pmwiki.org/wiki/PmWiki/IncludeOtherPages for more information
> about the section specifications.
>
> This version won't read text from pages that are read-protected;
> if you want to get text even from read-protected pages, then
>
> $text = RetrieveAuthSection($pagename, '##blogend', NULL, 'ALWAYS');
>
> Hope this helps!
>
> Pm
Thanks Patrick,
Worked like a charm! Is there documentation somewhere about what is
allowed in $level for RetrieveAuthPage($pagename, $level,
$authprompt=true, $since=0)?
cheers,
maria
More information about the pmwiki-users
mailing list