Example #1
0
function url_nettoyer($titre,$longueur_maxi,$longueur_min=0,$separateur='-',$filtre=''){
	if (!defined('_TRANSLITTERER_URL')) define('_TRANSLITTERER_URL', true);
	
	$titre = supprimer_tags(supprimer_numero(extraire_multi($titre)));
	$url = corriger_caracteres($titre);
	
	
	if (_TRANSLITTERER_URL) $url = translitteration($url);

	if ($filtre)
		$url = $filtre($url);

	// on va convertir tous les caracteres de ponctuation et espaces
	// a l'exception de l'underscore (_), car on veut le conserver dans l'url
	$url = str_replace('_', chr(7), $url);
	$url = @preg_replace(',[[:punct:][:space:]]+,u', ' ', $url);
	$url = str_replace(chr(7), '_', $url);

	// S'il reste trop de caracteres non latins, les gerer comme wikipedia
	// avec rawurlencode :
	if (_TRANSLITTERER_URL && preg_match_all(",[^a-zA-Z0-9 _]+,", $url, $r, PREG_SET_ORDER)) {
		foreach ($r as $regs) {
			$url = substr_replace($url, rawurlencode($regs[0]),
				strpos($url, $regs[0]), strlen($regs[0]));
		}
	}

	// S'il reste trop peu, renvoyer vide
	if (strlen($url) < $longueur_min)
		return '';

	// Sinon couper les mots et les relier par des $separateur
	if (_TRANSLITTERER_URL) $mots = preg_split(",[^a-zA-Z0-9_%]+,", $url); 
	else $mots = preg_split(",[\s]+,", $url);
	$url = '';
	foreach ($mots as $mot) {
		if (!strlen($mot)) continue;
		$url2 = $url.$separateur.$mot;

		// Si on depasse $longueur_maxi caracteres, s'arreter
		// ne pas compter 3 caracteres pour %E9 mais un seul
		$long = preg_replace(',%.,', '', $url2);
		if (strlen($long) > $longueur_maxi) {
			break;
		}

		$url = $url2;
	}
	$url = substr($url, 1);

	// On enregistre en utf-8 dans la base
	$url = rawurldecode($url);

	if (strlen($url) < $longueur_min)
		return '';
	return $url;
}
function BOUCLE_documenthtml_b8a8020987dd01f8087ad24f961857eb(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $in = array();
    if (!is_array($a = @$Pile[0]['mode'])) {
        $in[] = $a;
    } else {
        $in = array_merge($in, $a);
    }
    if (!isset($command['table'])) {
        $command['table'] = 'documents';
        $command['id'] = '_document';
        $command['from'] = array('documents' => 'spip_documents', 'L1' => 'spip_types_documents');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("documents.id_document", "L1.titre AS type_document", "documents.taille", "documents.mode", "documents.largeur", "documents.hauteur", "documents.titre", "L1.mime_type");
        $command['orderby'] = array();
        $command['join'] = array('L1' => array('documents', 'extension'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(array('(documents.taille > 0 OR documents.distant=\'oui\')'), array('=', 'documents.id_document', sql_quote(@$Pile[0]['id_document'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')), !(is_array(@$Pile[0]['mode']) ? count(@$Pile[0]['mode']) : strlen(@$Pile[0]['mode'])) ? '' : (is_array(@$Pile[0]['mode']) ? sql_in('documents.mode', sql_quote($in)) : array('=', 'documents.mode', sql_quote(@$Pile[0]['mode'], '', 'varchar(10) NOT NULL DEFAULT \'document\''))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('plugins-dist/medias/modeles/img.html', 'html_b8a8020987dd01f8087ad24f961857eb', '_document', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= '

' . vide($Pile['vars'][$_zzz = (string) 'image'] = interdire_scripts(($a = match(entites_html(sinon(table_valeur(@$Pile[0], (string) 'mode_force', null), interdire_scripts($Pile[$SP]['mode'])), true), 'image|vignette') or is_string($a) and strlen($a)) ? $a : interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'embed', null), true)) ? ' ' : '')) . (($t1 = strval(table_valeur($Pile["vars"], (string) 'image', null))) !== '' ? $t1 . ('
<span class=\'spip_document_' . $Pile[$SP]['id_document'] . ' spip_documents' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true)))) !== '' ? ' spip_documents_' . $t2 : '') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t2 : '') . ' spip_lien_ok\'' . (($t2 = strval(interdire_scripts(match(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true), 'left|right')))) !== '' ? '
 style=\'float:' . $t2 . ';\'' : '') . '>
' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true)))) !== '' ? '<a href="' . $t2 . ('"' . (($t3 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien_class', null), true)))) !== '' ? ' class="' . $t3 . '"' : '') . '>') : '') . '<img src=\'' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true))) . '\'' . (($t2 = strval(interdire_scripts($Pile[$SP]['largeur']))) !== '' ? ' width="' . $t2 . '"' : '') . (($t2 = strval(interdire_scripts($Pile[$SP]['hauteur']))) !== '' ? ' height="' . $t2 . '"' : '') . ' alt="' . interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '"' . (($t2 = strval(interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? ' title="' . $t2 . '"' : '') . ' />' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) ? '</a>' : '') . '</span>
') : '') . (!table_valeur($Pile["vars"], (string) 'image', null) ? ' ' . ('
	' . vide($Pile['vars'][$_zzz = (string) 'fichier'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'src')) . '
	' . vide($Pile['vars'][$_zzz = (string) 'width'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'width')) . '
	' . vide($Pile['vars'][$_zzz = (string) 'height'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'height')) . '
<span class=\'spip_document_' . $Pile[$SP]['id_document'] . ' spip_documents' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true)))) !== '' ? ' spip_documents_' . $t2 : '') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t2 : '') . ' spip_lien_ok\'' . (($t2 = strval(interdire_scripts(match(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true), 'left|right')))) !== '' ? '
 style=\'float:' . $t2 . (';' . (($t3 = strval(table_valeur($Pile["vars"], (string) 'width', null))) !== '' ? ' width:' . $t3 . 'px;' : '') . '\'') : '') . '><a href="' . interdire_scripts(($a = entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) or is_string($a) and strlen($a)) ? $a : vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true)))) . '"' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) ? '' : 'type="' . interdire_scripts($Pile[$SP]['mime_type']) . '"'))) !== '' ? '
 ' . $t2 : '') . (($t2 = strval(interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? ' title="' . $t2 . '"' : '') . '><img src=\'' . table_valeur($Pile["vars"], (string) 'fichier', null) . '\' width=\'' . table_valeur($Pile["vars"], (string) 'width', null) . '\' height=\'' . table_valeur($Pile["vars"], (string) 'height', null) . '\' alt=\'' . interdire_scripts(attribut_html(strlen(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])) ? interdire_scripts(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])) . ' {' . interdire_scripts($Pile[$SP]['type_document']) . '}' : interdire_scripts($Pile[$SP]['type_document']))) . '\' /></a></span>
