From: Anthony Talarico Date: Tue, 19 Sep 2017 20:29:16 +0000 (-0400) Subject: adding image uploading functionality X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=df0148fe3d065686f607bf6933486d7c33af4bc8;p=WP-Plugins%2Fglm-member-db-buy-sell.git adding image uploading functionality setting up the image uploading for admin --- diff --git a/classes/data/dataBuySell.php b/classes/data/dataBuySell.php index ef139f1..9674ba7 100644 --- a/classes/data/dataBuySell.php +++ b/classes/data/dataBuySell.php @@ -204,12 +204,12 @@ class GlmDataBuySell extends GlmDataAbstract ), 'image_1' => array ( 'field' => 'image_1', - 'type' => 'text', + 'type' => 'image', 'use' => 'a' ), 'image_2' => array ( 'field' => 'image_2', - 'type' => 'text', + 'type' => 'image', 'use' => 'a' ), 'company' => array ( @@ -219,7 +219,7 @@ class GlmDataBuySell extends GlmDataAbstract ), 'image_3' => array ( 'field' => 'image_3', - 'type' => 'text', + 'type' => 'image', 'use' => 'a' ), 'member' => array ( diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql index 0772e54..7b500fa 100644 --- a/setup/databaseScripts/create_database_V0.0.1.sql +++ b/setup/databaseScripts/create_database_V0.0.1.sql @@ -41,6 +41,6 @@ INSERT INTO {prefix}items ( id,title,descr,topic,contact_email,contact_name,contact_phone,post_date,visible, terms,location,item_expiration,image_3,post,image_1, company,member,image_2 -) VALUES ( 1, "TITLE", "DESCR", 1, "CONTACT_EMAIL", "CONTACT_NAME", "CONTACT_PHONE", NOW(), true, "TERMS", "LOCATION", 60, "IMAGE_3", "POST", -"IMAGE_1", "COMPANY", 1, "IMAGE_2" +) VALUES ( 1, "TITLE", "DESCR", 1, "CONTACT_EMAIL", "CONTACT_NAME", "CONTACT_PHONE", NOW(), true, "TERMS", "LOCATION", 60, "IMAGE_3.jpg", "POST", +"IMAGE_1.jpg", "COMPANY", 1, "IMAGE_2.jpg" ); \ No newline at end of file diff --git a/views/admin/buySell/edit.html b/views/admin/buySell/edit.html index b9f8713..fe2c67f 100644 --- a/views/admin/buySell/edit.html +++ b/views/admin/buySell/edit.html @@ -37,24 +37,8 @@
Item
-
- -
- - +
@@ -92,31 +76,6 @@ - -
-
- Facility Operation -
- -
- {php} - wp_editor( - - '{$item.fieldData.facility_operation|escape:quotes}', - - - 'facility_operation', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'facility_operation', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
@@ -140,142 +99,13 @@ {/php}
- -
-
- Item Requirements -
-
- {php} - wp_editor( - - '{$item.fieldData.requirements|escape:quotes}', - - 'requirements', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'requirements', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Item Benefits -
-
- {php} - wp_editor( - - '{$item.fieldData.benefits|escape:quotes}', - - - 'benefits', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'benefits', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Salary -
-
- -
-
- -
-
- Position Available -
-
- -
-
- -
-
- Item Duration -
-
- -
-
- -
-
- Deadline -
-
- -
-
- -
-
- Item Location -
-
- {php} - wp_editor( - - '{$item.fieldData.item_location|escape:quotes}', - - 'item_location', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'item_location', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
- -
-
- Send Resume To -
-
- {php} - wp_editor( - - '{$item.fieldData.resume_location|escape:quotes}', - - 'resume_location', array( - 'media_buttons' => false, - 'tinymce' => false, - // 'quicktags' => false, - // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. - 'textarea_name' => 'resume_location', - 'editor_height' => 200, // Height in px, overrides editor_rows - // 'textarea_rows' => 8 - )); - {/php} -
-
Contact Name
- +
@@ -284,7 +114,7 @@ Contact Email
- +
@@ -293,15 +123,18 @@ Contact Phone
- +
+
+ {include file='admin/buySell/parts/image_input.html'} +
Visible
-
+
diff --git a/views/admin/buySell/parts/image_input.html b/views/admin/buySell/parts/image_input.html new file mode 100644 index 0000000..66a718c --- /dev/null +++ b/views/admin/buySell/parts/image_input.html @@ -0,0 +1,63 @@ +
+
+ Image 1: +
+
+
{$item|@print_r}
+ {if $item.fieldData.image_1} + + {/if} + New image: + +
+ {if $item.fieldData.image_1} + + {/if} +
+
+ Delete Image
+
+
+
+
+
+ Image 2: +
+
+ + {if $item.fieldData.image_2} + + {/if} + New image: + +
+ {if $item.fieldData.image_2} + + {/if} +
+
+ Delete Image
+
+
+
+
+
+ Image 3: +
+
+ + {if $item.fieldData.image_3} + + {/if} + New image: + +
+ {if $item.fieldData.image_3} + + {/if} +
+
+ Delete Image
+
+
+
\ No newline at end of file