From: laury Date: Tue, 24 May 2016 18:59:38 +0000 (-0400) Subject: Database updates, packages link, list view file updates X-Git-Tag: v2.0.0^2~8^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=59498c07b7dbd804509b30036c56b6b6db443c15;p=WP-Plugins%2Fglm-member-db.git Database updates, packages link, list view file updates --- diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index b3adbe9d..508846b3 100644 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -263,6 +263,22 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), + // Front-end Listings - Show Search Alpha + 'list_floating_search' => array( + 'field' => 'list_floating_search', + 'type' => 'checkbox', + 'default' => false, + 'use' => 'a' + ), + + // Front-end Listings - Show Search Alpha + 'list_floating_search_distance_top' => array( + 'field' => 'list_floating_search_distance_top', + 'type' => 'integer', + 'default' => 0, + 'use' => 'a' + ), + /* * Front-end Member Listing Options */ @@ -409,6 +425,22 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), + // Front-end Listings - Show Packages + 'list_show_packages' => array( + 'field' => 'list_show_packages', + 'type' => 'checkbox', + 'default' => false, + 'use' => 'a' + ), + + // Front-end Listings - Show Link to Packages + 'list_show_packages_link' => array( + 'field' => 'list_show_packages_link', + 'type' => 'checkbox', + 'default' => false, + 'use' => 'a' + ), + /* * Front-end Member Listing Map Options */ diff --git a/css/admin.css b/css/admin.css index 26a9a767..3682d560 100644 --- a/css/admin.css +++ b/css/admin.css @@ -90,6 +90,11 @@ .glm-form-text-input { width: 90%; } +.glm-form-numeric-input { + padding-right: 6px; + width: 3.5em; + text-align: right; +} .glm-form-text-input-veryshort { width: 6em; } diff --git a/css/front.css b/css/front.css index 17b4f4ea..ccd24708 100644 --- a/css/front.css +++ b/css/front.css @@ -68,8 +68,7 @@ .glm-member-list-data { padding: 15px 20px; } -.glm-member-db-list-view, -.glm-member-db-list-grid-view { +.glm-member-db-list { position: relative; } .glm-member-list-inner-wrapper { @@ -82,7 +81,7 @@ .glm-member-list-image-border img { float: right; } -.glm-member-db-list-grid-view .glm-member-title { +.glm-member-db-list.glm-member-db-grid-view .glm-member-title { font-size: 24px; font-weight: normal; text-decoration: none; @@ -90,12 +89,12 @@ line-height: 1.2; padding: 15px; } -.glm-member-db-list-view .glm-member-title { +.glm-member-db-list.glm-member-db-list-view .glm-member-title { text-transform: none; line-height: 1.2; margin: 0; } -.glm-member-db-list-grid-view .glm-member-db-border-wrap { +.glm-member-db-list .glm-member-db-border-wrap { border-radius: 4px; } .glm-member-list-social { @@ -110,49 +109,37 @@ margin: 0; border-radius: 4px; } -.glm-member-db-list-grid-view.map-closed #glm-member-list-map-toggle:before { +.glm-member-db-list.map-closed #glm-member-list-map-toggle:before { content: "View "; } -.glm-member-db-list-view.map-closed #glm-member-list-map-toggle:before { - content: "View "; -} -.glm-member-db-list-grid-view.map-opened #glm-member-list-map-toggle:before { - content: "Hide "; -} -.glm-member-db-list-view.map-opened #glm-member-list-map-toggle:before { +.glm-member-db-list.map-opened #glm-member-list-map-toggle:before { content: "Hide "; } -.glm-member-db-list-view #glm-locationMap-container, -.glm-member-db-list-grid-view #glm-locationMap-container { +.glm-member-db-list #glm-locationMap-container { transition: all 0.5s; -/* padding: 0 0 0 2%;*/ + float: right; margin-top: 30px; } @media (min-width: 1024px) { - .glm-member-db-list-view #glm-locationMap-container, - .glm-member-db-list-grid-view #glm-locationMap-container { + .glm-member-db-list #glm-locationMap-container { float: right; } } -.glm-member-db-list-view.filters-closed #glm-locationMap-container, -.glm-member-db-list-grid-view.filters-closed #glm-locationMap-container { +.glm-member-db-list.filters-closed #glm-locationMap-container { transition: all 0.4s; width: 100%; float: right; margin-top: 30px; } @media (min-width: 1024px) { - .glm-member-db-list-view.filters-closed #glm-locationMap-container, - .glm-member-db-list-grid-view.filters-closed #glm-locationMap-container { + .glm-member-db-list.filters-closed #glm-locationMap-container { margin-top: 30px; } - .glm-member-db-list-view.filters-opened #glm-locationMap-container, - .glm-member-db-list-grid-view.filters-opened #glm-locationMap-container { + .glm-member-db-list.filters-opened #glm-locationMap-container { width: 70%; } } -.glm-member-db-list-view #glm-member-list-filters-close, -.glm-member-db-list-grid-view #glm-member-list-filters-close { +.glm-member-db-list #glm-member-list-filters-close { background-color: rgba(0,0,0,0.25); height: 40px; line-height: 40px; @@ -167,8 +154,7 @@ margin: 0; border-top-right-radius: 4px; } -.glm-member-db-list-view #glm-member-list-filters-box, -.glm-member-db-list-grid-view #glm-member-list-filters-box { +.glm-member-db-list #glm-member-list-filters-box { transition: all 0.5s; max-width: 234px;; min-width: 215px; @@ -181,16 +167,14 @@ border-top-right-radius: 4px; overflow: hidden; } -.glm-member-db-list-view .glm-member-search, -.glm-member-db-list-grid-view .glm-member-search { +.glm-member-db-list .glm-member-search { padding-top: 50px; border-top: 0; } #glm-member-list-filters-box .glm-member-search h3 { color: black; } -.glm-member-db-list-view .glm-member-search:before, -.glm-member-db-list-grid-view .glm-member-search:before { +.glm-member-db-list .glm-member-search:before { background-color: lightgrey; content: ''; position: absolute; @@ -209,25 +193,21 @@ transition: all 0.5s; } -.glm-member-db-list-view.filters-closed #glm-member-list-filters-wrapper, -.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-wrapper { +.glm-member-db-list.filters-closed #glm-member-list-filters-wrapper { overflow: hidden; } -.glm-member-db-list-view.filters-closed #glm-member-list-filters-box, -.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-box { +.glm-member-db-list.filters-closed #glm-member-list-filters-box { left: -215px; opacity: 0; transition: all 0.5s; } @media (min-width: 1024px) { - .glm-member-db-list-view.filters-closed #glm-member-list-filters-box, - .glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-box { + .glm-member-db-list.filters-closed #glm-member-list-filters-box { transition: all 0.5s; left: -100%; } } -.glm-member-db-list-view.filters-opened #glm-member-list-filters-box, -.glm-member-db-list-grid-view.filters-opened #glm-member-list-filters-box { +.glm-member-db-list.filters-opened #glm-member-list-filters-box { left: 0; } #glm-member-list-filters-button { @@ -244,53 +224,46 @@ position: absolute; } } -.glm-member-db-list-view.filters-closed #glm-member-list-filters-button, -.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-button { +.glm-member-db-list.filters-closed #glm-member-list-filters-button { position: relative; } -.glm-member-db-list-view.filters-opened #glm-member-list-filters-button, -.glm-member-db-list-grid-view.filters-opened #glm-member-list-filters-button { +.glm-member-db-list.filters-opened #glm-member-list-filters-button { border-bottom-left-radius: 0; } -.glm-member-db-list-view.filters-closed #glm-member-list-filters-button:before, -.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-button:before { +.glm-member-db-list.filters-closed #glm-member-list-filters-button:before { content: "+ "; } -.glm-member-db-list-view.filters-opened #glm-member-list-filters-button:before, -.glm-member-db-list-grid-view.filters-opened #glm-member-list-filters-button:before { +.glm-member-db-list.filters-opened #glm-member-list-filters-button:before { content: "— "; } -.glm-member-db-list-view.filters-opened #glm-locationMap-container, -.glm-member-db-list-grid-view.filters-opened #glm-locationMap-container { +.glm-member-db-list.filters-opened #glm-locationMap-container { width: 70%; } -.glm-member-db-list-view.filters-closed #glm-locationMap-container, -.glm-member-db-list-grid-view.filters-closed #glm-locationMap-container { +.glm-member-db-list.filters-closed #glm-locationMap-container { width: 100%; } -.glm-member-db-list-view #glm-locationMap-container, -.glm-member-db-list-grid-view #glm-locationMap-container { +.glm-member-db-list #glm-locationMap-container { margin-bottom: 40px; overflow: hidden; } -.glm-member-db-list-grid-view.map-closed #glm-locationMap-container, -.glm-member-db-list-view.map-closed #glm-locationMap-container { +.glm-member-db-list.map-closed #glm-locationMap-container { margin-bottom: 0; height: 0; } -.glm-member-db-list-grid-view li.glm-member-list-record { +.glm-member-db-list li.glm-member-list-record { padding: 20px 10px; } .glm-member-db-border-wrap { border: 1px solid #e1e1e1; } -.glm-member-db-list-grid-view .glm-member-list-image-wrapper { +.glm-member-db-list .glm-member-list-image-wrapper { position: relative; display: block; overflow: hidden; min-height: 30px; + padding: 0; } -.glm-member-db-list-grid-view .glm-member-list-image-wrapper > img { +.glm-member-db-list .glm-member-list-image-wrapper > img { position: absolute; min-width: 100%; min-height: 100%; @@ -301,14 +274,21 @@ margin: auto; } .glm-member-list-image-empty { + background-image: url("../assets/filler_s.gif"); display: inline-block; - background-image: url("../assets/filler_s.jpg"); max-height: 230px; + max-width: 100%; text-align: center; background-position: center center; background-repeat: no-repeat; background-size: contain; } +.glm-member-db-grid-view .glm-member-list-image-empty { + background-image: url("../assets/no-image.jpg"); +} +.glm-member-list-image-filler { + float: left; +} .glm-member-list-sub-links { color: black; height: 50px; @@ -330,12 +310,11 @@ .glm-member-list-sub-links:last-child { /* text-align: right;*/ } -.glm-member-db-list-view .glm-member-list-listing-container { +.glm-member-db-list .glm-member-list-listing-container { padding: 0 20px; } #glm-directions, -.glm-member-db-list-view .glm-member-entry-container.glm-member-search, -.glm-member-db-list-grid-view .glm-member-entry-container.glm-member-search { +.glm-member-db-list .glm-member-entry-container.glm-member-search { margin-top: 0; } .glm-member-entry-container { @@ -353,12 +332,11 @@ max-width: 100%; height: auto; } -.glm-member-db-list-view .glm-member-list-image { +.glm-member-db-list .glm-member-list-image { width: 100%; } -.glm-member-db-list-grid-view .glm-member-list-image { +glm-member-db-list.glm-member-db-grid-view .glm-member-list-image { position: absolute; - width: 100%; } .glm-member-detail-image { border-color: lightgrey; @@ -391,17 +369,16 @@ margin-top: .5em; } .glm-member-list-image-wrapper { - padding: 0; + display: block; overflow: hidden; } -.glm-member-db-list-view .glm-member-list-image-wrapper { +.glm-member-db-list .glm-member-list-image-wrapper { /* height: 250px;*/ } .glm-member-list-active-info .glm-member-title a { /* text-decoration: underline;*/ } -.glm-member-db-list-view #glm-member-db-front-container, -.glm-member-db-list-grid-view #glm-member-db-front-container { +.glm-member-db-list #glm-member-db-front-container { padding: 0; } #glm-member-db-front-container { @@ -412,7 +389,7 @@ padding: 0; } } -.glm-member-db-list-view .glm-member-list-active-info { +.glm-member-db-list .glm-member-list-active-info { padding: 0 15px 0 0; } /* @@ -573,14 +550,14 @@ input[type="submit"].glm-member-button { background: white none repeat scroll 0 0; margin-bottom: 5px; } -.glm-member-db-list-view .glm-member-list-container { +.glm-member-db-list .glm-member-list-container { padding: 0; } -.glm-member-db-list-view .glm-member-db-phone-tollfree { +.glm-member-db-list .glm-member-db-phone-tollfree { } -.glm-member-db-list-view .glm-member-db-phone-tollfree:before { +.glm-member-db-list .glm-member-db-phone-tollfree:before { padding-left: 15px; content: ""; } @@ -776,10 +753,10 @@ input[type="submit"].glm-member-button { #glm-directions { padding: 1em; } -.glm-member-db-list-view .glm-member-list-links { +.glm-member-db-list.glm-member-db-grid-view .glm-member-list-links { margin-top: 3px; } -.glm-member-db-list-view .glm-member-list-links #glm-member-list-website-link:before { +.glm-member-db-list.glm-member-db-grid-view .glm-member-list-links #glm-member-list-website-link:before { //content: url("../assets/offsite-link_wht.png"); background-image: url("../assets/offsite-link_blk.png"); background-repeat: no-repeat; diff --git a/index.php b/index.php index d6fba88f..56d88fa6 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@ */ define('GLM_MEMBERS_PLUGIN_VERSION', '1.0.58'); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.5'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.7'); // Check if plugin version is not current in WordPress option and if needed updated it if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) { diff --git a/models/front/members/list.php b/models/front/members/list.php index 4ea89f6f..b66a346e 100644 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -57,7 +57,9 @@ $GLOBALS['showOpts'] = array( 'email' => 'list_show_email', 'categories' => 'list_show_categroies', 'credit-cards' => 'list_show_creditcards', - 'amentities' => 'list_show_amenities' + 'amentities' => 'list_show_amenities', + 'packages' => 'list_show_packages', + 'packages-link' => 'list_show_packages_link' ); // Load Members data abstract @@ -437,10 +439,9 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo /* * Check for which view file to use, else default to list */ - $view = "front/members/list.html"; - if (isset($actionData['request']['view']) && - strtolower($actionData['request']['view']) == "grid") { - $view = "front/members/grid.html"; + $view = "list"; + if (isset($actionData['request']['view']) && $actionData['request']['view'] != "" ) { + $view = strtolower($actionData['request']['view']); } /* @@ -507,6 +508,7 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo 'alphaList' => $alphaList, 'alphaSelected' => $alphaSelected, 'blankStart' => $blankStart, + 'view' => $view, ); // Return status, suggested view, and data to controller - also return any modified settings @@ -514,7 +516,7 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo 'status' => $success, 'menuItemRedirect' => false, 'modelRedirect' => false, - 'view' => $view, + 'view' => "front/members/list.html", 'data' => $templateData, 'settings' => $settings ); diff --git a/setup/databaseScripts/create_database_V1.1.5.sql b/setup/databaseScripts/create_database_V1.1.5.sql deleted file mode 100644 index afbb3c7d..00000000 --- a/setup/databaseScripts/create_database_V1.1.5.sql +++ /dev/null @@ -1,481 +0,0 @@ --- Gaslight Media Members Database --- File Created: 12/09/14 15:27:15 --- Database Version: 1.1.5 --- Database Creation Script --- --- To permit each query below to be executed separately, --- all queries must be separated by a line with four dashes --- --- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES **** --- - --- Amenities -CREATE TABLE {prefix}amenities ( - id INT NOT NULL AUTO_INCREMENT, - active TINYINT(1) NULL, -- Amenity is active flag - name TINYTEXT NULL, -- Name of amenity - descr TEXT NULL, -- Description of amenity - short_descr TINYTEXT NULL, -- Short description of amenity - ref_type INT NULL, -- Type of entity these amenitites are associated with - see plugin.ini ref_type tables - uses_value BOOLEAN NULL, -- Flag indicating whether the amenity requires a quantity number - PRIMARY KEY (id), - INDEX(name(20)) -); - ----- - --- Amenity Reference - Links a specific amenity to a specific entity of type ref_type -CREATE TABLE {prefix}amenity_ref ( - id INT NOT NULL AUTO_INCREMENT, - amenity INT NULL, -- Pointer to amenity in amenities table - ref_type INT NULL, -- Copy of ref_type from matching ameities table entry - to simplify searches - ref_dest INT NULL, -- Pointer to the specific entity of type ref_type - amenity_value TINYTEXT NULL, -- Quanity if amenity uses values - PRIMARY KEY (id), - INDEX(ref_type), - INDEX(ref_dest) -); - ----- - --- Member Cateogries - used with member information records -CREATE TABLE {prefix}categories ( - id INT NOT NULL AUTO_INCREMENT, - name TINYTEXT NULL, -- Name of this category - descr TEXT NULL, -- Description of this category - short_descr TINYTEXT NULL, -- Short description of this category - parent INT NULL, -- Pointer to parent category in this table - if there is one - PRIMARY KEY (id) -); - ----- - --- Mapping of categories to speific member information records -CREATE TABLE {prefix}category_member_info ( - id INT NOT NULL AUTO_INCREMENT, - category INT NULL, -- Pointer to category in categories table - member_info INT NULL, -- Pointer to member infomation record - PRIMARY KEY (id), - CONSTRAINT {prefix}categories_fk_1 - FOREIGN KEY (category) - REFERENCES {prefix}categories (id) - ON DELETE CASCADE, - INDEX(category), - INDEX(member_info) -); - ----- - --- Cities -CREATE TABLE {prefix}cities ( - id INT NOT NULL AUTO_INCREMENT, - name TINYTEXT NULL, -- Name of city - PRIMARY KEY (id) -); - ----- - --- Files - Files are stored under /wp-content/uploads/glm-member-db/files/ -CREATE TABLE {prefix}files ( - id INT NOT NULL AUTO_INCREMENT, - name TINYTEXT NULL, -- Original name of the file - might be URL if copied via HTTP - status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table - file_name TINYTEXT NULL, -- Stored file name for the file - descr TEXT NULL, -- Description - position INT NULL, -- Numeric position for sequence of display - ref_type INT NULL, -- Type of entity this image is associated with - ref_dest INT NULL, -- Pointer to the specific entity of ref_type this image is associated with - PRIMARY KEY (id), - INDEX(name(20)), - INDEX(file_name(20)), - INDEX(ref_type), - INDEX(ref_dest) -); - ----- - --- Images - Images are stored under /wp-content/uploads/glm-member-db/images/{size}/ -CREATE TABLE {prefix}images ( - id INT NOT NULL AUTO_INCREMENT, - name TINYTEXT NULL, -- Original name of the image - might be URL if copied via HTTP - status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table - selected BOOLEAN NULL, -- A single special image in the current gallery for this entity - featured BOOLEAN null, -- Image is a member of a group of featured images - file_name TINYTEXT NULL, -- Stored file name for the image - descr TEXT NULL, -- Description - caption TINYTEXT NULL, -- Caption for the image - position INT NULL, -- Numeric position for sequence of display - ref_type INT NULL, -- Type of entity this image is associated with - ref_dest INT NULL, -- Pointer to the specific entity of ref_type this image is associated with - PRIMARY KEY (id), - INDEX(name(20)), - INDEX(file_name(20)), - INDEX(ref_type), - INDEX(ref_dest) -); - ----- - --- Primary member records - One for each member -CREATE TABLE {prefix}members ( - id INT NOT NULL AUTO_INCREMENT, - access INT NULL, -- Access type - See access table in plugin.ini - member_type INT NULL, -- Pointer to member type in member_type table - created DATE NULL, -- Date member record was created - name TINYTEXT NULL, -- Member name - member_slug TINYTEXT NULL, -- Member name slug for canonical URLs (lowercase, "-" for spaces, no punctuation) - notes TEXT NULL, -- General notes - Not displayed in front-end - old_member_id INT NULL, -- Old member ID if imported from old database - PRIMARY KEY (id), - INDEX(name(20)), - INDEX(member_slug(20)), - INDEX(created) -); - ----- - --- Member information version record - May be multiples per member - Only one with stauts "Active" for a distinct date range -CREATE TABLE {prefix}member_info ( - id INT NOT NULL AUTO_INCREMENT, - member INT NULL, -- Pointer to member record in table members - member_name TINYTEXT NULL, -- Copy of member name from members table entry for fast reference - status INT NULL, -- Status of this member information record - See plugin.ini status table - reference_name TINYTEXT NULL, -- Refernce name for this member information record - Not displayed on front-end - descr TEXT NULL, -- Description - short_descr TEXT NULL, -- Short description - addr1 TINYTEXT NULL, -- Main member location address line 1 - addr2 TINYTEXT NULL, -- Address line 2 - city INT NULL, -- Pointer to City in cities table - state TINYTEXT NULL, -- Two character state code - matches states.ini entries - country TINYTEXT NULL, -- Two character country code - matches countries.ini entries - zip TINYTEXT NULL, -- ZIP/Postal code - lat FLOAT NULL, -- Latitude of member's location - lon FLOAT NULL, -- Longitude of member's location - region INT NULL, -- Pointer to entry in regions table - phone TINYTEXT NULL, -- Primary phone number - toll_free TINYTEXT NULL, -- Toll Free phone number - url TINYTEXT NULL, -- URL with information about this member - email TINYTEXT NULL, -- Main E-Mail address for this member - logo TINYTEXT NULL, -- Member logo - cc_type INT NULL, -- Bitmap of credit card types accepted - See credit_card array in plugin.ini - notes TEXT NULL, -- General notes - Not displayed in front-end - create_time TIMESTAMP NULL, -- Create date/time - modify_time TIMESTAMP NULL, -- Last update date/time - PRIMARY KEY (id), - INDEX(status), - INDEX(city), - INDEX(zip(10)), - INDEX(lat), - INDEX(lon), - INDEX(region) -); - ----- - --- Member type - Can be used to assign members to different "classes" of membership (i.e. Full, Associate, Premium) --- Mostly for internal use by the member organization, but could be displayed - Consider a short_description if they are. -CREATE TABLE {prefix}member_type ( - id INT NOT NULL AUTO_INCREMENT, - name TINYTEXT NULL, -- Name of member type - descr TINYTEXT NULL, -- Description of member type - PRIMARY KEY (id) -); - ----- - --- Regions - Used to segment members into various geographical regions - can be cities, counties, or other logical regions -CREATE TABLE {prefix}regions ( - id INT NOT NULL AUTO_INCREMENT, - name TINYTEXT NULL, -- Name of region - descr TEXT NULL, -- Descrption of region - short_descr TINYTEXT NULL, -- Short descroption of region - PRIMARY KEY (id) -); - ----- - --- General settings available on Management page in admin - Only 1 entry in this table --- Items in this table should be all self-explanatory -CREATE TABLE {prefix}settings_general ( - id INT NOT NULL AUTO_INCREMENT, - admin_debug BOOLEAN DEFAULT '0', - admin_debug_verbose BOOLEAN DEFAULT '0', - front_debug BOOLEAN DEFAULT '0', - front_debug_verbose BOOLEAN DEFAULT '0', - google_maps_api_key TINYTEXT DEFAULT '', - maps_default_lat FLOAT DEFAULT '45.3749', - maps_default_lon FLOAT DEFAULT '-84.9592', - maps_default_zoom INTEGER DEFAULT '10', - time_zone TINYTEXT DEFAULT NULL, - canonical_member_page TINYTEXT DEFAULT NULL, - list_show_map BOOLEAN DEFAULT '1', - list_show_list BOOLEAN DEFAULT '1', - list_show_search_filters_opened BOOLEAN DEFAULT '0', - list_show_search BOOLEAN DEFAULT '1', - list_show_search_text BOOLEAN DEFAULT '1', - list_show_search_category BOOLEAN DEFAULT '1', - list_show_search_amenities BOOLEAN DEFAULT '1', - list_show_search_alpha BOOLEAN DEFAULT '1', - list_show_detail_link BOOLEAN DEFAULT '1', - list_show_logo BOOLEAN DEFAULT '1', - list_logo_size TINYTEXT NULL, - list_show_address BOOLEAN DEFAULT '1', - list_show_street BOOLEAN DEFAULT '1', - list_show_citystatezip BOOLEAN DEFAULT '1', - list_show_country BOOLEAN DEFAULT '1', - list_show_region BOOLEAN DEFAULT '1', - list_show_descr BOOLEAN DEFAULT '0', - list_show_short_descr BOOLEAN DEFAULT '1', - list_show_phone BOOLEAN DEFAULT '1', - list_show_tollfree BOOLEAN DEFAULT '1', - list_show_url BOOLEAN DEFAULT '1', - list_show_url_newtarget BOOLEAN DEFAULT '1', - list_show_email BOOLEAN DEFAULT '1', - list_show_categories BOOLEAN DEFAULT '0', - list_show_creditcards BOOLEAN DEFAULT '0', - list_show_amenities BOOLEAN DEFAULT '0', - list_map_show_opened BOOLEAN DEFAULT '0', - list_map_show_detaillink BOOLEAN DEFAULT '1', - list_map_show_logo BOOLEAN DEFAULT '0', - list_map_logo_size TINYTEXT NULL, - list_map_show_descr BOOLEAN DEFAULT '0', - list_map_show_short_descr BOOLEAN DEFAULT '1', - list_map_show_address BOOLEAN DEFAULT '1', - list_map_show_street BOOLEAN DEFAULT '1', - list_map_show_citystatezip BOOLEAN DEFAULT '1', - list_map_show_country BOOLEAN DEFAULT '1', - list_map_show_region BOOLEAN DEFAULT '1', - list_map_show_phone BOOLEAN DEFAULT '1', - list_map_show_tollfree BOOLEAN DEFAULT '1', - list_map_show_url BOOLEAN DEFAULT '1', - list_map_show_url_newtarget BOOLEAN DEFAULT '1', - list_map_show_email BOOLEAN DEFAULT '1', - list_map_show_categories BOOLEAN DEFAULT '0', - list_map_show_creditcards BOOLEAN DEFAULT '0', - list_map_show_amenities BOOLEAN DEFAULT '0', - detail_show_map BOOLEAN DEFAULT '1', - detail_show_directions BOOLEAN DEFAULT '1', - detail_show_logo BOOLEAN DEFAULT '1', - detail_logo_size TINYTEXT NULL, - detail_show_descr BOOLEAN DEFAULT '1', - detail_show_short_descr BOOLEAN DEFAULT '0', - detail_show_address BOOLEAN DEFAULT '1', - detail_show_street BOOLEAN DEFAULT '1', - detail_show_citystatezip BOOLEAN DEFAULT '1', - detail_show_country BOOLEAN DEFAULT '1', - detail_show_region BOOLEAN DEFAULT '1', - detail_show_phone BOOLEAN DEFAULT '1', - detail_show_tollfree BOOLEAN DEFAULT '1', - detail_show_url BOOLEAN DEFAULT '1', - detail_show_url_newtarget BOOLEAN DEFAULT '1', - detail_show_email BOOLEAN DEFAULT '1', - detail_show_categories BOOLEAN DEFAULT '0', - detail_show_creditcards BOOLEAN DEFAULT '0', - detail_show_amenities BOOLEAN DEFAULT '1', - detail_show_imagegallery BOOLEAN DEFAULT '1', - detail_show_coupons BOOLEAN DEFAULT '0', - detail_show_packages BOOLEAN DEFAULT '0', - detail_map_show_logo BOOLEAN DEFAULT '0', - detail_map_logo_size TINYTEXT NULL, - detail_map_show_descr BOOLEAN DEFAULT '0', - detail_map_show_short_descr BOOLEAN DEFAULT '1', - detail_map_show_address BOOLEAN DEFAULT '1', - detail_map_show_street BOOLEAN DEFAULT '1', - detail_map_show_citystatezip BOOLEAN DEFAULT '1', - detail_map_show_country BOOLEAN DEFAULT '1', - detail_map_show_region BOOLEAN DEFAULT '1', - detail_map_show_phone BOOLEAN DEFAULT '1', - detail_map_show_tollfree BOOLEAN DEFAULT '1', - detail_map_show_url BOOLEAN DEFAULT '1', - detail_map_show_url_newtarget BOOLEAN DEFAULT '1', - detail_map_show_email BOOLEAN DEFAULT '1', - detail_map_show_categories BOOLEAN DEFAULT '0', - detail_map_show_creditcards BOOLEAN DEFAULT '0', - detail_map_show_amenities BOOLEAN DEFAULT '0', - PRIMARY KEY (id) -); - ----- - --- Set default entry -INSERT INTO {prefix}settings_general - ( id, time_zone, canonical_member_page, list_logo_size, list_map_logo_size, detail_logo_size, detail_map_logo_size ) - VALUES - ( 1, 'America/Detroit', 'member-detail', 'large', 'thumb', 'large', 'thumb' ) -; - ----- - --- Terms used in site modifiable on Management page in admin - Only 1 entry in this table --- Tems in this table should be all self-explanatory -CREATE TABLE {prefix}settings_terms ( - id INT NOT NULL AUTO_INCREMENT, - term_admin_menu_members TINYTEXT NULL, - term_admin_menu_member_list TINYTEXT NULL, - term_admin_menu_member TINYTEXT NULL, - term_admin_menu_configure TINYTEXT NULL, - term_admin_menu_settings TINYTEXT NULL, - term_admin_menu_shortcodes TINYTEXT NULL, - term_admin_menu_members_dashboard TINYTEXT NULL, - term_admin_menu_members_list TINYTEXT NULL, - term_admin_menu_members_reports TINYTEXT NULL, - term_admin_menu_member_dashboard TINYTEXT NULL, - term_admin_menu_member_info TINYTEXT NULL, - term_admin_menu_member_locations TINYTEXT NULL, - term_admin_menu_member_facilities TINYTEXT NULL, - term_admin_menu_member_attractions TINYTEXT NULL, - term_admin_menu_member_contacts TINYTEXT NULL, - term_admin_menu_configure_member_types TINYTEXT NULL, - term_admin_menu_configure_member_cats TINYTEXT NULL, - term_admin_menu_configure_accom_types TINYTEXT NULL, - term_admin_menu_configure_amenities TINYTEXT NULL, - term_admin_menu_configure_cities TINYTEXT NULL, - term_admin_menu_configure_regions TINYTEXT NULL, - term_admin_menu_settings_general TINYTEXT NULL, - term_admin_menu_settings_terms TINYTEXT NULL, - term_admin_menu_settings_development TINYTEXT NULL, - term_member TINYTEXT NULL, - term_member_cap TINYTEXT NULL, - term_member_plur TINYTEXT NULL, - term_member_plur_cap TINYTEXT NULL, - term_location TINYTEXT NULL, - term_location_cap TINYTEXT NULL, - term_location_plur TINYTEXT NULL, - term_location_plur_cap TINYTEXT NULL, - term_facility TINYTEXT NULL, - term_facility_cap TINYTEXT NULL, - term_facility_plur TINYTEXT NULL, - term_facility_plur_cap TINYTEXT NULL, - term_attraction TINYTEXT NULL, - term_attraction_cap TINYTEXT NULL, - term_attraction_plur TINYTEXT NULL, - term_attraction_plur_cap TINYTEXT NULL, - term_contact TINYTEXT NULL, - term_contact_cap TINYTEXT NULL, - term_contact_plur TINYTEXT NULL, - term_contact_plur_cap TINYTEXT NULL, - PRIMARY KEY (id) -); - ----- - --- Default terms entry -INSERT INTO {prefix}settings_terms - ( - id, - term_admin_menu_members, - term_admin_menu_member_list, - term_admin_menu_member, - term_admin_menu_configure, - term_admin_menu_settings, - term_admin_menu_shortcodes, - term_admin_menu_members_dashboard, - term_admin_menu_members_list, - term_admin_menu_members_reports, - term_admin_menu_member_dashboard, - term_admin_menu_member_info, - term_admin_menu_member_locations, - term_admin_menu_member_facilities, - term_admin_menu_member_attractions, - term_admin_menu_member_contacts, - term_admin_menu_configure_member_types, - term_admin_menu_configure_member_cats, - term_admin_menu_configure_accom_types, - term_admin_menu_configure_amenities, - term_admin_menu_configure_cities, - term_admin_menu_configure_regions, - term_admin_menu_settings_general, - term_admin_menu_settings_terms, - term_admin_menu_settings_development, - term_member, - term_member_cap, - term_member_plur, - term_member_plur_cap, - term_location, - term_location_cap, - term_location_plur, - term_location_plur_cap, - term_facility, - term_facility_cap, - term_facility_plur, - term_facility_plur_cap, - term_attraction, - term_attraction_cap, - term_attraction_plur, - term_attraction_plur_cap, - term_contact, - term_contact_cap, - term_contact_plur, - term_contact_plur_cap - ) - VALUES - ( - 1, - 'Members', - 'Member', - 'Member', - 'Configure', - 'Management', - 'Shortcodes', - 'Dashboard', - 'Member List', - 'Reports', - 'Member Dashboard', - 'Member Info', - 'Locations', - 'Facilities', - 'Attractions', - 'Contacts', - 'Member Types', - 'Member Categories', - 'Accommodation Types', - 'Amenities', - 'Cities', - 'Regions', - 'General Settings', - 'Terms & Phrases', - 'Development', - 'member', - 'Member', - 'members', - 'Members', - 'location', - 'Location', - 'locations', - 'Locations', - 'facility', - 'Facility', - 'facilities', - 'Facilities', - 'attraction', - 'Attraction', - 'attractions', - 'Attractions', - 'contact', - 'Contact', - 'contacts', - 'Contacts' - ) -; - ----- - --- Theme Settings - Only 1 entry in this table -CREATE TABLE {prefix}settings_theme ( - id INT NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) -); - ----- - --- Default Theme Settings entry -INSERT INTO {prefix}settings_theme - ( - id - ) - VALUES - ( - 1 - ) -; - diff --git a/setup/databaseScripts/create_database_V1.1.7.sql b/setup/databaseScripts/create_database_V1.1.7.sql new file mode 100644 index 00000000..8cb7d7eb --- /dev/null +++ b/setup/databaseScripts/create_database_V1.1.7.sql @@ -0,0 +1,485 @@ +-- Gaslight Media Members Database +-- File Created: 12/09/14 15:27:15 +-- Database Version: 1.1.7 +-- Database Creation Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes +-- +-- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES **** +-- + +-- Amenities +CREATE TABLE {prefix}amenities ( + id INT NOT NULL AUTO_INCREMENT, + active TINYINT(1) NULL, -- Amenity is active flag + name TINYTEXT NULL, -- Name of amenity + descr TEXT NULL, -- Description of amenity + short_descr TINYTEXT NULL, -- Short description of amenity + ref_type INT NULL, -- Type of entity these amenitites are associated with - see plugin.ini ref_type tables + uses_value BOOLEAN NULL, -- Flag indicating whether the amenity requires a quantity number + PRIMARY KEY (id), + INDEX(name(20)) +); + +---- + +-- Amenity Reference - Links a specific amenity to a specific entity of type ref_type +CREATE TABLE {prefix}amenity_ref ( + id INT NOT NULL AUTO_INCREMENT, + amenity INT NULL, -- Pointer to amenity in amenities table + ref_type INT NULL, -- Copy of ref_type from matching ameities table entry - to simplify searches + ref_dest INT NULL, -- Pointer to the specific entity of type ref_type + amenity_value TINYTEXT NULL, -- Quanity if amenity uses values + PRIMARY KEY (id), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Member Cateogries - used with member information records +CREATE TABLE {prefix}categories ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of this category + descr TEXT NULL, -- Description of this category + short_descr TINYTEXT NULL, -- Short description of this category + parent INT NULL, -- Pointer to parent category in this table - if there is one + PRIMARY KEY (id) +); + +---- + +-- Mapping of categories to speific member information records +CREATE TABLE {prefix}category_member_info ( + id INT NOT NULL AUTO_INCREMENT, + category INT NULL, -- Pointer to category in categories table + member_info INT NULL, -- Pointer to member infomation record + PRIMARY KEY (id), + CONSTRAINT {prefix}categories_fk_1 + FOREIGN KEY (category) + REFERENCES {prefix}categories (id) + ON DELETE CASCADE, + INDEX(category), + INDEX(member_info) +); + +---- + +-- Cities +CREATE TABLE {prefix}cities ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of city + PRIMARY KEY (id) +); + +---- + +-- Files - Files are stored under /wp-content/uploads/glm-member-db/files/ +CREATE TABLE {prefix}files ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Original name of the file - might be URL if copied via HTTP + status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table + file_name TINYTEXT NULL, -- Stored file name for the file + descr TEXT NULL, -- Description + position INT NULL, -- Numeric position for sequence of display + ref_type INT NULL, -- Type of entity this image is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this image is associated with + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(file_name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Images - Images are stored under /wp-content/uploads/glm-member-db/images/{size}/ +CREATE TABLE {prefix}images ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Original name of the image - might be URL if copied via HTTP + status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table + selected BOOLEAN NULL, -- A single special image in the current gallery for this entity + featured BOOLEAN null, -- Image is a member of a group of featured images + file_name TINYTEXT NULL, -- Stored file name for the image + descr TEXT NULL, -- Description + caption TINYTEXT NULL, -- Caption for the image + position INT NULL, -- Numeric position for sequence of display + ref_type INT NULL, -- Type of entity this image is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this image is associated with + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(file_name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Primary member records - One for each member +CREATE TABLE {prefix}members ( + id INT NOT NULL AUTO_INCREMENT, + access INT NULL, -- Access type - See access table in plugin.ini + member_type INT NULL, -- Pointer to member type in member_type table + created DATE NULL, -- Date member record was created + name TINYTEXT NULL, -- Member name + member_slug TINYTEXT NULL, -- Member name slug for canonical URLs (lowercase, "-" for spaces, no punctuation) + notes TEXT NULL, -- General notes - Not displayed in front-end + old_member_id INT NULL, -- Old member ID if imported from old database + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(member_slug(20)), + INDEX(created) +); + +---- + +-- Member information version record - May be multiples per member - Only one with stauts "Active" for a distinct date range +CREATE TABLE {prefix}member_info ( + id INT NOT NULL AUTO_INCREMENT, + member INT NULL, -- Pointer to member record in table members + member_name TINYTEXT NULL, -- Copy of member name from members table entry for fast reference + status INT NULL, -- Status of this member information record - See plugin.ini status table + reference_name TINYTEXT NULL, -- Refernce name for this member information record - Not displayed on front-end + descr TEXT NULL, -- Description + short_descr TEXT NULL, -- Short description + addr1 TINYTEXT NULL, -- Main member location address line 1 + addr2 TINYTEXT NULL, -- Address line 2 + city INT NULL, -- Pointer to City in cities table + state TINYTEXT NULL, -- Two character state code - matches states.ini entries + country TINYTEXT NULL, -- Two character country code - matches countries.ini entries + zip TINYTEXT NULL, -- ZIP/Postal code + lat FLOAT NULL, -- Latitude of member's location + lon FLOAT NULL, -- Longitude of member's location + region INT NULL, -- Pointer to entry in regions table + phone TINYTEXT NULL, -- Primary phone number + toll_free TINYTEXT NULL, -- Toll Free phone number + url TINYTEXT NULL, -- URL with information about this member + email TINYTEXT NULL, -- Main E-Mail address for this member + logo TINYTEXT NULL, -- Member logo + cc_type INT NULL, -- Bitmap of credit card types accepted - See credit_card array in plugin.ini + notes TEXT NULL, -- General notes - Not displayed in front-end + create_time TIMESTAMP NULL, -- Create date/time + modify_time TIMESTAMP NULL, -- Last update date/time + PRIMARY KEY (id), + INDEX(status), + INDEX(city), + INDEX(zip(10)), + INDEX(lat), + INDEX(lon), + INDEX(region) +); + +---- + +-- Member type - Can be used to assign members to different "classes" of membership (i.e. Full, Associate, Premium) +-- Mostly for internal use by the member organization, but could be displayed - Consider a short_description if they are. +CREATE TABLE {prefix}member_type ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of member type + descr TINYTEXT NULL, -- Description of member type + PRIMARY KEY (id) +); + +---- + +-- Regions - Used to segment members into various geographical regions - can be cities, counties, or other logical regions +CREATE TABLE {prefix}regions ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of region + descr TEXT NULL, -- Descrption of region + short_descr TINYTEXT NULL, -- Short descroption of region + PRIMARY KEY (id) +); + +---- + +-- General settings available on Management page in admin - Only 1 entry in this table +-- Items in this table should be all self-explanatory +CREATE TABLE {prefix}settings_general ( + id INT NOT NULL AUTO_INCREMENT, + admin_debug BOOLEAN DEFAULT '0', + admin_debug_verbose BOOLEAN DEFAULT '0', + front_debug BOOLEAN DEFAULT '0', + front_debug_verbose BOOLEAN DEFAULT '0', + google_maps_api_key TINYTEXT DEFAULT '', + maps_default_lat FLOAT DEFAULT '45.3749', + maps_default_lon FLOAT DEFAULT '-84.9592', + maps_default_zoom INTEGER DEFAULT '10', + time_zone TINYTEXT DEFAULT NULL, + canonical_member_page TINYTEXT DEFAULT NULL, + list_show_map BOOLEAN DEFAULT '1', + list_show_list BOOLEAN DEFAULT '1', + list_show_search_filters_opened BOOLEAN DEFAULT '0', + list_show_search BOOLEAN DEFAULT '1', + list_show_search_text BOOLEAN DEFAULT '1', + list_show_search_category BOOLEAN DEFAULT '1', + list_show_search_amenities BOOLEAN DEFAULT '1', + list_show_search_alpha BOOLEAN DEFAULT '1', + list_floating_search BOOLEAN DEFAULT '0', + list_floating_search_distance_top INTEGER DEFAULT '0', + list_show_detail_link BOOLEAN DEFAULT '1', + list_show_logo BOOLEAN DEFAULT '1', + list_logo_size TINYTEXT NULL, + list_show_address BOOLEAN DEFAULT '1', + list_show_street BOOLEAN DEFAULT '1', + list_show_citystatezip BOOLEAN DEFAULT '1', + list_show_country BOOLEAN DEFAULT '1', + list_show_region BOOLEAN DEFAULT '1', + list_show_descr BOOLEAN DEFAULT '0', + list_show_short_descr BOOLEAN DEFAULT '1', + list_show_phone BOOLEAN DEFAULT '1', + list_show_tollfree BOOLEAN DEFAULT '1', + list_show_url BOOLEAN DEFAULT '1', + list_show_url_newtarget BOOLEAN DEFAULT '1', + list_show_email BOOLEAN DEFAULT '1', + list_show_categories BOOLEAN DEFAULT '0', + list_show_creditcards BOOLEAN DEFAULT '0', + list_show_amenities BOOLEAN DEFAULT '0', + list_map_show_opened BOOLEAN DEFAULT '0', + list_map_show_detaillink BOOLEAN DEFAULT '1', + list_map_show_logo BOOLEAN DEFAULT '0', + list_map_logo_size TINYTEXT NULL, + list_map_show_descr BOOLEAN DEFAULT '0', + list_map_show_short_descr BOOLEAN DEFAULT '1', + list_map_show_address BOOLEAN DEFAULT '1', + list_map_show_street BOOLEAN DEFAULT '1', + list_map_show_citystatezip BOOLEAN DEFAULT '1', + list_map_show_country BOOLEAN DEFAULT '1', + list_map_show_region BOOLEAN DEFAULT '1', + list_map_show_phone BOOLEAN DEFAULT '1', + list_map_show_tollfree BOOLEAN DEFAULT '1', + list_map_show_url BOOLEAN DEFAULT '1', + list_map_show_url_newtarget BOOLEAN DEFAULT '1', + list_map_show_email BOOLEAN DEFAULT '1', + list_map_show_categories BOOLEAN DEFAULT '0', + list_map_show_creditcards BOOLEAN DEFAULT '0', + list_map_show_amenities BOOLEAN DEFAULT '0', + list_show_packages BOOLEAN DEFAULT '0', + list_show_packages_link BOOLEAN DEFAULT '0', + detail_show_map BOOLEAN DEFAULT '1', + detail_show_directions BOOLEAN DEFAULT '1', + detail_show_logo BOOLEAN DEFAULT '1', + detail_logo_size TINYTEXT NULL, + detail_show_descr BOOLEAN DEFAULT '1', + detail_show_short_descr BOOLEAN DEFAULT '0', + detail_show_address BOOLEAN DEFAULT '1', + detail_show_street BOOLEAN DEFAULT '1', + detail_show_citystatezip BOOLEAN DEFAULT '1', + detail_show_country BOOLEAN DEFAULT '1', + detail_show_region BOOLEAN DEFAULT '1', + detail_show_phone BOOLEAN DEFAULT '1', + detail_show_tollfree BOOLEAN DEFAULT '1', + detail_show_url BOOLEAN DEFAULT '1', + detail_show_url_newtarget BOOLEAN DEFAULT '1', + detail_show_email BOOLEAN DEFAULT '1', + detail_show_categories BOOLEAN DEFAULT '0', + detail_show_creditcards BOOLEAN DEFAULT '0', + detail_show_amenities BOOLEAN DEFAULT '1', + detail_show_imagegallery BOOLEAN DEFAULT '1', + detail_show_coupons BOOLEAN DEFAULT '0', + detail_show_packages BOOLEAN DEFAULT '0', + detail_map_show_logo BOOLEAN DEFAULT '0', + detail_map_logo_size TINYTEXT NULL, + detail_map_show_descr BOOLEAN DEFAULT '0', + detail_map_show_short_descr BOOLEAN DEFAULT '1', + detail_map_show_address BOOLEAN DEFAULT '1', + detail_map_show_street BOOLEAN DEFAULT '1', + detail_map_show_citystatezip BOOLEAN DEFAULT '1', + detail_map_show_country BOOLEAN DEFAULT '1', + detail_map_show_region BOOLEAN DEFAULT '1', + detail_map_show_phone BOOLEAN DEFAULT '1', + detail_map_show_tollfree BOOLEAN DEFAULT '1', + detail_map_show_url BOOLEAN DEFAULT '1', + detail_map_show_url_newtarget BOOLEAN DEFAULT '1', + detail_map_show_email BOOLEAN DEFAULT '1', + detail_map_show_categories BOOLEAN DEFAULT '0', + detail_map_show_creditcards BOOLEAN DEFAULT '0', + detail_map_show_amenities BOOLEAN DEFAULT '0', + PRIMARY KEY (id) +); + +---- + +-- Set default entry +INSERT INTO {prefix}settings_general + ( id, time_zone, canonical_member_page, list_logo_size, list_map_logo_size, detail_logo_size, detail_map_logo_size ) + VALUES + ( 1, 'America/Detroit', 'member-detail', 'large', 'thumb', 'large', 'thumb' ) +; + +---- + +-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table +-- Tems in this table should be all self-explanatory +CREATE TABLE {prefix}settings_terms ( + id INT NOT NULL AUTO_INCREMENT, + term_admin_menu_members TINYTEXT NULL, + term_admin_menu_member_list TINYTEXT NULL, + term_admin_menu_member TINYTEXT NULL, + term_admin_menu_configure TINYTEXT NULL, + term_admin_menu_settings TINYTEXT NULL, + term_admin_menu_shortcodes TINYTEXT NULL, + term_admin_menu_members_dashboard TINYTEXT NULL, + term_admin_menu_members_list TINYTEXT NULL, + term_admin_menu_members_reports TINYTEXT NULL, + term_admin_menu_member_dashboard TINYTEXT NULL, + term_admin_menu_member_info TINYTEXT NULL, + term_admin_menu_member_locations TINYTEXT NULL, + term_admin_menu_member_facilities TINYTEXT NULL, + term_admin_menu_member_attractions TINYTEXT NULL, + term_admin_menu_member_contacts TINYTEXT NULL, + term_admin_menu_configure_member_types TINYTEXT NULL, + term_admin_menu_configure_member_cats TINYTEXT NULL, + term_admin_menu_configure_accom_types TINYTEXT NULL, + term_admin_menu_configure_amenities TINYTEXT NULL, + term_admin_menu_configure_cities TINYTEXT NULL, + term_admin_menu_configure_regions TINYTEXT NULL, + term_admin_menu_settings_general TINYTEXT NULL, + term_admin_menu_settings_terms TINYTEXT NULL, + term_admin_menu_settings_development TINYTEXT NULL, + term_member TINYTEXT NULL, + term_member_cap TINYTEXT NULL, + term_member_plur TINYTEXT NULL, + term_member_plur_cap TINYTEXT NULL, + term_location TINYTEXT NULL, + term_location_cap TINYTEXT NULL, + term_location_plur TINYTEXT NULL, + term_location_plur_cap TINYTEXT NULL, + term_facility TINYTEXT NULL, + term_facility_cap TINYTEXT NULL, + term_facility_plur TINYTEXT NULL, + term_facility_plur_cap TINYTEXT NULL, + term_attraction TINYTEXT NULL, + term_attraction_cap TINYTEXT NULL, + term_attraction_plur TINYTEXT NULL, + term_attraction_plur_cap TINYTEXT NULL, + term_contact TINYTEXT NULL, + term_contact_cap TINYTEXT NULL, + term_contact_plur TINYTEXT NULL, + term_contact_plur_cap TINYTEXT NULL, + PRIMARY KEY (id) +); + +---- + +-- Default terms entry +INSERT INTO {prefix}settings_terms + ( + id, + term_admin_menu_members, + term_admin_menu_member_list, + term_admin_menu_member, + term_admin_menu_configure, + term_admin_menu_settings, + term_admin_menu_shortcodes, + term_admin_menu_members_dashboard, + term_admin_menu_members_list, + term_admin_menu_members_reports, + term_admin_menu_member_dashboard, + term_admin_menu_member_info, + term_admin_menu_member_locations, + term_admin_menu_member_facilities, + term_admin_menu_member_attractions, + term_admin_menu_member_contacts, + term_admin_menu_configure_member_types, + term_admin_menu_configure_member_cats, + term_admin_menu_configure_accom_types, + term_admin_menu_configure_amenities, + term_admin_menu_configure_cities, + term_admin_menu_configure_regions, + term_admin_menu_settings_general, + term_admin_menu_settings_terms, + term_admin_menu_settings_development, + term_member, + term_member_cap, + term_member_plur, + term_member_plur_cap, + term_location, + term_location_cap, + term_location_plur, + term_location_plur_cap, + term_facility, + term_facility_cap, + term_facility_plur, + term_facility_plur_cap, + term_attraction, + term_attraction_cap, + term_attraction_plur, + term_attraction_plur_cap, + term_contact, + term_contact_cap, + term_contact_plur, + term_contact_plur_cap + ) + VALUES + ( + 1, + 'Members', + 'Member', + 'Member', + 'Configure', + 'Management', + 'Shortcodes', + 'Dashboard', + 'Member List', + 'Reports', + 'Member Dashboard', + 'Member Info', + 'Locations', + 'Facilities', + 'Attractions', + 'Contacts', + 'Member Types', + 'Member Categories', + 'Accommodation Types', + 'Amenities', + 'Cities', + 'Regions', + 'General Settings', + 'Terms & Phrases', + 'Development', + 'member', + 'Member', + 'members', + 'Members', + 'location', + 'Location', + 'locations', + 'Locations', + 'facility', + 'Facility', + 'facilities', + 'Facilities', + 'attraction', + 'Attraction', + 'attractions', + 'Attractions', + 'contact', + 'Contact', + 'contacts', + 'Contacts' + ) +; + +---- + +-- Theme Settings - Only 1 entry in this table +CREATE TABLE {prefix}settings_theme ( + id INT NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) +); + +---- + +-- Default Theme Settings entry +INSERT INTO {prefix}settings_theme + ( + id + ) + VALUES + ( + 1 + ) +; + diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index c0445bbd..1ed6b009 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -36,7 +36,9 @@ $glmMembersDbVersions = array( '1.1.2' => array('version' => '1.1.2', 'tables' => 14, 'date' => '4/11/16'), '1.1.3' => array('version' => '1.1.3', 'tables' => 13, 'date' => '4/13/16'), '1.1.4' => array('version' => '1.1.4', 'tables' => 14, 'date' => '4/18/16'), - '1.1.5' => array('version' => '1.1.5', 'tables' => 14, 'date' => '5/11/16') + '1.1.5' => array('version' => '1.1.5', 'tables' => 14, 'date' => '5/11/16'), + '1.1.6' => array('version' => '1.1.6', 'tables' => 14, 'date' => '5/23/16'), + '1.1.7' => array('version' => '1.1.7', 'tables' => 14, 'date' => '5/24/16') ); diff --git a/setup/databaseScripts/update_database_V1.1.5.sql b/setup/databaseScripts/update_database_V1.1.5.sql index 24a28224..408ded4d 100644 --- a/setup/databaseScripts/update_database_V1.1.5.sql +++ b/setup/databaseScripts/update_database_V1.1.5.sql @@ -7,9 +7,9 @@ -- all queries must be separated by a line with four dashses -- Default Search Filters Display Settings entry -ALTER TABLE {prefix}settings_general ADD COLUMN list_show_search_filters_opened BOOLEAN; +ALTER TABLE {prefix}settings_general ADD list_show_search_filters_opened BOOLEAN NULL DEFAULT FALSE; ---- -- Default List Map Display Settings entry -ALTER TABLE {prefix}settings_general ADD COLUMN list_map_show_opened BOOLEAN; \ No newline at end of file +ALTER TABLE {prefix}settings_general ADD list_map_show_opened BOOLEAN NULL DEFAULT FALSE; \ No newline at end of file diff --git a/setup/databaseScripts/update_database_V1.1.6.sql b/setup/databaseScripts/update_database_V1.1.6.sql new file mode 100644 index 00000000..dab80f8e --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.6.sql @@ -0,0 +1,14 @@ +-- Gaslight Media Members Database +-- File Created: 5/23/16 14:13:05 +-- Database Version: 1.1.6 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashses + +-- Determines whether search box floats on list view +ALTER TABLE {prefix}settings_general ADD list_floating_search BOOLEAN NULL DEFAULT FALSE; +---- + +-- Determines the distance from the top for the floating search box +ALTER TABLE {prefix}settings_general ADD list_floating_search_distance_top INTEGER NULL DEFAULT 0; \ No newline at end of file diff --git a/setup/databaseScripts/update_database_V1.1.7.sql b/setup/databaseScripts/update_database_V1.1.7.sql new file mode 100644 index 00000000..5e0b7c52 --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.7.sql @@ -0,0 +1,15 @@ +-- Gaslight Media Members Database +-- File Created: 5/23/16 14:13:05 +-- Database Version: 1.1.7 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashses + +-- Determines whether the packages show up on the member listing +ALTER TABLE {prefix}settings_general ADD list_show_packages BOOLEAN NULL DEFAULT FALSE; + +---- + +-- Determines whether the package link shows up on the member listing +ALTER TABLE {prefix}settings_general ADD list_show_packages_link BOOLEAN NULL DEFAULT FALSE; \ No newline at end of file diff --git a/setup/requiredPages.php b/setup/requiredPages.php index 37995a40..bc35d7c9 100644 --- a/setup/requiredPages.php +++ b/setup/requiredPages.php @@ -34,6 +34,15 @@ * for management purposes * * When in doubt just use '0' + * + * The underscored_title field will be added to the default option prefix as + * defined in GLM Associate. This will currently result in an option as follows: + * + * "glm_members_database_option_".$reqPage['underscored_title'] + * + * so glm_members_database_option_members_only_id + * glm_members_database_option_members_list_id + * and glm_members_database_option_member_detail_id * */ diff --git a/setup/shortcodes.php b/setup/shortcodes.php index ffdd3368..d1608038 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -100,23 +100,25 @@ $glmMembersShortcodes = array( 'search-amenities' => 'list_show_search_amenities', 'search-alpha' => 'list_show_search_alpha', 'list' => 'list_show_list', - 'name-link' => 'list_show_detail_link', + 'name-link' => 'list_show_detail_link', 'logo' => 'list_show_logo', 'address' => 'list_show_address', 'street' => 'list_show_street', 'city-state-zip' => 'list_show_citystatezip', - 'country' => 'list_show_country', + 'country' => 'list_show_country', 'region' => 'list_show_region', 'description' => 'list_show_descr', - 'short-description' => 'list_show_short_descr', + 'short-description' => 'list_show_short_descr', 'phone' => 'list_show_phone', 'toll-free' => 'list_show_tollfree', 'url' => 'list_show_url', 'url-new-target' => 'list_show_url_newtarget', 'email' => 'list_show_email', - 'categories' => 'list_show_categroies', + 'categories' => 'list_show_categroies', 'credit-cards' => 'list_show_creditcards', - 'amentities' => 'list_show_amenities' + 'amentities' => 'list_show_amenities', + 'packages' => 'list_show_packages', + 'packages-link' => 'list_show_packages_link' ) ), 'glm-member-detail' => array( diff --git a/views/admin/management/index.html b/views/admin/management/index.html index a0ff1210..df56697b 100644 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@ -143,7 +143,7 @@ - Map Options: +

