Some code fixes, and video code finished.
authorLaury GvR <laury@gaslightmedia.com>
Tue, 21 Jun 2016 21:36:15 +0000 (17:36 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 21 Jun 2016 21:36:15 +0000 (17:36 -0400)
14 files changed:
classes/data/settings/dataSettingsGeneral.php
config/plugin.ini
index.php
models/front/members/detail.php
models/front/members/list.php
setup/databaseScripts/create_database_V1.1.10.sql [deleted file]
setup/databaseScripts/create_database_V1.1.11.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V1.1.11.sql [new file with mode: 0644]
setup/hooksHelp.html
setup/shortcodes.php
views/admin/management/index.html
views/admin/member/memberInfo.html
views/front/members/detail.html

index 24d2a21..9a62a0d 100644 (file)
@@ -787,6 +787,14 @@ class GlmDataSettingsGeneral extends GlmDataAbstract
                         'default' => false,
                         'use' => 'a'
                 ),
+            
+                // Front-end Member Detail - Show Video
+                'detail_show_video' => array(
+                        'field' => 'detail_show_video',
+                        'type' => 'checkbox',
+                        'default' => false,
+                        'use' => 'a'
+                ),
 
                 /*
                  * Front-end Member Detail Map Options
index dc411f5..ffd7cb8 100644 (file)
@@ -312,14 +312,14 @@ day_of_month_bit[31] = 'Thirty First'
 ; Video Types
 video_type[1] = 'YouTube'
 video_type[2] = 'Vimeo'
-video_type[21] = 'MP4 File Upload'
-video_type[22] = 'WebM File Upload'
-video_type[23] = 'Ogg File Upload'
+;video_type[21] = 'MP4 File Upload'
+;video_type[22] = 'WebM File Upload'
+;video_type[23] = 'Ogg File Upload'
 
 video_type_numb['YouTube'] = 1
 video_type_numb['Vimeo'] = 2
-video_type_numb['MP4'] = 21
-video_type_numb['WebM'] = 22
-video_type_numb['Ogg'] = 23
+;video_type_numb['MP4'] = 21
+;video_type_numb['WebM'] = 22
+;video_type_numb['Ogg'] = 23
 
  
\ No newline at end of file
index b9622e0..fbdb245 100644 (file)
--- a/index.php
+++ b/index.php
@@ -39,7 +39,7 @@
  */
 
 define('GLM_MEMBERS_PLUGIN_VERSION', '2.1.9');
-define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.10');
+define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.11');
 
 // Check if plugin version is not current in WordPress option and if needed updated it
 if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) {
index b0e8ae6..e7f0e6f 100644 (file)
@@ -31,13 +31,13 @@ $GLOBALS['showOpts'] = array(
         'map-email' =>              'detail_map_show_email',
         'map-categories' =>         'detail_map_show_categories',
         'map-credit-cards' =>       'detail_map_show_creditcards',
-        'map-amentities' =>         'detail_map_show_amenities',
+        'map-amenities' =>          'detail_map_show_amenities',
         'logo' =>                   'detail_show_logo',
         'address' =>                'detail_show_address',
-        'street' =>                    'detail_show_street',
+        'street' =>                'detail_show_street',
         'city-state-zip' =>         'detail_show_citystatezip',
         'country' =>               'detail_show_country',
-        'region' =>                    'detail_show_region',
+        'region' =>                'detail_show_region',
         'description' =>            'detail_show_descr',
         'short-description' =>     'detail_show_short_descr',
         'phone' =>                  'detail_show_phone',
@@ -47,7 +47,8 @@ $GLOBALS['showOpts'] = array(
         'email' =>                  'detail_show_email',
         'categories' =>                    'detail_show_categories',
         'credit-cards' =>           'detail_show_creditcards',
-        'amentities' =>             'detail_show_amenities'
+        'amenities' =>              'detail_show_amenities',
+        'video' =>                  'detail_show_video'
 );
 
 // Load Members data abstract
@@ -293,6 +294,25 @@ class GlmMembersFront_members_detail extends GlmDataMemberInfo
                     }
                 }
             }
+            // Create embed code based on video type. Parse the url for the proper code.
+            //  - 1 = youtube
+            //  - 2 = vimeo
+            $video_url = $memberData['video_url'];
+            
+            if (strpos($video_url, 'youtube') !== false) {
+                if (strpos($video_url, 'embed') !== false) {
+                    $memberData['video_embed'] = '<iframe width="100%" height="315" src="'.$video_url.'" frameborder="0" allowfullscreen></iframe>';
+                } else {
+                    $memberData['video_embed'] = preg_replace("/\s*[a-zA-Z\/\/:\.]*www.youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i","<iframe width=\"100%\" height=\"315\" src=\"//www.youtube.com/embed/$1\" frameborder=\"0\" allowfullscreen></iframe>",$video_url);
+                }
+            } else if (strpos($video_url, 'vimeo') !== false) {
+                if (strpos($video_url, 'player') !== false) {
+                    $memberData['video_embed'] = '<iframe width="100%" height="315" src="'.$video_url.'" frameborder="0" allowfullscreen></iframe>';
+                } else {
+                    $memberData['video_embed'] = preg_replace("/\s*[a-zA-Z\/\/:\.]*www.vimeo.com\/([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i","<iframe width=\"100%\" height=\"315\" src=\"//player.vimeo.com/video/$1\" frameborder=\"0\" allowfullscreen></iframe>",$video_url);
+                }
+            }
+            
         }
         
         $expanded = htmlspecialchars($_GET['expanded']);
index 408a5a7..f7b0b81 100644 (file)
@@ -33,7 +33,7 @@ $GLOBALS['showOpts'] = array(
     'map-email' =>              'list_map_show_email',
     'map-categories' =>         'list_map_show_categories',
     'map-credit-cards' =>       'list_map_show_creditcards',
-    'map-amentities' =>         'list_map_show_amenities',
+    'map-amenities' =>          'list_map_show_amenities',
     'search' =>                 'list_show_search',
     'search-filters-opened' =>  'list_show_search_filters_opened',
     'search-text' =>            'list_show_search_text',
@@ -57,7 +57,7 @@ $GLOBALS['showOpts'] = array(
     'email' =>                  'list_show_email',
     'categories' =>            'list_show_categroies',
     'credit-cards' =>           'list_show_creditcards',
-    'amentities' =>             'list_show_amenities',
+    'amenities' =>              'list_show_amenities',
     'packages' =>               'list_show_packages',
     'packages-link' =>          'list_show_packages_link'
 );
diff --git a/setup/databaseScripts/create_database_V1.1.10.sql b/setup/databaseScripts/create_database_V1.1.10.sql
deleted file mode 100644 (file)
index f2c122c..0000000
+++ /dev/null
@@ -1,512 +0,0 @@
--- 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)
-);
-
-----
-
--- groups
-CREATE TABLE {prefix}amenity_groups (
-    id INT NOT NULL AUTO_INCREMENT,
-    name TINYTEXT NULL,                     -- Name of the Group
-    PRIMARY KEY (id),
-    INDEX(name(20))
-);
-
-----
-
--- Amenity Group - Links a specific amenity to groups
-CREATE TABLE {prefix}grouped_amenities (
-    id INT NOT NULL AUTO_INCREMENT,
-    group_id INT,                              -- Pointer to the group
-    amenity_id INT,                            -- Pointer to the Amenity
-    searchable BOOLEAN DEFAULT '0',         -- Flag indicating whether the amenity group will show in the search form
-    PRIMARY KEY (id)
-);
-
-----
-
--- 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
-  video_url TINYTEXT NULL,                  -- Video URL
-  video_file TINYTEXT NULL,                 -- Video File Name 
-  video_title TINYTEXT NULL,                -- Video Title
-  video_descr TEXT NULL,                    -- Video Description
-  video_type INT NULL,                      -- Video Type - See plugin.ini video type table.
-  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_show_events 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.11.sql b/setup/databaseScripts/create_database_V1.1.11.sql
new file mode 100644 (file)
index 0000000..65645bd
--- /dev/null
@@ -0,0 +1,513 @@
+-- Gaslight Media Members Database 
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 1.1.11
+-- 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)
+);
+
+----
+
+-- groups
+CREATE TABLE {prefix}amenity_groups (
+    id INT NOT NULL AUTO_INCREMENT,
+    name TINYTEXT NULL,                     -- Name of the Group
+    PRIMARY KEY (id),
+    INDEX(name(20))
+);
+
+----
+
+-- Amenity Group - Links a specific amenity to groups
+CREATE TABLE {prefix}grouped_amenities (
+    id INT NOT NULL AUTO_INCREMENT,
+    group_id INT,                              -- Pointer to the group
+    amenity_id INT,                            -- Pointer to the Amenity
+    searchable BOOLEAN DEFAULT '0',         -- Flag indicating whether the amenity group will show in the search form
+    PRIMARY KEY (id)
+);
+
+----
+
+-- 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
+  video_url TINYTEXT NULL,                  -- Video URL
+  video_file TINYTEXT NULL,                 -- Video File Name 
+  video_title TINYTEXT NULL,                -- Video Title
+  video_descr TEXT NULL,                    -- Video Description
+  video_type INT NULL,                      -- Video Type - See plugin.ini video type table.
+  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_show_events BOOLEAN DEFAULT '0',
+  detail_show_video 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
+    )
+;
+
index ce770d6..76a145c 100644 (file)
@@ -42,6 +42,7 @@ $glmMembersDbVersions = array(
     '1.1.8' => array('version' => '1.1.8', 'tables' => 14, 'date' => '6/01/16'),
     '1.1.9' => array('version' => '1.1.9', 'tables' => 16, 'date' => '6/13/16'),
     '1.1.10' => array('version' => '1.1.10', 'tables' => 16, 'date' => '6/16/16'),
+    '1.1.11' => array('version' => '1.1.11', 'tables' => 16, 'date' => '6/21/16'),
 );
 
 
