Example #1
0
function exec_calendrier_args($time, $type, $echelle, $partie_cal)
{
	if ($time < 0) $time = time();

	if (!$type)
		$type = 'mois';
	elseif ($type == 'semaine')
		$GLOBALS['afficher_bandeau_calendrier_semaine'] = true;

	$ancre = 'calendrier-1';
	$r = generer_url_ecrire('calendrier', "type=$type") . "#$ancre";
	$r = http_calendrier_init($time, $type, $echelle, $partie_cal, $r);

	if (_AJAX) {
		ajax_retour($r);
	} else {
		$date = date("Y-m-d", $time);
		if ($type == 'jour') {
			$titre = nom_jour($date)." ". affdate_jourcourt($date);
		}  else {
			$titre = _T('titre_page_calendrier',
					array('nom_mois' => nom_mois($date),
						'annee' => annee($date)));
		}

		$commencer_page = charger_fonction('commencer_page', 'inc');
		echo $commencer_page($titre, "accueil", "calendrier");
// ne produit rien par defaut, mais est utilisee par le plugin agenda
		echo barre_onglets("calendrier", "calendrier"); 
		echo debut_grand_cadre(true);
		echo "\n<div>&nbsp;</div>\n<div id='", $ancre, "'>",$r,'</div>';
		echo fin_grand_cadre(true);
		echo fin_page();
	}
}
function BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_articles';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_auteurs_liens');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.titre", "articles.id_article", "articles.lang", "articles.texte", "articles.descriptif", "articles.chapo", "articles.date");
        $command['orderby'] = array('articles.titre');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L1.id_auteur', sql_quote($Pile[$SP]['id_auteur'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_articles', 39, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t1 = '
			<h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/spip.php?action=converser&amp;redirect=' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '%2F' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '&amp;var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" hreflang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3>
			<div class="detail">
				' . interdire_scripts(nom_jour(normaliser_date($Pile[$SP]['date']))) . ' ' . interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))) . '
			</div>
		';
            $t0 .= (strlen($t1) && strlen($t0) ? '<br />' : '') . $t1;
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_articles @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #3
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),''));	
}
Example #4
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;
}
Example #5
0
function statistiques_href($jour, $moyenne, $script, $value='')
{
	$ce_jour=date("Y-m-d H:i:s", $jour);
	$title = nom_jour($ce_jour) . ' '
	  . ($script ? affdate_heure($ce_jour) :
	     (affdate_jourcourt($ce_jour)  .' '.
	      (" | " ._T('info_visites')." $value | " ._T('info_moyenne')." "
	       . round($moyenne,2))));
	return attribut_html(supprimer_tags($title));
}
Example #6
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 = '')
{
    $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'));
}
Example #7
0
function http_calendrier_jour($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre, $evt){
	global $spip_ecran;
	if (!isset($spip_ecran)) $spip_ecran = isset($_COOKIE['spip_ecran']) ? $_COOKIE['spip_ecran'] : "large";

	$id = ($ancre ? $ancre : 'agenda') . "-nav";

	return 
	  "<div><div id='$id'></div>" .
	  "<table class='calendrier calendrier-$spip_ecran'>" .
	  http_calendrier_navigation($annee, $mois, $jour, $echelle, $partie_cal,
				     (nom_jour("$annee-$mois-$jour") . " " .
				      affdate_jourcourt("$annee-$mois-$jour")),
				     $script,
				     array($annee, $mois, ($jour-1), "jour"),
				     array($annee, $mois, ($jour+1), "jour"),
				     'jour',
				     $ancre) .
	  (!is_array($evt) ? ("<tr><td>$evt</td></tr>") :
	   (http_calendrier_jour_noms($annee, $mois, $jour, $echelle, $partie_cal, $script, $ancre) .
	    http_calendrier_jour_sept($annee, $mois, $jour, $echelle,  $partie_cal, $script, $ancre, $evt))) .
	  "</table>" .
	  "</div>";
}
Example #8
0
function http_affiche_message($id_message, $expediteur, $statut, $type, $texte, $titre, $rv, $date_heure, $date_fin, $cherche_auteur, $forcer_dest)
{
  global $connect_id_auteur,$connect_statut, $les_notes; 

	if ($type == 'normal') {
		$le_type = _T('info_message_2').aide ("messut");
		$la_couleur = "#02531b";
		$fond = "#cffede";
	}
	else if ($type == 'pb') {
		$le_type = _T('info_pense_bete').aide ("messpense");
		$la_couleur = "#3874b0";
		$fond = "#edf3fe";
	}
	else if ($type == 'affich') {
		$le_type = _T('info_annonce');
		$la_couleur = "#ccaa00";
		$fond = "#ffffee";
	}
	
	// affichage des caracteristiques du message

	echo "<div style='border: 1px solid $la_couleur; background-color: $fond; padding: 5px;'>"; // debut cadre de couleur
	//echo debut_cadre_relief("messagerie-24.gif", true);
	echo "\n<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
	echo "<tr><td>"; # uniques

	echo "<span style='color: $la_couleur' class='verdana1 spip_small'><b>$le_type</b></span><br />";
	echo "<span class='verdana1 spip_large'><b>$titre</b></span>";
	if ($statut == 'redac') {
		echo "<br /><span style='color: red;' class='verdana1 spip_small'><b>"._T('info_redaction_en_cours')."</b></span>";
	}
	else if ($rv == 'non') {
		echo "<br /><span style='color: #666666;' class='verdana1 spip_small'><b>".nom_jour($date_heure).' '.affdate_heure($date_heure)."</b></span>";
	}


	//////////////////////////////////////////////////////
	// Message avec participants
	//
	
	if ($type == 'normal')
	  $total_dest = http_message_avec_participants($id_message, $statut, $forcer_dest, $cherche_auteur, $expediteur);

	if ($rv != "non") http_afficher_rendez_vous($date_heure, $date_fin);


	//////////////////////////////////////////////////////
	// Le message lui-meme
	//

	echo "\n<br />"
	  . "<div class='serif'>$texte</div>";

	if ($les_notes) {
		echo debut_cadre_relief('', true);
		echo "<div dir=" . lang_dir() ."' class='arial11'>";
		echo justifier("<b>"._T('info_notes')."&nbsp;:</b> ".$les_notes);
		echo "</div>";
		echo fin_cadre_relief(true);
	}

	if ($expediteur == $connect_id_auteur AND $statut == 'redac') {
	  if ($type == 'normal' AND $total_dest < 2) {
	    echo "<p style='color: #666666; text-align: right;' class='verdana1 spip_small'><b>"._T('avis_destinataire_obligatoire')."</b></p>";
	  } else {
	    echo "\n<div class='centered'>";
	    echo icone_inline(_T('icone_envoyer_message'), redirige_action_auteur('editer_message', "$id_message/publie", "message","id_message=$id_message"), "messagerie-24.gif", "creer.gif");
	    echo "</div>";
	  }
	}
	echo "</td></tr></table>\n";

	//	echo "</td></tr></table>\n"; //echo fin_cadre_relief(true);
	echo "</div>";			// fin du cadre de couleur
	
	// Les boutons

	$aut = ($expediteur == $connect_id_auteur);
	$aff = ($type == 'affich' AND $connect_statut == '0minirezo');

	echo "\n<table width='100%'><tr><td>";

	// bouton de suppression

	if ($aut AND ($statut == 'redac' OR $type == 'pb') OR $aff) {
	  echo icone_inline(_T('icone_supprimer_message'), redirige_action_auteur("editer_message","-$id_message", 'messagerie'), "messagerie-24.gif", "supprimer.gif", 'left');
	}

	// bouton retrait de la discussion

	if ($statut == 'publie' AND $type == 'normal') {
	  echo icone_inline(_T('icone_arret_discussion'), redirige_action_auteur("editer_message","$id_message/-$connect_id_auteur", 'messagerie', "id_message=$id_message"), "messagerie-24.gif", "supprimer.gif", 'left');
	}

	// bouton modifier ce message

	if ($aut OR $aff) {
	  echo icone_inline(_T('icone_modifier_message'), (generer_url_ecrire("message_edit","id_message=$id_message")), "messagerie-24.gif", "edit.gif", 'right');
	}
	echo "</td></tr></table>";
}
function BOUCLE_article_languehtml_76ddbc2b5f1671bea60186a8fa5bb500(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $doublons_index = array();
    $command['pagination'] = array(isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : null, 10);
    // Initialise le(s) critère(s) doublons
    if (!isset($doublons[$d = 'articles' . 'archives'])) {
        $doublons[$d] = '';
    }
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_article_langue';
        $command['from'] = array('articles' => 'spip_articles');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("articles.id_article", "articles.date_redac", "articles.surtitre", "articles.titre", "articles.soustitre", "articles.descriptif", "articles.chapo", "articles.texte", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array(sql_in('articles.id_article', $doublons[$doublons_index[] = 'articles' . 'archives'], 'NOT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/agenda.html', 'html_76ddbc2b5f1671bea60186a8fa5bb500', '_article_langue', 41, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        // COMPTEUR
        $Numrows['_article_langue']['compteur_boucle'] = 0;
        $Numrows['_article_langue']['total'] = @intval($iter->count());
        $debut_boucle = isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : _request('debut_article_langue');
        if (substr($debut_boucle, 0, 1) == '@') {
            $debut_boucle = $Pile[0]['debut_article_langue'] = quete_debut_pagination('id_article', $Pile[0]['@id_article'] = substr($debut_boucle, 1), 10, $iter);
            $iter->seek(0);
        }
        $debut_boucle = intval($debut_boucle);
        $debut_boucle = ($tout = $debut_boucle == -1) ? 0 : $debut_boucle;
        $debut_boucle = max(0, min($debut_boucle, floor(($Numrows['_article_langue']['total'] - 1) / 10) * 10));
        $debut_boucle = intval($debut_boucle);
        $fin_boucle = min($tout ? $Numrows['_article_langue']['total'] : $debut_boucle + 9, $Numrows['_article_langue']['total'] - 1);
        $Numrows['_article_langue']['grand_total'] = $Numrows['_article_langue']['total'];
        $Numrows['_article_langue']["total"] = max(0, $fin_boucle - $debut_boucle + 1);
        if ($debut_boucle > 0 and $debut_boucle < $Numrows['_article_langue']['grand_total'] and $iter->seek($debut_boucle, 'continue')) {
            $Numrows['_article_langue']['compteur_boucle'] = $debut_boucle;
        }
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $Numrows['_article_langue']['compteur_boucle']++;
            if ($Numrows['_article_langue']['compteur_boucle'] <= $debut_boucle) {
                continue;
            }
            if ($Numrows['_article_langue']['compteur_boucle'] - 1 > $fin_boucle) {
                break;
            }
            foreach ($doublons_index as $k) {
                $doublons[$k] .= "," . $Pile[$SP]['id_article'];
            }
            // doublons
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
    <hr />
        <h4>' . nom_jour(normaliser_date($Pile[$SP]['date_redac'])) . ' ' . affdate(normaliser_date($Pile[$SP]['date_redac'])) . (($t1 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t2 . ':' : '') . (($t2 = strval(minutes(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t2 . (' ' . _T('public|spip|ecrire:heures')) : '') : '')) !== '' ? ' — ' . $t1 : '') . '</h4>
    <hr />
      ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_article', 'ON', $Pile[$SP]['id_article'], '', 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']}'\"" : "") . ' />', '150', '0')))) !== '' ? '<span style="float:right;">' . $t1 . '</span>' : '') . '
			' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['surtitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="surtitre">' . $t1 . '</div>' : '') . '
      <h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3>
      ' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['soustitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="sous-titre">' . $t1 . '</div>' : '') . '
      <div class="detail">
      </div><!-- detail -->
      ' . (($t1 = strval(interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]) ? (($t2 = strval(interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0])))) !== '' ? '<div class="">' . $t2 . ('</div>
		<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
		' : interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0]) ? (($t3 = strval(interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0])))) !== '' ? '<div class="">' . $t3 . ('</div>
      	<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
      		' : (($t3 = strval(interdire_scripts(couper(propre($Pile[$SP]['texte'], $connect, $Pile[0]), '300')))) !== '' ? '<div class="">' . $t3 . ('</div>
      	<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
		') . '
	'))) !== '' ? '<div class="texte">
	<div class="extrait">' . $t1 . '</div><!-- fin extrait -->
      </div>' : '') . '
      <br />
    ';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_article_langue @ squelettes/agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_articles_rubriquehtml_8bf8bdc0aa13e79e11d908f1699ff96f(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $command['pagination'] = array(isset($Pile[0]['debut_articles_rubrique']) ? $Pile[0]['debut_articles_rubrique'] : null, 10);
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_articles_rubrique';
        $command['from'] = array('articles' => 'spip_articles');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("articles.id_rubrique", "0+articles.titre AS num", "articles.date", "articles.id_article", "articles.surtitre", "articles.descriptif", "articles.titre", "articles.soustitre", "articles.chapo", "articles.texte", "articles.lang");
        $command['orderby'] = array('num', 'articles.date DESC');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), sql_in('articles.id_rubrique', calcul_branche_in(sql_quote(@$Pile[0]['id_rubrique']))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-rub-articles.html', 'html_8bf8bdc0aa13e79e11d908f1699ff96f', '_articles_rubrique', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        // COMPTEUR
        $Numrows['_articles_rubrique']['compteur_boucle'] = 0;
        $Numrows['_articles_rubrique']['total'] = @intval($iter->count());
        $debut_boucle = isset($Pile[0]['debut_articles_rubrique']) ? $Pile[0]['debut_articles_rubrique'] : _request('debut_articles_rubrique');
        if (substr($debut_boucle, 0, 1) == '@') {
            $debut_boucle = $Pile[0]['debut_articles_rubrique'] = quete_debut_pagination('id_article', $Pile[0]['@id_article'] = substr($debut_boucle, 1), 10, $iter);
            $iter->seek(0);
        }
        $debut_boucle = intval($debut_boucle);
        $debut_boucle = ($tout = $debut_boucle == -1) ? 0 : $debut_boucle;
        $debut_boucle = max(0, min($debut_boucle, floor(($Numrows['_articles_rubrique']['total'] - 1) / 10) * 10));
        $debut_boucle = intval($debut_boucle);
        $fin_boucle = min($tout ? $Numrows['_articles_rubrique']['total'] : $debut_boucle + 9, $Numrows['_articles_rubrique']['total'] - 1);
        $Numrows['_articles_rubrique']['grand_total'] = $Numrows['_articles_rubrique']['total'];
        $Numrows['_articles_rubrique']["total"] = max(0, $fin_boucle - $debut_boucle + 1);
        if ($debut_boucle > 0 and $debut_boucle < $Numrows['_articles_rubrique']['grand_total'] and $iter->seek($debut_boucle, 'continue')) {
            $Numrows['_articles_rubrique']['compteur_boucle'] = $debut_boucle;
        }
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $Numrows['_articles_rubrique']['compteur_boucle']++;
            if ($Numrows['_articles_rubrique']['compteur_boucle'] <= $debut_boucle) {
                continue;
            }
            if ($Numrows['_articles_rubrique']['compteur_boucle'] - 1 > $fin_boucle) {
                break;
            }
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
			<br class="nettoyeur" />
			' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', strlen($logo = !is_array($l = quete_logo('id_article', 'ON', $Pile[$SP]['id_article'], '', 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']}'\"" : "") . ' />') ? '<a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '">' . $logo . '</a>' : '', '120', '0')))) !== '' ? '<div class="logo-liste-art">
				' . $t1 . '
			</div>' : '') . '
			' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['surtitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="surtitre">' . $t1 . '</div>' : '') . '
			<h3>
			<a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(propre($Pile[$SP]['descriptif'], $connect, $Pile[0])))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>
			' . BOUCLE_articles_rubrique_nomhtml_8bf8bdc0aa13e79e11d908f1699ff96f($Cache, $Pile, $doublons, $Numrows, $SP) . '
			</h3>
      	' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['soustitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="sous-titre">' . $t1 . '</div>' : '') . '
		<div class="detail">
			' . (($t1 = strval(interdire_scripts(nom_jour(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span class="date">' . $t1 : '') . ' ' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? $t1 . '</span>' : '') . ' 
			' . (($t1 = strval(recuperer_fond('modeles/lesauteurs', array('objet' => 'article', 'id_objet' => $Pile[$SP]['id_article'], 'id_article' => $Pile[$SP]['id_article']), array('trim' => true, 'compil' => array('squelettes/inc/inc-rub-articles.html', 'html_8bf8bdc0aa13e79e11d908f1699ff96f', '_articles_rubrique', 17, $GLOBALS['spip_lang'])), ''))) !== '' ? '<span class="auteurs">' . _T('public|spip|ecrire:par_auteur') . ' ' . $t1 . '</span>' : '') . '				
		</div><!-- detail -->
      <div class="texte">
	' . (($t1 = strval(interdire_scripts(filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['descriptif'], $connect, $Pile[0]), '552', '0')) ? (($t2 = strval(interdire_scripts(filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['descriptif'], $connect, $Pile[0]), '552', '0'))))) !== '' ? '<div class="">' . $t2 . ('</div>
		<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
		' : interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0]) ? (($t3 = strval(interdire_scripts(filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['chapo'], $connect, $Pile[0]), '552', '0'))))) !== '' ? '<div class="">' . $t3 . ('</div>
      	<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
      		' : (($t3 = strval(interdire_scripts(couper(propre($Pile[$SP]['texte'], $connect, $Pile[0]), '300')))) !== '' ? '<div class="">' . $t3 . ('</div>
      	<div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . '
		') . '
	'))) !== '' ? '<div class="extrait">' . $t1 . '</div><!-- fin extrait -->' : '') . '
      </div><!-- fin texte -->
      <br class="nettoyeur" />
		';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_articles_rubrique @ squelettes/inc/inc-rub-articles.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #11
