Exemple #1
0
/**
 * Afficher de facon textuelle les dates de debut et fin en fonction des cas
 * - Le lundi 20 fevrier a 18h
 * - Le 20 fevrier de 18h a 20h
 * - Du 20 au 23 fevrier
 * - du 20 fevrier au 30 mars
 * - du 20 fevrier 2007 au 30 mars 2008
 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour
 * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal)
 * 
 * @param string $date_debut
 * @param string $date_fin
 * @param string $horaire
 * @param string $forme
 * @return string
 */
function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){
	static $trans_tbl=NULL;
	if ($trans_tbl==NULL){
		$trans_tbl = get_html_translation_table (HTML_ENTITIES);
		$trans_tbl = array_flip ($trans_tbl);
	}
	
	$abbr = '';
	if (strpos($forme,'abbr')!==false) $abbr = 'abbr';
	$affdate = "affdate_jourcourt";
	if (strpos($forme,'annee')!==false) $affdate = 'affdate';
	
	$dtstart = $dtend = $dtabbr = "";
	if (strpos($forme,'hcal')!==false) {
		$dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>";
		$dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>";
		$dtabbr = "</abbr>";
	}
	
	$date_debut = strtotime($date_debut);
	$date_fin = strtotime($date_fin);
	$d = date("Y-m-d", $date_debut);
	$f = date("Y-m-d", $date_fin);
	$h = $horaire=='oui';
	$hd = date("H:i",$date_debut);
	$hf = date("H:i",$date_fin);
	$au = " " . strtolower(_T('agenda:evenement_date_au'));
	$du = _T('agenda:evenement_date_du') . " ";
	$s = "";
	if ($d==$f)
	{ // meme jour
		$s = ucfirst(nom_jour($d,$abbr))." ".$affdate($d);
		if ($h)
			$s .= " $hd";
		$s = "$dtstart$s$dtabbr";
		if ($h AND $hd!=$hf) $s .= "-$dtend$hf$dtabbr";
	}
	else if ((date("Y-m",$date_debut))==date("Y-m",$date_fin))
	{ // meme annee et mois, jours differents
		if ($h){
			$s = $du . $dtstart . affdate_jourcourt($d) . " $hd" . $dtabbr;
			$s .= $au . $dtend . $affdate($f);
			if ($hd!=$hf) $s .= " $hf";
			$s .= $dtabbr;
		}
		else {
			$s = $du . $dtstart . jour($d) . $dtabbr;
			$s .= $au . $dtend . $affdate($f) . $dtabbr;
		}
	}
	else if ((date("Y",$date_debut))==date("Y",$date_fin))
	{ // meme annee, mois et jours differents
		$s = $du . $dtstart . affdate_jourcourt($d);
		if ($h) $s .= " $hd";
		$s .= $dtabbr . $au . $dtend . $affdate($f);
		if ($h) $s .= " $hf";
		$s .= $dtabbr;
	}
	else
	{ // tout different
		$s = $du . $dtstart . affdate($d);
		if ($h)
			$s .= " ".date("(H:i)",$date_debut);
		$s .= $dtabbr . $au . $dtend. affdate($f);
		if ($h)
			$s .= " ".date("(H:i)",$date_fin);
		$s .= $dtabbr;
	}
	return unicode2charset(charset2unicode(strtr($s,$trans_tbl),''));	
}
/**
 * Afficher de facon textuelle les dates de debut et fin en fonction des cas
 * - Le lundi 20 fevrier a 18h
 * - Le 20 fevrier de 18h a 20h
 * - Du 20 au 23 fevrier
 * - du 20 fevrier au 30 mars
 * - du 20 fevrier 2007 au 30 mars 2008
 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour
 * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal)
 * 
 * @param string $date_debut
 * @param string $date_fin
 * @param string $horaire
 * @param string $forme
 * @return string
 */
