function install_etape_ldap4_dist() { $adresse_ldap = _request('adresse_ldap'); $login_ldap = _request('login_ldap'); $pass_ldap = _request('pass_ldap'); $port_ldap = _request('port_ldap'); $base_ldap = _request('base_ldap'); $base_ldap_text = _request('base_ldap_text'); if (!$base_ldap) { $base_ldap = $base_ldap_text; } echo install_debut_html('AUTO', ' onload="document.getElementById(\'suivant\').focus();return false;"'); $ldap_link = ldap_connect($adresse_ldap, $port_ldap); @ldap_bind($ldap_link, $login_ldap, $pass_ldap); // Essayer de verifier le chemin fourni $r = @ldap_compare($ldap_link, $base_ldap, "objectClass", ""); $fail = ldap_errno($ldap_link) == 32; if ($fail) { echo info_etape(_T('info_chemin_acces_annuaire')), info_progression_etape(3, 'etape_ldap', 'install/', true), "<div class='error'><p><b>" . _T('avis_operation_echec') . "</b></p><p>" . _T('avis_chemin_invalide_1'), " (<tt>" . spip_htmlspecialchars($base_ldap) . "</tt>) " . _T('avis_chemin_invalide_2') . "</p></div>"; } else { info_etape(_T('info_reglage_ldap')); echo info_progression_etape(4, 'etape_ldap', 'install/'); $statuts = liste_statuts_ldap(); $statut_ldap = defined('_INSTALL_STATUT_LDAP') ? _INSTALL_STATUT_LDAP : $GLOBALS['liste_des_statuts']['info_redacteurs']; $res = install_propager(array('adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap')) . "<input type='hidden' name='etape' value='ldap5' />" . "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />" . fieldset(_T('info_statut_utilisateurs_1'), array('statut_ldap' => array('label' => _T('info_statut_utilisateurs_2') . '<br />', 'valeur' => $statut_ldap, 'alternatives' => $statuts))) . install_ldap_correspondances() . bouton_suivant(); echo generer_form_ecrire('install', $res); } echo install_fin_html(); }
function echappe_js($t, $class = ' class="echappe-js"') { if (preg_match_all(',<script.*?($|</script.),isS', $t, $r, PREG_SET_ORDER)) { foreach ($r as $regs) { $t = str_replace($regs[0], "<code{$class}>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>', $t); } } return $t; }
function json_export($var) { $var = json_encode($var); // flag indiquant qu'on est en iframe et qu'il faut proteger nos // donnees dans un <textarea> ; attention $_FILES a ete vide par array_pop if (defined('FILE_UPLOAD')) { return "<textarea>" . spip_htmlspecialchars($var) . "</textarea>"; } else { return $var; } }
/** * Encoder les entites * * @param string $texte * @return string */ function xml_entites_html($texte) { if (!is_string($texte) or !$texte or strpbrk($texte, "&\"'<>") == false) { return $texte; } if (!function_exists('spip_htmlspecialchars')) { include_spip("inc/filtres_mini"); } $texte = spip_htmlspecialchars($texte, ENT_QUOTES); return $texte; }
function install_etape_ldap3_dist() { $adresse_ldap = _request('adresse_ldap'); $login_ldap = _request('login_ldap'); $pass_ldap = _request('pass_ldap'); $port_ldap = _request('port_ldap'); $base_ldap_text = defined('_INSTALL_BASE_LDAP') ? _INSTALL_BASE_LDAP : "ou=users, dc=mon-domaine, dc=com"; echo install_debut_html('AUTO', ' onload="document.getElementById(\'suivant\').focus();return false;"'); echo info_etape(_T('info_chemin_acces_1'), info_progression_etape(3, 'etape_ldap', 'install/')), _T('info_chemin_acces_2'); $ldap_link = @ldap_connect("{$adresse_ldap}", "{$port_ldap}"); if ($ldap_link) { @ldap_bind($ldap_link, "{$login_ldap}", "{$pass_ldap}"); $result = @ldap_read($ldap_link, "", "objectclass=*", array("namingContexts")); $info = @ldap_get_entries($ldap_link, $result); @ldap_close($ldap_link); } $checked = false; $res = ''; if (is_array($info) and $info["count"] > 0) { $res .= "<p>" . _T('info_selection_chemin_acces') . "</p>"; $res .= "<ul>"; $n = 0; for ($i = 0; $i < $info["count"]; $i++) { $names = $info[$i]["namingcontexts"]; if (is_array($names)) { for ($j = 0; $j < $names["count"]; $j++) { $n++; $res .= "<li><input name=\"base_ldap\" value=\"" . spip_htmlspecialchars($names[$j]) . "\" type='radio' id='tab{$n}'"; if (!$checked) { $res .= " checked=\"checked\""; $checked = true; } $res .= " />"; $res .= "<label for='tab{$n}'>" . spip_htmlspecialchars($names[$j]) . "</label></li>\n"; } } } $res .= "</ul>"; $res .= _T('info_ou') . " "; } $res .= "<br />\n<input name=\"base_ldap\" value=\"\" type='radio' id='manuel'"; if (!$checked) { $res .= " checked=\"checked\""; $checked = true; } $res .= " />" . "\n<label for='manuel'>" . _T('entree_chemin_acces') . "</label> " . "\n<fieldset>" . "<input type='text' name='base_ldap_text' class='text' value=\"{$base_ldap_text}\" size='40' />" . "\n</fieldset>" . "\n<input type='hidden' name='etape' value='ldap4' />" . install_propager(array('adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap')) . bouton_suivant(); echo generer_form_ecrire('install', $res); echo install_fin_html(); }
function html_e3cac34669117ef67c3fe7b2fef7351d($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = '<!-- L\'entete du site --> <div id="entete" class="pas_surlignable"> <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])) . '" class="nom-site"><span>' . interdire_scripts(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])) . '</span></a> </div><!-- entete -->'; return analyse_resultat_skel('html_e3cac34669117ef67c3fe7b2fef7351d', $Cache, $page, 'squelettes/inc/inc-bandeau.html'); }
function install_etape_2_dist() { $adresse_db = defined('_INSTALL_HOST_DB') ? _INSTALL_HOST_DB : _request('adresse_db'); if (preg_match(',(.*):(.*),', $adresse_db, $r)) { list(, $adresse_db, $port) = $r; } else { $port = ''; } $login_db = defined('_INSTALL_USER_DB') ? _INSTALL_USER_DB : _request('login_db'); $pass_db = defined('_INSTALL_PASS_DB') ? _INSTALL_PASS_DB : _request('pass_db'); $server_db = defined('_INSTALL_SERVER_DB') ? _INSTALL_SERVER_DB : _request('server_db'); $name_db = defined('_INSTALL_NAME_DB') ? _INSTALL_NAME_DB : ''; $chmod = _request('chmod'); $link = spip_connect_db($adresse_db, $port, $login_db, $pass_db, $name_db, $server_db); $GLOBALS['connexions'][$server_db] = $link; $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; echo install_debut_html(); // prenons toutes les dispositions possibles pour que rien ne s'affiche ! /* * /!\ sqlite3/PDO : erreur sur join(', ', $link) * L'objet PDO ne peut pas etre transformee en chaine * Un echo $link ne fonctionne pas non plus * Il faut utiliser par exemple print_r($link) */ //echo "\n<!--\n", join(', ', $link), " $login_db "; $db_connect = 0; // revoirfunction_exists($ferrno) ? $ferrno() : 0; //echo join(', ', $GLOBALS['connexions'][$server_db]); //echo "\n-->\n"; if ($db_connect == "0" && $link) { echo "<div class='success'><b>" . _T('info_connexion_ok') . "</b></div>"; echo info_progression_etape(2, 'etape_', 'install/'); echo info_etape(_T('menu_aide_installation_choix_base') . aide("install2", true)); echo "\n", '<!-- ', sql_version($server_db), ' -->'; list($checked, $res) = install_etape_2_bases($login_db, $server_db); $hidden = (defined('_SPIP_CHMOD') ? '' : "\n<input type='hidden' name='chmod' value='" . spip_htmlspecialchars($chmod) . "' />") . predef_ou_cache($adresse_db . ($port ? ':' . $port : ''), $login_db, $pass_db, $server_db); echo install_etape_2_form($hidden, $checked, $res, 3); } else { echo info_progression_etape(1, 'etape_', 'install/', true); echo "<div class='error'>"; echo info_etape(_T('info_connexion_base')); echo "<h3>" . _T('avis_connexion_echec_1') . "</h3>"; echo "<p>" . _T('avis_connexion_echec_2') . "</p>"; echo "<p style='font-size: small;'>", _T('avis_connexion_echec_3'), "</p></div>"; } echo install_fin_html(); }
function BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; if (!isset($command['table'])) { $command['table'] = 'articles'; $command['id'] = '_articles'; $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_auteurs_liens'); $command['type'] = array(); $command['groupby'] = array("articles.id_article"); $command['select'] = array("articles.titre", "articles.id_article", "articles.lang", "articles.texte", "articles.descriptif", "articles.chapo", "articles.date"); $command['orderby'] = array('articles.titre'); $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article'))); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L1.id_auteur', sql_quote($Pile[$SP]['id_auteur'], '', 'bigint(21) NOT NULL DEFAULT \'0\''))); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_articles', 39, $GLOBALS['spip_lang'])); if (!$iter->err()) { lang_select($GLOBALS['spip_lang']); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']); $t1 = ' <h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/spip.php?action=converser&redirect=' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '%2F' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '&var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" hreflang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3> <div class="detail"> ' . interdire_scripts(nom_jour(normaliser_date($Pile[$SP]['date']))) . ' ' . interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))) . ' </div> '; $t0 .= (strlen($t1) && strlen($t0) ? '<br />' : '') . $t1; lang_select(); } lang_select(); $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_articles @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
/** * Protéger les saisies d'un champ de formulaire * * Proteger les ' et les " dans les champs que l'on va injecter, * sans toucher aux valeurs sérialisées * * @see entites_html() * @param string|array $texte * Saisie à protéger * @return string|array * Saisie protégée **/ function protege_champ($texte) { if (is_array($texte)) { $texte = array_map('protege_champ', $texte); } else { // ne pas corrompre une valeur serialize if (preg_match(",^[abis]:\\d+[:;],", $texte) and unserialize($texte) != false or is_null($texte)) { return $texte; } if (is_string($texte) and $texte and strpbrk($texte, "&\"'<>") !== false) { $texte = spip_htmlspecialchars($texte, ENT_QUOTES); } elseif (is_bool($texte)) { $texte = $texte ? '1' : ''; } } return $texte; }
function formulaires_oubli_verifier_dist() { $erreurs = array(); $email = strval(_request('oubli')); $r = formulaires_oubli_mail($email); if (!is_array($r)) { $erreurs['oubli'] = $r; } else { if (!$r[1]) { $erreurs['oubli'] = _T('pass_erreur_non_enregistre', array('email_oubli' => spip_htmlspecialchars($email))); } elseif ($r[1]['statut'] == '5poubelle' or $r[1]['pass'] == '') { $erreurs['oubli'] = _T('pass_erreur_acces_refuse'); } } if (_request('nobot')) { $erreurs['message_erreur'] = _T('pass_rien_a_faire_ici'); } return $erreurs; }
function traiter_echap_code_dist($regs) { list(, , $att, $corps) = $regs; $echap = spip_htmlspecialchars($corps); // il ne faut pas passer dans entites_html, ne pas transformer les &#xxx; du code ! // ne pas mettre le <div...> s'il n'y a qu'une ligne if (is_int(strpos($echap, "\n"))) { // supprimer les sauts de ligne debut/fin // (mais pas les espaces => ascii art). $echap = preg_replace("/^[\n\r]+|[\n\r]+\$/s", "", $echap); $echap = nl2br($echap); $echap = "<div style='text-align: left;' " . "class='spip_code' dir='ltr'><code{$att}>" . $echap . "</code></div>"; } else { $echap = "<code{$att} class='spip_code' dir='ltr'>" . $echap . "</code>"; } $echap = str_replace("\t", " ", $echap); $echap = str_replace(" ", " ", $echap); return $echap; }
function html_6df0ecfade86092ec8be1bb468d967e1($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = ' ' . (($t1 = strval(direction_css(find_in_path('spip_style.css')))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="all" />' : '') . ' ' . (($t1 = strval(direction_css(find_in_path('spip_formulaires.css')))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="projection, screen, tv" />' : '') . ' ' . (($t1 = strval(direction_css(find_in_path('styles/base.css')))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="projection, screen, tv" />' : '') . ' ' . (($t1 = strval(find_in_path('styles/alter.css'))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="projection, screen, tv" />' : '') . ' ' . (($t1 = strval(find_in_path('styles/habillages.css'))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="projection, screen, tv" />' : '') . ' ' . (($t1 = strval(find_in_path('styles/perso.css'))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="projection, screen, tv" />' : '') . ' ' . (($t1 = strval(find_in_path('styles/color.css'))) !== '' ? '<link rel="stylesheet" href="' . $t1 . '" type="text/css" media="projection, screen, tv" />' : '') . ' ' . (($t1 = strval(direction_css(find_in_path('styles/print.css')))) !== '' ? '<link rel="stylesheet" href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . $t1 . '" type="text/css" media="print" />' : '') . ' ' . '<' . '?php header("X-Spip-Filtre: insert_head_css_conditionnel"); ?' . '>' . pipeline('insert_head', '<!-- insert_head -->') . ' ' . (($t1 = strval(find_in_path('js/base.js'))) !== '' ? '<script src="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . $t1 . '" type="text/javascript"></script>' : '') . ' ' . (($t1 = strval(find_in_path('js/perso.js'))) !== '' ? '<script src="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . $t1 . '" type="text/javascript"></script>' : '') . ' <!--[if lte IE 6]> <style> #menu-rubriques a, #extra a { height: 1em; } #menu-rubriques li, #extra li { height: 1em; float: left; clear: both;width: 100%; } </style> <![endif]--> <!--[if IE]> <style> body * {zoom:1} #menu-principal *, #bloc-contenu * {zoom: 0} #menu-rubriques li { clear: none;} </style> <![endif]--> ' . BOUCLE_polices_webfontshtml_6df0ecfade86092ec8be1bb468d967e1($Cache, $Pile, $doublons, $Numrows, $SP); return analyse_resultat_skel('html_6df0ecfade86092ec8be1bb468d967e1', $Cache, $page, 'squelettes/styles.html'); }
function install_etape_liste_bases($server_db, $login_db, $disabled = array()) { $bases = $checked = array(); $noms = sql_listdbs($server_db); if (!$noms) { return ''; } foreach ($noms as $nom) { $id = spip_htmlspecialchars($nom); $dis = in_array($nom, $disabled) ? " disabled='disabled'" : ''; $base = " name=\"choix_db\" value=\"" . $nom . '"' . $dis . " type='radio' id='{$id}'"; $label = "<label for='{$id}'>" . ($dis ? "<i>{$nom}</i>" : $nom) . "</label>"; if (!$checked and !$dis and ($nom == $login_db or $GLOBALS['table_prefix'] == $nom)) { $checked = "<input{$base} checked='checked' />\n{$label}"; } else { $bases[] = "<input{$base} />\n{$label}"; } } if (!$bases && !$checked) { return false; } if ($checked) { array_unshift($bases, $checked); $checked = true; } return array($checked, $bases); }
/** * Retourne une page HTML contenant, dans une présentation minimale, * le contenu transmis dans `$titre` et `$corps`. * * Appelée pour afficher un message d’erreur (l’utilisateur n’a pas * accès à cette page par exemple). * * Lorsqu’aucun argument n’est transmis, un header 403 est renvoyé, * ainsi qu’un message indiquant une interdiction d’accès. * * @example * ``` * include_spip('inc/minipres'); * if (!autoriser('configurer')) { * echo minipres(); * exit; * } * ``` * @uses install_debut_html() * @uses install_fin_html() * * @param string $titre * Titre de la page * @param string $corps * Corps de la page * @param array $options * string onload : Attribut onload de `<body>` * bool all_inline : Inliner les css et js dans la page (limiter le nombre de hits) * int status : status de la page * @return string * HTML de la page */ function minipres($titre = '', $corps = "", $options = array()) { // compat signature old // minipres($titre='', $corps="", $onload='', $all_inline = false) $args = func_get_args(); if (isset($args[2]) and is_string($args[2])) { $options = array('onload' => $args[2]); } if (isset($args[3])) { $options['all_inline'] = $args[3]; } $options = array_merge(array('onload' => '', 'all_inline' => false), $options); if (!defined('_AJAX')) { define('_AJAX', false); } // par securite if (!$titre) { if (!isset($options['status'])) { $options['status'] = 403; } if (!($titre = _request('action')) and !($titre = _request('exec')) and !($titre = _request('page'))) { $titre = '?'; } $titre = spip_htmlspecialchars($titre); $titre = $titre == 'install' ? _T('avis_espace_interdit') : $titre . ' : ' . _T('info_acces_interdit'); $statut = isset($GLOBALS['visiteur_session']['statut']) ? $GLOBALS['visiteur_session']['statut'] : ''; $nom = isset($GLOBALS['visiteur_session']['nom']) ? $GLOBALS['visiteur_session']['nom'] : ''; if ($statut != '0minirezo') { $titre = _T('info_acces_interdit'); } $corps = generer_form_ecrire('accueil', '', '', $statut ? _T('public:accueil_site') : _T('public:lien_connecter')); spip_log($nom . " {$titre} " . $_SERVER['REQUEST_URI']); } if (!_AJAX) { if (isset($options['status'])) { http_status($options['status']); } return install_debut_html($titre, $options['onload'], $options['all_inline']) . $corps . install_fin_html(); } else { include_spip('inc/headers'); include_spip('inc/actions'); $url = self('&', true); foreach ($_POST as $v => $c) { $url = parametre_url($url, $v, $c, '&'); } ajax_retour("<div>" . $titre . redirige_formulaire($url) . "</div>", false); } }
function html_2ac554317f8f8f8aa21871c007ab234d($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = ' <div id="bas"> <a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '" title="' . _T('public|spip|ecrire:accueil_site') . '">' . _T('public|spip|ecrire:accueil_site') . '</a> | <a href="' . vider_url(urlencode_1738(generer_url_entite('1', 'auteur', '', '', true))) . '" title="' . _T('public|spip|ecrire:info_contact') . '">' . _T('public|spip|ecrire:info_contact') . '</a> | <a href="' . interdire_scripts(generer_url_public('plan', '')) . '" title="' . _T('public|spip|ecrire:plan_site') . '">' . _T('public|spip|ecrire:plan_site') . '</a> ' . (($t1 = strval(interdire_scripts(invalideur_session($Cache, table_valeur($GLOBALS["visiteur_session"], (string) 'id_auteur', null) ? '' : ' ')))) !== '' ? $t1 . (' | <a href="' . interdire_scripts(parametre_url(generer_url_public('login', ''), 'url', self())) . '" rel="nofollow" class=\'login_modal\'>' . _T('public|spip|ecrire:lien_connecter') . '</a>') : '') . (($t1 = strval(invalideur_session($Cache, (function_exists("autoriser") || include_spip("inc/autoriser")) && autoriser('ecrire') ? " " : ""))) !== '' ? $t1 . ('| <a href="' . interdire_scripts(eval('return ' . '_DIR_RESTREINT_ABS' . ';')) . '">' . _T('public|spip|ecrire:espace_prive') . '</a>') : '') . (($t1 = strval(interdire_scripts(invalideur_session($Cache, table_valeur($GLOBALS["visiteur_session"], (string) 'id_auteur', null) ? ' ' : '')))) !== '' ? $t1 . (' | <a href="' . executer_balise_dynamique('URL_LOGOUT', array(), array('squelettes/inc/inc-bas.html', 'html_2ac554317f8f8f8aa21871c007ab234d', '', 1, $GLOBALS['spip_lang'])) . '" rel="nofollow">' . _T('public|spip|ecrire:icone_deconnecter') . '</a>') : '') . ' | <a href="' . interdire_scripts(generer_url_public('statistiques', '')) . '" title="' . _T('public|spip|ecrire:titre_statistiques') . '">' . _T('public|spip|ecrire:titre_statistiques') . '</a> | <span style="white-space: nowrap;">' . _T('public|spip|ecrire:info_visiteurs') . ' : ' . BOUCLE_art_visiteshtml_2ac554317f8f8f8aa21871c007ab234d($Cache, $Pile, $doublons, $Numrows, $SP) . ' ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-affvisit') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/inc/inc-bas.html\',\'html_2ac554317f8f8f8aa21871c007ab234d\',\'\',13,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '></span> <p> <a href="' . interdire_scripts(generer_url_public('backend', '')) . '" rel="nofollow" title="' . _T('public|spip|ecrire:bouton_radio_syndication') . ' ' . traduire_nom_langue(spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang'])) . '"><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 style="text-transform: uppercase;"> ' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . ' </span></a> ' . BOUCLE_rubriques_cheminhtml_2ac554317f8f8f8aa21871c007ab234d($Cache, $Pile, $doublons, $Numrows, $SP) . ' ' . BOUCLE_syndic_rubhtml_2ac554317f8f8f8aa21871c007ab234d($Cache, $Pile, $doublons, $Numrows, $SP) . ' <big> <b><a href="http://' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '.wikipedia.org/wiki/Really_Simple_Syndication">?</a></b> </big> ' . BOUCLE_syndic_testhtml_2ac554317f8f8f8aa21871c007ab234d($Cache, $Pile, $doublons, $Numrows, $SP) . ' </p> <p> <a href="http://www.spip.net" title="' . _T('public|spip|ecrire:site_realise_avec_spip') . ' ' . spip_version() . '"> ' . _T('public|spip|ecrire:site_realise_avec_spip') . ' ' . interdire_scripts('3.1.0') . '</a> + <a href="http://edu.ca.edu/rubrique43.html" title="' . _T('spip:squelette') . ' AHUNTSIC - ' . calcul_version_squelette() . '">AHUNTSIC</a> </p> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas_cc') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/inc/inc-bas.html\',\'html_2ac554317f8f8f8aa21871c007ab234d\',\'\',44,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . (($t1 = strval(interdire_scripts(filtre_info_plugin_dist("visiteurs_connectes", "est_actif") ? ' ' : ''))) !== '' ? $t1 . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc-visiteurs') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/inc/inc-bas.html\',\'html_2ac554317f8f8f8aa21871c007ab234d\',\'\',47,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '>' : '') . ' ' . (($t1 = strval(interdire_scripts(filtre_info_plugin_dist("couteau_suisse", "est_actif") ? ' ' : ''))) !== '' ? $t1 . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('fonds/visiteurs_connectes') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/inc/inc-bas.html\',\'html_2ac554317f8f8f8aa21871c007ab234d\',\'\',48,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '>' : '') . ' </div><!-- fin bas --> ' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas_menu-lang') . ', array(\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/inc/inc-bas.html\',\'html_2ac554317f8f8f8aa21871c007ab234d\',\'\',53,$GLOBALS[\'spip_lang\'])), _request("connect")); ?' . '> ' . interdire_scripts(@$Pile[0]['spip_cron']) . ' '; return analyse_resultat_skel('html_2ac554317f8f8f8aa21871c007ab234d', $Cache, $page, 'squelettes/inc/inc-bas.html'); }
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\'>></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; }
function microformat2enclosure($tags) { $enclosures = array(); foreach (extraire_balises($tags, 'a') as $e) { if (extraire_attribut($e, 'rel') == 'enclosure') { $url = filtrer_entites(extraire_attribut($e, 'href')); $type = extraire_attribut($e, 'type'); if (!($length = intval(extraire_attribut($e, 'title')))) { $length = intval(extraire_attribut($e, 'length')); } # vieux data $fichier = basename($url); $enclosures[] = '<enclosure' . ($url ? ' url="' . spip_htmlspecialchars($url) . '"' : '') . ($type ? ' type="' . spip_htmlspecialchars($type) . '"' : '') . ($length ? ' length="' . $length . '"' : '') . ' />'; } } return join("\n", $enclosures); }
function html_7e58ec237019eff13c867a6e81765d14($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = ' <div class="menu" id="menu-principal"> <ul> <li id="menu-principal-accueil"><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])) . '" accesskey="0">' . _T('public|spip|ecrire:accueil_site') . '</a></li> ' . BOUCLE_articlehtml_7e58ec237019eff13c867a6e81765d14($Cache, $Pile, $doublons, $Numrows, $SP) . ' ' . BOUCLE_rubriquehtml_7e58ec237019eff13c867a6e81765d14($Cache, $Pile, $doublons, $Numrows, $SP) . ' <li id="menu-principal-contact"><a href="' . vider_url(urlencode_1738(generer_url_entite('1', 'auteur', '', '', true))) . '" title="' . _T('public|spip|ecrire:info_contact') . '" accesskey="7">' . _T('public|spip|ecrire:info_contact') . '</a></li> ' . BOUCLE_art_agendahtml_7e58ec237019eff13c867a6e81765d14($Cache, $Pile, $doublons, $Numrows, $SP) . ' <li id="menu-principal-plan"><a href="' . interdire_scripts(generer_url_public('plan', '')) . '" title="' . _T('public|spip|ecrire:plan_site') . '" accesskey="3">' . _T('public|spip|ecrire:plan_site') . '</a></li> ' . BOUCLE_sitehtml_7e58ec237019eff13c867a6e81765d14($Cache, $Pile, $doublons, $Numrows, $SP) . ' <li id="menu-principal-resume"><a href="' . interdire_scripts(generer_url_public('resume', '')) . '" title="' . _T('public|spip|ecrire:en_resume') . '" accesskey="5">' . _T('public|spip|ecrire:en_resume') . '</a></li> ' . (($t1 = strval(executer_balise_dynamique('FORMULAIRE_RECHERCHE', array(), array('squelettes/inc/inc-menu-principal.html', 'html_7e58ec237019eff13c867a6e81765d14', '', 0, $GLOBALS['spip_lang'])))) !== '' ? '<li id="menu-principal-recherche"> <div class="menu" id="menu-recherche"> <h3 class="structure">' . _T('public|spip|ecrire:info_rechercher') . '</h3> <ul> <li> ' . $t1 . ' </li> </ul> </div><!-- menu-recherche --> </li>' : '') . ' </ul> </div>'; return analyse_resultat_skel('html_7e58ec237019eff13c867a6e81765d14', $Cache, $page, 'squelettes/inc/inc-menu-principal.html'); }
function BOUCLE_article_languehtml_76ddbc2b5f1671bea60186a8fa5bb500(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; $doublons_index = array(); $command['pagination'] = array(isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : null, 10); // Initialise le(s) critère(s) doublons if (!isset($doublons[$d = 'articles' . 'archives'])) { $doublons[$d] = ''; } if (!isset($command['table'])) { $command['table'] = 'articles'; $command['id'] = '_article_langue'; $command['from'] = array('articles' => 'spip_articles'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("articles.id_article", "articles.date_redac", "articles.surtitre", "articles.titre", "articles.soustitre", "articles.descriptif", "articles.chapo", "articles.texte", "articles.lang"); $command['orderby'] = array('articles.date_redac'); $command['join'] = array(); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array(sql_in('articles.id_article', $doublons[$doublons_index[] = 'articles' . 'archives'], 'NOT'))); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/agenda.html', 'html_76ddbc2b5f1671bea60186a8fa5bb500', '_article_langue', 41, $GLOBALS['spip_lang'])); if (!$iter->err()) { // COMPTEUR $Numrows['_article_langue']['compteur_boucle'] = 0; $Numrows['_article_langue']['total'] = @intval($iter->count()); $debut_boucle = isset($Pile[0]['debut_article_langue']) ? $Pile[0]['debut_article_langue'] : _request('debut_article_langue'); if (substr($debut_boucle, 0, 1) == '@') { $debut_boucle = $Pile[0]['debut_article_langue'] = quete_debut_pagination('id_article', $Pile[0]['@id_article'] = substr($debut_boucle, 1), 10, $iter); $iter->seek(0); } $debut_boucle = intval($debut_boucle); $debut_boucle = ($tout = $debut_boucle == -1) ? 0 : $debut_boucle; $debut_boucle = max(0, min($debut_boucle, floor(($Numrows['_article_langue']['total'] - 1) / 10) * 10)); $debut_boucle = intval($debut_boucle); $fin_boucle = min($tout ? $Numrows['_article_langue']['total'] : $debut_boucle + 9, $Numrows['_article_langue']['total'] - 1); $Numrows['_article_langue']['grand_total'] = $Numrows['_article_langue']['total']; $Numrows['_article_langue']["total"] = max(0, $fin_boucle - $debut_boucle + 1); if ($debut_boucle > 0 and $debut_boucle < $Numrows['_article_langue']['grand_total'] and $iter->seek($debut_boucle, 'continue')) { $Numrows['_article_langue']['compteur_boucle'] = $debut_boucle; } lang_select($GLOBALS['spip_lang']); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { $Numrows['_article_langue']['compteur_boucle']++; if ($Numrows['_article_langue']['compteur_boucle'] <= $debut_boucle) { continue; } if ($Numrows['_article_langue']['compteur_boucle'] - 1 > $fin_boucle) { break; } foreach ($doublons_index as $k) { $doublons[$k] .= "," . $Pile[$SP]['id_article']; } // doublons lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']); $t0 .= ' <hr /> <h4>' . nom_jour(normaliser_date($Pile[$SP]['date_redac'])) . ' ' . affdate(normaliser_date($Pile[$SP]['date_redac'])) . (($t1 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t2 . ':' : '') . (($t2 = strval(minutes(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t2 . (' ' . _T('public|spip|ecrire:heures')) : '') : '')) !== '' ? ' — ' . $t1 : '') . '</h4> <hr /> ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_article', 'ON', $Pile[$SP]['id_article'], '', 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '150', '0')))) !== '' ? '<span style="float:right;">' . $t1 . '</span>' : '') . ' ' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['surtitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="surtitre">' . $t1 . '</div>' : '') . ' <h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3> ' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['soustitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="sous-titre">' . $t1 . '</div>' : '') . ' <div class="detail"> </div><!-- detail --> ' . (($t1 = strval(interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]) ? (($t2 = strval(interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0])))) !== '' ? '<div class="">' . $t2 . ('</div> <div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . ' ' : interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0]) ? (($t3 = strval(interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0])))) !== '' ? '<div class="">' . $t3 . ('</div> <div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . ' ' : (($t3 = strval(interdire_scripts(couper(propre($Pile[$SP]['texte'], $connect, $Pile[0]), '300')))) !== '' ? '<div class="">' . $t3 . ('</div> <div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . ' ') . ' '))) !== '' ? '<div class="texte"> <div class="extrait">' . $t1 . '</div><!-- fin extrait --> </div>' : '') . ' <br /> '; lang_select(); } lang_select(); $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_article_langue @ squelettes/agenda.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
function BOUCLE_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&redirect=' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '%2F' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '&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; }
/** * http://doc.spip.org/@minipres * * @param string $titre * titre de la page * @param string $corps * corps de la page * @param string $onload * attribut onload de <body> * @param bool $all_inline * inliner les css et js dans la page (limiter le nombre de hits) * @return string */ function minipres($titre = '', $corps = "", $onload = '', $all_inline = false) { if (!defined('_AJAX')) { define('_AJAX', false); } // par securite if (!$titre) { if (!_AJAX) { http_status(403); } if (!($titre = _request('action')) and !($titre = _request('exec')) and !($titre = _request('page'))) { $titre = '?'; } $titre = spip_htmlspecialchars($titre); $titre = $titre == 'install' ? _T('avis_espace_interdit') : $titre . ' : ' . _T('info_acces_interdit'); $corps = generer_form_ecrire('accueil', '', '', $GLOBALS['visiteur_session']['statut'] ? _T('public:accueil_site') : _T('public:lien_connecter')); spip_log($GLOBALS['visiteur_session']['nom'] . " {$titre} " . $_SERVER['REQUEST_URI']); } if (!_AJAX) { return install_debut_html($titre, $onload, $all_inline) . $corps . install_fin_html(); } else { include_spip('inc/headers'); include_spip('inc/actions'); $url = self('&', true); foreach ($_POST as $v => $c) { $url = parametre_url($url, $v, $c, '&'); } ajax_retour("<div>" . $titre . redirige_formulaire($url) . "</div>", false); } }
function debusquer_source($objet, $affiche) { $quoi = $GLOBALS['debug_objets'][$affiche][$objet]; if (!empty($GLOBALS['debug_objets']['boucle'][$objet]->id_boucle)) { $nom = $GLOBALS['debug_objets']['boucle'][$objet]->id_boucle; } else { $nom = $GLOBALS['debug_objets']['sourcefile'][$objet]; } $res2 = ""; if ($affiche == 'resultat') { $legend = $nom; $req = $GLOBALS['debug_objets']['requete'][$objet]; if (function_exists('_mysql_traite_query')) { $c = strtolower(_request('connect')); $c = $GLOBALS['connexions'][$c ? $c : 0]['prefixe']; $req = _mysql_traite_query($req, '', $c); } // permettre le copier/coller facile // $res = ancre_texte($req, array(), true); $res = "<div id='T" . md5($req) . "'>\n<pre>\n" . $req . "</pre>\n</div>\n"; // formatage et affichage des resultats bruts de la requete $ress_req = spip_query($req); $brut_sql = ''; $num = 1; // eviter l'affichage de milliers de lignes // personnalisation possible dans mes_options $max_aff = defined('_MAX_DEBUG_AFF') ? _MAX_DEBUG_AFF : 50; while ($retours_sql = sql_fetch($ress_req)) { if ($num <= $max_aff) { $brut_sql .= "<h3>" . ($num == 1 ? $num . " sur " . sql_count($ress_req) : $num) . "</h3>"; $brut_sql .= "<p>"; foreach ($retours_sql as $key => $val) { $brut_sql .= "<strong>" . $key . "</strong> => " . spip_htmlspecialchars(couper($val, 150)) . "<br />\n"; } $brut_sql .= "</p>"; } $num++; } $res2 = interdire_scripts($brut_sql); foreach ($quoi as $view) { // ne pas afficher les $contexte_inclus $view = preg_replace(",<\\?php.+\\?[>],Uims", "", $view); if ($view) { $res2 .= "\n<br /><fieldset>" . interdire_scripts($view) . "</fieldset>"; } } } elseif ($affiche == 'code') { $legend = $nom; $res = ancre_texte("<" . "?php\n" . $quoi . "\n?" . ">"); } elseif ($affiche == 'boucle') { $legend = _T('zbug_boucle') . ' ' . $nom; // Le compilateur prefixe le nom des boucles par l'extension du fichier source. $gram = preg_match('/^([^_]+)_/', $objet, $r) ? $r[1] : ''; $res = ancre_texte(public_decompiler($quoi, $gram, 0, 'boucle')); } elseif ($affiche == 'squelette') { $legend = $GLOBALS['debug_objets']['sourcefile'][$objet]; $res = ancre_texte($GLOBALS['debug_objets']['squelette'][$objet]); } return array($legend, $res, $res2); }
/** * Échapper et affichier joliement les `<script` et `<iframe`... * * @param string $t * @param string $class Attributs HTML du conteneur à ajouter * @return string */ function echappe_js($t, $class = ' class = "echappe-js"') { foreach (array('script', 'iframe') as $tag) { if (stripos($t, "<{$tag}") !== false and preg_match_all(',<' . $tag . '.*?($|</' . $tag . '.),isS', $t, $r, PREG_SET_ORDER)) { foreach ($r as $regs) { $t = str_replace($regs[0], "<code{$class}>" . nl2br(spip_htmlspecialchars($regs[0])) . '</code>', $t); } } } return $t; }
public static function outputTotal($liste, $profondeur = 0) { ksort($liste); foreach ($liste as $cause => $duree) { if (is_array($duree)) { TextWheelDebug::outputTotal($duree, $profondeur + 1); } else { echo "<tr class='prof-{$profondeur}'>\n\t\t\t\t\t<td class='number'><b>" . intval($duree) . "</b> ms</td>\n\t\t\t\t\t<td class='name'>" . spip_htmlspecialchars($cause) . "</td>\n\t\t\t\t\t</tr>\n"; } } }
function BOUCLE_articles_rubriquehtml_8bf8bdc0aa13e79e11d908f1699ff96f(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; $command['pagination'] = array(isset($Pile[0]['debut_articles_rubrique']) ? $Pile[0]['debut_articles_rubrique'] : null, 10); if (!isset($command['table'])) { $command['table'] = 'articles'; $command['id'] = '_articles_rubrique'; $command['from'] = array('articles' => 'spip_articles'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("articles.id_rubrique", "0+articles.titre AS num", "articles.date", "articles.id_article", "articles.surtitre", "articles.descriptif", "articles.titre", "articles.soustitre", "articles.chapo", "articles.texte", "articles.lang"); $command['orderby'] = array('num', 'articles.date DESC'); $command['join'] = array(); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), sql_in('articles.id_rubrique', calcul_branche_in(sql_quote(@$Pile[0]['id_rubrique'])))); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-rub-articles.html', 'html_8bf8bdc0aa13e79e11d908f1699ff96f', '_articles_rubrique', 1, $GLOBALS['spip_lang'])); if (!$iter->err()) { // COMPTEUR $Numrows['_articles_rubrique']['compteur_boucle'] = 0; $Numrows['_articles_rubrique']['total'] = @intval($iter->count()); $debut_boucle = isset($Pile[0]['debut_articles_rubrique']) ? $Pile[0]['debut_articles_rubrique'] : _request('debut_articles_rubrique'); if (substr($debut_boucle, 0, 1) == '@') { $debut_boucle = $Pile[0]['debut_articles_rubrique'] = quete_debut_pagination('id_article', $Pile[0]['@id_article'] = substr($debut_boucle, 1), 10, $iter); $iter->seek(0); } $debut_boucle = intval($debut_boucle); $debut_boucle = ($tout = $debut_boucle == -1) ? 0 : $debut_boucle; $debut_boucle = max(0, min($debut_boucle, floor(($Numrows['_articles_rubrique']['total'] - 1) / 10) * 10)); $debut_boucle = intval($debut_boucle); $fin_boucle = min($tout ? $Numrows['_articles_rubrique']['total'] : $debut_boucle + 9, $Numrows['_articles_rubrique']['total'] - 1); $Numrows['_articles_rubrique']['grand_total'] = $Numrows['_articles_rubrique']['total']; $Numrows['_articles_rubrique']["total"] = max(0, $fin_boucle - $debut_boucle + 1); if ($debut_boucle > 0 and $debut_boucle < $Numrows['_articles_rubrique']['grand_total'] and $iter->seek($debut_boucle, 'continue')) { $Numrows['_articles_rubrique']['compteur_boucle'] = $debut_boucle; } lang_select($GLOBALS['spip_lang']); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { $Numrows['_articles_rubrique']['compteur_boucle']++; if ($Numrows['_articles_rubrique']['compteur_boucle'] <= $debut_boucle) { continue; } if ($Numrows['_articles_rubrique']['compteur_boucle'] - 1 > $fin_boucle) { break; } lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']); $t0 .= ' <br class="nettoyeur" /> ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', strlen($logo = !is_array($l = quete_logo('id_article', 'ON', $Pile[$SP]['id_article'], '', 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />') ? '<a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '">' . $logo . '</a>' : '', '120', '0')))) !== '' ? '<div class="logo-liste-art"> ' . $t1 . ' </div>' : '') . ' ' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['surtitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="surtitre">' . $t1 . '</div>' : '') . ' <h3> <a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(propre($Pile[$SP]['descriptif'], $connect, $Pile[0])))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a> ' . BOUCLE_articles_rubrique_nomhtml_8bf8bdc0aa13e79e11d908f1699ff96f($Cache, $Pile, $doublons, $Numrows, $SP) . ' </h3> ' . (($t1 = strval(interdire_scripts(typo($Pile[$SP]['soustitre'], "TYPO", $connect, $Pile[0])))) !== '' ? '<div class="sous-titre">' . $t1 . '</div>' : '') . ' <div class="detail"> ' . (($t1 = strval(interdire_scripts(nom_jour(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span class="date">' . $t1 : '') . ' ' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? $t1 . '</span>' : '') . ' ' . (($t1 = strval(recuperer_fond('modeles/lesauteurs', array('objet' => 'article', 'id_objet' => $Pile[$SP]['id_article'], 'id_article' => $Pile[$SP]['id_article']), array('trim' => true, 'compil' => array('squelettes/inc/inc-rub-articles.html', 'html_8bf8bdc0aa13e79e11d908f1699ff96f', '_articles_rubrique', 17, $GLOBALS['spip_lang'])), ''))) !== '' ? '<span class="auteurs">' . _T('public|spip|ecrire:par_auteur') . ' ' . $t1 . '</span>' : '') . ' </div><!-- detail --> <div class="texte"> ' . (($t1 = strval(interdire_scripts(filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['descriptif'], $connect, $Pile[0]), '552', '0')) ? (($t2 = strval(interdire_scripts(filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['descriptif'], $connect, $Pile[0]), '552', '0'))))) !== '' ? '<div class="">' . $t2 . ('</div> <div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . ' ' : interdire_scripts(propre($Pile[$SP]['chapo'], $connect, $Pile[0]) ? (($t3 = strval(interdire_scripts(filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['chapo'], $connect, $Pile[0]), '552', '0'))))) !== '' ? '<div class="">' . $t3 . ('</div> <div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . ' ' : (($t3 = strval(interdire_scripts(couper(propre($Pile[$SP]['texte'], $connect, $Pile[0]), '300')))) !== '' ? '<div class="">' . $t3 . ('</div> <div class="suite"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" title="...' . _T('public|spip|ecrire:suite') . ' : ' . interdire_scripts(attribut_html(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))) . '" >' . _T('public|spip|ecrire:suite') . '</a></div>') : '') . ' ') . ' '))) !== '' ? '<div class="extrait">' . $t1 . '</div><!-- fin extrait -->' : '') . ' </div><!-- fin texte --> <br class="nettoyeur" /> '; lang_select(); } lang_select(); $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_articles_rubrique @ squelettes/inc/inc-rub-articles.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
function copy_request($script, $suite, $submit = '') { include_spip('inc/filtres'); foreach (array_merge($_POST, $_GET) as $n => $c) { if (!in_array($n, array('fichier', 'exec', 'validation_admin')) and !is_array($c)) { $suite .= "\n<input type='hidden' name='" . spip_htmlspecialchars($n) . "' value='" . entites_html($c) . "' />"; } } return generer_form_ecrire($script, $suite, '', $submit); }
/** * Nettoie un texte, traite les raccourcis autre qu'URL, la typo, etc. * * http://code.spip.net/@traiter_raccourcis * * @param string $t * @param bool $show_autobr * @return string */ function traiter_raccourcis($t, $show_autobr = false) { static $wheel, $notes; static $img_br_auto, $img_br_manuel, $img_br_no; // hack1: respecter le tag ignore br if (_AUTOBR_IGNORER and strncmp($t, _AUTOBR_IGNORER, strlen(_AUTOBR_IGNORER)) == 0) { $ignorer_autobr = true; $t = substr($t, strlen(_AUTOBR_IGNORER)); } else { $ignorer_autobr = false; } // Appeler les fonctions de pre_traitement $t = pipeline('pre_propre', $t); if (!isset($wheel)) { $ruleset = SPIPTextWheelRuleset::loader($GLOBALS['spip_wheels']['raccourcis'], 'personnaliser_raccourcis'); $wheel = new TextWheel($ruleset); if (_request('var_mode') == 'wheel' and autoriser('debug')) { $f = $wheel->compile(); echo "<pre>\n" . spip_htmlspecialchars($f) . "</pre>\n"; exit; } $notes = charger_fonction('notes', 'inc'); } // Gerer les notes (ne passe pas dans le pipeline) list($t, $mes_notes) = $notes($t); $t = $wheel->text($t); // Appeler les fonctions de post-traitement $t = pipeline('post_propre', $t); if ($mes_notes) { $notes($mes_notes, 'traiter', $ignorer_autobr); } // hack2: wrap des autobr dans l'espace prive, pour affichage css // car en css on ne sait pas styler l'element BR if ($ignorer_autobr and _AUTOBR) { if (is_null($img_br_no)) { $img_br_no = $show_autobr ? http_img_pack("br-no-10.png", _T("tw:retour_ligne_ignore"), "class='br-no'", _T("tw:retour_ligne_ignore")) : ""; } $t = str_replace(_AUTOBR, $img_br_no, $t); } if ($show_autobr and _AUTOBR) { if (is_null($img_br_manuel)) { $img_br_manuel = http_img_pack("br-manuel-10.png", _T("tw:retour_ligne_manuel"), "class='br-manuel'", _T("tw:retour_ligne_manuel")); } if (is_null($img_br_auto)) { $img_br_auto = http_img_pack("br-auto-10.png", _T("tw:retour_ligne_auto"), "class='br-auto'", _T("tw:retour_ligne_auto")); } if (false !== strpos(strtolower($t), '<br')) { $t = preg_replace("/<br\\b.*>/UiS", "{$img_br_manuel}\\0", $t); $t = str_replace($img_br_manuel . _AUTOBR, $img_br_auto . _AUTOBR, $t); } } return $t; }
function html_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = BOUCLE_lien_webfontshtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . ' <!-- META DATA --> <meta http-equiv="Content-Type" content="text/html; charset=' . interdire_scripts($GLOBALS['meta']['charset']) . '" /> <meta http-equiv="Content-language" content="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" /> <meta name="language" content="' . spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']) . '" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta name="generator" content="SPIP' . (($t1 = strval(spip_version())) !== '' ? ' ' . $t1 : '') . '" /> <meta name="robots" content="index,follow" /> <link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" /> <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" /> ' . (($t1 = BOUCLE_article_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 : ' ' . (($t2 = BOUCLE_breve_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t2 : (($t3 = BOUCLE_mot_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t3 : (($t4 = BOUCLE_rubrique_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t4 : (($t5 = BOUCLE_site_headhtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t5 : ' <!-- META pages recapitulatives - META summary pages --> ' . (($t6 = BOUCLE_keywords_recaphtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' <meta name="keywords" content="' . $t6 . '" />' : '') . ' ' . (($t6 = strval(interdire_scripts(attribut_html(propre($GLOBALS['meta']['descriptif_site'], $connect, $Pile[0]))))) !== '' ? '<meta name="description" content="' . $t6 . '" />' : '') . ' <meta name="author" content="' . BOUCLE_author_recaphtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . '" /> <!-- META Dublin Core - voir: http://uk.dublincore.org/documents/dcq-html/ --> ' . (($t6 = strval(interdire_scripts(entites_html(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])))))) !== '' ? '<meta name="DC.title" content="' . $t6 . '" /> ' : '') . (($t6 = strval(spip_htmlentities(@$Pile[0]['lang'] ? @$Pile[0]['lang'] : $GLOBALS['spip_lang']))) !== '' ? '<meta name="DC.language" scheme="ISO639-1" content="' . $t6 . '" /> ' : '') . (($t6 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.identifier" scheme="DCTERMS.URI" content="' . $t6 . '" /> ' : '') . (($t6 = strval(spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')))) !== '' ? '<meta name="DC.source" scheme="DCTERMS.URI" content="' . $t6 . '" />' : '') . BOUCLE_recap_auteursDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP) . (($t6 = strval(interdire_scripts(attribut_html(couper(propre($GLOBALS['meta']['descriptif_site'], $connect, $Pile[0]), '150'))))) !== '' ? ' <meta name="DC.description" content="' . $t6 . '" />' : '') . (($t6 = BOUCLE_recap_subjectDChtml_f7a72f7c15527e9fefe562fecb18cf87($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? ' <meta name="DC.subject" content="' . $t6 . '" />' : '') . (($t6 = strval(interdire_scripts(date_iso(normaliser_date(@$Pile[0]['date']))))) !== '' ? ' <meta name="DC.date" scheme="ISO8601" content="' . $t6 . '" />' : '') . ' '))))) . ' ' . (($t1 = strval(interdire_scripts(($a = extraire_attribut(filtrer('image_graver', filtrer('image_format', filtrer('image_recadre', filtrer('image_passe_partout', ($a = ($a = table_valeur(@$Pile[0], (string) 'favicon', null) or is_string($a) and strlen($a)) ? $a : find_in_path('favicon.ico') or is_string($a) and strlen($a)) ? $a : (!is_array($l = quete_logo('id_syndic', 'ON', "'0'", '', 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />'), '32', '32'), '32', '32', 'center'), 'ico')), 'src') or is_string($a) and strlen($a)) ? $a : find_in_path('spip.ico')))) !== '' ? ' <link rel="shortcut icon" href="' . $t1 . '" type="image/x-icon" />' : '') . ' ' . (($t1 = strval(interdire_scripts(generer_url_public('backend', '')))) !== '' ? ' <link rel="alternate" type="application/rss+xml" title="' . _T('public|spip|ecrire:syndiquer_site') . ' : ' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '" href="' . $t1 . '" />' : '') . ' '; return analyse_resultat_skel('html_f7a72f7c15527e9fefe562fecb18cf87', $Cache, $page, 'squelettes/inc/inc-meta.html'); }
/** * Donner l'URL de base d'un lien vers "soi-meme", modulo les trucs inutiles * * @param string $amp * Style des esperluettes * @param bool $root * @return string * URL vers soi-même **/ function self($amp = '&', $root = false) { $url = nettoyer_uri(); if (!$root and ($GLOBALS['profondeur_url'] < (_DIR_RESTREINT ? 1 : 2) or defined('_SET_HTML_BASE') and !_SET_HTML_BASE)) { $url = preg_replace(',^[^?]*/,', '', $url); } // ajouter le cas echeant les variables _POST['id_...'] foreach ($_POST as $v => $c) { if (substr($v, 0, 3) == 'id_') { $url = parametre_url($url, $v, $c, '&'); } } // supprimer les variables sans interet if (test_espace_prive()) { $url = preg_replace(',([?&])(' . 'lang|show_docs|' . 'changer_lang|var_lang|action)=[^&]*,i', '\\1', $url); $url = preg_replace(',([?&])[&]+,', '\\1', $url); $url = preg_replace(',[&]$,', '\\1', $url); } // eviter les hacks include_spip('inc/filtres_mini'); $url = spip_htmlspecialchars($url); // & ? if ($amp != '&') { $url = str_replace('&', $amp, $url); } // Si ca demarre par ? ou vide, donner './' $url = preg_replace(',^([?].*)?$,', './\\1', $url); return $url; }
function assembler($fond, $connect = '') { // flag_preserver est modifie ici, et utilise en globale // use_cache sert a informer le bouton d'admin pr savoir s'il met un * // contexte est utilise en globale dans le formulaire d'admin $GLOBALS['contexte'] = calculer_contexte(); $page = array('contexte_implicite' => calculer_contexte_implicite()); $page['contexte_implicite']['cache'] = $fond . preg_replace(',\\.[a-zA-Z0-9]*$,', '', preg_replace('/[?].*$/', '', $GLOBALS['REQUEST_URI'])); // Cette fonction est utilisee deux fois $cacher = charger_fonction('cacher', 'public', true); // Les quatre derniers parametres sont modifies par la fonction: // emplacement, validite, et, s'il est valide, contenu & age if ($cacher) { $res = $cacher($GLOBALS['contexte'], $GLOBALS['use_cache'], $chemin_cache, $page, $lastmodified); } else { $GLOBALS['use_cache'] = -1; } // Si un resultat est retourne, c'est un message d'impossibilite if ($res) { return array('texte' => $res); } if (!$chemin_cache || !$lastmodified) { $lastmodified = time(); } $headers_only = $_SERVER['REQUEST_METHOD'] == 'HEAD'; $calculer_page = true; // Pour les pages non-dynamiques (indiquees par #CACHE{duree,cache-client}) // une perennite valide a meme reponse qu'une requete HEAD (par defaut les // pages sont dynamiques) if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and (!defined('_VAR_MODE') or !_VAR_MODE) and $chemin_cache and isset($page['entetes']) and isset($page['entetes']['Cache-Control']) and strstr($page['entetes']['Cache-Control'], 'max-age=') and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/')) { $since = preg_replace('/;.*/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE']); $since = str_replace('GMT', '', $since); if (trim($since) == gmdate("D, d M Y H:i:s", $lastmodified)) { $page['status'] = 304; $headers_only = true; $calculer_page = false; } } // Si requete HEAD ou Last-modified compatible, ignorer le texte // et pas de content-type (pour contrer le bouton admin de inc-public) if (!$calculer_page) { $page['texte'] = ""; } else { // si la page est prise dans le cache if (!$GLOBALS['use_cache']) { // Informer les boutons d'admin du contexte // (fourni par urls_decoder_url ci-dessous lors de la mise en cache) $GLOBALS['contexte'] = $page['contexte']; // vider les globales url propres qui ne doivent plus etre utilisees en cas // d'inversion url => objet // plus necessaire si on utilise bien la fonction urls_decoder_url #unset($_SERVER['REDIRECT_url_propre']); #unset($_ENV['url_propre']); } else { // Compat ascendante : // 1. $contexte est global // (a evacuer car urls_decoder_url gere ce probleme ?) // et calculer la page if (!test_espace_prive()) { include_spip('inc/urls'); list($fond, $GLOBALS['contexte'], $url_redirect) = urls_decoder_url(nettoyer_uri(), $fond, $GLOBALS['contexte'], true); } // squelette par defaut if (!strlen($fond)) { $fond = 'sommaire'; } // produire la page : peut mettre a jour $lastmodified $produire_page = charger_fonction('produire_page', 'public'); $page = $produire_page($fond, $GLOBALS['contexte'], $GLOBALS['use_cache'], $chemin_cache, null, $page, $lastmodified, $connect); if ($page === '') { $erreur = _T('info_erreur_squelette2', array('fichier' => spip_htmlspecialchars($fond) . '.' . _EXTENSION_SQUELETTES)); erreur_squelette($erreur); // eviter des erreurs strictes ensuite sur $page['cle'] en PHP >= 5.4 $page = array('texte' => '', 'erreur' => $erreur); } } if ($page and $chemin_cache) { $page['cache'] = $chemin_cache; } auto_content_type($page); $GLOBALS['flag_preserver'] |= headers_sent(); // Definir les entetes si ce n'est fait if (!$GLOBALS['flag_preserver']) { if ($GLOBALS['flag_ob']) { // Si la page est vide, produire l'erreur 404 ou message d'erreur pour les inclusions if (trim($page['texte']) === '' and _VAR_MODE != 'debug' and !isset($page['entetes']['Location'])) { $GLOBALS['contexte']['fond_erreur'] = $fond; $page = message_page_indisponible($page, $GLOBALS['contexte']); } // pas de cache client en mode 'observation' if (defined('_VAR_MODE') and _VAR_MODE) { $page['entetes']["Cache-Control"] = "no-cache,must-revalidate"; $page['entetes']["Pragma"] = "no-cache"; } } } } // Entete Last-Modified: // eviter d'etre incoherent en envoyant un lastmodified identique // a celui qu'on a refuse d'honorer plus haut (cf. #655) if ($lastmodified and !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and !isset($page['entetes']["Last-Modified"])) { $page['entetes']["Last-Modified"] = gmdate("D, d M Y H:i:s", $lastmodified) . " GMT"; } // fermer la connexion apres les headers si requete HEAD if ($headers_only) { $page['entetes']["Connection"] = "close"; } return $page; }