function exec_documents_liste_dist() { // // Recupere les donnees // $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('titre_page_documents_liste'), "naviguer", "documents"); echo debut_gauche('', true); ////////////////////////////////////////////////////// // Boite "voir en ligne" // echo debut_boite_info(true); echo propre(_T('texte_recapitiule_liste_documents')); echo fin_boite_info(true); echo debut_droite('', true); // recupere les titres des types $res = sql_select('extension, titre', "spip_types_documents"); while ($row = sql_fetch($res)) $types[$row['extension']] = $row; $result = sql_select("docs.id_document AS id_doc, docs.extension AS extension, docs.fichier AS fichier, docs.date AS date, docs.titre AS titre, docs.descriptif AS descriptif, R.id_rubrique AS id_rub, R.titre AS titre_rub", "spip_documents AS docs, spip_documents_liens AS lien, spip_rubriques AS R", "docs.id_document = lien.id_document AND R.id_rubrique = lien.id_objet AND lien.objet='rubrique' AND docs.mode = 'document'", "", "docs.date DESC"); while ($row=sql_fetch($result)){ $titre=$row['titre']; $descriptif=$row['descriptif']; $date=$row['date']; $id_document=$row['id_doc']; $id_rubrique=$row['id_rub']; $titre_rub = typo($row['titre_rub']); $fichier = $row['fichier']; if (!$titre) $titre = _T('info_document').' '.$id_document; debut_cadre_relief("doc-24.gif"); echo "<b>$titre</b> (" . $types[$row['extension']]['titre'] . ', ' . affdate($date) . ")"; if ($descriptif) echo propre($descriptif); else echo "<p><tt>$fichier</tt>" . '</p>'; echo "<p>"._T('info_dans_rubrique')." <a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "'>$titre_rub</a></p>"; echo fin_cadre_relief(true); } echo fin_gauche(), fin_page(); }
function formulaires_editer_document_charger_dist($id_document = 'new', $id_parent = '', $retour = '', $lier_trad = 0, $config_fonc = 'documents_edit_config', $row = array(), $hidden = '') { $valeurs = formulaires_editer_objet_charger('document', $id_document, $id_parent, $lier_trad, $retour, $config_fonc, $row, $hidden); // relier les parents $valeurs['parents'] = array(); $valeurs['_hidden'] = ""; $parents = sql_allfetsel('objet,id_objet', 'spip_documents_liens', 'id_document=' . intval($id_document)); foreach ($parents as $p) { if (in_array($p['objet'], array('article', 'rubrique')) and $p['id_objet'] > 0) { $valeurs['parents'][] = $p['objet'] . '|' . $p['id_objet']; } else { $valeurs['_hidden'] .= "<input type='hidden' name='parents[]' value='" . $p['objet'] . '|' . $p['id_objet'] . "' />"; } } // en fonction de la config du site on a le droit ou pas de modifier la date if ($valeurs['_editer_date'] = lire_config('documents_date') == 'oui' ? ' ' : '') { $valeurs['saisie_date'] = affdate($valeurs['date'], 'd/m/Y'); $valeurs['saisie_heure'] = affdate($valeurs['date'], 'H:i'); } elseif (isset($valeurs['date'])) { unset($valeurs['date']); } // en fonction du format $valeurs['_editer_dimension'] = autoriser('tailler', 'document', $id_document) ? ' ' : ''; // type du document et inclusion $row = sql_fetsel('titre as type_document,inclus', 'spip_types_documents', 'extension=' . sql_quote($valeurs['extension'])); $valeurs['type_document'] = $row['type_document']; $valeurs['_inclus'] = $row['inclus']; if (in_array($valeurs['extension'], array('jpg', 'gif', 'png'))) { $valeurs['apercu'] = get_spip_doc($valeurs['fichier']); } // verifier les infos de taille et dimensions sur les fichiers locaux // cas des maj de fichier directes par ftp if ($valeurs['distant'] !== 'oui') { include_spip('inc/renseigner_document'); $infos = renseigner_taille_dimension_image(get_spip_doc($valeurs['fichier']), $valeurs['extension']); if ($infos and is_array($infos) and isset($infos['taille'])) { if ($infos['taille'] != $valeurs['taille'] or $infos['type_image'] && $infos['largeur'] != $valeurs['largeur'] or $infos['type_image'] && $infos['hauteur'] != $valeurs['hauteur']) { $valeurs['_taille_modif'] = $infos['taille']; $valeurs['_largeur_modif'] = $infos['largeur']; $valeurs['_hauteur_modif'] = $infos['hauteur']; $valeurs['_hidden'] .= "<input type='hidden' name='_taille_modif' value='" . $infos['taille'] . "' />" . "<input type='hidden' name='_largeur_modif' value='" . $infos['largeur'] . "' />" . "<input type='hidden' name='_hauteur_modif' value='" . $infos['hauteur'] . "' />"; } } } // pour l'upload d'un nouveau doc if ($valeurs['fichier']) { $charger = charger_fonction('charger', 'formulaires/joindre_document'); $valeurs = array_merge($valeurs, $charger($id_document, 0, '', 'choix')); $valeurs['_hidden'] .= "<input name='id_document' value='{$id_document}' type='hidden' />"; } return $valeurs; }
function http_afficher_rendez_vous($date_heure, $date_fin) { global $spip_lang_rtl; $dirpuce = _DIR_RACINE . 'dist'; if (jour($date_heure) == jour($date_fin) AND mois($date_heure) == mois($date_fin) AND annee($date_heure) == annee($date_fin)) { echo "<p class='verdana2' style='text-align: center'>"._T('titre_rendez_vous')." ".majuscules(nom_jour($date_heure))." <b>".majuscules(affdate($date_heure))."</b><br />\n<b>".heures($date_heure)." "._T('date_mot_heures')." ".minutes($date_heure)."</b>"; echo " <img src='$dirpuce/puce$spip_lang_rtl.gif' alt=' ' style='border: 0px;' /> ".heures($date_fin)." "._T('date_mot_heures')." ".minutes($date_fin)."</p>"; } else { echo "<p class='verdana2' style='text-align: center'>"._T('titre_rendez_vous')."<br />\n".majuscules(nom_jour($date_heure))." <b>".majuscules(affdate($date_heure))."</b>, <b>".heures($date_heure)." "._T('date_mot_heures')." ".minutes($date_heure)."</b>"; echo "<br />\n<img src='$dirpuce/puce$spip_lang_rtl.gif' alt=' ' style='border: 0px;' /> ".majuscules(nom_jour($date_fin))." ".majuscules(affdate($date_fin)).", <b>".heures($date_fin)." "._T('date_mot_heures')." ".minutes($date_fin)."</b></p>"; } }
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; }
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 BOUCLE_art_syndichtml_bb1fa8f06f75cd5c61b4de0a063c1a54(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; if (!isset($command['table'])) { $command['table'] = 'syndic_articles'; $command['id'] = '_art_syndic'; $command['from'] = array('syndic_articles' => 'spip_syndic_articles', 'L1' => 'spip_syndic'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("syndic_articles.date", "syndic_articles.titre", "syndic_articles.url", "L1.url_site", "L1.nom_site", "syndic_articles.descriptif"); $command['orderby'] = array('syndic_articles.date DESC'); $command['join'] = array('L1' => array('syndic_articles', 'id_syndic')); $command['limit'] = '0,5'; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('L1.statut', 'publie,prop', 'publie', ''), quete_condition_statut('syndic_articles.statut', 'publie,prop', 'publie', ''), array('=', 'L1.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', '_art_syndic', 6, $GLOBALS['spip_lang'])); if (!$iter->err()) { $l1 = _T('public|spip|ecrire:form_prop_nom_site'); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { $t0 .= ' <li>' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span>' . $t1 . '</span>' : '') . ' ' . (($t1 = strval(interdire_scripts(supprimer_numero($Pile[$SP]['titre'])))) !== '' ? '<a href="' . vider_url($Pile[$SP]['url']) . '" ' . (($t2 = strval(interdire_scripts(attribut_html(supprimer_tags(typo(supprimer_numero(calculer_url($Pile[$SP]['url_site'], $Pile[$SP]['nom_site'], 'titre', $connect, false)), "TYPO", $connect, $Pile[0])))))) !== '' ? 'title="' . $l1 . ' : ' . $t2 . '"' : '') . ' class="spip_out">' . $t1 . '</a>' : '') . ' ' . (($t1 = strval(interdire_scripts(typo(supprimer_numero(calculer_url($Pile[$SP]['url_site'], $Pile[$SP]['nom_site'], 'titre', $connect, false)), "TYPO", $connect, $Pile[0])))) !== '' ? '<span style="text-align: right;"><a href="' . calculer_url($Pile[$SP]['url_site'], '', 'url', $connect) . '" ' . (($t2 = strval(interdire_scripts(attribut_html(supprimer_tags(safehtml($Pile[$SP]['descriptif'])))))) !== '' ? 'title="' . $t2 . '"' : '') . ' class="spip_out" style="text-align: right; color: maroon; margin-top:-.5em">' . $t1 . '</a></span>' : '') . ' </li> '; } $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_art_syndic @ squelettes/inc/inc-syndic.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
function genie_bank_daily_reporting_dist($t) { // entre minuit et 7h du matin $now = time(); if (intval(date('H', $now)) >= 1 and intval(date('H', $now)) <= 7) { // il faut avoir configure un ou des emails de notification $c = unserialize($GLOBALS['meta']['bank_paiement']); if (isset($c['email_reporting']) and strlen($email = $c['email_reporting'])) { include_spip('inc/filtres'); $texte = ""; // le nombre et le montant des transactions par jour sur les 15 derniers jours $j = date('Y-m-d 00:00:00', $now); $jm15 = date('Y-m-d 00:00:00', strtotime("-15 day", $now)); $jours = sql_allfetsel('date_paiement,sum(montant_ht) as total_ht,sum(montant) as total,count(id_transaction) as nb', 'spip_transactions', 'statut=' . sql_quote('ok') . ' AND date_paiement>=' . sql_quote($jm15) . ' AND date_paiement<' . sql_quote($j), 'DAYOFMONTH(date_paiement)', 'date_paiement DESC'); $lignes = ""; foreach ($jours as $jour) { if ($jour['date_paiement'] > date('Y-m-d 00:00:00', strtotime("-1 day", $now))) { $texte .= "<h2>" . affdate($jour['date_paiement']) . "</h2>\n" . $jour['nb'] . " Paiements OK <br />\nTotal HT : <b>" . affiche_monnaie($jour['total_ht']) . "</b><br />\nTotal TTC : <b>" . affiche_monnaie($jour['total']) . "</b><br />\n"; } $lignes .= "<tr><td>" . affdate($jour['date_paiement']) . "</td><td>" . $jour['nb'] . "</td><td>" . affiche_monnaie($jour['total_ht']) . "</td><td>" . affiche_monnaie($jour['total']) . "</td></tr>\n"; } $texte .= "<h2>Paiements 15 derniers jours</h2>\n<table class='spip'>\n<tr><th>Jour</th><th>Nb</th><th>Total HT</th><th>Total TTC</th></tr>\n{$lignes}\n</table>"; $jm365 = date('Y-m-01 00:00:00', strtotime("-13 month", $now)); $mois = sql_allfetsel('date_paiement,sum(montant_ht) as total_ht,sum(montant) as total,count(id_transaction) as nb', 'spip_transactions', 'statut=' . sql_quote('ok') . ' AND date_paiement>=' . sql_quote($jm365), "DATE_FORMAT(date_paiement,'%Y-%m')", 'date_paiement DESC'); $lignes = ""; foreach ($mois as $moi) { $lignes .= "<tr><td>" . affdate_mois_annee($moi['date_paiement']) . "</td><td>" . $moi['nb'] . "</td><td>" . affiche_monnaie($moi['total_ht']) . "</td><td>" . affiche_monnaie($moi['total']) . "</td></tr>\n"; } $texte .= "<h2>Paiements 12 derniers mois</h2>\n<table class='spip'>\n<tr><th>Mois</th><th>Nb</th><th>Total HT</th><th>Total TTC</th></tr>\n{$lignes}\n</table>"; $texte = "<html>{$texte}</html>"; $header = "MIME-Version: 1.0\n" . "Content-Type: text/html; charset=" . $GLOBALS['meta']['charset'] . "\n" . "Content-Transfer-Encoding: 8bit\n"; $sujet = "[" . $GLOBALS['meta']['nom_site'] . "] Reporting Paiements"; $envoyer_mail = charger_fonction('envoyer_mail', 'inc'); $envoyer_mail($email, $sujet, $texte, '', $header); spip_log("Envoi reporting quotidien", 'bank'); } } return 1; }
function agenda_definir_contexte($id_agenda = 0, $type_agenda = 'listing_annuel', $debut_saison = 1, $type_saison = 'annee', $url_page = '') { static $contexte = array(); if ($id_agenda == 0) { return $contexte; } $contexte['type_agenda'] = $type_agenda; $contexte['debut_saison'] = $debut_saison; $contexte['type_saison'] = $type_saison; $contexte['id_rubrique'] = $id_agenda; if (strpos($url_page, 'calendrier_mois') !== FALSE) { preg_match('/calendrier_mois=([0-9]{1,2})/', $url_page, $match); $contexte['mois_base'] = intval($match[1]); preg_match('/calendrier_annee=([0-9]{1,4})/', $url_page, $match); $contexte['annee_base'] = intval($match[1]); $contexte['url_base'] = substr($url_page, 0, strpos($url_page, 'calendrier_mois')); } else { $contexte['mois_base'] = intval(affdate(date("Y-m-d H:i"), 'mois')); $contexte['annee_base'] = intval(affdate(date("Y-m-d H:i"), 'annee')); $contexte['url_base'] = strpos($url_page, '?') !== FALSE ? $url_page . '&' : $url_page . '?'; } return; }
function legender_corps($ancre, $flag, $id, $id_document, $script, $type, $document, $label, $taille) { include_spip('inc/editer'); $contenu = ''; $descriptif = $document['descriptif']; if ($descriptif) $contenu .= "<p>".PtoBR(lignes_longues(propre($descriptif),25)) . "</p>\n"; if ($document['largeur'] OR $document['hauteur']) $contenu .= _T('info_largeur_vignette', array('largeur_vignette' => $document['largeur'], 'hauteur_vignette' => $document['hauteur'])) . ' — '; $contenu .= taille_en_octets($document['taille']); $date = $document['date']; if ($date AND ($GLOBALS['meta']["documents_date"] == 'oui')) $contenu .= "<br />\n" . affdate($date); $corps = (!$contenu ? '' : "<div class='verdana1' style='text-align: center; margin-bottom: 10px;'>$contenu</div>") . "<div class='formulaire_spip formulaire_spip_compact'><ul><li class='editer_titre'><label for='titre_document$id_document'>$label</label>\n" . "<input type='text' name='titre_document' id='titre_document$id_document' class='text' value=\"".entites_html($document['titre']). "\" size='40' onfocus=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\" /></li>\n" . (($GLOBALS['meta']["documents_date"] == 'oui') ? "<li class='editer_date'>".date_formulaire_legender($date, $id_document)."</li>" :'' ) . "<li class='editer_descriptif'><label for='descriptif_document$id_document'>". _T('info_description_2'). "</label>\n" . "<textarea name='descriptif_document' id='descriptif_document$id_document' rows='4' class='textarea' cols='*' onfocus=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\">" . entites_html($descriptif) . "</textarea></li></ul></div>\n" . $taille .controles_md5($document); $att_bouton = ""; $att_span = " id='valider_doc$id_document' " . ($flag == 'ajax' ? '' : "class='display_au_chargement'") . " style='text-align:" . $GLOBALS['spip_lang_right'] . ($flag == 'ajax' ? ';display:block' : "") . "'"; if (test_espace_prive()) return ajax_action_post("legender", $id_document, $script, "show_docs=$id_document&id_$type=$id#legender-$id_document", $corps, _T('bouton_enregistrer'), $att_bouton, $att_span, "&id_document=$id_document&id=$id&type=$type&ancre=$ancre") . "<div class='nettoyeur'></div>"; else { $corps = "<div class='boutons'>" . $corps . "<span" . $att_span . "><input type='submit' value='" . _T('bouton_enregistrer') ."' /></span></div>"; $redirect = parametre_url($script,'show_docs',$id_document,'&'); $redirect = parametre_url($redirect,"id_$type",$id,'&'); $redirect = parametre_url($redirect,"id_$type",$id,'&'); $redirect = ancre_url($redirect,"legender-$id_document"); return generer_action_auteur("legender", $id_document, $redirect, $corps, "\nmethod='post'"); } }
/** * Afficher de facon textuelle les dates de debut et fin en fonction des cas * - Le lundi 20 fevrier a 18h * - Le 20 fevrier de 18h a 20h * - Du 20 au 23 fevrier * - du 20 fevrier au 30 mars * - du 20 fevrier 2007 au 30 mars 2008 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal) * * @param string $date_debut * @param string $date_fin * @param string $horaire * @param string $forme * @return string */ function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '') { $abbr = ''; if (strpos($forme, 'abbr') !== false) { $abbr = 'abbr'; } $affdate = "affdate_jourcourt"; if (strpos($forme, 'annee') !== false) { $affdate = 'affdate'; } $dtstart = $dtend = $dtabbr = ""; if (strpos($forme, 'hcal') !== false) { $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>"; $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>"; $dtabbr = "</abbr>"; } $date_debut = strtotime($date_debut); $date_fin = strtotime($date_fin); $d = date("Y-m-d", $date_debut); $f = date("Y-m-d", $date_fin); $h = $horaire == 'oui'; $hd = date("H:i", $date_debut); $hf = date("H:i", $date_fin); $au = " " . strtolower(_T('agenda:evenement_date_au')); $du = _T('agenda:evenement_date_du') . " "; $s = ""; if ($d == $f) { // meme jour $s = ucfirst(nom_jour($d, $abbr)) . " " . $affdate($d); if ($h) { $s .= " {$hd}"; } $s = "{$dtstart}{$s}{$dtabbr}"; if ($h and $hd != $hf) { $s .= "-{$dtend}{$hf}{$dtabbr}"; } } else { if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) { // meme annee et mois, jours differents if ($h) { $s = $du . $dtstart . affdate_jourcourt($d) . " {$hd}" . $dtabbr; $s .= $au . $dtend . $affdate($f); if ($hd != $hf) { $s .= " {$hf}"; } $s .= $dtabbr; } else { $s = $du . $dtstart . jour($d) . $dtabbr; $s .= $au . $dtend . $affdate($f) . $dtabbr; } } else { if (date("Y", $date_debut) == date("Y", $date_fin)) { // meme annee, mois et jours differents $s = $du . $dtstart . affdate_jourcourt($d); if ($h) { $s .= " {$hd}"; } $s .= $dtabbr . $au . $dtend . $affdate($f); if ($h) { $s .= " {$hf}"; } $s .= $dtabbr; } else { // tout different $s = $du . $dtstart . affdate($d); if ($h) { $s .= " " . date("(H:i)", $date_debut); } $s .= $dtabbr . $au . $dtend . affdate($f); if ($h) { $s .= " " . date("(H:i)", $date_fin); } $s .= $dtabbr; } } } return unicode2charset(charset2unicode($s, 'AUTO')); }
function presenter_message_boucles($row, $afficher_auteurs) { global $connect_id_auteur, $spip_lang_left, $spip_lang_rtl; $vals = array(); $id_message = $row['id_message']; $date = $row["date_heure"]; $date_fin = $row["date_fin"]; $titre = sinon($row['titre'], _T('ecrire:info_sans_titre')); $type = $row["type"]; $rv = $row["rv"]; // // Titre // $s = "<a href='" . generer_url_ecrire("message","id_message=$id_message") . "' style='display: block;'>"; switch ($type) { case 'pb' : $puce = "m_envoi_bleu$spip_lang_rtl.gif"; break; case 'memo' : $puce = "m_envoi_jaune$spip_lang_rtl.gif"; break; case 'affich' : $puce = "m_envoi_jaune$spip_lang_rtl.gif"; break; case 'normal': default: $puce = "m_envoi$spip_lang_rtl.gif"; break; } $s .= http_img_pack("$puce", "", "width='14' height='7'"); $s .= " ".typo($titre)."</a>"; $vals[] = $s; // // Auteurs if ($afficher_auteurs) { $result_auteurs = sql_select("auteurs.id_auteur, auteurs.nom", "spip_auteurs AS auteurs, spip_auteurs_messages AS lien", "lien.id_message=$id_message AND lien.id_auteur!=$connect_id_auteur AND lien.id_auteur=auteurs.id_auteur"); $auteurs = ''; while ($row_auteurs = sql_fetch($result_auteurs)) { $id_auteur = $row_auteurs['id_auteur']; $auteurs[] = "<a href='" . generer_url_ecrire("auteur_infos","id_auteur=$id_auteur") . "'>".typo($row_auteurs['nom'])."</a>"; } if ($auteurs AND $type == 'normal') { $s = "<span class='arial1 spip_x-small'>" . join(', ', $auteurs) . "</span>"; } else $s = " "; $vals[] = $s; } // // Messages de forums $total_forum = sql_countsel('spip_forum', "id_message=$id_message"); if ($total_forum > 0) $vals[] = "($total_forum)"; else $vals[] = ""; // // Date // $s = affdate($date); if ($rv == 'oui') { $jour=journum($date); $mois=mois($date); $annee=annee($date); $heure = heures($date).":".minutes($date); if (affdate($date) == affdate($date_fin)) $heure_fin = heures($date_fin).":".minutes($date_fin); else $heure_fin = "..."; $s = "<div " . http_style_background('rv-12.gif', "$spip_lang_left center no-repeat; padding-$spip_lang_left: 15px") . "><a href='" . generer_url_ecrire("calendrier","type=jour&jour=$jour&mois=$mois&annee=$annee") . "'><b style='color: black;'>$s</b><br />$heure-$heure_fin</a></div>"; } else { $s = "<span style='color: #999999'>$s</span>"; } $vals[] = $s; return $vals; }
function http_calendrier_rv($messages, $type) { $total = $date_rv = ''; if (!$messages) return $total; $connect_quand = $GLOBALS['visiteur_session']['quand']; foreach ($messages as $row) { $rv = ($row['location'] == 'oui'); $date = $row['dtstart']; $date_fin = $row['dtend']; if ($row['category']=="pb") $bouton = "pense-bete"; else if ($row['category']=="affich") $bouton = "annonce"; else $bouton = "message"; if ($rv) { $date_jour = affdate_jourcourt($date); $total .= "<tr><td colspan='2'>" . (($date_jour == $date_rv) ? '' : "\n<div class='calendrier-arial11'><b>$date_jour</b></div>") . "</td></tr>"; $date_rv = $date_jour; $rv = ((affdate($date) == affdate($date_fin)) ? ("\n<div class='calendrier-arial9 fond-agenda'>" . heures($date).":".minutes($date)."<br />" . heures($date_fin).":".minutes($date_fin)."</div>") : ( "\n<div class='calendrier-arial9 fond-agenda' style='text-align: center;'>" . heures($date).":".minutes($date)."<br />...</div>" )); } $c = (strtotime($date) <= $connect_quand) ? '' : " color: red;"; $total .= "<tr><td style='width: 24px' valign='middle'>" . http_href($row['url'], ($rv ? http_img_pack("rv.gif", 'rv', http_style_background($bouton . '.gif', "no-repeat;")) : http_img_pack($bouton.".gif", $bouton, ""))) . "</td>\n" . "<td valign='middle'><div style='font-weight: bold;$c'>" . $rv . http_href($row['url'], typo($row['summary']), '', '', 'calendrier-verdana') . "</div></td></tr>"; } if ($type == 'annonces') { $titre = _T('info_annonces_generales'); } else if ($type == 'pb') { $titre = _T('infos_vos_pense_bete'); } else if ($type == 'rv') { $titre = _T('info_vos_rendez_vous'); } return debut_cadre_enfonce("", true, "", $titre) . "\n<table>" . $total . "</table>" . fin_cadre_enfonce(true); }
function affdate_heure($numdate) { $date_array = recup_date($numdate); if (!$date_array) { return; } list($annee, $mois, $jour, $heures, $minutes, $sec) = $date_array; return _T('date_fmt_jour_heure', array('jour' => affdate($numdate), 'heure' => _T('date_fmt_heures_minutes', array('h' => $heures, 'm' => $minutes)))); }
function BOUCLE_documents_jointshtml_4dc0f36e18dd7a26ebc382429cbc9835(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) { static $command = array(); static $connect; $command['connect'] = $connect = ''; $in = array(); $in[] = 'gif'; $in[] = 'jpg'; $in[] = 'png'; if (!isset($command['table'])) { $command['table'] = 'documents'; $command['id'] = '_documents_joints'; $command['from'] = array('documents' => 'spip_documents', 'L1' => 'spip_documents_liens', 'L2' => 'spip_types_documents'); $command['type'] = array(); $command['groupby'] = array(); $command['select'] = array("0+documents.titre AS num", "documents.date", "documents.titre", "documents.id_document", "L2.titre AS type_document", "documents.taille", "documents.descriptif"); $command['orderby'] = array('num', 'documents.date DESC'); $command['join'] = array('L1' => array('documents', 'id_document'), 'L2' => array('documents', 'extension')); $command['limit'] = ''; $command['having'] = array(); } $command['where'] = array(quete_condition_statut('documents.statut', 'publie,prop,prepa', 'publie', ''), array('IN', 'documents.mode', '(\'image\',\'document\')'), array('(documents.taille > 0 OR documents.distant=\'oui\')'), array('=', 'L1.id_objet', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'L1.objet', sql_quote('rubrique')), sql_in('documents.extension', sql_quote($in), 'NOT'), array('=', 'L1.vu', "'non'")); if (defined("_BOUCLE_PROFILER")) { $timer = time() + microtime(); } $t0 = ""; // REQUETE $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-rub-documents.html', 'html_4dc0f36e18dd7a26ebc382429cbc9835', '_documents_joints', 39, $GLOBALS['spip_lang'])); if (!$iter->err()) { $l1 = _T('spip:info_document'); $SP++; // RESULTATS while ($Pile[$SP] = $iter->fetch()) { $t1 = ' ' . (($t1 = strval(interdire_scripts(supprimer_numero(traiter_doublons_documents($doublons, typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])))))) !== '' ? '<h3 class="" style="margin-bottom: .6em;"><a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true))) . '">' . $t1 . '</a></h3>' : '') . ' ' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', ($doublons["documents"] .= "," . $Pile[$SP]['id_document']) ? quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true))), '', '', 0, 0, '') : '', '60', '0')))) !== '' ? '<div style="float:left;padding-right: .5em; width:36%;"> <div style="float:left; margin-right: .5em;">' . $t1 . ('</div> <small> ' . (($t2 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? $t2 . '<br />' : '') . ' ' . (($t2 = strval(interdire_scripts($Pile[$SP]['type_document']))) !== '' ? $l1 . ' : ' . $t2 . '<br />' : '') . ' ' . interdire_scripts(taille_en_octets($Pile[$SP]['taille'])) . ' </small> </div>') : '') . ' ' . (($t1 = strval(interdire_scripts(traiter_doublons_documents($doublons, propre($Pile[$SP]['descriptif'], $connect, $Pile[0]))))) !== '' ? '<div class="" style="margin: 0 0 0 40%; border-left: 1px gray dotted;padding-left: 1em">' . $t1 . '</div>' : '') . ' '; $t0 .= (strlen($t1) && strlen($t0) ? '<hr style=\'clear:both\' />' : '') . $t1; } $iter->free(); } if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) { spip_log(intval(1000 * $timer) . "ms BOUCLE_documents_joints @ squelettes/inc/inc-rub-documents.html", "profiler" . _LOG_AVERTISSEMENT); } return $t0; }
function exec_agenda_inscriptions_dist() { $id_evenement = intval(_request('id_evenement')); $evenement = sql_fetsel(array('titre','date_debut'), 'spip_evenements', array("id_evenement=$id_evenement","inscription=1")); // recupere les infos de l'evenement $format = _request('format'); if ($GLOBALS['auteur_session']['statut'] != '0minirezo') { include_spip('inc/minipres'); echo minipres(_T('info_acces_refuse')); } elseif ($evenement === false) { include_spip('inc/minipres'); echo minipres(_T('agenda:aucun_evenement')); } else { $retirer_auteur = intval(_request('retirer_auteur')); if ($retirer_auteur) { sql_delete('spip_evenements_participants', "id_auteur=$retirer_auteur AND id_evenement=$id_evenement"); } if ($format == 'csv') { if (_request('mode') == 'inline') { // passer &mode=inline pour voir le fichier au lieu de le télécharger header("Content-type: text/plain; charset=".$GLOBALS['meta']['charset']); } else { header('Content-Disposition: attachment; filename="'._T('agenda:liste_inscrits').' - '.addslashes($evenement['titre']).'.csv"'); // nom du fichier = Inscriptons #TITRE au #AUJOURDHUI if ($GLOBALS['meta']['charset']) header("Content-type: text/csv; charset=".$GLOBALS['meta']['charset']); else header("Content-type: text/csv"); } // liste des champs à inclure dans le CSV $champs = array( 'nom' => 'Nom', 'login' => 'Identifiant', 'email' => 'Email', 'date' => 'Date d\'inscription', 'reponse' => 'Réponse', ); $res = sql_allfetsel(array_keys($champs), 'spip_evenements_participants INNER JOIN spip_auteurs USING (id_auteur)', array("id_evenement=$id_evenement", "reponse = 'oui' OR reponse = '?'"), "date ASC"); $csv = ''; // ligne d'en-tete foreach($champs as $champ => $legende) { $csv .= '"'.str_replace('"','""', $legende).'",'; } $csv = substr($csv, 0, -1); // on supprime la derniere virgule foreach($res as $row) { $csv .= "\r\n"; foreach($champs as $champ => $legende) { if (isset($row[$champ])) { if ($champ == 'date') $row[$champ] = affdate($row[$champ], 'd/m/Y H:i:s'); $csv .= '"'.str_replace('"','""', $row[$champ]).'"'; } $csv .= ','; } $csv = substr($csv, 0, -1); // on supprime la derniere virgule } echo $csv; } else { $inscrits = sql_allfetsel(array('nom', 'reponse', 'id_auteur', 'date'), 'spip_evenements_participants INNER JOIN spip_auteurs USING (id_auteur)', array("id_evenement=$id_evenement"), "date ASC"); pipeline('exec_init',array('args'=>array('exec'=>'agenda_inscriptions', 'id_evenement'=>$id_evenement),'data'=>'')); $titre = $evenement['titre'].' ('.affdate($evenement['date_debut']).') - '._T('agenda:liste_inscrits'); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page($titre, "auteurs","redacteurs"); echo pipeline('affiche_milieu',array('args'=>array('exec'=>'agenda_inscriptions', 'id_evenement'=>$id_evenement),'data'=>'')); echo debut_gauche('', true); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'agenda_inscriptions', 'id_evenement'=>$id_evenement),'data'=>'')); echo bloc_des_raccourcis( icone_horizontale (_T('agenda:telecharger').' (CSV)', generer_url_ecrire("agenda_inscriptions", "id_evenement=$id_evenement&format=csv"), "synchro-24.gif", "", false) ); echo creer_colonne_droite('', true); echo pipeline('affiche_droite',array('args'=>array('exec'=>'agenda_inscriptions', 'id_evenement'=>$id_evenement),'data'=>'')); echo debut_droite('', true), gros_titre($titre,'',false); echo debut_cadre('liste','auteur-24.gif','','','inscriptions'); echo "\n<br /><table class='arial2' cellpadding='2' cellspacing='0' style='width: 100%; border: 0px;'>\n"; echo "<tr class='titrem'><th style='width: 20px;'></th><th style='width: 20px;'></th><th>Nom</th><th>Date</th><th>Réponse</th><th></th></tr>"; $formater_auteur = charger_fonction('formater_auteur', 'inc'); foreach ($inscrits as $row) { list($s, $mail, $nom, $w, $p) = $formater_auteur($row['id_auteur']); echo "\n<tr class='tr_liste'>" . "\n<td>" . $s . "</td><td>" . $mail . "</td>" . "\n<td class='verdana1'>" . '<a href="'.generer_url_ecrire("auteur_infos","id_auteur=".$row['id_auteur']).'">' . $nom . '</a>' ."</td>" . "\n<td class='arial1'>" . affdate($row['date']).' '.affdate($row['date'], 'H:i') ."</td>" ."\n<td class='arial1'>" . $row['reponse'] . "</td><td class='arial1'>" . '<a class="arial1 editer_auteurs" href="'.generer_url_ecrire("agenda_inscriptions","id_evenement=$id_evenement&retirer_auteur=".$row['id_auteur']).'" onclick="return (confirm(\''.texte_script(_T('agenda:confirm_suppression_inscription')).'\'));">'._T('agenda:lien_desinscrire')." ". http_img_pack('croix-rouge.gif', "X", " class='puce' style='vertical-align: bottom;'").'</a>' . "</td></tr>\n"; } echo "</table>\n<br />"; echo fin_cadre(); echo fin_gauche(), fin_page(); } } }
function afficher_liste_listes_plugins() { if (!is_array($flux = @unserialize($GLOBALS['meta']['syndic_plug']))) return ''; if (count($flux)){ $ret = '<h3>'._T('plugin_info_automatique_liste').'</h3><ul class="liste-items">'; //$ret .= '<li>'._T('plugin_info_automatique_liste_officielle').'</li>'; foreach ($flux as $url => $c) { $a = '<div class="actions">[<a href="'.parametre_url( generer_action_auteur('charger_plugin', 'supprimer_flux'),'supprimer_flux', $url).'">'._T('lien_supprimer').'</a>]</div>'; $time = @filemtime(_DIR_TMP.'syndic_plug_'.md5($url).'.txt'); $ret .= '<li class="item">'.inserer_attribut(PtoBR(propre("[->$url]")),'title',$url).' ('._T('plugins_compte',array('count' => $c)).') ' .($time?"<div class='small'>" . _T('info_derniere_syndication').' '.affdate(date('Y-m-d H:i:s',$time)) ."</div>":'') . $a .'</li>'; } $ret .= '</ul>'; $ret .= '<div style="text-align:'.$GLOBALS['spip_lang_right'].'"><a href="'.parametre_url( generer_action_auteur('charger_plugin', 'update_flux'),'update_flux', 'oui').'">'._T('plugin_info_automatique_liste_update').'</a></div>'; } return $ret; }
function afficher_site($id_syndic, $id_rubrique, $nom_site, $row){ global $spip_lang_right; $cherche_mot = _request('cherche_mot'); $select_groupe = _request('select_groupe'); $id_secteur = $row["id_secteur"]; $url_site = $row["url_site"]; $url_syndic = $row["url_syndic"]; $syndication = $row["syndication"]; $statut = $row["statut"]; $date_heure = $row["date"]; $date_syndic = $row['date_syndic']; $flag_administrable = autoriser('modifier','site',$id_syndic); $flag_editable = ($flag_administrable OR ($GLOBALS['meta']["proposer_sites"] > 0 AND ($statut == 'prop'))); $meme_rubrique = charger_fonction('meme_rubrique', 'inc'); $iconifier = charger_fonction('iconifier', 'inc'); if ($flag_editable AND ($statut == 'publie')) $dater = charger_fonction('dater', 'inc'); $editer_mots = charger_fonction('editer_mots', 'inc'); if ($flag_administrable) $instituer_site = charger_fonction('instituer_site','inc'); echo debut_grand_cadre(true); echo afficher_hierarchie($id_rubrique); echo fin_grand_cadre(true); echo debut_gauche('', true); echo debut_boite_info(true); echo pipeline ('boite_infos', array('data' => '', 'args' => array( 'type'=>'site', 'id' => $id_syndic, 'row' => $row ) )); echo fin_boite_info(true); echo $iconifier('id_syndic', $id_syndic, 'sites', false, $flag_administrable); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')); echo creer_colonne_droite('', true); echo $meme_rubrique($id_rubrique, $id_syndic, 'syndic'); echo pipeline('affiche_droite',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')); echo bloc_des_raccourcis( icone_horizontale(_T('icone_voir_sites_references'), generer_url_ecrire("sites_tous",""), "site-24.gif","rien.gif", false) ); echo debut_droite('', true); if ($syndication == 'off' OR $syndication == 'sus') $droit = $id_rubrique; else $droit = 0; $url_affichee = $url_site; if (strlen($url_affichee) > 40) $url_affichee = substr($url_affichee, 0, 30)."..."; $actions = ($flag_editable ? icone_inline(_T('icone_modifier_site'), generer_url_ecrire('sites_edit',"id_syndic=$id_syndic"), "site-24.gif", "edit.gif",$spip_lang_right) : ""); $haut = "<div class='bandeau_actions'>$actions</div>". gros_titre($nom_site?$nom_site:"("._T('info_sans_titre_2').")", '' , false) . "<a href='$url_site' class='url_site'>$url_affichee</a>"; $type = 'site'; $contexte = array('id'=>$id_syndic,'id_rubrique'=>$id_rubrique); $fond = recuperer_fond("prive/contenu/$type",$contexte); // permettre aux plugin de faire des modifs ou des ajouts $fond = pipeline('afficher_contenu_objet', array( 'args'=>array( 'type'=>$type, 'id_objet'=>$id_syndic, 'contexte'=>$contexte), 'data'=> $fond)); $fond = "<div id='wysiwyg'>$fond</div>"; $onglet_contenu = (_INTERFACE_ONGLETS? ($statut == 'prop' ? "<p class='site_prop'>"._T('info_site_propose')." <b>".affdate($date_heure)." </b></p>" : "") . $fond:"") . (($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") ? "<p class='site_syndique'><a href='".htmlspecialchars($url_syndic)."'>" . http_img_pack('feed.png', 'RSS'). '</a>'._T('info_site_syndique').'</p>' . (($syndication == "off" OR $syndication=="sus") ? "<div class='site_syndique_probleme'>" . _T('avis_site_syndique_probleme', array('url_syndic' => quote_amp($url_syndic))) . redirige_action_auteur('editer_site', $id_syndic, 'sites', '', "<input type='hidden' name='reload' value='oui' /> <input type='submit' value=\"" . attribut_html(_T('lien_nouvelle_recuperation')) . "\" class='spip_xx-small' />") . "</div>" : "") . afficher_objets('syndic_article',_T('titre_articles_syndiques'), array('FROM' => 'spip_syndic_articles', 'WHERE' => "id_syndic=$id_syndic", 'ORDER BY' => "date DESC"), $id_syndic) . ($date_syndic ? "<div class='date_syndic'>" . _T('info_derniere_syndication').' '.affdate_heure($date_syndic) .".</div>" : "") . "<div class='mise_a_jour_syndic'>" . redirige_action_post('editer_site', $id_syndic, 'sites', "id_syndic=$id_syndic", "<input type='hidden' name='reload' value='oui' /> <input type='submit' value=\"" . attribut_html(_T('lien_mise_a_jour_syndication')) . "\" class='spip_xx-small' />") . "</div>" : choix_feed($id_syndic, $id_rubrique, $nom_site, $row)) . (_INTERFACE_ONGLETS?"":($flag_administrable ? options_moderation($row) : "")) ; $onglet_proprietes = (_INTERFACE_ONGLETS?"": $fond . ($statut == 'prop' ? "<p class='site_prop'>"._T('info_site_propose')." <b>".affdate($date_heure)." </b></p>" : "") ) . afficher_site_rubrique($id_syndic, $id_rubrique, $id_secteur) . ($dater ? $dater($id_syndic, $flag_editable, $statut, 'syndic', 'sites', $date_heure) : "") . $editer_mots('syndic', $id_syndic, $cherche_mot, $select_groupe, $flag_editable, true, 'sites') . (_INTERFACE_ONGLETS?($flag_administrable ? options_moderation($row) : ""):"") . pipeline('affiche_milieu',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>'')) ; $discuter = charger_fonction('discuter', 'inc'); $onglet_discuter = $discuter($id_syndic, 'sites', 'id_syndic'); $onglet_documents = "" ; $onglet_interactivite = ""; echo "<div class='fiche_objet'>" . $haut . afficher_onglets_pages(array( 'voir' => _T('onglet_contenu'), 'props' => _T('onglet_proprietes'), 'docs' => _T('onglet_documents'), 'interactivite' => _T('onglet_interactivite'), 'discuter' => _T('onglet_discuter')), _INTERFACE_ONGLETS? array( 'voir'=>$onglet_contenu, 'props'=>$onglet_proprietes, 'docs'=>$onglet_documents, 'interactivite'=>$onglet_interactivite, 'discuter'=>$onglet_discuter) :array( 'props'=>$onglet_proprietes, 'voir'=>$onglet_contenu ) ) . "</div>" . (_INTERFACE_ONGLETS?"":$onglet_discuter); }
/** * Afficher de facon textuelle les dates de debut et fin en fonction des cas * - Lundi 20 fevrier a 18h * - Le 20 fevrier de 18h a 20h * - Du 20 au 23 fevrier * - Du 20 fevrier au 30 mars * - Du 20 fevrier 2007 au 30 mars 2008 * $horaire='oui' ou true permet d'afficher l'horaire, toute autre valeur n'indique que le jour * $forme peut contenir une ou plusieurs valeurs parmi * - abbr (afficher le nom des jours en abbrege) * - hcal (generer une date au format hcal) * - jour (forcer l'affichage des jours) * - annee (forcer l'affichage de l'annee) * * @param string $date_debut * @param string $date_fin * @param string $horaire * @param string $forme * @return string */ function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme = '') { $abbr = $jour = ''; $affdate = "affdate_jourcourt"; if (strpos($forme, 'abbr') !== false) { $abbr = 'abbr'; } if (strpos($forme, 'annee') !== false) { $affdate = 'affdate'; } if (strpos($forme, 'jour') !== false) { $jour = 'jour'; } $dtstart = $dtend = $dtabbr = ""; if (strpos($forme, 'hcal') !== false) { $dtstart = "<abbr class='dtstart' title='" . date_iso($date_debut) . "'>"; $dtend = "<abbr class='dtend' title='" . date_iso($date_fin) . "'>"; $dtabbr = "</abbr>"; } $date_debut = strtotime($date_debut); $date_fin = strtotime($date_fin); $d = date("Y-m-d", $date_debut); $f = date("Y-m-d", $date_fin); $h = ($horaire === 'oui' or $horaire === true); $hd = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_debut), 'm' => date("i", $date_debut))); $hf = _T('date_fmt_heures_minutes_court', array('h' => date("H", $date_fin), 'm' => date("i", $date_fin))); if ($d == $f) { // meme jour $nomjour = nom_jour($d, $abbr); $s = $affdate($d); $s = _T('date_fmt_jour', array('nomjour' => $nomjour, 'jour' => $s)); if ($h) { if ($hd == $hf) { // Lundi 20 fevrier a 18h25 $s = spip_ucfirst(_T('date_fmt_jour_heure', array('jour' => $s, 'heure' => $hd))); $s = "{$dtstart}{$s}{$dtabbr}"; } else { // Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr> if ($dtabbr && $dtstart && $dtend) { $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin_abbr', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf, 'dtstart' => $dtstart, 'dtend' => $dtend, 'dtabbr' => $dtabbr))); } else { $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin', array('jour' => $s, 'heure_debut' => $hd, 'heure_fin' => $hf))); } } } else { if ($dtabbr && $dtstart) { $s = $dtstart . spip_ucfirst($s) . $dtabbr; } else { $s = spip_ucfirst($s); } } } else { if (date("Y-m", $date_debut) == date("Y-m", $date_fin)) { // meme annee et mois, jours differents if (!$h) { $date_debut = jour($d); } else { $date_debut = $affdate($d); } $date_fin = $affdate($f); if ($jour) { $nomjour_debut = nom_jour($d, $abbr); $date_debut = _T('date_fmt_jour', array('nomjour' => $nomjour_debut, 'jour' => $date_debut)); $nomjour_fin = nom_jour($f, $abbr); $date_fin = _T('date_fmt_jour', array('nomjour' => $nomjour_fin, 'jour' => $date_fin)); } if ($h) { $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd)); $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf)); } $date_debut = $dtstart . $date_debut . $dtabbr; $date_fin = $dtend . $date_fin . $dtabbr; $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin)); } else { $date_debut = affdate($d); $date_fin = affdate($f); if ($jour) { $nomjour_debut = nom_jour($d, $abbr); $date_debut = _T('date_fmt_jour_periode', array('nomjour' => $nomjour_debut, 'jour' => $date_debut)); $nomjour_fin = nom_jour($f, $abbr); $date_fin = _T('date_fmt_jour_periode', array('nomjour' => $nomjour_fin, 'jour' => $date_fin)); } if ($h) { $date_debut = _T('date_fmt_jour_heure', array('jour' => $date_debut, 'heure' => $hd)); $date_fin = _T('date_fmt_jour_heure', array('jour' => $date_fin, 'heure' => $hf)); } $date_debut = $dtstart . $date_debut . $dtabbr; $date_fin = $dtend . $date_fin . $dtabbr; $s = _T('date_fmt_periode', array('date_debut' => $date_debut, 'date_fin' => $date_fin)); } } return $s; }
function 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 dater_redac($id, $type, $script, $possedeDateRedac, $date_redac, $fct_ajax) { if ($possedeDateRedac) $date_affichee = majuscules(affdate($date_redac)); else $date_affichee = majuscules(_T('jour_non_connu_nc')); $invite = "<b>" . "<span class='verdana1'>" . majuscules(_T('texte_date_publication_anterieure')) . '</span> ' . $date_affichee . " " . aide('artdate_redac') . "</b>"; $js = "\"findObj_forcer('valider_date_redac-$id').style.visibility='visible';\""; $label = "<input type='radio' name='avec_redac' value='non' id='avec_redac_on$id'" . ($possedeDateRedac ? '' : " checked='checked'") . " onclick=$js" . " /> <label for='avec_redac_on$id'>" . _T('texte_date_publication_anterieure_nonaffichee'). '</label>' . "<br /><input type='radio' name='avec_redac' value='oui' id='avec_redac_off$id'" . (!$possedeDateRedac ? '' : " checked='checked'") . " onclick=$js /> <label for='avec_redac_off$id'>" . _T('bouton_radio_afficher'). ' :</label> '; $masque = dater_ajax($id, $type, $script, $date_redac, $fct_ajax, 0, '_redac', $label, true); return block_parfois_visible("dateredac-$id", $invite, $masque, 'text-align: left'); }
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; }
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 affdate_heure($numdate) { return _T('date_fmt_jour_heure', array('jour' => affdate($numdate), 'heure' => heures_minutes($numdate))); }
function liste_rv($query, $type) { global $spip_lang_rtl, $spip_lang_left, $spip_lang_right; if ($type == annonces) { $titre = _T('info_annonces_generales'); $couleur_titre = "ccaa00"; $couleur_texte = "black"; $couleur_fond = "#ffffee"; } else { if ($type == pb) { $titre = _T('infos_vos_pense_bete'); $couleur_titre = "#3874B0"; $couleur_fond = "#EDF3FE"; $couleur_texte = "white"; } else { if ($type == rv) { $titre = _T('info_vos_rendez_vous'); $couleur_titre = "#666666"; $couleur_fond = "#eeeeee"; $couleur_texte = "white"; } } } $result = spip_query($query); if (spip_num_rows($result) > 0) { debut_cadre_enfonce("", false, "", $titre); echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>"; while ($row = spip_fetch_array($result)) { if (preg_match("/^=([^[:space:]]+)\$/", $row['texte'], $match)) { $url = $match[1]; } else { $url = "message.php3?id_message=" . $row['id_message']; } $type = $row['type']; $rv = $row['rv']; $date = $row['date_heure']; $date_fin = $row['date_fin']; if ($type == "normal") { $bouton = "message"; } elseif ($type == "pb") { $bouton = "pense-bete"; } elseif ($type == "affich") { $bouton = "annonce"; } else { $bouton = "message"; } $titre = typo($row['titre']); if ($rv == "oui") { echo "<tr><td colspan='2'>"; $date_jour = affdate_jourcourt($date); if ($date_jour != $date_rv) { echo "<div class='arial11'><b>{$date_jour}</b></div>"; } echo "</td></tr>"; } echo "<tr>"; echo "<td width='24' valign='middle'>"; echo "<a href='{$url}'>"; if ($rv == "oui") { echo "<img src='img_pack/rv.gif' style='background: url(img_pack/{$bouton}.gif) no-repeat;' border='0'>"; } else { echo "<img src='img_pack/{$bouton}.gif' border='0'>"; } echo "</a>"; echo "</td>"; echo "<td valign='middle'>"; if ($rv == "oui") { if (affdate($date) == affdate($date_fin)) { echo "<div class='arial0' style='float: {$spip_lang_left}; line-height: 12px; color: #666666; margin-{$spip_lang_right}: 3px; padding-{$spip_lang_right}: 4px; background: url(img_pack/fond-agenda.gif) {$spip_lang_right} center no-repeat;'>" . heures($date) . ":" . minutes($date) . "<br />" . heures($date_fin) . ":" . minutes($date_fin) . "</div>"; } else { echo "<div class='arial0' style='float: {$spip_lang_left}; line-height: 12px; color: #666666; margin-{$spip_lang_right}: 3px; padding-{$spip_lang_right}: 4px; background: url(img_pack/fond-agenda.gif) {$spip_lang_right} center no-repeat; text-align: center;'>" . heures($date) . ":" . minutes($date) . "<br />...</div>"; } } echo "<div><b><a href='{$url}' class='arial1' style='color: #333333;'>{$titre}</a></b></div>"; echo "</td>"; echo "</tr>\n"; $date_rv = $date_jour; } echo "</table>"; fin_cadre_enfonce(); } }
/** * Afficher de facon textuelle les dates de debut et fin en fonction des cas * - Le lundi 20 fevrier a 18h * - Le 20 fevrier de 18h a 20h * - Du 20 au 23 fevrier * - du 20 fevrier au 30 mars * - du 20 fevrier 2007 au 30 mars 2008 * $horaire='oui' permet d'afficher l'horaire, toute autre valeur n'indique que le jour * $forme peut contenir abbr (afficher le nom des jours en abbrege) et ou hcal (generer une date au format hcal) * * @param string $date_debut * @param string $date_fin * @param string $horaire * @param string $forme * @return string */ function agenda_affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){ static $trans_tbl=NULL; if ($trans_tbl==NULL){ $trans_tbl = get_html_translation_table (HTML_ENTITIES); $trans_tbl = array_flip ($trans_tbl); } $abbr = ''; if (strpos($forme,'abbr')!==false) $abbr = 'abbr'; $affdate = "affdate_jourcourt"; if (strpos($forme,'annee')!==false) $affdate = 'affdate'; $dtstart = $dtend = $dtabbr = ""; if (strpos($forme,'hcal')!==false) { $dtstart = "<abbr class='dtstart' title='".date_iso($date_debut)."'>"; $dtend = "<abbr class='dtend' title='".date_iso($date_fin)."'>"; $dtabbr = "</abbr>"; } $date_debut = strtotime($date_debut); $date_fin = strtotime($date_fin); $d = date("Y-m-d", $date_debut); $f = date("Y-m-d", $date_fin); $h = $horaire=='oui'; $hd = date("H:i",$date_debut); $hf = date("H:i",$date_fin); $au = " " . strtolower(_T('agenda:evenement_date_au')); $du = _T('agenda:evenement_date_du') . " "; $s = ""; if ($d==$f) { // meme jour $s = ucfirst(nom_jour($d,$abbr))." ".$affdate($d); if ($h) $s .= " $hd"; $s = "$dtstart$s$dtabbr"; if ($h AND $hd!=$hf) $s .= "-$dtend$hf$dtabbr"; } else if ((date("Y-m",$date_debut))==date("Y-m",$date_fin)) { // meme annee et mois, jours differents if ($h){ $s = $du . $dtstart . affdate_jourcourt($d) . " $hd" . $dtabbr; $s .= $au . $dtend . $affdate($f); if ($hd!=$hf) $s .= " $hf"; $s .= $dtabbr; } else { $s = $du . $dtstart . jour($d) . $dtabbr; $s .= $au . $dtend . $affdate($f) . $dtabbr; } } else if ((date("Y",$date_debut))==date("Y",$date_fin)) { // meme annee, mois et jours differents $s = $du . $dtstart . affdate_jourcourt($d); if ($h) $s .= " $hd"; $s .= $dtabbr . $au . $dtend . $affdate($f); if ($h) $s .= " $hf"; $s .= $dtabbr; } else { // tout different $s = $du . $dtstart . affdate($d); if ($h) $s .= " ".date("(H:i)",$date_debut); $s .= $dtabbr . $au . $dtend. affdate($f); if ($h) $s .= " ".date("(H:i)",$date_fin); $s .= $dtabbr; } return unicode2charset(charset2unicode(strtr($s,$trans_tbl),'')); }
function http_calendrier_rv($messages, $type) { global $lcm_lang_rtl; $total = ''; if (!$messages) { return $total; } foreach ($messages as $row) { if (preg_match("/^=([^[:space:]]+)\$/", $row['texte'], $match)) { $url = $match[1]; } else { $url = "message.php3?id_message=" . $row['id_message']; } $rv = $row['rv'] == 'oui'; $date = $row['date_heure']; $date_fin = $row['date_fin']; if ($row['type'] == "pb") { $bouton = "pense-bete"; } else { if ($row['type'] == "annonces") { $bouton = "annonce"; } else { $bouton = "message"; } } if ($rv) { $date_jour = affdate_jourcourt($date); $total .= "<tr><td colspan='2'>" . ($date_jour == $date_rv ? '' : "<div><b>{$date_jour}</b></div>") . "</td></tr>"; } $total .= "<tr><td width='24' valign='middle'>" . http_href($url, $rv ? http_img_pack("rv.gif", '', http_style_background($bouton . '.gif', "no-repeat;' border='0'")) : http_img_pack("{$bouton}.gif", '', "border='0'"), '', '') . "</td>" . "<td valign='middle'>" . (!$rv ? '' : (affdate($date) == affdate($date_fin) ? "<div style='font-size: 9px;'" . http_style_background('fond-agenda.gif', "right center no-repeat; float: left; line-height: 12px; color: #666666; margin-right: 3px; padding-right: 4px;") . heures($date) . ":" . minutes($date) . "<br />" . heures($date_fin) . ":" . minutes($date_fin) . "</div>" : "<div style='font-size: 9px;'" . http_style_background('fond-agenda.gif', "right center no-repeat; float: left; line-height: 12px; color: #666666; margin-right: 3px; padding-right: 4px; text-align: center;") . heures($date) . ":" . minutes($date) . "<br />...</div>")) . "<div><b>" . http_href($url, typo($row['titre']), '', 'font-size: 10px;') . "</b></div>" . "</td>" . "</tr>\n"; $date_rv = $date_jour; } if ($type == 'annonces') { $titre = _T('info_annonces_generales'); $couleur_titre = "ccaa00"; $couleur_texte = "black"; $couleur_fond = "#ffffee"; } else { if ($type == 'pb') { $titre = _T('infos_vos_pense_bete'); $couleur_titre = "#3874B0"; $couleur_fond = "#EDF3FE"; $couleur_texte = "white"; } else { if ($type == 'rv') { $titre = _T('info_vos_rendez_vous'); $couleur_titre = "#666666"; $couleur_fond = "#eeeeee"; $couleur_texte = "white"; } } } return debut_cadre_enfonce("", true, "", $titre) . "<table width='98%' border='0' cellpadding='0' cellspacing='2'>" . $total . "</table>" . fin_cadre_enfonce(true); }