"; $PageHeaderFmt = "

From $WikiTitle

\$Groupspaced: \$Titlespaced

"; $PageFooterFmt = array("
", "function:PrintEndnotes #", "

$[Retrieved from] “$PageUrlFmt”
$[Page last modified on \$LastModified]

"); $GroupHeaderFmt = '$Group.GroupPrintHeader'; $GroupFooterFmt = '$Group.GroupPrintFooter'; $DoubleBrackets["/\\[\\[mailto:($UrlPathPattern)(.*?)\\]\\]/"] = "''$2'' [[[mailto:$1 $1]]]"; $WikiPageExistsFmt = "\$LinkText"; $WikiPageCreateFmt = "\$LinkText"; $WikiPageCreateSpaceFmt = "\$LinkText"; $UrlLinkTextFmt = "\$LinkText [\$Url]"; $FmtUrlLink = 'FmtUrlLinkPublish'; $TrailLinkPattern = "(?:($GroupNamePattern)([\\/.]))?(($WikiWordPattern)|($FreeLinkPattern))"; $DoubleBrackets["/<<\\|($TrailLinkPattern)\\|>>/"] = "$1"; $DoubleBrackets["/\\^\\|($TrailLinkPattern)\\|\\^/"] = ''; $DoubleBrackets["/<\\|($TrailLinkPattern)\\|>/"] = ''; $InlineReplacements['/\\[\\[\\$Publish\\]\\]/'] = ''; $SpaceWikiWords = 1; $hide = 1; } else $PageFooterFmt = str_replace("
", " - $[Printable Version]
", $PageFooterFmt); SDV($HandleActions['publish'],'HandlePublish'); $include = $HTTP_GET_VARS['include']; SDV($HandlePublishFmt,array(&$HTMLStartFmt,&$PageHeaderFmt, "wiki:$GroupHeaderFmt", &$PublishList, "wiki:$GroupFooterFmt", &$PageFooterFmt,&$HTMLEndFmt)); SDV($PublishPageNotFoundFmt,'Page \'\'$Tlink\'\' does not exist.'); SDV($PublishPageNameFmt,"\$Titlespaced:"); if (isset($EnablePathInfo) && !$EnablePathInfo) SDV($PublishTagFmt,"
\$PublishName $[Include this page]
"); SDV($PublishTagFmt,"
\$PublishName $[Include this page]
"); SDV($InlineReplacements['/\\[\\[\\$Publish(nodate)?(:(.*?))?\\]\\]/e'], "FmtPublishName(\$GLOBALS['PublishTagFmt'],\$pagename,'\$3')"); $DoubleBrackets['/\\[\\[\\$Publish:(.*?)\\]\\]/e'] = 'ValidatePublish("$pagename","$1");'; if (!isset($IncludeModifiedDate)) $IncludeModifiedDate = true; function ValidatePublish($pagename,$publishpage) { global $GroupNamePattern,$PageTitlePattern; $delimiter = '/'; if (preg_match("/^$GroupNamePattern([\\/.])$PageTitlePattern\$/", $publishpage,$match)) $delimiter = $match[1]; else $publishpage = FmtPageName('$Group',$pagename)."/$publishpage"; if (PageExists($publishpage)) return "[[\$Publish:" . AsSpaced($publishpage) . "]]"; else return str_replace($delimiter,"$delimiter{{",$publishpage) . "}} not found."; } function FmtPublishName($fmt,$pagename,$publishpage) { global $PublishPageNameFmt; if ($publishpage) { $publishpage = str_replace(" ","",$publishpage); $r = FmtPageName($PublishPageNameFmt,$publishpage); } else $publishpage = $pagename; return str_replace('$PublishName',$r,FmtPageName($fmt,$publishpage)); } function HandlePublish($pagename) { global $HandlePublishFmt,$TrailLinkPattern,$PublishPageNotFoundFmt; global $include,$HTMLTitle,$GCount,$LastModified,$IncludeModifiedDate; $trailname = FmtWikiLink('',$pagename,NULL,'PageName'); $trailpage = ReadPage($trailname); if ($trailpage) { $LastModified = $trailpage['timefmt']; if (strstr($trailpage['text'],'[[$Publishnodate]]')) $IncludeModifiedDate = false; $trailgroup = FmtPageName('$Group',$trailname); foreach(explode("\n",$trailpage['text']) as $x) { if (preg_match("/^T?([#*:]+)\\s*(.*)/",$x,$match)) { $match[1] = str_replace(':#',':',$match[1]); $depth[] = strlen($match[1]); if (preg_match("/^(\\[\\[)?($TrailLinkPattern)/",$match[2],$text)) { $pg = ($text[3]>'')?$text[2]: $trailgroup.'/'.$text[2]; $pages[] = FmtWikiLink('',$pg,NULL,'PageName',$trailpage); if (preg_match("/^\\[\\[($TrailLinkPattern)((?:\\s.*?)\\]\\])/", $match[2],$dbm)) $links[] = "[[".$pg.array_pop($dbm); else $links[] = $pg; } elseif (!strstr($match[1],":")) { $pages[] = "textonly"; $links[] = $match[2]; } } } if (isset($include)) { $PublishList[] = "function:PrintThisPage $pagename"; } for($i=0;$i$s) { if (strstr($text,$p)) $text = str_replace($p,eval($s),$text); } return $text; } function PrintEndnotes($pagename,$urltext) { $etext = Endnote($urltext); if ($etext!="") PrintText($pagename,$etext); } function Endnote($urltext) { static $endcount, $endtext; if ($urltext == "#") { $r = "$endtext"; if ($endcount>0) $r = "!Links\n$r"; $endcount = 0; $endtext = ''; } else { $endcount++; $r = "$endcount"; $urltext = str_replace('&','&',stripslashes($urltext)); $endtext .= "# [[#end$endcount]]$urltext\n"; } return $r; } function FmtUrlLinkPublish($pat,$ref,$btext) { if (!is_null($btext)) { $ref = Endnote($ref); } return FmtUrlLink($pat,$ref,$btext); } ?>