From: Chris S. <san...@us...> - 2005-07-18 10:53:45
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2466/scripts/install Modified Files: stackInstall.php stackUpdateDatabase.php Log Message: Index: stackUpdateDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackUpdateDatabase.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stackUpdateDatabase.php 18 Jul 2005 10:11:12 -0000 1.1 --- stackUpdateDatabase.php 18 Jul 2005 10:53:37 -0000 1.2 *************** *** 2,79 **** <head><title>Update STACK Database utility</title><head> <body> ! <p><b>This script updates the STACK database with new metadata fields. Please enter your mySQL username and password in the following boxes</b></p> ! <form action="stackUpdateDatabase.php" method="POST"> ! <p>mySQL Username:</p> ! <input type="text" name="userName"> ! <p>mySQL Password:</p> ! <input type="password" name="password"> ! <br><br> ! <input type="submit" value="Update STACK database" name="submit"> ! </form> ! <body><html> <?php /** This PHP script simply adds new fields to mySQL for metadata. This affects both questions and quizzes */ $addQuestionColumnQuery = ' ALTER TABLE stackquestion ! ADD COLUMN questionPublisher tinytext NULL, ! ADD COLUMN type tinytext NULL, ! ADD COLUMN questionFormat tinytext NULL, ! ADD COLUMN questionLanguage tinytext NULL, ! ADD COLUMN questionRights text NULL, ! ADD COLUMN questionLearningContext tinytext NULL, ! ADD COLUMN questionDifficulty tinytext NULL, ! ADD COLUMN questionCompetency tinytext NULL, ! ADD COLUMN questionCompetencyLevel tinytext NULL, ! ADD COLUMN questionTimeAllocated time NULL, ! ADD COLUMN questionExcerciseType tinytext NULL, ! ADD COLUMN questionDateLastEdited datetime NULL, ! DROP COLUMN questionDateLastEdited;'; ! $addQuizColumnQuery = ' ALTER TABLE stackquiz ! ADD COLUMN quizGUID varchar(22) NULL, ! ADD COLUMN quizKeywords tinytext NULL, ! ADD COLUMN quizUserLastEdited int NULL, ! ADD COLUMN quizDateLastEdited datetime NULL, ! ADD COLUMN quizPublisher tinytext NULL, ! ADD COLUMN type tinytext NULL, ! ADD COLUMN quizFormat tinytext NULL, ! ADD COLUMN quizLanguage tinytext NULL, ! ADD COLUMN quizRights text NULL, ! ADD COLUMN quizLearningContext tinytext NULL, ! ADD COLUMN quizDifficulty tinytext NULL, ! ADD COLUMN quizCompetency text NULL, ! ADD COLUMN quizCompetencyLevel text NULL, ! ADD COLUMN quizTimeAllocated time NULL, ! ADD COLUMN quizExcerciseType text NULL;'; ! ! //Global mysql connection settings ! $stack_mysql['host'] = 'localhost'; ! $stack_mysql['user'] = ''; ! $stack_mysql['pswd'] = ''; ! $stack_mysql['stackdb'] = 'stack'; ! ! //Catch a postback event ! if (isset($_POST["submit"])) ! { ! if (!empty($_POST["userName"]) && !empty($_POST["password"])) ! { ! $stack_mysql['user'] = $_POST["userName"]; ! $stack_mysql['pswd'] = $_POST["password"]; ! ! stack_mysqlcmd($addQuestionColumnQuery,$stack_mysql['user'],$error); ! stack_mysqlcmd($addQuizColumnQuery,$stack_mysql['user'],$error); ! ! echo($error); ! ! } ! ! else ! { ! echo("Please ensure you have entered your mySQL username and password!"); ! } ! } /** --- 2,56 ---- <head><title>Update STACK Database utility</title><head> <body> ! <H1>Update STACK Database utility</H1> ! <p><b>This script updates the STACK database with new fields in various tables. </p> <?php + require_once('stackstd.php'); + /** This PHP script simply adds new fields to mySQL for metadata. This affects both questions and quizzes */ $addQuestionColumnQuery = ' ALTER TABLE stackquestion ! ADD COLUMN questionPublisher tinytext NULL, ! ADD COLUMN type tinytext NULL, ! ADD COLUMN questionFormat tinytext NULL, ! ADD COLUMN questionLanguage tinytext NULL, ! ADD COLUMN questionRights text NULL, ! ADD COLUMN questionLearningContext tinytext NULL, ! ADD COLUMN questionDifficulty tinytext NULL, ! ADD COLUMN questionCompetency tinytext NULL, ! ADD COLUMN questionCompetencyLevel tinytext NULL, ! ADD COLUMN questionTimeAllocated time NULL, ! ADD COLUMN questionExcerciseType tinytext NULL, ! ADD COLUMN questionDateLastEdited datetime NULL, ! DROP COLUMN questionDateLastEdited;'; ! $addQuizColumnQuery = ' ALTER TABLE stackquiz ! ADD COLUMN quizGUID varchar(22) NULL, ! ADD COLUMN quizKeywords tinytext NULL, ! ADD COLUMN quizUserLastEdited int NULL, ! ADD COLUMN quizDateLastEdited datetime NULL, ! ADD COLUMN quizPublisher tinytext NULL, ! ADD COLUMN type tinytext NULL, ! ADD COLUMN quizFormat tinytext NULL, ! ADD COLUMN quizLanguage tinytext NULL, ! ADD COLUMN quizRights text NULL, ! ADD COLUMN quizLearningContext tinytext NULL, ! ADD COLUMN quizDifficulty tinytext NULL, ! ADD COLUMN quizCompetency text NULL, ! ADD COLUMN quizCompetencyLevel text NULL, ! ADD COLUMN quizTimeAllocated time NULL, ! ADD COLUMN quizExcerciseType text NULL;'; ! ! $addUserColumnQuery = ' ! ALTER TABLE stackUser ! ADD COLUMN options text NULL;'; ! ! ! stack_mysqlcmd($addQuestionColumnQuery,$stack_mysql['user'],$error); ! stack_mysqlcmd($addQuizColumnQuery,$stack_mysql['user'],$error); ! stack_mysqlcmd($addUserColumnQuery,$stack_mysql['user'],$error); ! /** *************** *** 136,137 **** --- 113,116 ---- } ?> + + </body></html> Index: stackInstall.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackInstall.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** stackInstall.php 14 Jul 2005 18:44:55 -0000 1.12 --- stackInstall.php 18 Jul 2005 10:53:37 -0000 1.13 *************** *** 194,197 **** --- 194,198 ---- `department` varchar(30) default NULL, `address` varchar(70) default NULL, + `options` text default NULL, `firstaccess` int(10) unsigned NOT NULL default '0', `lastaccess` int(10) unsigned NOT NULL default '0', |