') : '');
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_document @ plugins-dist/medias/modeles/img.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #3
0
function formulaires_editer_mot_verifier_dist($id_mot = 'new', $id_groupe = 0, $retour = '', $associer_objet = '', $dummy1 = '', $dummy2 = '', $config_fonc = 'mots_edit_config', $row = array(), $hidden = '')
{
    $erreurs = formulaires_editer_objet_verifier('mot', $id_mot, array('titre'));
    // verifier qu'un mot du meme groupe n'existe pas avec le meme titre
    // la comparaison accepte un numero absent ou different
    // sinon avertir
    if (!count($erreurs) and !_request('confirm_titre_mot')) {
        if (sql_countsel("spip_mots", "titre REGEXP " . sql_quote("^([0-9]+[.] )?" . preg_quote(supprimer_numero(_request('titre'))) . "\$") . " AND id_mot<>" . intval($id_mot))) {
            $erreurs['titre'] = _T('mots:avis_doublon_mot_cle') . " <input type='hidden' name='confirm_titre_mot' value='1' />";
        }
    }
    return $erreurs;
}
Example #4
0
function inc_plonger_dist($id_rubrique, $idom = "", $list = array(), $col = 1, $exclu = 0, $do = 'aff')
{
    global $spip_lang_left;
    if ($list) {
        $id_rubrique = $list[$col - 1];
    }
    $ret = '';
    # recherche les filles et petites-filles de la rubrique donnee
    # en excluant une eventuelle rubrique interdite (par exemple, lorsqu'on
    # deplace une rubrique, on peut la deplacer partout a partir de la
    # racine... sauf vers elle-meme ou sa propre branche)
    $ordre = array();
    $rub = array();
    $res = sql_select("rub1.id_rubrique, rub1.titre, rub1.id_parent, rub1.lang, rub1.langue_choisie, rub2.id_rubrique AS id_enfant", "spip_rubriques AS rub1 LEFT JOIN spip_rubriques AS rub2 ON (rub1.id_rubrique = rub2.id_parent)", "rub1.id_parent = " . sql_quote($id_rubrique) . "\n\t\t\tAND rub1.id_rubrique!=" . sql_quote($exclu) . "\n\t\t\tAND (rub2.id_rubrique IS NULL OR rub2.id_rubrique!=" . sql_quote($exclu) . ")", "", "0+rub1.titre,rub1.titre");
    while ($row = sql_fetch($res)) {
        if (autoriser('voir', 'rubrique', $row['id_rubrique'])) {
            $rub[$row['id_rubrique']]['enfants'] = $row['id_enfant'];
            if ($row['id_parent'] == $id_rubrique) {
                $t = trim(typo(supprimer_numero($row['titre'])));
                if ($row['langue_choisie'] != 'oui') {
                    $t .= ' <small title="' . traduire_nom_langue($row['lang']) . '">[' . $row['lang'] . ']</small>';
                }
                $ordre[$row['id_rubrique']] = $t;
            }
        }
    }
    $next = isset($list[$col]) ? $list[$col] : 0;
    if ($ordre) {
        $rec = generer_url_ecrire('plonger', "rac={$idom}&exclus={$exclu}&do={$do}&col=" . ($col + 1));
        $info = generer_url_ecrire('informer', "type=rubrique&rac={$idom}&do={$do}&id=");
        $args = "'{$idom}',this,{$col},'{$spip_lang_left}','{$info}',event";
        while (list($id, $titrebrut) = each($ordre)) {
            $titre = supprimer_numero($titrebrut);
            $classe1 = $id_rubrique ? 'petite-rubrique' : "petit-secteur";
            if (isset($rub[$id]["enfants"])) {
                $classe2 = " class='rub-ouverte'";
                $url = "\nhref='{$rec}&amp;id={$id}'";
            } else {
                $classe2 = $url = '';
                $url = "\nhref='javascript:void(0)'";
            }
            $js_func = $do . '_selection_titre';
            $click = "\nonclick=\"changerhighlight(this.parentNode.parentNode.parentNode);\nreturn " . (!is_array($list) ? ' false' : "aff_selection_provisoire({$id},{$args})") . "\"\nondblclick=\"" . "{$js_func}(this." . "firstChild.nodeValue," . $id . ",'selection_rubrique','id_parent');" . "\nreturn aff_selection_provisoire({$id},{$args});" . "\"";
            $ret .= "<div class='" . ($id == $next ? "item on" : "item") . "'><div class='" . $classe1 . "'><div{$classe2}><a" . $url . $click . ">" . $titre . "</a></div></div></div>";
        }
    }
    $idom2 = $idom . "_col_" . ($col + 1);
    $left = $col * 150;
    return http_img_pack("searching.gif", "*", "style='visibility: hidden; position: absolute; {$spip_lang_left}: " . ($left - 30) . "px; top: 2px; z-index: 2;' id='img_{$idom2}'") . "<div style='width: 150px; height: 100%; overflow: auto; position: absolute; top: 0px; {$spip_lang_left}: " . ($left - 150) . "px;'>" . $ret . "\n</div>\n<div id='{$idom2}'>" . ($next ? inc_plonger_dist($id_rubrique, $idom, $list, $col + 1, $exclu) : "") . "\n</div>";
}
function balise_CLEVERMAIL_UNSUBSCRIBE_dyn()
{
    if (isset($_GET['id']) && $_GET['id'] != '') {
        if (sql_countsel("spip_cm_lists_subscribers", "lsr_id=" . sql_quote($_GET['id'])) == 1) {
            $abonnement = sql_fetsel("*", "spip_cm_lists_subscribers", "lsr_id=" . sql_quote($_GET['id']));
            // Desinscription a cette liste demandee
            $actionId = md5('unsubscribe#' . intval($abonnement['lst_id']) . '#' . intval($abonnement['sub_id']) . '#' . time());
            if (sql_countsel("spip_cm_pending", "lst_id = " . intval($abonnement['lst_id']) . " AND sub_id = " . intval($abonnement['sub_id'])) == 0) {
                sql_insertq("spip_cm_pending", array('lst_id' => intval($abonnement['lst_id']), 'sub_id' => $abonnement['sub_id'], 'pnd_action' => 'unsubscribe', 'pnd_action_date' => time(), 'pnd_action_id' => $actionId));
            }
            // Composition du message de demande de confirmation
            $sub = sql_fetsel("*", "spip_cm_subscribers", "sub_id=" . intval($abonnement['sub_id']));
            $list = sql_fetsel("*", "spip_cm_lists", "lst_id=" . intval($abonnement['lst_id']));
            $template = array();
            if (strpos($list['lst_name'], '/') === false) {
                $template['@@NOM_LETTRE@@'] = supprimer_numero($list['lst_name']);
                $template['@@NOM_CATEGORIE@@'] = '';
                $template['@@NOM_COMPLET@@'] = $template['@@NOM_LETTRE@@'];
            } else {
                $template['@@NOM_LETTRE@@'] = supprimer_numero(substr($list['lst_name'], strpos($list['lst_name'], '/') + 1));
                $template['@@NOM_CATEGORIE@@'] = supprimer_numero(substr($list['lst_name'], 0, strpos($list['lst_name'], '/')));
                $template['@@NOM_COMPLET@@'] = $template['@@NOM_CATEGORIE@@'] . ' / ' . $template['@@NOM_LETTRE@@'];
            }
            $template['@@EMAIL@@'] = $sub['sub_email'];
            $template['@@FORMAT_INSCRIPTION@@'] = $data['lsr_mode'] == 1 ? 'HTML' : 'texte';
            //$template['@@URL_CONFIRMATION@@'] = $GLOBALS['meta']['adresse_site'].'/spip.php?page=clevermail_do&id='.$actionId;
            $template['@@URL_CONFIRMATION@@'] = url_absolue(generer_url_public(_CLEVERMAIL_UNSUBSCRIBE, 'id=' . $actionId));
            $to = $sub['sub_email'];
            $subject = (intval($list['lst_subject_tag']) == 1 ? '[' . $template['@@NOM_COMPLET@@'] . '] ' : '') . html_entity_decode($list['lst_unsubscribe_subject'], ENT_QUOTES, 'UTF-8');
            $body = $list['lst_unsubscribe_text'];
            while (list($translateFrom, $translateTo) = each($template)) {
                $body = str_replace($translateFrom, $translateTo, $body);
            }
            $from = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_FROM'");
            $return = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_RETURN'");
            // TODO : Et le charset ?
            // TODO : Et le return-path ?
            $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
            $envoyer_mail($to, $subject, $body, $from);
            $return = '<p>' . _T('clevermail:desinscription_confirmation_debut') . ' ' . $template['@@NOM_COMPLET@@'] . ' ' . _T('clevermail:desinscription_confirmation_fin') . '</p>';
        } else {
            $return = '<p>' . _T('clevermail:aucune_inscription') . '</p>';
        }
    }
    return $return;
}
function BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_art_agenda';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.date_redac", "articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '0,5';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L2.titre', "'Agenda'"), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-menu-agenda.html', 'html_78503d8cb0bd66f2d97f4b9c0f7d329a', '_art_agenda', 4, $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']);
            $t0 .= '
				<li>' . (($t1 = strval(affdate(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? '<span>' . $t1 . (' ' . (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t3 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t3 . ':' : '') . minutes(normaliser_date($Pile[$SP]['date_redac'])) : '')) !== '' ? '- ' . $t2 : '') . '</span>') : '') . '
					<a class="lien' . interdire_scripts(@$Pile[0]['exposer']) . ' article" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($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>

				</li>
		';
            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_art_agenda @ squelettes/inc/inc-menu-agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_breves_rubriqueshtml_11157eacea3e766769d2031f1e2eed04(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'breves';
        $command['id'] = '_breves_rubriques';
        $command['from'] = array('breves' => 'spip_breves');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("breves.date_heure", "breves.date_heure AS date", "breves.id_breve", "breves.texte", "breves.titre", "breves.lang");
        $command['orderby'] = array('breves.date_heure DESC');
        $command['join'] = array();
        $command['limit'] = '0,10';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('breves.statut', 'publie,prop', 'publie', ''), array('=', 'breves.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'breves.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-breves.html', 'html_11157eacea3e766769d2031f1e2eed04', '_breves_rubriques', 2, $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']);
            $t0 .= '
          	<li>' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span>' . $t1 . '</span>' : '') . '
              <a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_breve'], 'breve', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist('', $Pile[$SP]['texte'], 300, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>
          	</li>
            ';
            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_breves_rubriques @ squelettes/inc/inc-breves.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function formulaires_clevermail_unsubscribe_why_traiter_dist()
{
    if (isset($_GET['id']) && $_GET['id'] != '') {
        $action = sql_fetch(sql_select("*", "spip_cm_pending", array("pnd_action_id=" . sql_quote($_GET['id']), "pnd_action='unsubscribe'")));
        if (empty($action)) {
            return array('message_erreur' => 'Votre demande ne peut pas être traitée', 'editable' => false);
        }
        $list = sql_fetsel("*", "spip_cm_lists", "lst_id = " . intval($action['lst_id']));
        $pos = strpos($list['lst_name'], "/");
        if (strpos($list['lst_name'], '/') === false) {
            $lettre = supprimer_numero($list['lst_name']);
            $categorie = '';
            $list_name_complet = $lettre;
        } else {
            $lettre = supprimer_numero(substr($list['lst_name'], strpos($list['lst_name'], '/') + 1));
            $categorie = supprimer_numero(substr($list['lst_name'], 0, strpos($list['lst_name'], '/')));
            $list_name_complet = $categorie . " / " . $lettre;
        }
        sql_delete("spip_cm_lists_subscribers", "lst_id = " . intval($action['lst_id']) . " AND sub_id = " . intval($action['sub_id']));
        // remove posts from this list already queued
        sql_delete("spip_cm_posts_queued", "sub_id = " . intval($action['sub_id']) . " AND pst_id IN (" . implode(',', sql_fetsel("lst_id", "spip_cm_posts", "lst_id=" . intval($action['lst_id']), "lst_id")) . ")");
        $lst_name = sql_getfetsel("lst_name", "spip_cm_lists", "lst_id = " . intval($action['lst_id']));
        $message_ok = _T('clevermail:desinscription_validee', array('lst_name' => $list_name_complet));
        // E-mail d'alerte envoye au moderateur de la liste
        $sub = sql_fetsel("*", "spip_cm_subscribers", "sub_id = " . intval($action['sub_id']));
        sql_insertq("spip_cm_unsubscribe_why", array('sub_email' => $sub['sub_email'], 'sub_champ_exercice' => $sub['sub_champ_exercice'], 'sub_territoire' => $sub['sub_territoire'], 'lst_id' => $action['lst_id'], 'date_unsubscribe' => date('Y-m-d H:i:s'), 'choices_unsubscribe' => implode(':', $_POST['choices_unsubscribe']), 'choices_autre' => $_POST['autre']));
        $list = sql_fetsel("*", "spip_cm_lists", "lst_id = " . intval($action['lst_id']));
        $destinataire = $list['lst_moderator_email'];
        $sujet = '[' . $list['lst_name'] . '] Désinscription de ' . addslashes($sub['sub_email']);
        $corps = _T('clevermail:mail_info_desinscription_corps', array('nom_site' => $GLOBALS['meta']['nom_site'], 'url_site' => $GLOBALS['meta']['adresse_site'], 'sub_email' => addslashes($sub['sub_email']), 'lst_name' => $list['lst_name']));
        $expediteur = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_FROM'");
        $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
        $envoyer_mail($destinataire, $sujet, $corps, $expediteur);
        $abonne = sql_getfetsel("sub_email", "spip_cm_subscribers", "sub_id=" . intval($action['sub_id']));
        $liste = sql_getfetsel("lst_name", "spip_cm_lists", "lst_id=" . intval($action['lst_id']));
        if (sql_countsel("spip_cm_lists_subscribers", "sub_id=" . intval($action['sub_id'])) == 0) {
            sql_updateq("spip_cm_subscribers", array('sub_email' => md5(substr($abonne, 0, strpos($abonne, '@'))) . substr($abonne, strpos($abonne, '@'))), "sub_id = " . intval($action['sub_id']));
        }
        spip_log('Suppression du l\'abonnement de « ' . $abonne . ' » de la liste « ' . $liste . ' » (id=' . $action['lst_id'] . ')', 'clevermail');
        sql_delete("spip_cm_pending", "pnd_action_id=" . sql_quote($_GET['id']));
        return array('message_ok' => $message_ok, 'redirect' => 'spip.php');
    } else {
        return array('message_erreur' => 'Votre demande ne peut pas être traitée', 'editable' => false);
    }
}
function BOUCLE_rubriquehtml_7e58ec237019eff13c867a6e81765d14(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_rubrique';
        $command['from'] = array('rubriques' => 'spip_rubriques', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("rubriques.id_rubrique");
        $command['select'] = array("0+rubriques.titre AS num", "rubriques.titre", "rubriques.id_rubrique", "rubriques.lang");
        $command['orderby'] = array('num', 'rubriques.titre');
        $command['join'] = array('L1' => array('rubriques', 'id_objet', 'id_rubrique', 'L1.objet=' . sql_quote('rubrique')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'L2.titre', "'inclu_menu_principal'"), array('=', 'rubriques.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-menu-principal.html', 'html_7e58ec237019eff13c867a6e81765d14', '_rubrique', 8, $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']);
            $t0 .= '
			' . (($t1 = strval(interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? '<li class="menu-principal-rubriques"><a href="' . (($t2 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? $t2 . '/' : '') . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_rubrique'], 'rubrique', '', '', true))) . '">' . $t1 . '</a></li>' : '') . '
			';
            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_rubrique @ squelettes/inc/inc-menu-principal.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #10
0
function formulaires_editer_mot_verifier_dist($id_mot='new', $id_groupe=0, $retour='', $ajouter_id_article=0, $table='', $table_id=0, $config_fonc='mots_edit_config', $row=array(), $hidden=''){

	$erreurs = formulaires_editer_objet_verifier('mot',$id_mot,array('titre'));
	// verifier qu'un mot du meme groupe n'existe pas avec le meme titre
	// la comparaison accepte un numero absent ou different
	// sinon avertir
	if (!count($erreurs) AND !_request('confirm_titre_mot')){
		if ($l = sql_allfetsel('id_mot', "spip_mots", 
						"titre REGEXP ".sql_quote("^([0-9]+[.] )?".preg_quote(supprimer_numero(_request('titre')))."$")
				       ." AND id_mot<>".intval($id_mot))) {
			$a = 'id_mot='.$l[0]['id_mot'];
			$h = generer_url_ecrire('mots_edit', $a);
			$l = join(' ', array_map('array_shift', $l));
			$t = _T('avis_doublon_mot_cle');
			$erreurs['titre'] = "$t <a href='$h' title='$l'>?</a>"
				." <input type='hidden' name='confirm_titre_mot' value='1' />";
			set_request('edit','oui');
		}
	}
	return $erreurs;
}
function BOUCLE_auteurshtml_bc3326b3fba39516fdcfa67a49c7ff7f(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'auteurs';
        $command['id'] = '_auteurs';
        $command['from'] = array('auteurs' => 'spip_auteurs', 'L1' => 'spip_auteurs_liens');
        $command['type'] = array();
        $command['groupby'] = array("auteurs.id_auteur");
        $command['select'] = array("auteurs.nom", "auteurs.id_auteur");
        $command['orderby'] = array('auteurs.nom');
        $command['join'] = array('L1' => array('auteurs', 'id_auteur'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('auteurs.statut', '!5poubelle', '!5poubelle', ''), array('=', 'L1.id_objet', sql_quote(@$Pile[0]['id_objet'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'L1.objet', sql_quote(@$Pile[0]['objet'], '', 'varchar(25) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes-dist/modeles/lesauteurs.html', 'html_bc3326b3fba39516fdcfa67a49c7ff7f', '_auteurs', 9, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t1 = '
<span class="vcard author"><a class="url fn spip_in" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_auteur'], 'auteur', '', '', true))) . '">' . interdire_scripts(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0])) . '</a></span>';
            $t0 .= (strlen($t1) && strlen($t0) ? ', ' : '') . $t1;
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_auteurs @ squelettes-dist/modeles/lesauteurs.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_secteurshtml_7b757a9211fae3c1871c26ec4415f046(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_secteurs';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.id_rubrique", "rubriques.lang", "0+rubriques.titre AS num1", "rubriques.titre");
        $command['orderby'] = array('rubriques.lang DESC', 'num1', 'rubriques.titre');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_parent', 0), array('=', 'rubriques.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/plan.html', 'html_7b757a9211fae3c1871c26ec4415f046', '_secteurs', 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']);
            $t0 .= '
			' . (($t1 = strval(traduire_nom_langue(unique(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang'])), 'langues'))) !== '' ? '<h2>' . $t1 . '</h2>' : '') . '
				<div class="plan-archives" style="clear:both;">
				' . filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_rubrique', 'ON', $Pile[$SP]['id_rubrique'], quete_parent($Pile[$SP]['id_rubrique']), 0)) ? '' : "<img class=\"spip_logo spip_logo_right spip_logos\" alt=\"\" style=\"float:right\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '120', '0')) . '
				<h3><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_rubrique'], 'rubrique', '', '', true))) . '">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3>
				</div>
				' . (($t1 = BOUCLE_articles_racinehtml_7b757a9211fae3c1871c26ec4415f046($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
				<ul>
					' . $t1 . '
				</ul>
				' : '') . '
					' . (($t1 = BOUCLE_rubriqueshtml_7b757a9211fae3c1871c26ec4415f046($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
					<ul>
						' . $t1 . '
					</ul>
				' : '') . '
			';
            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_secteurs @ squelettes/plan.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #13
0
function traiter_raccourci_titre($id, $type, $connect=NULL)
{
	$trouver_table = charger_fonction('trouver_table', 'base');
	$desc = $trouver_table(table_objet($type));
	if (!($desc AND $s = $desc['titre'])) return array();
	$_id = $desc['key']['PRIMARY KEY'];
	$r = sql_fetsel($s, $desc['table'], "$_id=$id", '','','','',$connect);
	if (!$r) return array();
	$r['titre'] = supprimer_numero($r['titre']);
	if (!$r['titre']) $r['titre'] = $r['surnom'];
	if (!isset($r['lang'])) $r['lang'] = '';
	return $r;
}
Example #14
0
function signatures_edit($script, $id, $arg, $row) {

	global $spip_lang_right, $spip_lang_left;
	$id_signature = $row['id_signature'];
	$id_article = $row['id_article'];
	$date_time = $row['date_time'];
	$nom_email= typo(echapper_tags($row['nom_email']));
	$ad_email = echapper_tags($row['ad_email']);
	$nom_site = typo(echapper_tags($row['nom_site']));
	$url_site = echapper_tags($row['url_site']);
	$statut = $row['statut'];

	$res = !autoriser('modererpetition', 'article', $id_article) ? '' : true;

	if ($res) {
		if ($id) $arg .= "&id_article=$id_article";
		$arg .= "#signature$id_signature";
		$retour_s = redirige_action_auteur('editer_signatures', $id_signature, $script, $arg);
		$retour_a = redirige_action_auteur('editer_signatures', "-$id_signature", $script, $arg);

		if  ($statut=="poubelle"){
			$res = icone_inline (_T('icone_valider_signature'),
				$retour_s,
				"forum-interne-24.gif", 
				"creer.gif",
				"right",
				false);
		} else {
			$res = icone_inline (_T('icone_supprimer_signature'),
				$retour_a,
				"forum-interne-24.gif", 
				"supprimer.gif",
				"right",
				false);
			if ($statut<>"publie") {
				$res .= icone_inline (_T('icone_relancer_signataire'),
				$retour_s,
				"forum-interne-24.gif", 
				"creer.gif",
				"right",
				false);
			}
		}
		$res = "<div class='editer_auteurs'>$res</div>";
	}

	$res .= "<div class='spip_small date'>".date_interface($date_time)."</div>\n";
	if ($statut=="poubelle"){
		$res .= "<div class='spip_x-small info_statut'>"._T('info_message_efface')."</div>\n";
	}
	if (strlen($url_site)>6) {
		if (!$nom_site) $nom_site = _T('info_site');
		$res .= "<div class='site'><span class='spip_x-small'>"._T('info_site_web')."</span> <a href='$url_site'>$nom_site</a></div>\n";
		}

	if ($ad_email) $res .= signatures_edit_mail($id_article, $ad_email, $row);

	$res .= "<div class='texte'>" . message_de_signature($row) . "</div>";
		
	if (!$id) {
		if ($r = sql_fetsel("titre, id_rubrique", "spip_articles", "id_article=$id_article")) {
			$id_rubrique = $r['id_rubrique'];
			$titre_a = $r['titre'];
			$titre_r = supprimer_numero(sql_getfetsel("titre", "spip_rubriques", "id_rubrique=$id_rubrique"));
		        $href = generer_url_ecrire('naviguer', "id_rubrique=" . $id_rubrique);
			$h2 = generer_url_ecrire_article($id_article);
			$res .= "<div class='nettoyeur'></div><div class='reponse_a'><a title='$id_article' href='"
			  . $h2
			  . "'>"
			  . typo($titre_a)
			  . "</a><a class='reponse_a' style='float: $spip_lang_right; padding-$spip_lang_left: 4px;' href='$href' title='$id_rubrique'>"
			. typo($titre_r)
			. " </a></div>";
		}
	}

	$res = "<table class='signature' id='signature$id_signature' width='100%' cellpadding='3' cellspacing='0'>\n<tr><td class='verdana2 cartouche'>"
 		.  ($nom_site ? "$nom_site / " : "")
		.  $nom_email
		.  "</td></tr>"
		.  "\n<tr><td class='serif contenu'>"
		. $res
		. "</td></tr></table>\n";
		
	if ($statut=="poubelle") {
		$res = "<table class='signature' width='100%' cellpadding='2' cellspacing='0' border='0'><tr><td class='poubelle'>"
			. $res
			. "</td></tr></table>";
	}

	return $res;
}
Example #15
0
function exec_spiplistes_courrier_edit(){

	include_spip('inc/barre');
	include_spip('inc/documents');
	include_spip('base/spiplistes_tables');
	include_spip('inc/spiplistes_api');
	include_spip('inc/spiplistes_api_presentation');
	include_spip('inc/spiplistes_dater_envoi');
	include_spip('inc/spiplistes_api_courrier');
	include_spip('public/assembler');
	include_spip('inc/spiplistes_naviguer_paniers');

	global $connect_statut
		, $connect_toutes_rubriques
		, $connect_id_auteur
		, $spip_ecran
		, $compteur_block
		;
	
	$eol = "\n";
	$id_temp = false;
	
	$type = _request('type');
	$id_courrier = intval(_request('id_courrier'));

	foreach(array('btn_courrier_apercu') as $key) {
		$$key = _request($key);
	}

	if($id_courrier > 0) {
	///////////////////////////
	// Edition /modification d'un courrier
		$sql_select_array = array('titre','texte','message_texte','type','statut','id_auteur');
		if($row = spiplistes_courriers_premier($id_courrier, $sql_select_array)) {
			foreach($sql_select_array as $key) {
				$$key = $row[$key];
			}
			$titre = entites_html($titre);
			$texte = entites_html($texte);
		}
		else {
			$id_courrier = false;
		}
	}
	// n'existe pas encore ?
	// placer un marqueur pour les documents joints
	else {
		$id_temp = 0-intval(substr(creer_uniqid(),0,5));
	}

	// l'edition du courrier est reservee aux super-admins 
	// ou aux admin createur du courrier
	$flag_editable = (($connect_statut == "0minirezo") 
		&& ($connect_toutes_rubriques || ($connect_id_auteur == $id_auteur) || !$id_courrier));

	if($flag_editable) {
		if(!$id_courrier) {
		// si pas de ID courrier, c'est une creation
			$statut = _SPIPLISTES_COURRIER_STATUT_REDAC; 
			$type = _SPIPLISTES_COURRIER_TYPE_NEWSLETTER;
			$new = 'oui';
			$titre = _T('spiplistes:Nouveau_courrier');
			$clearonfocus = " onfocus=\"if(!antifocus){this.value='';antifocus=true;}\"";
		}
		else {
			$clearonfocus = "";
		}
	
		$gros_bouton_retour =
			($id_courrier)
			? icone(
				_T('spiplistes:retour_link')
				, generer_url_ecrire(_SPIPLISTES_EXEC_COURRIER_GERER, "id_courrier=$id_courrier")
				, spiplistes_items_get_item('icon', $statut)
				, "rien.gif"
				, ""
				, false
				)
			: ""
			;
		$boite_documents = afficher_documents_colonne(
							  ($id_courrier ? $id_courrier : $id_temp )
							  , 'courrier');
	}
	
////////////////////////////////////
// PAGE CONTENU
////////////////////////////////////

	$titre_page = _T('spiplistes:edition_du_courrier');
	// Permet entre autres d'ajouter les classes a' la page : <body class='$rubrique $sous_rubrique'>
	$rubrique = _SPIPLISTES_PREFIX;
	$sous_rubrique = "courrier_edit";

	$commencer_page = charger_fonction('commencer_page', 'inc');
	echo($commencer_page(_T('spiplistes:spiplistes') . " - " . $titre_page, $rubrique, $sous_rubrique));

	if(!$flag_editable) {
		die (spiplistes_terminer_page_non_autorisee() . fin_page());
	}
	
	$page_result = ""
		. "<br /><br /><br />\n"
		. spiplistes_gros_titre($titre_page, '', true)
		. barre_onglets($rubrique, $sous_rubrique)
		. debut_gauche($rubrique, true)
		. spiplistes_boite_info_id(_T('spiplistes:Courrier_numero_'), $id_courrier, true)
		. spiplistes_naviguer_paniers_courriers(_T('spiplistes:aller_au_panier_'), true)
		. $boite_documents
		. pipeline('affiche_gauche', array('args'=>array('exec'=>$sous_rubrique),'data'=>''))
		//. creer_colonne_droite($rubrique, true)  // spiplistes_boite_raccourcis() s'en occupe
		. spiplistes_boite_raccourcis(true)
		//. spiplistes_boite_autocron() // ne pas gener l'edition
		. pipeline('affiche_droite', array('args'=>array('exec'=>$sous_rubrique),'data'=>''))
		. debut_droite($rubrique, true)
		;

	$page_result .= ""
		// le bloc pour apercu (retour ajax)
		. "<div id='apercu-courrier' style='clear:both;tex-align:center'></div>\n"
		//
		. debut_cadre_formulaire('', true)
		. "<a name='haut-block' id='haut-block'></a>\n"
		// 
		//
		// bloc titre
		. "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>\n"
		. "<tr width='100%'>"
		. "<td>"
		. $gros_bouton_retour
		. "</td>"
		. "<td><img src='"._DIR_IMG_PACK."/rien.gif' width='10'></td>\n"
		. "<td width='100%'>"
		. ($id_courrier ? _T('spiplistes:Modifier_un_courrier__') : _T('spiplistes:Creer_un_courrier_') )."<br />\n"
		. spiplistes_gros_titre($titre, '', true)
		. "</td>\n"
		. "</tr></table>\n"
		. "<hr />\n"
		;
		//
		// debut formulaire
	
	$page_result .= ""
		. "<form action='".generer_url_ecrire(_SPIPLISTES_EXEC_COURRIER_GERER
											  , ($id_courrier ? "id_courrier=$id_courrier" : "")
											  )
			."' method='post' name='formulaire_courrier_edit' id='formulaire_courrier_edit'>\n"
		. "<input type='hidden' name='modifier_message' value=\"oui\" />\n"
		. "<input type='hidden' name='id_courrier' value='$id_courrier' />\n"
		//
		// bloc sujet du courrier
		. "<label for='sujet_courrier'>"._T('spiplistes:sujet_courrier').":</label>\n"
		. "<input id='sujet_courrier' type='text' class='formo' name='titre' value=\"$titre\" size='40' $clearonfocus />\n"
		. "<p style='margin-bottom:1.75em;'>"._T('spiplistes:Courrier_edit_desc')."</p>\n"
		;
		
	$titre_block_depliable = _T('spiplistes:Generer_le_contenu');
	$page_result .= ''
		//
		// generer le contenu
		// Reprise du Formulaire adapte de abomailman () // MaZiaR - NetAktiv	// tech@netaktiv.com
		. debut_cadre_relief(_DIR_PLUGIN_SPIPLISTES_IMG_PACK.'stock_insert-slide.gif', true)
		//. bouton_block_invisible(md5(_T('spiplistes:charger_patron')))
		. spiplistes_bouton_block_depliable($titre_block_depliable, false, md5(_T('spiplistes:charger_patron')))
		. "<span class='verdana2 triangle_label' onclick=\"javascript:$('#triangle".$compteur_block."').click();\">"
			. (spiplistes_spip_est_inferieur_193() ? $titre_block_depliable : "")
			. "</span>\n"
		. spiplistes_debut_block_invisible(md5(_T('spiplistes:charger_patron')))
		// 
		. '<div id="ajax-loader" align="right">'
			. '<script type="text/javascript">'.$eol
			. 'document.write(\'<img src="' . _DIR_PLUGIN_SPIPLISTES_IMG_PACK . 'ajax_indicator.gif" alt="" />\');'	
			. '</script>'.$eol
			. '<noscript>'.$eol
			. spiplistes_boite_alerte (_T('spiplistes:javascript_inactif'), true)
			. $eol
			. '</noscript>'.$eol
			//. '<img src="' . _DIR_PLUGIN_SPIPLISTES_IMG_PACK . 'ajax_indicator.gif" alt="" />'
			. '</div>'.$eol
		;
	
	if(strpos($GLOBALS['meta']['langues_multilingue'], ",") !== false) {
		$page_result .= "" 
			// selecteur de langues
			. "<div class='boite-generer-option'>\n"
			. "<label class='verdana2'>"._T('spiplistes:Langue_du_courrier_')
			. "<select name='lang' class='fondo'>\n"
			. liste_options_langues('changer_lang')
			. "</select></label>\n"
			. "</div>\n"
			;
	}
	
	$page_result .= ""
		// Prendre en compte a partir de quelle date ?
		. spiplistes_dater_envoi(
			'courrier', $id_courrier, $statut
			, $flag_editable
			, _T('spiplistes:Contenu_a_partir_de_date_')
			, normaliser_date(time()), 'btn_changer_date'
			, false
			)
		;
		
	$page_result .= ""
		// texte introduction a placer avant le patron et sommaire 
		. '<div class="boite-generer-option">'.$eol
		. '<label class="verdana2">'
		. '<input type="checkbox" id="avec_intro" name="avec_intro" value="non" />'
		. _T('spiplistes:avec_introduction')
		. '</label>'.$eol
		. '<div id="choisir_intro" class="option">'.$eol
		. '<label class="verdana2" style="display:block;" for="message_intro">'
		. _T('spiplistes:introduction_du_courrier_').':</label>'.$eol
		. afficher_barre('document.formulaire_courrier_edit.message_intro')
		. '<textarea id="message_intro" name="message_intro" '.$GLOBALS['browser_caret'].' rows="5" cols="40" wrap="soft" style="width:100%">'.$eol
		. '</textarea>'
		. '</div>'.$eol
		. '</div>'.$eol
		;
		
	// selection du patron
	$page_result .= ''
		. "<div class='boite-generer-option'>\n"
		. "<label class='verdana2'>"
		. "<input type='checkbox' id='avec_patron' name='avec_patron' value='non' />"
		. _T('spiplistes:a_partir_de_patron')
		. "</label>\n"
		. "<div id='choisir_patron' class='option'>"
		. "<label class='verdana2'>"
		. _T('spiplistes:choisir_un_patron_').":</label>\n"
		. spiplistes_boite_selection_patrons ("", true, _SPIPLISTES_PATRONS_DIR, "patron", 1)
		. "<div id='patron_pos' style='display:none'>\n"
		. "<span class='verdana2'>" . _T('spiplistes:generer_patron_'). "</span>\n"
		. spiplistes_form_input_radio ('patron_pos', 'avant', _T('spiplistes:generer_patron_avant'), true, true, false)
		. spiplistes_form_input_radio ('patron_pos', 'apres', _T('spiplistes:generer_patron_apres'), false, true, false)
		. "</div>\n"
		. "</div>\n"
		. "</div>\n"
		;
	
	// Generer un sommaire
	$page_result .= ""
		. "<div class='boite-generer-option'>\n"
		. "<label class='verdana2'>"
		. "<input type='checkbox' id='avec_sommaire' name='avec_sommaire' value='non' />"
		. _T('spiplistes:generer_un_sommaire')
		. "</label>\n"
		. "<div id='choisir_sommaire' class='option'>";		
	$page_result .= ""
		//
		// selecteur de rubriques
		. "<label class='verdana2' for='ajouter_rubrique'>"._T('spiplistes:Lister_articles_de_rubrique').":</label>\n"
		. "<select name='id_rubrique' id='ajouter_rubrique' class='formo'>\n"
		. "<option value=''></option>\n"
		. spiplistes_arbo_rubriques()
		. "</select>\n"
		. "<br />\n"
		//
		// selecteur des mots-cles
		. "<label class='verdana2' for='ajouter_motcle'>"._T('spiplistes:Lister_articles_mot_cle').":</label>\n"
		. "<select name='id_mot' id='ajouter_motcle' class='formo'>\n"
		. "<option value=''></option>\n"
		;
	
	if (version_compare($GLOBALS['spip_version_code'], '1.9300', '<')){
		$rqt_gmc = sql_select (array('id_groupe','titre'), 'spip_groupes_mots', "articles=".sql_quote('oui'));
	}else{
		$rqt_gmc = sql_select (array('id_groupe','titre'), 'spip_groupes_mots', "tables_liees LIKE '%articles%'");		
	}
	
	while ($row = sql_fetch($rqt_gmc)) {
		$id_groupe = intval($row['id_groupe']);
		$titre = $row['titre'];
		$page_result .= "<option value='' disabled='disabled'>". supprimer_numero (typo($titre)) . "</option>\n";
		$rqt_mc = sql_select (array('id_mot','titre'), 'spip_mots', "id_groupe=".sql_quote($id_groupe));
		while ($row = sql_fetch($rqt_mc)) {
			$id_mot = intval($row['id_mot']);
			$titre = supprimer_numero (typo($row['titre']));
			$page_result .= "<option value='$id_mot'>--&nbsp;$titre</option>\n";
		}
	}
	$page_result .= ""
		. "</select><br />\n"
		//
		// a partir de la date selectionnee plus haut
		. spiplistes_form_input_item ('checkbox', 'date_sommaire', 'oui'
			, _T('spiplistes:sommaire_date_debut'), $sommaire_date == 'oui', true, false)
		. "</div>\n"
		. "</div>\n"
		; // fin generer le sommaire
		
		// choisir son patron de pied
	$page_result .= ""
		. "<div class='boite-generer-option'>\n"
			. "<label class='verdana2'>"
		. _T('spiplistes:avec_patron_pied__')
		. spiplistes_boite_selection_patrons (_SPIPLISTES_PATRONS_PIED_DEFAUT, true, _SPIPLISTES_PATRONS_PIED_DIR, "pied_patron", 1)
		. "</label>\n"
		. "</div>\n"
		; 
		
	$page_result .= ""
		. "<p class='verdana2'>\n"
			. _T('spiplistes:Cliquez_Generer_desc'
				, array('titre_bouton'=>_T('spiplistes:generer_Apercu'), 'titre_champ_texte'=>_T('spiplistes:texte_courrier'))
				)
			. "</p>\n"
		. "<p class='verdana2'>\n" ._T('spiplistes:calcul_patron_attention') .  "</p>\n"
		. spiplistes_form_bouton_valider ('Valider', _T('spiplistes:generer_Apercu'))
		. fin_block() // fin_block_invisible
		. fin_cadre_relief(true)
		. "<br />\n"
		;
		
	//
	// bloc du courrier (titre, texte), toujours visible
	$page_result .= ''
		. '<label for="texte_courrier">'._T('spiplistes:texte_courrier').'</label>'
		. afficher_barre('document.formulaire_courrier_edit.message')
		. '<textarea id="texte_courrier" name="message" '.$GLOBALS['browser_caret'].' class="porte_plume_partout barre_inserer formo" rows="20" cols="40" wrap=soft>'.$eol
		. $texte
		. '</textarea>'.$eol
		. (!$id_courrier ? '<input type="hidden" name="new" value="oui" />'.$eol : '')
		//
		. '<p style="text-align:right;">'.$eol
		. '<input type="submit" onclick="this.value=\'oui\';" id="btn_courrier_edit" '
			. ' name="btn_courrier_valider" value="'._T('bouton_valider').'" class="fondo" /></p>'.$eol
		// le marqueur pour les documents joints
		. (($id_temp!==false) ? '<input type="hidden" name="id_temp" value="' . $id_temp . '" />'.$eol : '')
		//
		// fin formulaire
		. '</form>'.$eol
		. fin_cadre_formulaire(true)
		;
	
	echo($page_result);

	// COURRIER EDIT FIN ---------------------------------------------------------------

	echo pipeline('affiche_milieu',array('args'=>array('exec'=>$sous_rubrique),'data'=>''))
		, spiplistes_html_signature(_SPIPLISTES_PREFIX)
		, fin_gauche(), fin_page();
	
}
function BOUCLE_archivehtml_76ddbc2b5f1671bea60186a8fa5bb500(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $doublons_index = array();
    // Initialise le(s) critère(s) doublons
    if (!isset($doublons[$d = 'articles' . 'archives'])) {
        $doublons[$d] = '';
    }
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_archive';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.date_redac", "articles.id_article", "articles.titre", "articles.lang");
        $command['orderby'] = array('articles.date_redac DESC');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L2.titre', "'Agenda'"), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')), 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', '_archive', 77, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        // COMPTEUR
        $Numrows['_archive']['compteur_boucle'] = 0;
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $Numrows['_archive']['compteur_boucle']++;
            foreach ($doublons_index as $k) {
                $doublons[$k] .= "," . $Pile[$SP]['id_article'];
            }
            // doublons
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
		' . (($t1 = strval(unique(annee(normaliser_date($Pile[$SP]['date_redac']))))) !== '' ? '
			' . ($Numrows['_archive']['compteur_boucle'] > '1' ? '</ul></li></ul></div>' : '') . '
			<div id="plan">
			<h3>' . $t1 . '</h3>

			<ul>
		' : '') . '
		' . (($t1 = strval(nom_mois(unique(affdate(normaliser_date($Pile[$SP]['date_redac']), 'Y-m'))))) !== '' ? '
			' . (unique(annee(normaliser_date($Pile[$SP]['date_redac'])), 'nouvelle') ? '' : '</ul></li>') . '
			  <li>' . $t1 . '
  				<ul>
		' : '') . '
				  <li><a href="' . 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></li>
	';
            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_archive @ squelettes/agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_article_headhtml_f7a72f7c15527e9fefe562fecb18cf87(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_article_head';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang", "articles.date");
        $command['orderby'] = array();
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'articles.id_article', sql_quote(@$Pile[0]['id_article'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')), array('NOT', array('IN', 'articles.id_article', array('SELF', 'articles.id_article', array('REGEXP', 'L2.type', "'^_config'")))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-meta.html', 'html_f7a72f7c15527e9fefe562fecb18cf87', '_article_head', 13, $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']);
            $t0 .= '
  <!-- META article -->
  ' . (($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)))))) !== '' ? '<meta name="Description" content="' . $t1 . '" />' : '') . '
' . (($t1 = BOUCLE_authorhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '  <meta name="Author" content="' . $t1 . '" />' : '') . '
' . (($t1 = BOUCLE_keywords_articlehtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '  <meta name="Keywords" content="' . $t1 . '" />' : '') . '
  <!-- META Dublin Core - voir: http://uk.dublincore.org/documents/dcq-html/  -->
  ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))))) !== '' ? '<meta name="DC.title" content="' . $t1 . '" />
  ' : '') . (($t1 = strval(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']))) !== '' ? '<meta name="DC.language" scheme="ISO639-1" content="' . $t1 . '" />
  ' : '') . (($t1 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.identifier" scheme="DCTERMS.URI" content="' . $t1 . '/' : '') . (($t1 = strval(vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))))) !== '' ? $t1 . '" />
  ' : '') . (($t1 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.source" scheme="DCTERMS.URI" content="' . $t1 . '" />' : '') . BOUCLE_auteursDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . (($t1 = strval(interdire_scripts(attribut_html(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null))))))) !== '' ? '
  <meta name="DC.description" content="' . $t1 . '" />' : '') . (($t1 = BOUCLE_subjectDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
  <meta name="DC.subject" content="' . $t1 . '" />' : '') . (($t1 = strval(interdire_scripts(date_iso(normaliser_date($Pile[$SP]['date']))))) !== '' ? '
  <meta name="DC.date" scheme="ISO8601" content="' . $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_article_head @ squelettes/inc/inc-meta.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #18