diff --git a/setup/databaseScripts/update_database_V1.1.11.sql b/setup/databaseScripts/update_database_V1.1.11.sql
new file mode 100644 (file)
index 0000000..5426e3a
--- /dev/null
@@ -0,0 +1,12 @@
+-- Gaslight Media Members Database 
+-- File Created: 6/21/16 15:19:15
+-- Database Version: 1.1.11
+-- 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
+
+-- Add new setting for showing events on member detail pages
+
+
+ALTER TABLE {prefix}settings_general ADD COLUMN detail_show_video BOOLEAN DEFAULT true;
\ No newline at end of file
index e64b366..31e4e2d 100644 (file)
@@ -717,6 +717,20 @@ public function glmMembersAddTabForMembers($addOnTabs)
             <td>
             </td>
         </tr>
+        <tr>
+            <td>glm-member-db-front-members-detail-videoBefore</td>
+            <td>Filter</td>
+            <td>$memberID</td>
+            <td>
+            </td>
+        </tr>
+        <tr>
+            <td>glm-member-db-front-members-detail-videoAfter</td>
+            <td>Filter</td>
+            <td>$memberID</td>
+            <td>
+            </td>
+        </tr>
         <tr>
             <td>glm-member-db-front-members-detail-pageBottom</td>
             <td>Filter</td>