Map Options:

@@ -181,7 +181,9 @@ - + + +
Show Member Name as Link to Detail:
Show E-mail:
Show Categories:
Show Credit Cards:
Show Amenitiies:
Show Amenities:
Show Packages:
Show Packages Link:
@@ -192,7 +194,7 @@ - Search Form Options: +

Search Form Options:

@@ -200,7 +202,9 @@ - + + +
Category Search:
Amenities Search:
Show Alpha Index:
(Grid) Filter Box Opened by Default:
Filter Box Opened by Default:
Floating Search Box:
Floating Search Distance From Top:px
@@ -211,7 +215,7 @@ - Member List Options +

Member List Options

diff --git a/views/front/members/detail.html b/views/front/members/detail.html index 224de19f..92f7ed50 100644 --- a/views/front/members/detail.html +++ b/views/front/members/detail.html @@ -312,10 +312,22 @@ $('body,html').animate({ scrollTop: $("#glm-member-detail-takeback-mini").offset().top }, 75); - }); + }); + // Open the appropriate section if a link is clicked + $('.link-open-detail-content-data').click(function(e) { + var target = $(this).attr("id").slice(0, -5); + // e.g.: #glm-member-detail-packages-link + $("#"+target+"-container").show("fast", "swing", function() {}); + $("#"+target+"-toggle").addClass("selected"); + fullProfileCheck(target); + $('html, body').animate({ + scrollTop: $("#"+target+"-toggle").offset().top + }, 500); + }); + + // Open or close the appropriate section if a toggle is clicked $(".glm-member-detail-content-toggle").not("#glm-member-detail-fullprofile-toggle").click(function() { - if($(this).parents('.glm-member-detail-sub-data-links').length) { var target = $(this).parent().parent().attr("id").slice(0, -10); } else { @@ -323,14 +335,19 @@ } $("#"+target+"-container").slideToggle("fast", "swing", function() {}); $("#"+target+"-toggle").toggleClass("selected"); - + fullProfileCheck(target); + }); + + // Change the toggle button based on whether all the content sections are expanded + function fullProfileCheck(target) { if ($("#glm-member-detail-data-container > .glm-member-detail-content-toggle.selected").length == $("#glm-member-detail-data-container > .glm-member-detail-content-toggle").length) { $("#glm-member-detail-fullprofile-toggle").addClass("selected"); } else { $("#glm-member-detail-fullprofile-toggle").removeClass("selected"); } - }); + } + // Open or close every data container if the fullprofile toggle is clicked $("#glm-member-detail-fullprofile-toggle").click(function() { if ($(this).hasClass("selected")) { $(".glm-member-detail-content-data").slideUp(175, "swing", function() {}); @@ -343,6 +360,7 @@ } }); + // Expand the takeback button on hover. Progressively add ellipses when clicked and loading $("#glm-member-detail-takeback-mini").click(function() { $("#glm-member-detail-takeback-mini span").html("Loading"); $("#glm-member-detail-takeback-mini").css('min-width','170px'); @@ -354,27 +372,30 @@ }, 500); }); - $("#glm-member-detail-map-button").click(function() { - var mapC = "#glm-locationMap-container"; - var map = "#glm-locationMap"; - var mapNewH = 0; - var mapOverflow = 'hidden'; - var mapBtnTxt = 'view map'; - if ($(mapC).height() == 0) { - mapNewH = 250; - mapV = 'visible'; - mapBtnTxt = 'hide map' - } - $(mapC).animate({ - overflow: mapOverflow, - height: mapNewH - }, 250, "swing", function() { - - }); - $(this).html(mapBtnTxt); - }); {if $settings.detail_show_map} + + // Expand/contract map container and change the toggle button + $("#glm-member-detail-map-button").click(function() { + var mapC = "#glm-locationMap-container"; + var map = "#glm-locationMap"; + var mapNewH = 0; + var mapOverflow = 'hidden'; + var mapBtnTxt = 'view map'; + if ($(mapC).height() == 0) { + mapNewH = 250; + mapV = 'visible'; + mapBtnTxt = 'hide map' + } + $(mapC).animate({ + overflow: mapOverflow, + height: mapNewH + }, 250, "swing", function() { + + }); + $(this).html(mapBtnTxt); + }); + /* * Google Maps * API reference: https://developers.google.com/maps/documentation/javascript/reference @@ -438,6 +459,8 @@ {/if} {*detail_show_map*} + +// Direction code is below, but since we're sending them offsite to google maps this is no longer necessary. // // {if $settings.detail_show_directions} // diff --git a/views/front/members/grid.html b/views/front/members/grid.html index ea06a490..25b0d79a 100644 --- a/views/front/members/grid.html +++ b/views/front/members/grid.html @@ -1,10 +1,8 @@ -
- {include file='front/members/header.html'} - {apply_filters('glm-member-db-front-members-list-pageTop', '')}
{if $settings.list_show_map} @@ -75,30 +73,31 @@ {apply_filters('glm-member-db-front-members-list-listHeaderTop', '')} + {if $settings.list_show_list && !$blankStart} +

