diff --git a/ecrire/articles.php3 b/ecrire/articles.php3 index bee0b1b6478f1bb5b1597f3f2ed93c5a5ba69b1c..04fb5c176610c6b8ddb530f7adac294b56dbce8c 100644 --- a/ecrire/articles.php3 +++ b/ecrire/articles.php3 @@ -190,22 +190,38 @@ echo "<div align='center'>\n"; if ($statut_article == "publie") { $post_dates = lire_meta("post_dates"); - + + $voir_en_ligne = true; + if ($post_dates == "non") { $query = "SELECT id_article FROM spip_articles WHERE id_article=$id_article AND date<=NOW()"; $result = mysql_query($query); - if (mysql_num_rows($result) > 0) { - echo "<a href='../spip_redirect.php3?id_article=$id_article&recalcul=oui'><img src='IMG2/voirenligne.gif' alt='voir en ligne' width='48' height='48' border='0' align='right'></a>\n"; + if (!mysql_num_rows($result)) { + $voir_en_ligne = false; } } - else { - echo "<a href='../spip_redirect.php3?id_article=$id_article&recalcul=oui'><img src='IMG2/voirenligne.gif' alt='voir en ligne' width='48' height='48' border='0' align='right'></a>\n"; + if ($voir_en_ligne) { + afficher_icone(newLinkUrl("../spip_redirect.php3?id_article=$id_article&recalcul=oui"), + "Voir en ligne", 'IMG2/voir.gif', 40, 28, 'right'); } } + echo "<font face='Verdana,Arial,Helvetica,sans-serif' size='1'><b>ARTICLE NUMÉRO :</b></font>\n"; echo "<br><font face='Verdana,Arial,Helvetica,sans-serif' size='6'><b>$id_article</b></font>\n"; +if ($statut_article == 'publie' AND $connect_statut=='0minirezo' AND acces_rubrique($id_rubrique)) { + $req = "SELECT count(*) FROM spip_forum WHERE id_article=$id_article"; + if ($row = mysql_fetch_row(mysql_query($req))) { + $nb_forums = $row[0]; + if ($nb_forums) { + echo "<br><a ".newLinkHref("articles_forum.php3?id_article=$id_article").">\n"; + echo "<b>Forum public : $nb_forums contribution(s)</b></a>\n"; + } + } +} + + echo "</div>\n"; fin_boite_info(); @@ -263,7 +279,7 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op } // boite active ? - if ($change_accepter_forum || $petition) $visible = true; + if ($change_accepter_forum) $visible = true; echo "<center><table width='100%' cellpadding='2' border='1' class='hauteur'>\n"; echo "<tr><td width='100%' align='center' bgcolor='#FFCC66'>\n"; @@ -272,7 +288,7 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op echo bouton_block_visible("forumarticle"); else echo bouton_block_invisible("forumarticle"); - echo "FORUM & PÉTITION"; + echo "CONFIGURER LE FORUM"; echo "</b></font></td></tr></table></center>"; if ($visible) @@ -281,18 +297,9 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op echo debut_block_invisible("forumarticle"); echo "\n<form action='articles.php3' method='get'>"; - echo "<font face='Verdana,Arial,Helvetica,sans-serif' size='2'><u><b>FORUM PUBLIC</b></u><br>"; - - if ($statut_article == 'publie') { - $req = "SELECT count(*) FROM spip_forum WHERE id_article=$id_article"; - if ($row = mysql_fetch_row(mysql_query($req))) { - $nbforums = '<br>Vérifier '.$row[0].' contribution(s).'; - if ($row[0]>0) echo "<a href='articles_forum.php3?id_article=$id_article'>$nbforums</a>\n"; - } - } echo "\n<input type='hidden' name='id_article' value='$id_article'>"; - echo "<i>Mode de modération :</i>\n"; + echo "<br>Mode de modération du forum :\n"; if ($forums_publics == "pos") { echo "<br><input type='radio' name='change_accepter_forum' value='pos' id='accepterforumpos' checked>"; echo "<B><label for='accepterforumpos'> modéré à posteriori</label></B>"; @@ -316,16 +323,21 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op } if ($forums_publics == "non") { echo "<br><input type='radio' name='change_accepter_forum' value='non' id='accepterforumnon' checked>"; - echo "<B><label for='accepterforumnon'>pas de forum</label></B>"; + echo "<B><label for='accepterforumnon'> pas de forum</label></B>"; } else { echo "<br><input type='radio' name='change_accepter_forum' value='non' id='accepterforumnon'>"; - echo "<label for='accepterforumnon'>pas de forum</label>"; + echo "<label for='accepterforumnon'> pas de forum</label>"; } echo "<p align='right'><input type='submit' name='Changer' class='fondo' value='Changer' STYLE='font-size:10px'></p>\n"; echo "</form>"; - //////////////////////////////////////////////// + echo fin_block(); + + echo "<br>\n"; + + + // // Petitions // @@ -355,7 +367,7 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op $result_petition = mysql_query($query_petition); $petition = (mysql_num_rows($result_petition) > 0); - while ($row=mysql_fetch_array($result_petition)) { + while ($row = mysql_fetch_array($result_petition)) { $id_rubrique=$row[0]; $email_unique=$row[1]; $site_obli=$row[2]; @@ -364,13 +376,33 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op $texte_petition=$row[5]; } + if ($petition) $visible = true; + + echo "<center><table width='100%' cellpadding='2' border='1' class='hauteur'>\n"; + echo "<tr><td width='100%' align='center' bgcolor='#FFCC66'>\n"; + echo "<font face='Verdana,Arial,Helvetica,sans-serif' size='2' color='#333333'><b>\n"; + if ($visible) + echo bouton_block_visible("petition"); + else + echo bouton_block_invisible("petition"); + + if ($petition) + echo "CONFIGURER LA PETITION"; + else + echo "AJOUTER UNE PETITION"; + echo "</b></font></td></tr></table></center>"; + + if ($visible) + echo debut_block_visible("petition"); + else + echo debut_block_invisible("petition"); + + echo "\n<FORM ACTION='articles.php3' METHOD='post'>"; echo "\n<INPUT TYPE='hidden' NAME='id_article' VALUE='$id_article'>"; - echo "<font face='Verdana,Arial,Helvetica,sans-serif' size='2'><u><b>PÉTITION</b></u></font><br>\n"; - if ($petition){ - echo "<br><input type='radio' name='petition' value='on' id='petitionon' checked>"; + echo "<input type='radio' name='petition' value='on' id='petitionon' checked>"; echo "<B><label for='petitionon'>Cet article est une pétition</label></B>"; echo "<FONT SIZE=1>"; @@ -402,8 +434,9 @@ if ($connect_statut == '0minirezo' AND acces_rubrique($rubrique_article) AND $op echo "</FONT>"; - }else{ - echo "<br><input type='radio' name='petition' value='on' id='petitionon'>"; + } + else { + echo "<input type='radio' name='petition' value='on' id='petitionon'>"; echo "<label for='petitionon'>Ajouter une pétition</label>"; } if (!$petition){ diff --git a/ecrire/inc_documents.php3 b/ecrire/inc_documents.php3 index e89c9ee7aec99d1e7aff0c22ec4b98c5690064bb..81981ef27bb53b6e34216f4615d8c0edb6291dd1 100644 --- a/ecrire/inc_documents.php3 +++ b/ecrire/inc_documents.php3 @@ -205,6 +205,11 @@ function afficher_document($id_document, $image_link, $redirect_url = "", $depli echo "<td width='100%' align='left' valign='top'>\n"; + // Si pas image, lien vers le document + if ($type_inclus != "image") { + afficher_icone("../$fichier", 'Voir le document', 'IMG2/voir.gif', 40, 28, 'right'); + } + if ($descriptif) { echo debut_cadre_relief(); echo "<font face='Georgia, Garamond, Times, sans-serif' size='3'>\n"; diff --git a/ecrire/inc_layer.php3 b/ecrire/inc_layer.php3 index 7b0e7f68bbdac8660b3939ca9697c7bfb8ef8631..a91654af1592b4abdf7882602dd9050afb02d8cd 100644 --- a/ecrire/inc_layer.php3 +++ b/ecrire/inc_layer.php3 @@ -110,12 +110,6 @@ function debut_block_visible($nom_block){ $numero_block["$nom_block"] = $compteur_block; } - /*$retour = "\n<script language='JavaScript'>\n"; - $retour .= "<!--\n"; - $retour .= "vis['".$numero_block["$nom_block"]."'] = 'show';\n"; - $retour .= "//-->\n"; - $retour .= "</script>\n"; - */ $retour .= "<div id='Layer".$numero_block["$nom_block"]."' style='display: block'>"; } return $retour; @@ -158,7 +152,7 @@ function bouton_block_invisible($nom_block) { $numero_block["$nom_block"] = $compteur_block; } - return "<a href=\"javascript:swap_couche('".$numero_block["$nom_block"]."')\"><IMG name='triangle".$numero_block["$nom_block"]."' SRC='IMG2/deplierhaut.gif' WIDTH=16 HEIGHT=14 border=0></a> "; + return "<a href=\"javascript:swap_couche('".$numero_block["$nom_block"]."')\"><img name='triangle".$numero_block["$nom_block"]."' src='IMG2/deplierhaut.gif' alt='Déplier' title='Déplier' width='16' height='14' border='0'></a> "; } } @@ -172,7 +166,7 @@ function bouton_block_visible($nom_block){ $numero_block["$nom_block"] = $compteur_block; } - return "<a href=\"javascript:swap_couche('".$numero_block["$nom_block"]."')\"><IMG name='triangle".$numero_block["$nom_block"]."' SRC='IMG2/deplierbas.gif' WIDTH=16 HEIGHT=14 border=0></a> "; + return "<a href=\"javascript:swap_couche('".$numero_block["$nom_block"]."')\"><IMG name='triangle".$numero_block["$nom_block"]."' src='IMG2/deplierbas.gif' alt='Déplier' title='Déplier' width='16' height='14' border='0'></a> "; } } diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3 index 92a4305fb34e6fb84c8bde085c3138b21577de49..902e5d64b8b38a9d89603145a7d23aa953f6a385 100644 --- a/ecrire/inc_presentation.php3 +++ b/ecrire/inc_presentation.php3 @@ -161,6 +161,37 @@ function bandeau_titre_boite($titre, $afficher_auteurs, $boite_importante = true } +// +// Une icone avec lien et legende (texte en-dessous) +// + +function afficher_icone_texte($url, $texte, $image, $largeur, $hauteur, $align = "") { + echo "<table"; + if ($align) echo " align='$align'"; + echo " cellspacing='0' cellpadding='10'>"; + echo "<tr><td width='".floor($largeur * 2.0)."' align='center'>\n"; + echo "\t<a class='icone' href=\"$url\"><font face='Verdana, Arial, Helvetica, sans-serif' size='1'>\n"; + echo "\t<img src='$image' border='0' width='$largeur' height='$hauteur'><br>\n"; + echo "\t<b>$texte</b></font></a>\n"; + echo "\t</td></tr></table>\n"; +} + + +// +// Une icone avec lien et info-bulle (pas de texte en-dessous) +// + +function afficher_icone($url, $texte, $image, $largeur, $hauteur, $align = "") { + echo "<a class='icone' href=\"$url\">\n"; + $texte = attribut_html($texte); + echo "\t<img src='$image' border='0' width='$largeur' height='$hauteur' alt=\"$texte\" title=\"$texte\""; + if ($align) echo " align='$align'"; + echo "></a>\n"; +} + + + + // // Fonctions d'affichage // @@ -671,11 +702,14 @@ function debut_html($titre = "") { .profondeur {border-right-color:white; border-top-color:#666666; border-left-color:#666666; border-bottom-color:white; border-style:solid} .hauteur {border-right-color:#666666; border-top-color:white; border-left-color:white; border-bottom-color:#666666; border-style:solid} label {cursor: pointer;} - .arial1 {font-family: Arial, Helvetica, sans-serif; font-size: 10px;} - .arial2 {font-family: Arial, Helvetica, sans-serif; font-size: 12px;} + .arial1 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; } + .arial2 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } + + a { text-decoration: none; } + a:hover { color:#FF9900; text-decoration: underline; } + a.icone { color:#808080; text-decoration: none; border: 1px #707070; } + a.icone:hover { color:#404040; } - a {text-decoration: none;} - a:hover {color:#FF9900; text-decoration: underline;} a.spip_in {background-color:#eeeeee;} a.spip_out {} a.spip_note {} diff --git a/ecrire/inc_version.php3 b/ecrire/inc_version.php3 index 2d91e664a2937a20941fae268ab4f8f7e88c6f01..9747c479c40e5a923abb7c47cc7db5ef91d1bf48 100644 --- a/ecrire/inc_version.php3 +++ b/ecrire/inc_version.php3 @@ -525,6 +525,11 @@ function newLinkHref($url) { return $link->getHref(); } +function newLinkUrl($url) { + $link = new Link($url); + return $link->getUrl(); +} + // // Recuperer la valeur d'une variable de session sur la page courante // diff --git a/ecrire/message.php3 b/ecrire/message.php3 index db36a5c26e971ab9abc1fbbb81caae5357b9917d..d0f1ef3bc877a2ff8ef5c4ca229ae15500bab608 100644 --- a/ecrire/message.php3 +++ b/ecrire/message.php3 @@ -4,6 +4,7 @@ include ("inc.php3"); include_local ("inc_mots.php3"); + $query = "SELECT COUNT(*) FROM spip_auteurs_messages WHERE id_auteur=$connect_id_auteur AND id_message=$id_message"; $result = mysql_query($query); list($n) = mysql_fetch_array($result); @@ -221,7 +222,7 @@ while($row = mysql_fetch_array($result_message)) { if ($cherche_auteur) { echo "<P ALIGN='left'>"; - $query = "SELECT id_auteur, nom FROM spip_auteurs WHERE messagerie<>'non' AND id_auteur<>'$connect_id_auteur' AND en_ligne>DATE_SUB(NOW(),INTERVAL 15 DAY)"; + $query = "SELECT id_auteur, nom FROM spip_auteurs WHERE messagerie<>'non' AND id_auteur<>'$connect_id_auteur'"; $result = mysql_query($query); unset($table_auteurs); unset($table_ids); @@ -375,7 +376,7 @@ while($row = mysql_fetch_array($result_message)) { if ($statut == 'redac' OR $forcer_dest) { $query_ajout_auteurs = "SELECT * FROM spip_auteurs WHERE "; if ($les_auteurs) $query_ajout_auteurs .= "id_auteur NOT IN ($ze_auteurs) AND "; - $query_ajout_auteurs .= " messagerie<>'non' AND statut<>'5poubelle' AND statut<>'nouveau' AND statut<>'6forum' AND nom<>'Nouvel auteur' AND en_ligne>DATE_SUB(NOW(),INTERVAL 15 DAY) ORDER BY statut, nom"; + $query_ajout_auteurs .= " messagerie<>'non' AND statut<>'5poubelle' AND statut<>'nouveau' AND statut<>'6forum' AND nom<>'Nouvel auteur' ORDER BY statut, nom"; $result_ajout_auteurs = mysql_query($query_ajout_auteurs); if (mysql_num_rows($result_ajout_auteurs) > 0) { @@ -507,7 +508,8 @@ while($row = mysql_fetch_array($result_message)) { echo "<br><font face='Georgia,Garamond,Times,serif' size=3>"; if ($expediteur == $connect_id_auteur AND ($statut == 'redac' OR $type == 'pb') OR ($type == 'affich' AND $connect_statut == '0minirezo')) { - echo "<table align='right' cellpadding=5><tr><td width=90 align='right'><a href='message_edit.php3?id_message=$id_message'><font face='Verdana,Arial,Helvetica,sans-serif' size=1 color='#666666'><img src='IMG2/message-modif.gif' border=0 width=32 height=32><br><b>Modifier ce message</b></font></a></td></tr></table>"; + afficher_icone_texte(newLinkUrl("message_edit.php3?id_message=$id_message"), + "Modifier ce message", 'IMG2/message-modif.gif', 32, 32, 'right'); } echo "<p>$texte"; @@ -519,22 +521,19 @@ while($row = mysql_fetch_array($result_message)) { echo "<hr noshade size=1>"; - - echo "<table align='right' cellpadding=5 width='100%'><tr width='100%'>"; - if ($expediteur == $connect_id_auteur AND ($statut == 'redac' OR $type == 'pb') OR ($type == 'affich' AND $connect_statut == '0minirezo')) { - echo "<td width=90 align='left'><a href='messagerie.php3?detruire_message=$id_message'><font face='Verdana,Arial,Helvetica,sans-serif' size=1 color='#666666'><img src='IMG2/message-efface.gif' border=0 width=32 height=32><br><b>Supprimer ce message</b></font></a></td>"; + afficher_icone_texte(newLinkUrl("messagerie.php3?detruire_message=$id_message"), + "Supprimer ce message", 'IMG2/message-efface.gif', 32, 32, 'left'); } - echo "<td> </td>"; if ($expediteur == $connect_id_auteur AND $statut == 'redac') { if ($type == 'normal' AND $total_dest < 2){ - echo "<td width=180 align='center'><font face='Verdana,Arial,Helvetica,sans-serif' size=1 color='#666666'><b>Vous devez indiquer un destinataire avant d'envoyer ce message.</b></font></td>"; + echo "<p align='right'><font face='Verdana,Arial,Helvetica,sans-serif' size='2' color='#666666'><b>Vous devez indiquer un destinataire avant d'envoyer ce message.</b></font></p>"; } else { - echo "<td width=90 align='right'><a href='message.php3?id_message=$id_message&change_statut=publie'><font face='Verdana,Arial,Helvetica,sans-serif' size=1 color='#666666'><img src='IMG2/message-valide.gif' border=0 width=32 height=32><br><b>Envoyer ce message</b></font></a></td>"; + afficher_icone_texte(newLinkUrl("message.php3?id_message=$id_message&change_statut=publie"), + "Envoyer ce message", 'IMG2/message-efface.gif', 32, 32, 'right'); } } - echo "</tr></table>"; }