From 4a0520977c1b8d23fe7e145023bc34615537cf32 Mon Sep 17 00:00:00 2001
From: James <james@rezo.net>
Date: Sat, 29 Oct 2005 15:03:33 +0000
Subject: [PATCH] des liens dates pour le suivi des petitions

---
 ecrire/inc_signatures.php3 | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/ecrire/inc_signatures.php3 b/ecrire/inc_signatures.php3
index 2db73c902b..4055ab5c38 100644
--- a/ecrire/inc_signatures.php3
+++ b/ecrire/inc_signatures.php3
@@ -103,17 +103,16 @@ function tronconne_signatures($script, $id_article, $debut, $where, $limit)
 	}
 	else $script .= '?';
 
-	$res = spip_query("SELECT COUNT(*) AS cnt FROM spip_signatures WHERE $where AND date_time>DATE_SUB(NOW(),INTERVAL 180 DAY)");
+	$res = spip_query("SELECT date_time FROM spip_signatures WHERE $where AND date_time>DATE_SUB(NOW(),INTERVAL 180 DAY)");
 
-	$total = ($row = spip_fetch_array($res)) ? $row['cnt'] : 0;
-
-	if ($total > $limit) {
-		for ($i = 0; $i < $total; $i += $limit){
-			if ($i > 0) echo " | ";
-			if ($i == $debut)
-				echo "<FONT SIZE=3><B>$i</B></FONT>";
+	while ($row = spip_fetch_array($res)) {
+		if($c++%10==0) {	
+			if ($c > 1) echo " | ";
+			$date = entites_html(affdate_court($row['date_time']));
+			if ($c == ($debut+1))
+				echo "<FONT SIZE=3><B>$c</B></FONT>";
 			else
-			  echo "<A HREF='$script","debut=$i'>$i</A>";
+			  echo "<A alt='$date' title='$date' HREF='$script","debut=".($c-1)."'>$c</A>";
 		}
 	}
 	return $where;
-- 
GitLab