$banana is the only global variable !
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 3 Jan 2005 11:12:31 +0000 (11:12 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:10 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-212

htdocs/banana/include/format.inc.php
htdocs/banana/include/hack.inc.php

index 6908c1e..ec83714 100644 (file)
@@ -10,8 +10,8 @@
 /** contextual links 
  * @return STRING HTML output
  */
-function displayshortcuts() {
-    global $banana,$first,$group,$post,$id,$css;
+function displayshortcuts($first = -1) {
+    global $banana,$css;
     $sname = basename($_SERVER['SCRIPT_NAME']);
 
     echo "<div class=\"{$css['bananashortcuts']}\">";
@@ -34,13 +34,13 @@ function displayshortcuts() {
             }
             echo '[<a href="'.url("confbanana.php").'">Profil</a>] ';
             echo '[<a href="index.php">'._('Liste des forums').'</a>] ';
-            echo "[<a href=\"post.php?group=$group\">"._('Nouveau message')."</a>] ";
+            echo "[<a href=\"post.php?group={$banana->spool->group}\">"._('Nouveau message')."</a>] ";
             if (sizeof($banana->spool->overview)>$banana->tmax) {
                 for ($ndx=1; $ndx<=sizeof($banana->spool->overview); $ndx += $banana->tmax) {
                     if ($first==$ndx) {
                         echo "[$ndx-".min($ndx+$banana->tmax-1,sizeof($banana->spool->overview))."] ";
                     } else {
-                        echo "[<a href=\"?group=$group&amp;first=$ndx\">$ndx-".min($ndx+$banan->tmax-1,sizeof($banana->spool->overview))."</a>] ";
+                        echo "[<a href=\"?group={$banana->spool->group}&amp;first=$ndx\">$ndx-".min($ndx+$banan->tmax-1,sizeof($banana->spool->overview))."</a>] ";
                     }
                 }
             }
@@ -51,10 +51,12 @@ function displayshortcuts() {
             }
             echo '[<a href="'.url("confbanana.php").'">Profil</a>] ';
             echo '[<a href="index.php">'._('Liste des forums').'</a>] ';
-            echo "[<a href=\"thread.php?group=$group\">$group</a>]";
-            echo "[<a href=\"post.php?group=$group&amp;id=$id&amp;type=followup\">"._('RĂ©pondre')."</a>] ";
-            if (checkcancel($post->headers)) {
-                echo "[<a href=\"article.php?group=$group&amp;id=$id&amp;type=cancel\">"._('Annuler ce message')."</a>] ";
+            echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>]";
+            echo "[<a href=\"post.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=followup\">"
+                ._('RĂ©pondre')."</a>] ";
+            if ($banana->post->checkcancel()) {
+                echo "[<a href=\"article.php?group={$banana->spool->group}&amp;id={$banana->post->id}&amp;type=cancel\">"
+                    ._('Annuler ce message')."</a>] ";
             }
             break;
         case 'post.php' :
@@ -63,7 +65,7 @@ function displayshortcuts() {
             }
             echo '[<a href="'.url("confbanana.php").'">Profil</a>] ';
             echo '[<a href="index.php">'._('Liste des forums').'</a>] ';
-            echo "[<a href=\"thread.php?group=$group\">$group</a>] ";
+            echo "[<a href=\"thread.php?group={$banana->spool->group}\">{$banana->spool->group}</a>] ";
             break;
     }
     echo '</div>';
index 0dba042..3a18053 100644 (file)
@@ -2,14 +2,8 @@
     
 function banana($params) {
     global $globals, $page;
-    global $banana,$first,$group,$post,$id,$css;
+    global $banana,$css;
     $sname = basename($_SERVER['SCRIPT_NAME']);
-
-    global $news_server,$news_port;
-
-    $news_server    = $globals->banana->server;
-    $news_port      = $globals->banana->port;
-
     require_once('config.inc.php');
     require_once("../../../banana/$sname");
 }