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

Passage en Ajax des messages de forums attachés en interne à un article. Ce...

Passage en Ajax des messages de forums attachés en interne à un article. Ce passage devait pouvoir facilement s'opérer aussi dans les autres scripts utilisant la fonction afficher_forum, apres plus grande généralisation du script discuter.php. 

A noter qu'il devient évident qu'il faut supprimer tous les "echo" dans les scrips exec, afin que chacun d'eux puisse potentitellement etre inséré dans un autre grace à Ajax.
parent cae2bb39
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -100,6 +100,7 @@ ecrire/exec/controle_petition.php -text ...@@ -100,6 +100,7 @@ ecrire/exec/controle_petition.php -text
ecrire/exec/convert_utf8.php -text ecrire/exec/convert_utf8.php -text
ecrire/exec/dater.php -text ecrire/exec/dater.php -text
ecrire/exec/delete_all.php -text ecrire/exec/delete_all.php -text
ecrire/exec/discuter.php -text
ecrire/exec/documenter.php -text ecrire/exec/documenter.php -text
ecrire/exec/documents_liste.php -text ecrire/exec/documents_liste.php -text
ecrire/exec/editer_mot.php -text ecrire/exec/editer_mot.php -text
......
...@@ -18,9 +18,9 @@ include_spip('inc/rubriques'); ...@@ -18,9 +18,9 @@ include_spip('inc/rubriques');
include_spip('inc/mots'); include_spip('inc/mots');
include_spip('inc/date'); include_spip('inc/date');
include_spip('inc/documents'); include_spip('inc/documents');
include_spip('inc/forum');
include_spip('inc/petition'); include_spip('inc/petition');
include_spip('exec/virtualiser'); include_spip('exec/virtualiser');
include_spip('exec/discuter');
include_spip('base/abstract_sql'); include_spip('base/abstract_sql');
// http://doc.spip.org/@exec_articles_dist // http://doc.spip.org/@exec_articles_dist
...@@ -270,9 +270,16 @@ if ($flag_editable) { ...@@ -270,9 +270,16 @@ if ($flag_editable) {
echo "</div>"; echo "</div>";
fin_cadre_relief(); fin_cadre_relief();
affiche_forums_article($id_article, $id_rubrique, $titre, $debut); echo "<br /><br />";
$tm = rawurlencode($titre);
echo "\n<div align='center'>";
icone(_T('icone_poster_message'), generer_url_ecrire("forum_envoi","statut=prive&id_article=$id_article&titre_message=$tm&url=" . generer_url_retour("articles","id_article=$id_article")), "forum-interne-24.gif", "creer.gif");
echo "</div><br />";
echo exec_discuter_dist($id_article, $debut);
fin_page(); fin_page();
} }
...@@ -1033,62 +1040,6 @@ function afficher_corps_articles($virtuel, $chapo, $texte, $ps, $extra) ...@@ -1033,62 +1040,6 @@ function afficher_corps_articles($virtuel, $chapo, $texte, $ps, $extra)
} }
} }
// http://doc.spip.org/@affiche_forums_article
function affiche_forums_article($id_article, $id_rubrique, $titre, $debut, $mute=false)
{
global $spip_lang_left;
echo "<br /><br />";
if (!$mute) {
$tm = rawurlencode($titre);
echo "\n<div align='center'>";
icone(_T('icone_poster_message'), generer_url_ecrire("forum_envoi","statut=prive&id_article=$id_article&titre_message=$tm&url=" . generer_url_retour("articles","id_article=$id_article")), "forum-interne-24.gif", "creer.gif");
echo "</div>";
}
echo "<p align='$spip_lang_left'>";
$row = spip_fetch_array(spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='prive' AND id_article='$id_article' AND id_parent=0"));
$total = $row ? $row["cnt"] : 0;
if (!$debut) $debut = 0;
$total_afficher = 8;
if ($total > $total_afficher) {
echo "<div class='serif2' align='center'>";
for ($i = 0; $i < $total; $i = $i + $total_afficher){
$y = $i + $total_afficher - 1;
if ($i == $debut)
echo "<font size='3'><b>[$i-$y]</b></font> ";
else
echo "[<a href='" . generer_url_ecrire("articles","id_article=$id_article&debut=$i") . "'>$i-$y</a>] ";
}
echo "</div>";
}
$result_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" );
# " LIMIT $total_afficher OFFSET $debut" # PG
afficher_forum($result_forum, "articles","id_article=$id_article", $mute);
if (!$debut) $debut = 0;
$total_afficher = 8;
if ($total > $total_afficher) {
echo "<div class='serif2' align='center'>";
for ($i = 0; $i < $total; $i = $i + $total_afficher){
$y = $i + $total_afficher - 1;
if ($i == $debut)
echo "<FONT SIZE=3><B>[$i-$y]</B></FONT> ";
else
echo "[<A href='" . generer_url_ecrire("articles","id_article=$id_article&debut=$i") . "'>$i-$y</A>] ";
}
echo "</div>";
}
echo "</div>\n";
}
// http://doc.spip.org/@formulaire_instituer_article // http://doc.spip.org/@formulaire_instituer_article
function formulaire_instituer_article($id_article, $statut, $script, $args) function formulaire_instituer_article($id_article, $statut, $script, $args)
{ {
......
...@@ -53,7 +53,7 @@ function exec_articles_forum_dist() ...@@ -53,7 +53,7 @@ function exec_articles_forum_dist()
$res = spip_query("SELECT pied.*, max(thread.date_heure) AS date FROM spip_forum AS pied, spip_forum AS thread WHERE pied.id_article='$id_article' AND pied.id_parent=0 AND pied.statut IN ('publie', 'off', 'prop') AND thread.id_thread=pied.id_forum GROUP BY id_thread ORDER BY date DESC LIMIT $debut, $pack"); $res = spip_query("SELECT pied.*, max(thread.date_heure) AS date FROM spip_forum AS pied, spip_forum AS thread WHERE pied.id_article='$id_article' AND pied.id_parent=0 AND pied.statut IN ('publie', 'off', 'prop') AND thread.id_thread=pied.id_forum GROUP BY id_thread ORDER BY date DESC LIMIT $debut, $pack");
afficher_forum($res,"", '', $id_article); echo afficher_forum($res,"", '', $id_article);
fin_page(); fin_page();
} }
......
...@@ -222,18 +222,16 @@ fin_cadre_relief(); ...@@ -222,18 +222,16 @@ fin_cadre_relief();
$tm = rawurlencode($titre); $tm = rawurlencode($titre);
echo "<BR><BR>"; echo "<br /><br />";
echo "\n<div align='center'>"; echo "\n<div align='center'>";
icone(_T('icone_poster_message'), generer_url_ecrire("forum_envoi", "statut=prive&id_breve=$id_breve&titre_message=$tm&url=".generer_url_retour("breves_voir", "id_breve=$id_breve")), icone(_T('icone_poster_message'), generer_url_ecrire("forum_envoi", "statut=prive&id_breve=$id_breve&titre_message=$tm&url=".generer_url_retour("breves_voir", "id_breve=$id_breve")),
"forum-interne-24.gif", "creer.gif"); "forum-interne-24.gif", "creer.gif");
echo "</div>"; echo "</div>";
echo "<br />";
echo "<P align='left'>"; echo afficher_forum(spip_query("SELECT * FROM spip_forum WHERE statut='prive' AND id_breve='$id_breve' AND id_parent=0 ORDER BY date_heure DESC LIMIT 20"), "breves_voir", "id_breve=$id_breve");
afficher_forum(spip_query("SELECT * FROM spip_forum WHERE statut='prive' AND id_breve='$id_breve' AND id_parent=0 ORDER BY date_heure DESC LIMIT 20"), "breves_voir", "id_breve=$id_breve");
fin_page(); fin_page();
} }
......
...@@ -44,7 +44,7 @@ function exec_calendrier_dist() ...@@ -44,7 +44,7 @@ function exec_calendrier_dist()
$r = http_calendrier_init('', $type, '','',generer_url_ecrire('calendrier', ($type ? "type=$type" : '')) . "#$ancre"); $r = http_calendrier_init('', $type, '','',generer_url_ecrire('calendrier', ($type ? "type=$type" : '')) . "#$ancre");
if (_request(var_ajax)) return $r; if (_request('var_ajax')) return $r;
debut_page($titre, "accueil", "calendrier","",$css); debut_page($titre, "accueil", "calendrier","",$css);
echo "<div>&nbsp;</div><div id='", $ancre, "'>",$r,'</div>'; echo "<div>&nbsp;</div><div id='", $ancre, "'>",$r,'</div>';
......
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2006 *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/
if (!defined("_ECRIRE_INC_VERSION")) return;
include_spip('inc/forum');
include_spip('inc/presentation');
// http://doc.spip.org/@affiche_forums_article
function formulaire_discuter($query, $total, $debut, $total_afficher, $script, $args, $mute=false)
{
$res = $nav ='';
if ($total > $total_afficher) {
$nav = "<div class='serif2' align='center'>";
for ($i = 0; $i < $total; $i = $i + $total_afficher){
$y = $i + $total_afficher - 1;
if ($i == $debut)
$nav .= "<font size='3'><b>[$i-$y]</b></font> ";
else {
if ($_COOKIE['spip_accepte_ajax'] != 1 ) {
$h = generer_url_ecrire($script, "$args&debut=$i");
$nav .= "[<a href='$h#forum'>$i-$y</a>] ";
} else {
$h = generer_url_ecrire('discuter', "$args&debut=$i&var_ajax=1#forum");
$nav .= "[<span\nonclick='AjaxSqueeze(\"$h\",\n\t\"forum\")'>$i-$y</span>] ";
}
}
}
$nav .= "</div>";
}
$res = $nav
. afficher_forum($query, $script, $args, $mute)
. "<br />"
. $nav;
return (_request('var_ajax')) ? $res : "<div id='forum'>$res</div>";
}
function exec_discuter_dist($id_article=-1, $debut=-1)
{
if ($debut == -1) $debut = _request('debut');
if ($id_article == -1) $id_article = _request('id_article');
$debut = intval($debut);
$id_article = intval($id_article);
$row = spip_fetch_array(spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='prive' AND id_article='$id_article' AND id_parent=0"));
$total = $row["cnt"];
if ($total) {
$total_afficher = 8;
$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" );
# " LIMIT $total_afficher OFFSET $debut" # PG
$total = formulaire_discuter($forum, $total, $debut, $total_afficher, 'articles', "id_article=$id_article");
}
return $total;
}
?>
...@@ -82,7 +82,7 @@ function exec_forum_dist() ...@@ -82,7 +82,7 @@ function exec_forum_dist()
$limit = $debut ? "LIMIT $debut,10" : "LIMIT 10" ; $limit = $debut ? "LIMIT $debut,10" : "LIMIT 10" ;
$result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 ORDER BY date_heure DESC $limit"); $result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 ORDER BY date_heure DESC $limit");
afficher_forum($result_forum,$script,''); echo afficher_forum($result_forum,$script,'');
echo "</div>"; echo "</div>";
......
...@@ -247,7 +247,7 @@ function http_afficher_forum_perso($id_message, $titre) ...@@ -247,7 +247,7 @@ function http_afficher_forum_perso($id_message, $titre)
echo "</div>\n<p align='left'>"; echo "</div>\n<p align='left'>";
$query_forum = spip_query("SELECT * FROM spip_forum WHERE statut='perso' AND id_message='$id_message' AND id_parent=0 ORDER BY date_heure DESC LIMIT 20"); $query_forum = spip_query("SELECT * FROM spip_forum WHERE statut='perso' AND id_message='$id_message' AND id_parent=0 ORDER BY date_heure DESC LIMIT 20");
afficher_forum($query_forum, "message","id_message=$id_message"); echo afficher_forum($query_forum, "message","id_message=$id_message");
echo "\n</p>"; echo "\n</p>";
} }
......
...@@ -522,11 +522,11 @@ fin_cadre_relief(); ...@@ -522,11 +522,11 @@ fin_cadre_relief();
echo "</div><p align='left'>\n"; echo "</div><p align='left'>\n";
$result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='prive' AND id_syndic=$id_syndic AND id_parent=0 ORDER BY date_heure DESC LIMIT 20"); $result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='prive' AND id_syndic=$id_syndic AND id_parent=0 ORDER BY date_heure DESC LIMIT 20");
afficher_forum($result_forum, "sites","id_syndic=$id_syndic");
echo afficher_forum($result_forum, "sites","id_syndic=$id_syndic");
fin_page(); fin_page();
} }
// http://doc.spip.org/@analyser_site // http://doc.spip.org/@analyser_site
......
...@@ -1438,29 +1438,32 @@ function afficher_forum($request, $retour, $arg, $controle_id_article = false) { ...@@ -1438,29 +1438,32 @@ function afficher_forum($request, $retour, $arg, $controle_id_article = false) {
global $spip_display; global $spip_display;
static $compteur_forum = 0; static $compteur_forum = 0;
static $nb_forum = array(); static $nb_forum = array();
static $i = array(); static $thread = array();
$compteur_forum++; $compteur_forum++;
$nb_forum[$compteur_forum] = spip_num_rows($request); $nb_forum[$compteur_forum] = spip_num_rows($request);
$i[$compteur_forum] = 1; $thread[$compteur_forum] = 1;
if ($spip_display == 4) echo "<ul>"; $res = '';
if ($spip_display == 4) $res .= "<ul>";
while($row = spip_fetch_array($request)) { while($row = spip_fetch_array($request)) {
$statut=$row['statut']; $statut=$row['statut'];
if ($compteur_forum==1) echo "\n<br /><br />"; if ($compteur_forum==1) $res .= "\n<br />";
if (($controle_id_article) ? ($statut!="perso") : if (($controle_id_article) ? ($statut!="perso") :
(($statut=="prive" OR $statut=="privrac" OR $statut=="privadm" OR $statut=="perso") (($statut=="prive" OR $statut=="privrac" OR $statut=="privadm" OR $statut=="perso")
OR ($statut=="publie" AND $id_parent > 0))) { OR ($statut=="publie" AND $id_parent > 0))) {
afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $i, $retour, $arg); $res .= afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $thread, $retour, $arg)
afficher_forum(spip_query("SELECT * FROM spip_forum WHERE id_parent='" . $row['id_forum'] . "'" . ($controle_id_article ? " AND statut<>'off'" : '') . " ORDER BY date_heure"), $retour, $arg, $controle_id_article); . afficher_forum(spip_query("SELECT * FROM spip_forum WHERE id_parent='" . $row['id_forum'] . "'" . ($controle_id_article ? " AND statut<>'off'" : '') . " ORDER BY date_heure"), $retour, $arg, $controle_id_article);
} }
$i[$compteur_forum]++; $thread[$compteur_forum]++;
} }
if ($spip_display == 4) echo "</ul>"; if ($spip_display == 4) $res .= "</ul>";
spip_free_result($request); spip_free_result($request);
$compteur_forum--; $compteur_forum--;
return $res;
} }
// http://doc.spip.org/@afficher_forum_thread // http://doc.spip.org/@afficher_forum_thread
...@@ -1492,89 +1495,85 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1492,89 +1495,85 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
$ip=$row["ip"]; $ip=$row["ip"];
$id_auteur=$row["id_auteur"]; $id_auteur=$row["id_auteur"];
echo "<a id='$id_forum'></a>"; $res = "<a id='$id_forum'></a>";
if ($spip_display != 4) {
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>";
afficher_forum_4($compteur_forum, $nb_forum, $i);
}
$titre_boite = '';
if ($id_auteur AND $voir_logo) {
$logo_f = charger_fonction('chercher_logo', 'inc');
if ($logo = $logo_f($id_auteur, 'id_auteur', 'on'))
if ($logo = decrire_logo("id_auteur", 'on', $id_auteur, 48, 48, $logo))
$titre_boite = "<div style='$voir_logo'>$$logo</div>" ;
}
$titre_boite .= typo($titre);
if ($spip_display == 4) { if ($spip_display == 4) {
echo "<li>".typo($titre)."<br>"; $res .= "<li>".typo($titre)."<br>";
} else { } else {
$titre_boite = '';
if ($id_auteur AND $voir_logo) {
$logo_f = charger_fonction('chercher_logo', 'inc');
if ($logo = $logo_f($id_auteur, 'id_auteur', 'on'))
if ($logo = decrire_logo("id_auteur", 'on', $id_auteur, 48, 48, $logo))
$titre_boite = "<div style='$voir_logo'>$logo</div>" ;
}
$titre_boite .= typo($titre);
$res .= "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>";
$res .= afficher_forum_4($compteur_forum, $nb_forum, $i);
if ($compteur_forum == 1) if ($compteur_forum == 1)
echo afficher_forum_logo($statut, $titre_boite); $res .= afficher_forum_logo($statut, $titre_boite);
else echo debut_cadre_thread_forum("", false, "", $titre_boite); else $res .= debut_cadre_thread_forum("", true, "", $titre_boite);
} }
// Si refuse, cadre rouge // Si refuse, cadre rouge
if ($statut=="off") { if ($statut=="off") {
echo "<div style='border: 2px dashed red; padding: 5px;'>"; $res .= "<div style='border: 2px dashed red; padding: 5px;'>";
} }
// Si propose, cadre jaune // Si propose, cadre jaune
else if ($statut=="prop") { else if ($statut=="prop") {
echo "<div style='border: 1px solid yellow; padding: 5px;'>"; $res .= "<div style='border: 1px solid yellow; padding: 5px;'>";
} }
echo "<span class='arial2'>"; $res .= "<span class='arial2'>". date_interface($date_heure) . "</span> ";
// echo affdate_court($date_heure);
// echo ", ";
// echo heures($date_heure).":".minutes($date_heure);
echo date_interface($date_heure);
echo "</span> ";
if ($id_auteur) if ($id_auteur)
echo "<a href='" . generer_url_ecrire("auteurs_edit","id_auteur=$id_auteur") . "'>".typo($auteur)."</a>"; $res .= "<a href='" . generer_url_ecrire("auteurs_edit","id_auteur=$id_auteur") . "'>".typo($auteur)."</a>";
else if ($email_auteur) else if ($email_auteur)
echo "<a href='mailto:$email_auteur'>".typo($auteur)."</a>"; $res .= "<a href='mailto:$email_auteur'>".typo($auteur)."</a>";
else echo typo($auteur); else $res .= typo($auteur);
if ($id_auteur) { if ($id_auteur) {
$bouton = bouton_imessage($id_auteur); $bouton = bouton_imessage($id_auteur);
if ($bouton) echo "&nbsp;".$bouton; if ($bouton) $res .= "&nbsp;".$bouton;
} }
// boutons de moderation // boutons de moderation
if ($controle_id_article) if ($controle_id_article)
echo boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip); $res .= boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip);
echo safehtml(justifier(propre($texte))); $res .= safehtml(justifier(propre($texte)));
if ($nom_site) { if ($nom_site) {
if (strlen($url_site) > 10) if (strlen($url_site) > 10)
echo "<div align='left' class='verdana2'><b><a href='$url_site'>$nom_site</a></b></div>"; $res .= "<div align='left' class='verdana2'><b><a href='$url_site'>$nom_site</a></b></div>";
else echo "<b>$nom_site</b>"; else $res .= "<b>$nom_site</b>";
} }
if (!$controle_id_article) { if (!$controle_id_article) {
$tm = rawurlencode($titre); $tm = rawurlencode($titre);
echo "<div align='right' class='verdana1'>"; $res .= "<div align='right' class='verdana1'>"
echo "<b><a href='", generer_url_ecrire("forum_envoi","id_parent=$id_forum&titre_message=$tm&url=" . generer_url_retour($retour, $arg) .'#formulaire'), . "<b><a href='"
"'>", . generer_url_ecrire("forum_envoi","id_parent=$id_forum&titre_message=$tm&url=" . generer_url_retour($retour, $arg) .'#formulaire')
_T('lien_repondre_message'), . "'>"
"</a></b></div>"; . _T('lien_repondre_message')
. "</a></b></div>";
} }
if ($GLOBALS['meta']["mots_cles_forums"] == "oui") if ($GLOBALS['meta']["mots_cles_forums"] == "oui")
afficher_forum_mots($id_forum); $res .= afficher_forum_mots($id_forum);
if ($statut == "off" OR $statut == "prop") echo "</div>"; if ($statut == "off" OR $statut == "prop") $res .= "</div>";
if ($spip_display != 4) { if ($spip_display != 4) {
if ($compteur_forum == 1) echo fin_cadre_forum(); if ($compteur_forum == 1) $res .= fin_cadre_forum(true);
else echo fin_cadre_thread_forum(); else $res .= fin_cadre_thread_forum(true);
echo "</td></tr></table>\n"; $res .= "</td></tr></table>\n";
} }
return $res;
} }
...@@ -1585,43 +1584,47 @@ function afficher_forum_logo($statut, $titre_boite) ...@@ -1585,43 +1584,47 @@ function afficher_forum_logo($statut, $titre_boite)
else if ($statut == "privadm") $logo = "forum-admin-24.gif"; else if ($statut == "privadm") $logo = "forum-admin-24.gif";
else if ($statut == "privrac") $logo = "forum-interne-24.gif"; else if ($statut == "privrac") $logo = "forum-interne-24.gif";
else $logo = "forum-public-24.gif"; else $logo = "forum-public-24.gif";
return debut_cadre_forum($logo, false, "", $titre_boite); return debut_cadre_forum($logo, true, "", $titre_boite);
} }
// http://doc.spip.org/@afficher_forum_mots // http://doc.spip.org/@afficher_forum_mots
function afficher_forum_mots($id_forum) function afficher_forum_mots($id_forum)
{ {
$result_mots = spip_query("SELECT * FROM spip_mots AS mots, spip_mots_forum AS lien WHERE lien.id_forum = '$id_forum' AND lien.id_mot = mots.id_mot"); $result = spip_query("SELECT * FROM spip_mots AS mots, spip_mots_forum AS lien WHERE lien.id_forum = '$id_forum' AND lien.id_mot = mots.id_mot");
echo '<ul>'; $res = '<ul>';
while ($row_mots = spip_fetch_array($result_mots)) { while ($row = spip_fetch_array($result)) {
$id_mot = $row_mots['id_mot']; $res .= "<li> <b>"
$titre_mot = propre($row_mots['titre']); . propre($row['titre'])
$type_mot = propre($row_mots['type']); . " :</b> "
echo "<li> <b>",$type_mot," :</b> ",$titre_mot, "<li>"; . propre($row['type'])
. "<li>";
} }
echo '</ul>'; $res .= '</ul>';
return $res;
} }
// affiche les traits de liaisons entre les reponses // affiche les traits de liaisons entre les reponses
// http://doc.spip.org/@afficher_forum_4 // http://doc.spip.org/@afficher_forum_4
function afficher_forum_4($compteur_forum, $nb_forum, $i) function afficher_forum_4($compteur_forum, $nb_forum, $thread)
{ {
global $spip_lang_rtl; global $spip_lang_rtl;
$fleche='rien.gif'; $fleche='rien.gif';
for ($count=2;$count<=$compteur_forum AND $count<20;$count++){ $res = '';
$fond[$count]=_DIR_IMG_PACK . 'rien.gif'; for ($j=2;$j<=$compteur_forum AND $j<20;$j++){
if ($i[$count]!=$nb_forum[$count]){ $fond[$j]=_DIR_IMG_PACK . 'rien.gif';
$fond[$count]=_DIR_IMG_PACK . 'forum-vert.gif'; if ($thread[$j]!=$nb_forum[$j]){
$fond[$j]=_DIR_IMG_PACK . 'forum-vert.gif';
} }
echo "<td width='10' valign='top' background=$fond[$count]>"; if ($j==$compteur_forum){
if ($count==$compteur_forum){
$fleche="forum-droite$spip_lang_rtl.gif"; $fleche="forum-droite$spip_lang_rtl.gif";
} }
echo http_img_pack($fleche, " ", "width='10' height='13'"), "</td>\n"; $res .= "<td width='10' valign='top' background=$fond[$j]>"
. http_img_pack($fleche, " ", "width='10' height='13'")
. "</td>\n";
} }
echo "\n<td width=100% valign='top'>"; return $res . "\n<td width=100% valign='top'>";
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter