From: laury Date: Thu, 12 May 2016 14:40:41 +0000 (-0400) Subject: Required page auto-creation, shortcodes, settings, views for list/detail X-Git-Tag: v2.0.0^2~21^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=36c6947b877e54f42893a9a0ffaa6d87e73dccc4;p=WP-Plugins%2Fglm-member-db.git Required page auto-creation, shortcodes, settings, views for list/detail Pages are no longer duplicated upon auto-creation if it finds a slug corresponding to the given page name: it will instead replace the option. Required pages given a different admin management display, can no longer edit ID or slug, which are instead derived through the page name. (this is not yet functional though!) Views for List and Detail have been updated. List has a new view file called 'grid' which can be selected in the options and through a shortcode. Map and search filters can now be auto-opened on page load or not dependent on an option or shortcode. Database scripts updated to suit new options. --- diff --git a/assets/filler.gif b/assets/filler.gif new file mode 100644 index 00000000..9871b2d9 Binary files /dev/null and b/assets/filler.gif differ diff --git a/assets/filler_s.gif b/assets/filler_s.gif new file mode 100644 index 00000000..8fac2643 Binary files /dev/null and b/assets/filler_s.gif differ diff --git a/assets/no-image.jpg b/assets/no-image.jpg new file mode 100644 index 00000000..dddcc249 Binary files /dev/null and b/assets/no-image.jpg differ diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index d90028c8..14e76968 100644 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -198,6 +198,15 @@ class GlmDataSettingsGeneral extends GlmDataAbstract * Front-end Member Search Options */ + + // Search Filters Opened + 'list_show_search_filters_opened' => array( + 'field' => 'list_show_search_filters_opened', + 'type' => 'checkbox', + 'default' => true, + 'use' => 'a' + ), + // Front-end Listings - Show Map 'list_show_map' => array( 'field' => 'list_show_map', @@ -404,6 +413,15 @@ class GlmDataSettingsGeneral extends GlmDataAbstract * Front-end Member Listing Map Options */ + + // Google Map Opened + 'list_map_show_opened' => array( + 'field' => 'list_map_show_opened', + 'type' => 'checkbox', + 'default' => true, + 'use' => 'a' + ), + // Front-end Listings - Map Show Detail Link 'list_map_show_detaillink' => array( 'field' => 'list_map_show_detaillink', diff --git a/config/plugin.ini b/config/plugin.ini index 9ff60f8c..72b6c7da 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -30,12 +30,17 @@ thumb['width'] = 60 thumb['height'] = null thumb['crop'] = null +grid['width'] = 360 +grid['height'] = 270 +grid['crop'] = null + [common] image_sizes['large'] = 'Large' image_sizes['medium'] = 'Medium' image_sizes['small'] = 'Small' image_sizes['thumb'] = 'Thumbnail' +image_sizes['grid'] = 'Grid' ; ; Entry Status Types diff --git a/controllers/admin.php b/controllers/admin.php index b1d52147..0d7bb79c 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -222,7 +222,7 @@ class glmMembersAdmin extends GlmPluginSupport public function createPages($requiredPages) { foreach($requiredPages as $requiredPage => $requiredPageInfo) { - $trimmedName = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$requiredPageInfo['optionSuffix']; + $trimmedName = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$requiredPageInfo['underscored_name']; if ($requiredPageInfo['parent'] == 'associate') { $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_ASSOCIATE_ID); } else if ($requiredPageInfo['parent'] == 'membersonly') { @@ -232,45 +232,106 @@ class glmMembersAdmin extends GlmPluginSupport } else { $postParent = '0'; } - if ( !get_post(get_option($trimmedName))) { - $duplicatePage = get_page_by_title($requiredPageInfo['name']); - //echo $duplicatePage; - echo $duplicatePage->title; - echo $duplicatePage->title->ID; - if ($duplicatePage->title == $requiredPageInfo['name']) { - update_option($trimmedName, $duplicatePage->ID); + $existingPost = get_post(get_option($trimmedName)); + $testSlug = get_post_field( 'post_name', $existingPost); + //$existingSlug = $existingPost->post_name; + + $newSlug = str_replace(' ','-',strtolower($requiredPageInfo['name'])); + + //$existingSlug = $this->get_post_data($newSlug, 'post_name', 'post_name'); + $existingSlug = $this->verify_post_slug($newSlug); + + + // If a post with the ID set in the option does not exist + if ( !$existingPost) { + + // If the new slug corresponds to an already existent page, yet the ID option does not exist, + // then it's either the first time this plugin is run on an outdated site or somehow the ID was + // deleted. Either way, replace the option value with whatever is the ID of the page matching + // that slug. The slug is checked by translating the page title. + //$existingPage = get_post(url_to_postid(str_replace(' ','-',strtolower($requiredPageInfo['name'])))); + //$existingPage = get_post('members-detail'); + //echo '-- PROCESSING PAGE'.str_replace(' ','-',strtolower($requiredPageInfo['name'])); + + if ($newSlug == $existingSlug) { + //echo $existingSlug; + //echo 'DUPLICATE PAGE'.$existingSlug; + + $existingID = $this->get_post_id_by_slug($newSlug); + update_option($trimmedName, $existingID); + // Otherwise create a new page } else { - $new_page = array( - 'post_title' => $requiredPageInfo['name'], - 'post_content' => $requiredPageInfo['content'], - 'post_status' => 'publish', - 'post_type' => 'page', - 'post_author' => '1', - 'page_template' => isset($requiredPageInfo['template']) ? $requiredPageInfo['template'] : 'index.php' , - 'post_parent' => $postParent - ); - $new_id = wp_insert_post($new_page); + // Put together the new page, then update the option with the new ID + $templateUsed = isset($requiredPageInfo['template']) ? $requiredPageInfo['template'] : 'index.php'; + $new_id = $this->insertReqPage( + $requiredPageInfo['name'], + $requiredPageInfo['content'], + 'publish', + 'page', + '1', + $templateUsed, + $postParent + ); update_option($trimmedName, $new_id); // Make extra page if members only is created if ($new_id == get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID)) { - $sample_page = array( - 'post_title' => 'Members Only Sample Subpage', - 'post_content' => 'This page will automatically be locked to Members Only with the members-only-template', - 'post_status' => 'publish', - 'post_type' => 'page', - 'post_author' => '1', - 'page_template' => isset($requiredPageInfo['template']) ? $requiredPageInfo['template'] : 'index.php' , - 'post_parent' => $new_id + $this->insertReqPage( + 'Members Only Sample Subpage', + 'This page will automatically be locked to Members Only with the members-only-template', + 'publish', + 'page', + '1', + $templateUsed, + $new_id ); - wp_insert_post($sample_page); + } } + } else { + +// echo " ((( slugpage ID: ".$existingID.")))"; +// echo " ((( testslug: ".$testSlug.")))"; +// echo " ((( existingslug: ".$existingSlug.")))"; +// echo '-- EXISTING PAGE '.$existingPost->ID.' - '.$existingPost->post_name; } } + } - - + + public function insertReqPage($pTitle = '--bad page--', $pContent = '', $pPublish = 'publish', $pType = 'page', $pAuthor = '1', $pTemplate = 'index.php', $pParent = '0') + { + $new_page = array( + 'post_title' => $pTitle, + 'post_content' => $pContent, + 'post_status' => $pPublish, + 'post_type' => $pType, + 'post_author' => $pAuthor, + 'page_template' => $pTemplate , + 'post_parent' => $pParent + ); + return wp_insert_post($new_page); + } + + + public function get_post_data($needle = 1, $valueField = 'post_name', $needleField = 'ID') + { + $value = $this->wpdb->get_var("SELECT $valueField FROM ".$this->wpdb->posts." WHERE $needleField = '".$needle."'"); + return $value; + } + + public function verify_post_slug($postName) + { + $value = $this->wpdb->get_var("SELECT post_name FROM ".$this->wpdb->posts." WHERE post_name = '".$postName."'"); + return $value; + } + + public function get_post_id_by_slug($postName) + { + $value = $this->wpdb->get_var("SELECT ID FROM ".$this->wpdb->posts." WHERE post_name = '".$postName."'"); + return $value; + } + /** * Get Git Branch * @@ -735,6 +796,12 @@ class glmMembersAdmin extends GlmPluginSupport '; echo ''; +// // dropdown for views + echo ''; + // show list options 'scb' = shortcode builder acronym echo '
'; echo ''; diff --git a/css/front.css b/css/front.css index 9677b780..304fb3e9 100644 --- a/css/front.css +++ b/css/front.css @@ -65,6 +65,225 @@ background: white; margin: .4em 0px .4em 0px; } +.glm-member-db-list-grid-view { + overflow: hidden; + position: relative; +} +.glm-member-list-inner-wrapper { + position: relative; +} +.glm-member-list-inner-wrapper h3 { + font-size: 24px; + line-height: 1; +} +.glm-member-db-list-grid-view .glm-member-title { + font-size: 24px; + font-weight: normal; + text-decoration: none; + text-transform: none; + line-height: 1.2; + padding-top: 10px; +} +#glm-member-list-map-toggle { + background-color: lightgrey; + position: absolute; + padding: 10px 20px; + right: 0; + top: 0; + margin: 0; + border-radius: 4px; +} +#glm-member-list-map-toggle { + +} +.glm-member-db-list-grid-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-grid-view #glm-locationMap-container { + +} +.glm-member-db-list-grid-view .glm-member-list-listing-container { + transition: all 0.5s; + padding: 0 0 0 2%; + margin-top: 30px; +} +@media (min-width: 1024px) { + .glm-member-db-list-grid-view .glm-member-list-listing-container { + float: right; + } +} +.glm-member-db-list-grid-view.filters-closed .glm-member-list-listing-container { + transition: all 0.4s; + width: 100%; + margin-top: 30px; +} +@media (min-width: 1024px) { + .glm-member-db-list-grid-view.filters-closed .glm-member-list-listing-container { + margin-top: 30px; + } + .glm-member-db-list-grid-view.filters-opened .glm-member-list-listing-container { + width: 80%; + } +} +.glm-member-db-list-grid-view #glm-member-list-filters-close { + background-color: grey; + height: 40px; + line-height: 40px; + color: white; + position: absolute; + top: 0; + right: 0; + z-index: 20; + text-decoration: none; + padding: 0 20px; + font-size: 14px; + margin: 0; + border-top-right-radius: 4px; +} +.glm-member-db-list-grid-view #glm-member-list-filters-box { + transition: all 0.5s; + max-width: 234px;; + min-width: 215px; + float: left; + position: absolute; + z-index: 10; + top: 0; + font-size: 14px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + overflow: hidden; +} +.glm-member-db-list-grid-view .glm-member-search { + padding-top: 50px; + border-top: 0; +} +.glm-member-db-list-grid-view .glm-member-search:before { + background-color: lightgrey; + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 40px; +} + +#glm-member-list-filters-wrapper { + width: 100%; + max-width: 20%; + min-width: 215px; + z-index: 10; + height: 40px; + transition: all 0.5s; + +} +.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-wrapper { + overflow: hidden; +} +.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-box { + left: -215px; + opacity: 0; + transition: all 0.5s; +} +@media (min-width: 1024px) { + .glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-box { + transition: all 0.5s; + left: -100%; + } +} +.glm-member-db-list-grid-view.filters-opened #glm-member-list-filters-box { + left: 0; +} +#glm-member-list-filters-button { + background-color: lightgrey; + padding: 10px 20px; + z-index: 20; + left: 0; + top: 0; + margin: 0; + border-radius: 4px; +} +@media (min-width: 1024px) { + #glm-member-list-filters-button { + position: absolute; + } +} +.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-button { + position: relative; +} +.glm-member-db-list-grid-view.filters-opened #glm-member-list-filters-button { + border-bottom-left-radius: 0; +} +.glm-member-db-list-grid-view.filters-closed #glm-member-list-filters-button:before { + content: "+ "; +} +.glm-member-db-list-grid-view.filters-opened #glm-member-list-filters-button:before { + content: "— "; +} +.glm-member-db-list-grid-view #glm-locationMap-container { + margin-bottom: 40px; + overflow: hidden; +} +.glm-member-db-list-grid-view.map-closed #glm-locationMap-container { + margin-bottom: 0; + height: 0; +} +.glm-member-db-list-grid-view.map-closed #glm-locationMap-container #glm-locationMap { +} +.glm-member-db-list-grid-view.map-opened #glm-locationMap-container { + +} +.glm-member-list-sub-links { + color: black; +} +.glm-member-db-list-grid-view li.glm-member-list-record { + padding: 20px 10px; +} + +.glm-member-db-list-grid-view .glm-member-list-image-wrapper { + border-radius: 4px; + border: 1px solid lightgrey; + position: relative; + display: block; + overflow: hidden; + min-height: 30px; +} +.glm-member-db-list-grid-view .glm-member-list-image-wrapper > img { + position: absolute; + min-width: 100%; + min-height: 100%; + left: 0; + top: 0; + right: 0; + bottom: 0; + margin: auto; +} +.glm-member-list-image-empty { + display: inline-block; + background-image: url("../assets/filler_s.jpg"); + max-height: 230px; + text-align: center; + background-position: center center; + background-repeat: no-repeat; + background-size: contain; +} +.glm-member-list-sub-links > a { + display: block; + float: left; + width: 33%; + text-align: center; +} +.glm-member-list-sub-links > a:first-child { +/* text-align:left;*/ +} +.glm-member-list-sub-links > a:nth-child(2) { +/* text-align: center;*/ +} +.glm-member-list-sub-links:last-child { +/* text-align: right;*/ +} #glm-directions, .glm-member-entry-container.glm-member-search { margin-top: 0; @@ -84,6 +303,10 @@ max-width: 100%; height: auto; } +.glm-member-db-list-grid-view .glm-member-list-image { + position: absolute; + width: 100%; +} .glm-member-detail-image { border-color: lightgrey; border-image: none; @@ -109,19 +332,98 @@ .glm-member-list-active-info .glm-member-title a { text-decoration: underline; } -#glm-member-db-front-container{ +.glm-member-db-list-grid-view #glm-member-db-front-container { + padding: 0; +} +#glm-member-db-front-container { padding: 0 25px; } +@media (max-width: 640px) { + #glm-member-db-front-container { + padding: 0; + } +} .glm-member-list-active-info { padding: 15px; } -/* Member Detail */ +/* + * Member List End + */ + +/* + * Member Detail Start + */ .glm-member-detail-image { margin-bottom: 1em; width: 100%; } .glm-member-detail-nameAddress { } + +#glm-member-detail-takeback { + margin-bottom: 0; + margin-top: -5px; +} +#glm-member-detail-takeback-mini { + margin-bottom: 0; + border-radius: 4px; + padding: 5px 20px; + overflow: hidden; + text-align: left; + width: 63px; + left: 15px; + -webkit-transition: width 0.5s ease; + -moz-transition: width 0.5s ease; + -o-transition: width 0.5s ease; + transition: width 0.5s ease; +} +#glm-member-detail-takeback-mini > span { + left: 63px; + overflow: hidden; + position: absolute; + top: 8px; + width: 100px; +} +#glm-member-detail-takeback-mini:hover { + text-decoration: none; + width: 170px; + -webkit-transition: width 0.5s ease; + -moz-transition: width 0.5s ease; + -o-transition: width 0.5s ease; + transition: width 0.5s ease; +} +#glm-member-detail-takeback-mini:before { + content: '\21A9'; + font-size: 28px; + line-height: 1; +} +#glm-member-detail-takeback-mini:hover:after { + padding-left: 5px; + font-size: 20px; +} +#glm-member-detail-side-box { + padding: 0px; + border-radius: 4px; + overflow: hidden; +} +#glm-member-detail-website-link { + font-size: 24px; + margin: 0; + text-align: center; + padding: 15px; +} +#glm-member-detail-website-link a { + color: white; +} +#glm-member-detail-contact-info { + background-color: #2C296D; + padding: 15px; + color: white; + font-size: 18px; +} +.glm-member-detail-contact-phone { + margin-top: 10px; +} #glm-member-detail-info > * { line-height: 1.2; } @@ -135,18 +437,22 @@ #glm-member-detail-container h2 { color: #92a682; } +#glm-member-detail-container .glm-member-title { + font-size: 28px; +} #glm-member-detail-sidemenu { clear: left; } -#glm-member-detail-data { - border-left: 1px solid lightgrey; -} .glm-member-detail-items { margin-top: .5em; } .glm-member-detail-featured-image-wrapper { padding: 0; overflow: hidden; + clear: both; + max-height: 360px; + border-radius: 4px; + margin-bottom: 10px; } .glm-member-detail-featured-image-wrapper img { float: right; @@ -155,9 +461,24 @@ .glm-package-detail-featured-image-wrapper img { float: right; } -#glm-member-detail-images-container img { +#glm-member-detail-images-container ul { + margin: 0; +} +#glm-member-detail-images-container ul li { + margin-bottom: 20px; + max-height: 150px; + overflow: hidden; + padding: 0 10px; border-radius: 2px; } +@media (max-width: 640px) { + #glm-member-detail-images-container ul li { + padding: 0; + } +} +#glm-member-detail-images-container img { + width: 100%; +} .glm-member-button, input[type="submit"].glm-member-button { padding: 10px 20px; @@ -170,11 +491,18 @@ input[type="submit"].glm-member-button { } #glm-member-detail-container { background: white none repeat scroll 0 0; - border: 1px solid #ccc; margin: 20px 0 0; } #glm-member-detail-container > div { - margin: 0 -0.9375rem; + +} +#glm-member-detail-descr-row { + padding: 0 0 0 40px; +} +@media (max-width: 640px) { + #glm-member-detail-descr-row { + padding: 40px 0; + } } .glm-member-container { line-height: 1.3; @@ -190,21 +518,88 @@ input[type="submit"].glm-member-button { .glm-member-container a:hover { cursor: pointer; } -#glm-member-detail-sidemenu .glm-member-detail-table td { - cursor: pointer; +#glm-member-detail-container #glm-locationMap-container { + height: 0; + overflow: hidden; } -#glm-member-detail-sidemenu .glm-member-detail-table td.selected { - box-shadow: 1px 2px 5px 2px lightgrey inset; +#MemberDrivingDirectionSubmit { + border: 0; } -#glm-member-detail-sidemenu .glm-member-detail-table td:hover { - box-shadow: 1px 1px 5px 3px lightgrey; - border-radius: 2px; +#glm-member-detail-container #glm-locationMap { + margin: 0; + padding: 0; + width: 100%; + border: 0; +} +#glm-member-detail-container .map-button { + width: 50%; + font-size: 16px; + padding: 7px; + height: 35px; + margin: 0; + float: left; + text-transform: uppercase; +} +#glm-member-detail-intro-desc { + clear: both; +} +.glm-member-detail-content-data { + padding: 10px; + display: none; +} +#glm-member-detail-description-container { +/* display: block;*/ +} +#glm-member-detail-fullprofile-toggle { + text-align: center; + padding: 3px 6px; + margin: 10px; + border: 1px solid lightgrey; + border-radius: 3px; + float: right; + width: 85px; +} +#glm-member-detail-fullprofile-toggle:hover { + box-shadow: 1px 1px 4px lightgrey inset; + cursor: pointer; +} +#glm-member-detail-fullprofile-toggle.selected { + box-shadow: 1px 1px 2px lightgrey inset; + cursor: pointer; +} +#glm-member-detail-data-container { + display: block; + clear: both; } -#glm-member-detail-sidemenu table { +#glm-member-detail-data-container > .glm-member-detail-content-toggle { width: 100%; -} -#glm-member-detail-container #glm-locationMap-container { - padding: 0; + border-radius: 4px; + background: #fefefe; + color: #57b649; + font-size: 18px; + padding: 10px; +} +#glm-member-detail-data-container > .glm-member-detail-content-toggle:nth-child(n-1) { + border-width: 0 0 1px 0; + border-style: solid; + border-color: lightgrey; +} +#glm-member-detail-data-container > .glm-member-detail-content-toggle:hover { + cursor: pointer; + box-shadow: 1px 1px 4px lightgrey inset; +} +#glm-member-detail-data-container > .glm-member-detail-content-toggle:after { + content: "+"; + float: right; + font-size: 24px; + line-height: 1; +} +#glm-member-detail-data-container > .glm-member-detail-content-toggle.selected { + box-shadow: 1px 1px 4px lightgrey inset; +} +#glm-member-detail-data-container > .glm-member-detail-content-toggle.selected:after { + content: "-"; + font-size: 28px; } .glm-member-detail-table { width: 100%; @@ -212,7 +607,16 @@ input[type="submit"].glm-member-button { .glm-member-detail-table tbody tr th { background-color: #c4e2f0; } -/* Alpha Lists */ +.glm-member-detail-sub-data-links { + padding: 10px; +} +/* + * Member Detail End + */ + +/* + * Alpha Lists Start + */ .glm-alpha-links { clear: both; } @@ -230,16 +634,22 @@ input[type="submit"].glm-member-button { background-color: blue; color: white; } +/* + * Alpha Links End + */ -/* Maps */ +/* + * Map Start + */ .glm-map { width: 100%; - height:200px; + height:400px; border-color: lightgrey; border-image: none; - border-style: solid none solid solid; - border-width: 2px 0 2px 2px; - margin: 10px 0 10px 0; + border-style: solid; + border-width: 1px; +/* margin: 10px 0 10px 0;*/ + margin: 0 auto; } /* overrride whatever was causing the 100% width for images in Google Maps */ .glm-map img { @@ -258,9 +668,13 @@ input[type="submit"].glm-member-button { line-height: 1.2; margin: 3px 0 0; } +/* + * Map End + */ - -/* Specific Divs */ +/* + * Specific Divs Start + */ #glm-directions { padding: 1em; } @@ -270,7 +684,6 @@ input[type="submit"].glm-member-button { .glm-member-list-links a, #glm-member-detail-list-links a { display: inline; - text-decoration: underline; margin-right: 15px; } #glm-member-detail-social { @@ -279,12 +692,6 @@ input[type="submit"].glm-member-button { #glm-member-detail-social a { margin-right: 5px; } - -#glm-member-detail-description-container { - padding: 10px; - padding-top: 10px; - padding-bottom: 10px; -} .glm-member-detail-border { border: 1px solid lightgrey; padding: 10px; @@ -308,7 +715,7 @@ input[type="submit"].glm-member-button { margin-top: -45px; } @media (max-width: 1024px) { - #glm-member-detail-data > div { + #glm-member-detail-data-container > div { margin: 0 auto; padding: 10px 0; } @@ -330,34 +737,13 @@ input[type="submit"].glm-member-button { } } @media (min-width: 1024px) { - #glm-member-detail-sidemenu, - #glm-member-detail-data > div { - padding: 10px 40px 10px 10px; - } - .glm-member-detail-featured-image-wrapper { - border-top-right-radius: 3px; - } - .glm-member-list-image-wrapper { - border-bottom-left-radius: 4px; - border-top-left-radius: 4px; - } - .glm-member-list-active-info { - left: initial; - } } @media (max-width: 640px) { - .glm-member-detail-featured-image-wrapper { - text-align: center; - } #glm-member-detail-container { margin: 20px 0 100px; } - .glm-member-detail-featured-image-wrapper img { - float: none; - margin: 0 auto; - } .glm-member-list-image-border { margin: 0 auto; } @@ -372,7 +758,7 @@ input[type="submit"].glm-member-button { padding: 15px; } #glm-member-detail-sidemenu, - #glm-member-detail-data > div { + #glm-member-detail-data-container > div { padding: 10px; } diff --git a/defines.php b/defines.php index 211d1d7d..7660cb77 100644 --- a/defines.php +++ b/defines.php @@ -40,6 +40,7 @@ $WPUploadDir = wp_upload_dir(); define('GLM_MEMBERS_SITE_BASE_URL', home_url('/') ); define('GLM_MEMBERS_PLUGIN_URL', plugin_dir_url(__FILE__)); define('GLM_MEMBERS_PLUGIN_ADMIN_URL', admin_url('admin.php')); +define('GLM_MEMBERS_PLUGIN_ASSETS_URL', GLM_MEMBERS_PLUGIN_URL.'/assets'); define('GLM_MEMBERS_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_PLUGIN_SLUG); define('GLM_MEMBERS_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]); define('GLM_MEMBERS_PLUGIN_MEDIA_URL', $WPUploadDir['baseurl'].'/'.GLM_MEMBERS_PLUGIN_SLUG); diff --git a/index.php b/index.php index 1e4150f3..da3de120 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.4'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.5'); // 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/js/front.js b/js/front.js index fe7e3d25..129bf6ba 100644 --- a/js/front.js +++ b/js/front.js @@ -1,2 +1,9 @@ - + jQuery("#MemberDrivingDirectionsForm").submit(function(){ + var place = jQuery("#MemberLocation").val().replace( new RegExp( " ", "g" ), '+' ); + var lat = jQuery("#MemberLat").val(); + var lon = jQuery("#MemberLon").val(); + var url = "https://maps.google.com/maps?daddr=" + place + "%40" + lat + "," + lon; + window.open(url, '_blank'); + return false; + }); /* Nothing here yet */ \ No newline at end of file diff --git a/js/shortcodeBuilder.js b/js/shortcodeBuilder.js index 9d52eb7c..ed2cb81c 100644 --- a/js/shortcodeBuilder.js +++ b/js/shortcodeBuilder.js @@ -13,7 +13,7 @@ jQuery(document).ready(function ($) { $("#detailBtn").hide(); $("[id$=-scDropdown]").hide(); $("#packageListAttr").hide(); - + // fire core events when switching between shortcodes $("#shortcodeDropdown").on("change", function () { // reset the dropdowns and checkbox if when switching shortcodes @@ -38,6 +38,8 @@ jQuery(document).ready(function ($) { $("#category-scDropdown").show(); $("#blank-start-scDropdown").show(); $("#id-scDropdown").hide(); + $("#view-scDropdown").show(); + $("#map-collapsed-scDropdown").show(); $("[id^='packageList']").hide(); } diff --git a/models/admin/management/index.php b/models/admin/management/index.php index c8023645..2c7ff611 100644 --- a/models/admin/management/index.php +++ b/models/admin/management/index.php @@ -124,12 +124,13 @@ class GlmMembersAdmin_management_index extends GlmDataSettingsGeneral } foreach ($this->config['addOns'] as $a) { + if (isset($a['requiredPages'])) { foreach($a['requiredPages'] as $pageName => &$pageData) { //echo $pageName; - $pageID = get_option(GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$pageData['optionSuffix']); + $pageID = get_option(GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$pageData['underscored_name']); $pageData['id'] = $pageID; - $pageData['slug'] = str_replace(' ','_',strtolower($pageData['name'])); + $pageData['slug'] = str_replace(' ','-',strtolower($pageData['name'])); echo get_the_title($pageID); //$pageData['name'] = single_post_title(get_post(get_option($pageID))); } diff --git a/models/front/members/list.php b/models/front/members/list.php index 491b7252..09fa3ed4 100644 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -16,6 +16,7 @@ // Translation table for [glm-members-list] "show" options to configuration parameters $GLOBALS['showOpts'] = array( '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', @@ -34,6 +35,7 @@ $GLOBALS['showOpts'] = array( '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', @@ -430,7 +432,26 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo $alphaList = $this->getAlphaList(' AND '.$where, $alphaSelected); } + + // Check whether search filters open by default + if ($this->config['settings']['list_show_search_filters_opened'] == 1) { + $filtersOpened = true; + } + + // Check whether map opens by default + if ($this->config['settings']['list_map_opened'] == 1) { + $mapOpened = true; + } + /* + * Check for which view file to use, else default to bars + */ + $view = "front/members/grid.html"; + if (isset($actionData['request']['view']) && + strtolower($actionData['request']['view']) == "grid") { + $view = "front/members/grid.html"; + } + /* * Check for a blank start - No members selected, just search form */ @@ -490,7 +511,7 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo 'amenSelected' => $amenSelected, 'alphaList' => $alphaList, 'alphaSelected' => $alphaSelected, - 'blankStart' => $blankStart + 'blankStart' => $blankStart, ); // Return status, suggested view, and data to controller - also return any modified settings @@ -498,7 +519,7 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo 'status' => $success, 'menuItemRedirect' => false, 'modelRedirect' => false, - 'view' => 'front/members/list.html', + 'view' => $view, 'data' => $templateData, 'settings' => $settings ); diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 00000000..4b714368 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,2 @@ +index.file=index.php +url=http://localhost/glm-member-db/ diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 00000000..d37ef956 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_54 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 00000000..04983684 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + glm-member-db + + + diff --git a/setup/databaseScripts/create_database_V1.1.4.sql b/setup/databaseScripts/create_database_V1.1.4.sql deleted file mode 100644 index bd24525d..00000000 --- a/setup/databaseScripts/create_database_V1.1.4.sql +++ /dev/null @@ -1,479 +0,0 @@ --- Gaslight Media Members Database --- File Created: 12/09/14 15:27:15 --- Database Version: 1.1.4 --- 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 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_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.5.sql b/setup/databaseScripts/create_database_V1.1.5.sql new file mode 100644 index 00000000..5d0496a4 --- /dev/null +++ b/setup/databaseScripts/create_database_V1.1.5.sql @@ -0,0 +1,481 @@ +-- 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 '1', + 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 '1', + 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/dbVersions.php b/setup/databaseScripts/dbVersions.php index 2337d535..c0445bbd 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -35,7 +35,8 @@ $glmMembersDbVersions = array( '1.1.1' => array('version' => '1.1.1', 'tables' => 13), '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.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') ); diff --git a/setup/databaseScripts/drop_database_V1.1.4.sql b/setup/databaseScripts/drop_database_V1.1.4.sql deleted file mode 100644 index 17b02fda..00000000 --- a/setup/databaseScripts/drop_database_V1.1.4.sql +++ /dev/null @@ -1,23 +0,0 @@ --- Gaslight Media Members Database --- File Created: 12/09/14 15:27:15 --- Database Version: 1.1.1 --- Database Deletion Script --- Note: Tables with DELETE CASCADE must appear before referenced table - -DROP TABLE IF EXISTS - {prefix}amenities, - {prefix}amenity_ref, - {prefix}category_member_info, - {prefix}cities, - {prefix}images, - {prefix}files, - {prefix}members, - {prefix}member_info, - {prefix}member_type, - {prefix}regions, - {prefix}settings_general, - {prefix}settings_terms, - {prefix}settings_theme, - {prefix}categories -; - diff --git a/setup/databaseScripts/drop_database_V1.1.5.sql b/setup/databaseScripts/drop_database_V1.1.5.sql new file mode 100644 index 00000000..10010336 --- /dev/null +++ b/setup/databaseScripts/drop_database_V1.1.5.sql @@ -0,0 +1,23 @@ +-- Gaslight Media Members Database +-- File Created: 12/09/14 15:27:15 +-- Database Version: 1.1.5 +-- Database Deletion Script +-- Note: Tables with DELETE CASCADE must appear before referenced table + +DROP TABLE IF EXISTS + {prefix}amenities, + {prefix}amenity_ref, + {prefix}category_member_info, + {prefix}cities, + {prefix}images, + {prefix}files, + {prefix}members, + {prefix}member_info, + {prefix}member_type, + {prefix}regions, + {prefix}settings_general, + {prefix}settings_terms, + {prefix}settings_theme, + {prefix}categories +; + diff --git a/setup/databaseScripts/update_database_V1.1.5.sql b/setup/databaseScripts/update_database_V1.1.5.sql new file mode 100644 index 00000000..24a28224 --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.5.sql @@ -0,0 +1,15 @@ +-- Gaslight Media Members Database +-- File Created: 5/11/16 13:50:15 +-- Database Version: 1.1.5 +-- 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 + +-- Default Search Filters Display Settings entry +ALTER TABLE {prefix}settings_general ADD COLUMN list_show_search_filters_opened BOOLEAN; + +---- + +-- Default List Map Display Settings entry +ALTER TABLE {prefix}settings_general ADD COLUMN list_map_show_opened BOOLEAN; \ No newline at end of file diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 0cf62fef..310ed048 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -81,6 +81,39 @@ if (!function_exists('is_in_tree')) { return false; } } + +/* + * This function makes it easier to get the slug of a post, which WP does not + * natively do. + */ +if (!function_exists('get_the_slug')) { +function get_the_slug( $id=null ){ + if( empty($id) ): + global $post; + if( empty($post) ) + return ''; // No global $post var available. + $id = $post->ID; + endif; + $slug = basename( get_permalink($id) ); + return $slug; + } +} + +/* + * This function makes it easier to get a page ID using the page SLUG, which + * WP does not natively do. + */ +if (!function_exists('get_id_by_slug')) { + function get_id_by_slug($page_slug) { + $page = get_page_by_path($page_slug); + if ($page) { + return $page->ID; + } else { + return null; + } + } +} + /* * This function will make any page that is under the Members Only page * (derived from an option) use the members only template when displaying, diff --git a/setup/requiredPages.php b/setup/requiredPages.php index 803bf7ad..a3d3c047 100644 --- a/setup/requiredPages.php +++ b/setup/requiredPages.php @@ -43,7 +43,7 @@ $glmMembersRequiredPages = array( 'name' => 'GLM Associate', 'content' => '', 'parent' => '0', - 'optionSuffix' => 'glm_associate_id', + 'underscored_name' => 'glm_associate_id', ), // These should be in GLM Members 'Members Only' => array( @@ -51,18 +51,18 @@ $glmMembersRequiredPages = array( 'content' => 'This page and any child beneath it will automatically be locked to Members Only with the members-only-template.', 'parent' => '0', 'template' => 'glm-members-only-template.php', - 'optionSuffix' => 'members_only_id', + 'underscored_name' => 'members_only_id', ), 'Members List' => array( 'name' => 'Members List', 'content' => '[glm-members-list]', 'parent' => 'associate', - 'optionSuffix' => 'members_list_id', + 'underscored_name' => 'members_list_id', ), 'Members Detail' => array( 'name' => 'Members Detail', 'content' => '[glm-member-detail]', 'parent' => 'associate', - 'optionSuffix' => 'member_detail_id', + 'underscored_name' => 'member_detail_id', ) ); diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 9f2ede3e..b7dc61f2 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -73,7 +73,9 @@ $glmMembersShortcodes = array( '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', @@ -92,6 +94,7 @@ $glmMembersShortcodes = array( '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', @@ -205,7 +208,7 @@ $glmMembersShortcodesDescription = '

- +   show="{ content to show }" @@ -238,6 +241,7 @@ $glmMembersShortcodesDescription = ' allnone Map Options mapmap-name-linkmap-logo + map-collapsedmap-collapsedmap-collapsed map-descriptionmap-short-descriptionmap-address map-streetmap-city-state-zipmap-country map-regionmap-phonemap-toll-free @@ -257,6 +261,23 @@ $glmMembersShortcodesDescription = '

+ +   + + view="{ view to use }" + + +

+ Current options available are: bars (default), grid +

+

+ The "view" attribute tells the page which view file to use. The "bars" value will display + by default, and features a succession of page-wide bars containing an image, member contact + info, and the short description. The "grid" value will display a three-columned series of + rows showing the featured image or logo, and below it simply the name and a few links. +

+ + diff --git a/setup/standardTemplateParams.php b/setup/standardTemplateParams.php index b5090be5..f2dde165 100644 --- a/setup/standardTemplateParams.php +++ b/setup/standardTemplateParams.php @@ -25,6 +25,7 @@ // Common to both admin and front-end $smarty->templateAssign('glmPluginName', GLM_MEMBERS_PLUGIN_NAME ); $smarty->templateAssign('siteBaseUrl', GLM_MEMBERS_SITE_BASE_URL); +$smarty->templateAssign('assetsUrl', GLM_MEMBERS_PLUGIN_ASSETS_URL); $smarty->templateAssign('baseUrl', GLM_MEMBERS_PLUGIN_BASE_URL); $smarty->templateAssign('thisUrl', GLM_MEMBERS_PLUGIN_CURRENT_URL ); $smarty->templateAssign('glmPluginMediaUrl', GLM_MEMBERS_PLUGIN_MEDIA_URL ); diff --git a/views/admin/management/index.html b/views/admin/management/index.html index 0605566c..cb5a8e30 100644 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@ -12,7 +12,7 @@ Member List Options Member Detail Options {if $settingsUpdated}Settings Updated{/if} - {if $requiredPageUpdateError}{$requiredPageUpdateError}{/if} + {if $settingsUpdateError}Settings Update Error{/if} @@ -33,12 +33,12 @@ - + Page Slug @@ -146,6 +146,8 @@ + + @@ -192,11 +194,12 @@ diff --git a/views/front/members/detail.html b/views/front/members/detail.html index fcb69d5a..12e65d1d 100644 --- a/views/front/members/detail.html +++ b/views/front/members/detail.html @@ -1,21 +1,18 @@ {include file='front/members/header.html'} - + {apply_filters('glm-member-db-front-members-detail-pageTop', '', $member.id)} {if $haveMember} -MEMBER ID = {$member.id} - + {if $settings.detail_show_map} -
+ {/if} {if $settings.detail_show_directions} -
+ + - Doesn't seem to work
@@ -44,37 +41,46 @@ MEMBER ID = {$member.id}
- + --> {/if} +
+
-
-
- -

- {$member.member} -

- {if $settings.detail_show_address} - {apply_filters('glm-member-db-front-members-detail-addressTop', '', $member.id)} - {if $settings.detail_show_street} - {if $member.addr1}
{$member.addr1}
{/if} - {if $member.addr2}
{$member.addr2}
{/if} - {/if} - {if $settings.detail_show_citystatezip} - {if $member.city}{$member.city}{if $member.state.value}, {/if}{/if}{if $member.state.value}{$member.state.value}{/if}{if $member.zip} {$member.zip}{/if} - {/if} - {if $member.country.name && $settings.detail_show_country}
{$member.country.name}
{/if} - {apply_filters('glm-member-db-front-members-detail-addressBottom', '', $member.id)} - {/if} +

{$member.member}

+
+ {if $member.logo && $settings.detail_show_logo} +
+ + +
+ {/if} + +
+ + + {if $settings.detail_show_address} + {apply_filters('glm-member-db-front-members-detail-addressTop', '', $member.id)} + {if $settings.detail_show_street} + {if $member.addr1}
{$member.addr1}
{/if} + {if $member.addr2}
{$member.addr2}
{/if} + {/if} + {if $settings.detail_show_citystatezip} + {if $member.city}{$member.city}{if $member.state.value}, {/if}{/if}{if $member.state.value}{$member.state.value}{/if}{if $member.zip} {$member.zip}{/if} + {/if} + {if $member.country.name && $settings.detail_show_country}
{$member.country.name}
{/if} + {apply_filters('glm-member-db-front-members-detail-addressBottom', '', $member.id)} + {/if} {apply_filters('glm-member-db-front-members-detail-otherDetailTop', '', $member.id)} - {if $member.phone && $settings.detail_show_phone}
Phone: {$member.phone}
{/if} - {if $member.toll_free && $settings.detail_show_tollfree}
Toll Free: {$member.toll_free}
{/if} {if $member.region && $settings.detail_show_region}
Region: {$member.region}
{/if} -
+ {if $member.phone && $settings.detail_show_phone}
Phone: {$member.phone}
{/if} + {if $member.toll_free && $settings.detail_show_tollfree}
Toll Free: {$member.toll_free}
{/if} {apply_filters('glm-member-db-front-members-detail-otherDetailBottom', '', $member.id)} -
- - {if $member.logo && $settings.detail_show_logo} - -
+
{apply_filters('glm-member-db-front-members-detail-attributesTop', '', $member.id)} -
-
Show Member Name as Link to Detail:
Map Opened by Default:
Show Logo:
Search Form Options: + - +
Text Search:
Category Search:
Amenities Search:
Show Alpha Index:
(Grid) Filter Box Opened by Default:
- {apply_filters('glm-member-db-front-members-detail-sidemenuTop', '', $member.id)} - - - - {if $settings.detail_show_imagegallery && $haveImageGallery} - - {/if} - {if $member.amenities && $settings.detail_show_amenities} - - {/if} - {if $member.cc_type && $settings.detail_show_creditcards} - - {/if} - {if $member.categories && $settings.detail_show_categories} - - {/if} - {if $settings.detail_show_coupons && $coupons} - - {/if} - {apply_filters('glm-member-db-front-members-detail-sidemenuBottom', '', $member.id)} -
Member Info
Full profile
Description
Image Gallery
Amenities & Services
Accepted Credit Cards
Categories
Coupons
+ + +
+ {if $member.short_descr && $settings.detail_show_short_descr}{$member.short_descr|nl2br}{/if}
-
-
-
- {apply_filters('glm-member-db-front-members-detail-descriptionTop', '', $member.id)} - {if $member.descr && $settings.detail_show_descr}{$member.descr|nl2br}{/if} - {if $member.short_descr && $settings.detail_show_short_descr}{$member.short_descr|nl2br}{/if} - {apply_filters('glm-member-db-front-members-detail-descriptionBottom', '', $member.id)} -
+
Expand All
+
+
Description
+
+ {if $member.descr && $settings.detail_show_descr} + {apply_filters('glm-member-db-front-members-detail-descriptionTop', '', $member.id)} + {$member.descr|nl2br} + {apply_filters('glm-member-db-front-members-detail-descriptionBottom', '', $member.id)} + {/if} +
{apply_filters('glm-member-db-front-members-detail-descriptionAfter', '', $member.id)} {if $settings.detail_show_imagegallery && $haveImageGallery} -
+
Photos
+
{apply_filters('glm-member-db-front-members-detail-galleryTop', '', $member.id)} - -

Photo Gallery

+ -
-
    +
      {foreach $imageGallery as $i}
    • {/foreach}
    -
{apply_filters('glm-member-db-front-members-detail-galleryBottom', '', $member.id)} +
{/if} {if $member.amenities && $settings.detail_show_amenities} -
+
Amenities & Services
+
- + {foreach $member.amenities as $a} {/foreach}
Amenities & Services
@@ -163,26 +170,34 @@ MEMBER ID = {$member.id}
+
{/if} {if $member.cc_type && $settings.detail_show_creditcards} -
-

- - - {foreach $member.cc_type.names as $c} - - {/foreach} -
Credit Cards Accepted:
{$c}
-

+
Credit Cards
+
+ + + {foreach $member.cc_type.names as $c} + + {/foreach} +
{$c}
+
{/if} {if $member.categories && $settings.detail_show_categories} -
+
Categories
+
- + {foreach $member.categories as $c} {/foreach}
{$terms.term_member_cap} Categories
@@ -191,12 +206,21 @@ MEMBER ID = {$member.id}
+
{/if} {if $settings.detail_show_coupons && $coupons} -
+
Coupons
+ {/if} @@ -215,55 +239,73 @@ MEMBER ID = {$member.id} {apply_filters('glm-member-db-front-members-detail-jqueryScriptTop', '', $member.id)} jQuery(document).ready(function($) { - - $("#glm-member-detail-data").children().not("#glm-member-detail-description-container").hide(); - - $("#glm-member-detail-fullprofile-button").click(function() { - if ( $("#glm-member-detail-data").css('display') == 'none') { - $("#glm-member-detail-data").show().children().show(); - $("#glm-member-detail-sidemenu table tr td").addClass("selected"); - } else if ($("#glm-member-detail-fullprofile-button").hasClass("selected")) { - $("#glm-member-detail-data").hide(); - $("#glm-member-detail-data > div").hide(); - $("#glm-member-detail-sidemenu table tr td").removeClass("selected"); + + $('.link-to-top').click(function () { + $('body,html').animate({ + scrollTop: $("#glm-member-detail-takeback-mini").offset().top + }, 75); + }); + + $(".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 { - $("#glm-member-detail-data").show().children().show(); - $("#glm-member-detail-sidemenu table tr td").addClass("selected"); + var target = $(this).attr("id").slice(0, -7); } - }); - $("#glm-member-detail-sidemenu table tr td").not("#glm-member-detail-description-button").not("#glm-member-detail-fullprofile-button").on("click", function( e ) { - var target = $(this).attr("id").slice(0, -7); - if ( $("#"+target+"-container").css('display') == 'none' ){ - $("#glm-member-detail-data").show().children().hide(); - $("#"+target+"-container").show(); - $("#glm-member-detail-sidemenu table tr td").removeClass("selected"); - $(this).addClass("selected"); - } else { - $("#"+target+"-container").hide(); - $(this).removeClass("selected"); - $("#glm-member-detail-fullprofile-button").removeClass("selected"); - $("#glm-member-detail-data").show().children().hide(); - $("#glm-member-detail-sidemenu table tr td").removeClass("selected"); - } - }); - - $("#glm-member-detail-description-button" ).click(function() { - if ( $("#glm-member-detail-description-container").css('display') == 'none' ){ - $("#glm-member-detail-data").show().children().hide(); - $("#glm-member-detail-description").show(); - $("#glm-member-detail-description-container").show(); - $("#glm-member-detail-sidemenu table tr td").removeClass("selected"); - $("#glm-member-detail-description-button").addClass("selected"); + $("#"+target+"-container").slideToggle("fast", "swing", function() {}); + $("#"+target+"-toggle").toggleClass("selected"); + + 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-description-container").hide(); - $("#glm-member-detail-data").show().children().hide(); - $("#glm-member-detail-description-button").removeClass("selected"); - $("#glm-member-detail-fullprofile-button").removeClass("selected"); - $("#glm-member-detail-sidemenu table tr td").removeClass("selected"); + $("#glm-member-detail-fullprofile-toggle").removeClass("selected"); } }); - + $("#glm-member-detail-fullprofile-toggle").click(function() { + if ($(this).hasClass("selected")) { + $(".glm-member-detail-content-data").slideUp(175, "swing", function() {}); + $(".glm-member-detail-content-toggle").removeClass("selected"); + $(this).toggleClass("selected"); + } else { + $(".glm-member-detail-content-data").not($(this)).slideDown(350, "swing", function() {}); + $(".glm-member-detail-content-toggle").addClass("selected"); + $(this).toggleClass("selected"); + } + }); + + $("#glm-member-detail-takeback-mini").click(function() { + $("#glm-member-detail-takeback-mini span").html("Loading"); + $("#glm-member-detail-takeback-mini").css('min-width','170px'); + var count = 0; + setInterval(function(){ + count++; + var dots = new Array(count % 5).join(' .'); + $('#glm-member-detail-takeback-mini span').html("Loading ." + dots); + }, 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 = 200; + mapV = 'visible'; + mapBtnTxt = 'hide map' + } + $(mapC).animate({ + overflow: mapOverflow, + height: mapNewH + }, 200, "swing", function() { + + }); + $(this).html(mapBtnTxt); + }); + {if $settings.detail_show_map} /* * Google Maps @@ -328,86 +370,86 @@ MEMBER ID = {$member.id} {/if} {*detail_show_map*} - - {if $settings.detail_show_directions} - - var directionsDisplay; - var directionsService = new google.maps.DirectionsService(); - - // Display map with route from specified location to member location - function calcRoute() { - - // If an address was input, use that, otherwise use detected location if available - var start = $('#glm-startLocation').val(); - if (start == '' ) { - if (myLocation != false) { - start = myLocation; - } - } - - // If no start location available, tell user - if (start == '') { - alert('No starting location. Please enter address.'); - return; - } - - // Switch to directions map being visible - $('#glm-directionsMap-container').removeClass('glm-hidden'); - $('#glm-locationMap-container').addClass('glm-hidden'); - $('#glm-showLocationButton').removeClass('glm-hidden'); - - // Initialize the directions map with a default center location - directionsDisplay = new google.maps.DirectionsRenderer(); - var mapOptions = { - zoom:7, - center: memberlocation - } - directionsMap = new google.maps.Map(document.getElementById("glm-directionsMap"), mapOptions); - directionsDisplay.setMap(directionsMap); - - // Get directions type selected - var directionsType = $('#directionsType').find(':selected').val(); - - // Specify origin and destination then get route - var request = { - origin: start, - destination: memberlocation, - travelMode: google.maps.TravelMode[directionsType] - }; - directionsService.route(request, function(result, status) { - if (status == google.maps.DirectionsStatus.OK) { - directionsDisplay.setDirections(result); - $('#directions-panel').html(''); - directionsDisplay.setPanel(document.getElementById('directions-panel')); - } - }); - - // Check for first map idle (completely loaded) - Check max initial zoom - var mapLoadedListener = google.maps.event.addListener(directionsMap, 'idle', function() { - if (directionsMap.getZoom() > 16) { - this.setZoom(16); - } - google.maps.event.removeListener(mapLoadedListener); - }); - - } - - // Trigger route map either by button or input of address - $('#glm-showDirectionsButton' ).click( function() { - calcRoute(); - }); - $('#glm-startLocation' ).change( function() { - calcRoute(); - }); - - // Switch back to member location map - $('#glm-showLocationButton').click( function() { - $('#glm-directionsMap-container').addClass('glm-hidden'); - $('#glm-locationMap-container').removeClass('glm-hidden'); - $('#glm-showLocationButton').addClass('glm-hidden'); - }); - - {/if} {*detail_show_directions*} +// +// {if $settings.detail_show_directions} +// +// var directionsDisplay; +// var directionsService = new google.maps.DirectionsService(); +// +// // Display map with route from specified location to member location +// function calcRoute() { +// +// // If an address was input, use that, otherwise use detected location if available +// var start = $('#glm-startLocation').val(); +// if (start == '' ) { +// if (myLocation != false) { +// start = myLocation; +// } +// } +// +// // If no start location available, tell user +// if (start == '') { +// alert('No starting location. Please enter address.'); +// return; +// } +// +// // Switch to directions map being visible +// $('#glm-directionsMap-container').removeClass('glm-hidden'); +// $('#glm-locationMap-container').addClass('glm-hidden'); +// $('#glm-showLocationButton').removeClass('glm-hidden'); +// +// // Initialize the directions map with a default center location +// directionsDisplay = new google.maps.DirectionsRenderer(); +// var mapOptions = { +// zoom:7, +// center: memberlocation +// } +// directionsMap = new google.maps.Map(document.getElementById("glm-directionsMap"), mapOptions); +// directionsDisplay.setMap(directionsMap); +// +// // Get directions type selected +// var directionsType = $('#directionsType').find(':selected').val(); +// +// // Specify origin and destination then get route +// var request = { +// origin: start, +// destination: memberlocation, +// travelMode: google.maps.TravelMode[directionsType] +// }; +// directionsService.route(request, function(result, status) { +// if (status == google.maps.DirectionsStatus.OK) { +// directionsDisplay.setDirections(result); +// $('#directions-panel').html(''); +// directionsDisplay.setPanel(document.getElementById('directions-panel')); +// } +// }); +// +// // Check for first map idle (completely loaded) - Check max initial zoom +// var mapLoadedListener = google.maps.event.addListener(directionsMap, 'idle', function() { +// if (directionsMap.getZoom() > 16) { +// this.setZoom(16); +// } +// google.maps.event.removeListener(mapLoadedListener); +// }); +// +// } +// +// // Trigger route map either by button or input of address +// $('#glm-showDirectionsButton' ).click( function() { +// calcRoute(); +// }); +// $('#glm-startLocation' ).change( function() { +// calcRoute(); +// }); +// +// // Switch back to member location map +// $('#glm-showLocationButton').click( function() { +// $('#glm-directionsMap-container').addClass('glm-hidden'); +// $('#glm-locationMap-container').removeClass('glm-hidden'); +// $('#glm-showLocationButton').addClass('glm-hidden'); +// }); +// +// {/if} {*detail_show_directions*} {apply_filters('glm-member-db-front-members-detail-jqueryScriptBottom', '', $member.id)} diff --git a/views/front/members/grid.html b/views/front/members/grid.html new file mode 100644 index 00000000..35740863 --- /dev/null +++ b/views/front/members/grid.html @@ -0,0 +1,370 @@ +
+{include file='front/members/header.html'} + + {apply_filters('glm-member-db-front-members-list-pageTop', '')} + + {if $settings.list_show_map} + + {apply_filters('glm-member-db-front-members-list-mapTop', '')} +
+
(map loads here)
+
+ {apply_filters('glm-member-db-front-members-list-mapBottom', '')} + {/if} +{apply_filters('glm-member-db-front-members-list-listHeaderTop', '')} +
+ {if $settings.list_show_map} +
Map
+ {/if} + {if $settings.list_show_search} +
+
+ FILTERS +
+
+
Close
+
+
+ {apply_filters('glm-member-db-front-members-list-searchFormTop', '')} +
+

Filter {$terms.term_member_cap}s

+
+ {if $settings.list_show_search_category} +
+ {$terms.term_member_cap} Category: + +
+ {/if} + {if $settings.list_show_search_amenities} +
+ {$terms.term_member_cap} Amenity: + +
+ {/if} + + {if $settings.list_show_search_text} +
+ Text Search: +
+ {/if} +
+ {apply_filters('glm-member-db-front-members-list-searchFormBottom', '')} +
+
+
+
+ {/if} {*list_show_search*} + +
+ + {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)} + + {if $settings.list_show_detail_link} + + {/if} + {if $m.logo && $settings.list_show_logo}
    + + +
    + {else} +
    + +
    + {/if} + {if $settings.list_show_detail_link} +
    + {/if} +
    +

    + {if $settings.list_show_detail_link} + + {$m.member} + + {else} + {$m.member} + {/if} + +

    + + + +
    + {apply_filters('glm-member-db-front-members-list-mapBubbleTop', '', $m.id)} + {if $m.logo && $settings.list_map_show_logo} +
    + +
    + {/if} +
    + {if $settings.list_map_show_detaillink} + {$m.member} + {else} + {$m.member} + {/if} +
    + {if $settings.list_map_show_address} +

    + {if $settings.list_map_show_street} + {if $m.addr1}{$m.addr1}
    {/if} + {if $m.addr2}{$m.addr2}
    {/if} + {/if} + {if $settings.list_map_show_citystatezip} + {if $m.city}{$m.city}{if $m.state.value}, {/if}{/if}{if $m.state.value}{$m.state.value}{/if}{if $m.zip} {$m.zip}{/if} + {/if} + {if $m.country.name && $settings.list_map_show_country} +
    {$m.country.name} + {/if} +

    + {/if} {*list_map_show_address*} +
    +

    + {if $m.phone && $settings.list_map_show_phone}Phone: {$m.phone}
    {/if} + {if $m.toll_free && $settings.list_map_show_tollfree}Toll Free: {$m.toll_free}
    {/if} + {if $m.url && $settings.list_map_show_url}Web site: {$m.url}
    {/if} + {if $m.email && $settings.list_map_show_email}E-Mail Address: {$m.email}
    {/if} + {if $m.region && $settings.list_map_show_region}Region: {$m.region}{/if} +

    + {if $m.descr && $settings.list_map_show_descr}{$m.descr|nl2br}
    {/if} + {if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr}
    {/if} + {if $m.categories && $settings.list_map_show_categories} +
    + {$terms.term_member_cap} Categories +
      + {foreach $m.categories as $c} +
    • + {if $c.parent_name}{$c.parent_name}: {/if}{$c.name} +
    • + {/foreach} +
    +
    + {/if} + {if $m.cc_type && $settings.list_map_show_creditcards} +
    + Credit Cards Accepted: +
      + {foreach $m.cc_type.names as $c} +
    • {$c}
    • + {/foreach} +
    +
    + {/if} + {if $settings.list_map_show_amenities} +
    + Amenities: +
      + {foreach $m.amenities as $a} +
    • {$a.name}
    • + {/foreach} +
    +
    + {/if} +
    + {apply_filters('glm-member-db-front-members-list-mapBubbleBottom', '', $m.id)} +
    +
  • + + + {/foreach} {*$members*} + {apply_filters('glm-member-db-front-members-list-pageBottom', '')} + {else} +
    (no {$terms.term_member_plur} listed)
    + {/if} + + {/if} {*list_show_list*} + +
+
+ {include file='front/footer.html'} + +
+
\ No newline at end of file diff --git a/views/front/members/list.html b/views/front/members/list.html index 3f8dda1c..459b6174 100644 --- a/views/front/members/list.html +++ b/views/front/members/list.html @@ -67,202 +67,201 @@ {/if} {*list_show_search*} - {apply_filters('glm-member-db-front-members-list-listHeaderTop', '')} +{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_search_alpha} - - {/if} - {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} +

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)} + {apply_filters('glm-member-db-front-members-list-memberAbove', '', $m.id)}
- {apply_filters('glm-member-db-front-members-list-memberTop', '', $m.id)} -
+ {apply_filters('glm-member-db-front-members-list-memberTop', '', $m.id)} +
- {if $m.logo && $settings.list_show_logo} -
-
- + {if $m.logo && $settings.list_show_logo} +
+
+ -
-
+
+
- {else} + {else}

- {/if} + {/if} - {apply_filters('glm-member-db-front-members-list-memberInfoTop', '', $m.id)} -

- {if $settings.list_show_detail_link} - {$m.member} - - {else} - {$m.member} - {/if} -

- {if $settings.list_show_address} - {apply_filters('glm-member-db-front-members-list-memberAddressTop', '', $m.id)} - {if $settings.list_show_street} - {if $m.addr1 && $settings.list_show_address}
{$m.addr1}
{/if} - {if $m.addr2 && $settings.list_show_addr2}
{$m.addr2}
{/if} - {/if} - {if $settings.list_show_citystatezip} - {if $m.city}{$m.city}{if $m.state.value}, {/if}{/if}{if $m.state.value}{$m.state.value}{/if}{if $m.zip} {$m.zip}{/if} - {/if} - {if $m.country.name && $settings.list_show_country}
{$m.country.name}
{/if} - {apply_filters('glm-member-db-front-members-list-memberAddressBottom', '', $m.id)} - {/if} - {apply_filters('glm-member-db-front-members-list-memberDetailTop', '', $m.id)} - {if $m.phone && $settings.list_show_phone}
Phone: {$m.phone}
{/if} - {if $m.toll_free && $settings.list_show_tollfree}
Toll Free: {$m.toll_free}
{/if} - {if $m.region && $settings.list_show_region}
Region: {$m.region}
{/if} - - +
+
+ {apply_filters('glm-member-db-front-members-list-memberDescriptionTop', '', $m.id)} + {if $m.short_descr && $settings.list_show_short_descr} + {$m.short_descr|nl2br} + {elseif $m.descr && $settings.list_show_description} + {$m.descr|nl2br} + {/if} + {apply_filters('glm-member-db-front-members-list-memberDescriptionBottom', '', $m.id)} +
+ {if $m.categories && $settings.list_show_categories} + {$terms.term_member_cap} Categories +
    + {foreach $m.categories as $c} +
  • + {if $c.parent_name}{$c.parent_name}: {/if}{$c.name} +
  • + {/foreach} +
+ {/if} + {if $m.cc_type && $settings.list_show_creditcards} + Credit Cards Accepted: +
    + {foreach $m.cc_type.names as $c} +
  • {$c}
  • + {/foreach} +
+ {/if} + {if $m.amenities && $settings.list_show_amenities} + {$terms.term_member_cap} Amenities +
    + {foreach $m.amenities as $A} +
  • + {$A.name} +
  • + {/foreach} +
+ {/if} +
- {apply_filters('glm-member-db-front-members-list-memberDetailBottom', '', $m.id)} + + {apply_filters('glm-member-db-front-members-list-memberDataBelow', '', $m.id)} + + {apply_filters('glm-member-db-front-members-list-memberBottom', '', $m.id)}
-
-
- {apply_filters('glm-member-db-front-members-list-memberDescriptionTop', '', $m.id)} - {if $m.short_descr && $settings.list_show_short_descr} - {$m.short_descr|nl2br} - {elseif $m.descr && $settings.list_show_description} - {$m.descr|nl2br} + {apply_filters('glm-member-db-front-members-list-memberBelow', '', $m.id)} + +
+ + +
+ {apply_filters('glm-member-db-front-members-list-mapBubbleTop', '', $m.id)} + {if $m.logo && $settings.list_map_show_logo}
{/if} +
+ {if $settings.list_map_show_detaillink} + {$m.member} + {else} + {$m.member} {/if} - {apply_filters('glm-member-db-front-members-list-memberDescriptionBottom', '', $m.id)} -
- {if $m.categories && $settings.list_show_categories} +
+ {if $settings.list_map_show_address} +

+ {if $settings.list_map_show_street} + {if $m.addr1}{$m.addr1}
{/if} + {if $m.addr2}{$m.addr2}
{/if} + {/if} + {if $settings.list_map_show_citystatezip} + {if $m.city}{$m.city}{if $m.state.value}, {/if}{/if}{if $m.state.value}{$m.state.value}{/if}{if $m.zip} {$m.zip}{/if} + {/if} + {if $m.country.name && $settings.list_map_show_country}
{$m.country.name}{/if} +

+ {/if} {*list_map_show_address*} +
+

+ {if $m.phone && $settings.list_map_show_phone}Phone: {$m.phone}
{/if} + {if $m.toll_free && $settings.list_map_show_tollfree}Toll Free: {$m.toll_free}
{/if} + {if $m.url && $settings.list_map_show_url}Web site: {$m.url}
{/if} + {if $m.email && $settings.list_map_show_email}E-Mail Address: {$m.email}
{/if} + {if $m.region && $settings.list_map_show_region}Region: {$m.region}{/if} +

+ {if $m.descr && $settings.list_map_show_descr}{$m.descr|nl2br}
{/if} + {if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr}
{/if} + {if $m.categories && $settings.list_map_show_categories} +
{$terms.term_member_cap} Categories
    - {foreach $m.categories as $c} + {foreach $m.categories as $c}
  • {if $c.parent_name}{$c.parent_name}: {/if}{$c.name}
  • - {/foreach} + {/foreach}
- {/if} - {if $m.cc_type && $settings.list_show_creditcards} +
+ {/if} + {if $m.cc_type && $settings.list_map_show_creditcards} +
Credit Cards Accepted:
    - {foreach $m.cc_type.names as $c} + {foreach $m.cc_type.names as $c}
  • {$c}
  • - {/foreach} + {/foreach}
- {/if} - {if $m.amenities && $settings.list_show_amenities} - {$terms.term_member_cap} Amenities +
+ {/if} + {if $settings.list_map_show_amenities} +
+ Amenities:
    - {foreach $m.amenities as $A} -
  • - {$A.name} -
  • - {/foreach} + {foreach $m.amenities as $a} +
  • {$a.name}
  • + {/foreach}
- {/if} -
-
- - {apply_filters('glm-member-db-front-members-list-memberDataBelow', '', $m.id)} - - {apply_filters('glm-member-db-front-members-list-memberBottom', '', $m.id)} -
- {apply_filters('glm-member-db-front-members-list-memberBelow', '', $m.id)} - -
- - -
- {apply_filters('glm-member-db-front-members-list-mapBubbleTop', '', $m.id)} - {if $m.logo && $settings.list_map_show_logo}
{/if} -
- {if $settings.list_map_show_detaillink} - {$m.member} - {else} - {$m.member} - {/if} -
- {if $settings.list_map_show_address} -

- {if $settings.list_map_show_street} - {if $m.addr1}{$m.addr1}
{/if} - {if $m.addr2}{$m.addr2}
{/if} - {/if} - {if $settings.list_map_show_citystatezip} - {if $m.city}{$m.city}{if $m.state.value}, {/if}{/if}{if $m.state.value}{$m.state.value}{/if}{if $m.zip} {$m.zip}{/if} - {/if} - {if $m.country.name && $settings.list_map_show_country}
{$m.country.name}{/if} -

- {/if} {*list_map_show_address*} -
-

- {if $m.phone && $settings.list_map_show_phone}Phone: {$m.phone}
{/if} - {if $m.toll_free && $settings.list_map_show_tollfree}Toll Free: {$m.toll_free}
{/if} - {if $m.url && $settings.list_map_show_url}Web site: {$m.url}
{/if} - {if $m.email && $settings.list_map_show_email}E-Mail Address: {$m.email}
{/if} - {if $m.region && $settings.list_map_show_region}Region: {$m.region}{/if} -

- {if $m.descr && $settings.list_map_show_descr}{$m.descr|nl2br}
{/if} - {if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr}
{/if} - {if $m.categories && $settings.list_map_show_categories} -
- {$terms.term_member_cap} Categories -
    - {foreach $m.categories as $c} -
  • - {if $c.parent_name}{$c.parent_name}: {/if}{$c.name} -
  • - {/foreach} -
-
- {/if} - {if $m.cc_type && $settings.list_map_show_creditcards} -
- Credit Cards Accepted: -
    - {foreach $m.cc_type.names as $c} -
  • {$c}
  • - {/foreach} -
-
- {/if} - {if $settings.list_map_show_amenities} -
- Amenities: -
    - {foreach $m.amenities as $a} -
  • {$a.name}
  • - {/foreach} -
+
+ {/if}
- {/if} -
- {apply_filters('glm-member-db-front-members-list-mapBubbleBottom', '', $m.id)} -
+ {apply_filters('glm-member-db-front-members-list-mapBubbleBottom', '', $m.id)} +
{/foreach} {*$members*} - {apply_filters('glm-member-db-front-members-list-pageBottom', '')} + {apply_filters('glm-member-db-front-members-list-pageBottom', '')} {else} -
(no {$terms.term_member_plur} listed)
+
(no {$terms.term_member_plur} listed)
{/if} {/if} {*list_show_list*} -