# HG changeset patch # User Matti Hamalainen # Date 1607860033 -7200 # Node ID b2bca5f6d0ffb3cd3f56ac2c561f0550d392cba3 # Parent a4daa7ea74790c882bd07a1a97697c878197be4d Cosmetic cleanup: remove trailing whitespace. diff -r a4daa7ea7479 -r b2bca5f6d0ff admajax.js.php --- a/admajax.js.php Mon Oct 14 10:54:32 2019 +0300 +++ b/admajax.js.php Sun Dec 13 13:47:13 2020 +0200 @@ -229,12 +229,12 @@ jsSendPOSTRequest("action=delete&type="+type+"&id="+id, msuccess); item.className = tmp; } - + var mcb_cancel = function (data) { item.className = tmp; } - + if (dsc) jsConfirmBox("Are you sure you want to delete "+dsc+" #"+id+"?", mcb_ok, mcb_cancel, 0); else @@ -486,7 +486,7 @@ function deleteCompo(id) { - jsDeleteItem(id, "compo", "compo", function () { refreshDispatchCC("Compos"); }, 0, + jsDeleteItem(id, "compo", "compo", function () { refreshDispatchCC("Compos"); }, 0, "Are you ABSOLUTELY sure you want to delete compo #"+id+"? "+ "This will delete all votes AND entries related to it!"); } @@ -675,7 +675,7 @@ { userKeyRefresh(id); } - + if (lastPostArgs["active"] == 0) jsConfirmBox("Are you sure you want to deactivate vote key #"+id+"?", mcb_ok, mcb_cancel, 0); else @@ -691,7 +691,7 @@ { userKeyUpdate(id, (mode ? "assign" : "clear"), args); } - + if (mode == 0) jsConfirmBox("Are you sure you want to clear vote key assign #"+id+"?", mcb_ok, 0, 0); else @@ -730,7 +730,7 @@ else jsSendPOSTRequest("action=randomize&type=compo&id="+id+"&patch="+patch, msuccess); } - + if (patch == 0) { jsConfirmBox("Are you ABSOLUTELY CERTAIN you want to delete and regenerate entry show positions "+ diff -r a4daa7ea7479 -r b2bca5f6d0ff admajax.php --- a/admajax.php Mon Oct 14 10:54:32 2019 +0300 +++ b/admajax.php Sun Dec 13 13:47:13 2020 +0200 @@ -95,7 +95,7 @@ array(CHK_RANGE, VT_INT, array(EPREV_NONE, EPREV_AUDIO), "Invalid preview type value.")); } break; - + case COMPO_POINTS: stChkRequestItemFail("evalue", $fake, $res, array(CHK_TYPE, VT_INT, "Invalid points value, must be a valid integer.")); @@ -139,7 +139,7 @@ switch ($item["ctype"]) { case COMPO_NORMAL: - $str1 = + $str1 = " File path: ".stGetFormTextInput(40, SQL_LEN_COMPO_PATH, "cpath", $id, $prefix, $item["cpath"])."
\n"; $str2 = @@ -261,7 +261,7 @@ echo "
".($item["show_id"] > 0 ? $item["show_id"] : "-")."
\n"; } - + switch ($compo["ctype"]) { case COMPO_NORMAL: @@ -324,10 +324,10 @@ stGetFormOptionListEnd(" ", TRUE). "\n"; } - + echo "\n"; break; - + case COMPO_POINTS: case COMPO_ASSIGN: echo @@ -366,7 +366,7 @@ stGetFormButtonInput("update", $eid, $prefix, "Update", "updateEntry(".$item["compo_id"].",".$eid.", 0)"). stGetFormButtonInput("delete", $eid, $prefix, "Delete", "deleteEntry(".$item["compo_id"].",".$eid.")"); break; - + case EEMODE_ADD: echo stGetFormButtonInput("add", $item["compo_id"], $prefix, "Add new", "addEntry(".$item["compo_id"].")"); @@ -383,7 +383,7 @@ function stGetUserKeyClass($item) { global $setUserKeyMode; - + switch ($setUserKeyMode) { case VOTE_FREELY: @@ -409,7 +409,7 @@ { $nkeys = stFetchSQLColumn("SELECT COUNT(*) FROM userkeys WHERE active=1"); $totalKeys = stFetchSQLColumn("SELECT COUNT(*) FROM userkeys"); - + $nvoters = stFetchSQLColumn("SELECT COUNT(DISTINCT(key_id)) FROM votes"); return @@ -438,7 +438,7 @@ $str .= stGetFormCheckBoxInput("active", $id, $prefix, $item["active"], FALSE, "class=\"keyactive\" onChange=\"userKeySetActive(".$id.")\"", ""); } - + return $str; case VOTE_ASSIGN: @@ -451,7 +451,7 @@ if ($item["key_id"] != 0) $str .= stGetFormButtonInput("clear", $id, $prefix, "Clear", "userKeyAssign(".$id.",0)"); - + $str .= "\n". " "; @@ -556,7 +556,7 @@ substr($item["author"], 0, 15))); } } - + return $str.stGetFormOptionListEnd($indent, $outer); } @@ -606,7 +606,7 @@ $sql = stPrepareSQL("SELECT * FROM rot_list_data WHERE id=%d", $list_id); if (($data = stFetchSQL($sql)) === FALSE) return "

