Example #1
0
 public static function metainfo()
 {
     $routing_uri = $_SERVER['REQUEST_URI'];
     /* Contact */
     if (strpos($routing_uri, '/contact') !== FALSE) {
         echo '<meta name="description" content="' . METADESCRIPTION . '">';
         echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
     } elseif (strpos($routing_uri, '/category') !== FALSE) {
         $category_id = explode("/", $routing_uri);
         if (is_numeric($category_id[2])) {
             $id = mysqli_real_escape_string(db_connect(), $category_id[2]);
         } else {
             $id = mysqli_real_escape_string(db_connect(), $category_id[3]);
         }
         $category_lookup = new Category();
         $category = $category_lookup->category_load($id);
         if (!empty($category['metadescription'])) {
             echo '<meta name="description" content="' . $category['metadescription'] . '">';
         } else {
             echo '<meta name="description" content="' . METADESCRIPTION . '">';
         }
         if (!empty($category['metakeywords'])) {
             echo '<meta name="keywords" content="' . $category['metakeywords'] . '">';
         } else {
             echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
         }
     } elseif (strpos($routing_uri, '/blog') !== FALSE) {
         $post_id = explode("/", $routing_uri);
         $id = mysqli_real_escape_string(db_connect(), $post_id[2]);
         $post_class = new Post();
         $post = $post_class->post_load($id);
         if (!empty($post['metadescription'])) {
             echo '<meta name="description" content="' . $post['metadescription'] . '">';
         } else {
             echo '<meta name="description" content="' . METADESCRIPTION . '">';
         }
         if (!empty($post['metakeywords'])) {
             echo '<meta name="keywords" content="' . $post['metakeywords'] . '">';
         } else {
             echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
         }
     } elseif (strpos($routing_uri, '/index.php') !== FALSE) {
         echo '<meta name="description" content="' . METADESCRIPTION . '">';
         echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
     } elseif (strpos($routing_uri, '/') !== FALSE) {
         $page = explode("/", $routing_uri);
         if (empty($page[1])) {
             echo '<meta name="description" content="' . METADESCRIPTION . '">';
             echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
         } else {
             $page_slug = explode("/", $routing_uri);
             $slug = mysqli_real_escape_string(db_connect(), $page_slug[1]);
             $slug = strtok($slug, '?');
             $page_lookup = new Page();
             $page = $page_lookup->page_load_slug($slug);
             if (!empty($page['metadescription'])) {
                 echo '<meta name="description" content="' . $page['metadescription'] . '">';
             } else {
                 echo '<meta name="description" content="' . METADESCRIPTION . '">';
             }
             if (!empty($page['metakeywords'])) {
                 echo '<meta name="keywords" content="' . $page['metakeywords'] . '">';
             } else {
                 echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
             }
         }
     } else {
         echo '<meta name="description" content="' . METADESCRIPTION . '">';
         echo '<meta name="keywords" content="' . METAKEYWORDS . '">';
     }
 }
Example #2
0
<?php

$routing_uri = $_SERVER['REQUEST_URI'];
$page_slug = explode("/", $routing_uri);
$page_slug[1] = strtok($page_slug[1], '?');
$slug = mysqli_real_escape_string(db_connect(), $page_slug[1]);
$page_lookup = new Page();
$page = $page_lookup->page_load_slug($slug);
if (empty($page['slug'])) {
    include_once '404.php';
} else {
    ?>
<header class="intro-header" style="background-image: url('<?php 
    echo BASE_URL;
    ?>
/gw-content/uploads/<?php 
    echo $page['featured'];
    ?>
')">&nbsp;</header>

<div class="container">
    <h1 class="page-header"><?php 
    echo $page['title'];
    ?>
</h1>
    <?php 
    echo eval("?>" . $page['body'] . "");
    ?>
</div>
<?php 
}