annotate top.php @ 11:ff57b45eda37

Changement profond de l'index. Utilisation des templates. Dual Blog utilise maintenant intimement la libraire de templates que l'on peut trouver sur http://hg.defr.org/defr/templates, ce qui permet d'eviter de mixer du code PHP avec du HTML. Accessoirement, on est aussi assurer d'avoir du XML valide, puisque c'est l'API DOM qui est utilisée pour générer la sortie.
author Franck Deroche <webmaster@defr.org>
date Wed, 24 Oct 2007 20:06:00 +0200
parents 629389204276
children
rev   line source
webmaster@0 1 <?php
webmaster@0 2 if(is_null($_SERVER['HTTP_ACCEPT']) || stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml'))
webmaster@0 3 header('Content-Type: application/xhtml+xml; charset=UTF-8');
webmaster@0 4 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
webmaster@0 5 <html xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
webmaster@0 6 <head>
webmaster@0 7 <link rel='StyleSheet' type='Text/CSS' href='/blog/css/comment.css' />
webmaster@0 8 <?php
webmaster@0 9 $startDate = array("year" => "2004", "month" => 6);
webmaster@0 10 $tmpYear = $startDate['year']; $tmpMonth = $startDate['month'];
webmaster@0 11 $curYear = (int)gmdate("Y"); $curMonth = (int)gmdate("m");
webmaster@0 12 $arMonth = array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre");
webmaster@0 13 $StyleSheets = array(
webmaster@0 14 "Somatic" => "Somatic.css",
webmaster@0 15 "OliveVerde" => "OliveVerde.css",
webmaster@0 16 "Lite:Reloaded" => "Lite_nv.css",
webmaster@0 17 "Brushed" => "Brushed.css",
webmaster@0 18 ":Hover" => "HoverExp.css");
webmaster@0 19 $CkStyle = (array_key_exists("style", $_COOKIE) && array_key_exists($_COOKIE['style'], $StyleSheets))?$_COOKIE['style']:"Somatic";
webmaster@0 20 foreach($StyleSheets as $CSSName => $CSSHref) {
webmaster@0 21 $t = ($CSSName == $CkStyle)?"StyleSheet":"Alternate StyleSheet";
webmaster@0 22 echo(" <link rel='$t' type='text/css' href='/blog/css/$CSSHref' title='$CSSName' media='screen' />\n");
webmaster@0 23 }
webmaster@0 24 if(!empty($Titre))
webmaster@0 25 echo(" <title>{$Titre} - Dual Blog</title>\n");
webmaster@0 26 else
webmaster@0 27 echo(" <title>Dual { v10 : OS Edition } Blog</title>\n");
webmaster@0 28
webmaster@0 29 if(stristr($_SERVER['HTTP_USER_AGENT'], "MSIE") && !$CkStyle == "Somatic")
webmaster@0 30 echo("<style type='Text/CSS'>
webmaster@0 31 .PostTitle {margin-bottom:0px;}
webmaster@0 32 </style>");
webmaster@0 33 ?>
webmaster@0 34 <link rel="alternate" type="application/atom+xml" title="Atom feed" href="/blog/dualblog.atom" />
webmaster@0 35 <link rel="alternate" type="application/rss+xml" title="RSS 2.0 feed" href="/blog/dualblog.rss" />
webmaster@0 36 <link rel="icon" type="image/png" href="/favicon.png" />
webmaster@0 37 <meta http-equiv='content-type' content='text/html; charset=utf-8' />
webmaster@0 38 <meta name='author' content='Franck Deroche' />
webmaster@0 39 <script type="Text/JavaScript" src="/blog/RollUp.js"></script>
webmaster@0 40 </head>
webmaster@0 41
webmaster@0 42 <body id="Main">
webmaster@0 43 <?php /* if(!empty($Summary)) {
webmaster@0 44 echo("
webmaster@0 45 <q id='Summary'>
webmaster@0 46 {$Summary}
webmaster@0 47 </q>\n");
webmaster@0 48 }*/ ?>
webmaster@0 49 <h1>Dual Blog : DeFr's Weblog</h1>
webmaster@0 50 <div id="Posts">