From ab93975fdc2a87d87a34b46cb83b88ce77345d93 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 26 Jul 2018 11:45:18 -0400 Subject: [PATCH] Added call to search add-on filter to index packaging page when any package is updated. Also some work for migration of plugin names to GLM Associate --- index.php | 6 +++--- models/admin/member/packaging.php | 36 +++++++++++++++++++++++++++++++ readme.txt | 12 +++++++---- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index b383dd4..8673187 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,8 @@ deleteEntry($packageID, true); $packageDeleted = true; + // Flag that a search engine update is needed + $indexPackages = true; + glmClearShortcodeCache(); } @@ -333,6 +343,32 @@ class GlmMembersAdmin_member_packaging extends GlmDataPackages } + + + // If we need to re-index the packages list page(s) + if ($indexPackages) { + + // Get a list of all published pages that have a package list shortcode + $prefix = $this->wpdb->get_blog_prefix(); + $shortcodePages = $this->wpdb->get_results(" + SELECT ID, post_title, post_name + FROM ".$prefix."posts + WHERE post_status = 'publish' + AND post_content LIKE '%[glm-members-packaging-list%' + ", ARRAY_A); + + // If there's any pages with this shortcode + if ($shortcodePages != NULL && is_array($shortcodePages) && count($shortcodePages) > 0) { + foreach ($shortcodePages as $shortcodePage) { + + // Build the URL to that page and ask for it to be indexed. + $pageUrl = GLM_MEMBERS_SITE_BASE_URL.$shortcodePage['post_name'].'/'; + $result = apply_filters( 'glm_member_db_common_search_indexurl', $pageUrl ); + + } + } + } + // Compile template data $templateData = array( 'havePackages' => $havePackages, diff --git a/readme.txt b/readme.txt index b4c528f..52867de 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -=== Gaslight Media Member Database Packaging Child Plugin === +=== GLM Associate - Packaging Add-On === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,Members Packaging @@ -8,12 +8,12 @@ Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -This is the Gaslight Media Members Database Packaging Child Plugin. +This is the Gaslight Media GLM Associate Packaging Add-On. == Description == -The Gaslight Media Members Database Packaging Child Plugin is an add-on to the Gaslight Media Members Database, -which is required to install and run this plugin +The Gaslight Media GLM Associate Packaging Add-On is a child plugin to the Gaslight Media GLM Associate Members plugin +which is required to install and run this plugin. == Installation == @@ -26,6 +26,10 @@ e.g. == Changelog == + += (pending) = +* Added filter to update search engine if GLM Associate - OpenSearchServer Add-On is installed and active. + = 1.2.18 = * Add management option for member message and for overriding moderated member packages. -- 2.17.1