function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '')
{
    $abbr = '';
    if (strpos($forme, 'abbr') !== false) {
        $abbr = 'abbr';
    }
    $affdate = "affdate_jourcourt";
    if (strpos($forme, 'annee') !== false) {
        $affdate = 'affdate';
    }
    $dtstart = $dtend = $dtabbr = "";
    if (strpos($forme, 'hcal') !== false) {
        $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
        $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
        $dtabbr = "</abbr>";
    }
    $date_debut = strtotime($date_debut);
    $date_fin = strtotime($date_fin);
    $d = date("Y-m-d", $date_debut);
    $f = date("Y-m-d", $date_fin);
    $h = $horaire == 'oui';
    $hd = date("H:i", $date_debut);
    $hf = date("H:i", $date_fin);
    $au = " " . strtolower(_T('agenda:evenement_date_au'));
    $du = _T('agenda:evenement_date_du') . " ";
    $s = "";
    if ($d == $f) {
        // meme jour
        $s = ucfirst(nom_jour($d, $abbr)) . " " . $affdate($d);
        if ($h) {
            $s .= " {$hd}";
        }
        $s = "{$dtstart}{$s}{$dtabbr}";
        if ($h and $hd != $hf) {
            $s .= "-{$dtend}{$hf}{$dtabbr}";
        }
    } else {
        if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) {
            // meme annee et mois, jours differents
            if ($h) {
                $s = $du . $dtstart . affdate_jourcourt($d) . " {$hd}" . $dtabbr;
                $s .= $au . $dtend . $affdate($f);
                if ($hd != $hf) {
                    $s .= " {$hf}";
                }
                $s .= $dtabbr;
            } else {
                $s = $du . $dtstart . jour($d) . $dtabbr;
                $s .= $au . $dtend . $affdate($f) . $dtabbr;
            }
        } else {
            if (date("Y", $date_debut) == date("Y", $date_fin)) {
                // meme annee, mois et jours differents
                $s = $du . $dtstart . affdate_jourcourt($d);
                if ($h) {
                    $s .= " {$hd}";
                }
                $s .= $dtabbr . $au . $dtend . $affdate($f);
                if ($h) {
                    $s .= " {$hf}";
                }
                $s .= $dtabbr;
            } else {
                // tout different
                $s = $du . $dtstart . affdate($d);
                if ($h) {
                    $s .= " " . date("(H:i)", $date_debut);
                }
                $s .= $dtabbr . $au . $dtend . affdate($f);
                if ($h) {
                    $s .= " " . date("(H:i)", $date_fin);
                }
                $s .= $dtabbr;
            }
        }
    }
    return unicode2charset(charset2unicode($s, 'AUTO'));
}
Exemple #3
0
/**
 * Afficher de facon textuelle les dates de debut et fin en fonction des cas
 * - Lundi 20 fevrier a 18h
 * - Le 20 fevrier de 18h a 20h
 * - Du 20 au 23 fevrier
 * - Du 20 fevrier au 30 mars
 * - Du 20 fevrier 2007 au 30 mars 2008
 * $horaire='oui' ou true permet d'afficher l'horaire, toute autre valeur n'indique que le jour
 * $forme peut contenir une ou plusieurs valeurs parmi
 *  - abbr (afficher le nom des jours en abbrege)
 *  - hcal (generer une date au format hcal)
 *  - jour (forcer l'affichage des jours)
 *  - annee (forcer l'affichage de l'annee)
 *
 * @param string $date_debut
 * @param string $date_fin
 * @param string $horaire
 * @param string $forme
 * @return string
 */
function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '')
{
    $abbr = $jour = '';
    $affdate = "affdate_jourcourt";
    if (strpos($forme, 'abbr') !== false) {
        $abbr = 'abbr';
    }
    if (strpos($forme, 'annee') !== false) {
        $affdate = 'affdate';
    }
    if (strpos($forme, 'jour') !== false) {
        $jour = 'jour';
    }
    $dtstart = $dtend = $dtabbr = "";
    if (strpos($forme, 'hcal') !== false) {
        $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>";
        $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>";
        $dtabbr = "</abbr>";
    }
    $date_debut = strtotime($date_debut);
    $date_fin = strtotime($date_fin);
    $d = date("Y-m-d", $date_debut);
    $f = date("Y-m-d", $date_fin);
    $h = ($horaire === 'oui' or $horaire === true);
    $hd = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_debut), 'm' => date("i", $date_debut)));
    $hf = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_fin), 'm' => date("i", $date_fin)));
    if ($d == $f) {
        // meme jour
        $nomjour = nom_jour($d, $abbr);
        $s = $affdate($d);
        $s = _T('date_fmt_jour', array('nomjour' => $nomjour, 'jour' => $s));
        if ($h) {
            if ($hd == $hf) {
                // Lundi 20 fevrier a 18h25
                $s = spip_ucfirst(_T('date_fmt_jour_heure', array('jour' => $s, 'heure' => $hd)));
                $s = "{$dtstart}{$s}{$dtabbr}";
            } else {
                // Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr>
                if ($dtabbr && $dtstart && $dtend) {
                    $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin_abbr', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf, 'dtstart' => $dtstart, 'dtend' => $dtend, 'dtabbr' => $dtabbr)));
                } else {
                    $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf)));
                }
            }
        } else {
            if ($dtabbr && $dtstart) {
                $s = $dtstart . spip_ucfirst($s) . $dtabbr;
            } else {
                $s = spip_ucfirst($s);
            }
        }
    } else {
        if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) {
            // meme annee et mois, jours differents
            if (!$h) {
                $date_debut = jour($d);
            } else {
                $date_debut = $affdate($d);
            }
            $date_fin = $affdate($f);
            if ($jour) {
                $nomjour_debut = nom_jour($d, $abbr);
                $date_debut = _T('date_fmt_jour', array('nomjour' => $nomjour_debut, 'jour' => $date_debut));
                $nomjour_fin = nom_jour($f, $abbr);
                $date_fin = _T('date_fmt_jour', array('nomjour' => $nomjour_fin, 'jour' => $date_fin));
            }
            if ($h) {
                $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd));
                $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf));
            }
            $date_debut = $dtstart . $date_debut . $dtabbr;
            $date_fin = $dtend . $date_fin . $dtabbr;
            $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin));
        } else {
            $date_debut = affdate($d);
            $date_fin = affdate($f);
            if ($jour) {
                $nomjour_debut = nom_jour($d, $abbr);
                $date_debut = _T('date_fmt_jour_periode', array('nomjour' => $nomjour_debut, 'jour' => $date_debut));
                $nomjour_fin = nom_jour($f, $abbr);
                $date_fin = _T('date_fmt_jour_periode', array('nomjour' => $nomjour_fin, 'jour' => $date_fin));
            }
            if ($h) {
                $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd));
                $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf));
            }
            $date_debut = $dtstart . $date_debut . $dtabbr;
            $date_fin = $dtend . $date_fin . $dtabbr;
            $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin));
        }
    }
    return $s;
}
function html_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0)
{
    if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) {
        $doublons = nettoyer_env_doublons($Pile[0]["doublons"]);
    }
    $connect = '';
    $page = BOUCLE_lien_webfontshtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . '

