[Kos-cvs] kos-web/include toc.php,1.11,1.12

thomas at kos.enix.org thomas at kos.enix.org
Wed Jan 5 22:44:30 CET 2005


Update of /var/cvs/kos/kos-web/include
In directory the-doors:/tmp/cvs-serv2567

Modified Files:
	toc.php 
Log Message:
Gestion correcte du #machinchose dans le menu.


Index: toc.php
===================================================================
RCS file: /var/cvs/kos/kos-web/include/toc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- toc.php	30 Dec 2004 01:01:29 -0000	1.11
+++ toc.php	5 Jan 2005 21:44:28 -0000	1.12
@@ -23,10 +23,20 @@
   global $lang;
   global $topsrcdir;
 
+  // Split the before-# and the after-# part, because the after-# part
+  // must be after the ?lang=$lang part of the URL
+  $url_array = split("#", $url);
+
+  // If there's an after-# part
+  if($url_array[1])
+    $anchor = "#" . $url_array[1];
+
+  $url = $url_array[0];
+
   if($current == $toc_entry)
-    echo "  <a class=\"current_topic\" href=\"" . $topsrcdir . "/$url?lang=$lang\">$title</a><br/>\n";
+    echo "  <a class=\"current_topic\" href=\"" . $topsrcdir . "/$url?lang=$lang$anchor\">$title</a><br/>\n";
   else
-    echo "  <a class=\"other_topic\" href=\"" . $topsrcdir . "/$url?lang=$lang\">$title</a><br/>\n";
+    echo "  <a class=\"other_topic\" href=\"" . $topsrcdir . "/$url?lang=$lang$anchor\">$title</a><br/>\n";
 }
 
 



More information about the Kos-cvs mailing list