Skip to content
Extraits de code Groupes Projets
Valider a40b3904 rédigé par esj's avatar esj
Parcourir les fichiers

meilleure interface de la fonction d'affichage de signatures

parent 4421cc49
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -75,7 +75,8 @@ if ($connect_statut == "0minirezo") { ...@@ -75,7 +75,8 @@ if ($connect_statut == "0minirezo") {
$id_article, $id_article,
$debut, $debut,
"(statut='publie' OR statut='poubelle')", "(statut='publie' OR statut='poubelle')",
"date_time DESC"); "date_time DESC",
10);
} }
else { else {
......
...@@ -15,15 +15,16 @@ if (!defined("_ECRIRE_INC_VERSION")) return; ...@@ -15,15 +15,16 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
charger_generer_url(); charger_generer_url();
function controle_signatures($script, $id, $debut, $where, $order, $limit=10) { function controle_signatures($script, $id, $debut, $where, $order, $limit='') {
global $couleur_foncee; global $couleur_foncee;
$where = tronconne_signatures($script, $id, $debut, $where, $limit); $where = tronconne_signatures($script, $id, $debut, $where, $limit);
$request = spip_query("SELECT * FROM spip_signatures " . $request = spip_query("SELECT * FROM spip_signatures " .
($where ? " WHERE $where" : "") . ($where ? " WHERE $where" : "") .
($order ? " ORDER BY $order" : "") . ($order ? " ORDER BY $order" : "") .
" LIMIT " . ((!$limit AND !$debut) ? '' :
(($debut ? "$debut," : "") . $limit) (" LIMIT " .
(($debut ? "$debut," : "") . $limit) ))
# ($limit . ($debut ? " OFFSET $debut" : "")); #PG # ($limit . ($debut ? " OFFSET $debut" : "")); #PG
); );
...@@ -99,18 +100,19 @@ function controle_signatures($script, $id, $debut, $where, $order, $limit=10) { ...@@ -99,18 +100,19 @@ function controle_signatures($script, $id, $debut, $where, $order, $limit=10) {
} }
} }
function tronconne_signatures($script, $id_article, $debut, $where, $limit) function tronconne_signatures($script, $id_article, $debut, $where, $limit=10)
{ {
$where .= ($where ? " AND " : "") . "date_time>DATE_SUB(NOW(),INTERVAL 180 DAY)";
if ($id_article) { if ($id_article) {
$args = "id_article=$id_article&"; $args = "id_article=$id_article&";
$where .= ($where ? " AND " : "") . "id_article=$id_article"; $where .= " AND id_article=$id_article";
} }
else $args = ""; else $args = "";
$res = spip_query("SELECT date_time FROM spip_signatures WHERE $where AND date_time>DATE_SUB(NOW(),INTERVAL 180 DAY)ORDER BY date_time DESC"); $res = spip_query("SELECT date_time FROM spip_signatures WHERE $where ORDER BY date_time DESC");
while ($row = spip_fetch_array($res)) { while ($row = spip_fetch_array($res)) {
if($c++%10==0) { if($c++%$limit==0) {
if ($c > 1) echo " | "; if ($c > 1) echo " | ";
$date = entites_html(affdate_court($row['date_time'])); $date = entites_html(affdate_court($row['date_time']));
if ($c == ($debut+1)) if ($c == ($debut+1))
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter