<?php

    
    # Find path for posts and pages
    # created in version 2.2

    include_once 'log.php';
    
    
    # pages created in version 2.2 and above have a $incp
    if (isset($incp)) {
    
        $obj = simplexml_object($pn.'.xml','l','page');
        
        if (!empty($obj->pageinfo->page->published) && $obj->pageinfo->page->published != 'on') {
        
            header('HTTP/1.0 404 Not Found');

            # Obtain the server's 404 error message
            include 'notfound.php';
            exit;
        }
        
        
        $rot = $incp;
    
    }
    
    
    # category inc path
    elseif (isset($incpc))
        $rot = $incpc;
        
    else
        $rot = is_file('monofiles/filesinfo/log.xml') ? '' : '../../';
    
    
    
    # v2.2 and above
    #$rot = isset($incp) ? $incp : '../../';
    

    # href link to home dir
    $lot = $rot == '' ? './' : $rot;
    
    
    # cmsetup function also updated in v2.2 to support path as parameter-> 3.0 version $path not used anymore.
    $cms = cmsetup();
    
    
    
    # tags in version 3.0 can be also be plain text instead of links
    if (isset($tagg) && $cms['tagstext'] == 'on') {
    
        header('HTTP/1.0 404 Not Found');

        # Obtain the server's 404 error message
        include 'notfound.php';
        exit;
    
    }


    # Size of pagination menu (type 2)
    #$nol = 2;
    
    
    include $rot.'pagep.php'
        
?>