No such rotation list ID #".intval($list_id)."

"; - + $str = ($outer ? $indent."
\n" : ""). $indent."
Edit rotation list
\n". @@ -666,7 +666,7 @@ { $sql = stPrepareSQL("SELECT * FROM rot_list_data WHERE id=%d", stGetDisplayVar("rotateList")); - + $str = $indent.($outer ? "
" : ""). "Active list: "; @@ -703,7 +703,7 @@ "
\n". " \n". ($outer ? "
\n" : ""); - + return $str; } @@ -859,7 +859,7 @@ echo "

Competitions / voting

\n". "\n"; - + break; case "ctrl": @@ -1165,7 +1165,7 @@ { $sql = stPrepareSQL("DELETE FROM rot_list_slides WHERE list_id=%d AND slide_id=%d AND order_num=%d", $list_id, $slide_id, $order_num); - + if (stExecSQLCond($sql, "List slide refs deleted.")) { stNormalizeListSlideOrder($list_id); @@ -1190,11 +1190,11 @@ case "infoCurrEntryList": echo stGetInfoCurrEntryList("", FALSE); break; - + case "infoRotationLists": echo stGetInfoRotationLists("", FALSE); break; - + case "infoDisplaySlides": echo stGetInfoDisplaySlides("", FALSE); break; @@ -1474,7 +1474,7 @@ "
". "User key length ".stGetSetting("userKeyLength")." ". "Voting mode: "; - + if (isset($voteModeData[$setUserKeyMode])) echo $voteModeData[$setUserKeyMode][0].". ".$voteModeData[$setUserKeyMode][1]; else @@ -1627,7 +1627,7 @@ echo "\n"; } break; - + case "compolist": $index = 0; foreach (stExecSQL("SELECT * FROM compos") as $compo) @@ -1891,12 +1891,12 @@ "cpath" => "S", ); break; - + default: $cdata = array(); break; } - + $sql = stPrepareSQLUpdate("compos", "WHERE id=".$id, array_merge(array( @@ -1982,7 +1982,7 @@ $sql = stPrepareSQL("UPDATE attendees SET key_id=NULL WHERE id=%d", $id); stExecSQLCond($sql, "Assigned key cleared."); break; - + case "active": // Autobots activate! $sql = stPrepareSQL("UPDATE userkeys SET active=%B WHERE id=%d", "active", $id); diff -r a4daa7ea7479 -r b2bca5f6d0ff dbdefs.inc.php --- a/dbdefs.inc.php Mon Oct 14 10:54:32 2019 +0300 +++ b/dbdefs.inc.php Sun Dec 13 13:47:13 2020 +0200 @@ -82,7 +82,7 @@

The FAPper's news outlet

