/** * Nombre de forums d'un secteur dans la boite d'info * * @param array $flux * @return array */ function forum_boite_infos($flux) { if ($flux['args']['type'] == 'rubrique' and $id_rubrique = $flux['args']['id']) { if (autoriser('publierdans', 'rubrique', $id_rubrique) and (!isset($flux['args']['row']['id_parent']) or !$flux['args']['row']['id_parent'])) { include_spip('inc/forum'); list($from, $where) = critere_statut_controle_forum('prop', $id_rubrique); $n_forums = sql_countsel($from, $where); } else { $n_forums = 0; } if ($n_forums) { $aff = "<p class='forums'>" . singulier_ou_pluriel($n_forums, "forum:info_1_message_forum", "forum:info_nb_messages_forum") . '</p>'; if (($pos = strpos($flux['data'], '<!--nb_elements-->')) !== FALSE) { $flux['data'] = substr($flux['data'], 0, $pos) . $aff . substr($flux['data'], $pos); } else { $flux['data'] .= $aff; } } } elseif ($flux['args']['type'] == 'auteur' and $id_auteur = $flux['args']['id']) { if ($nb = sql_countsel('spip_forum', "statut!='poubelle' AND id_auteur=" . intval($id_auteur))) { $nb = "<div>" . singulier_ou_pluriel($nb, "forum:info_1_message_forum", "forum:info_nb_messages_forum") . "</div>"; if ($p = strpos($flux['data'], "<!--nb_elements-->")) { $flux['data'] = substr_replace($flux['data'], $nb, $p, 0); } } } return $flux; }
function exec_controle_forum_args2($id_rubrique, $type, $debut, $pas, $enplus, $recherche, $from, $where, $debut_id_forum) { // Si un id_controle_forum est demande, on adapte le debut if ($debut_id_forum AND (NULL !== ($d = sql_getfetsel('date_heure', 'spip_forum', "id_forum=$debut_id_forum")))) { $debut = sql_countsel($from, $where . (" AND F.date_heure > '$d'")); } if ($recherche) $args = 'recherche='.rawurlencode($recherche).'&'; else $args = ''; $args .= (!$id_rubrique ? "" : "id_rubrique=$id_rubrique&") . 'type='; $query = array('SELECT' => "F.id_forum, F.id_parent, F.id_rubrique, F.id_article, F.id_breve, F.date_heure, F.titre, F.texte, F.auteur, F.email_auteur, F.nom_site, F.url_site, F.statut, F.ip, F.id_auteur", 'FROM' => $from, 'WHERE' => $where, 'GROUP BY' => "", 'ORDER BY' => "F.date_heure DESC"); $nav = affiche_navigation_forum($query, 'controle_forum', $args . $type, $debut, $pas, $enplus); $select = sql_select($query['SELECT'], $query['FROM'], $query['WHERE'], $query['GROUP BY'], $query['ORDER BY'], $query['LIMIT']); $res = ''; while ($row = sql_fetch($select)) $res .= controle_forum_boucle($row, "$args$type&debut=$debut"); $res = "<br />$nav<br />$res<br />$nav"; if (_AJAX) { ajax_retour($res); } else { pipeline('exec_init',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('titre_page_forum_suivi'), "forum", "forum-controle"); echo "<br /><br /><br />"; echo gros_titre(_T('titre_forum_suivi'),'',false); echo debut_onglet(); echo onglet(_T('onglet_messages_publics'), generer_url_ecrire('controle_forum', $args . "public"), "public", $type=='public', "forum-public-24.gif"); echo onglet(_T('onglet_messages_internes'), generer_url_ecrire('controle_forum', $args . "interne"), "interne", $type=='interne', "forum-interne-24.gif"); list($from,$where) = critere_statut_controle_forum('vide', $id_rubrique); $n = sql_fetsel('1', $from, $where); if ($n) echo onglet(_T('onglet_messages_vide'), generer_url_ecrire('controle_forum', $args . "vide"), "vide", $type=='vide'); list($from,$where) = critere_statut_controle_forum('prop', $id_rubrique); $f = sql_fetsel('1', $from, $where); if ($f) echo onglet(_T('texte_statut_attente_validation'), generer_url_ecrire('controle_forum', $args . "prop"), "prop", $type=='prop'); echo fin_onglet(); echo debut_gauche('', true); echo debut_boite_info(true); echo "<span class='verdana1 spip_small'>", _T('info_gauche_suivi_forum_2'), aide("suiviforum"), "</span>"; // Afficher le lien RSS echo bouton_spip_rss("forums_$type"); echo fin_boite_info(true); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); echo creer_colonne_droite('', true); echo pipeline('affiche_droite',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); echo debut_droite('', true); echo pipeline('affiche_milieu',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); echo formulaire_recherche("controle_forum","<input type='hidden' name='type' value='$type' />"); echo "<div class='nettoyeur'></div>"; echo "<div id='controle_forum' class='serif2'>", $res, "</div>"; echo fin_gauche(), fin_page(); } }
function etat_base_accueil() { global $spip_display, $spip_lang_left, $connect_id_rubrique; $where = count($connect_id_rubrique) ? sql_in('id_rubrique', $connect_id_rubrique) : ''; $res = ''; if ($spip_display != 1) { $chercher_logo = charger_fonction('chercher_logo', 'inc'); if ($r = $chercher_logo(0, 'id_syndic', 'on')) { list($fid, $dir, $nom, $format) = $r; include_spip('inc/filtres_images_mini'); $r = image_reduire("<img src='$fid' alt='' />", 170, 170); if ($r) $res ="<div style='text-align:center; margin-bottom: 5px;'>$r</div>"; } } $res .= "<div class='verdana1'>"; $res .= propre($GLOBALS['meta']["descriptif_site"]); $q = sql_select("COUNT(*) AS cnt, statut", 'spip_articles', '', 'statut', '','', "COUNT(*)<>0"); $cpt = array(); $cpt2 = array(); $defaut = $where ? '0/' : ''; while($row = sql_fetch($q)) { $cpt[$row['statut']] = $row['cnt']; $cpt2[$row['statut']] = $defaut; } if ($cpt) { if ($where) { $q = sql_select("COUNT(*) AS cnt, statut", 'spip_articles', $where, "statut"); while($row = sql_fetch($q)) { $r = $row['statut']; $cpt2[$r] = intval($row['cnt']) . '/'; } } $res .= afficher_plus(generer_url_ecrire("articles_page",""))."<b>"._T('info_articles')."</b>"; $res .= "<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>"; if (isset($cpt['prepa'])) $res .= "<li>"._T("texte_statut_en_cours_redaction").": ".$cpt2['prepa'] . $cpt['prepa'] .'</li>'; if (isset($cpt['prop'])) $res .= "<li>"._T("texte_statut_attente_validation").": ".$cpt2['prop'] . $cpt['prop'] . '</li>'; if (isset($cpt['publie'])) $res .= "<li><b>"._T("texte_statut_publies").": ".$cpt2['publie'].$cpt['publie'] ."</b>" . '</li>'; $res .= "</ul>"; } $q = sql_select("COUNT(*) AS cnt, statut", 'spip_breves', '', 'statut', '','', "COUNT(*)<>0"); $cpt = array(); $cpt2 = array(); $defaut = $where ? '0/' : ''; while($row = sql_fetch($q)) { $cpt[$row['statut']] = $row['cnt']; $cpt2[$row['statut']] = $defaut; } if ($cpt) { if ($where) { $q = sql_select("COUNT(*) AS cnt, statut", 'spip_breves', $where, "statut"); while($row = sql_fetch($q)) { $r = $row['statut']; $cpt2[$r] = intval($row['cnt']) . '/'; } } $res .= afficher_plus(generer_url_ecrire("breves",""))."<b>"._T('info_breves_02')."</b>"; $res .= "<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>"; if (isset($cpt['prop'])) $res .= "<li>"._T("texte_statut_attente_validation").": ".$cpt2['prop'].$cpt['prop'] . '</li>'; if (isset($cpt['publie'])) $res .= "<li><b>"._T("texte_statut_publies").": ".$cpt2['publie'] .$cpt['publie'] . "</b>" .'</li>'; $res .= "</ul>"; } $q = sql_select('COUNT(*) AS cnt, statut', 'spip_forum', sql_in('statut', array('publie', 'prop')), 'statut', '','', "COUNT(*)<>0"); $cpt = array(); $cpt2 = array(); $defaut = $where ? '0/' : ''; while($row = sql_fetch($q)) { $cpt[$row['statut']] = $row['cnt']; $cpt2[$row['statut']] = $defaut; } if ($cpt) { if ($where) { include_spip('inc/forum'); list($f, $w) = critere_statut_controle_forum('public'); $q = sql_select("COUNT(*) AS cnt, F.statut", "$f", "$w ", "F.statut"); while($row = sql_fetch($q)) { $r = $row['statut']; $cpt2[$r] = intval($row['cnt']) . '/'; } } if (autoriser('modererforum')) $res .= afficher_plus(generer_url_ecrire("controle_forum","")); $res .= "<b>" ._T('onglet_messages_publics') ."</b>"; $res .= "<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>"; if (isset($cpt['prop'])) $res .= "<li>"._T("texte_statut_attente_validation").": ".$cpt2['prop'] .$cpt['prop'] . '</li>'; if (isset($cpt['publie'])) $res .= "<li><b>"._T("texte_statut_publies").": ".$cpt2['publie'] .$cpt['publie'] . "</b>" .'</li>'; $res .= "</ul>"; } $res .= accueil_liste_participants() . "</div>"; return pipeline('accueil_informations',$res) ; }
function exec_naviguer_args($id_rubrique, $cherche_mot, $select_groupe) { if (!$id_rubrique) { $lang = $statut = $titre = $extra = $id_parent=$id_secteur=''; $ze_logo = "racine-site-24.gif"; $row = array(); } else { $row = sql_fetsel('id_parent, id_secteur, titre, statut, lang, descriptif, texte', 'spip_rubriques', "id_rubrique=$id_rubrique"); if (!$row OR !autoriser('voir','rubrique',$id_rubrique)) { include_spip('inc/minipres'); echo minipres(); } else { $id_parent=$row['id_parent']; $id_secteur=$row['id_secteur']; $titre=$row['titre']; $statut = $row['statut']; $lang = $row["lang"]; if ($id_parent == 0) $ze_logo = "secteur-24.gif"; else $ze_logo = "rubrique-24.gif"; } } if ($ze_logo) { pipeline('exec_init',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(($titre ? ("« ".textebrut(typo($titre))." »") : _T('titre_naviguer_dans_le_site')), "naviguer", "rubriques", $id_rubrique); echo debut_grand_cadre(true); if ($id_rubrique > 0) echo afficher_hierarchie($id_parent,_T('titre_cadre_interieur_rubrique'),$id_rubrique,'rubrique',$id_secteur,(!$GLOBALS['connect_toutes_rubriques'])); else $titre = _T('info_racine_site').": ". $GLOBALS['meta']["nom_site"]; echo fin_grand_cadre(true); echo debut_gauche('', true); $flag_editable = autoriser('publierdans','rubrique',$id_rubrique); if ($flag_editable AND !$id_parent) { list($from, $where) = critere_statut_controle_forum('prop', $id_rubrique); $n_forums = sql_countsel($from, $where); } else $n_forums = 0; changer_typo($lang); echo infos_naviguer($id_rubrique, $statut, $row, $n_forums); $iconifier = charger_fonction('iconifier', 'inc'); echo $iconifier('id_rubrique', $id_rubrique, 'naviguer', false, $flag_editable); echo pipeline('affiche_gauche',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); echo creer_colonne_droite('', true); echo raccourcis_naviguer($id_rubrique, $id_parent); echo pipeline('affiche_droite',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); echo debut_droite('', true); $haut = montre_naviguer($id_rubrique, $titre, $id_parent, $ze_logo, $flag_editable); $boucles = contenu_naviguer($id_rubrique, $id_parent, $ze_logo, $flag_editable); if ($id_rubrique > 0) { $editer_mots = charger_fonction('editer_mots', 'inc'); $editer_mots = $editer_mots('rubrique', $id_rubrique, $cherche_mot, $select_groupe, $flag_editable, true, 'naviguer'); } else $editer_mots = ''; echo naviguer_droite($row, $id_rubrique, $id_parent, $id_secteur, $haut, $n_forums, $editer_mots, $flag_editable, $boucles), fin_gauche(), fin_page(); } }