X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnewsletter.inc.php;h=9e1a59bc3f0fbc6edc04046e6b86ecd56109cd8a;hb=b3ec63d58dc3bb0e0e380774bf62b410542deb6d;hp=0ab9899528758f1b1fe4a78bbc8c51fbbc1e3549;hpb=787bb3d745141f2f85bd947ad7dd775d2c63f908;p=platal.git diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index 0ab9899..9e1a59b 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -1,6 +1,6 @@ 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 = "

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

'; $body = MiniWiki::WikiToHTML($this->_body); @@ -246,6 +252,11 @@ class NLArticle $art .= "
$app
"; } $art .= "\n"; + if (!is_null($hash) && !is_null($login)) { + $art = str_replace('%HASH%', "$hash/$login", $art); + } else { + $art = str_replace('%HASH%', '', $art); + } return $art; }