Mercurial > hg > fapweb
view pages/compos.inc.php @ 1115:24e6915fc0fb
Move database field length definitions from msite.inc.php to dbdefs.inc.php
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 14 Oct 2019 10:33:39 +0300 |
parents | bbc0a3d0b51e |
children |
line wrap: on
line source
<?php // // 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("msgCompoDescription"); $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=\"componamelist\">".join($list, "<span class=\"composep\"> | </span>")."</div>\n\n"; } $sql = "SELECT * FROM compos WHERE visible<>0 ORDER BY id ASC"; if (($res = stExecSQL($sql)) !== FALSE) { echo "<div class=\"compolist\">\n"; foreach ($res as $item) { echo "<div class=\"compo\" 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"; } echo "</div>\n"; } } ?>