<!-- META DATA -->
	<meta http-equiv="Content-Type" content="text/html; charset=' . interdire_scripts($GLOBALS['meta']['charset']) . '" />
	<meta http-equiv="Content-language" content="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" />
	<meta name="language" content="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" />
	<meta http-equiv="Content-Style-Type" content="text/css" />
	<meta http-equiv="Content-Script-Type" content="text/javascript" />
	<meta name="generator" content="SPIP' . (($t1 = strval(spip_version())) !== '' ? ' ' . $t1 : '') . '" />
	<meta name="robots" content="index,follow" />
	<link rel="schema.DCTERMS"  href="http://purl.org/dc/terms/" />
	<link rel="schema.DC"       href="http://purl.org/dc/elements/1.1/" />
' . (($t1 = BOUCLE_article_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 : '
' . (($t2 = BOUCLE_breve_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t2 : (($t3 = BOUCLE_mot_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t3 : (($t4 = BOUCLE_rubrique_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t4 : (($t5 = BOUCLE_site_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t5 : '  
	<!-- META pages recapitulatives - META summary pages -->
' . (($t6 = BOUCLE_keywords_recaphtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
  <meta name="keywords" content="' . $t6 . '" />' : '') . '
  ' . (($t6 = strval(interdire_scripts(attribut_html(propre($GLOBALS['meta']['descriptif_site'], $connect, $Pile[0]))))) !== '' ? '<meta name="description" content="' . $t6 . '" />' : '') . '
  <meta name="author" content="' . BOUCLE_author_recaphtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . '" />
  <!-- META Dublin Core - voir: http://uk.dublincore.org/documents/dcq-html/  -->
  ' . (($t6 = strval(interdire_scripts(entites_html(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])))))) !== '' ? '<meta name="DC.title" content="' . $t6 . '" />
  ' : '') . (($t6 = strval(spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']))) !== '' ? '<meta name="DC.language" scheme="ISO639-1" content="' . $t6 . '" />
  ' : '') . (($t6 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.identifier" scheme="DCTERMS.URI" content="' . $t6 . '" />
  ' : '') . (($t6 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.source" scheme="DCTERMS.URI" content="' . $t6 . '" />' : '') . BOUCLE_recap_auteursDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . (($t6 = strval(interdire_scripts(attribut_html(couper(propre($GLOBALS['meta']['descriptif_site'], $connect, $Pile[0]), '150'))))) !== '' ? '
  <meta name="DC.description" content="' . $t6 . '" />' : '') . (($t6 = BOUCLE_recap_subjectDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
  <meta name="DC.subject" content="' . $t6 . '" />' : '') . (($t6 = strval(interdire_scripts(date_iso(normaliser_date(@$Pile[0]['date']))))) !== '' ? '
  <meta name="DC.date" scheme="ISO8601" content="' . $t6 . '" />' : '') . '

'))))) . '

' . (($t1 = strval(interdire_scripts(($a = extraire_attribut(filtrer('image_graver', filtrer('image_format', filtrer('image_recadre', filtrer('image_passe_partout', ($a = ($a = table_valeur(@$Pile[0], (string) 'favicon', null) or is_string($a) and strlen($a)) ? $a : find_in_path('favicon.ico') or is_string($a) and strlen($a)) ? $a : (!is_array($l = quete_logo('id_syndic', 'ON', "'0'", '', 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />'), '32', '32'), '32', '32', 'center'), 'ico')), 'src') or is_string($a) and strlen($a)) ? $a : find_in_path('spip.ico')))) !== '' ? '  <link rel="shortcut icon" href="' . $t1 . '" type="image/x-icon" />' : '') . '

' . (($t1 = strval(interdire_scripts(generer_url_public('backend', '')))) !== '' ? '  <link rel="alternate" type="application/rss+xml" title="' . _T('public|spip|ecrire:syndiquer_site') . ' : ' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '" href="' . $t1 . '" />' : '') . '

';
    return analyse_resultat_skel('html_f7a72f7c15527e9fefe562fecb18cf87', $Cache, $page, 'squelettes/inc/inc-meta.html');
}