Proof of concept:
[platal.git] / include / newsletter.inc.php
index 63e0b2e..ae2aef1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  Copyright (C) 2003-2006 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -252,6 +252,7 @@ class NewsLetter
         }
 
        $i = 1;
+       $res .= "<a id='top_lnks'></a>";
        foreach ($this->_arts as $cid=>$arts) {
            $res .= "<div class='lnk'><a href='#cat$cid'><strong>$i. {$this->_cats[$cid]}</strong></a>";
            foreach ($arts as $art) {
@@ -264,7 +265,8 @@ class NewsLetter
        foreach ($this->_arts as $cid=>$arts) {
            $res .= "<h1><a id='cat$cid'></a><span>".$this->_cats[$cid].'</span></h1>';
            foreach($arts as $art) {
-               $res .= $art->toHtml();
+               $res .= $art->toHtml();
+               $res .= "<p><a href='#top_lnk'>Revenir au sommaire</a></p>";
            }
        }
 
@@ -479,7 +481,7 @@ function subscribe_nl($uid=-1)
  
 function justify($text,$n)
 {
-    $arr = split("\n",wordwrap($text,$n));
+    $arr = explode("\n",wordwrap($text,$n));
     $arr = array_map('trim',$arr);
     $res = '';
     foreach ($arr as $key => $line) {