From 3706394fa93611fc33658e1f6928c3949c713ec1 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Wed, 9 Oct 2024 16:03:33 -0400 Subject: [PATCH 1/2] make conf_file variable instead of using the file path twice --- src/includes/config.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/includes/config.php b/src/includes/config.php index db7919c..ffa7b46 100644 --- a/src/includes/config.php +++ b/src/includes/config.php @@ -15,11 +15,12 @@ function getGlobalOptions() { // Read information + $conf_file = '/var/www/conf/phpgiftreg.conf'; $mysql_conn_string = "mysql:host=localhost;dbname=giftreg"; $mysql_username = "giftreg"; $mysql_password = "cn3Malk"; - if (file_exists('/var/www/conf/phpgiftreg.conf')) { - $ini_file = parse_ini_file('/var/www/conf/phpgiftreg.conf'); + if (file_exists($conf_file)) { + $ini_file = parse_ini_file($conf_file); if (isset($ini_file['mysql_conn_string'])) { $mysql_conn_string = $ini_file['mysql_conn_string']; } From 159059e679f5a17ca6c0c694ab653d0a672c1a79 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Wed, 9 Oct 2024 15:27:03 -0400 Subject: [PATCH 2/2] Add updated columns --- src/sql/create-phpgiftregdb.sql | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sql/create-phpgiftregdb.sql b/src/sql/create-phpgiftregdb.sql index be307de..087b93e 100644 --- a/src/sql/create-phpgiftregdb.sql +++ b/src/sql/create-phpgiftregdb.sql @@ -24,7 +24,7 @@ CREATE TABLE `categories` ( -- Dumping data for table `categories` -- -INSERT INTO `categories` VALUES (1,'Books'); +INSERT INTO `categories` VALUES (1,'Miscellaneous'); INSERT INTO `categories` VALUES (2,'Music'); INSERT INTO `categories` VALUES (3,'Video Games'); INSERT INTO `categories` VALUES (4,'Clothing'); @@ -36,10 +36,11 @@ INSERT INTO `categories` VALUES (9,'Electronics'); INSERT INTO `categories` VALUES (10,'Ornaments/Figurines'); INSERT INTO `categories` VALUES (11,'Automotive'); INSERT INTO `categories` VALUES (12,'Toys'); -INSERT INTO `categories` VALUES (13,'Jewellery'); +INSERT INTO `categories` VALUES (13,'Jewelry'); INSERT INTO `categories` VALUES (14,'Computer'); INSERT INTO `categories` VALUES (15,'Games'); INSERT INTO `categories` VALUES (16,'Tools'); +INSERT INTO `categories` VALUES (17,'Books'); -- -- Table structure for table `events` @@ -67,12 +68,13 @@ INSERT INTO `events` VALUES (1,NULL,'Christmas','2000-12-25',1); CREATE TABLE `items` ( `itemid` int(11) NOT NULL auto_increment, `userid` int(11) NOT NULL default '0', - `description` varchar(255) NOT NULL default '', + `name` varchar(100) NOT NULL default '', + `description` varchar(255) default '', `price` decimal(7,2) default NULL, `source` varchar(255) NOT NULL default '', `ranking` int(11) NOT NULL default '0', `url` varchar(255) default NULL, - `category` int(11) default NULL, + `category` int(11) default '1', `comment` text, `quantity` int(11) NOT NULL default '0', `image_filename` varchar(255) default NULL, @@ -150,6 +152,7 @@ CREATE TABLE `users` ( `admin` tinyint(1) NOT NULL default '0', `comment` text, `email_msgs` tinyint(1) NOT NULL default '0', + `show_helptext` tinyint(1) NOT NULL default '1', `list_stamp` datetime default NULL, `initialfamilyid` int NULL, PRIMARY KEY (`userid`)