function body_class() { $classes = array(); // Is it a posts page? if (is_postspage()) { $classes[] = 'posts'; } // Is it the homepage? if (is_homepage()) { $classes[] = 'home'; } // Is it a single post? if (is_article()) { $classes[] = 'article'; } // Is it a custom page? if (is_page()) { $classes[] = 'page'; } return implode(' ', array_unique($classes)); }
<?php /* ############ URL Processor ############ All requests to the CMS will be handeled by the following sections Once a http request is received the URL is split and analysed for all possiblities. */ include '_core/init.php'; if (isset($_GET['url'])) { $url = mysql_real_escape_string($_GET['url']); if (is_article($url) == true) { require 'post.php'; } elseif (category_valid($url) == true) { include 'category.php'; } elseif (wrong_url($url) == true) { wrong_url_redirect($url); } elseif (wrong_category($url) == true) { wrong_category_redirect($url); } else { $url = "404"; require 'post.php'; } } else { $url = "404"; require 'post.php'; }
?> "> <meta property="og:image" content="<?php echo theme_url('img/og_image.gif'); ?> "> <meta property="og:site_name" content="<?php echo site_name(); ?> "> <meta property="og:description" content="<?php echo site_description(); ?> "> <?php if (is_article()) { ?> <meta name="og:description" content="<?php echo article_description(); ?> "> <meta name="description" content="<?php echo article_description(); ?> "> <?php } elseif (is_homepage()) { ?> <meta name="og:description" content="<?php echo site_description(); ?>
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $_SESSION['slug'] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); if ($_SESSION['slug'] == 'en') { $_SESSION['slug'] = 'us'; } } else { $_SESSION['slug'] = 'us'; } } $url = $_SERVER['REQUEST_URI']; $parts = explode('/', $url); $first = $parts[1]; $second = isset($parts[2]) ? $parts[2] : false; if ($first == '') { header('Location: /' . $_SESSION['slug'] . '/'); } elseif (is_article($url)) { include BASE_PATH . 'app/controllers/article.php'; } elseif (is_slug($first) && empty($second)) { if (substr($url, -1) == '/') { include BASE_PATH . 'app/controllers/index.php'; } else { header('HTTP/1.1 301 Moved Permanently'); header('Location: /' . $first . '/'); } } elseif (!empty($utils['static_page']) && !empty($utils['static_page'][$url]) && $utils['static_page'][$url]['name'] == $url) { if ($utils['static_page'][$url]['status'] == 'redirect') { header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $utils['static_page'][$url]['value']); } else { include BASE_PATH . 'app/controllers/' . $utils['static_page'][$url]['value']; }
$fd = fopen($article, 'r'); $titre = 'compilation'; $fdc = fopen('xml/article/' . $titre . '.xml', 'w'); //PARSING XML $i = 0; while (!feof($fd)) { $line = fgets($fd); if (is_note($line)) { $note = extract_note($line); $notes[$i] = $note; $i++; /*$temoin=extract_note($line); array_push($note,$temoin) /*echo "Hello Maxime la réponse est là" . $temoin; fputs($fdc,$line);*/ } elseif (is_article($line)) { fputs($fdc, "<?xml-stylesheet type=\"text/css\" href=\"style.css\" media=\"all\"?>\n<article>\n"); } elseif (is_article_end($line)) { } else { fputs($fdc, $line); } } //FUSION //print_r($notes); foreach ($notes as $file) { $fdn = fopen('xml/note/' . $file . '.note', 'r'); $cpt = 0; while (!feof($fdn)) { $line1 = fgets($fdn); if ($cpt == 0) { } else {