From: Chuck Scott Date: Tue, 10 Feb 2015 16:59:49 +0000 (-0500) Subject: Fixed Activation error due to undefined variable - Some image debugging currently... X-Git-Tag: v1.0.0~69 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=cfaadd222ecfcf453ea37f1599bbd1704e9a6232;p=WP-Plugins%2Fglm-member-db.git Fixed Activation error due to undefined variable - Some image debugging currently included. --- diff --git a/index.php b/index.php index b370ec6b..a4a7e3aa 100644 --- a/index.php +++ b/index.php @@ -196,7 +196,7 @@ add_option('glmMembersDatabaseDbVersion', false); // Activate function glmMembersPluginActivate () { - global $wpdb; + global $wpdb, $config; require_once (GLM_MEMBERS_PLUGIN_PATH . '/activate.php'); new glmMembersPluginActivate($wpdb, $config); } @@ -205,7 +205,7 @@ register_activation_hook(__FILE__, 'glmMembersPluginActivate'); // Deactivate function glmMembersPluginDeactivate () { - global $wpdb; + global $wpdb, $config; require_once (GLM_MEMBERS_PLUGIN_PATH . '/deactivate.php'); $x = new glmMembersPluginDeactivate($wpdb, $config); return false; diff --git a/lib/GlmDataAbstract/DataAbstract.php b/lib/GlmDataAbstract/DataAbstract.php index 4c39a929..39ec4b92 100755 --- a/lib/GlmDataAbstract/DataAbstract.php +++ b/lib/GlmDataAbstract/DataAbstract.php @@ -2015,13 +2015,16 @@ abstract class GlmDataAbstract } function imageInput($as, $f, $id, $idfield, $op) { +echo "DDDDD"; + + $haveNewImage = false; // If this is setup for a new entry, there is no default image capability if ($op == 'n') { $in = ''; return $in; } - +echo "222"; $current_img = false; // Setup Image server access @@ -2048,24 +2051,37 @@ abstract class GlmDataAbstract } } - // Is there a new image being uploaded - $new = false; - - if (isset($_FILES[$as.'_new']) && is_array($_FILES[$as.'_new']) && $_FILES[$as.'_new']['tmp_name'] != '') { - $new = true; - } - // If there a request to delete an existing image or a new image and there's a current image if (isset($_REQUEST[$as."_delete"]) && ($_REQUEST[$as."_delete"] == 'on' || $new) && $current_img != false) { // $imServer->imageDelete($current_img); $current_img = ''; } +echo "3333"; + // Is there a new image being uploaded + if (isset($_FILES[$as.'_new']) && is_array($_FILES[$as.'_new']) && $_FILES[$as.'_new']['tmp_name'] != '') { + + $tmpImg = $_FILES[$as.'_new']['tmp_name']; + +$imgSize = filesize ( $tmpImg ); +echo "Getting $tmpImg - Size = $imgSize
"; + $newImage = wp_get_image_editor($tmpImg); + + // If we have a good image + if ( ! is_wp_error( $newImage ) ) { - // If there's a new image, try to store that one - if ($new) { + // Get image temp file name + $size = $newImage->get_size(); +echo "Size = $size
"; + $type = $newImage->get_mime_type(); +echo "Type = $type
"; + } else { -// $current_img = $imServer->imageUpload($as.'_new'); + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { + glmMembersAdmin::addNotice($newImage, 'DataBlock', "DataAbstract - imageInput() wp_get_image_editor($tmpFile) Error"); + } +echo "Bad image file or some such thing
"; + } } diff --git a/views/admin/member/memberInfo.html b/views/admin/member/memberInfo.html index 9cf0c861..cab2bbda 100644 --- a/views/admin/member/memberInfo.html +++ b/views/admin/member/memberInfo.html @@ -242,7 +242,10 @@ Logo: - + {if $memberInfo.fieldData.logo} + Delete Image
+ {/if} + {if $memberInfo.fieldFail.logo}

{$memberInfo.fieldFail.logo}

{/if} @@ -262,16 +265,6 @@ {if $memberInfo.fieldFail.notes}

{$memberInfo.fieldFail.notes}

{/if} - - Logo: - - {if $memberInfo.fieldData.logo} - Delete Image
- {/if} - - {if $memberInfo.fieldFail.logo}

{$memberInfo.fieldFail.logo}

{/if} - -