[spip-dev] Envoyer l'article à un ami...

Hello,

Voici une version "standard SPIP" (du moins j'ai essayé :wink: ) de la
fonctionalité "Envoyer cet article à un ami" que j'ai mise en place sur
LinuxFrench.NET.

Il suffit de décompacter le .tgz dans le répertoire racine du site spip, et
dans le squelette de votre article, mettre le lien suivant :

<A HREF="mail_article.php3?art_id=#ID_ARTICLE">Envoyer &agrave; un ami</A>

Le formulaire de saisie est "customizable" selon les standard SPIP, pour cela
modifier mail_article.html

--------------Boundary-00=_KPLAFF8D0TSTL6U1GL44
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Exusez, j'avais oublié le principal :-/
--------------Boundary-00=_KPLAFF8D0TSTL6U1GL44
Content-Type: application/x-gzip;
  name="mail.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mail.tgz"

H4sIAHmg5TsAA+1YbW/iSBKer+NfUetDQ3IKGAJDMsF2ZMAEJF4icLI3d3NCxu6E3jVtx25zyY3m
v191205IMjezK+2s7iTXB9wv1VVd1VXVT7N1abByY069gNQ3fBu8+eOp0Ww0Ou32mwbSSSf/njTk
F+n4RMydtE6arWNkPEb+VqvdeQONH7CXV5Qm3I0B3rjklsbf4Pve/P8p6SNnOjEVfWRbA/xwygNi
2mwXPpAYUgZWFhrgys6Wgq5lPIq+JdyFDedRjdyldGeo/ZBxwnjNeYiICl7WM1RO7rkmQqsL3saN
E8INmoS109P3H2pNFQUl/EEIVPSfajVFASQXPotVNZ94YexyGrIzYCEjXfiSMVhno3CHO3zNljKf
xAFFXmSt1YRYLVega5mVit6bDz7C+tYLgzA21L8MJakghGE3C0sVUMqv2LVPO++bH1TY5f1Go9Xp
tFRw8/5w+OGDYHfml1NrcTGeGSr2JvbQ2etmzZ/HA2e01x/Z44uRIwZwd72FqQ/nMweW47/bRsvU
LRgt7CFquFpMVsuxY6vmO7ZOou7r3wXhYRqj34Kq5XkpoYGuWaauCXkoum/PHHuR6+iJhmP1Jjb0
7cnk0hoMxrMLo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yaEQIgyE+hlIdPHlptYrOcqrV2En8O2NSzmi2hhRL43BQ5BX4GS0pVp/7v96
NROH66Iw3SHkxsNO0gDh07OlOj4KY3JjqCjg1dHUq9p+kTmnfuFHQ7BTv15VTepR+XoRj5XRwsSJ
3CJhnLBgHfoPRjV7umYvV71nLe38ufR1vQIY5qwCHT0JravFq0goU/Nj+qnir1fhr4fw+TcdlA1y
A/gdzGcz217+jgN7+7aQ/EWpxOROXMVLe2L3HfFejsIjmTFHSYqOwrM8yn4TPAjZguFiPn0Rkj+P
bNS951zhWjRN0zLEiVq6uNne1YXQKA7R2D4kd8HqLiXxw4GYF5mFolYs5AQRt6gFInoRiOP+MuYb
wr0NqohduUSIOTxUPitvK3LfyBdhzsRErvpHVQ5W/yksrkiTXjLIwYJBmvaSQQzmDIU7XvIU4wXb
o5te8hUTkvHLU2DVMW9GLROzpRCFEaLhiD5qitGnoSZGjeQrRInRngwlHJXm4shI9rKqV/QeHdt9
rjdD7jlwF6FY2RDXJzEewCc2jMPtGRQ5/IlNx1O7do2T8n+PZr3xie3/A3MG3/zjZY85xof5DYlr
NvNCn7LbMzhdU/6JiQ3s44ODTPdRRbzjjh43flRsUhSfrIn5MQm9/B8Z9Sv5eNgV8V5ixZJKKqmk
kkoqqaSSSiqppJJKKqmkkkr6ofQfa9BVhgAoAAA=

--------------Boundary-00=_KPLAFF8D0TSTL6U1GL44--

Il y a un bug dans la version que j'ai envoyée.

Des séries de warning en tout genre interviennent lors de la validation du
formulaire pour peu que la page soit absente du cache :

Warning: Unable to access .html in inc-calcul.php3 on line 2071

Warning: File(".html") - No such file or directory in inc-calcul.php3 on line
2071

etc.

Le temps de me plonger dans le code de SPIP pour comprende ce qui se passe,
et je règle cela. (désolé).

--------------Boundary-00=_LNTA2L820NPNIGYJ5YSL
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Le problème semble réglé. Apparemment il faut éviter de faire un include
"inc_public.php3" dans une page qui n'est pas un squelette SPIP :slight_smile:

J'ai donc remplacé cet include par ceux dont j'avais réellement besoin
(inc_mail et inc_meta) et ça semble OK.

Merci à Laurent pour le beta-testing :slight_smile:
--------------Boundary-00=_LNTA2L820NPNIGYJ5YSL
Content-Type: application/x-gzip;
  name="mail_1.01.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mail_1.01.tgz"

H4sIAPvJ5TsAA+1Y62/iSBKfr+O/otaLhuQUwDzymGA7MmACEo8InOzO3ayQsTuhd02b2G0uudH8
71fdthPyuMyOtLvak1wfcD+qq7qqq6p/zdqlwcKNOPUCUl3xdfDujyetrmlHrdY7Den4KPsea/KL
1DgWc8fN43qzgYwN5G82W0fvQPsT9vKCkpi7EcA7l9zQ6A2+b83/n5I+cMYjU9EHttXDD6c8IKbN
tuE9iSBhYKWhAa7srCnotZRH0deEu7DifFMhtwndGmo3ZJwwXnHuN0QFL+0ZKid3vCZCqw3eyo1i
wg0ah5WTk8OPlbqKgmJ+LwQq+g+ViqIAkgtfxKqKT7wwcjkN2SmwkJE2fE0ZrNNBuMUdvmRLmE+i
gCIvslYqQmwtU6DXUisVvTPtfYLljRcGYWSoP/YlqSCEYTcNSxVQym/YtU+ODusfVdhmfU1rHh01
VXCzfr//8aNgd6YXY2t2PpwYKvZGdt/Z6abNn4Y9Z7DTH9jD84EjBnB3nZmp96cTB+bDf9pG09Qt
GMzsPmq4nI0W86Fjq+YHtow37Ze/M8LDJEK/BWXL8xJCA71mmXpNyEPRXXvi2LNMR0c0HKszsqFr
j0YXVq83nJwbmuzNL6xu2utMZz17ho1000dNTSyTa3vZGKYrXFmj4TnayMONMEIa0Le6tqG6EXWD
gxUJtgRjyD2IXRZXYhLRazU3UfDPxmB1neEUZZA07hbr3aK0WW3Q2WPbGUx7hnoxnTvqo0Vzl8Y0
jsl/0HDXjwg2IfyQ3ETuFoMlkyfm8jCmLKZwm5QTpnjheo0B6tKIwAfiegkn7S0OJCSAPRYmMbAy
YRHmfcyjkMWwcWMISAyZolghYqP7ei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