From 4e64b6345fabfa6b5bb532197a038d470ef8a375 Mon Sep 17 00:00:00 2001
From: laury
Date: Fri, 20 May 2016 17:14:24 -0400
Subject: [PATCH] First-activation now properly set, createPages doesn't
displace ID unless first-activation, unsets after
---
activate.php | 6 ++---
classes/glmPluginSupport.php | 15 ++++++++----
css/front.css | 7 ++++--
setup/shortcodes.php | 5 ++--
views/admin/shortcodes/index.html | 38 ++++++++++++++++++++++++++-----
5 files changed, 54 insertions(+), 17 deletions(-)
diff --git a/activate.php b/activate.php
index 228d4485..e29c3cc8 100644
--- a/activate.php
+++ b/activate.php
@@ -94,10 +94,10 @@ class glmMembersPluginActivate extends glmPluginSupport
}
- if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'none') == 'none') {
- update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, true);
+ if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'None') == 'None') {
+ update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'true');
} else {
- update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, false);
+ update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'false');
}
}
diff --git a/classes/glmPluginSupport.php b/classes/glmPluginSupport.php
index 0dd64a7e..5fe414ed 100644
--- a/classes/glmPluginSupport.php
+++ b/classes/glmPluginSupport.php
@@ -533,10 +533,15 @@ return; // Off for now ** Need to make this switchable in management
// is checked by translating the page title.
$newSlug = sanitize_title($requiredPageInfo['title']);
$existingSlug = $this->verify_post_slug($newSlug);
- if ($newSlug == $existingSlug) {
- $existingID = $this->get_post_id_by_slug($newSlug);
- update_option($option, $existingID);
+
+ // But only run this if it is the first time this plugin is activated
+ if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION) == 'true') {
+ if ($newSlug == $existingSlug) {
+ $existingID = $this->get_post_id_by_slug($newSlug);
+ update_option($option, $existingID);
+ }
}
+
$existingPost = get_post(get_option($option));
// If a post with the ID set in the option does not exist
if ( !$existingPost) {
@@ -572,7 +577,9 @@ return; // Off for now ** Need to make this switchable in management
// No page created
}
}
-
+ if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION) == 'true') {
+ update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'false');
+ }
}
public function insertReqPage($pTitle = '--bad page--', $pContent = '', $pPublish = 'publish', $pType = 'page', $pAuthor = '1', $pTemplate = 'index.php', $pParent = '0')
diff --git a/css/front.css b/css/front.css
index 0c3ced57..117d8a07 100644
--- a/css/front.css
+++ b/css/front.css
@@ -80,6 +80,9 @@
font-size: 24px;
line-height: 1;
}
+.glm-member-list-image-border img {
+ float: right;
+}
.glm-member-db-list-grid-view .glm-member-title {
font-size: 24px;
font-weight: normal;
@@ -449,11 +452,11 @@
overflow: hidden;
position: absolute;
top: 13px;
- width: 100px;
+ width: 120px;
}
#glm-member-detail-takeback-mini:hover {
text-decoration: none;
- width: 170px;
+ width: 190px;
-webkit-transition: width 0.5s ease;
-moz-transition: width 0.5s ease;
-o-transition: width 0.5s ease;
diff --git a/setup/shortcodes.php b/setup/shortcodes.php
index 64f774b1..ffdd3368 100644
--- a/setup/shortcodes.php
+++ b/setup/shortcodes.php
@@ -167,7 +167,8 @@ $glmMembersShortcodes = array(
$glmMembersShortcodesDescription = '
-
+
+ Shortcode | Attribute | Description |
[glm-members-list] |
|
@@ -359,5 +360,5 @@ $glmMembersShortcodesDescription = '
-
+
';
diff --git a/views/admin/shortcodes/index.html b/views/admin/shortcodes/index.html
index b9cfc4e8..d87855d4 100644
--- a/views/admin/shortcodes/index.html
+++ b/views/admin/shortcodes/index.html
@@ -19,12 +19,38 @@
[glm-members-list category="11"]
-
-
- Shortcode | Attribute | Description |
-
+
+
+
{$shortcodesDescription}
-
-
+
{include file='admin/footer.html'}
--
2.17.1