Mercurial > hg > fapweb
changeset 1116:d5847f016de5
Merge.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 14 Oct 2019 10:34:06 +0300 |
parents | 24e6915fc0fb (current diff) 0eca3f1b1d48 (diff) |
children | 43c384a37d19 |
files | admajax.php |
diffstat | 1 files changed, 15 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Mon Oct 14 10:33:39 2019 +0300 +++ b/admajax.php Mon Oct 14 10:34:06 2019 +0300 @@ -1279,8 +1279,7 @@ " <div class=\"ctrlInfo\">Controls for competition showing mode. Select and activate desired compo, then ". "hit 'Next entry' to activate the first entry to show. <b>Notice! You need to have generated 'show positions' ". "before starting compos!</b></div>\n". - " <div class=\"ctrlDBox1\">\n". - stGetFormOptionListStart("ctrlCompoList", " ", TRUE); + " <div class=\"ctrlDBox1\">\n"; $sql = "SELECT compos.*, ". @@ -1293,16 +1292,19 @@ $currCompoID = stGetDisplayVar("compoID"); if (($res = stExecSQL($sql)) !== FALSE) { + echo stGetFormOptionListStart("ctrlCompoList", " ", TRUE); foreach ($res as $item) { echo stGetFormOptionListItem(" ", $item["id"], ($item["id"] == $currCompoID), sprintf("%-20s (%d entries)", substr($item["name"], 0, 20), $item["nentries"])); } + echo stGetFormOptionListEnd(" ", TRUE); } + else + echo "ERROR"; echo - stGetFormOptionListEnd(" ", TRUE). " <div class=\"ctrlButtons\">\n". " ".stGetFormButtonInput("setcompo", "", "", "Change compo", "activateCompo()")."\n". " </div>\n". @@ -1334,13 +1336,18 @@ "<hr />\n"; $sql = "SELECT * FROM news ORDER BY utime DESC"; - foreach (stExecSQL($sql) as $item) + if (($res = stExecSQL($sql)) !== false) { - echo - "<div id=\"news".$item["id"]."\" class=\"newsItem\">\n". - stGetNewsItemData($item["id"], $item, "ne"). - "</div>\n"; + foreach ($res as $item) + { + echo + "<div id=\"news".$item["id"]."\" class=\"newsItem\">\n". + stGetNewsItemData($item["id"], $item, "ne"). + "</div>\n"; + } } + else + echo "ERROR"; break; case "newsitem":