Force baseurl because it is used in redirect
[platal.git] / modules / events.php
index 87b9e17..28c07a0 100644 (file)
@@ -41,7 +41,7 @@ class EventsModule extends PLModule
                                       WHERE user_id={?}', S::v('uid'));
         list($date, $naissance) = $res->fetchOneRow();
 
-        // incitation à mettre à jour la fiche
+        // incitation à mettre à jour la fiche
 
         $d2  = mktime(0, 0, 0, substr($date, 5, 2), substr($date, 8, 2),
                       substr($date, 0, 4));
@@ -56,18 +56,18 @@ class EventsModule extends PLModule
             $page->assign('birthday', date('Y') - substr($naissance, 0, 4));
         }
 
-        // incitation à mettre une photo
+        // incitation à mettre une photo
 
         $res = XDB::query('SELECT COUNT(*) FROM photo
                                       WHERE uid={?}', S::v('uid'));
         $page->assign('photo_incitation', $res->fetchOneCell() == 0);
 
-        // Incitation à se géolocaliser
+        // Incitation à se géolocaliser
         require_once 'geoloc.inc.php';
         $res = localize_addresses(S::v('uid', -1));
         $page->assign('geoloc_incitation', count($res));
 
-        // affichage de la boîte avec quelques liens
+        // affichage de la boîte avec quelques liens
         require_once 'login.conf.php';
         $pub_nbElem = $pub_nbLig * $pub_nbCol ;
         if (count($pub_tjs) <= $pub_nbElem) {
@@ -102,17 +102,17 @@ class EventsModule extends PLModule
                                      INNER JOIN evenements AS e ON e.id = ev.evt_id
                                           WHERE peremption < NOW)');
             XDB::execute('REPLACE INTO evenements_vus VALUES({?},{?})',
-                                   Env::get('lu'), S::v('uid'));
+                                   Env::v('lu'), S::v('uid'));
         }
 
         if (Env::has('nonlu')){
             XDB::execute('DELETE FROM evenements_vus
                                           WHERE evt_id = {?} AND user_id = {?}',
-                                   Env::get('nonlu'), S::v('uid'));
+                                   Env::v('nonlu'), S::v('uid'));
         }
 
         // affichage des evenements
-        // annonces promos triées par présence d'une limite sur les promos
+        // annonces promos triées par présence d'une limite sur les promos
         // puis par dates croissantes d'expiration
         $promo = S::v('promo');
         $sql = "SELECT  e.id,e.titre,e.texte,a.user_id,a.nom,a.prenom,a.promo,l.alias AS forlife
@@ -147,13 +147,13 @@ class EventsModule extends PLModule
     {
         $page->changeTpl('evenements.tpl');
 
-        $titre      = Post::get('titre');
-        $texte      = Post::get('texte');
-        $promo_min  = Post::getInt('promo_min');
-        $promo_max  = Post::getInt('promo_max');
-        $peremption = Post::getInt('peremption');
-        $valid_mesg = Post::get('valid_mesg');
-        $action     = Post::get('action');
+        $titre      = Post::v('titre');
+        $texte      = Post::v('texte');
+        $promo_min  = Post::i('promo_min');
+        $promo_max  = Post::i('promo_max');
+        $peremption = Post::i('peremption');
+        $valid_mesg = Post::v('valid_mesg');
+        $action     = Post::v('action');
 
         $page->assign('titre', $titre);
         $page->assign('texte', $texte);
@@ -232,12 +232,12 @@ class EventsModule extends PLModule
         require_once 'newsletter.inc.php';
 
         if (Post::has('see')) {
-            $art = new NLArticle(Post::get('title'), Post::get('body'), Post::get('append'));
+            $art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'));
             $page->assign('art', $art);
         } elseif (Post::has('valid')) {
             require_once('validations.inc.php');
-            $art = new NLReq(S::v('uid'), Post::get('title'),
-                             Post::get('body'), Post::get('append'));
+            $art = new NLReq(S::v('uid'), Post::v('title'),
+                             Post::v('body'), Post::v('append'));
             $art->submit();
             $page->assign('submited', true);
         }