diff vote.inc.php @ 333:018817535fab

Make voting more visually pleasant(?).
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 28 Nov 2013 04:45:24 +0200
parents 78521cac3a42
children 87e57f0aa0e5
line wrap: on
line diff
--- a/vote.inc.php	Thu Nov 28 03:32:49 2013 +0200
+++ b/vote.inc.php	Thu Nov 28 04:45:24 2013 +0200
@@ -132,10 +132,9 @@
       ($compo["showAuthors"] ? "   <th class=\"vauthor\">Author</th>\n" : "").
       "   ";
 
-      for ($i = stGetSetting("voteMin"); $i <= stGetSetting("voteMax"); $i++)
+      for ($i = stGetSetting("voteMax"); $i >= stGetSetting("voteMin"); $i--)
       {
-        echo
-        "<th class=\"vvalue\">".$i."</th>";
+        echo "<th class=\"vvalue\">".$i."</th>";
       }
       echo "\n".
       "  </tr>\n";
@@ -153,14 +152,16 @@
 
         $val = isset($votes[$eid]) ? $votes[$eid] : 0;
 
-        for ($i = stGetSetting("voteMin"); $i <= stGetSetting("voteMax"); $i++)
+        for ($i = stGetSetting("voteMax"); $i >= stGetSetting("voteMin"); $i--)
         {
+          $nid = "ve".$eid."_".$i;
           echo
             "<td class=\"vvalue\">".
-            stGetFormRadioButtonInput(
-              "ventry".$eid, "", "", $i, ($i == $val),
-              "",
-              "onClick=\"updateVote(".$eid.",".$i.")\"").
+            "<input type=\"radio\" id=\"".$nid.
+            "\" name=\"ventry".$eid."\" value=\"".$i."\" ".
+            "onClick=\"updateVote(".$eid.",".$i.")\" ".
+            ($val == $i ? "checked=\"checked\" ": "")."/>".
+            "<label for=\"".$nid."\"></label>".
             "</td>";
         }