0
 private function plugins()
 {
     global $mysqli;
     $this->b = 0;
     $sql = "SELECT * FROM plugins WHERE ouvert = 'y' order by description";
     $query = mysqli_query($mysqli, $sql);
     while ($plugin = $query->fetch_object()) {
         $this->b = 0;
         $nomPlugin = $plugin->nom;
         $this->verif_exist_ordre_menu('bloc_plugin_' . $nomPlugin);
         // On offre la possibilité d'inclure un fichier functions_nom_du_plugin.php
         // Ce fichier peut lui-même contenir une fonction calcul_autorisation_nom_du_plugin voir plus bas.
         if (file_exists($this->cheminRelatif . "mod_plugins/" . $nomPlugin . "/functions_" . $nomPlugin . ".php")) {
             include_once $this->cheminRelatif . "mod_plugins/" . $nomPlugin . "/functions_" . $nomPlugin . ".php";
         }
         $querymenu = mysqli_query($mysqli, 'SELECT * FROM plugins_menus
                                   WHERE plugin_id = "' . $plugin->id . '"
                                   ORDER by titre_item');
         while ($menuItem = $querymenu->fetch_object()) {
             // On regarde si le plugin a prévu une surcharge dans le calcul de l'affichage de l'item dans le menu
             // On commence par regarder si une fonction du type calcul_autorisation_nom_du_plugin existe
             $nom_fonction_autorisation = "calcul_autorisation_" . $nomPlugin;
             if (function_exists($nom_fonction_autorisation)) {
                 // Si une fonction du type calcul_autorisation_nom_du_plugin existe, on calcule le droit de l'utilisateur à afficher cet item dans le menu
                 $result_autorisation = $nom_fonction_autorisation($this->loginUtilisateur, $menuItem->lien_item);
             } else {
                 $result_autorisation = true;
             }
             if ($menuItem->user_statut == $this->statutUtilisateur and $result_autorisation) {
                 $this->creeNouveauItemPlugin("/" . $menuItem->lien_item, supprimer_numero($menuItem->titre_item), $menuItem->description_item);
             }
         }
         if ($this->b > 0) {
             $descriptionPlugin = $plugin->description;
             $this->creeNouveauTitre('accueil', "{$descriptionPlugin}", 'images/icons/package.png');
         }
     }
 }
function BOUCLE_rubriques_editohtml_0167a54ed63f4fd0ee2bbef24b5ac307(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $in = array();
    if (!is_array($a = @$Pile[0]['lang'])) {
        $in[] = $a;
    } else {
        $in = array_merge($in, $a);
    }
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_rubriques_edito';
        $command['from'] = array('rubriques' => 'spip_rubriques', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("rubriques.id_rubrique");
        $command['select'] = array("0+rubriques.titre AS num", "rubriques.titre", "rubriques.id_rubrique", "rubriques.descriptif", "rubriques.texte", "rubriques.lang");
        $command['orderby'] = array('num', 'rubriques.titre');
        $command['join'] = array('L1' => array('rubriques', 'id_objet', 'id_rubrique', 'L1.objet=' . sql_quote('rubrique')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '0,10';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), !(is_array(@$Pile[0]['lang']) ? count(@$Pile[0]['lang']) : strlen(@$Pile[0]['lang'])) ? '' : (is_array(@$Pile[0]['lang']) ? sql_in('rubriques.lang', sql_quote($in)) : array('=', 'rubriques.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\''))), array('=', 'L2.titre', "'Editorial'"));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-sommaire-edito.html', 'html_0167a54ed63f4fd0ee2bbef24b5ac307', '_rubriques_edito', 8, $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']);
            $t0 .= '
	  <br class="nettoyeur" />
      ' . (($t1 = strval(interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? '<h3 class="edito-titre"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_rubrique'], 'rubrique', '', '', true))) . '">' . $t1 . '</a></h3>' : '') . '
	  ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', strlen($logo = !is_array($l = quete_logo('id_rubrique', 'ON', $Pile[$SP]['id_rubrique'], quete_parent($Pile[$SP]['id_rubrique']), 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_rubrique'], 'rubrique', '', '', true))) . '">' . $logo . '</a>' : '', '150', '0')))) !== '' ? '<div class="logo-liste-art">
		' . $t1 . '
	  </div>' : '') . '
      ' . (($t1 = strval(interdire_scripts(($a = propre($Pile[$SP]['descriptif'], $connect, $Pile[0]) or is_string($a) and strlen($a)) ? $a : interdire_scripts(propre($Pile[$SP]['texte'], $connect, $Pile[0]))))) !== '' ? '<div class="chapo ' . interdire_scripts($Pile[$SP]['descriptif'] ? '' : '') . '">' . $t1 . '
        	<div style="clear: both; height: .1em;">&nbsp;</div>
       </div>' : '') . '
