<?php


    # included in every posts permanent link page
    # $fn must be set

    include 'log.php';
    $fninfo = getxmlpost('../../monofiles/autosaves/'.$fn);
    
    

    # Do not print a Draft post
    if ($fninfo['type'] == 'Draft')
        $drf = true;
        
    ####
    
        
    
    # Find category and check category link status
    $ctgs = get_categories();
    if(!empty($fninfo['catid'])) {
        
        $pc = $fninfo['catid'];
        if (isset($ctgs[$pc]))
            $postlink = $ctgs[$pc][5];
        else {
            $mrg = merged_categories();
            if (isset($mrg[$pc]))
                $postlink = $ctgs[$mrg[$pc]][5];
        }
    }
    
    ####
    
    
    
    if (!file_exists('../../pagep.php') || (int)$fninfo['ptime'] > time() || (isset($postlink) && $postlink == 'off') || isset($drf)) {


        # exit with 404 error
        # send 404 header
        header('HTTP/1.0 404 Not Found');

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

    }



    include 'path.php'



?>