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

Fin de mise en squelette des formulaires de forum, grace à la nouvelle...

Fin de mise en squelette des formulaires de forum, grace à la nouvelle fonctionnalité #225 implémentée par [6192]
parent 99b8e816
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
name='ajouter_mot[]' name='ajouter_mot[]'
value='#ID_MOT' value='#ID_MOT'
id='mot#ID_MOT' id='mot#ID_MOT'
[(#ID_MOT|in_any{#ENV*{ajouter_mot}, ''}|? [(#ID_MOT|in_any{#ENV**{ajouter_mot}, ''}|?
{'checked="checked"',''})] />[ {'checked="checked"',''})] />[
(#LOGO_MOT|lien) (#LOGO_MOT|lien)
<br />] <br />]
...@@ -16,3 +16,4 @@ ...@@ -16,3 +16,4 @@
(#COMPTEUR_BOUCLE|alterner{'',</tr>})]</BOUCLE_M> (#COMPTEUR_BOUCLE|alterner{'',</tr>})]</BOUCLE_M>
</table> </table>
</B_M> </B_M>
<br />
...@@ -149,6 +149,8 @@ $ajouter_mot, $ajouter_groupe, $afficher_texte, $url_param_retour) ...@@ -149,6 +149,8 @@ $ajouter_mot, $ajouter_groupe, $afficher_texte, $url_param_retour)
$email_auteur = _request('email_auteur'); $email_auteur = _request('email_auteur');
$nom_site_forum = _request('nom_site_forum'); $nom_site_forum = _request('nom_site_forum');
$url_site = _request('url_site'); $url_site = _request('url_site');
$ajouter_mot = _request('ajouter_mot');
$ajouter_groupe = _request('ajouter_groupe');
if ($afficher_texte != 'non') if ($afficher_texte != 'non')
$previsu = inclure_previsu($texte, $titre, $email_auteur, $auteur, $url_site, $nom_site_forum, $ajouter_mot); $previsu = inclure_previsu($texte, $titre, $email_auteur, $auteur, $url_site, $nom_site_forum, $ajouter_mot);
...@@ -195,32 +197,16 @@ $ajouter_mot, $ajouter_groupe, $afficher_texte, $url_param_retour) ...@@ -195,32 +197,16 @@ $ajouter_mot, $ajouter_groupe, $afficher_texte, $url_param_retour)
'alea' => $alea, 'alea' => $alea,
'hash' => $hash, 'hash' => $hash,
'ajouter_groupe' => $ajouter_groupe, 'ajouter_groupe' => $ajouter_groupe,
'ajouter_mot' => (is_array($ajouter_mot) ? $ajouter_mot : array()), 'ajouter_mot' => (is_array($ajouter_mot) ? $ajouter_mot : array($ajouter_mot)),
)); ));
} }
function inclure_previsu($texte,$titre, $email_auteur, $auteur, $url_site, $nom_site_forum, $ajouter_mot) function inclure_previsu($texte,$titre, $email_auteur, $auteur, $url_site, $nom_site_forum, $ajouter_mot)
{ {
$mots_forum = $erreur = $bouton = ''; $erreur = $bouton = '';
if (is_array($ajouter_mot)) {
$result_mots = spip_query("SELECT id_mot, titre, type
FROM spip_mots
WHERE id_mot IN (" #securite XSS
. preg_replace('/[^0-9,]/', '', join(',',$ajouter_mot))
. ") ORDER BY 0+type,type,0+titre,titre");
if (spip_num_rows($result_mots)>0) {
$mots_forum = "<p>"._T('forum_avez_selectionne')."</p><ul>";
while ($row = spip_fetch_array($result_mots)) {
$mots_forum .= "<li style='font-size: 80%;'> "
. typo($row['type']) . "&nbsp;: <b>"
. typo($row['titre']) ."</b></li>";
}
$mots_forum .= '</ul>';
}
}
if (strlen($texte) < 10 AND !$mots_forum) if (strlen($texte) < 10 AND !$ajouter_mot)
$erreur = _T('forum_attention_dix_caracteres'); $erreur = _T('forum_attention_dix_caracteres');
else if (strlen($titre) < 3) else if (strlen($titre) < 3)
$erreur = _T('forum_attention_trois_caracteres'); $erreur = _T('forum_attention_trois_caracteres');
...@@ -240,7 +226,7 @@ function inclure_previsu($texte,$titre, $email_auteur, $auteur, $url_site, $nom_ ...@@ -240,7 +226,7 @@ function inclure_previsu($texte,$titre, $email_auteur, $auteur, $url_site, $nom_
'texte' => safehtml(propre($texte)), 'texte' => safehtml(propre($texte)),
'url_site' => safehtml($url_site), 'url_site' => safehtml($url_site),
'nom_site_forum' => safehtml(typo($nom_site_forum)), 'nom_site_forum' => safehtml(typo($nom_site_forum)),
'mots_forum' => $mots_forum, 'ajouter_mot' => (is_array($ajouter_mot) ? $ajouter_mot : array($ajouter_mot)),
'erreur' => $erreur, 'erreur' => $erreur,
'bouton' => $bouton 'bouton' => $bouton
) )
......
...@@ -10,7 +10,13 @@ ...@@ -10,7 +10,13 @@
[<p /><a [href="(#ENV{url_site}|attribut_html)"]>(#ENV*{nom_site_forum})</a>] [<p /><a [href="(#ENV{url_site}|attribut_html)"]>(#ENV*{nom_site_forum})</a>]
[(#ENV*{mots_forum})] <B_M>
<p><:forum_avez_selectionne:></p><ul>
<BOUCLE_M(MOTS){id_mot IN #ENV**{ajouter_mot}}{par num type}{par type}{par num titre}{par titre}>
<li style='font-size: 80%;'>#TYPE&nbsp;: <b>#TITRE</b></li>
</BOUCLE_M>
</ul>
</B_M>
[<p align='right' style='color: red;'>(#ENV*{erreur})</p>] [<p align='right' style='color: red;'>(#ENV*{erreur})</p>]
...@@ -18,4 +24,4 @@ ...@@ -18,4 +24,4 @@
</div> </div>
<br /> <br />
\ No newline at end of file
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