';
            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_rubriques_edito @ squelettes/inc/inc-sommaire-edito.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #20
0
function balise_FORMULAIRE_FORUM_stat($args, $context_compil) {

	// le denier arg peut contenir l'url sur lequel faire le retour
	// exemple dans un squelette article.html : [(#FORMULAIRE_FORUM{#SELF})]

	// recuperer les donnees du forum auquel on repond.
	list ($idr, $idf, $ida, $idb, $ids, $am, $ag, $af, $url) = $args;
	$idr = intval($idr);
	$idf = intval($idf);
	$ida = intval($ida);
	$idb = intval($idb);
	$ids = intval($ids);

	$type = substr($GLOBALS['meta']["forums_publics"],0,3);

	if ($ida) {
		$titre = sql_fetsel('accepter_forum AS type, titre', 'spip_articles', "statut = 'publie' AND id_article = $ida");
		if ($titre) {
			if ($titre['type']) $type = $titre['type'];
			$table = "articles";
		}
		if ($type == 'non') return false;
	} else {
		if ($type == 'non') return false;
		if ($idb) {
			$titre = sql_fetsel('titre', 'spip_breves', "statut = 'publie' AND id_breve = $idb");
			$table = "breves";
		} else if ($ids) {
			$titre = sql_fetsel('nom_site AS titre', 'spip_syndic', "statut = 'publie' AND id_syndic = $ids");
			$table = "syndic";
		} else if ($idr) {
			$titre = sql_fetsel('titre', 'spip_rubriques', "statut = 'publie' AND id_rubrique = $idr");
			$table = "rubriques";
		}
	}

	if (!$titre) return false; // inexistant ou non public

	if ($idf>0) {
		$titre_m = sql_fetsel('titre', 'spip_forum', "id_forum = $idf");
		if (!$titre_m) return false; // URL fabriquee
		$titre = $titre_m;
	}

	if ($GLOBALS['meta']["mots_cles_forums"] != "oui")
		$table = '';

	$titre = supprimer_numero($titre['titre']);

	// Sur quelle adresse va-t-on "boucler" pour la previsualisation ?
	// si vide : self()
	$script = '';

	return
		array($titre, $table, $type, $script,
		$idr, $idf, $ida, $idb, $ids, $am, $ag, $af, $url);
}
function BOUCLE_siteshtml_bb1fa8f06f75cd5c61b4de0a063c1a54(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'syndic';
        $command['id'] = '_sites';
        $command['from'] = array('syndic' => 'spip_syndic');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("syndic.nom_site", "syndic.url_site", "syndic.descriptif");
        $command['orderby'] = array('syndic.nom_site');
        $command['join'] = array();
        $command['limit'] = '0,5';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('syndic.statut', 'publie,prop', 'publie', ''), array('=', 'syndic.syndication', "'non'"), array('=', 'syndic.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-syndic.html', 'html_bb1fa8f06f75cd5c61b4de0a063c1a54', '_sites', 52, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= '
            <li>
                ' . (($t1 = strval(interdire_scripts(typo(supprimer_numero(calculer_url($Pile[$SP]['url_site'], $Pile[$SP]['nom_site'], 'titre', $connect, false)), "TYPO", $connect, $Pile[0])))) !== '' ? '<a href="' . calculer_url($Pile[$SP]['url_site'], '', 'url', $connect) . '" ' . (($t2 = strval(interdire_scripts(attribut_html(supprimer_tags(propre($Pile[$SP]['descriptif'], $connect, $Pile[0])))))) !== '' ? 'title="' . $t2 . '"' : '') . ' class="spip_out">' . $t1 . '</a>' : '') . '
            </li>            
            ';
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_sites @ squelettes/inc/inc-syndic.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #22
0
function afficher_hierarchie($id_parent, $message='',$id_objet=0,$type='',$id_secteur=0,$restreint='') {
	global $spip_lang_left,$spip_lang_right;

	$out = "";
	$nav = "";
 	if ($id_objet) {
 		# desactiver le selecteur de rubrique sur le chemin
 		# $nav = chercher_rubrique($message,$id_objet, $id_parent, $type, $id_secteur, $restreint,true);
 		$nav = $nav ?"<div class='none'>$nav</div>":"";
 	}

	$parents = '';
	$style1 = "$spip_lang_left center no-repeat; padding-$spip_lang_left: 15px";
	$style2 = "margin-$spip_lang_left: 15px;";
	$tag = "a";
	$on = ' on';

	$id_rubrique = $id_parent;
	while ($id_rubrique) {

		$res = sql_fetsel("id_parent, titre, lang", "spip_rubriques", "id_rubrique=".intval($id_rubrique));

		if (!$res){  // rubrique inexistante
			$id_rubrique = 0;
			break;
		}

		$id_parent = $res['id_parent'];
		changer_typo($res['lang']);

		$class = (!$id_parent) ? "secteur"
		: (acces_restreint_rubrique($id_rubrique)
		? "admin" : "rubrique");

		$parents = "<ul><li><span class='bloc'><em> &gt; </em><$tag class='$class$on'"
		. ($tag=='a'?" href='". generer_url_ecrire("naviguer","id_rubrique=$id_rubrique")."'":"")
		. ">"
		. supprimer_numero(typo(sinon($res['titre'], _T('ecrire:info_sans_titre'))))
		. "</$tag></span>"
		. $parents
		. "</li></ul>";

		$id_rubrique = $id_parent;
		$tag = 'a';
		$on = '';
	}

	$out .=  $nav
		. "\n<ul id='chemin' class='verdana3' dir='".lang_dir()."'"
	  //. http_style_background("racine-site-12.gif", $style1)
	  . "><li><span class='bloc'><$tag class='racine$on'"
		. ($tag=='a'?" href='". generer_url_ecrire("naviguer","id_rubrique=$id_rubrique")."'":"")
	  . ">"._T('info_racine_site')."</$tag>"
 	  . "</span>"
	  . $parents
 	  . aide ("rubhier")
 	  . "</li></ul>"
 	  . ($nav?
 	    "&nbsp;<a href='#' onclick=\"$(this).prev().prev().toggle('fast');return false;\" class='verdana2'>"
 	    . _T('bouton_changer') ."</a>"
 	    :"");

	$out = pipeline('affiche_hierarchie',array('args'=>array(
			'id_parent'=>$id_parent,
			'message'=>$message,
			'id_objet'=>$id_objet,
			'objet'=>$type,
			'id_secteur'=>$id_secteur,
			'restreint'=>$restreint),
			'data'=>$out));

 	return $out;
}
Example #23
0
/**
 * Trouver le titre d'un objet publie
 *
 * @param string $objet
 * @param int $id_objet
 * @param int $id_forum
 * @param bool $publie
 * @return bool|string
 */
function forum_recuperer_titre_dist($objet, $id_objet, $id_forum = 0, $publie = true)
{
    include_spip('inc/filtres');
    $titre = "";
    if ($f = charger_fonction($objet . '_forum_extraire_titre', 'inc', true)) {
        $titre = $f($id_objet);
    } else {
        include_spip('base/objets');
        if ($publie and !objet_test_si_publie($objet, $id_objet)) {
            return false;
        }
        $titre = generer_info_entite($id_objet, $objet, 'titre', '*');
    }
    if ($titre and $id_forum) {
        $titre_m = sql_getfetsel('titre', 'spip_forum', "id_forum = " . intval($id_forum));
        if (!$titre_m) {
            return false;
            // URL fabriquee
        }
        $titre = $titre_m;
    }
    $titre = supprimer_numero($titre);
    $titre = str_replace('~', ' ', extraire_multi($titre));
    return $titre;
}
Example #24
0
function formulaires_clevermail_multiple_traiter_dist($lst_id = 0, $lsr_mode_force = false)
{
    $ok = true;
    $message = '';
    if ($sub_id = sql_getfetsel("sub_id", "spip_cm_subscribers", "sub_email=" . sql_quote(_request('sub_email')))) {
        $sub_id = intval($sub_id);
    } else {
        // Nouvelle adresse e-mail
        $sub_id = intval(sql_insertq("spip_cm_subscribers", array('sub_email' => _request('sub_email'))));
        sql_updateq("spip_cm_subscribers", array('sub_profile' => md5($sub_id . '#' . sql_quote(_request('sub_email')) . '#' . time())), "sub_id=" . intval($sub_id));
    }
    if (_request('lst_id')) {
        $lists[] = intval(_request('lst_id'));
    } elseif (_request('lst_ids')) {
        $lists = array_map("intval", _request('lst_ids'));
    }
    if (_request('lsr_mode_force')) {
        $lsr_mode = intval(_request('lsr_mode_force'));
    } else {
        $lsr_mode = intval(_request('lsr_mode'));
    }
    $actionId = md5('subscribe#' . $sub_id . '#' . time());
    $nbLettre = 1;
    $lists_name = "";
    $lists_name_categorie = "";
    $lists_name_complet = "";
    foreach ($lists as $list) {
        $lst_id = intval($list);
        $listData = sql_fetsel("*", "spip_cm_lists", "lst_id=" . intval($lst_id));
        if (sql_countsel("spip_cm_lists_subscribers", "lst_id=" . intval($lst_id) . " AND sub_id=" . intval($sub_id)) == 1) {
            if (sql_getfetsel("lsr_mode", "spip_cm_lists_subscribers", "lst_id=" . intval($lst_id) . " AND sub_id=" . intval($sub_id)) == intval($lsr_mode)) {
                // Déjà abonné avec ce mode
                $message .= (strlen($message) > 0 ? '<br />' : '') . _T('clevermail:inscription_deja_abonne_meme_mode', array('lst_name' => $listData['lst_name']));
            } else {
                // Déjà abonné mais changement de mode
                sql_updateq("spip_cm_lists_subscribers", array('lsr_mode' => intval($lsr_mode)), "lst_id=" . intval($lst_id) . " AND sub_id=" . intval($sub_id));
                $message .= (strlen($message) > 0 ? '<br />' : '') . _T('clevermail:inscription_deja_abonne_autre_mode', array('lst_name' => $listData['lst_name']));
            }
        } else {
            // Nouvel abonnement
            switch ($listData['lst_moderation']) {
                case 'open':
                    $actionId = md5('subscribe#' . $lst_id . '#' . $sub_id . '#' . time());
                    sql_insertq("spip_cm_lists_subscribers", array('lst_id' => intval($lst_id), 'sub_id' => intval($sub_id), 'lsr_mode' => intval($lsr_mode), 'lsr_id' => $actionId));
                    $message .= (strlen($message) > 0 ? '<br />' : '') . _T('clevermail:inscription_validee', array('lst_name' => supprimer_numero($listData['lst_name'])));
                    break;
                case 'email':
                    // TODO : à finir
                    if (sql_countsel("spip_cm_pending", "lst_id=" . intval($lst_id) . " AND sub_id=" . intval($sub_id)) == 0) {
                        sql_insertq("spip_cm_pending", array('lst_id' => intval($lst_id), 'sub_id' => intval($sub_id), 'pnd_action' => 'subscribe', 'pnd_mode' => intval($lsr_mode), 'pnd_action_date' => time(), 'pnd_action_id' => $actionId));
                    } else {
                        sql_updateq("spip_cm_pending", array('pnd_action' => 'subscribe', 'pnd_mode' => intval($lsr_mode), 'pnd_action_date' => time(), 'pnd_action_id' => $actionId), "sub_id=" . intval($sub_id) . " AND lst_id=" . intval($lst_id));
                    }
                    if (strpos($listData['lst_name'], '/') === false) {
                        $lettre = supprimer_numero($listData['lst_name']);
                        $categorie = '';
                    } else {
                        $lettre = supprimer_numero(substr($listData['lst_name'], strpos($listData['lst_name'], '/') + 1));
                        $categorie = supprimer_numero(substr($listData['lst_name'], 0, strpos($listData['lst_name'], '/')));
                    }
                    $lists_name = $lists_name . '- ' . $lettre . "\n\n";
                    $lists_name_categorie = $lists_name_categorie . '- ' . $categorie . "\n\n";
                    $lists_name_complet = $lists_name_complet . '- ' . $categorie . ' / ' . $lettre . "\n\n";
                    $msgInscription = '';
                    if ($nbLettre <= count($lists)) {
                        if (count($lists) > 1) {
                            //Si inscription a plusieurs lettres, on envoie un seul mail avec la liste des lettres
                            // Composition du message de demande de confirmation
                            $template = array();
                            $template['@@NOM_LETTRE@@'] = $lists_name;
                            $template['@@NOM_CATEGORIE@@'] = $lists_name_categorie;
                            $template['@@NOM_COMPLET@@'] = $lists_name_complet;
                            $template['@@DESCRIPTION@@'] = $listData['lst_comment'];
                            $template['@@FORMAT_INSCRIPTION@@'] = intval($lsr_mode) == 1 ? _T('clevermail:choix_version_html') : _T('clevermail:choix_version_texte');
                            $template['@@EMAIL@@'] = _request('sub_email');
                            $template['@@URL_CONFIRMATION@@'] = url_absolue(generer_url_public(_CLEVERMAIL_VALIDATION, 'id=' . $actionId));
                            $body = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_TEXT'");
                            $subject = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_SUBJECT'");
                            $msgInscription = _T('clevermail:inscription_ok_multiple', array('lst_name' => $lists_name_complet));
                        } else {
                            // Composition du message de demande de confirmation
                            $template = array();
                            if (strpos($listData['lst_name'], '/') === false) {
                                $template['@@NOM_LETTRE@@'] = supprimer_numero($listData['lst_name']);
                                $template['@@NOM_CATEGORIE@@'] = '';
                                $template['@@NOM_COMPLET@@'] = $template['@@NOM_LETTRE@@'];
                            } else {
                                $template['@@NOM_LETTRE@@'] = supprimer_numero(substr($listData['lst_name'], strpos($listData['lst_name'], '/') + 1));
                                $template['@@NOM_CATEGORIE@@'] = supprimer_numero(substr($listData['lst_name'], 0, strpos($listData['lst_name'], '/')));
                                $template['@@NOM_COMPLET@@'] = $template['@@NOM_CATEGORIE@@'] . ' / ' . $template['@@NOM_LETTRE@@'];
                            }
                            $template['@@DESCRIPTION@@'] = $listData['lst_comment'];
                            $template['@@FORMAT_INSCRIPTION@@'] = intval($lsr_mode) == 1 ? _T('clevermail:choix_version_html') : _T('clevermail:choix_version_texte');
                            $template['@@EMAIL@@'] = _request('sub_email');
                            $template['@@URL_CONFIRMATION@@'] = url_absolue(generer_url_public(_CLEVERMAIL_VALIDATION, 'id=' . $actionId));
                            $body = $listData['lst_subscribe_text'];
                            $subject = (intval($listData['lst_subject_tag']) == 1 ? '[' . $template['@@NOM_COMPLET@@'] . '] ' : '') . $listData['lst_subscribe_subject'];
                            $msgInscription = _T('clevermail:inscription_ok', array('lst_name' => $template['@@NOM_COMPLET@@']));
                        }
                        if ($nbLettre == count($lists)) {
                            while (list($translateFrom, $translateTo) = each($template)) {
                                $body = str_replace($translateFrom, $translateTo, $body);
                            }
                            $to = _request('sub_email');
                            $from = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_FROM'");
                            $return = sql_getfetsel("set_value", "spip_cm_settings", "set_name='CM_MAIL_RETURN'");
                            // message removed from queue, we can try to send it
                            // TODO : Et le charset ?
                            // TODO : Et le return-path ?
                            $envoyer_mail = charger_fonction('envoyer_mail', 'inc');
                            if ($envoyer_mail($to, $subject, $body, $from)) {
                                $message .= (strlen($message) > 0 ? '<br />' : '') . $msgInscription;
                            } else {
                                $message .= (strlen($message) > 0 ? '<br />' : '') . _T('clevermail:send_error', array('lst_name' => $listData['lst_name']));
                            }
                        }
                        $nbLettre++;
                    }
                    break;
                case 'mod':
                    // TODO : à faire
                    break;
                case 'closed':
                    $message .= (strlen($message) > 0 ? '<br />' : '') . _T('clevermail:inscription_nok', array('lst_name' => $listData['lst_name']));
                    $ok = false;
                    break;
            }
        }
    }
    return array('message_ok' => $message, 'editable' => '');
}
function BOUCLE_syndic_rubhtml_2ac554317f8f8f8aa21871c007ab234d(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_syndic_rub';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.id_rubrique", "rubriques.titre", "rubriques.lang");
        $command['orderby'] = array();
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-bas.html', 'html_2ac554317f8f8f8aa21871c007ab234d', '_syndic_rub', 22, $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']);
            $t0 .= '
		<a href="' . interdire_scripts(generer_url_public('backend', 'id_rubrique=' . $Pile[$SP]['id_rubrique'])) . '" rel="nofollow" title="' . _T('public|spip|ecrire:syndiquer_rubrique') . '"><img src="' . find_in_path('styles/img/rss.png') . '" alt="' . _T('public|spip|ecrire:icone_suivi_activite') . '" style="position:relative;bottom:-0.3em;" width="16" height="16" class="format_png" /><span>&nbsp;' . interdire_scripts(couper(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])), '60')) . '</span></a>
';
            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_syndic_rub @ squelettes/inc/inc-bas.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Example #26
0
/**
 * Retourne le titre et la langue d'un objet éditorial
 *
 * @param int $id Identifiant de l'objet
 * @param string $type Type d'objet
 * @param string|null $connect Connecteur SQL utilisé
 * @return array {
 * @var string $titre Titre si présent, sinon ''
 * @var string $lang Langue si présente, sinon ''
 * }
 **/
function traiter_raccourci_titre($id, $type, $connect = null)
{
    $trouver_table = charger_fonction('trouver_table', 'base');
    $desc = $trouver_table(table_objet($type));
    if (!($desc and $s = $desc['titre'])) {
        return array();
    }
    $_id = $desc['key']['PRIMARY KEY'];
    $r = sql_fetsel($s, $desc['table'], "{$_id}={$id}", '', '', '', '', $connect);
    if (!$r) {
        return array();
    }
    $r['titre'] = supprimer_numero($r['titre']);
    if (!$r['titre'] and !empty($r['surnom'])) {
        $r['titre'] = $r['surnom'];
    }
    if (!isset($r['lang'])) {
        $r['lang'] = '';
    }
    return $r;
}
function BOUCLE_rubrique_principalhtml_0caead67327defaf94febb642f511490(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_rubrique_principal';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.id_rubrique", "rubriques.lang", "rubriques.titre", "rubriques.id_secteur", "rubriques.texte", "rubriques.descriptif");
        $command['orderby'] = array();
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], 'oui', $Pile[$SP]['titre']);
            $t0 .= '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">
