From 930e19b6e405e5a78da7a8c7fdf70a75e347502c Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Mon, 9 Feb 2004 14:54:54 +0000 Subject: [PATCH] =?utf8?q?affichage=20nl=20newsletter.php=3Fid=3Dlast=20po?= =?utf8?q?ur=20afficher=20la=20derni=E8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- etat_migration | 2 +- htdocs/newsletter.php | 33 ++++++++++++++++++++++++++ include/xorg.page.inc.php | 8 +++++++ templates/include/newsletter.list.tpl | 39 +++++++++++++++++++++++++++++++ templates/newsletter.tpl | 44 +++++++++++++++++++++++++++++++++++ 5 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 htdocs/newsletter.php create mode 100644 templates/include/newsletter.list.tpl create mode 100644 templates/newsletter.tpl diff --git a/etat_migration b/etat_migration index 98a5ac8..eb54c57 100644 --- a/etat_migration +++ b/etat_migration @@ -91,7 +91,6 @@ Etat | Ancien nom | Nouveau nom | marketing.php | | mescontacts.php | | mescontacts_pdf.php | - | newsletter.php | | newsletter_req.php | | pg.confirm.php | | pg.php | @@ -186,6 +185,7 @@ xx | index.php | - xx | login.php | - xx | motdepassemd5.php | - xx | nbpromo2.php | stats/nb_by_promo.php +xx | newsletter.php | - xx | pattecassee.php | - xx | preferences.php | - xx | rss.php | - diff --git a/htdocs/newsletter.php b/htdocs/newsletter.php new file mode 100644 index 0000000..4445f9b --- /dev/null +++ b/htdocs/newsletter.php @@ -0,0 +1,33 @@ +assign('nl_date', $nl_date); + $page->assign('nl_titre', $nl_titre); + $page->assign('nl_text', $nl_text); + + if (isset($_REQUEST['send_mail'])) { + require('mailer.inc.php'); + $mymail = new mailer("info_newsletter@polytechnique.org", + $_SESSION['username']."@polytechnique.org", + "[polytechnique.org] ".$nl_titre); + $mymail->addHeader("From: \"Equipe polytechnique.org\" "); + $mymail->setBody("Suite à ta demande sur le site web, nous te réexpédions cette lettre d'informations archivée.\r\n\r\n".strip_tags($nl_text)); + $mymail->send(); + $page->assign('erreur', '

Mail envoyé.

'); + } +} + +$sql = "SELECT id,date,titre FROM newsletter ORDER BY date DESC"; +$page->mysql_assign($sql, 'nl_list'); + +$page->display(); +?> diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php index a63f8f0..80947c1 100644 --- a/include/xorg.page.inc.php +++ b/include/xorg.page.inc.php @@ -52,6 +52,14 @@ class XorgPage extends DiogenesCorePage { exit; } + function xorg_is_cached($append_to_id="") { + $id = $this->make_id($append_to_id); + if($this->_page_type == POPUP) + return parent::is_cached('skin/'.$_SESSION['skin_popup'], $id); + else + return parent::is_cached('skin/'.$_SESSION['skin'], $id); + } + function make_id($append_to_id="") { $ret = $this->_tpl; if($append_to_id) diff --git a/templates/include/newsletter.list.tpl b/templates/include/newsletter.list.tpl new file mode 100644 index 0000000..792836b --- /dev/null +++ b/templates/include/newsletter.list.tpl @@ -0,0 +1,39 @@ +{* $Id: newsletter.list.tpl,v 1.1 2004-02-09 14:54:55 x2000habouzit Exp $ *} + + + + + + + +{foreach item=nl from=$nl_list} + + + + {if $admin} + + + {else} + + {/if} + +{/foreach} +
datetitre 
{$nl.date|date_format:"%Y-%m-%d"} + {$nl.titre} + +
+ + + +
+
+
+ + + +
+
+   +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/newsletter.tpl b/templates/newsletter.tpl new file mode 100644 index 0000000..1443f52 --- /dev/null +++ b/templates/newsletter.tpl @@ -0,0 +1,44 @@ +{* $Id: newsletter.tpl,v 1.1 2004-02-09 14:54:55 x2000habouzit Exp $ *} + +{dynamic} + +{$erreur} + +{if $nl_titre} + +

+[me l'envoyer par mail] +

+ + + + + + + +
+ {$nl_titre} - {$nl_date|date_format:"%d/%m/%Y"} +
+ {$nl_text|replace:" ":" "|nl2br} +
+

+[retour à la liste] +

+ +{else} + +
+ Lettre de Polytechnique.org +
+

+Tu trouveras ici les archives de la lettre d'information de Polytechnique.org. +Pour t'abonner à cette lettre, il te suffit de te +rendre sur la page des listes et de cocher la case "newsletter". +

+ +{include file=include/newsletter.list.tpl nl_list=$nl_list} + +{/if} + +{/dynamic} +{* vim:set et sw=2 sts=2 sws=2: *} -- 2.1.4