From 9d1c1114dbfa9a20aea5b47f0e80c37285435f4b Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 14 Feb 2019 12:54:17 -0500 Subject: [PATCH] Add setting to create sidebar area on front listing --- classes/data/settings/dataSettingsGeneral.php | 8 ++ index.php | 2 +- models/front/members/list.php | 1 + ...1.1.46.sql => create_database_V1.1.47.sql} | 3 +- setup/databaseScripts/dbVersions.php | 1 + ..._V1.1.46.sql => drop_database_V1.1.47.sql} | 0 .../update_database_V1.1.47.sql | 10 ++ setup/shortcodes.php | 1 + views/admin/management/index.html | 6 + views/front/members/list.html | 132 ++++++++++-------- 10 files changed, 103 insertions(+), 61 deletions(-) rename setup/databaseScripts/{create_database_V1.1.46.sql => create_database_V1.1.47.sql} (99%) rename setup/databaseScripts/{drop_database_V1.1.46.sql => drop_database_V1.1.47.sql} (100%) create mode 100755 setup/databaseScripts/update_database_V1.1.47.sql diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index 2f498a69..c27f1a29 100755 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -468,6 +468,14 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), + // Front-end Listings - List-adjacent sidebar spacing + 'list_sidebar_area' => array( + 'field' => 'list_sidebar_area', + 'type' => 'checkbox', + 'default' => false, + 'use' => 'a' + ), + // Front-end Listings - Show List 'list_header_text' => array( 'field' => 'list_header_text', diff --git a/index.php b/index.php index add5d1ba..55a5ed99 100755 --- a/index.php +++ b/index.php @@ -48,7 +48,7 @@ if (!defined('ABSPATH')) { */ define('GLM_MEMBERS_PLUGIN_VERSION', '2.11.0'); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.46'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.47'); // Check if plugin version is not current in WordPress option and if needed updated it if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) { diff --git a/models/front/members/list.php b/models/front/members/list.php index 99370405..9904fa00 100755 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -38,6 +38,7 @@ $GLOBALS['showOpts'] = array( 'marker-clusters' => 'use_cluster_markers', 'search' => 'list_show_search', 'search-filters-opened' => 'list_show_search_filters_opened', + 'sidebar-area' => 'list_sidebar_area', 'search-text' => 'list_show_search_text', 'search-categories' => 'list_show_search_category', 'search-amenities' => 'list_show_search_amenities', diff --git a/setup/databaseScripts/create_database_V1.1.46.sql b/setup/databaseScripts/create_database_V1.1.47.sql similarity index 99% rename from setup/databaseScripts/create_database_V1.1.46.sql rename to setup/databaseScripts/create_database_V1.1.47.sql index 56d4cfe6..2e4f820b 100755 --- a/setup/databaseScripts/create_database_V1.1.46.sql +++ b/setup/databaseScripts/create_database_V1.1.47.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database -- File Created: 12/29/16 12:06:00 --- Database Version: 1.1.46 +-- Database Version: 1.1.47 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -356,6 +356,7 @@ CREATE TABLE {prefix}settings_general ( list_pagination BOOLEAN DEFAULT '1', list_ajax_pagination BOOLEAN DEFAULT '0', list_pagination_count SMALLINT DEFAULT '20', + list_sidebar_area SMALLINT DEFAULT '0', list_show_search_filters_opened BOOLEAN DEFAULT '0', list_show_search BOOLEAN DEFAULT '1', list_show_search_text BOOLEAN DEFAULT '1', diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index cdbfaa1e..9d8e7b71 100755 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -78,6 +78,7 @@ $glmMembersDbVersions = array( '1.1.44' => array('version' => '1.1.44', 'tables' => 23, 'date' => '11/08/18'), '1.1.45' => array('version' => '1.1.45', 'tables' => 23, 'date' => '01/02/19'), '1.1.46' => array('version' => '1.1.46', 'tables' => 23, 'date' => '01/07/19'), + '1.1.47' => array('version' => '1.1.47', 'tables' => 23, 'date' => '02/14/19'), ); diff --git a/setup/databaseScripts/drop_database_V1.1.46.sql b/setup/databaseScripts/drop_database_V1.1.47.sql similarity index 100% rename from setup/databaseScripts/drop_database_V1.1.46.sql rename to setup/databaseScripts/drop_database_V1.1.47.sql diff --git a/setup/databaseScripts/update_database_V1.1.47.sql b/setup/databaseScripts/update_database_V1.1.47.sql new file mode 100755 index 00000000..c146d45f --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.47.sql @@ -0,0 +1,10 @@ +-- Gaslight Media Members Database +-- File Created: 2019-01-02 +-- Database Version: 1.1.47 +-- 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 dashes + +-- Add list_ajax_pagination to settings_general table +ALTER TABLE {prefix}settings_general ADD COLUMN list_sidebar_area BOOLEAN DEFAULT '0'; -- Show sidebar area on list \ No newline at end of file diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 1c5aee1c..72a18e33 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -116,6 +116,7 @@ if ( isset( $config['settings'] ) && $config['settings']['enable_members'] ) { 'marker-clusters' => 'use_cluster_markers', 'search' => 'list_show_search', 'search-filters-opened' => 'list_show_search_filters_opened', + 'sidebar-area' => 'list_sidebar_area', 'search-text' => 'list_show_search_text', 'search-categories' => 'list_show_search_category', 'search-amenities' => 'list_show_search_amenities', diff --git a/views/admin/management/index.html b/views/admin/management/index.html index 18024b32..aa924093 100755 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@ -347,6 +347,12 @@ + + Enable sidebar area: + + + + Show Member Name as Link to Detail: List Header Text: Show Member Logo: diff --git a/views/front/members/list.html b/views/front/members/list.html index 140f9481..c1dc24f8 100755 --- a/views/front/members/list.html +++ b/views/front/members/list.html @@ -302,68 +302,39 @@ {/if} {* haveFeaturedMembers *} {if $showSettings.list_show_list && !$blankStart} - {if $settings.list_header_text} -

