X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnewsletter.inc.php;h=9e1a59bc3f0fbc6edc04046e6b86ecd56109cd8a;hb=9466051012a24391af2b769a4c281ed5588105bc;hp=07aac94d71263ef535829677b5cf6d4893fea838;hpb=5f30b30e8b2657ade5c727e98de286386ee002d8;p=platal.git diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index 07aac94..9e1a59b 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -223,18 +223,24 @@ class NLArticle // }}} // {{{ function toText() - public function toText() + public function toText($hash = null, $login = null) { $title = '*'.$this->title().'*'; $body = MiniWiki::WikiToText($this->_body, true); $app = MiniWiki::WikiToText($this->_append,false,4); - return trim("$title\n\n$body\n\n$app")."\n"; + $text = trim("$title\n\n$body\n\n$app")."\n"; + if (!is_null($hash) && !is_null($login)) { + $text = str_replace('%HASH%', "$hash/$login", $text); + } else { + $text = str_replace('%HASH%', '', $text); + } + return $text; } // }}} // {{{ function toHtml() - public function toHtml() + public function toHtml($hash = null, $login = null) { $title = "