本文整理匯總了PHP中MakePageList函數的典型用法代碼示例。如果您正苦於以下問題:PHP MakePageList函數的具體用法?PHP MakePageList怎麽用?PHP MakePageList使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MakePageList函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: FPLByGroup
function FPLByGroup($pagename, &$matches, $opt)
{
global $FPLByGroupStartFmt, $FPLByGroupEndFmt, $FPLByGroupGFmt, $FPLByGroupIFmt, $FPLByGroupOpt;
SDV($FPLByGroupStartFmt, "<dl class='fplbygroup'>");
SDV($FPLByGroupEndFmt, '</dl>');
SDV($FPLByGroupGFmt, "<dt><a href='\$ScriptUrl/\$Group'>\$Group</a> /</dt>\n");
SDV($FPLByGroupIFmt, "<dd><a href='\$PageUrl'>\$Name</a></dd>\n");
SDVA($FPLByGroupOpt, array('readf' => 0, 'order' => 'name'));
$matches = MakePageList($pagename, array_merge((array) $FPLByGroupOpt, $opt), 0);
if (@$opt['count']) {
array_splice($matches, $opt['count']);
}
if (count($matches) < 1) {
return '';
}
$out = '';
foreach ($matches as $pn) {
$pgroup = FmtPageName($FPLByGroupGFmt, $pn);
if ($pgroup != @$lgroup) {
$out .= $pgroup;
$lgroup = $pgroup;
}
$out .= FmtPageName($FPLByGroupIFmt, $pn);
}
return FmtPageName($FPLByGroupStartFmt, $pagename) . $out . FmtPageName($FPLByGroupEndFmt, $pagename);
}
示例2: BGetWikiPages
function BGetWikiPages($args)
{
$pages = MakePageList('', $args);
$grouplist = array();
foreach ($pages as $page) {
list($group, $name) = explode('.', $page['name']);
$grouplist[] = "({$group}.){$name}";
}
sort($grouplist);
return $grouplist;
}
示例3: FPLGroup
function FPLGroup($pagename, &$matches, $opt)
{
global $FPLGroupStartFmt, $FPLGroupIFmt, $FPLGroupEndFmt, $FPLGroupOpt;
SDV($FPLGroupStartFmt, "<ul class='fplgroup'>");
SDV($FPLGroupEndFmt, "</ul>");
SDV($FPLGroupIFmt, "<li><a href='\$ScriptUrl/\$Group'>\$Group</a></li>");
SDVA($FPLGroupOpt, array('readf' => 0, 'order' => 'name'));
$matches = MakePageList($pagename, array_merge((array) $FPLGroupOpt, $opt));
$out = array();
foreach ($matches as $pc) {
$group = preg_replace('/\\.[^.]+$/', '', $pc['pagename']);
if (@(!$seen[$group]++)) {
$out[] = FmtPageName($FPLGroupIFmt, $pc['pagename']);
if ($opt['count'] && count($out) >= $opt['count']) {
break;
}
}
}
return FmtPageName($FPLGroupStartFmt, $pagename) . implode('', $out) . FmtPageName($FPLGroupEndFmt, $pagename);
}
示例4: HandleFeed
function HandleFeed($pagename, $auth = 'read')
{
global $FeedFmt, $action, $PCache, $FmtV, $ISOTimeFmt, $RSSTimeFmt, $FeedOpt, $FeedDescPatterns, $CategoryGroup, $EntitiesTable;
SDV($ISOTimeFmt, '%Y-%m-%dT%H:%M:%SZ');
SDV($RSSTimeFmt, 'D, d M Y H:i:s \\G\\M\\T');
SDV($FeedDescPatterns, array('/<[^>]*$/' => ' ', '/\\w+$/' => '', '/<[^>]+>/' => ''));
SDVA($FeedCategoryOpt, array('link' => $pagename, 'readf' => 1));
SDVA($FeedTrailOpt, array('trail' => $pagename, 'count' => 10, 'readf' => 1));
$f = $FeedFmt[$action];
$page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
if (!$page) {
Abort("?cannot generate feed");
}
$feedtime = $page['time'];
# determine list of pages to display
if (@($_REQUEST['trail'] || $_REQUEST['group'] || $_REQUEST['link'])) {
$opt['readf'] = 1;
} else {
if ($action == 'dc') {
$opt = array();
} else {
if (preg_match("/^{$CategoryGroup}\\./", $pagename)) {
$opt = $FeedCategoryOpt;
} else {
$opt = $FeedTrailOpt;
}
}
}
if (!$opt) {
PCache($pagename, $page);
$pagelist = array(&$PCache[$pagename]);
} else {
$opt = array_merge($opt, @$_REQUEST);
$pagelist = MakePageList($pagename, $opt);
}
# process list of pages in feed
$rdfseq = '';
foreach ($pagelist as $page) {
$pn = $page['name'];
if (!PageExists($pn)) {
continue;
}
$pl[] = $pn;
if (@$opt['count'] && count($pl) >= $opt['count']) {
break;
}
$rdfseq .= FmtPageName("<rdf:li resource=\"\$PageUrl\" />\n", $pn);
if ($page['time'] > $feedtime) {
$feedtime = $page['time'];
}
}
$pagelist = $pl;
$FmtV['$FeedRDFSeq'] = $rdfseq;
$FmtV['$FeedISOTime'] = gmstrftime($ISOTimeFmt, $feedtime);
$FmtV['$FeedRSSTime'] = gmdate($RSSTimeFmt, $feedtime);
# format start of feed
$out = FmtPageName($f['feed']['_start'], $pagename);
# format feed elements
foreach ($f['feed'] as $k => $v) {
if ($k[0] == '_' || !$v) {
continue;
}
$x = FmtPageName($v, $pagename);
if (!$x) {
continue;
}
$out .= $v[0] == '<' ? $x : "<{$k}>{$x}</{$k}>\n";
}
# format items in feed
if (@$f['feed']['_items']) {
$out .= FmtPageName($f['feed']['_items'], $pagename);
}
foreach ($pagelist as $pn) {
$page =& $PCache[$pn];
$FmtV['$ItemDesc'] = @$page['description'] ? $page['description'] : trim(preg_replace(array_keys($FeedDescPatterns), array_values($FeedDescPatterns), @$page['excerpt']));
$FmtV['$ItemISOTime'] = gmstrftime($ISOTimeFmt, $page['time']);
$out .= FmtPageName($f['item']['_start'], $pn);
foreach ((array) @$f['item'] as $k => $v) {
if ($k[0] == '_' || !$v) {
continue;
}
if (is_callable($v)) {
$out .= $v($pn, $page, $k);
continue;
}
if (strpos($v, '$LastModifiedBy') !== false && !@$page['author']) {
continue;
}
if (strpos($v, '$Category') !== false) {
if (preg_match_all("/(?<=^|,){$CategoryGroup}\\.([^,]+)/", @$page['targets'], $match)) {
foreach ($match[1] as $c) {
$FmtV['$Category'] = $c;
$out .= FmtPageName($v, $pn);
}
}
continue;
}
$x = FmtPageName($v, $pn);
if (!$x) {
continue;
//.........這裏部分代碼省略.........
示例5: FPLTemplatePageList
function FPLTemplatePageList($pagename, &$matches, &$opt){
$matches = array_unique(array_merge((array)$matches, MakePageList($pagename, $opt, 0)));
## count matches before any slicing and save value as template var {$$PageListCount}
$opt['PageListCount'] = count($matches);
}
示例6: FPLTemplate
function FPLTemplate($pagename, &$matches, $opt)
{
global $Cursor, $FPLTemplatePageFmt, $RASPageName, $PageListArgPattern;
SDV($FPLTemplatePageFmt, array('{$FullName}', '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates'));
StopWatch("FPLTemplate begin");
$template = @$opt['template'];
if (!$template) {
$template = @$opt['fmt'];
}
$ttext = RetrieveAuthSection($pagename, $template, $FPLTemplatePageFmt);
$ttext = PVSE(Qualify($RASPageName, $ttext));
## save any escapes
$ttext = MarkupEscape($ttext);
## remove any anchor markups to avoid duplications
$ttext = preg_replace('/\\[\\[#[A-Za-z][-.:\\w]*\\]\\]/', '', $ttext);
## extract portions of template
$tparts = preg_split('/\\(:(template)\\s+(\\w+)\\s*(.*?):\\)/i', $ttext, -1, PREG_SPLIT_DELIM_CAPTURE);
## handle (:template defaults:)
$i = 0;
while ($i < count($tparts)) {
if ($tparts[$i] != 'template') {
$i++;
continue;
}
if ($tparts[$i + 1] != 'defaults' && $tparts[$i + 1] != 'default') {
$i += 4;
continue;
}
$opt = array_merge(ParseArgs($tparts[$i + 2], $PageListArgPattern), $opt);
array_splice($tparts, $i, 3);
}
SDVA($opt, array('class' => 'fpltemplate', 'wrap' => 'div'));
## get the list of pages
$matches = array_values(MakePageList($pagename, $opt, 0));
## extract page subset according to 'count=' parameter
if (@$opt['count']) {
list($r0, $r1) = CalcRange($opt['count'], count($matches));
if ($r1 < $r0) {
$matches = array_reverse(array_slice($matches, $r1 - 1, $r0 - $r1 + 1));
} else {
$matches = array_slice($matches, $r0 - 1, $r1 - $r0 + 1);
}
}
$savecursor = $Cursor;
$pagecount = 0;
$groupcount = 0;
$grouppagecount = 0;
$pseudovars = array('{$$PageCount}' => &$pagecount, '{$$GroupCount}' => &$groupcount, '{$$GroupPageCount}' => &$grouppagecount);
foreach (preg_grep('/^[\\w$]/', array_keys($opt)) as $k) {
if (!is_array($opt[$k])) {
$pseudovars["{\$\${$k}}"] = htmlspecialchars($opt[$k], ENT_NOQUOTES);
}
}
$vk = array_keys($pseudovars);
$vv = array_values($pseudovars);
$lgroup = '';
$out = '';
foreach ($matches as $i => $pn) {
$group = PageVar($pn, '$Group');
if ($group != $lgroup) {
$groupcount++;
$grouppagecount = 0;
$lgroup = $group;
}
$grouppagecount++;
$pagecount++;
$t = 0;
while ($t < count($tparts)) {
if ($tparts[$t] != 'template') {
$item = $tparts[$t];
$t++;
} else {
list($when, $control, $item) = array_slice($tparts, $t + 1, 3);
$t += 4;
if (!$control) {
if ($when == 'first' && $i != 0) {
continue;
}
if ($when == 'last' && $i != count($matches) - 1) {
continue;
}
} else {
if ($when == 'first' || !isset($last[$t])) {
$Cursor['<'] = $Cursor['<'] = (string) @$matches[$i - 1];
$Cursor['='] = $pn;
$Cursor['>'] = $Cursor['>'] = (string) @$matches[$i + 1];
$curr = str_replace($vk, $vv, $control);
$curr = preg_replace('/\\{(=|&[lg]t;)(\\$:?\\w+)\\}/e', "PageVar(\$pn, '\$2', '\$1')", $curr);
if ($when == 'first' && $i > 0 && $last[$t] == $curr) {
continue;
}
$last[$t] = $curr;
}
if ($when == 'last') {
$Cursor['<'] = $Cursor['<'] = $pn;
$Cursor['='] = (string) @$matches[$i + 1];
$Cursor['>'] = $Cursor['>'] = (string) @$matches[$i + 2];
$next = str_replace($vk, $vv, $control);
$next = preg_replace('/\\{(=|&[lg]t;)(\\$:?\\w+)\\}/e', "PageVar(\$pn, '\$2', '\$1')", $next);
if ($next == $last[$t] && $i != count($matches) - 1) {
//.........這裏部分代碼省略.........
示例7: FPLTemplate
function FPLTemplate($pagename, &$matches, $opt)
{
global $Cursor, $FPLFormatOpt, $FPLTemplatePageFmt;
SDV($FPLTemplatePageFmt, array('{$FullName}', '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates'));
$template = @$opt['template'];
if (!$template) {
$template = @$opt['fmt'];
}
list($tname, $qf) = explode('#', $template, 2);
if ($tname) {
$tname = array(MakePageName($pagename, $tname));
} else {
$tname = (array) $FPLTemplatePageFmt;
}
foreach ($tname as $t) {
$t = FmtPageName($t, $pagename);
if (!PageExists($t)) {
continue;
}
if ($qf) {
$t .= "#{$qf}";
}
$ttext = IncludeText($pagename, $t, true);
if (!$qf || strpos($ttext, "[[#{$qf}]]") !== false) {
break;
}
}
## remove any anchor markups to avoid duplications
$ttext = preg_replace('/\\[\\[#[A-Za-z][-.:\\w]*\\]\\]/', '', $ttext);
if (!@$opt['order'] && !@$opt['trail']) {
$opt['order'] = 'name';
}
$matches = array_values(MakePageList($pagename, $opt, 0));
if (@$opt['count']) {
array_splice($matches, $opt['count']);
}
$savecursor = $Cursor;
$pagecount = 0;
$groupcount = 0;
$grouppagecount = 0;
$vk = array('{$PageCount}', '{$GroupCount}', '{$GroupPageCount}');
$vv = array(&$pagecount, &$groupcount, &$grouppagecount);
$lgroup = '';
$out = '';
foreach ($matches as $i => $pn) {
$prev = (string) @$matches[$i - 1];
$next = (string) @$matches[$i + 1];
$Cursor['<'] = $Cursor['<'] = $prev;
$Cursor['='] = $pn;
$Cursor['>'] = $Cursor['>'] = $next;
$group = PageVar($pn, '$Group');
if ($group != $lgroup) {
$groupcount++;
$grouppagecount = 0;
}
$grouppagecount++;
$pagecount++;
$item = str_replace($vk, $vv, $ttext);
$item = preg_replace('/\\{(=|&[lg]t;)(\\$:?\\w+)\\}/e', "PageVar(\$pn, '\$2', '\$1')", $item);
$out .= $item;
$lgroup = $group;
}
$class = preg_replace('/[^-a-zA-Z0-9\\x80-\\xff]/', ' ', @$opt['class']);
$div = $class ? "<div class='{$class}'>" : '<div>';
return $div . MarkupToHTML($pagename, $out, array('escape' => 0)) . '</div>';
}
示例8: FPLTemplate
function FPLTemplate($pagename, &$matches, $opt)
{
global $Cursor, $FPLFormatOpt, $FPLTemplatePageFmt;
SDV($FPLTemplatePageFmt, array('{$FullName}', '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates'));
StopWatch("FPLTemplate begin");
$template = @$opt['template'];
if (!$template) {
$template = @$opt['fmt'];
}
list($tname, $qf) = explode('#', $template, 2);
if ($tname) {
$tname = array(MakePageName($pagename, $tname));
} else {
$tname = (array) $FPLTemplatePageFmt;
}
foreach ($tname as $t) {
$t = FmtPageName($t, $pagename);
if (!PageExists($t)) {
continue;
}
if ($qf) {
$t .= "#{$qf}";
}
$ttext = IncludeText($pagename, $t, true);
if (!$qf || strpos($ttext, "[[#{$qf}]]") !== false) {
break;
}
}
## remove any anchor markups to avoid duplications
$ttext = preg_replace('/\\[\\[#[A-Za-z][-.:\\w]*\\]\\]/', '', $ttext);
## save any escapes
$ttext = MarkupEscape($ttext);
$matches = array_values(MakePageList($pagename, $opt, 0));
if (@$opt['count']) {
array_splice($matches, $opt['count']);
}
$savecursor = $Cursor;
$pagecount = 0;
$groupcount = 0;
$grouppagecount = 0;
$pseudovars = array('{$$PageCount}' => &$pagecount, '{$$GroupCount}' => &$groupcount, '{$$GroupPageCount}' => &$grouppagecount);
foreach (preg_grep('/^[\\w$]/', array_keys($opt)) as $k) {
if (!is_array($opt[$k])) {
$pseudovars["{\$\${$k}}"] = htmlspecialchars($opt[$k], ENT_NOQUOTES);
}
}
$vk = array_keys($pseudovars);
$vv = array_values($pseudovars);
$lgroup = '';
$out = '';
foreach ($matches as $i => $pn) {
$prev = (string) @$matches[$i - 1];
$next = (string) @$matches[$i + 1];
$Cursor['<'] = $Cursor['<'] = $prev;
$Cursor['='] = $pn;
$Cursor['>'] = $Cursor['>'] = $next;
$group = PageVar($pn, '$Group');
if ($group != $lgroup) {
$groupcount++;
$grouppagecount = 0;
}
$grouppagecount++;
$pagecount++;
$item = str_replace($vk, $vv, $ttext);
$item = preg_replace('/\\{(=|&[lg]t;)(\\$:?\\w+)\\}/e', "PVSE(PageVar(\$pn, '\$2', '\$1'))", $item);
$out .= MarkupRestore($item);
$lgroup = $group;
}
$class = preg_replace('/[^-a-zA-Z0-9\\x80-\\xff]/', ' ', @$opt['class']);
$div = $class ? "<div class='{$class}'>" : '<div>';
$out = $div . MarkupToHTML($pagename, $out, array('escape' => 0)) . '</div>';
StopWatch("FPLTemplate end");
return $out;
}
示例9: FPLTrailTrail
function FPLTrailTrail($pagename, &$matches, $opt)
{
if (!@$opt['link']) {
$opt['link'] = $pagename;
}
$matches = MakePageList($pagename, $opt, 0);
// deal with count
if (@$opt['count']) {
list($r0, $r1) = CalcRange($opt['count'], count($matches));
if ($r1 < $r0) {
$matches = array_reverse(array_slice($matches, $r1 - 1, $r0 - $r1 + 1));
} else {
$matches = array_slice($matches, $r0 - 1, $r1 - $r0 + 1);
}
}
if (!@$opt['label']) {
$opt['label'] = '{$Title}';
}
$topt = array();
$topt['fmt'] = 'fauxtrail';
$topt['label'] = $opt['label'];
$out = '';
$tmatches = array();
foreach ($matches as $m) {
$topt['trail'] = $m;
$topt['trailpage'] = $m;
$out .= FPLFauxTrail($pagename, $tmatches, $topt);
}
return $out;
}
示例10: FPLTextExtract
function FPLTextExtract($pagename, &$matches, $opt)
{
##DEBUG echo "<pre>OPT "; print_r($opt); echo "</pre>";
global $FmtV, $EnableStopWatch, $KeepToken, $KPV;
$EnableStopWatch = 1;
StopWatch('TextExtract pagelist begin');
$opt['stime'] = strtok(microtime(), ' ') + strtok('');
$opt['q'] = ltrim($opt['q']);
foreach ($opt[''] as $k => $v) {
$opt[''][$k] = htmlspecialchars_decode($v);
}
//treat single . search term as request for regex 'all characters'
if ($opt[''][0] == '.' || $opt['pattern'] == '.') {
$opt['regex'] = 1;
}
//MakePageList() does not evaluate terms as regular expressions, so we save them for later
if (@$opt['regex'] == 1) {
$opt['pattern'] = implode(' ', $opt['']);
unset($opt['']);
}
if (@$opt['page']) {
$opt['name'] .= "," . $opt['page'];
}
//allow search of anchor sections
if ($sa = strpos($opt['name'], '#')) {
$opt['section'] = strstr($opt['name'], '#');
$opt['name'] = substr($opt['name'], 0, $sa);
}
$list = MakePageList($pagename, $opt, 0);
//extract page subset according to 'count=' parameter
if (@$opt['count'] && !$opt['section']) {
TESliceList($list, $opt);
}
return TextExtract($pagename, $list, $opt);
}
示例11: FPLSimpleText
function FPLSimpleText($pagename, &$matches, $opt)
{
$matches = MakePageList($pagename, $opt, 0);
## extract page subset according to 'count=' parameter
if (@$opt['count']) {
list($r0, $r1) = CalcRange($opt['count'], count($matches));
if ($r1 < $r0) {
$matches = array_reverse(array_slice($matches, $r1 - 1, $r0 - $r1 + 1));
} else {
$matches = array_slice($matches, $r0 - 1, $r1 - $r0 + 1);
}
}
$opt['sep'] = @$opt['sep'] ? $opt['sep'] : ",";
$opt['sep'] = str_replace('\\n', "\n", $opt['sep']);
if ($opt['sep'] == 'LF') {
$opt['sep'] = "\n";
}
return Keep(implode($opt['sep'], $matches), 'P');
}
示例12: FPLTemplate
function FPLTemplate($pagename, &$matches, $opt)
{
global $Cursor, $FPLFormatOpt, $FPLTemplatePageFmt;
SDV($FPLTemplatePageFmt, '{$SiteGroup}.PageListTemplates');
$template = @$opt['template'];
if (!$template) {
$template = @$opt['fmt'];
}
list($tname, $qf) = explode('#', $template, 2);
if ($tname) {
$tname = MakePageName($pagename, $tname);
} else {
$tname = FmtPageName($FPLTemplatePageFmt, $pagename);
}
if ($qf) {
$tname .= "#{$qf}";
}
$ttext = IncludeText($pagename, $tname, true);
$ttext = preg_replace('/\\[\\[#[A-Za-z][-.:\\w]*\\]\\]/', '', $ttext);
if (!$opt['order'] && !$opt['trail']) {
$opt['order'] = 'name';
}
$matches = array_values(MakePageList($pagename, $opt, 0));
if (@$opt['count']) {
array_splice($matches, $opt['count']);
}
$savecursor = $Cursor;
$pagecount = 0;
$groupcount = 0;
$grouppagecount = 0;
$vk = array('{$PageCount}', '{$GroupCount}', '{$GroupPageCount}');
$vv = array(&$pagecount, &$groupcount, &$grouppagecount);
$lgroup = '';
$out = '';
foreach ($matches as $i => $pn) {
$prev = (string) @$matches[$i - 1];
$next = (string) @$matches[$i + 1];
$Cursor['<'] = $Cursor['<'] = $prev;
$Cursor['='] = $pn;
$Cursor['>'] = $Cursor['>'] = $next;
$group = PageVar($pn, '$Group');
if ($group != $lgroup) {
$groupcount++;
$grouppagecount = 0;
}
$grouppagecount++;
$pagecount++;
$item = str_replace($vk, $vv, $ttext);
$item = preg_replace('/\\{(=|&[lg]t;)(\\$\\w+)\\}/e', "PageVar(\$pn, '\$2', '\$1')", $item);
$out .= $item;
$lgroup = $group;
}
return '<div>' . MarkupToHTML($pagename, $out, false) . '</div>';
}
示例13: HandleFeed
function HandleFeed($pagename, $auth = 'read') {
global $FeedFmt, $action, $PCache, $FmtV, $TimeISOZFmt, $RSSTimeFmt,
$FeedPageListOpt, $FeedCategoryOpt, $FeedTrailOpt,
$FeedDescPatterns, $CategoryGroup, $EntitiesTable;
SDV($RSSTimeFmt, 'D, d M Y H:i:s \G\M\T');
SDV($FeedDescPatterns,
array('/<[^>]*$/' => ' ', '/\\w+$/' => '', '/<[^>]+>/' => ''));
$FeedPageListOpt = (array)@$FeedPageListOpt;
SDVA($FeedCategoryOpt, array('link' => $pagename));
SDVA($FeedTrailOpt, array('trail' => $pagename, 'count' => 10));
$f = $FeedFmt[$action];
$page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
if (!$page) Abort("?cannot generate feed");
$feedtime = $page['time'];
# determine list of pages to display
if (@($_REQUEST['trail'] || $_REQUEST['group'] || $_REQUEST['link']
|| $_REQUEST['name']))
$opt = $FeedPageListOpt;
else if (preg_match("/^$CategoryGroup\\./", $pagename))
$opt = $FeedCategoryOpt;
else if ($action != 'dc') $opt = $FeedTrailOpt;
else {
PCache($pagename, $page);
$pagelist = array($pagename);
}
if (!@$pagelist) {
$opt = array_merge($opt, @$_REQUEST);
$pagelist = MakePageList($pagename, $opt, 0);
}
# process list of pages in feed
$rdfseq = '';
$pl = array();
foreach($pagelist as $pn) {
if (!PageExists($pn)) continue;
if (!isset($PCache[$pn]['time']))
{ $page = ReadPage($pn, READPAGE_CURRENT); PCache($pn, $page); }
$pc = & $PCache[$pn];
$pl[] = $pn;
$rdfseq .= FmtPageName("<rdf:li resource=\"{\$PageUrl}\" />\n", $pn);
if ($pc['time'] > $feedtime) $feedtime = $pc['time'];
if (@$opt['count'] && count($pl) >= $opt['count']) break;
}
$pagelist = $pl;
$FmtV['$FeedRDFSeq'] = $rdfseq;
$FmtV['$FeedISOTime'] = gmstrftime($TimeISOZFmt, $feedtime);
$FmtV['$FeedRSSTime'] = gmdate($RSSTimeFmt, $feedtime);
# format start of feed
$out = FmtPageName($f['feed']['_start'], $pagename);
# format feed elements
foreach($f['feed'] as $k => $v) {
if ($k{0} == '_' || !$v) continue;
$x = FmtPageName($v, $pagename);
if (!$x) continue;
$out .= ($v{0} == '<') ? $x : "<$k>$x</$k>\n";
}
# format items in feed
if (@$f['feed']['_items'])
$out .= FmtPageName($f['feed']['_items'], $pagename);
foreach($pagelist as $pn) {
$page = &$PCache[$pn];
$FmtV['$ItemDesc'] = @$page['description'];
$FmtV['$ItemISOTime'] = gmstrftime($TimeISOZFmt, $page['time']);
$FmtV['$ItemRSSTime'] = gmdate($RSSTimeFmt, $page['time']);
$out .= FmtPageName($f['item']['_start'], $pn);
foreach((array)@$f['item'] as $k => $v) {
if ($k{0} == '_' || !$v) continue;
if (is_callable($v)) { $out .= $v($pn, $page, $k); continue; }
if (strpos($v, '$LastModifiedBy') !== false && !@$page['author'])
continue;
if (strpos($v, '$Category') !== false) {
if (preg_match_all("/(?<=^|,)$CategoryGroup\\.([^,]+)/",
@$page['targets'], $match)) {
foreach($match[1] as $c) {
$FmtV['$Category'] = $c;
$out .= FmtPageName($v, $pn);
}
}
continue;
}
$x = FmtPageName($v, $pn);
if (!$x) continue;
$out .= ($v{0} == '<') ? $x : "<$k>$x</$k>\n";
}
$out .= FmtPageName($f['item']['_end'], $pn);
}
$out .= FmtPageName($f['feed']['_end'], $pagename);
foreach((array)@$f['feed']['_header'] as $fmt)
header(FmtPageName($fmt, $pagename));
print str_replace(array_keys($EntitiesTable),
array_values($EntitiesTable), $out);
}