{$settings.list_header_text}

- {elseif apply_filters('is_page', 'search')} -

List of {$terms.term_member_plur_cap}

- {else} -

List of {$terms.term_member_plur_cap}

+ {if $settings.list_sidebar_area} +
+
{/if} - {if $haveMembers} - -
{$terms.term_member_plur_cap} found: {$membersFound}
- - {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} + {if $settings.list_header_text} +

{$settings.list_header_text}

+ {elseif apply_filters('is_page', 'search')} +

List of {$terms.term_member_plur_cap}

+ {else} +

List of {$terms.term_member_plur_cap}

+ {/if} + {if $haveMembers} - +
{$terms.term_member_plur_cap} found: {$membersFound}
+ {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} - {* Alpha List *} + - {if $showSettings.list_show_search_alpha && !apply_filters("is_page", 'search')} - - {/if} - {* Page selection top *} + {* Alpha List *} - {if $paging} - {if ( $prevStart || $nextStart ) && !$settings.list_ajax_pagination} -
-
- < Previous page - Next page > + {if $showSettings.list_show_search_alpha && !apply_filters("is_page", 'search')} + -
{/if} -
-
- showing {$start} through {$lastDisplayed} of {$filteredMembersFound} -
- {/if} - {* Members List *} + {* Page selection top *} - {if $settings.list_ajax_pagination} -
- loading... -
- {else} - {if $view == list || $view == map} - {include file='front/members/listTypeList.html'} - {/if} - {if $view == grid} - {include file='front/members/listTypeGrid.html'} - {/if} - {/if} - - {* Page selection bottom *} - -
{if $paging} {if ( $prevStart || $nextStart ) && !$settings.list_ajax_pagination}
@@ -373,19 +344,62 @@

{/if} - {if $nextStart && $settings.list_ajax_pagination} - [ Load More ] - {/if}
showing {$start} through {$lastDisplayed} of {$filteredMembersFound}
{/if} -
- {apply_filters('glm-member-db-front-members-list-pageBottom', '')} - {else} -
(no {$terms.term_member_plur} listed)
+ {* Members List *} + + {if $settings.list_ajax_pagination} +
+ loading... +
+ {else} + {if $view == list || $view == map} + {include file='front/members/listTypeList.html'} + {/if} + {if $view == grid} + {include file='front/members/listTypeGrid.html'} + {/if} + {if $view == uptravel} + {include file='front/members/listTypeUptravel.html'} + {/if} + {/if} + + {* Page selection bottom *} + +
+ {if $paging} + {if ( $prevStart || $nextStart ) && !$settings.list_ajax_pagination} +
+ +
+ {/if} + {if $nextStart && $settings.list_ajax_pagination} + [ Load More ] + {/if} +
+
+ showing {$start} through {$lastDisplayed} of {$filteredMembersFound} +
+ {/if} +
+ {apply_filters('glm-member-db-front-members-list-pageBottom', '')} + + {else} +
(no {$terms.term_member_plur} listed)
+ {/if} + {if $settings.list_sidebar_area} +
+
+ {get_sidebar()} +
+
{/if} {/if} {* list_show_list *} @@ -515,7 +529,7 @@ var geocoder; // Loading features - var loadingControl = L.Control.loading({ + var loadingControl = L.control.loading({ separate: true, delayIndicator: 500 }); -- 2.17.1