$label"; $tp_val = FmtPageName($trailpage, $pagename); $tp_page = MakePageName($pagename, $tp_val); $itemfmt = "{\$Title}"; $prev_link = ''; $next_link = ''; $out = ''; for($i=0; $i < count($matches); $i++) { if ($matches[$i] == $pagename) { if ($i > 0) { $prev_page = $matches[$i-1]; $prev_link = FmtPageName($itemfmt, $prev_page); } $trailindex = FmtPageName($index_itemfmt, $tp_page); if ($i + 1 < count($matches)) { $next_page = $matches[$i+1]; $next_link = FmtPageName($itemfmt, $next_page); } $out = "

<< $prev_link | $trailindex | $next_link >>

"; break; } } return $out; } // trailtrail // Find all pages which link to this page; // for each page which was found // take it as a trail page, and create a FauxTrail for it. 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; }