A form to write to the author. An anti-spam solution.

In the basic SPIP template, author’s emails can be seen by anyone. This is good food for spammers.
This template adds a new page to write to the author through a form without disclosing their mail.

In place of the user mailer, we provide with this template a simple web form to write to the author.

template

here are the two files for this new page:

ecrire_auteur.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">
<head>
<title>Write to the author</title>
<meta http-equiv="Content-Type" content="text/html; charset=#CHARSET">

<!-- Ceci est la feuille de style par defaut pour les types internes a SPIP -->
<link rel="stylesheet" href="spip_style.css" type="text/css">

<!-- Les feuilles de style specifiques aux presents squelettes -->
<link rel="stylesheet" href="typographie.css" type="text/css">

<!-- media="..." permet de ne pas utiliser ce style sous Netscape 4 (sinon plantage) -->
<link rel="stylesheet" href="habillage.css" type="text/css" media="projection, screen, tv">
<!-- media="print" permet d'utiliser cette feuille de style quand vous imprimez depuis votre navigateur -->
<link rel="stylesheet" href="impression.css" type="text/css" media="print">

</head>
<body>
<div id="principal" class="contenu">

<BOUCLE_article_principal(ARTICLES) {id_article}>
<BOUCLE_auteurs(AUTEURS) {id_article}>
<div class="cartouche">
<div class="textetop">
<h1 class="titre-texte">Write to #NOM</h1>
<div class="surtitre">in regard to "#TITRE"</div>
</div>
</div>

#FORMULAIRE_ECRIRE_AUTEUR

</BOUCLE_auteurs>
<center><a href="#URL_ARTICLE" title="back to: #TITRE">back</a></center>
</BOUCLE_article_principal>

</div>

</body>
</html>

ecrire_auteur.php

<?php
$fond = "ecrire_auteur";
$delais = 10 * 24 * 3600;

include ("inc-public.php");

?>

install them into your SPIP folder.

Linking from other templates

Now, we have to direct the user to this page when he clicks on the author name. Put this new code in any boucle providing an id_article (like the ARTICLE boucle).

<BOUCLE_auteurs(AUTEURS) {id_article} {par nom}>
                <li><A HREF="ecrire_auteur.php?id_article=#ID_ARTICLE">#NOM</a></li>
</BOUCLE_auteurs>
  1. From version 1.7.2, the distribution file auteur-dist.html comes with this same functionality.
  2. This form will only work if the server where the site is provides the emailing functions.

Discussion

Aucune discussion

Comment on this article

Who are you?
  • [Log in]

To show your avatar with your message, register it first on gravatar.com (free et painless) and don’t forget to indicate your Email addresse here.

Enter your comment here

This form accepts SPIP shortcuts {{bold}} {italic} -*list [text->url] <quote> <code> and HTML code <q> <del> <ins>. To create paragraphs, just leave empty lines.

Add a document

Follow the comments: RSS 2.0 | Atom

updated on 25 January 2007