<head>
	<title>[' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '] : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '</title>
	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
	<link rel="alternate" type="application/rss+xml" title="' . _T('public|spip|ecrire:syndiquer_rubrique') . ' : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '" href="' . interdire_scripts(parametre_url(generer_url_public('backend', ''), 'id_rubrique', $Pile[$SP]['id_rubrique'])) . '" />

	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',10,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
</head>
<body dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . ' rubrique sect' . $Pile[$SP]['id_secteur'] . ' ' . BOUCLE_rubriques_bodyhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP) . ' rub' . $Pile[$SP]['id_rubrique'] . '">
<div id="page" class="rubrique rub' . $Pile[$SP]['id_rubrique'] . '">

<!-- *****************************************************************
	Bandeau, titre du site et menu langue
	Header and main menu (top and right) 
    ************************************************************* -->
	
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',20,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

<!-- *****************************************************************
	Contenu principal (centre)
	Main content (center) 
    ************************************************************* -->
	<div id="bloc-contenu">
		<h5>
		<a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '" title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . interdire_scripts(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])) . '">' . _T('public|spip|ecrire:accueil_site') . '</a>
    ' . (($t1 = BOUCLE_rubriques_cheminhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
    ' . $t1 . '
	' : '') . '
		' . (($t1 = strval(interdire_scripts(couper(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])), '60')))) !== '' ? '<b class=\'separateur\'>&gt;</b> ' . $t1 : '') . '
		</h5>
		<div class="ligne-debut"></div><!-- ligne-debut -->
    	' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_rubrique', 'ON', $Pile[$SP]['id_rubrique'], quete_parent($Pile[$SP]['id_rubrique']), 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']}'\"" : "") . ' />', '120', '0')))) !== '' ? '<div class="logo-liste-art">
    		' . $t1 . '
    	</div>' : '') . '
    <h1 class="titre-article">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</h1>
	' . (($t1 = strval(interdire_scripts(($a = filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['texte'], $connect, $Pile[0]), '560', '0')) or is_string($a) and strlen($a)) ? $a : interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]))))) !== '' ? '<div class="chapo ' . interdire_scripts($Pile[$SP]['texte'] ? '' : '') . '" id="description">
        ' . $t1 . ('
        ' . (($t2 = strval(interdire_scripts(calculer_notes()))) !== '' ? '<div class="notes" style="padding: 0 1.5em;">' . $t2 . '</div>' : '') . '
	</div><!-- chapo -->') : '') . '
	

		' . recuperer_fond('inc/inc-rub-documents', array_merge($Pile[0], array('id_rubrique' => $Pile[$SP]['id_rubrique'])), array('compil' => array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 43, $GLOBALS['spip_lang'])), _request('connect')) . '
	


		' . (($t1 = BOUCLE_type_miniplanhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 . '
		' : '


		' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-rub-articles') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',63,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
		
		') . '
		
		<br class="nettoyeur" />
	</div><!-- bloc-contenu -->
	
