Mercurial > hg > fapweb
changeset 376:55007fe09371
And some more work on the backend.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 03 Dec 2013 16:23:03 +0200 |
parents | 028daa721ee2 |
children | f7b53225d315 |
files | admajax.php main.css |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Tue Dec 03 16:00:27 2013 +0200 +++ b/admajax.php Tue Dec 03 16:23:03 2013 +0200 @@ -233,11 +233,12 @@ $entries = stExecSQL("SELECT id,show_id FROM entries WHERE compo_id=".$compo_id); if ($entries !== FALSE) { + $ncount = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$compo_id." AND show_id<>0"); $final = array(); - if ($patch) + if ($patch && $ncount > 0) { - $iindex = -1; + $index = -1; foreach ($entries as $entry) { if ($entry["show_id"] == 0) @@ -246,7 +247,7 @@ if ($entry["show_id"] > $index) $index = $entry["show_id"]; } - + $index++; } else