From: <dts...@us...> - 2003-05-27 16:47:58
|
Update of /cvsroot/phpwebsite-comm/modules/contacts/boost In directory sc8-pr-cvs1:/tmp/cvs-serv19977 Added Files: install.php install.sql uninstall.php uninstall.sql Log Message: Initial check-in --- NEW FILE: install.php --- <?php /** * @version $Id: install.php,v 1.1 2003/05/27 16:47:49 dtseiler Exp $ * @author Don Seiler <do...@NO...> */ if(!$_SESSION["OBJ_user"]->isDeity()) { header("location:index.php"); exit(); } if($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/contacts/boost/install.sql", TRUE)) { $content .= "All Contacts tables successfully written.<br />"; if(isset($_SESSION["OBJ_search"])) { $search["module"] = "contacts"; $search["search_class"] = "CONTACTS_Manager"; $search["search_function"] = "searchMessages"; $search["search_cols"] = "none"; $search["view_string"] = "none"; $search["show_block"] = 0; if(!$GLOBALS["core"]->sqlInsert($search, "mod_search_register")) $content .= "Database problem when attempting to register with Search module.<br />"; else $content .= "Successfully registered with Search module!<br />"; } } else { $content .= "There was a problem writing to the database!<br />"; } ?> --- NEW FILE: install.sql --- -- $Id: install.sql,v 1.1 2003/05/27 16:47:49 dtseiler Exp $ CREATE TABLE mod_contacts_contacts ( id int NOT NULL default '0', owner varchar(20) default '', editor varchar(20) default '', ip text, label text NOT NULL, groups text, created int NOT NULL default '0', updated int NOT NULL default '0', hidden smallint NOT NULL default '0', approved smallint NOT NULL default '1', givenname varchar(20) NOT NULL, middlename varchar(20) NOT NULL, familyname varchar(40) NOT NULL, prefix varchar(5), suffix varchar(5), email varchar(80), birthday int NOT NULL default '0', PRIMARY KEY (id) ); CREATE TABLE mod_contacts_countries ( id int NOT NULL default '0', owner varchar(20) default '', editor varchar(20) default '', ip text, label text NOT NULL, groups text, created int NOT NULL default '0', updated int NOT NULL default '0', hidden smallint NOT NULL default '0', approved smallint NOT NULL default '1', code varchar(5) NOT NULL, country varchar(80) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE mod_contacts_addresstypes ( id int NOT NULL default '0', owner varchar(20) default '', editor varchar(20) default '', ip text, label text NOT NULL, groups text, created int NOT NULL default '0', updated int NOT NULL default '0', hidden smallint NOT NULL default '0', approved smallint NOT NULL default '1', name varchar(20) NOT NULL, abbreviation varchar(10) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE mod_contacts_addresses ( id int NOT NULL default '0', owner varchar(20) default '', editor varchar(20) default '', ip text, label text NOT NULL, groups text, created int NOT NULL default '0', updated int NOT NULL default '0', hidden smallint NOT NULL default '0', approved smallint NOT NULL default '1', type_id int NOT NULL default '0', street1 varchar(30) NOT NULL default '', street2 varchar(30) default '', city varchar(50) NOT NULL default '', stateprov varchar(20) NOT NULL default '', postalcode varchar(10) default '', countrycode varchar(5) NOT NULL default '', PRIMARY KEY (id) ); CREATE TABLE mod_contacts_phonetypes ( id int NOT NULL default '0', owner varchar(20) default '', editor varchar(20) default '', ip text, label text NOT NULL, groups text, created int NOT NULL default '0', updated int NOT NULL default '0', hidden smallint NOT NULL default '0', approved smallint NOT NULL default '1', name varchar(20) NOT NULL, abbreviation varchar(10) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE mod_contacts_phones ( id int NOT NULL default '0', owner varchar(20) default '', editor varchar(20) default '', ip text, label text NOT NULL, groups text, created int NOT NULL default '0', updated int NOT NULL default '0', hidden smallint NOT NULL default '0', approved smallint NOT NULL default '1', type_id int NOT NULL default '0', phonenumber varchar(50) NOT NULL, PRIMARY KEY (id) ); --- NEW FILE: uninstall.php --- <?php /** * @version $Id: uninstall.php,v 1.1 2003/05/27 16:47:49 dtseiler Exp $ * @author Don Seiler <do...@NO...> */ if(!$_SESSION["OBJ_user"]->isDeity()) { header("location:index.php"); exit(); } if($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/contacts/boost/uninstall.sql", 1, 1)) { $content .= "All Contacts tables successfully removed!<br />"; if(isset($_SESSION["OBJ_search"])) $status = $GLOBALS["core"]->sqlDelete("mod_search_register", "module", "contacts"); } else { $content .= "There was a problem writing to the database.<br />"; $status = 0; } ?> --- NEW FILE: uninstall.sql --- -- $Id: uninstall.sql,v 1.1 2003/05/27 16:47:49 dtseiler Exp $ DROP TABLE mod_contacts_contacts; DROP TABLE mod_contacts_countries; DROP TABLE mod_contacts_phonetypes; DROP TABLE mod_contacts_addresstypes; DROP TABLE mod_contacts_phones; DROP TABLE mod_contacts_addresses; |