if (substr($lastarg, strlen($lastarg)-strlen($suffix)) == $suffix) {
for ($i=2; $i<$argsnum; $i++) {
if (!empty($urlname))
$urlname .= '/';
$urlname .= $args['vars'][$i];
}
$urlname = substr($urlname, 0, -strlen($suffix));
$pageId = pnModAPIFunc('content', 'page', 'solveURLPath', array('urlname' => $urlname));//new
$category = pnModAPIFunc('content', 'page', 'GetPageCategory', $pageId);//new
pnQueryStringSetVar('func', 'view');
pnQueryStringSetVar('name', $urlname);
pnQueryStringSetVar('pid', $pageId);//new
pnQueryStringSetVar('cat', $category);//new
return true;
}function content_pageapi_GetPageCategory($pageId) //new
{
$pntable = pnDBGetTables();
$pageTable = $pntable['content_page'];
$pageColumn = $pntable['content_page_column'];
$pageId = (int)$pageId;
$sql = "
SELECT $pageColumn[categoryId]
FROM $pageTable
WHERE $pageColumn[id] = $pageId";
$dbresult = DBUtil::executeSQL($sql);
if ($result->EOF)
return false;
$category = '';
for (; !$dbresult->EOF; $dbresult->MoveNext())
{
$category = (int)$dbresult->fields[0];
}
$dbresult->Close();
return $category;
}Actually, you could do this using the Extended Menu block in PN 0.8 RC4 / Zikula 1.0. You can assign certain menu items to specific pages within your site. For an example of what I mean and how I used it, visit http://www.pdgroupllc.com -- take note of the menu then click on "Services" and you'll see new menu items appear.
Template courtesy of Designs By Darren.