Fixes to member region selection shortcode,
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 22 Aug 2016 18:30:02 +0000 (14:30 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 22 Aug 2016 18:30:02 +0000 (14:30 -0400)
Fixes and enhancements to member click-throughs and page vies data and display.
Added define for site title and to standard template parameters.
Added apply_filter for additional placement in main dashboard widget and members dashboard.
Updated phpgraphlib with some custom improvements.

14 files changed:
controllers/admin.php
defines.php
index.php
lib/phpgraphlib-master/00_MODIFIED_DONT_UPDATE [new file with mode: 0644]
lib/phpgraphlib-master/phpgraphlib.php
models/admin/ajax/memberClickThrough.php
models/admin/ajax/memberDetailClick.php
models/admin/ajax/memberGraphs.php
models/front/members/list.php
setup/hooksHelp.html
setup/standardTemplateParams.php
views/admin/dashboardWidget/index.html
views/admin/member/index.html
views/admin/members/index.html

index 69b04bf..78cdcd2 100644 (file)
@@ -370,7 +370,8 @@ class glmMembersAdmin extends GlmPluginSupport
                 </script>
             ";
         }
-exit;
+
+        exit;   // Need to test if this is here for a reason!
         wp_die();
 
     }
@@ -639,15 +640,23 @@ exit;
      * For a better explanation of how this all works, see the description for
      * this class.
      *
+     * NOTE: When calling controller() directly, this controller will check for
+     * $actionData not being false and not attempt to check the $_REQUEST array
+     * for any submitted action request. Since it makes no sense to call the
+     * controller directly without some $actionData other than from the main index.php
+     * file, this should not be a problem. Doing so, however may cause unexpected
+     * results like excessive looping.
+     *
      * Controller parameters
      *
      * @param string $menuItem Name of the menu item that is being processed
      * @param string $action Specified Action to take or false
+     * @param array $actionData Optional array of data to pass to the selected action
      *
      * @return void
      * @access public
      */
