# HG changeset patch # User Matti Hamalainen # Date 1380965663 -10800 # Node ID 101cde58b2675290b82ba69f7c0486e698f52bc5 # Parent e85ed35585fcb40ec22f13f2eeabef92d68b6869 Add a new setting for ASCII vs. HTML table output for compo results. diff -r e85ed35585fc -r 101cde58b267 createdb.php --- a/createdb.php Sat Oct 05 12:33:59 2013 +0300 +++ b/createdb.php Sat Oct 05 12:34:23 2013 +0300 @@ -49,12 +49,13 @@ "userTimeout" => array(VT_INT, 120, "User pages (voting, entry submission) timeout in minutes"), "admTimeout" => array(VT_INT, 15, "Administration interface timeout in minutes"), - "showAdmin" => array(VT_BOOL, false, "Show administration interface link on the menu"), + "showAdmin" => array(VT_BOOL, false, "Always show administration interface link on the menu"), "showAttendees" => array(VT_BOOL, false, "Show attendees list"), "allowRegister" => array(VT_BOOL, false, "Enable event registration"), "allowVoting" => array(VT_BOOL, false, "Enable voting (individual compos must be enabled as well)"), "showResults" => array(VT_BOOL, false, "Enable results page"), + "showResultsASCII" => array(VT_BOOL, true, "Show results as ASCII instead of HTML table"), "showResAuthors" => array(VT_BOOL, false, "Show entry authors on results page"), "requireEMail" => array(VT_BOOL, false, "Require e-mail address in registrations"), diff -r e85ed35585fc -r 101cde58b267 results.inc.php --- a/results.inc.php Sat Oct 05 12:33:59 2013 +0300 +++ b/results.inc.php Sat Oct 05 12:34:23 2013 +0300 @@ -1,13 +1,8 @@ $len) @@ -19,6 +14,19 @@ echo "

Results

\n"; + +// Show everything for the admin session +if (stAdmSessionAuth()) +{ + if (!$showResults) + echo "

Results hidden from normal users.

"; + if (!$showAuthors) + echo "

Entry authors hidden from normal users.

"; + + $showResults = $showAuthors = TRUE; +} + + if (!$showResults) { echo "

Sorry, no results available! Nothing to see here, move along.

"; @@ -27,7 +35,7 @@ { if (($res = stExecSQL("SELECT * FROM compos WHERE visible<>0 ORDER BY name DESC")) !== FALSE) { - if ($text) echo "
\n";
+    if ($useASCII) echo "
\n";
     foreach ($res as $compo)
     {
       $sql =
@@ -39,7 +47,7 @@
 
       if (($fres = stExecSQL($sql)) !== FALSE)
       {
-        if ($text)
+        if ($useASCII)
         {
           echo " ".$compo["name"]." \n";
           echo str_repeat("=", strlen($compo["name"]) + 2)."-- - .\n\n";
@@ -95,7 +103,7 @@
         }
       }
     }
-    if ($text) echo "
\n"; + if ($useASCII) echo "
\n"; } } ?> \ No newline at end of file