From cc91aa71cea92dc2c42ad1bd4aa4c2a89821c10b Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 15 Feb 2019 11:46:31 -0500 Subject: [PATCH] Add Entities Found and Entities Shown settings for customizing front list displays --- classes/data/settings/dataSettingsGeneral.php | 20 +++++++++++++++++-- index.php | 2 +- models/front/members/list.php | 2 ++ ...1.1.48.sql => create_database_V1.1.49.sql} | 4 +++- setup/databaseScripts/dbVersions.php | 1 + ..._V1.1.48.sql => drop_database_V1.1.49.sql} | 0 .../update_database_V1.1.49.sql | 15 ++++++++++++++ setup/shortcodes.php | 4 ++++ views/admin/management/index.html | 12 +++++++++++ views/front/members/list.html | 19 +++++++++++------- 10 files changed, 68 insertions(+), 11 deletions(-) rename setup/databaseScripts/{create_database_V1.1.48.sql => create_database_V1.1.49.sql} (99%) rename setup/databaseScripts/{drop_database_V1.1.48.sql => drop_database_V1.1.49.sql} (100%) create mode 100755 setup/databaseScripts/update_database_V1.1.49.sql diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index 750fe3ab..e2aa0533 100755 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -476,11 +476,11 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), - // Front-end Listings - List-adjacent sidebar spacing + // Front-end Listings - Show list header title 'list_show_header_text' => array( 'field' => 'list_show_header_text', 'type' => 'checkbox', - 'default' => false, + 'default' => true, 'use' => 'a' ), @@ -491,6 +491,22 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), + // Front-end Listings - Show number of entities found + 'list_show_entities_found' => array( + 'field' => 'list_show_entities_found', + 'type' => 'checkbox', + 'default' => true, + 'use' => 'a' + ), + + // Front-end Listings - Show number of entities shown + 'list_show_entities_shown' => array( + 'field' => 'list_show_entities_shown', + 'type' => 'checkbox', + 'default' => true, + 'use' => 'a' + ), + // Front-end Listings - Show Search Form 'list_show_search' => array( 'field' => 'list_show_search', diff --git a/index.php b/index.php index 9a4a6e2d..742f1a55 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.48'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.49'); // 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 f20e6f03..2d1368ef 100755 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -40,6 +40,8 @@ $GLOBALS['showOpts'] = array( 'search-filters-opened' => 'list_show_search_filters_opened', 'sidebar-area' => 'list_show_sidebar_area', 'header-text' => 'list_show_header_text', + 'entities-found' => 'list_show_entities_found', + 'entities-shown' => 'list_show_entities_shown', '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.48.sql b/setup/databaseScripts/create_database_V1.1.49.sql similarity index 99% rename from setup/databaseScripts/create_database_V1.1.48.sql rename to setup/databaseScripts/create_database_V1.1.49.sql index d89db171..c8b4bd1b 100755 --- a/setup/databaseScripts/create_database_V1.1.48.sql +++ b/setup/databaseScripts/create_database_V1.1.49.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database -- File Created: 12/29/16 12:06:00 --- Database Version: 1.1.47 +-- Database Version: 1.1.49 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -358,6 +358,8 @@ CREATE TABLE {prefix}settings_general ( list_pagination_count SMALLINT DEFAULT '20', list_show_sidebar_area BOOLEAN DEFAULT '0', list_show_header_text BOOLEAN DEFAULT '1', + list_show_entities_found BOOLEAN DEFAULT '1', + list_show_entities_shown BOOLEAN DEFAULT '1', 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 965d8bf2..0ac7a196 100755 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -80,6 +80,7 @@ $glmMembersDbVersions = array( '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'), '1.1.48' => array('version' => '1.1.48', 'tables' => 23, 'date' => '02/14/19'), + '1.1.49' => array('version' => '1.1.49', 'tables' => 23, 'date' => '02/15/19'), ); diff --git a/setup/databaseScripts/drop_database_V1.1.48.sql b/setup/databaseScripts/drop_database_V1.1.49.sql similarity index 100% rename from setup/databaseScripts/drop_database_V1.1.48.sql rename to setup/databaseScripts/drop_database_V1.1.49.sql diff --git a/setup/databaseScripts/update_database_V1.1.49.sql b/setup/databaseScripts/update_database_V1.1.49.sql new file mode 100755 index 00000000..92f24e5b --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.49.sql @@ -0,0 +1,15 @@ +-- Gaslight Media Members Database +-- File Created: 2019-02-15 +-- Database Version: 1.1.49 +-- 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 setting to show the 'Entities found: 123' line on listings +ALTER TABLE {prefix}settings_general ADD COLUMN list_show_entities_found BOOLEAN DEFAULT '1'; -- Show number of entities found on lists + +---- + +-- Add setting to show the 'showing 1 through 50 of 111' line on listings +ALTER TABLE {prefix}settings_general ADD COLUMN list_show_entities_shown BOOLEAN DEFAULT '1'; -- Show number of entities shown on lists diff --git a/setup/shortcodes.php b/setup/shortcodes.php index b88dc63a..af5b8ec1 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -118,6 +118,8 @@ if ( isset( $config['settings'] ) && $config['settings']['enable_members'] ) { 'search-filters-opened' => 'list_show_search_filters_opened', 'sidebar-area' => 'list_show_sidebar_area', 'header-text' => 'list_show_header_text', + 'entities-found' => 'list_show_entities_found', + 'entities-shown' => 'list_show_entities_shown', 'search-text' => 'list_show_search_text', 'search-categories' => 'list_show_search_category', 'search-amenities' => 'list_show_search_amenities', @@ -465,6 +467,8 @@ if ( isset( $config['settings'] ) && $config['settings']['enable_members'] ) { Member List Options
list header-text + entities-found + entities-shown name-link logo logo-for-mobile diff --git a/views/admin/management/index.html b/views/admin/management/index.html index fe09d569..ca625569 100755 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@ -361,6 +361,18 @@ List Header Text: + + Show number of entities found: + + + + + + Show number of entities shown: + + + + Show Member Logo: Logo Size: diff --git a/views/front/members/list.html b/views/front/members/list.html index 4f1c4513..e528f331 100755 --- a/views/front/members/list.html +++ b/views/front/members/list.html @@ -316,8 +316,9 @@ {/if} {/if} {if $haveMembers} - + {if $showSettings.list_show_entities_found}
{$terms.term_member_plur_cap} found: {$membersFound}
+ {/if} {apply_filters('glm-member-db-front-members-list-listHeaderBottom', '')} @@ -347,9 +348,11 @@
{/if}
-
- showing {$start} through {$lastDisplayed} of {$filteredMembersFound} -
+ {if $list_show_entities_shown} +
+ showing {$start} through {$lastDisplayed} of {$filteredMembersFound} +
+ {/if} {/if} {* Members List *} @@ -386,9 +389,11 @@ [ Load More ] {/if}
-
- showing {$start} through {$lastDisplayed} of {$filteredMembersFound} -
+ {if $showSettings.list_show_entities_shown} +
+ showing {$start} through {$lastDisplayed} of {$filteredMembersFound} +
+ {/if} {/if} {apply_filters('glm-member-db-front-members-list-pageBottom', '')} -- 2.17.1