From: laury Date: Tue, 17 May 2016 20:38:08 +0000 (-0400) Subject: Updated view templates, disabled requiredPages checks X-Git-Tag: v2.0.0^2~10^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a52f3c302a0121c73736727a398e52302e348564;p=WP-Plugins%2Fglm-member-db.git Updated view templates, disabled requiredPages checks --- diff --git a/classes/data/dataMemberInfo.php b/classes/data/dataMemberInfo.php index baf67765..25f2de2b 100644 --- a/classes/data/dataMemberInfo.php +++ b/classes/data/dataMemberInfo.php @@ -310,6 +310,7 @@ class GlmDataMemberInfo extends GlmDataAbstract 'short_descr' => array ( 'field' => 'short_descr', 'type' => 'text', + 'maxLength' => '120', 'use' => 'a' ), @@ -399,11 +400,15 @@ class GlmDataMemberInfo extends GlmDataAbstract ;"; $r['categories'] = $this->wpdb->get_results($sql, ARRAY_A); + if ((strlen($r['short_descr']) == 0) && ($r['description'] > 0)) { + $r['short_descr'] = $r['description']; + } $dotdotdot = ''; - if (strlen($r['short_descr']) > 200 ) { - $dotdotdot = '...'; + if (strlen($r['short_descr']) > 120 ) { + $dotdotdot = ' ... '; } - $r['short_descr'] = substr($r['short_descr'], 0, 200).$dotdotdot; + $formattedStr = trim(preg_replace('/\s\s+/', ' ', $r['short_descr'])); + $r['short_descr'] = substr($formattedStr, 0, 120).$dotdotdot; return $r; } diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index 14e76968..b3adbe9d 100644 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -203,7 +203,7 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'list_show_search_filters_opened' => array( 'field' => 'list_show_search_filters_opened', 'type' => 'checkbox', - 'default' => true, + 'default' => false, 'use' => 'a' ), @@ -418,7 +418,7 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'list_map_show_opened' => array( 'field' => 'list_map_show_opened', 'type' => 'checkbox', - 'default' => true, + 'default' => false, 'use' => 'a' ), diff --git a/classes/glmPluginSupport.php b/classes/glmPluginSupport.php index 634816ac..df8858fa 100644 --- a/classes/glmPluginSupport.php +++ b/classes/glmPluginSupport.php @@ -509,102 +509,102 @@ class GlmPluginSupport * * @return void */ - public function createPages($requiredPages) - { - foreach($requiredPages as $requiredPage => $requiredPageInfo) { - $trimmedName = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$requiredPageInfo['underscored_title']; - if ($requiredPageInfo['parent'] == 'associate') { - $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_ASSOCIATE_ID); - } else if ($requiredPageInfo['parent'] == 'membersonly') { - $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID); - } else if (is_numeric($requiredPageInfo['parent'])) { - $postParent = $requiredPageInfo['parent']; - } else { - $postParent = '0'; - } - $existingPost = get_post(get_option($trimmedName)); - $newSlug = sanitize_title($requiredPageInfo['title']); - $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. - if ($newSlug == $existingSlug) { - $existingID = $this->get_post_id_by_slug($newSlug); - update_option($trimmedName, $existingID); - // Otherwise create a new page - } else { - // 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['title'], - $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)) { - $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 - ); - - } - } - } else { - // No page created - } - } - - } - - 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; - } +// public function createPages($requiredPages) +// { +// foreach($requiredPages as $requiredPage => $requiredPageInfo) { +// $trimmedName = GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$requiredPageInfo['underscored_title']; +// if ($requiredPageInfo['parent'] == 'associate') { +// $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_ASSOCIATE_ID); +// } else if ($requiredPageInfo['parent'] == 'membersonly') { +// $postParent = get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID); +// } else if (is_numeric($requiredPageInfo['parent'])) { +// $postParent = $requiredPageInfo['parent']; +// } else { +// $postParent = '0'; +// } +// $existingPost = get_post(get_option($trimmedName)); +// $newSlug = sanitize_title($requiredPageInfo['title']); +// $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. +// if ($newSlug == $existingSlug) { +// $existingID = $this->get_post_id_by_slug($newSlug); +// update_option($trimmedName, $existingID); +// // Otherwise create a new page +// } else { +// // 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['title'], +// $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)) { +// $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 +// ); +// +// } +// } +// } else { +// // No page created +// } +// } +// +// } + +// 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; +// } /** * diff --git a/controllers/admin.php b/controllers/admin.php index 51f82ced..a99db7d2 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -624,11 +624,11 @@ class glmMembersAdmin extends GlmPluginSupport * Check Required Pages * */ - foreach ($this->config['addOns'] as $a) { - if (isset($a['requiredPages'])) { - $this->createPages($a['requiredPages']); - } - } +// foreach ($this->config['addOns'] as $a) { +// if (isset($a['requiredPages'])) { +// $this->createPages($a['requiredPages']); +// } +// } // Loop till we have a final action $loopCheck = 0; diff --git a/css/front.css b/css/front.css index cb61ffee..366d4303 100644 --- a/css/front.css +++ b/css/front.css @@ -63,7 +63,7 @@ border: 1px #ccc solid; /* padding: .4em 0px 0px 0px;*/ background: white; - margin: .4em 0px .4em 0px; + margin: .8em 0px .8em 0px; } .glm-member-db-list-grid-view { overflow: hidden; @@ -84,6 +84,12 @@ line-height: 1.2; padding: 15px; } +.glm-member-db-list-view .glm-member-title { + text-transform: none; +} +.glm-member-db-list-grid-view .glm-member-db-border-wrap { + border-radius: 4px; +} #glm-member-list-map-toggle { background-color: lightgrey; position: absolute; @@ -105,27 +111,28 @@ .glm-member-db-list-view.map-opened #glm-member-list-map-toggle:before { content: "Hide "; } -.glm-member-db-list-grid-view .glm-member-list-listing-container { +.glm-member-db-list-grid-view #glm-locationMap-container { transition: all 0.5s; - padding: 0 0 0 2%; +/* padding: 0 0 0 2%;*/ margin-top: 30px; } @media (min-width: 1024px) { - .glm-member-db-list-grid-view .glm-member-list-listing-container { + .glm-member-db-list-grid-view #glm-locationMap-container { float: right; } } -.glm-member-db-list-grid-view.filters-closed .glm-member-list-listing-container { +.glm-member-db-list-grid-view.filters-closed #glm-locationMap-container { transition: all 0.4s; width: 100%; + float: right; margin-top: 30px; } @media (min-width: 1024px) { - .glm-member-db-list-grid-view.filters-closed .glm-member-list-listing-container { + .glm-member-db-list-grid-view.filters-closed #glm-locationMap-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.filters-opened #glm-locationMap-container { + width: 70%; } } .glm-member-db-list-grid-view #glm-member-list-filters-close { @@ -227,6 +234,7 @@ } .glm-member-db-list-grid-view #glm-locationMap-container { margin-bottom: 40px; + width: 100%; overflow: hidden; } .glm-member-db-list-view #glm-locationMap-container { @@ -332,8 +340,14 @@ .glm-member-list-nameAddress { } .glm-member-detail-images-thumb { + display: block; + background-repeat: no-repeat; + background-size: cover; + background-position: center center; width: 100%; } +.testclass { +} .glm-member-detail-image .visible-img { } @@ -354,7 +368,7 @@ height: 250px; } .glm-member-list-active-info .glm-member-title a { - text-decoration: underline; +/* text-decoration: underline;*/ } .glm-member-db-list-grid-view #glm-member-db-front-container { padding: 0; @@ -367,8 +381,8 @@ padding: 0; } } -.glm-member-list-active-info { - padding: 15px; +.glm-member-db-list-view .glm-member-list-active-info { + padding: 0; } /* * Member List End @@ -525,8 +539,16 @@ input[type="submit"].glm-member-button { background: white none repeat scroll 0 0; margin-bottom: 5px; } -.glm-member-list-container { +.glm-member-db-list-view .glm-member-list-container { padding: 0; + height: 200px; +} +.glm-member-db-list-view .glm-member-db-phone-tollfree { + +} +.glm-member-db-list-view .glm-member-db-phone-tollfree:before { + padding-left: 15px; + content: ""; } #glm-member-detail-container { background: white none repeat scroll 0 0; @@ -720,8 +742,8 @@ input[type="submit"].glm-member-button { #glm-directions { padding: 1em; } -#glm-member-detail-list-links { - margin: 10px 0; +.glm-member-db-list-view .glm-member-list-links { + margin-top: 3px; } .glm-member-db-list-view .glm-member-list-links #glm-member-list-website-link:before { //content: url("../assets/offsite-link_wht.png"); @@ -762,7 +784,8 @@ input[type="submit"].glm-member-button { margin-bottom: 25px; } .glm-member-list-description { - padding: 15px 15px 15px 0; + margin-top: 15px; + padding: 0; } .glm-searchTitle{ margin-top: -45px; diff --git a/models/front/members/detail.php b/models/front/members/detail.php index 25f7fb39..a3c73564 100644 --- a/models/front/members/detail.php +++ b/models/front/members/detail.php @@ -297,7 +297,6 @@ class GlmMembersFront_members_detail extends GlmDataMemberInfo // Since the ID we recieved with the member data is the pointer to the member info record, replace it with member ID $memberData['id'] = $memberData['member_pointer']; - // Compile template data $templateData = array( 'haveMember' => $haveMember, diff --git a/models/front/members/list.php b/models/front/members/list.php index 2eaec5f7..0649dfb0 100644 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -41,21 +41,21 @@ $GLOBALS['showOpts'] = array( 'search-amenities' => 'list_show_search_amenities', 'search-alpha' => 'list_show_search_alpha', 'list' => 'list_show_list', - 'name-link' => 'list_show_detail_link', + 'name-link' => 'list_show_detail_link', 'logo' => 'list_show_logo', 'address' => 'list_show_address', 'street' => 'list_show_street', 'city-state-zip' => 'list_show_citystatezip', - 'country' => 'list_show_country', + 'country' => 'list_show_country', 'region' => 'list_show_region', 'description' => 'list_show_descr', - 'short-description' => 'list_show_short_descr', + 'short-description' => 'list_show_short_descr', 'phone' => 'list_show_phone', 'toll-free' => 'list_show_tollfree', 'url' => 'list_show_url', 'url-new-target' => 'list_show_url_newtarget', 'email' => 'list_show_email', - 'categories' => 'list_show_categroies', + 'categories' => 'list_show_categroies', 'credit-cards' => 'list_show_creditcards', 'amentities' => 'list_show_amenities' ); diff --git a/setup/databaseScripts/create_database_V1.1.5.sql b/setup/databaseScripts/create_database_V1.1.5.sql index 5d0496a4..afbb3c7d 100644 --- a/setup/databaseScripts/create_database_V1.1.5.sql +++ b/setup/databaseScripts/create_database_V1.1.5.sql @@ -210,7 +210,7 @@ CREATE TABLE {prefix}settings_general ( 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_filters_opened BOOLEAN DEFAULT '0', list_show_search BOOLEAN DEFAULT '1', list_show_search_text BOOLEAN DEFAULT '1', list_show_search_category BOOLEAN DEFAULT '1', @@ -234,7 +234,7 @@ CREATE TABLE {prefix}settings_general ( 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_opened BOOLEAN DEFAULT '0', list_map_show_detaillink BOOLEAN DEFAULT '1', list_map_show_logo BOOLEAN DEFAULT '0', list_map_logo_size TINYTEXT NULL, diff --git a/views/front/members/detail.html b/views/front/members/detail.html index 63fb10f1..1955baa9 100644 --- a/views/front/members/detail.html +++ b/views/front/members/detail.html @@ -93,6 +93,11 @@ {if $settings.detail_show_coupons && $coupons}Coupons{/if} {apply_filters('glm-member-db-front-members-detail-linksBottom', '', $member.id)} + +
+ {apply_filters('glm-member-db-front-members-list-memberDetailBottom', '', $m.id)} + Social:{apply_filters('glm-member-db-front-members-social-list', '', $m.id)} +
{if $settings.detail_show_map} @@ -118,10 +123,16 @@
{apply_filters('glm-member-db-front-members-detail-attributesTop', '', $member.id)} - + {if $featuredImage} + {/if}
{if $member.short_descr && $settings.detail_show_short_descr}{$member.short_descr|nl2br}{/if}
@@ -149,7 +160,12 @@ {apply_filters('glm-member-db-front-members-detail-galleryBottom', '', $member.id)} diff --git a/views/front/members/grid.html b/views/front/members/grid.html index 24880135..ea06a490 100644 --- a/views/front/members/grid.html +++ b/views/front/members/grid.html @@ -1,23 +1,13 @@
{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} +
+ {if $settings.list_show_map}
Map
{/if} {if $settings.list_show_search} @@ -52,7 +42,7 @@
{$terms.term_member_cap} Amenity: