pagep.php
File Type: php
File Location: /
File name: pagep.php
<?php
//
/// PAGE pattern. Works for all.
/// If variable $index is set -> index page is loaded.
/// If $catg -> Category results page. (All pages of a specific category)
/// $tagg -> Tag results page
/// $fn -> Blog Post
/// $pn -> Page
//
// Find root
$rot = (is_dir('monofiles')) ? '' : '../../';
$lot = ($rot == '') ? './' : '../../' ;
// Load CMS settings
include $rot.'monofiles/set-general.php';
$stgs = load_settings();
// Load some page info
include $rot.'monofiles/en_code.php';
include $rot.'monofiles/pageinfo.php';
// Load theme settings
$thms = load_theme();
//Website Title and Description
$dt = (string)$thms['default_title'];
$dd = (string)$thms['default_description'];
//
/// if $thms[$dt.'show'] == 'on' , the website title appears
/// if $thms[$dd.'show'] == 'on' , the website description appears
//
?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php print $title ?></title>
<meta name="description" content="<?php print $meta_description ?>">
<link rel="stylesheet" type="text/css" href="<?php print $rot ?>style.css">
<style type="text/css">
@charset "utf-8";
<?php
$layoutcss = array('layouthead','layoutbody','layoutfoot');
foreach($layoutcss as $cssfile) {
$file = $rot.'layout/'.$thms[$cssfile].'.css';
if (file_exists($file))
include $file;
}
if ($thms['darktheme'] == 'on') include $rot.'layout/dark.css'
?>
</style>
<?php
if (($thms['navigation'] == 'on') && ($thms['fixedmenu'] == 'on'))
print '<script type="text/javascript" src="'.$rot.'javascript/windowscroll.js"></script>';
?>
</head>
<body>
<?php
if ($stgs['makenote'] == 'on')
print '<div class="mon-note">'.loadhtml($stgs['note']).'</div>'
?>
<div id="header">
<div class="hfx-before"></div>
<div id="htop" class="header-top">
<div id="header-content">
<?php
if ($thms['layouthead'] == 'head1') {
//Default title
if ($thms[$dt.'show'] == 'on') {
print '<div id="lg"><h1>';
print (!isset($index)) ? '<a href="'.$lot.'">'.$stgs[$dt].'</a></h1></div>' : $stgs[$dt].'</h1></div>';
}
}
// Navigation menu
if ($thms['navigation'] == 'on') {
include $rot.'monofiles/set-nav.php';
load_navigation();
}
?>
</div>
</div>
<div id="h-des">
<div class="space"></div>
<?php
// Default title
if ($thms['layouthead'] == 'head2'){
if ($thms[$dt.'show'] == 'on') {
print '<h1 id="lg">';
print (!isset($index)) ? '<a href="'.$lot.'">'.$stgs[$dt].'</a></h1>' : $stgs[$dt].'</h1>';
}
}
// Default description
if ($thms[$dd.'show'] == 'on')
// Here is an example of a custom description that contains some html:
// print '<h2 id="description">My Free<br><span>File based</span><br>CMS</h2>';
// Set the next line of code as a comment, if you wish to use the one above.
print '<h2 id="description">'.$stgs[$dd].'</h2>'
?>
</div>
</div>
<!-- Main body -->
<div class="page-content">
<div id="info-section">
<?php if ( $thms['layoutbody'] == 'body3' || $thms['layoutbody'] == 'body4' ) : ?>
<div class="left-s">
...
</div>
<?php endif;
// page, post
if (isset($fn) || isset($pn)) {
if (isset($post_date))
print '<div class="date">'.$post_date.'</div>'.PHP_EOL;
print '<h1>'.load_xml($title).'</h1>';
}
?>
<!-- Page content -->
<!-- Index, category, tag -->
<?php if (isset($index) || isset($catg) || isset($tagg)) : ?>
<div class="set-posts">
<?php include $rot.'monofiles/set-posts.php' ?>
<div id="res-nav">
<?php include $rot.'monofiles/paginate.php' ?>
</div>
</div>
<!-- END -->
<?php endif ?>
<!-- Posts and pages -->
<div class="mainpage">
<?php
if (isset($content))
print $content
?>
</div>
<?php
if (!isset($index)) {
// Tags on from settings
if (isset($tags))
print '<div class="tags">Tags: '.$tags.'</div>'.PHP_EOL;
if (isset($ctgr))
print '<div class="category">Category: '.$ctgr.'</div>';
if (isset($sign))
print $sign;
}
?>
<!-- END -->
<?php if ( $thms['layoutbody'] == 'body2' || $thms['layoutbody'] == 'body4' ) : ?>
<div class="right-s">
...
</div>
<?php endif ?>
</div>
</div>
<!-- footer -->
<footer class="footer">
<div class="footer-menu">
<?php if ( $thms['layoutfoot'] == 'foot2' || $thms['layoutfoot'] == 'foot3') : ?>
<div class="foot-l">
</div>
<?php endif ?>
<div class="foot">
</div>
<?php if ($thms['layoutfoot'] == 'foot3') : ?>
<div class="foot-r">
</div>
<?php endif ?>
</div>
</footer>
</body>
</html>