Skip to content
Extraits de code Groupes Projets
Valider 9f42df5e rédigé par Fil's avatar Fil
Parcourir les fichiers

- formulaire forum sécurisé mais acceptant html et raccourcis spip

- le problème du chevron du titre proposé par défaut
parent 0f6c7e77
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<legend><b><:forum_titre:></b></legend> <legend><b><:forum_titre:></b></legend>
<label> <label>
<input type='text' name='titre' <input type='text' name='titre'
[value="> (#HTTP_VARS{titre}|supprimer_prefixe{'>'}|supprimer_numero)" ]class='forml' size='40' /> [value="(#HTTP_VARS{titre}|supprimer_numero)" ]class='forml' size='40' />
</label> </label>
</fieldset> </fieldset>
<br /> <br />
......
...@@ -83,24 +83,24 @@ function forum_dyn($titre, $table, $forums_publics, $id_rubrique, $id_forum, $id ...@@ -83,24 +83,24 @@ function forum_dyn($titre, $table, $forums_publics, $id_rubrique, $id_forum, $id
$previsu = ' '; $previsu = ' ';
// Recuperer le message a previsualiser // Recuperer le message a previsualiser
if ($id_message = intval($GLOBALS[HTTP_POST_VARS][id_message])) { if ($id_message = intval($GLOBALS['HTTP_POST_VARS']['id_message'])) {
$titre = $GLOBALS[HTTP_POST_VARS][titre]; $titre = $GLOBALS['HTTP_POST_VARS']['titre'];
$texte = $GLOBALS[HTTP_POST_VARS][texte]; $texte = $GLOBALS['HTTP_POST_VARS']['texte'];
$auteur = $GLOBALS[HTTP_POST_VARS][auteur]; $auteur = $GLOBALS['HTTP_POST_VARS']['auteur'];
$email_auteur = $GLOBALS[HTTP_POST_VARS][email_auteur]; $email_auteur = $GLOBALS['HTTP_POST_VARS']['email_auteur'];
$nom_site_forum = $GLOBALS[HTTP_POST_VARS][nom_site_forum]; $nom_site_forum = $GLOBALS['HTTP_POST_VARS']['nom_site_forum'];
$url_site = $GLOBALS[HTTP_POST_VARS][url_site]; $url_site = $GLOBALS['HTTP_POST_VARS']['url_site'];
if ($afficher_texte != 'non') { if ($afficher_texte != 'non') {
$previsu = $previsu =
"<div style='font-size: 120%; font-weigth: bold;'>" "<div style='font-size: 120%; font-weight: bold;'>"
. htmlspecialchars($titre) . interdire_scripts(typo($titre))
. "</div><p /><b><a href=\"mailto:" . "</div><p /><b><a href=\"mailto:"
. htmlspecialchars($email_auteur) . "\">" . interdire_scripts(typo($email_auteur)) . "\">"
. htmlspecialchars($auteur) . "</a></b><p />" . interdire_scripts(typo($auteur)) . "</a></b><p />"
. htmlspecialchars($texte) . "<p /><a href=\"" . propre($texte) . "<p /><a href=\""
. htmlspecialchars($url_site) . "\">" . interdire_scripts($url_site) . "\">"
. htmlspecialchars($nom_site_forum) . "</a>"; . interdire_scripts(typo($nom_site_forum)) . "</a>";
// Verifier mots associes au message // Verifier mots associes au message
$result_mots = spip_query("SELECT mots.id_mot, mots.titre, mots.type $result_mots = spip_query("SELECT mots.id_mot, mots.titre, mots.type
...@@ -113,7 +113,8 @@ function forum_dyn($titre, $table, $forums_publics, $id_rubrique, $id_forum, $id ...@@ -113,7 +113,8 @@ function forum_dyn($titre, $table, $forums_publics, $id_rubrique, $id_forum, $id
$les_mots[$row['id_mot']] = "checked='checked'"; $les_mots[$row['id_mot']] = "checked='checked'";
$presence_mots = true; $presence_mots = true;
$previsu .= "<li class='font-size=80%'> " $previsu .= "<li class='font-size=80%'> "
. $row['type'] . "&nbsp;: <b>" . $row['titre'] ."</b></li>"; . typo($row['type']) . "&nbsp;: <b>"
. typo($row['titre']) ."</b></li>";
} }
$previsu .= '</ul>'; $previsu .= '</ul>';
} }
...@@ -373,9 +374,10 @@ function sql_recherche_donnees_forum ($idr, $idf, $ida, $idb, $ids) { ...@@ -373,9 +374,10 @@ function sql_recherche_donnees_forum ($idr, $idf, $ida, $idb, $ids) {
if ($idf) if ($idf)
$r = "SELECT titre FROM spip_forum WHERE id_forum = $idf"; $r = "SELECT titre FROM spip_forum WHERE id_forum = $idf";
if ($r) if ($r) {
list($titre) = spip_fetch_array(spip_query($r)); list($titre) = spip_fetch_array(spip_query($r));
else { $titre = '> ' . supprimer_numero($titre);
} else {
$titre = _T('forum_titre_erreur'); $titre = _T('forum_titre_erreur');
$table = ''; $table = '';
} }
...@@ -393,8 +395,4 @@ function sql_recherche_donnees_forum ($idr, $idf, $ida, $idb, $ids) { ...@@ -393,8 +395,4 @@ function sql_recherche_donnees_forum ($idr, $idf, $ida, $idb, $ids) {
return array ($titre, $table, $accepter_forum); return array ($titre, $table, $accepter_forum);
} }
function supprimer_prefixe($texte, $prefixe)
{
return ereg_replace("^[$prefixe" . '[:space:]]*', '', $texte);
}
?> ?>
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