0
function http_calendrier_suite_heures($jour_today, $mois_today, $annee_today, $articles, $breves, $evenements, $partie_cal, $echelle, $script, $nav)
{
    global $couleur_claire, $couleur_foncee, $prefs;
    if ($partie_cal == "soir") {
        $debut = 12;
        $fin = 23;
    } else {
        if ($partie_cal == "matin") {
            $debut = 4;
            $fin = 15;
        } else {
            $debut = 7;
            $fin = 20;
        }
    }
    if ($prefs['screen'] == "wide") {
        $largeur = 90;
    } else {
        $largeur = 60;
    }
    $jour_semaine = date("w", mktime(1, 1, 1, $mois_today, $jour_today, $annee_today));
    if ($jour_semaine == 0) {
        $jour_semaine = 7;
    }
    $intitul = array();
    $liens = array();
    for ($j = 0; $j < 7; $j++) {
        $nom = mktime(0, 0, 0, $mois_today, $jour_today - $jour_semaine + $j + 1, $annee_today);
        $date = date("Y-m-d", $nom);
        $v = array('date' => date("Ymd", $nom), 'nom' => nom_jour($date), 'jour' => journum($date), 'mois' => mois($date), 'annee' => annee($date), 'index' => date("w", $nom));
        $intitul[$j] = $v;
        $liens[$j] = http_href($script . (strpos($script, '?') ? '&' : '?') . "type=jour&jour=" . $v['jour'] . "&mois=" . $v['mois'] . "&annee=" . $v['annee'] . $nav, $v['nom'] . " " . _T('date_day_' . $v['jour']) . ($nav ? '/' . (0 + $v['mois']) : ''), '', 'color:black;');
    }
    list($dimheure, $dimjour, $fontsize, $padding) = calendrier_echelle($debut, $fin, $echelle);
    $today = getdate(time());
    $jour_t = $today["mday"];
    $mois_t = $today["mon"];
    $annee_t = $today["year"];
    $total = '';
    $style = !_DIR_RESTREINT ? 'padding: 5px;' : "position: absolute; z-index: 2; top: 10px; left: " . round($largeur / 2) . 'px';
    foreach ($intitul as $k => $v) {
        $d = $v['date'];
        $arbrev = !($articles[$d] or $breves[$d]) ? '' : http_calendrier_articles_et_breves($articles[$d], $breves[$d], $style);
        $total .= "\n<td style='width: 14%; height: 100px;  vertical-align: top'>\n\t\t\t<div style='background-color: " . ($v['index'] == 0 ? $couleur_claire : (($v['jour'] == $jour_t and $v['mois'] == $mois_t and $v['annee'] == $annee_t) ? "white;" : "#eeeeee;")) . "'>" . "\n<div style='position: relative; color: #999999; width: 100%; " . "border-left: 1px solid {$couleur_claire}; " . "border-bottom: 1px solid {$couleur_claire}; " . "height: {$dimjour}px; " . "font-size: {$fontsize}px;'>" . http_calendrier_jour_ics($debut, $fin, $largeur, 'calendrier_div_style', $echelle, $evenements[$d], $d) . (!_DIR_RESTREINT ? "</div></div>{$arbrev}" : "{$arbrev}</div></div>") . "\n</td>";
    }
    return "<table border='0' cellspacing='0' cellpadding='0' width='98%'>" . http_calendrier_navigation_semaine($jour_today, $mois_today, $annee_today, $partie_cal, $echelle, $jour_semaine, $script, $nav) . http_calendrier_les_jours($liens, $couleur_claire, $couleur_foncee) . "\n<tr>{$total}</tr>" . "</table>";
}