X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnewsletter.inc.php;h=98407755a9eacf0b7678d379a1c154af9f14b833;hb=259626014d09f53dd6993724a6b0f38bb8af8b86;hp=b4d43f8825865d6b21f6bbd542aec5abc9081861;hpb=a7de4ef724d1a3b0bf978a50ce7cc9d23412c7a0;p=platal.git diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index b4d43f8..9840775 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -31,7 +31,7 @@ class NewsLetter extends MassMailer function __construct($id = null) { - parent::__construct('newsletter/nl.tpl', 'nl.css', 'nl/show'); + parent::__construct('newsletter/nl.tpl', 'nl.css', 'nl/show', 'newsletter', 'newsletter_ins'); if (isset($id)) { if ($id == 'last') { $res = XDB::query("SELECT MAX(id) FROM newsletter WHERE bits!='new'"); @@ -146,11 +146,6 @@ class NewsLetter extends MassMailer VALUES ({?}, 0)", $user); } - protected function subscriptionTable() - { - return 'newsletter_ins'; - } - protected function subscriptionWhere() { return '1'; @@ -231,8 +226,8 @@ class NLArticle public function toText() { $title = '*'.$this->title().'*'; - $body = enriched_to_text($this->_body,false,true); - $app = enriched_to_text($this->_append,false,false,4); + $body = MiniWiki::WikiToText($this->_body, true); + $app = MiniWiki::WikiToText($this->_append,false,4); return trim("$title\n\n$body\n\n$app")."\n"; } @@ -241,9 +236,9 @@ class NLArticle public function toHtml() { - $title = "

".htmlentities($this->title()).'

'; - $body = enriched_to_text($this->_body,true); - $app = enriched_to_text($this->_append,true); + $title = "

".pl_entities($this->title()).'

'; + $body = MiniWiki::WikiToHTML($this->_body); + $app = MiniWiki::WikiToHTML($this->_append); $art = "$title\n"; $art .= "
\n$body\n"; @@ -260,7 +255,7 @@ class NLArticle public function check() { - $text = enriched_to_text($this->_body); + $text = MiniWiki::WikiToText($this->_body); $arr = explode("\n",wordwrap($text,68)); $c = 0; foreach ($arr as $line) {