Mercurial > hg > fapweb
changeset 416:876846d8ed5b
Rename some database things.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Dec 2013 17:55:07 +0200 |
parents | b83b9dd20b69 |
children | d2ece5d0aaa4 |
files | admajax.php admin.php createdb.php showajax.php |
diffstat | 4 files changed, 22 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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(). " <div class=\"ctrlButtons\">\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". " </div>\n".
--- 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 = "";
--- 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", "<b>Buy Amiga stuff!</b><br />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))
--- 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)