function exec_auteurs_dist() { $tri = preg_replace('/\W/', '', _request('tri')); if (!$tri) $tri='nom'; $statut = _request('statut'); if (!$statut) $statut = AUTEURS_DEFAUT . AUTEURS_MIN_REDAC; $debut = intval(_request('debut')); $recherche = NULL; if ($cherche = _request('recherche')) { include_spip('inc/rechercher'); $tables = liste_des_champs(); $tables = array('auteur'=>$tables['auteur']); $recherche = recherche_en_base($cherche, $tables,array('toutvoir'=>true)); if ($recherche['auteur']) $recherche = sql_in('aut.id_auteur', array_keys($recherche['auteur'])); else { $recherche = "aut.id_auteur=0"; // rien trouve ! } } $form = formulaire_recherche("auteurs",(($s=_request('statut'))?"<input type='hidden' name='statut' value='$s' />":"")); exec_auteurs_args($statut, $tri, $debut, $recherche,$form, $cherche); }
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 exec_recherche_dist() { $recherche = _request('recherche'); $recherche_aff = entites_html($recherche); $commencer_page = charger_fonction('commencer_page', 'inc'); echo $commencer_page(_T('titre_page_recherche', array('recherche' => $recherche_aff))); if (strlen($recherche)) { include_spip('inc/rechercher'); include_spip('base/abstract_sql'); $tables = liste_des_champs(); //unset($tables['document']); unset($tables['forum']); unset($tables['syndic_article']); $results = recherche_en_base($recherche, $tables, array('jointures' => true, 'score' => false)); // true => a gerer dans l'affichage, autant faire un squelette /* $modifier = false; foreach ($results as $table => $r) { foreach ($r as $id => $x) { $modifier |= autoriser('modifier', $table, $id); } } */ // Ajouter la recherche par identifiant if (preg_match(',^[0-9]+$,', $recherche) AND $id = intval($recherche)) foreach ($tables as $table => $x) { $t = sql_countsel(table_objet_sql($table), id_table_objet($table)."=".sql_quote($id)); if ($t AND autoriser('voir', $table, $id) AND !isset($results[$table][$id])) $results[$table][$id] = array(); } } echo debut_grand_cadre(true); echo formulaire_recherche("recherche"); /* // Si on est autorise a modifier, proposer le choix de REMPLACER // Il faudra aussi pouvoir indiquer sur quels elements on veut effectuer le remplacement... if ($modifier) { echo '<br /><input type="text" size="10" value="'.entites_html(_request('remplacer')).'" name="remplacer" class="spip_recherche" />'; } */ if ($results) { echo "<span class='verdana1'><b>"._T('info_resultat_recherche')."</b></span><br />"; echo "<h1>$recherche_aff</h1>"; include_spip('inc/afficher_objets'); foreach($results as $table => $r) { switch ($table) { case 'article': $titre = _T('info_articles_trouves'); $order = 'date DESC'; break; case 'breve': $titre = _T('info_breves_touvees'); $order = 'date_heure DESC'; break; case 'rubrique': $titre = _T('info_rubriques_trouvees'); $order = 'date DESC'; break; case 'site': $titre = _T('info_sites_trouves'); $order = 'date DESC'; break; case 'auteur': $titre = _T('info_auteurs_trouves'); $order = 'nom'; break; case 'mot': $titre = _T('titre_page_mots_tous'); $order = 'titre'; break; case 'document': $titre = _T('titre_documents_joints'); $order = "id_$table"; break; case 'groupes_mot': $titre = _T('titre_groupe_mots'); $order = 'titre'; break; default: $titre = _T("autres"); $order = "id_$table"; break; } echo afficher_objets($table,$titre, array( // gasp: la requete spip_articles exige AS articles... 'FROM' => table_objet_sql($table).' AS '.table_objet($table), 'WHERE' => sql_in( table_objet($table).'.'.id_table_objet($table), array_keys($r) ), 'ORDER BY' => $order ) ); } } else if (strlen($recherche)) echo "<p class='verdana1'>"._T('avis_aucun_resultat')."</p>"; echo fin_grand_cadre(true), fin_page(); }