List of {$terms.term_member_plur_cap}

+ {if $haveMembers} -
- {if $settings.list_show_list && !$blankStart} -

List of {$terms.term_member_plur_cap}

- {if $haveMembers} - - {if $settings.list_show_search_alpha} - - {/if} - {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} - - - -
    - {foreach $members as $m} -
  • -
    -
    - {apply_filters('glm-member-db-front-members-list-memberAbove', '', $m.id)} + {$terms.term_member_plur_cap} found: {$membersFound}
    + + {if $settings.list_show_search_alpha} + + {/if} + {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} + + + +
    + +
@@ -228,32 +227,27 @@ // Show search filters box {if $settings.list_show_search} - var fixmeTop = $('#glm-member-list-filters-button').offset().top; - $(window).scroll(function() { + + // Float filter box - var currentScroll = $(window).scrollTop(); + var fixmeTop = $('#glm-member-list-filters-button').offset().top; + $(window).scroll(function() { - if (currentScroll >= fixmeTop) { - if ($(window).width() < 1024) { + var currentScroll = $(window).scrollTop(); + + if (currentScroll >= fixmeTop && {$settings.list_floating_search}) { $('#glm-member-list-filters-wrapper').css({ position: 'fixed', - top: '5px', + top: '{$settings.list_floating_search_distance_top}', transform: 'translateX(0%)' }); } else { $('#glm-member-list-filters-wrapper').css({ - position: 'fixed', - top: '30px', + position: 'static', + top: '0', transform: 'translateX(0%)' }); } - } else { - $('#glm-member-list-filters-wrapper').css({ - position: 'static', - top: '0', - transform: 'translateX(0%)' - }); - } }); $(".glm-member-list-filters-toggle").click( function() { @@ -379,4 +373,6 @@ {/if} }); - {include file='front/footer.html'} + + +{include file='front/footer.html'} diff --git a/views/front/members/list.html b/views/front/members/list.html index fdeb610b..8757b0b1 100644 --- a/views/front/members/list.html +++ b/views/front/members/list.html @@ -1,11 +1,10 @@ -
{include file='front/members/header.html'} {apply_filters('glm-member-db-front-members-list-pageTop', '')} - -
+
{if $settings.list_show_map}
Map
{/if} @@ -91,13 +90,132 @@ {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} - +
- {foreach $members as $m} - - {apply_filters('glm-member-db-front-members-list-memberAbove', '', $m.id)} -
+ {if $view == grid} + + {else} + + {foreach $members as $m} + {apply_filters('glm-member-db-front-members-list-memberAbove', '', $m.id)}
{apply_filters('glm-member-db-front-members-list-memberTop', '', $m.id)} @@ -141,8 +259,10 @@ {if $m.region && $settings.list_show_region}
Region: {$m.region}
{/if}
{apply_filters('glm-member-db-front-members-social-list', '', $m.id)} @@ -197,7 +317,6 @@
{apply_filters('glm-member-db-front-members-list-memberBelow', '', $m.id)} -
@@ -270,48 +389,45 @@ {/foreach} {*$members*}
+ + {/if} {*end grid view check*} {apply_filters('glm-member-db-front-members-list-pageBottom', '')} {else}
(no {$terms.term_member_plur} listed)
{/if} - {/if} {*list_show_list*} -
Show Member Name as Link to Detail: