<?php
//$mainContentLabel = 'Content';	

$mainContentLabel = $GLOBALS['CONTENT_MODEL_INFO'][$NodeInfo['TableID']]['MainField'];	

$patt = "/<h3[^>]*><font[^>]*>\[Page:(.*)]<\/font><\/h3>/siU";
$patt1 = "/<h3[^>]*><font[^>]*>\[Page:(.*)]<\/font><\/h3>/siU";
$filenameFormatMap = array(
	'{IndexID}'=>'{$IndexID}',
	'{ContentID}'=>'{$IndexID}',
	'{NodeID}'=>'{$publishInfo[NodeID]}',
	'{TimeStamp}'=>'{$publishInfo[CreationDate]}',
	//'{Page}'=> '{$Page}',
);
$IndexPageTitle = "前言";
$_pageList = "PageList";
$_pageTitle = "PageTitle";
$_pageLink = "PageLink";
$_pageNav = "PageNav";

$RelateDocArray = $publish->getRelateDoc($IndexID,0,15);
//debug($RelateDocArray);
$RelateDoc = "<TABLE cellSpacing=3 cellPadding=0  border=0><TBODY>";
if(is_array($RelateDocArray)) {
	foreach($RelateDocArray as $key=>$var) {
		$RelateDoc.= "<TR><TD >· </TD><TD ><A href='{$var[URL]}' target=_blank>{$var[Title]}</A></TD></TR>";
	}

} else {
	$RelateDoc.= "<TR> <TD >沒有相關文章</TD></TR>";
}

$RelateDoc .= "</TBODY></TABLE>";

$NodeArray = unserialize($NodeInfo[Nav]);
$tmpNodeInfo = $publish->NodeInfo;

foreach($NodeArray as $key=>$var) {
	$publish->NodeInfo = $iWPC->loadNodeInfo($var[NodeID]);
	$URL = $publish->getHtmlURL($publish->NodeInfo[IndexName]);

	if($key == 0) {

		$Navigation = "<a href='{$URL}' >{$var[Name]}</a>";
	
	} else {
		$Navigation .= "&nbsp;&gt;&nbsp;<a href='{$URL}' >{$var[Name]}</a>";
	
	}


}

$publish->NodeInfo = $tmpNodeInfo;
/*
***使用說明***

分頁子標題數組：$pageNav
$pageNav = array(
	Title => 分頁子標題,
	Link => 分頁鏈接,
)
內容數組：$Publish
分頁第一頁默認子標題：$IndexPageTitle
*/
?>