Mercurial > hg > fapweb
changeset 667:4fdb61f40946
Fixes to voting page. Some SQL fields had been left unrenamed, etc.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 06 Nov 2014 19:35:22 +0200 |
parents | 61a1575306d3 |
children | 2943ec592cc1 |
files | pages/vote.inc.php |
diffstat | 1 files changed, 4 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/pages/vote.inc.php Thu Nov 06 19:23:43 2014 +0200 +++ b/pages/vote.inc.php Thu Nov 06 19:35:22 2014 +0200 @@ -119,22 +119,17 @@ foreach (stExecSQL("SELECT * FROM compos WHERE visible<>0 AND voting<>0") as $compo) { - $cid = $compo["id"]; - $esql = - "FROM entries " - "WHERE (flags & ".EFLAG_DISQUALIFIED.")=0 ". - "AND compo_id=".$cid; - + $esql = stPrepareSQL("FROM entries WHERE (flags & %d)=0 AND compo_id=%d", EFLAG_DISQUALIFIED, $compo["id"]); $nentries = stFetchSQLColumn("SELECT COUNT(*) ".$esql); if ($nentries > 0) { echo " <table class=\"vote\">\n". - " <tr><th colspan=\"".($compo["showAuthors"] ? "3" : "2")."\">".chentities($compo["name"])."</th></tr>\n". + " <tr><th colspan=\"".($compo["show_authors"] ? "3" : "2")."\">".chentities($compo["name"])."</th></tr>\n". " <tr>\n". " <th class=\"vshown\">#</th>\n". " <th class=\"vtitle\">Title</th>\n". - ($compo["showAuthors"] ? " <th class=\"vauthor\">Author</th>\n" : ""). + ($compo["show_authors"] ? " <th class=\"vauthor\">Author</th>\n" : ""). " "; for ($i = stGetSetting("voteMax"); $i >= stGetSetting("voteMin"); $i--) @@ -152,7 +147,7 @@ " <tr class=\"".($row % 2 == 1 ? "rodd" : "reven")."\">\n". " <td class=\"vshown\">".($entry["show_id"] > 0 ? $entry["show_id"] : "-")."</td>\n". " <td class=\"vtitle\">".$entry["name"]."</td>\n". - ($compo["showAuthors"] ? " <td class=\"vauthor\">".$entry["author"]."</td>\n" : ""). + ($compo["show_authors"] ? " <td class=\"vauthor\">".$entry["author"]."</td>\n" : ""). " "; $val = isset($votes[$eid]) ? $votes[$eid] : 0;