[ Index ] |
|
Code source de SPIP 1.9.2c |
1 <?php 2 3 /***************************************************************************\ 4 * SPIP, Systeme de publication pour l'internet * 5 * * 6 * Copyright (c) 2001-2007 * 7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * 8 * * 9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * 10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * 11 \***************************************************************************/ 12 13 if (!defined("_ECRIRE_INC_VERSION")) return; 14 15 include_spip('inc/forum'); 16 include_spip('inc/presentation'); 17 18 // http://doc.spip.org/@formulaire_discuter 19 function formulaire_discuter($query, $total, $debut, $total_afficher, $script, $args, $mute=false) 20 { 21 $nav =''; 22 if ($total > $total_afficher) { 23 $evt = (_SPIP_AJAX === 1); 24 $nav = "<div class='serif2' align='center'>"; 25 for ($i = 0; $i < $total; $i = $i + $total_afficher){ 26 $y = $i + $total_afficher - 1; 27 if ($i == $debut) 28 $nav .= "<span class='spip_medium'><b>[$i-$y]</b></span> "; 29 else { 30 $a = "$args&debut=$i"; 31 if (!$evt) { 32 $h = generer_url_ecrire($script, $a); 33 } else { 34 $h = generer_url_ecrire('discuter', $a); 35 $evt = "\nonclick=" . ajax_action_declencheur($h,'forum'); 36 } 37 $nav .= "[<a href='$h#forum'$evt>$i-$y</a>] "; 38 } 39 } 40 $nav .= "</div>"; 41 } 42 43 return $nav 44 . afficher_forum($query, $script, $args, $mute) 45 . "<br />" 46 . $nav; 47 } 48 49 // http://doc.spip.org/@inc_discuter_dist 50 function inc_discuter_dist($id_article, $flag, $debut=1) 51 { 52 $debut = intval($debut); 53 $id_article = intval($id_article); 54 55 $res = spip_fetch_array(spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='prive' AND id_article='$id_article' AND id_parent=0")); 56 $res = $res["cnt"]; 57 58 if ($res) { 59 60 $total_afficher = 8; 61 $forum = spip_query("SELECT * FROM spip_forum WHERE statut='prive' AND id_article='$id_article' AND id_parent=0 ORDER BY date_heure DESC" . " LIMIT $debut,$total_afficher" ); 62 # " LIMIT $total_afficher OFFSET $debut" # PG 63 64 $res = formulaire_discuter($forum, $res, $debut, $total_afficher, 'articles', "id_article=$id_article"); 65 } else $res =''; 66 67 return ajax_action_greffe("forum", $res); 68 } 69 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 10:20:27 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |