From e8f98487bce6f2820aec9f6184c9087586e6d37f Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 4 Dec 2017 08:43:11 -0500 Subject: [PATCH] adding trail tag name separate from the trail name input adding separate trail name section for the trail name input and a static trail name section --- index.php | 6 +++--- models/front/trailreports/list.php | 14 ++++++++++++++ views/front/trailreports/parts/alston.html | 3 ++- views/front/trailreports/parts/bigBay.html | 3 ++- views/front/trailreports/parts/chassell.html | 3 ++- views/front/trailreports/parts/nestoria.html | 3 ++- views/front/trailreports/parts/pinery.html | 3 ++- 7 files changed, 27 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 02ffb76..7e789d4 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Trail Reports * Plugin URI: http://www.gaslightmedia.com/ * Description: This is a plugin to update the trail conditions - * Version: 1.0.0 + * Version: 1.0.2 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersTrailReportsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.0.0 + * @version 1.0.2 */ /* @@ -37,7 +37,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_TRAIL_REPORTS_PLUGIN_VERSION', '1.0.0'); +define('GLM_MEMBERS_TRAIL_REPORTS_PLUGIN_VERSION', '1.0.2'); define('GLM_MEMBERS_TRAIL_REPORTS_PLUGIN_DB_VERSION', '0.0.1'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/models/front/trailreports/list.php b/models/front/trailreports/list.php index a07fbe1..b028552 100644 --- a/models/front/trailreports/list.php +++ b/models/front/trailreports/list.php @@ -112,15 +112,29 @@ class GlmMembersFront_trailreports_list extends GlmDataTrailReports $trail_reports = array(); // separate the main report info and the individual details $trail_data = $this->getList(); + $trail_tags = ['Big Bay Trail', 'Alston Trail', 'Chassell Trail', 'Nestoria Trail', 'Pinery Lakes CC Ski Trail']; + foreach($trail_data as $id=>$record){ foreach($record as $key=>$value){ if(strpos($key, "report") !== false){ $trail_reports['trail_report'][$id]['report_info'][$key] = $value; } else { $trail_reports['trail_report'][$id]['trail_info'][$key] = $value; + if( !is_array($value) && strpos($key, 'name')){ + $substring = substr($key, 0, strpos($key, '_')); + foreach($trail_tags as $tag){ + if( stripos($tag, $substring) !== false ){ + $trail_reports['trail_report'][$id]['trail_info'][$key . '_tag'] = $tag; + } + } + } + +// + } } } + echo '
', print_r($trail_reports), '
'; // echo '
', print_r($trail_reports), '
'; $view_file = 'list'; switch ($option) { diff --git a/views/front/trailreports/parts/alston.html b/views/front/trailreports/parts/alston.html index 9f9660b..b46c5c9 100644 --- a/views/front/trailreports/parts/alston.html +++ b/views/front/trailreports/parts/alston.html @@ -1,4 +1,5 @@ -
{$trail.trail_info.alston_name}
+
{$trail.trail_info.alston_name_tag}
+
{$trail.trail_info.alston_name}
Date Groomed: {$trail.trail_info.alston_groom.date}
Conditions: {$trail.trail_info.alston_cond}
Snow Base: {$trail.trail_info.alston_base}
diff --git a/views/front/trailreports/parts/bigBay.html b/views/front/trailreports/parts/bigBay.html index af372c0..1ff9422 100644 --- a/views/front/trailreports/parts/bigBay.html +++ b/views/front/trailreports/parts/bigBay.html @@ -1,4 +1,5 @@ -
{$trail.trail_info.big_bay_name}
+
{$trail.trail_info.big_bay_name_tag}
+
{$trail.trail_info.big_bay_name}
Date Groomed: {$trail.trail_info.big_bay_groom.date}
Conditions: {$trail.trail_info.big_bay_cond}
Snow Base: {$trail.trail_info.big_bay_base}
diff --git a/views/front/trailreports/parts/chassell.html b/views/front/trailreports/parts/chassell.html index fe43437..d4ca716 100644 --- a/views/front/trailreports/parts/chassell.html +++ b/views/front/trailreports/parts/chassell.html @@ -1,4 +1,5 @@ -
{$trail.trail_info.chassell_name}
+
{$trail.trail_info.chassell_name_tag}
+
{$trail.trail_info.chassell_name}
Date Groomed: {$trail.trail_info.chassell_groom.date}
Conditions: {$trail.trail_info.chassell_cond}
Snow Base: {$trail.trail_info.chassell_base}
diff --git a/views/front/trailreports/parts/nestoria.html b/views/front/trailreports/parts/nestoria.html index 6f59c03..250c2f6 100644 --- a/views/front/trailreports/parts/nestoria.html +++ b/views/front/trailreports/parts/nestoria.html @@ -1,4 +1,5 @@ -
{$trail.trail_info.nestoria_name}
+
{$trail.trail_info.nestoria_name_tag}
+
{$trail.trail_info.nestoria_name}
Date Groomed: {$trail.trail_info.nestoria_groom.date}
Conditions: {$trail.trail_info.nestoria_cond}
Snow Base: {$trail.trail_info.nestoria_base}
diff --git a/views/front/trailreports/parts/pinery.html b/views/front/trailreports/parts/pinery.html index 7d3b781..613d671 100644 --- a/views/front/trailreports/parts/pinery.html +++ b/views/front/trailreports/parts/pinery.html @@ -1,4 +1,5 @@ -
{$trail.trail_info.pinery_name}
+
{$trail.trail_info.pinery_name_tag}
+
{$trail.trail_info.pinery_name}
Date Groomed: {$trail.trail_info.pinery_groom.date}
Conditions: {$trail.trail_info.pinery_cond}
Snow Base: {$trail.trail_info.pinery_base}
-- 2.17.1