From 36a9754dbc56e494cc713a63b5e2a73136facdd2 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Mon, 17 Oct 2016 09:05:32 -0400 Subject: [PATCH] Special conditions were not properly displaying' --- css/front.css | 3 +++ models/admin/conditions/index.php | 2 +- models/front/conditions/current.php | 8 +++++++- views/front/conditions/inside.html | 8 +++++--- 4 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 css/front.css diff --git a/css/front.css b/css/front.css new file mode 100644 index 0000000..41d5022 --- /dev/null +++ b/css/front.css @@ -0,0 +1,3 @@ +.condition-description { + margin-bottom: 10px; +} \ No newline at end of file diff --git a/models/admin/conditions/index.php b/models/admin/conditions/index.php index 1c69fe3..313aabb 100644 --- a/models/admin/conditions/index.php +++ b/models/admin/conditions/index.php @@ -190,7 +190,7 @@ class GlmMembersAdmin_conditions_index extends GlmDataConditions FROM ".GLM_MEMBERS_CONDITIONS_PLUGIN_DB_PREFIX."current_condition CC "; $current_condition = $this->wpdb->get_results( $sql, ARRAY_A ); - + // Compile template data $templateData = array( 'conditionList' => $condition_list, diff --git a/models/front/conditions/current.php b/models/front/conditions/current.php index 7be40b5..82825f9 100644 --- a/models/front/conditions/current.php +++ b/models/front/conditions/current.php @@ -65,6 +65,11 @@ class GlmMembersFront_conditions_current extends GlmDataCurrentCondition $conditions_url = esc_url( home_url( '/' ) ) . "conditions"; + // If this is a special condition + if ($current_condition[0]['id'] == 12) { + $special_condition = true; + } + // Compile template data $templateData = array( 'currentCondition' => $current_condition[0], @@ -72,7 +77,8 @@ class GlmMembersFront_conditions_current extends GlmDataCurrentCondition 'todaysDate' => $todays_date, 'timeNow' => $time_now, 'conditionsUrl' => $conditions_url, - 'siteBaseUrl' => $site_base_url + 'siteBaseUrl' => $site_base_url, + 'specialCondition' => $special_condition ); error_reporting(E_ALL ^ E_NOTICE); diff --git a/views/front/conditions/inside.html b/views/front/conditions/inside.html index 49bf8ab..2df648e 100644 --- a/views/front/conditions/inside.html +++ b/views/front/conditions/inside.html @@ -3,9 +3,11 @@

Status:

{$selectedCondition.name}

{$todaysDate}{$timeNow}

-
-
+
+ {if $special} + {$currentCondition.special|nl2br} + {else} {$selectedCondition.descr|nl2br} -
+ {/if}
{/if} -- 2.17.1