X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fnewsletter.inc.php;h=9e1a59bc3f0fbc6edc04046e6b86ecd56109cd8a;hb=77b7830984e6b5be75bb3b498cefeeb3f37a9635;hp=0ab9899528758f1b1fe4a78bbc8c51fbbc1e3549;hpb=eaf30d86cc99df2414cf4f171a9b0f11b0561e3b;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; }