index 9d7f833..822cc9b 100644 (file)
@@ -69,57 +69,56 @@ $glmMembersShortcodes = array(
         'action' => 'list',
         'table'  => GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_general',
         'attributes' => array(
-            'category'              => false,
-            'category-name'         => false,
-            'blank-start'           => false,
-            'show'                  => false,
-            'view'                  => false,
-            'map'                   => 'list_show_map',
-            'map-opened'            => 'list_map_show_opened',
-            'map-name-link'         => 'list_map_show_detaillink',
-            'map-logo'              => 'list_map_show_logo',
-            'map-description'       => 'list_map_show_descr',
-            'map-short-description' => 'list_map_show_short_descr',
-            'map-address'           => 'list_map_show_address',
-            'map-street'            => 'list_map_show_street',
-            'map-city-state-zip'    => 'list_map_show_citystatezip',
-            'map-country'           => 'list_map_show_country',
-            'map-region'            => 'list_map_show_region',
-            'map-phone'             => 'list_map_show_phone',
-            'map-toll-free'         => 'list_map_show_tollfree',
-            'map-url'               => 'list_map_show_url',
-            'map-url-new-target'    => 'list_map_show_url_newtarget',
-            'map-email'             => 'list_map_show_email',
-            'map-categories'        => 'list_map_show_categories',
-            'map-credit-cards'      => 'list_map_show_creditcards',
-            'map-amentities'        => 'list_map_show_amenities',
-            'search'                => 'list_show_search',
-            'search-filters-opened' => 'list_show_search_filters_opened',
-            'search-text'           => 'list_show_search_text',
-            'search-categories'     => 'list_show_search_category',
-            'search-amenities'      => 'list_show_search_amenities',
-            'search-alpha'          => 'list_show_search_alpha',
-            'list'                  => 'list_show_list',
-            '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',
-            'region'                => 'list_show_region',
-            'description'           => 'list_show_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',
-            'credit-cards'          => 'list_show_creditcards',
-            'amentities'            => 'list_show_amenities',
-            'amenity-groups'        => false,
-            'packages'              => 'list_show_packages',
-            'packages-link'         => 'list_show_packages_link',
+            'category' =>               false,
+            'category-name' =>          false,
+            'blank-start' =>            false,
+            'show' =>                   false,
+            'view' =>                   false,
+            'map' =>                    'list_show_map',
+            'map-opened' =>             'list_map_show_opened',
+            'map-name-link' =>          'list_map_show_detaillink',
+            'map-logo' =>               'list_map_show_logo',
+            'map-description' =>        'list_map_show_descr',
+            'map-short-description' =>  'list_map_show_short_descr',
+            'map-address' =>            'list_map_show_address',
+            'map-street' =>             'list_map_show_street',
+            'map-city-state-zip' =>     'list_map_show_citystatezip',
+            'map-country' =>            'list_map_show_country',
+            'map-region' =>             'list_map_show_region',
+            'map-phone' =>              'list_map_show_phone',
+            'map-toll-free' =>          'list_map_show_tollfree',
+            'map-url' =>                'list_map_show_url',
+            'map-url-new-target' =>     'list_map_show_url_newtarget',
+            'map-email' =>              'list_map_show_email',
+            'map-categories' =>         'list_map_show_categories',
+            'map-credit-cards' =>       'list_map_show_creditcards',
+            'map-amenities' =>          'list_map_show_amenities',
+            'search' =>                 'list_show_search',
+            'search-filters-opened' =>  'list_show_search_filters_opened',
+            'search-text' =>            'list_show_search_text',
+            'search-categories' =>      'list_show_search_category',
+            'search-amenities' =>       'list_show_search_amenities',
+            'search-alpha' =>           'list_show_search_alpha',
+            'list' =>                   'list_show_list',
+            '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',
+            'region' =>                        'list_show_region',
+            'description' =>            'list_show_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',
+            'credit-cards' =>           'list_show_creditcards',
+            'amenities' =>              'list_show_amenities',
+            'packages' =>               'list_show_packages',
+            'packages-link' =>          'list_show_packages_link'
         )
     ),
     'glm-member-detail' => array(
@@ -128,41 +127,41 @@ $glmMembersShortcodes = array(
         'action' => 'detail',
         'table'  => GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_general',
         'attributes' => array(
-            'id'                    => false,
-            'show'                  => false,
-            'map'                   => 'detail_show_map',
-            'map-logo'              => 'detail_map_show_logo',
-            'map-description'       => 'detail_map_show_descr',
-            'map-short-description' => 'detail_map_show_short_descr',
-            'map-address'           => 'detail_map_show_address',
-            'map-street'            => 'detail_map_show_street',
-            'map-city-state-zip'    => 'detail_map_show_citystatezip',
-            'map-country'           => 'detail_map_show_country',
-            'map-region'            => 'detail_map_show_region',
-            'map-phone'             => 'detail_map_show_phone',
-            'map-toll-free'         => 'detail_map_show_tollfree',
-            'map-url'               => 'detail_map_show_url',
-            'map-url-new-target'    => 'detail_map_show_url_newtarget',
-            'map-email'             => 'detail_map_show_email',
-            'map-categories'        => 'detail_map_show_categories',
-            'map-credit-cards'      => 'detail_map_show_creditcards',
-            'map-amentities'        => 'detail_map_show_amenities',
-            'logo'                  => 'detail_show_logo',
-            'address'               => 'detail_show_address',
-            'street'                => 'detail_show_street',
-            'city-state-zip'        => 'detail_show_citystatezip',
-            'country'               => 'detail_show_country',
-            'region'                => 'detail_show_region',
-            'description'           => 'detail_show_descr',
-            'short-description'     => 'detail_show_short_descr',
-            'phone'                 => 'detail_show_phone',
-            'toll-free'             => 'detail_show_tollfree',
-            'url'                   => 'detail_show_url',
-            'url-new-target'        => 'detail_show_url_newtarget',
-            'email'                 => 'detail_show_email',
-            'categories'            => 'detail_show_categories',
-            'credit-cards'          => 'detail_show_creditcards',
-            'amentities'            => 'detail_show_amenities',
+            'id' =>                     false,
+            'show' =>                   false,
+            'map' =>                    'detail_show_map',
+            'map-logo' =>               'detail_map_show_logo',
+            'map-description' =>        'detail_map_show_descr',
+            'map-short-description' =>  'detail_map_show_short_descr',
+            'map-address' =>            'detail_map_show_address',
+            'map-street' =>             'detail_map_show_street',
+            'map-city-state-zip' =>     'detail_map_show_citystatezip',
+            'map-country' =>            'detail_map_show_country',
+            'map-region' =>             'detail_map_show_region',
+            'map-phone' =>              'detail_map_show_phone',
+            'map-toll-free' =>          'detail_map_show_tollfree',
+            'map-url' =>                'detail_map_show_url',
+            'map-url-new-target' =>     'detail_map_show_url_newtarget',
+            'map-email' =>              'detail_map_show_email',
+            'map-categories' =>         'detail_map_show_categories',
+            'map-credit-cards' =>       'detail_map_show_creditcards',
+            'map-amenities' =>          'detail_map_show_amenities',
+            'logo' =>                   'detail_show_logo',
+            'address' =>                'detail_show_address',
+            'street' =>                        'detail_show_street',
+            'city-state-zip' =>         'detail_show_citystatezip',
+            'country' =>               'detail_show_country',
+            'region' =>                        'detail_show_region',
+            'description' =>            'detail_show_descr',
+            'short-description' =>     'detail_show_short_descr',
+            'phone' =>                  'detail_show_phone',
+            'toll-free' =>              'detail_show_tollfree',
+            'url' =>                    'detail_show_url',
+            'url-new-target' =>         'detail_show_url_newtarget',
+            'email' =>                  'detail_show_email',
+            'categories' =>            'detail_show_categories',
+            'credit-cards' =>           'detail_show_creditcards',
+            'amenities' =>              'detail_show_amenities'
         )
     )
 );
