fix gestion des liens internes a la page dans les annonces d'accueil
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 19 Sep 2006 17:57:13 +0000 (17:57 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 19 Sep 2006 17:57:13 +0000 (17:57 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.11@875 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/events.php
templates/login.tpl

index af01c70..7c96566 100644 (file)
@@ -43,7 +43,7 @@ class EventsModule extends PLModule
         subscribe_nl($uid);
     }
 
-    function handler_ev(&$page, $action = 'list', $eid = null)
+    function handler_ev(&$page, $action = 'list', $eid = null, $pound = null)
     {
         $page->changeTpl('login.tpl');
 
@@ -114,13 +114,15 @@ 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({?},{?})',
-                                   $eid, S::v('uid'));
+                $eid, S::v('uid'));
+            pl_redirect('events#'.$pound);
         }
 
         if ($action == 'unread' && $eid) {
             XDB::execute('DELETE FROM evenements_vus
                            WHERE evt_id = {?} AND user_id = {?}',
                                    $eid, S::v('uid'));
+            pl_redirect('events#newsid'.$eid);
         }
 
         // affichage des evenements
index b63745e..a104701 100644 (file)
@@ -87,7 +87,7 @@ Bienvenue {$smarty.session.prenom}
           {if $smarty.session.perms eq 'admin'}
           <a href="admin/events/edit/{$ev.id}">{icon name=page_edit title="Editer cet article"}</a>
           {/if}
-          <a href="events/read/{$ev.id}{if $previd}#newsid{$previd}{/if}">{icon name=cross title="Cacher cet article"}</a>
+          <a href="events/read/{$ev.id}{if $previd}/newsid{$previd}{/if}">{icon name=cross title="Cacher cet article"}</a>
         </div>
         {assign var="previd" value=$ev.id}
         <a id="newsid{$ev.id}"></a>
@@ -133,7 +133,7 @@ Bienvenue {$smarty.session.prenom}
     <tr class="{cycle values="impair,pair"}">
       <td class="half">
         &bull;
-        <a href="{if !$ev.nonlu}events/unread/{$ev.id}{/if}#newsid{$ev.id}">
+        <a href="events{if !$ev.nonlu}/unread/{$ev.id}{else}#newsid{$ev.id}{/if}">
         {if $ev.nonlu}<strong>{/if}
         {tidy}
           {$ev.titre|nl2br}