<!-- *****************************************************************
	Menus contextuels (droite)
	Contextual menus (right) 
    ************************************************************* -->
  <div id="encart">  

' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',76,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-breves') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',78,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-syndic') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',80,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
	
  </div><!-- encart -->

<!-- *****************************************************************
	Navigation principale et rubriques (haut et/ou gauche)
	Main and Sections Navigation (top and/orleft) 
    ************************************************************* -->
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',88,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
<!-- *****************************************************************
	Pied de page - Footer
    ************************************************************* -->
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',92,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

</div><!-- page -->
</body>
</html>
';
            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_rubrique_principal @ squelettes/rubrique.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
/**
 * Génère le cache de la liste des rubriques pour la navigation du bandeau
 *
 * Le cache, qui comprend pour chaque rubrique ses rubriques enfants et leur titre, est :
 *
 * - réactualisé en fonction de la meta `date_calcul_rubriques`
 * - mis en cache dans le fichier défini par la constante `_CACHE_RUBRIQUES`
 * - stocké également dans la globale `db_art_cache`
 *
 * @return bool true.
 **/
function gen_liste_rubriques()
{
    include_spip('inc/config');
    // ici, un petit fichier cache ne fait pas de mal
    $last = lire_config('date_calcul_rubriques', 0);
    if (lire_fichier(_CACHE_RUBRIQUES, $cache)) {
        list($date, $GLOBALS['db_art_cache']) = @unserialize($cache);
        if ($date == $last) {
            return false;
        }
        // c'etait en cache :-)
    }
    // se restreindre aux rubriques utilisees recemment +secteurs
    $where = sql_in_select("id_rubrique", "id_rubrique", "spip_rubriques", "", "", "id_parent=0 DESC, date DESC", _CACHE_RUBRIQUES_MAX);
    // puis refaire la requete pour avoir l'ordre alphabetique
    $res = sql_select("id_rubrique, titre, id_parent", "spip_rubriques", $where, '', 'id_parent, 0+titre, titre');
    // il ne faut pas filtrer le autoriser voir ici
    // car on met le resultat en cache, commun a tout le monde
    $GLOBALS['db_art_cache'] = array();
    while ($r = sql_fetch($res)) {
        $t = sinon($r['titre'], _T('ecrire:info_sans_titre'));
        $GLOBALS['db_art_cache'][$r['id_parent']][$r['id_rubrique']] = supprimer_numero(typo($t));
    }
    $t = array($last ? $last : time(), $GLOBALS['db_art_cache']);
    ecrire_fichier(_CACHE_RUBRIQUES, serialize($t));
    return true;
}
function BOUCLE_auteur_principalhtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'auteurs';
        $command['id'] = '_auteur_principal';
        $command['from'] = array('auteurs' => 'spip_auteurs');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("auteurs.id_auteur", "auteurs.lang", "auteurs.nom", "auteurs.bio", "auteurs.url_site", "auteurs.nom_site", "auteurs.email");
        $command['orderby'] = array();
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('auteurs.statut', '!5poubelle', '!5poubelle', ''), array('=', 'auteurs.id_auteur', sql_quote(@$Pile[0]['id_auteur'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_auteur_principal', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">
<head>
	<title>' . interdire_scripts(textebrut(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0]))) . ' - [' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . ']</title>
	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
	<link rel="alternate" type="application/rss+xml" title="' . interdire_scripts(textebrut(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0]))) . '" href="' . interdire_scripts(parametre_url(generer_url_public('backend', ''), 'id_auteur', $Pile[$SP]['id_auteur'])) . '" />
	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',9,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
</head>
<body dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . ' auteur aut' . $Pile[$SP]['id_auteur'] . '">
<div id="page" class="auteur">

<!-- *****************************************************************
	Bandeau, titre du site et menu langue
	Header and main menu (top and right) 
    ************************************************************* -->
	
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',19,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

<!-- *****************************************************************
	Contenu principal (centre)
	Main content (center) 
    ************************************************************* -->
	<div id="bloc-contenu">
		<div class="cartouche">
		' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_auteur', 'ON', $Pile[$SP]['id_auteur'], '', 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']}'\"" : "") . ' />', '120', '0')))) !== '' ? '<span style="float:right;">' . $t1 . '</span>' : '') . '
			<h1 class="">' . interdire_scripts(typo(supprimer_numero($Pile[$SP]['nom']), "TYPO", $connect, $Pile[0])) . '</h1>
			<div class="texte">
				' . (($t1 = strval(interdire_scripts(propre($Pile[$SP]['bio'], $connect, $Pile[0])))) !== '' ? '<div  class="bio">' . $t1 . '</div>' : '') . '
				' . (($t1 = strval(calculer_url($Pile[$SP]['url_site'], '', 'url', $connect))) !== '' ? '<b>' . interdire_scripts(typo(supprimer_numero(calculer_url($Pile[$SP]['url_site'], $Pile[$SP]['nom_site'], 'titre', $connect, false)), "TYPO", $connect, $Pile[0])) . ' : <a href="' . $t1 . ('">' . calculer_url($Pile[$SP]['url_site'], '', 'url', $connect) . '</a></b><br />') : '') . '
				' . (($t1 = strval(interdire_scripts(calculer_notes()))) !== '' ? $t1 . '<br />' : '') . '
				<br />
				' . (($t1 = strval(executer_balise_dynamique('FORMULAIRE_ECRIRE_AUTEUR', array($Pile[$SP]['id_auteur'], @$Pile[0]['id_article'], $Pile[$SP]['email']), array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_auteur_principal', 27, $GLOBALS['spip_lang'])))) !== '' ? '<h2 id="message">' . _T('public|spip|ecrire:info_envoyer_message_prive') . '</h2>' . $t1 : '') . '
			</div><!-- texte -->
		</div><!-- cartouche -->
		<!-- Articles de l\'auteur -->
		<h2>' . _T('public|spip|ecrire:articles_auteur') . '</h2>
		' . (($t1 = BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 : '
		') . '
	</div><!-- bloc-contenu -->

