Exemplo n.º 1
0
function exec_articles_forum_args($id_article, $date, $debut, $pas, $enplus)
{
	if (!autoriser('modererforum', 'article', $id_article)) {
		include_spip('inc/minipres');
		echo minipres();
	} else {

	$query = array('SELECT' => "pied.id_forum,pied.id_parent,pied.id_rubrique,pied.id_article,pied.id_breve,pied.id_message,pied.id_syndic,pied.date_heure,pied.titre,pied.texte,pied.auteur,pied.email_auteur,pied.nom_site,pied.url_site,pied.statut,pied.ip,pied.id_auteur, max(thread.date_heure) AS date", 
		       'FROM' => "spip_forum AS pied LEFT JOIN spip_forum AS thread ON pied.id_forum=thread.id_thread",
		       'WHERE' => "pied.id_article=$id_article AND pied.id_parent=0 AND pied.statut IN ('publie', 'off', 'prop', 'spam')",
		       'GROUP BY' => "pied.id_forum",
		       'ORDER BY' => "date DESC");

	if (!$pas) $pas = 5;
	$nav = affiche_navigation_forum($query, "articles_forum", "id_article=$id_article", $debut, $pas, $enplus, $date);

	$res = afficher_forum($query, '', '', $id_article, 'articles_forum', "id_article=$id_article");
	$res =  "<br />$nav<br />$res<br />$nav";	

	if (_AJAX) {
		ajax_retour($res);
	} else {

		$ancre = 'articles_forum';
		$res =  "<div class='serif2' id='$ancre'>$res</div>";

	 	pipeline('exec_init',array('args'=>array('exec'=>'articles_forum','id_article'=>$id_article),'data'=>''));

		$row = sql_fetsel("titre, id_rubrique", "spip_articles", "id_article=$id_article");

		if ($row) {
			$titre = $row["titre"];
			$id_rubrique = $row["id_rubrique"];
		}

		$commencer_page = charger_fonction('commencer_page', 'inc');
		echo $commencer_page($titre, "naviguer", "articles", $id_rubrique);

		articles_forum_cadres($id_rubrique, $id_article, $titre, 'articles', "id_article=$id_article");

		echo $res;
		echo fin_gauche(), fin_page();
	}
	}
}
Exemplo n.º 2
0
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();
	}
}