index 46c23ae..ff70e93 100644 (file)
                         <tr><th>Show Coupons:</th><td><input type="checkbox" name="detail_show_coupons"{if $genSettings.fieldData.detail_show_coupons.value} checked="checked"{/if}></td></tr>
                         <tr><th>Show Packages:</th><td><input type="checkbox" name="detail_show_packages"{if $genSettings.fieldData.detail_show_packages.value} checked="checked"{/if}></td></tr>
                         <tr><th>Show Events:</th><td><input type="checkbox" name="detail_show_events"{if $genSettings.fieldData.detail_show_events.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Video:</th><td><input type="checkbox" name="detail_show_video"{if $genSettings.fieldData.detail_show_video.value} checked="checked"{/if}></td></tr>
                     </table>
                 </td>
             </tr>
index 7a0c069..5f7e71c 100644 (file)
         <!-- **** Video **** -->
         
         <table id="glm-table-video" class="glm-admin-table glm-hidden glm-member-info-table">
-            <tr>
+            <tr style="display:none">
                 <th {if $memberInfo.fieldRequired.video_type}class="glm-required"{/if}>Video Type:</th>
                 <td {if $memberInfo.fieldFail.video_type}class="glm-form-bad-input" data-tabid="glm-member-info-video"{/if}>
                     <select id="glm-video-type" name="video_type">
index e00c5bf..16225e6 100644 (file)
                     </div>
                     {/if}
                     {apply_filters('glm-member-db-front-members-detail-categoriesAfter', '', $member.id)}
+                    {apply_filters('glm-member-db-front-members-detail-videoBefore', '', $member.id)}
+                    {if $member.video_url && $settings.detail_show_video}
+                    <div id="glm-member-detail-video-toggle" class="glm-member-detail-content-toggle">Videos</div>
+                    <div id="glm-member-detail-video-container" class="glm-member-detail-content-data small-12">
+                        <table class="glm-member-detail-table">
+<!--                            <tr><th>{$terms.term_member_cap} Categories</th></tr>-->
+                            <div><h3>{$member.video_title}</h3></div>
+                            <div>{$member.video_embed}</div>
+                            <div><p>{$member.video_descr}</p></div>
+                            {foreach $member.video as $c}
+                            <tr>
+                                <td>
+                                    {if $c.parent_name}{$c.parent_name}: {/if}{$c.name}
+                                    {if $c.parent_name}{$c.parent_name}: {/if}{$c.name}
+                                </td>
+                            </tr>
+                            {/foreach}
+                        </table>
+                        <div class="glm-member-detail-sub-data-links row">
+                            <a class="left glm-member-detail-content-toggle">Collapse</a>
+                            <a class="right link-to-top">Back to top</a>
+                        </div>
+                    </div>
+                    {/if}
+                    
+                    {apply_filters('glm-member-db-front-members-detail-videoAfter', '', $member.id)}
                     
                     {apply_filters('glm-member-db-front-members-detail-dataBottom','',$member.id)}
                 </div>