diff compos.inc.php @ 193:1e4f530c8310

Add link list of compos.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 10 Nov 2013 15:48:23 +0200
parents 0980e705dea0
children c30f5bcb71fd
line wrap: on
line diff
--- a/compos.inc.php	Sun Nov 10 15:29:46 2013 +0200
+++ b/compos.inc.php	Sun Nov 10 15:48:23 2013 +0200
@@ -52,6 +52,20 @@
   return $str;
 }
 
+
+$sql = "SELECT id,name FROM compos WHERE visible<>0 ORDER BY id ASC";
+
+if (($res = stExecSQL($sql)) !== FALSE)
+{
+  $list = array();
+  foreach ($res as $item)
+  {
+    $list[] = "<a href=\"#compo".$item["id"]."\">".chentities($item["name"])."</a>";
+  }
+  echo "<p>".join($list, " | ")."</p>";
+}
+
+
 $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC";
 
 if (($res = stExecSQL($sql)) !== FALSE)