-    public function controller ($menuItem, $action = false)
+    public function controller ($menuItem, $action = false, $actionData = false)
     {
 
         // Enque admin scripts and css here so that only happens when we're doing something
@@ -708,7 +717,7 @@ exit;
 
         // Get any requested "action" from a form submission and modify path/name
         // accordingly. This modifies the previously set $action.
-        if (isset($_REQUEST['glm_action']) && $_REQUEST['glm_action'] != '') {
+        if (!$actionData && isset($_REQUEST['glm_action']) && $_REQUEST['glm_action'] != '') {
             $a = sanitize_text_field($_REQUEST['glm_action']);
             if ($a != '') {
                 $action = $a;
@@ -729,7 +738,7 @@ exit;
         // Loop till we have a final action
         $loopCheck = 0;
         $loopTracking = "<p>Menu: $menuItem, Action = $action</p>";
-        $actionData = false;
+//        $actionData = false;
         do {
 
             if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
@@ -877,7 +886,7 @@ exit;
                             if (!is_file($viewPath.'/'.$viewFile)) {
 
                                 // No matching view file found
-                                $errorMsg .= "<b>Bad or missing view file:</b> $viewPath/$viewfile";
+                                $errorMsg .= "<b>Bad or missing view file:</b> $viewPath/$view";
                                 $badView = true;
 
                             }
@@ -905,7 +914,7 @@ exit;
             }
 
             // This is just a sanity check on this loop to keep it from getting out of control
-            if (++$loopCheck > 10) {
+            if (++$loopCheck > 5) {
                 die('
                     <h1>Serious failure looping on model load in "controllers/admin.php".</h1>
                     <div class="glm-item-container">
index 42d0cba..94a1fed 100644 (file)
@@ -7,6 +7,8 @@
 
 // NOTE: Plugin & Database versions are defined in "/glm-member-db.php".
 
+define('GLM_MEMBERS_SITE_TITLE', get_bloginfo( 'name' ));
+
 define('GLM_MEMBERS_PLUGIN_NAME', 'GLM Associate - Membership Management System');
 define('GLM_MEMBERS_PLUGIN_SHORT_NAME', 'GLM Associate');
 define('GLM_MEMBERS_PLUGIN_SLUG', 'glm-member-db');
index dc7e79e..10b6494 100644 (file)
--- a/index.php
+++ b/index.php
@@ -504,7 +504,8 @@ function glmCheckDatabase ()
 
                 // Check if the database version set for this plug-in is invalid - not in the dbVersions array
                 if (!isset($a['database']['dbVersions'][$dbVersion])) {
-                    $startupNotices .= "<p>The last database version set for the ".$a['name']." ($dbVersion) isn't valid.<p>";
+                    $startupNotices .= "<p>The last database version set for the ".$a['name']." ($dbVersion) isn't valid.<p><pre>".
+                        print_r($a['database']['dbVersions'],1)."</pre>";
                     $db_error = true;
                 } else {
 
diff --git a/lib/phpgraphlib-master/00_MODIFIED_DONT_UPDATE b/lib/phpgraphlib-master/00_MODIFIED_DONT_UPDATE
new file mode 100644 (file)
index 0000000..e69de29
index 476e703..15b2245 100644 (file)
@@ -7,8 +7,8 @@ PHPGraphLib Graphing Library
 The first version PHPGraphLib was written in 2007 by Elliott Brueggeman to
 deliver PHP generated graphs quickly and easily. It has grown in both features
 and maturity since its inception, but remains PHP 4.04+ compatible. Originally
-available only for paid commerial use, PHPGraphLib was open-sourced in 2013 
-under the MIT License. Please visit http://www.ebrueggeman.com/phpgraphlib 
+available only for paid commerial use, PHPGraphLib was open-sourced in 2013
+under the MIT License. Please visit http://www.ebrueggeman.com/phpgraphlib
 for more information.
 
 ---
@@ -72,7 +72,7 @@ class PHPGraphLib {
        const MULTI_OFFSET_FIVE = 9;
 
        //padding inside legend box
-       const LEGEND_PADDING = 4; 
+       const LEGEND_PADDING = 4;
        const LEGEND_MAX_CHARS = 15;
 
        //display default
@@ -97,7 +97,7 @@ class PHPGraphLib {
        protected $bool_ignore_data_fit_errors = false;
        protected $data_point_width = 6;
        protected $x_axis_value_interval = false;
-       
+
        //internal status vars
        protected $data_set_count = 0;
        protected $data_min = 0;
@@ -166,7 +166,7 @@ class PHPGraphLib {
        protected $highest_x;
 
        //aka bottom margin
-       protected $x_axis_margin; 
+       protected $x_axis_margin;
 
        //aka left margin
        protected $y_axis_margin;
@@ -182,12 +182,12 @@ class PHPGraphLib {
        protected $multi_bar_colors = array();
 
        //percent color decrease for multiple datasets
-       protected $color_darken_factor = 30; 
+       protected $color_darken_factor = 30;
 
        //legend variables
        protected $bool_legend = false;
-       protected $legend_total_chars = array(); 
-       
+       protected $legend_total_chars = array();
+
        protected $legend_width;
        protected $legend_height;
        protected $legend_x;
@@ -198,7 +198,7 @@ class PHPGraphLib {
        protected $legend_swatch_outline_color;
        protected $legend_titles = array();
 
-       public function __construct($width, $height, $output_file = null) 
+       public function __construct($width, $height, $output_file = null)
        {
                $this->width = $width;
                $this->height = $height;
@@ -207,7 +207,7 @@ class PHPGraphLib {
                $this->allocateColors();
        }
 
-       protected function initialize() 
+       protected function initialize()
        {
                //header must be sent before any html or blank space output
                if (!$this->output_file) {
@@ -218,50 +218,50 @@ class PHPGraphLib {
                        or die("Cannot Initialize new GD image stream - Check your PHP setup");
        }
 
-       public function createGraph() 
+       public function createGraph()
        {
                //main class method - called last
                //setup axis if not already setup by user
                if ($this->bool_data){
                        $this->analyzeData();
-                       if (!$this->bool_x_axis_setup) { 
-                               $this->setupXAxis(); 
+                       if (!$this->bool_x_axis_setup) {
+                               $this->setupXAxis();
                        }
-                       if (!$this->bool_y_axis_setup){ 
-                               $this->setupYAxis(); 
+                       if (!$this->bool_y_axis_setup){
+                               $this->setupYAxis();
                        }
-                       
+
                        //calculations
                        $this->calcTopMargin();
                        $this->calcRightMargin();
                        $this->calcCoords();
                        $this->setupData();
-                       
+
                        //start creating actual image elements
-                       if ($this->bool_background) { 
-                               $this->generateBackgound(); 
+                       if ($this->bool_background) {
+                               $this->generateBackgound();
                        }
-                       
+
                        //always gen grid values, even if not displayed
                        $this->setupGrid();
 
-                       if ($this->bool_bars_generate) { 
-                               $this->generateBars(); 
+                       if ($this->bool_bars_generate) {
+                               $this->generateBars();
                        }
                        if ($this->bool_data_points) {
-                               $this->generateDataPoints(); 
+                               $this->generateDataPoints();
                        }
-                       if ($this->bool_legend) { 
-                               $this->generateLegend(); 
+                       if ($this->bool_legend) {
+                               $this->generateLegend();
                        }
-                       if ($this->bool_title) { 
-                               $this->generateTitle(); 
+                       if ($this->bool_title) {
+                               $this->generateTitle();
                        }
-                       if ($this->bool_x_axis) { 
-                               $this->generateXAxis(); 
+                       if ($this->bool_x_axis) {
+                               $this->generateXAxis();
                        }
-                       if ($this->bool_y_axis) { 
-                               $this->generateYAxis(); 
+                       if ($this->bool_y_axis) {
+                               $this->generateYAxis();
                        }
                } else {
                        $this->error[] = "No valid data added to graph. Add data with the addData() function.";
@@ -282,7 +282,7 @@ class PHPGraphLib {
        protected function setupData()
        {
                $unit_width = ($this->width - $this->y_axis_margin - $this->right_margin) / (($this->data_count * 2) + $this->data_count);
-               if ($unit_width < 1 && !$this->bool_ignore_data_fit_errors) {   
+               if ($unit_width < 1 && !$this->bool_ignore_data_fit_errors) {
                        //error units too small, too many data points or not large enough graph
                        $this->bool_bars_generate = false;
                        $this->error[] = "Graph too small or too many data points.";
@@ -292,7 +292,7 @@ class PHPGraphLib {
                        $this->bar_width = 2 * $unit_width;
                        $this->space_width = $unit_width;
                        //now calculate height (scale) units
-                       $availVertSpace = $this->height - $this->x_axis_margin - $this->top_margin;     
+                       $availVertSpace = $this->height - $this->x_axis_margin - $this->top_margin;
                        if ($availVertSpace < 1) {
                                $this->bool_bars_generate = false;
                                $this->error[] = "Graph height not tall enough.";
@@ -301,11 +301,11 @@ class PHPGraphLib {
                                if ($this->bool_user_data_range) {
                                        //if all zero data, set fake max and min to range boundaries
                                        if ($this->all_zero_data) {
-                                               if ($this->data_range_min > $this->data_min) { 
-                                                       $this->data_min = $this->data_range_min; 
+                                               if ($this->data_range_min > $this->data_min) {
+                                                       $this->data_min = $this->data_range_min;
                                                }
                                                if ($this->data_range_max < $this->data_max) {
-                                                       $this->data_max = $this->data_range_max; 
+                                                       $this->data_max = $this->data_range_max;
                                                }
                                        }
 
@@ -328,12 +328,12 @@ class PHPGraphLib {
                                        $graphBottomScale = ($this->data_min<0) ? $this->data_min : 0;
                                        $graphTopScale = ($this->data_max<0) ? 0 : $this->data_max ;
                                        $graphScaleRange = $graphTopScale - $graphBottomScale;
-                                       
+
                                        //all data identical
                                        if ($graphScaleRange == 0) {
                                                $graphScaleRange = 100;
                                        }
-                                       $this->unit_scale = $availVertSpace / $graphScaleRange;                 
+                                       $this->unit_scale = $availVertSpace / $graphScaleRange;
                                        //now adjust x axis in y value if negative values
                                        if ($this->data_min < 0) {
                                                $this->x_axis_y1 -= round($this->unit_scale * abs($this->data_min));
@@ -344,8 +344,34 @@ class PHPGraphLib {
                }
        }
 
+       // Function added by Chuck Scott - 8/22/16
+    protected function imagelinethick($image, $x1, $y1, $x2, $y2, $color, $thick = 1)
+    {
+        /* this way it works well only for orthogonal lines
+        imagesetthickness($image, $thick);
+        return imageline($image, $x1, $y1, $x2, $y2, $color);
+        */
+        if ($thick == 1) {
+            return imageline($image, $x1, $y1, $x2, $y2, $color);
+        }
+        $t = $thick / 2 - 0.5;
+        if ($x1 == $x2 || $y1 == $y2) {
+            return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);
+        }
+        $k = ($y2 - $y1) / ($x2 - $x1); //y = kx + q
+        $a = $t / sqrt(1 + pow($k, 2));
+        $points = array(
+            round($x1 - (1+$k)*$a), round($y1 + (1-$k)*$a),
+            round($x1 - (1-$k)*$a), round($y1 - (1+$k)*$a),
+            round($x2 + (1+$k)*$a), round($y2 - (1-$k)*$a),
+            round($x2 + (1-$k)*$a), round($y2 + (1+$k)*$a),
+        );
+        imagefilledpolygon($image, $points, 4, $color);
+        return imagepolygon($image, $points, 4, $color);
+    }
+
        //always port changes to generatebars() to extensions
-       protected function generateBars() 
+       protected function generateBars()
        {
                $this->finalizeColors();
 
@@ -360,33 +386,37 @@ class PHPGraphLib {
 
                //set different offsets based on number of data sets
                $dataset_offset = 0;
+               /* Commented out. What the heck is this in there for anyway? Chuck Scott - 8/22/16
                switch ($this->data_set_count) {
-                       case 2: 
-                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_TWO / 100); 
+                       case 2:
+                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_TWO / 100);
                                break;
-                       case 3: 
-                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_THREE / 100); 
+                       case 3:
+                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_THREE / 100);
                                break;
-                       case 4: 
-                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_FOUR / 100); 
+                       case 4:
+                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_FOUR / 100);
                                break;
-                       case 5: 
-                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_FIVE / 100); 
+                       case 5:
+                               $dataset_offset = $this->bar_width * (self::MULTI_OFFSET_FIVE / 100);
                                break;
                }
-               
+               */
+
                foreach ($this->data_array as $data_set_num => $data_set) {
                        $lineX2 = null;
                        reset($data_set);
                        $xStart = $this->y_axis_x1 + ($this->space_width / 2) + ((key($data_set) - $this->lowest_x) * ($this->bar_width + $this->space_width));
+                   $xIndex = 0;
                        foreach ($data_set as $key => $item) {
                                $hideBarOutline = false;
+                               $xIndex++;
 
                                $x1 = round($xStart + ($dataset_offset * $data_set_num));
                                $x2 = round(($xStart + $this->bar_width) + ($dataset_offset * $data_set_num));
                                $y1 = round($this->x_axis_y1 - ($item * $this->unit_scale) + $adjustment);
                                $y2 = round($this->x_axis_y1);
-                               
+
                                //if we are using a user specified data range, need to limit what's displayed
                                if ($this->bool_user_data_range) {
                                        if ($item <= $this->data_range_min) {
@@ -395,10 +425,10 @@ class PHPGraphLib {
                                                $hideBarOutline = true;
                                        } elseif ($item >= $this->data_range_max) {
                                                //display, but cut off display above range max
-                                               $y1 = $this->x_axis_y1 - ($this->actual_displayed_max_value * $this->unit_scale) + $adjustment; 
+                                               $y1 = $this->x_axis_y1 - ($this->actual_displayed_max_value * $this->unit_scale) + $adjustment;
                                        }
-                               }       
-                               //draw bar 
+                               }
+                               //draw bar
                                if ($this->bool_bars) {
                                        if ($this->bool_gradient) {
                                                //draw gradient if desired
@@ -406,9 +436,9 @@ class PHPGraphLib {
                                        } else {
                                                imagefilledrectangle($this->image, $x1, $y1,$x2, $y2,  $this->multi_bar_colors[$data_set_num]);
                                        }
-                                       //draw bar outline      
-                                       if ($this->bool_bar_outline && !$hideBarOutline) { 
-                                               imagerectangle($this->image, $x1, $y2, $x2, $y1, $this->outline_color); 
+                                       //draw bar outline
+                                       if ($this->bool_bar_outline && !$hideBarOutline) {
+                                               imagerectangle($this->image, $x1, $y2, $x2, $y1, $this->outline_color);
                                        }
                                }
                                // draw line
@@ -416,13 +446,13 @@ class PHPGraphLib {
                                        $lineX1 = $x1 + ($this->bar_width / 2); //MIDPOINT OF BARS, IF SHOWN
                                        $lineY1 = $y1;
                                        if (isset($lineX2)) {
-                                               imageline($this->image, $lineX2, $lineY2, $lineX1, $lineY1, $this->line_color[$data_set_num]);
+                                               $this->imagelinethick($this->image, $lineX2, $lineY2, $lineX1, $lineY1, $this->line_color[$data_set_num], 2);
                                                $lineX2 = $lineX1;
                                                $lineY2 = $lineY1;
                                        } else {
                                                $lineX2 = $lineX1;
                                                $lineY2 = $lineY1;
-                                       }       
+                                       }
                                }
                                // display data points
                                if ($this->bool_data_points) {
@@ -456,7 +486,7 @@ class PHPGraphLib {
                                        $dataX -= ($this->data_additional_length * self::DATA_VALUE_TEXT_WIDTH) / 2;
                                        imagestring($this->image, 2, $dataX, $dataY, $item,  $this->data_value_color);
                                }
-                               //write x axis value 
+                               //write x axis value
                                if ($this->bool_x_axis_values) {
                                        {
                                                if ($this->bool_x_axis_values_vert) {
@@ -469,10 +499,10 @@ class PHPGraphLib {
                                                                $textVertPos = round($this->y_axis_y1 + (strlen($key) * self::TEXT_WIDTH) + self::AXIS_VALUE_PADDING);
                                                        }
                                                        $textHorizPos = round($xStart + ($this->bar_width / 2) - (self::TEXT_HEIGHT / 2));
-                                       
+
                                                        //skip and dispplay every x intervals
                                                        if ($this->x_axis_value_interval) {
-                                                               if ($key % $this->x_axis_value_interval) {
+                                                               if ($xIndex % $this->x_axis_value_interval) {
                                                                } else {
                                                                        imagestringup($this->image, 2, $textHorizPos, $textVertPos, $key,  $this->x_axis_text_color);
                                                                }
@@ -492,8 +522,8 @@ class PHPGraphLib {
                                                        }
                                                        //horizontal data keys
                                                        $textHorizPos = round($xStart + ($this->bar_width / 2) - ((strlen($key) * self::TEXT_WIDTH) / 2));
-                                                       
-                                                       
+
+
                                                        //skip and dispplay every x intervals
                                                        if ($this->x_axis_value_interval) {
                                                                if ($key % $this->x_axis_value_interval) {
@@ -521,7 +551,7 @@ class PHPGraphLib {
                                while ($num_set < $this->data_set_count) {
                                        $color_ref_1 = $this->multi_gradient_colors_1[$num_set - 1];
                                        $color_ref_2 = $this->multi_gradient_colors_2[$num_set - 1];
-                                       $this->multi_gradient_colors_1[] = array( 
+                                       $this->multi_gradient_colors_1[] = array(
                                                round($color_ref_1[0] * $color_darken_decimal),
                                                round($color_ref_1[1] * $color_darken_decimal),
                                                round($color_ref_1[2] * $color_darken_decimal));
@@ -530,7 +560,7 @@ class PHPGraphLib {
                                                round($color_ref_2[1] * $color_darken_decimal),
                                                round($color_ref_2[2] * $color_darken_decimal));
                                        $num_set++;
-                               }       
+                               }
                        }
                        while (count($this->multi_gradient_colors_1) > $this->data_set_count) {
                                $temp = array_pop($this->multi_gradient_colors_1);
@@ -551,9 +581,9 @@ class PHPGraphLib {
                                $color_ref = $this->multi_bar_colors[$num_set - 1];
                                $color_parts = imagecolorsforindex($this->image, $color_ref);
                                $color_darken_decimal = (100 - $this->color_darken_factor) / 100;
-                               $this->multi_bar_colors[$num_set] = imagecolorallocate($this->image, 
-                                       round($color_parts['red'] * $color_darken_decimal), 
-                                       round($color_parts['green'] * $color_darken_decimal), 
+                               $this->multi_bar_colors[$num_set] = imagecolorallocate($this->image,
+                                       round($color_parts['red'] * $color_darken_decimal),
+                                       round($color_parts['green'] * $color_darken_decimal),
                                        round($color_parts['blue'] * $color_darken_decimal));
                                $num_set++;
                        }
@@ -574,9 +604,9 @@ class PHPGraphLib {
                                        $color_ref = $this->line_color[$num_set - 1];
                                        $color_parts = imagecolorsforindex($this->image, $color_ref);
                                        $color_darken_decimal = (100 - $this->color_darken_factor) / 100;
-                                       $this->line_color[$num_set] = imagecolorallocate($this->image, 
-                                               round($color_parts['red'] * $color_darken_decimal), 
-                                               round($color_parts['green'] * $color_darken_decimal), 
+                                       $this->line_color[$num_set] = imagecolorallocate($this->image,
+                                               round($color_parts['red'] * $color_darken_decimal),
+                                               round($color_parts['green'] * $color_darken_decimal),
                                                round($color_parts['blue'] * $color_darken_decimal));
                                        $num_set++;
                                }
@@ -591,10 +621,10 @@ class PHPGraphLib {
                                $temp = array_pop($this->line_color);
                        }
                        $this->line_color = array_reverse($this->line_color);
-               }       
+               }
        }
 
-       protected function drawGradientBar($x1, $y1, $x2, $y2, $colorArr1, $colorArr2, $data_set_num) 
+       protected function drawGradientBar($x1, $y1, $x2, $y2, $colorArr1, $colorArr2, $data_set_num)
        {
                if (!isset($this->bool_gradient_colors_found[$data_set_num]) || $this->bool_gradient_colors_found[$data_set_num] == false) {
                        $this->gradient_handicap[$data_set_num] = 0;
@@ -625,17 +655,17 @@ class PHPGraphLib {
                                if ($adjusted_index < 0) {
                                        $adjusted_index = 0;
                                }
-                               imageline($this->image, $x1+$i, $y1, $x1 + $i, $y2, $this->gradient_color_array[$data_set_num][$adjusted_index]);               
+                               imageline($this->image, $x1+$i, $y1, $x1 + $i, $y2, $this->gradient_color_array[$data_set_num][$adjusted_index]);
                        }
                } else {
                        //normal gradients with colors < self::GRADIENT_MAX_COLORS
                        for ($i = 0; $i < $numLines; $i++) {
-                               imageline($this->image, $x1+$i, $y1, $x1+$i, $y2, $this->gradient_color_array[$data_set_num][$i]);              
+                               imageline($this->image, $x1+$i, $y1, $x1+$i, $y2, $this->gradient_color_array[$data_set_num][$i]);
                        }
                }
        }
 
-       protected function setupGrid() 
+       protected function setupGrid()
        {
                //adjustment for when user sets their data display range
                $adjustment = 0;
@@ -649,7 +679,7 @@ class PHPGraphLib {
                $this->generateGoalLines($adjustment);
        }
 
-       protected function calculateGridHoriz($adjustment = 0) 
+       protected function calculateGridHoriz($adjustment = 0)
        {
                //determine horizontal grid lines
                $horizGridArray = array();
@@ -659,7 +689,7 @@ class PHPGraphLib {
                //use our function to determine ideal y axis scale interval
                $intervalFromZero = $this->determineAxisMarkerScale($this->data_max, $this->data_min);
 
-               //if we have positive values, add grid values to array 
+               //if we have positive values, add grid values to array
                //until we reach the max needed (we will go 1 over)
                $cur = $min;
                while ($cur < $this->data_max) {
@@ -667,7 +697,7 @@ class PHPGraphLib {
                        $horizGridArray[] = $cur;
                }
 
-               //if we have negative values, add grid values to array 
+               //if we have negative values, add grid values to array
                //until we reach the min needed (we will go 1 over)
                $cur = $min;
                while ($cur > $this->data_min) {
@@ -678,14 +708,14 @@ class PHPGraphLib {
                //sort needed b/c we will use last value later (max)
                sort($horizGridArray);
                $this->actual_displayed_max_value = $horizGridArray[count($horizGridArray) - 1];
-               $this->actual_displayed_min_value = $horizGridArray[0]; 
+               $this->actual_displayed_min_value = $horizGridArray[0];
 
                //loop through each horizontal line
                foreach ($horizGridArray as $value) {
                        $yValue = round($this->x_axis_y1 - ($value * $this->unit_scale) + $adjustment);
                        if ($this->bool_grid) {
                                //imageline($this->image, $this->y_axis_x1, $yValue, $this->x_axis_x2 , $yValue, $this->grid_color);
-                               $this->horiz_grid_lines[] = array('x1' => $this->y_axis_x1, 'y1' => $yValue, 
+                               $this->horiz_grid_lines[] = array('x1' => $this->y_axis_x1, 'y1' => $yValue,
                                        'x2' => $this->x_axis_x2, 'y2' => $yValue, 'color' => $this->grid_color);
                        }
                        //display value on y axis if desired using calc'd grid values
@@ -722,13 +752,13 @@ class PHPGraphLib {
                for ($i = 1; $i < $vertGrids; $i++) {
                        $vertGridArray[] = $this->y_axis_x1 + ($interval * $i);
                }
-               
+
                //loop through each vertical line
                if ($this->bool_grid) {
                        $xValue = $this->y_axis_y1;
                        foreach ($vertGridArray as $value) {
                                //imageline($this->image, $value, $this->y_axis_y2, $value, $xValue , $this->grid_color);
-                               $this->vert_grid_lines[] = array('x1' => $value, 'y1' => $this->y_axis_y2, 
+                               $this->vert_grid_lines[] = array('x1' => $value, 'y1' => $this->y_axis_y2,
                                        'x2' => $value, 'y2' => $xValue, 'color' => $this->grid_color);
                        }
                }
@@ -742,7 +772,7 @@ class PHPGraphLib {
                }
        }
 
-       protected function generateGrids() 
+       protected function generateGrids()
        {
                //loop through and display values
                foreach ($this->horiz_grid_lines as $line) {
@@ -760,7 +790,7 @@ class PHPGraphLib {
                }
        }
 
-       protected function generateGoalLines($adjustment = 0) 
+       protected function generateGoalLines($adjustment = 0)
        {
                //draw goal lines if present (after grid) - doesn't get executed if array empty
                foreach ($this->goal_line_array as $goal_line_data) {
@@ -778,29 +808,29 @@ class PHPGraphLib {
                }
        }
 
-       protected function generateDataPoints() 
+       protected function generateDataPoints()
        {
                foreach ($this->data_point_array as $pointArray) {
                        imagefilledellipse($this->image, $pointArray[0], $pointArray[1], $this->data_point_width, $this->data_point_width, $this->data_point_color);
-               }               
+               }
        }
 
-       protected function generateXAxis() 
+       protected function generateXAxis()
        {
                imageline($this->image, $this->x_axis_x1, $this->x_axis_y1, $this->x_axis_x2, $this->x_axis_y2, $this->x_axis_color);
        }
 
-       protected function generateYAxis() 
+       protected function generateYAxis()
        {
                imageline($this->image, $this->y_axis_x1, $this->y_axis_y1, $this->y_axis_x2, $this->y_axis_y2, $this->y_axis_color);
        }
 
-       protected function generateBackgound() 
+       protected function generateBackgound()
        {
                imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, $this->background_color);
        }
 
-       protected function generateTitle() 
+       protected function generateTitle()
        {
                //spacing may have changed since earlier
                //use top margin or grid top y, whichever less
@@ -820,7 +850,7 @@ class PHPGraphLib {
                imagestring($this->image, 2, $title_x , $title_y , $this->title_text,  $this->title_color);
        }
 
-       protected function calcTopMargin() 
+       protected function calcTopMargin()
        {
                if ($this->bool_title) {
                        //include space for title, approx margin + 3*title height
@@ -828,16 +858,16 @@ class PHPGraphLib {
                } else {
                        //just use default spacing
                        $this->top_margin = $this->height * (self::X_AXIS_MARGIN_PERCENT / 100);
-               }       
+               }
        }
 
-       protected function calcRightMargin() 
+       protected function calcRightMargin()
        {
                //just use default spacing
                $this->right_margin = $this->width * (self::Y_AXIS_MARGIN_PERCENT / 100);
        }
 
-       protected function calcCoords() 
+       protected function calcCoords()
        {
                //calculate axis points, also used for other calculations
                $this->x_axis_x1 = $this->y_axis_margin;
@@ -849,18 +879,18 @@ class PHPGraphLib {
                $this->y_axis_x2 = $this->y_axis_margin;
                $this->y_axis_y2 = $this->top_margin;
        }
-       
-       protected function determineAxisMarkerScale($max, $min, $axis = 'y') 
+
+       protected function determineAxisMarkerScale($max, $min, $axis = 'y')
        {
                switch ($axis) {
-                       case 'y' : 
-                               $space = $this->height; 
+                       case 'y' :
+                               $space = $this->height;
                                break;
-                       case 'x' : 
-                               $space = $this->width; 
+                       case 'x' :
+                               $space = $this->width;
                                break;
                }
-       
+
                //for calclation, take range or max-0
                if ($this->bool_user_data_range) {
                        $range = abs($max - $min);
@@ -890,12 +920,12 @@ class PHPGraphLib {
                for ($i = 0; $i < $count; $i++) {
                        $result /= 10;
                }
-               return $result; 
+               return $result;
        }
-       
-       protected function roundUpSameDigits($num) 
-       {           
-               $len = strlen($num);  
+
+       protected function roundUpSameDigits($num)
+       {
+               $len = strlen($num);
                if (round($num, -1 * ($len - 1)) == $num) {
                        //we already have a sig number
                        return $num;
@@ -910,18 +940,18 @@ class PHPGraphLib {
                }
        }
 
-       protected function roundUpOneExtraDigit($num) 
-       {                     
-               $len = strlen($num);  
+       protected function roundUpOneExtraDigit($num)
+       {
+               $len = strlen($num);
                $firstDig = substr($num, 0, 1);
                $rest = substr($num, 1);
                $firstDig = 5;
                $altered = $firstDig . $rest;
                //after reassembly, round up to next sig number, one extra # of digits
-               return round((int)$altered, -1 * ($len)); 
+               return round((int)$altered, -1 * ($len));
        }
 
-       protected function displayErrors() 
+       protected function displayErrors()
        {
                if (count($this->error) > 0) {
                        $lineHeight = 12;
@@ -930,15 +960,15 @@ class PHPGraphLib {
                        imagefilledrectangle($this->image, 0, 0, $this->width - 1, 2 * $lineHeight,  $errorBackColor);
                        imagestring($this->image, 3, 2, 0, "!!----- PHPGraphLib Error -----!!",  $errorColor);
                        foreach($this->error as $key => $errorText) {
-                               imagefilledrectangle($this->image, 0, ($key * $lineHeight) + $lineHeight, $this->width - 1, ($key * $lineHeight) + 2 * $lineHeight,  $errorBackColor);  
-                               imagestring($this->image, 2, 2, ($key * $lineHeight) + $lineHeight, "[". ($key + 1) . "] ". $errorText,  $errorColor);  
+                               imagefilledrectangle($this->image, 0, ($key * $lineHeight) + $lineHeight, $this->width - 1, ($key * $lineHeight) + 2 * $lineHeight,  $errorBackColor);
+                               imagestring($this->image, 2, 2, ($key * $lineHeight) + $lineHeight, "[". ($key + 1) . "] ". $errorText,  $errorColor);
                        }
                        $errorOutlineColor = imagecolorallocate($this->image, 255, 0, 0);
-                       imagerectangle($this->image, 0, 0, $this->width-1,($key * $lineHeight) + 2 * $lineHeight,  $errorOutlineColor);         
+                       imagerectangle($this->image, 0, 0, $this->width-1,($key * $lineHeight) + 2 * $lineHeight,  $errorOutlineColor);
                }
        }
 
-       public function addData($data, $data2 = '', $data3 = '', $data4 = '', $data5 = '') 
+       public function addData($data, $data2 = '', $data3 = '', $data4 = '', $data5 = '')
        {
                $data_sets = array($data, $data2, $data3, $data4, $data5);
 
@@ -969,11 +999,11 @@ class PHPGraphLib {
                                        unset($this->data_array[$data_set_num][$key]);
                                        continue;
                                }
-                               if ($item < $this->data_min) { 
+                               if ($item < $this->data_min) {
                                        $this->data_min = $item;
                                }
-                               if ($item > $this->data_max) { 
-                                       $this->data_max = $item; 
+                               if ($item > $this->data_max) {
+                                       $this->data_max = $item;
                                }
                        }
                        //find the count of the dataset with the most data points
@@ -995,11 +1025,11 @@ class PHPGraphLib {
                        $this->error[] = "No valid datasets added in adddata() function.";
                        return;
                }
-               
+
                $this->bool_data = true;
        }
 
-       protected function analyzeData() 
+       protected function analyzeData()
        {
                if ($this->data_min >= 0) {
                        $this->bool_all_positive = true;
@@ -1011,10 +1041,10 @@ class PHPGraphLib {
                        $this->data_min = 0;
                        $this->data_max = 10;
                        $this->all_zero_data = true;
-               } 
+               }
        }
 
-       public function setupXAxis($percent = '', $color = '') 
+       public function setupXAxis($percent = '', $color = '')
        {
                $this->bool_x_axis_setup = true;
                if ($percent === false) {
@@ -1025,16 +1055,16 @@ class PHPGraphLib {
                if (!empty($color) && $arr = $this->returnColorArray($color)) {
                        $this->x_axis_color = imagecolorallocate($this->image, $arr[0], $arr[1], $arr[2]);
                }
-               if (is_numeric($percent) && $percent > 0) { 
+               if (is_numeric($percent) && $percent > 0) {
                        $percent = $percent / 100;
                        $this->x_axis_margin = round($this->height * $percent);
                } else {
                        $percent = self::X_AXIS_MARGIN_PERCENT / 100;
                        $this->x_axis_margin = round($this->height * $percent);
-               }       
+               }
        }
 
-       public function setupYAxis($percent = '', $color = '') 
+       public function setupYAxis($percent = '', $color = '')
        {
                $this->bool_y_axis_setup = true;
                if ($percent === false) {
@@ -1045,7 +1075,7 @@ class PHPGraphLib {
                if (!empty($color) && $arr = $this->returnColorArray($color)) {
                        $this->y_axis_color = imagecolorallocate($this->image, $arr[0], $arr[1], $arr[2]);
                }
-               if (is_numeric($percent) && $percent > 0) { 
+               if (is_numeric($percent) && $percent > 0) {
                        $this->y_axis_margin = round($this->width * ($percent / 100));
                } else {
                        $percent = self::Y_AXIS_MARGIN_PERCENT / 100;
@@ -1053,7 +1083,7 @@ class PHPGraphLib {
                }
        }
 
-       public function setRange($min, $max) 
+       public function setRange($min, $max)
        {
                //because of deprecated use of this function as($max, $min)
                if ($min > $max) {
@@ -1066,82 +1096,82 @@ class PHPGraphLib {
                $this->bool_user_data_range = true;
        }
 
-       public function setTitle($title) 
+       public function setTitle($title)
        {
                if (!empty($title)) {
                        $this->title_text = $title;
                        $this->bool_title = true;
-               } else { 
-                       $this->error[] = "String arg for setTitle() not specified properly."; 
-               }       
+               } else {
+                       $this->error[] = "String arg for setTitle() not specified properly.";
+               }
        }
 
-       public function setTitleLocation($location) 
+       public function setTitleLocation($location)
        {
                $this->bool_title_left = false;
                $this->bool_title_right = false;
                $this->bool_title_center = false;
                switch (strtolower($location)) {
-                       case 'left': 
+                       case 'left':
                                $this->bool_title_left = true;
                                break;
-                       case 'right': 
+                       case 'right':
                                $this->bool_title_right = true;
                                break;
                        case 'center':
                                $this->bool_title_center = true;
                                break;
-                       default: 
+                       default:
                                $this->error[] = "String arg for setTitleLocation() not specified properly.";
-               }       
+               }
        }
 
-       public function setBars($bool) 
+       public function setBars($bool)
        {
-               if (is_bool($bool)) { 
+               if (is_bool($bool)) {
                        $this->bool_bars = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setBars() not specified properly.";
                }
        }
 
-       public function setGrid($bool) 
+       public function setGrid($bool)
        {
-               if (is_bool($bool)) { 
+               if (is_bool($bool)) {
                        $this->bool_grid = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setGrid() not specified properly.";
                }
        }
 
-       public function setXValues($bool) 
+       public function setXValues($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_x_axis_values = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setXValues() not specified properly.";
                }
        }
 
-       public function setYValues($bool) 
+       public function setYValues($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_y_axis_values = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setYValues() not specified properly.";
                }
        }
 
-       public function setXValuesHorizontal($bool) 
+       public function setXValuesHorizontal($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_x_axis_values_vert = !$bool;
                } else {
-                       $this->error[] = "Boolean arg for setXValuesHorizontal() not specified properly."; 
+                       $this->error[] = "Boolean arg for setXValuesHorizontal() not specified properly.";
                }
        }
 
-       public function setXValuesVertical($bool) 
+       public function setXValuesVertical($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_x_axis_values_vert = $bool;
@@ -1159,7 +1189,7 @@ class PHPGraphLib {
                }
        }
 
-       public function setBarOutline($bool) 
+       public function setBarOutline($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_bar_outline = $bool;
@@ -1168,7 +1198,7 @@ class PHPGraphLib {
                }
        }
 
-       public function setDataPoints($bool) 
+       public function setDataPoints($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_data_points = $bool;
@@ -1177,7 +1207,7 @@ class PHPGraphLib {
                }
        }
 
-       public function setDataPointSize($size) 
+       public function setDataPointSize($size)
        {
                if (is_numeric($size)) {
                        $this->data_point_width = $size;
@@ -1186,7 +1216,7 @@ class PHPGraphLib {
                }
        }
 
-       public function setDataValues($bool) 
+       public function setDataValues($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_data_values = $bool;
@@ -1225,15 +1255,15 @@ class PHPGraphLib {
                                break;
                        case 'percent':
                                $this->data_format_array[] = 'formatDataAsPercent';
-                               $this->data_additional_length++; 
+                               $this->data_additional_length++;
                                break;
                        case 'degrees':
                                $this->data_format_array[] = 'formatDataAsDegrees';
-                               $this->data_additional_length++; 
+                               $this->data_additional_length++;
                                break;
-                       default: 
+                       default:
                                $this->data_format_array[] = 'formatDataAsGeneric';
-                               $this->data_format_generic = $format; 
+                               $this->data_format_generic = $format;
                                $this->data_additional_length += strlen($format);
                                break;
                }
@@ -1270,7 +1300,7 @@ class PHPGraphLib {
                //turn data into format 12,234...
                $parts = '';
                while (strlen($input)>3) {
-                       $parts = ',' . substr($input, -3) . $parts;     
+                       $parts = ',' . substr($input, -3) . $parts;
                        $input = substr($input, 0, strlen($input) - 3);
                }
                return $sign_part . $currency_part . $input . $parts . $decimal_part;
@@ -1293,9 +1323,9 @@ class PHPGraphLib {
 
        public function setLine($bool)
        {
-               if (is_bool($bool)) { 
+               if (is_bool($bool)) {
                        $this->bool_line = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setLine() not specified properly.";
                }
        }
@@ -1304,12 +1334,12 @@ class PHPGraphLib {
        {
                if (is_numeric($yValue)) {
                        if ($color) {
-                               $this->setGenericColor($color, '$this->goal_line_custom_color', "Goal line color not specified properly.");     
+                               $this->setGenericColor($color, '$this->goal_line_custom_color', "Goal line color not specified properly.");
                                $color = $this->goal_line_custom_color;
                        }
                        $this->goal_line_array[] = array(
-                               'yValue' => $yValue, 
-                               'color' => $color, 
+                               'yValue' => $yValue,
+                               'color' => $color,
                                'style' => $style
                        );
                        if($yValue > $this->data_max) {
@@ -1321,7 +1351,7 @@ class PHPGraphLib {
                }
        }
 
-       protected function allocateColors() 
+       protected function allocateColors()
        {
                $this->background_color = imagecolorallocate($this->image, 255, 255, 255);
                $this->grid_color = imagecolorallocate($this->image, 220, 220, 220);
@@ -1342,12 +1372,12 @@ class PHPGraphLib {
                $this->legend_swatch_outline_color = $this->line_color_default;
        }
 
-       protected function returnColorArray($color) 
+       protected function returnColorArray($color)
        {
                //check to see if color passed through in form '128,128,128' or hex format
                if (strpos($color,',') !== false) {
                        return explode(',', $color);
-               } elseif (substr($color, 0, 1) == '#') {        
+               } elseif (substr($color, 0, 1) == '#') {
                        if (strlen($color) == 7) {
                                $hex1 = hexdec(substr($color, 1, 2));
                                $hex2 = hexdec(substr($color, 3, 2));
@@ -1358,7 +1388,7 @@ class PHPGraphLib {
                                $hex2 = hexdec(substr($color, 2, 1) . substr($color, 2, 1));
                                $hex3 = hexdec(substr($color, 3, 1) . substr($color, 3, 1));
                                return array($hex1, $hex2, $hex3);
-                       }                       
+                       }
                }
 
                switch (strtolower($color)) {
@@ -1375,10 +1405,10 @@ class PHPGraphLib {
                        case 'lime':   return array(0,255,0); break;
                        case 'olive':  return array(128,128,0); break;
                        case 'yellow': return array(255,255,0); break;
-                       case 'navy':   return array(0,0,128); break;    
+                       case 'navy':   return array(0,0,128); break;
                        case 'blue':   return array(0,0,255); break;
                        case 'teal':   return array(0,128,128); break;
-                       case 'aqua':   return array(0,255,255); break;  
+                       case 'aqua':   return array(0,255,255); break;
                }
 
                $this->error[] = "Color name \"$color\" not recogized.";
@@ -1400,7 +1430,7 @@ class PHPGraphLib {
                //can be used for most color setting options
                if (!empty($inputColor) && ($arr = $this->returnColorArray($inputColor))) {
                        eval($var . ' = imagecolorallocate($this->image, $arr[0], $arr[1], $arr[2]);');
-                       return true;    
+                       return true;
                }
                else {
                        $this->error[] = $errorMsg;
@@ -1408,7 +1438,7 @@ class PHPGraphLib {
                }
        }
 
-       public function setBackgroundColor($color) 
+       public function setBackgroundColor($color)
        {
                if ($this->setGenericColor($color, '$this->background_color', "Background color not specified properly.")) {
                        $this->bool_background = true;
@@ -1426,12 +1456,12 @@ class PHPGraphLib {
                $this->setGenericColor($color, '$this->y_axis_text_color', "Y axis Text color not specified properly.");
        }
 
-       public function setXAxisTextColor($color) 
+       public function setXAxisTextColor($color)
        {
                $this->setGenericColor($color, '$this->x_axis_text_color', "X axis text color not specified properly.");
        }
 
-       public function setYAxisTextColor($color) 
+       public function setYAxisTextColor($color)
        {
                $this->setGenericColor($color, '$this->y_axis_text_color', "Y axis Text color not specified properly.");
        }
@@ -1481,7 +1511,7 @@ class PHPGraphLib {
                $this->setGenericColor($color, '$this->goal_line_color', "Goal line color not specified properly.");
        }
 
-       public function setGradient($color1, $color2, $color3 = '', $color4 = '', $color5 = '', $color6 = '', $color7 = '', $color8 = '', $color9 = '', $color10 = '') 
+       public function setGradient($color1, $color2, $color3 = '', $color4 = '', $color5 = '', $color6 = '', $color7 = '', $color8 = '', $color9 = '', $color10 = '')
        {
                if (!empty($color1) && !empty($color2) && ($arr1 = $this->returnColorArray($color1)) && ($arr2 = $this->returnColorArray($color2))) {
                        $this->bool_gradient = true;
@@ -1518,24 +1548,24 @@ class PHPGraphLib {
        //Legend Related Functions
        public function setLegend($bool)
        {
-               if (is_bool($bool)) { 
+               if (is_bool($bool)) {
                        $this->bool_legend = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setLegend() not specified properly.";
                }
        }
 
-       public function setLegendColor($color) 
+       public function setLegendColor($color)
        {
                $this->setGenericColor($color, '$this->legend_color', "Legend color not specified properly.");
        }
 
-       public function setLegendTextColor($color) 
+       public function setLegendTextColor($color)
        {
                $this->setGenericColor($color, '$this->legend_text_color', "Legend text color not specified properly.");
        }
 
-       public function setLegendOutlineColor($color) 
+       public function setLegendOutlineColor($color)
        {
                $this->setGenericColor($color, '$this->legend_outline_color', "Legend outline color not specified properly.");
        }
@@ -1550,7 +1580,7 @@ class PHPGraphLib {
                $title_array = array($title1, $title2, $title3, $title4, $title5);
                foreach ($title_array as $title) {
                        if ($len = strlen($title)) {
-                               if ($len > self::LEGEND_MAX_CHARS) { 
+                               if ($len > self::LEGEND_MAX_CHARS) {
                                        $title = substr($title, 0, self::LEGEND_MAX_CHARS);
                                        $this->legend_total_chars[] = self::LEGEND_MAX_CHARS;
                                } else {
@@ -1573,7 +1603,7 @@ class PHPGraphLib {
                        //could have more titles than data sets - check for this
                        if (isset($this->legend_total_chars[$i])){ $totalChars += $this->legend_total_chars[$i]; }
                }
-               $this->legend_width = $totalChars * self::LEGEND_TEXT_WIDTH + (self::LEGEND_PADDING * 2.2) + 
+               $this->legend_width = $totalChars * self::LEGEND_TEXT_WIDTH + (self::LEGEND_PADDING * 2.2) +
                        ($this->data_set_count * ($swatchSize + (self::LEGEND_PADDING * 2)));
                $this->legend_x = $this->x_axis_x2 - $this->legend_width;
                $highestElement = ($this->top_margin < $this->y_axis_y2) ? $this->top_margin : $this->y_axis_y2;
@@ -1607,17 +1637,17 @@ class PHPGraphLib {
                                $color = $this->line_color[$this->data_set_count - $i - 1];
                        }
                        imagefilledrectangle($this->image, $xValue, $yValue + $swatchToTextOffset, $xValue + $swatchSize, $yValue + $swatchToTextOffset + $swatchSize, $color);
-                       imagerectangle($this->image, $xValue, $yValue + $swatchToTextOffset, $xValue + $swatchSize, $yValue + $swatchToTextOffset + $swatchSize, $this->legend_swatch_outline_color);   
+                       imagerectangle($this->image, $xValue, $yValue + $swatchToTextOffset, $xValue + $swatchSize, $yValue + $swatchToTextOffset + $swatchSize, $this->legend_swatch_outline_color);
                        imagestring($this->image, 2, $xValue + (2 * self::LEGEND_PADDING + 2), $yValue, $data_label, $this->legend_text_color);
                }
        }
 
-       public function setIgnoreDataFitErrors($bool) 
+       public function setIgnoreDataFitErrors($bool)
        {
                if (is_bool($bool)) {
                        $this->bool_ignore_data_fit_errors = $bool;
-               } else { 
+               } else {
                        $this->error[] = "Boolean arg for setIgnoreDataFitErrors() not specified properly.";
-               }       
+               }
        }
 }
index 9c9835c..ba582ee 100644 (file)
@@ -64,8 +64,9 @@ class GlmMembersAdmin_ajax_memberClickThrough extends GlmDataMembers
     /*
      * Perform Model Action
      *
-     * This modelAction takes an AJAX image upload and stores the image in the
-     * media/images directory of the plugin.
+     * This modelAction takes an AJAX request to bump a member click-through
+     * counter in the database for the current day, week and month and updates
+     * the database accordingly.
      *
      * This model action does not return, it simply does it's work then calls die();
      *
index d0fd2c6..078b95b 100644 (file)
@@ -64,8 +64,9 @@ class GlmMembersAdmin_ajax_memberDetailClick extends GlmDataMembers
     /*
      * Perform Model Action
      *
-     * This modelAction takes an AJAX image upload and stores the image in the
-     * media/images directory of the plugin.
+     * This modelAction takes an AJAX request to bump a member detail page views
+     * counter in the database for the current day, week and month and updates
+     * the database accordingly.
      *
      * This model action does not return, it simply does it's work then calls die();
      *
index 1d975e7..fb90272 100644 (file)
@@ -63,8 +63,8 @@ class GlmMembersAdmin_ajax_memberGraphs extends GlmDataMembers
     /*
      * Perform Model Action
      *
-     * This modelAction takes an AJAX image upload and stores the image in the
-     * media/images directory of the plugin.
+     * This modelAction takes an AJAX request to produce certain member click-through
+     * and detail page views graphs and outputs the desired result.
      *
      * This model action does not return, it simply does it's work then calls die();
      *
@@ -187,7 +187,7 @@ class GlmMembersAdmin_ajax_memberGraphs extends GlmDataMembers
             $graph->setBackgroundColor('245,245,245');
             $graph->setLine(true);
             $graph->setBars(false);
-            $graph->setDataPoints(true);
+            $graph->setDataPoints(false);
             $graph->createGraph();
 
         }
index 311dcea..a8c7005 100644 (file)
@@ -406,7 +406,8 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo
         if ($actionData['request']['region-search']) {
             $regionSearch = $actionData['request']['region-search']-0;
             if ($regionSearch > 0) {
-                $where .= " AND T.region = $regionSearch";
+                $where .= $whereSep." T.region = $regionSearch";
+                $whereSep = ' AND ';
             }
         }
 
index efb7197..d4a299a 100644 (file)
@@ -812,4 +812,14 @@ public function glmMembersAddTabForMembers($addOnTabs)
                 </div>
             </td>
         </tr>
+        <tr>
+            <td>glm_members_admin_member_index_bottomOfMemberSummary</td>
+            <td>Filter</td>
+            <td>$memberID</td>
+            <td>
+                Permits adding data below the base member information on the member 
+                Dashboard page. This is just below where URL click-throughs and page views
+                are displayed. 
+            </td>
+        </tr>
         
\ No newline at end of file
index 0d2a929..4f8f261 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 // Common to both admin and front-end
+$smarty->templateAssign('glmSiteTitle', GLM_MEMBERS_SITE_TITLE);
 $smarty->templateAssign('glmPluginName', GLM_MEMBERS_PLUGIN_NAME );
 $smarty->templateAssign('siteBaseUrl', GLM_MEMBERS_SITE_BASE_URL);
 $smarty->templateAssign('assetsUrl', GLM_MEMBERS_PLUGIN_ASSETS_URL);
index f8fb5b8..c866870 100644 (file)
@@ -28,7 +28,7 @@
                              */
                             var availableTags = [
                     {foreach $membersList as $m}
-                                { label: "{$m.name|unescape:'html'}", value: "{$m.name|unescape:'html'}", id: '{$m.id}' },
+                                { label: "{$m.name|unescape:'html'|replace:'"':''}", value: "{$m.name|unescape:'html'|replace:'"':''}", id: '{$m.id}' },
                     {/foreach}
                              ];
                              $( "#glmMembersSearch" ).autocomplete({
index d633d53..14a0426 100644 (file)
@@ -90,6 +90,8 @@
         <div class="button button-secondary graph-print glm-right" data-areaToPrint="viewsPrintArea">Print</div>
     </div>
 
+  {apply_filters('glm_members_admin_member_index_bottomOfMemberSummary', '', {$member.fieldData.id})}
+
   <p>&nbsp;</p>
 
   {if $haveMember}
index cb3cf30..217ac2e 100644 (file)
@@ -58,6 +58,8 @@
     <table class="glm-admin-table">
         <tr><th>Number of {$terms.term_member_plur_cap} Listed: </th><td>{$numbMembers}</td></tr>
     </table>
+    
+{apply_filters('glm-member-db-members-othernotices', '')}
 
 {if $haveBadLatLon}
     <h3 class="glm-error">&nbsp;<br>{$terms.term_member_cap} Profile with Bad Map Location Information</h3>