pageinfo.php

File Type: php File Location: monofiles/ File name: pageinfo.php
<?php
    
    
// Post
    
if(isset($fn)) {
        
        
$xmlfile simplexml_load_file('../../monofiles/'.$fn);
        
$title $xmlfile->postinfo->post->title;
        
$meta_description load_meta_description($xmlfile->postinfo->post->description);
        
$htm_file '../../monofiles/autosaves/content/'.basename($fn,'.xml').'.htm';
        
        if (
file_exists($htm_file)){
            
            
$content file_get_contents($htm_file);
            
            if (
$xmlfile->postinfo->post->excerpt != 'none')
                
$content str_replace('<hr>','',$content);
            
            if (
$meta_description == '')
                
$meta_description load_meta_description($content);
        }
        
        if (
$stgs['dates'] == 'on'
            
$post_date date("D j F, Y",(int)$xmlfile->postinfo->post->ptime);
        
        
        
// sign post
        
$uid = (string)$xmlfile->postinfo->post->createdby;
        
$log simplexml_load_file('../../monofiles/filesinfo/log.xml');

        foreach(
$log->user as $userinfo){
        
            if ((string)
$userinfo->userID == $uid){
            
                if (
$userinfo->signposts == 'on' ){
                
                    
$authorname $userinfo->name;
                    
$authoricon $userinfo->icon;
                    
$authordesc $userinfo->description;
                
                    
$sign '<div class="signicon"><div class="editor-description"><img src="../../monofiles/'.$authoricon.'" class="editors-img"><span>'.$authorname.'</span>'.$authordesc.'</div></div>';
                
                }
                break;
            }
        }
        
        
// Post tags
        
if (load_settings()['tags'] == 'on'){
            
            
$taginfo load_xml($xmlfile->postinfo->post->tags);
            
$sep array_values(preg_split('/[,]/'$taginfonullPREG_SPLIT_NO_EMPTY));
            
            if (!empty(
$sep))
                foreach(
$sep as $val)
                    
$tags .= '<a href="../../tags/'.str_replace(' ','-',mb_strtolower($val,'UTF-8')).'" class="tagged">'.$val.'</a> '.PHP_EOL;
        }
        
        
        
// Post category
        
$catinfo load_xml($xmlfile->postinfo->post->category);
        
$folders glob('../../category/*',GLOB_ONLYDIR);
            foreach(
$folders as $catf){
                if (
file_get_contents($catf.'/name.txt') == $catinfo){
                        
$ctgr '<a href="'.$catf.'" class="catword">'.$catinfo.'</a>';
                        break;
                }
            }
    }


    
    
// Page
    
elseif (isset($pn)) {
        
        
$xmlfile simplexml_load_file('monofiles/savedpages/'.$pn.'.xml');
        
$title load_xml($xmlfile->pageinfo->page->title);
        
$meta_description load_meta_description($xmlfile->pageinfo->page->description);
        
$content $xmlfile->pageinfo->page->content;
    }

    
    
    
//Index, tag, category
    
else {

        
$title $stgs['title'];
        
$meta_description $stgs['description'];
        
        
    }
?>