", "News page header blob"], ], - + // // Event / schedule information // @@ -118,13 +118,13 @@ ", "Event general description / timetables etc."], ], - + // // Competitions // "compos" => [ "showCompos" => [VT_BOOL, TRUE, "Enable Compos link on main menu + Compos page"], - + "msgCompoDescription" => [VT_TEXT, "

General

@@ -187,7 +187,7 @@ ["notes" , "VARCHAR(".SQL_LEN_COMPO_NOTES.")"], ["visible" , "INT", "DEFAULT 0"], ["voting" , "INT", "DEFAULT 0"], - + // Default preview type (see EFILE_* in msite.inc.php) for this compo. // Global for the compo (entry-specific overrides if it is != EFILE_NONE) ["preview_type" , "INT", "DEFAULT 0"], @@ -195,11 +195,11 @@ ["show_authors" , "INT", "DEFAULT 0"], // Show author(s) on compo main screen/voting page for COMPO_NORMAL compos // For COMPO_POINTS and COMPO_ASSIGN, show on results page or not - + ["ctype" , "INT", "DEFAULT 0"], ["cpath" , "VARCHAR(".SQL_LEN_COMPO_PATH.")"], ], - + "entries" => [ ["id" , "INTEGER", "PRIMARY KEY", "AUTOINCREMENT"], ["show_id" , "INT", "DEFAULT 0"], @@ -278,7 +278,7 @@ ["id" , "INTEGER", "PRIMARY KEY", "AUTOINCREMENT"], ["name" , "VARCHAR(".SQL_LEN_ROT_LIST_NAME.")"], ], - + "rot_list_slides" => [ ["id" , "INTEGER", "PRIMARY KEY", "AUTOINCREMENT"], ["list_id" , "INT", "DEFAULT 0"], @@ -301,7 +301,7 @@ "compoID" => [VT_INT, 0, "Compo ID of current compo"], "compoPrevEntry" => [VT_INT, 0, "Previously shown compo entry"], "compoCurrEntry" => [VT_INT, 0, "Current / next compo entry to be shown"], - + // Not user-manageable "tempSlideSet" => [VT_BOOL, FALSE, "Temporary slide set"], @@ -354,7 +354,7 @@ ["Protracker music", "Standard 4-channel Protracker MOD music."], ["4k intro", "4k intro competition"], ], - + "entries" => [ "name,author,compo_id,filename,info", "%s,%s,%d,%s,%s", @@ -364,7 +364,7 @@ ["jenkka", "aegis", 2, "jenkka.mod", ""], ["Fungiform 2", "mfx", 3, "mfx-fungiform2.lzh", "OCS-only"], ], - + "display_slides" => [ "title,text", "%s,%s", @@ -372,14 +372,14 @@ ["Astu to infodesk", "Astu - please come to info desk!"], ["Gentle Eye mainos", "Buy Amiga stuff!
Gentle Eye Oy is selling Amiga-related stuff near organizer desk!"], ], - + "rot_list_data" => [ "name", "%s", ["Main rotation"], ["Next Up"], ], - + "rot_list_slides" => [ "list_id,slide_id", "%d,%d", @@ -399,11 +399,11 @@ "rot_list_data" => ["table" => "rotationListData"], "rot_list_slides" => ["table" => "rotationListSlides"], ], - + 14 => [ "settings_groups" => ["table" => FALSE], ], - + 17 => [ "ctype" => ["key" => "type"], "cpath" => ["key" => "path"], @@ -416,5 +416,4 @@ ], ]; - ?> \ No newline at end of file diff -r a4daa7ea7479 -r b2bca5f6d0ff faptool.php --- a/faptool.php Mon Oct 14 10:54:32 2019 +0300 +++ b/faptool.php Sun Dec 13 13:47:13 2020 +0200 @@ -70,7 +70,7 @@ if ($outDim !== FALSE) { - // Get dimensions, setup background + // Get dimensions, setup background $dim = $img->getImageGeometry(); // $img->setBackgroundColor(imagick::COLOR_BLACK); $img->setGravity(imagick::GRAVITY_CENTER); @@ -172,7 +172,7 @@ $res = wtConvertSample($inFilename, $outFilename, array("-f" => "wav")); break; - + case EFILE_IMAGE: $res = wtConvertImage( $inFilename, @@ -341,7 +341,7 @@ // Single file $found = wtEntryToSource($compo, $filename, $edata, $filename, $pdata, $outFilename, $force); } - + if (!$found) { echo "WARNING: Could not generate preview from entry ".wtNiceName($compo, $entry, $efile)."\n"; @@ -369,7 +369,7 @@ if ($valid) return TRUE; } - + // // Either we now have a "user specified" source file or // a generated source file - in any case, now convert it @@ -890,11 +890,11 @@ wtPrintDivider(); } break; - + case "cra": echo "Not implemented. :D\n"; break; - + default: die("ERROR! Invalid entry sub-command '".stCArg(2)."'.\n"); break; @@ -944,7 +944,7 @@ { // Create new one wtMakeDir($setPrefix, 0755); - + // Create results.txt if it does not exist $resultsFile = stMakePath(FALSE, TRUE, array($setPrefix, "results.txt")); if (!file_exists($resultsFile)) @@ -964,7 +964,7 @@ $resultsText.stGetCompoResultsASCIIStr(FALSE, 0) ); } - + foreach (stExecSQL("SELECT * FROM compos WHERE cpath <> '' AND cpath IS NOT NULL") as $compo) foreach (stExecSQL("SELECT * FROM entries WHERE compo_id=".$compo["id"]) as $entry) { @@ -1045,7 +1045,7 @@ /* Dummy { - + } */ ?> \ No newline at end of file diff -r a4daa7ea7479 -r b2bca5f6d0ff managedb.php --- a/managedb.php Mon Oct 14 10:54:32 2019 +0300 +++ b/managedb.php Sun Dec 13 13:47:13 2020 +0200 @@ -144,7 +144,7 @@ } return $status; -} +} function stAddSettingsGroup($inDB, $outDB, $groups, $groupData, $groupTable, $table, $upgrade) @@ -157,7 +157,7 @@ echo "Group data not set for settings group ID '".$groupID."'.\n"; return FALSE; } - + // Add group, if needed echo " - Group '".$groupID."' -> ".$groupData[$groupID][1]."."; $sql = stDBPrepareSQL($outDB, @@ -169,7 +169,7 @@ echo "\nFailed to add group '".$groupID."'\n"; return FALSE; } - + // Add settings to the group stDBBeginTransaction($outDB); if (stDoAddSettings($inDB, $outDB, $settings, $table, $upgrade, $gid) === FALSE) @@ -260,7 +260,7 @@ $status = TRUE; $dbName = $outDB->getAttribute(PDO::ATTR_DRIVER_NAME); stDBBeginTransaction($outDB); - + foreach ($sqlTables as $table => $schema) { // Do not migrate excluded tables (or excluded tables with old names) @@ -282,7 +282,7 @@ // Convert to new schema, as needed $avals = array(); $acols = array(); - + foreach ($schema as $col) { // If input has schema column, add it to output @@ -393,7 +393,7 @@ echo "Invalid table definition '".$table."', table name must be lower case.\n"; $errors = TRUE; } - + foreach ($data as $def) if (strtolower($def[0]) != $def[0]) { @@ -432,7 +432,7 @@ stAddSettingsGroup($inDB, $inDB, $siteDefaultSettings, $siteSettingsGroups, "settings_groups", "settings", FALSE); stAddSettingsNormal($inDB, $inDB, $siteDisplayVars, "display_vars", FALSE, FALSE); } - + if ($addTestData) stAddTestData($inDB); @@ -479,7 +479,7 @@ echo "Using OUTPUT database spec '".$outSpec."'.\n"; // Possibly bail out incompatible upgrades here - + // Create tables if (!stCreateTables($outDB, TRUE)) exit; @@ -496,7 +496,7 @@ // Migrate other tables if (!stMigrateTables($inDB, $outDB, $upgrade, array("settings", "display_vars", "dbmeta", "settings_groups"))) exit; - + // Set new database version echo "Setting dbVersion.\n"; stSetDBMeta($outDB, "dbVersion", $dbVersion); diff -r a4daa7ea7479 -r b2bca5f6d0ff msession.inc.php --- a/msession.inc.php Mon Oct 14 10:54:32 2019 +0300 +++ b/msession.inc.php Sun Dec 13 13:47:13 2020 +0200 @@ -13,7 +13,7 @@ { // Use cookies to store the session ID on the client side @ini_set("session.use_only_cookies", 1); - + // Disable transparent Session ID support @ini_set("session.use_trans_sid", 0); } @@ -40,7 +40,7 @@ global $sessionType; if (!isset($sessionType)) die("Session type not set."); - + $_SESSION[$sessionType][$name] = $value; } diff -r a4daa7ea7479 -r b2bca5f6d0ff msite.inc.php --- a/msite.inc.php Mon Oct 14 10:54:32 2019 +0300 +++ b/msite.inc.php Sun Dec 13 13:47:13 2020 +0200 @@ -419,7 +419,7 @@ else echo ""; } - + if ($tr) echo "\n"; } @@ -536,7 +536,7 @@ if (($tmp = stGetSetting("userKeyCase", NULL)) !== NULL) $keyChars = strtoupper($keyChars); - + while (TRUE) { // Generate one randomized keycode @@ -706,7 +706,7 @@ break; } - $extra = + $extra = "GROUP BY entries.id ". "ORDER BY votesum DESC"; break; @@ -775,7 +775,7 @@ } } } - + return $out; } @@ -976,7 +976,7 @@ stGetSetting("previewThumbType"), stGetSetting("thumbnailSubDir")); break; - + case EFILE_AUDIO: foreach (stGetSetting("sampleTypes") as $type => $fdata) { @@ -1185,13 +1185,13 @@ return stFileError($userID, "Path '".$dstPath."' for compo ID #".$entry["compo_id"]." does not exist.", "The directory for entry's compo does not exist!"); - + $dstPerms = fileperms($dstPath); if (($dstPerms & 0x4000) === 0) return stFileError($userID, "Path for entry's compo '".$dstPath."' is not a directory.", "Path for entry's compo is not a directory?"); - + $needPerms = 0x0100 | 0x0080 | 0x0040; if (($dstPerms & $needPerms) !== $needPerms) return stFileError($userID, @@ -1267,7 +1267,7 @@ if ($uploadType == "preview" && !isset($fileInfo["type"])) return stError("Preview file upload is not one of the supported preview file types."); - + // Get original extension if (($fileExt = $fileInfo["fext"]) === FALSE) { @@ -1311,7 +1311,7 @@ "INSERT INTO entries (name,author,compo_id,info,notes,preview_type,utime,owner_id) VALUES (%S,%S,%d,%Q,%Q,%D,%d,%d)", "name", "author", $compo["id"], "info", "notes", "preview_type", time(), $uid); break; - + case COMPO_POINTS: case COMPO_ASSIGN: $sql = stPrepareSQL( @@ -1333,7 +1333,7 @@ // Delete votes for the entry $sql = stPrepareSQL("DELETE FROM votes WHERE entry_id=%d", $id); stExecSQLCond($sql, "OK, entry ".$id." votes deleted."); - + // Mark related files to be deleted $sql = stPrepareSQL("UPDATE files SET deleted=%d WHERE entry_id=%d", 1, $id); stExecSQLCond($sql, "OK, entry ".$id." files marked."); diff -r a4daa7ea7479 -r b2bca5f6d0ff pages/register.inc.php --- a/pages/register.inc.php Mon Oct 14 10:54:32 2019 +0300 +++ b/pages/register.inc.php Sun Dec 13 13:47:13 2020 +0200 @@ -13,7 +13,7 @@ $registerFormFields = [ - "name" => "Name", + "name" => "Name", "groups" => "Group(s)", "email" => "E-mail", "oneliner" => "Oneliner", @@ -66,7 +66,7 @@ foreach ($errorMsgs as $msg) echo "

  • ".$msg."
  • \n"; - + echo "\n"; stPrintFormData("Go back", "start", array("botcheck")); } @@ -116,7 +116,7 @@ { global $botCheckOPs, $botCheckROPs; $out = ""; - + foreach (splitHash($hash) as $val) { $i = strpos($botCheckOPs, $val); @@ -229,7 +229,7 @@ "

    Verify your information

    \n". "

    Is the following information correct?

    \n". "\n"; - + foreach ($registerFormFields as $name => $title) { if ($title !== FALSE) diff -r a4daa7ea7479 -r b2bca5f6d0ff pages/results.inc.php --- a/pages/results.inc.php Mon Oct 14 10:54:32 2019 +0300 +++ b/pages/results.inc.php Sun Dec 13 13:47:13 2020 +0200 @@ -24,5 +24,5 @@ { echo "

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

    "; } - + ?> \ No newline at end of file diff -r a4daa7ea7479 -r b2bca5f6d0ff pages/vote.inc.php --- a/pages/vote.inc.php Mon Oct 14 10:54:32 2019 +0300 +++ b/pages/vote.inc.php Sun Dec 13 13:47:13 2020 +0200 @@ -58,7 +58,7 @@ "The userkey is not yet activated, try again later. If ". "you are certain that it should be working now, go pester an organizer."; break; - + default: echo "Undefined error occured."; @@ -197,4 +197,4 @@ stSessionEnd(SESS_USER); } -?> \ No newline at end of file +?> \ No newline at end of file diff -r a4daa7ea7479 -r b2bca5f6d0ff print.php --- a/print.php Mon Oct 14 10:54:32 2019 +0300 +++ b/print.php Sun Dec 13 13:47:13 2020 +0200 @@ -20,7 +20,7 @@ stSetupCacheControl(); stSessionEnd(SESS_ADMIN); stSetStatus(404, "Not Found"); - + cmPrintPageHeader("Error"); echo "

    Permission denied

    \n". diff -r a4daa7ea7479 -r b2bca5f6d0ff showajax.js.php --- a/showajax.js.php Mon Oct 14 10:54:32 2019 +0300 +++ b/showajax.js.php Sun Dec 13 13:47:13 2020 +0200 @@ -92,7 +92,7 @@ setTickUpdate(500); } } - + var mfail = function(txt) { displayError(); diff -r a4daa7ea7479 -r b2bca5f6d0ff showajax.php --- a/showajax.php Mon Oct 14 10:54:32 2019 +0300 +++ b/showajax.php Sun Dec 13 13:47:13 2020 +0200 @@ -11,8 +11,8 @@ function stPrintCompoEntry($entry, $class, $compo, $title = FALSE) { echo - "
    \n"; - + "
    \n"; + if ($title !== FALSE) echo "
    ".$title."
    \n"; @@ -46,10 +46,10 @@ if ($entry === FALSE && $prev === FALSE) echo "
    ... Is about to start ...
    "; - + if ($entry !== FALSE) stPrintCompoEntry($entry, "compoNext", $compo, FALSE); - + if ($prev !== FALSE) stPrintCompoEntry($prev, "compoPrev", $compo, "Previous entry"); } @@ -119,7 +119,7 @@ // Rotation / normal slide show mode // stSetDisplayVar("activeSlideMode", SMODE_ROTATE); - + if (stGetDisplayVar("rotateList") == 0) { stSetDisplayVar("rotateList", 1); @@ -142,7 +142,7 @@ $slides = array(); foreach ($slideList as $slide) $slides[] = $slide; - + $index = stGetDisplayVar("rotateListIndex"); if (count($slides) > $index) { @@ -158,12 +158,12 @@ // Rotate to next slide if (++$index >= count($slides)) $index = 0; - + stSetDisplayVar("rotateListIndex", $index); } } break; - + case SMODE_COMPO: // // Competition mode, is controlled from admin UI, so we donẗ @@ -232,7 +232,7 @@ else stGuruMeditation(); break; - + case SMODE_COMPO: // Competition mode, show entry data $compo_id = stGetDisplayVar("compoID"); @@ -259,7 +259,7 @@ break; } break; - + default: stGuruMeditation(); break;