Mercurial > hg > fapweb
view pages/compos.inc.php @ 1001:ffacd904fd1f
Update copyrights.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 15 Jan 2015 10:31:00 +0200 |
parents | 7091b0c6c7c1 |
children | 74b98743697b |
line wrap: on
line source
<? // // FAPWeb - Simple Web-based Demoparty Management System // Competitions page // (C) Copyright 2012-2015 Tecnic Software productions (TNSP) // function stConvertNameToID($name) { return preg_replace("/[^a-z0-9_]/", "", strtolower($name)); } if (stChkSetting("showCompos")) { echo "<div id=\"top\"></div>\n". stGetSetting("compoDescription"); $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 class=\"compo\" href=\"#". stConvertNameToID($item["name"])."\">". chentities($item["name"])."</a>"; } echo "<div class=\"compolist\">".join($list, "<span class=\"composep\"> | </span>")."</div>"; } $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC"; if (($res = stExecSQL($sql)) !== FALSE) { foreach ($res as $item) { echo "<div id=\"".stConvertNameToID($item["name"])."\">\n". "<h2>".chentities($item["name"])."</h2>\n". stConvertCommonDesc($item["description"], FALSE). "<div class=\"backToTop\"><a href=\"#top\">Back</a></div>\n". "</div>\n"; } } } ?>