# HG changeset patch # User Matti Hamalainen # Date 1386258907 -7200 # Node ID 876846d8ed5b717ccd24d6933719701d848a0720 # Parent b83b9dd20b69630591b3410a67ed2ef1f0d2b33a Rename some database things. diff -r b83b9dd20b69 -r 876846d8ed5b admajax.php --- a/admajax.php Thu Dec 05 17:47:22 2013 +0200 +++ b/admajax.php Thu Dec 05 17:55:07 2013 +0200 @@ -547,9 +547,9 @@ $sql = stPrepareSQL( "SELECT displaySlides.* FROM displaySlides ". - "LEFT JOIN displayListSlides ON displaySlides.id=displayListSlides.slide_id ". - "WHERE displayListSlides.list_id=%d ". - "ORDER BY displayListSlides.order_num DESC", + "LEFT JOIN rotationListSlides ON displaySlides.id=rotationListSlides.slide_id ". + "WHERE rotationListSlides.list_id=%d ". + "ORDER BY rotationListSlides.order_num DESC", $list_id); echo @@ -610,8 +610,8 @@ " ".stGetOptionListStart("ctrlRotationLists"); $sql = - "SELECT displayListData.* FROM displayListData ". - "LEFT JOIN displayListSlides ". + "SELECT rotationListData.* FROM rotationListData ". + "LEFT JOIN rotationListSlides ON ". "ORDER BY id DESC"; if (($res = stExecSQL($sql)) !== false) @@ -623,8 +623,8 @@ echo " ".stGetOptionListEnd(). "
\n". - " ".stGetFormButtonInput("sellist", "", "", "Set Active", "activateRotationList()")."\n". - " ".stGetFormButtonInput("newlist", "", "", "Edit", "newRotationList()")."\n". + " ".stGetFormButtonInput("actlist", "", "", "Set Active", "activateRotationList()")."\n". + " ".stGetFormButtonInput("editlist", "", "", "Edit", "editRotationList()")."\n". " ".stGetFormButtonInput("newlist", "", "", "New", "newRotationList()")."\n". " ".stGetFormButtonInput("dellist", "", "", "Delete", "deleteRotationList()")."\n". "
\n". diff -r b83b9dd20b69 -r 876846d8ed5b admin.php --- a/admin.php Thu Dec 05 17:47:22 2013 +0200 +++ b/admin.php Thu Dec 05 17:55:07 2013 +0200 @@ -536,6 +536,7 @@ } + function cancelEditDisplaySlide() { var nitem = document.getElementById("ctrlEditDisplaySlide"); @@ -550,6 +551,7 @@ } + function addRotationListSlide() { } @@ -568,6 +570,8 @@ } + + function updateTabList(tabset, extra) { var tabs = ""; diff -r b83b9dd20b69 -r 876846d8ed5b createdb.php --- a/createdb.php Thu Dec 05 17:47:22 2013 +0200 +++ b/createdb.php Thu Dec 05 17:55:07 2013 +0200 @@ -11,7 +11,7 @@ die(); } -$dbVersion = 8; +$dbVersion = 9; $dbMeta = array( "dbVersion" => array(VT_INT, $dbVersion, "Database version"), @@ -179,8 +179,8 @@ "displayVars" => "key VARCHAR(32) PRIMARY KEY, vtype INT, vstr VARCHAR(128), vtext TEXT, vint INT, desc VARCHAR(128)", "displaySlides" => "id INTEGER PRIMARY KEY AUTOINCREMENT, title VARCHAR(128), text VARCHAR(4096)", - "displayListData" => "id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(128)", - "displayListSlides" => "id INTEGER PRIMARY KEY AUTOINCREMENT, list_id INT DEFAULT 0, slide_id INT DEFAULT 0, order_num INT DEFAULT 0", + "rotationListData" => "id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(128)", + "rotationListSlides" => "id INTEGER PRIMARY KEY AUTOINCREMENT, list_id INT DEFAULT 0, slide_id INT DEFAULT 0, order_num INT DEFAULT 0", ); $siteDisplayVars = array( @@ -258,14 +258,14 @@ array("Gentle Eye mainos", "Buy Amiga stuff!
Gentle Eye Oy is selling Amiga-related stuff near organizer desk!"), ), - "displayListData" => array( + "rotationListData" => array( "name", "%s", array("Main rotation"), array("Next Up"), ), - "displayListSlides" => array( + "rotationListSlides" => array( "list_id,slide_id", "%d,%d", array(1,2), @@ -535,11 +535,12 @@ if ($currVersion < 6) stExecSQL("DROP TABLE votes"); - if ($currVersion < 7) + if ($currVersion < 9) + { + stExecSQL("DROP TABLE displayVars"); stExecSQL("DROP TABLE displayListSlides"); - - if ($currVersion < 8) - stExecSQL("DROP TABLE displayVars"); + stExecSQL("DROP TABLE displayListSlides"); + } // Create tables if (!stCreateTables(TRUE)) diff -r b83b9dd20b69 -r 876846d8ed5b showajax.php --- a/showajax.php Thu Dec 05 17:47:22 2013 +0200 +++ b/showajax.php Thu Dec 05 17:55:07 2013 +0200 @@ -130,7 +130,7 @@ // Get list of slides from active rotation list $list = stGetDisplayVar("rotateList"); $sql = stPrepareSQL( - "SELECT * FROM displayListSlides WHERE list_id=%d ORDER BY order_num", + "SELECT * FROM rotationListSlides WHERE list_id=%d ORDER BY order_num", $list); if (($slideList = stExecSQL($sql)) !== false)