<!-- *****************************************************************
	Menus contextuels (droite)
	Contextual menus (right) 
    ************************************************************* -->
	<div id="encart">
	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',53,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

		' . (($t1 = BOUCLE_auteurshtml_ce97d1249b67fffb20134bd49b8a9e29($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
		<!-- Tous les auteurs -->
			<div class="menu">
				<ul class="titre">
					<li><b>' . _T('public|spip|ecrire:icone_tous_auteur') . '</b>
						' . $t1 . '
					</li>
				</ul>
			</div><!-- menu -->
		' : '') . '
	</div><!-- encart -->
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',72,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'id_auteur\' => ' . argumenter_squelette($Pile[$SP]['id_auteur']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/auteur.html\',\'html_ce97d1249b67fffb20134bd49b8a9e29\',\'\',73,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
</div><!-- page -->

</body>
</html>
';
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_auteur_principal @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_articleshtml_a80389532d86f8e6929960268237a0a8(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $doublons_index = array();
    // Initialise le(s) critère(s) doublons
    if (!isset($doublons[$d = 'articles'])) {
        $doublons[$d] = '';
    }
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_articles';
        $command['from'] = array('articles' => 'spip_articles');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("articles.date", "articles.lang", "articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre");
        $command['orderby'] = array('articles.date DESC');
        $command['join'] = array();
        $command['limit'] = '0,3';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array(sql_in('articles.id_article', $doublons[$doublons_index[] = 'articles'], 'NOT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-trad.html', 'html_a80389532d86f8e6929960268237a0a8', '_articles', 6, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            foreach ($doublons_index as $k) {
                $doublons[$k] .= "," . $Pile[$SP]['id_article'];
            }
            // doublons
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
          	<li>' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span>' . $t1 . ((($t2 = strval(traduire_nom_langue(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang'])))) !== '' ? ' - <dfn class="lang">' . $t2 . '</dfn>' : '') . '</span>') : '') . ' 
          	    
              <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>
          	</li>
            ';
            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/inc/inc-trad.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}