$include_file = 'inc/include_main.php'; include('inc/include_once.php'); ?> $include_file = 'inc/classes/pagelist.php'; include('inc/include_once.php'); ?> $include_file = 'inc/classes/pagetextlist.php'; include('inc/include_once.php'); ?> // Find page id with lowest sequence $pagelist = new pagelist(0); $pagelist->readPages(PAGE_FIND_PARENTID); $firstpage = $pagelist->nextPage(0); $firstpageid = $firstpage->getId(); // Set page identification if not exist if (isset($pageid) == false) $pageid = $firstpageid; // Create pagetext list object $pagetextlist = new pagetextlist($pageid); // Find page text $pagetextlist->readPageText(PAGETEXT_FIND_PAGEID); // Set subpage show flag $subpageshow = 0; // Check if there is no text for current page if ($pagetextlist->getCount() == 0) { // Create page list object $pagelist = new pagelist($pageid); // Find sub pages for current page $pagelist->readPages(PAGE_FIND_PARENTID); // Check if there are sub pages if ($pagelist->getCount()) { // Get first page $page = $pagelist->nextPage(0); // Set parent id to current page $parentid = $pageid; // Set page current page $pageid = $page->getId(); // Set subpage show flag $subpageshow = 1; } } // Create page object $page = new page($pageid); // Find page $page->readPage(PAGE_FIND_ID); // Create parent id if not exist if (isset($parentid) == false) $parentid = 0; ?>