Ultimate CSV Importer - Version 3.2.2

Version Description

Download this release

Release Info

Developer smackcoders
Plugin Icon 128x128 Ultimate CSV Importer
Version 3.2.2
Comparing to
See all releases

Code changes from version 3.2.1 to 3.2.2

Readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.smackcoders.com/donate.html
4
  Tags: batch, excel, import, spreadsheet, plugin, admin, csv, importer,
5
  Requires at least: 3.4.0
6
  Tested up to: 3.6
7
- Stable tag: 3.2.1
8
- Version: 3.2.1
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
@@ -15,11 +15,11 @@ A plugin that turns your offline data as wordpress post, page or custom post dat
15
 
16
  == Description ==
17
 
18
- Version 3.2.1 is out now with performance improvements and added powerful features.
19
 
20
- WP Ultimate CSV Importer Plugin helps you to import any CSV file as post, page or even as custom post type. Convert your offline database maintained for years into your valuable website content. Also do periodical content changes, maintenance, content update, prices, offers, coupons and inventory etc.
21
 
22
- This simple but ultimate plugin as you can import everything needed to create as any WP post types from admin as simple as CSV file. Just in few clicks to map your CSV data set to match the Wordpress fields to import. That�s all, now your imports are turned as Wordpress site content in matter of seconds. No more pain of creating post content one by one of converting your offline data. You can import all the essential data as Wordpress post and skip unwanted things. Or you can import as many as custom fields without missing even a single data. Provided you should have a theme that supports custom fields. So you can now make use of your offline data, inventory, price catalog, information data, database and any other excel data sheet for online content distribution to your valuable visitor or customers.
23
 
24
  1. Admin can import the data's from any CSV file.
25
  2. Can import as post, page or custom post.
@@ -63,34 +63,98 @@ One click Import of Custom taxonomies with proper description and seo slugs
63
  Import, update and maintain your WP Commerce / eshop inventory, prices, periodical and short term offers, coupons, bonus etc.
64
 
65
 
66
- Support and Feature request.
67
- ----------------------------
68
-
69
- Please create issues only in our tracker http://forge.smackcoders.com/projects/wp-ultimate-csv-importer-free/issues instead of WordPress support forum.
70
- For guides and tutorials, visit http://forge.smackcoders.com/projects/wp-ultimate-csv-importer-free .
71
-
72
 
73
  == Installation ==
 
74
 
 
 
 
 
75
 
76
  Please click here for [Detailed Installation Instructions](http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html)
77
- Or view our hoe to guide video guide in our [Youtube Channel](www.youtube.com/user/smackcoders)
78
 
79
 
80
  == Screenshots ==
81
 
82
  1. Admin settings for WP Ultimate CSV Importer Plugin .
83
  2. Admin settings for Import Data and Header Mapping configuration to import data's from a csv file.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
89
  = 3.2.1 = Performance improvements on SQL and CSV parsing
90
- -- [resolved] require_once(plugin_deactivate.php): failed to open stream
91
- -- [resolved] Links in the cells makes problems with the "quote"
92
- -- [resolved] Loading content from more than one colunm
93
- -- [resolved] Custom Post Plugin Not Found
94
 
95
  = 3.2.0 = WordPress 3.6 compatibility added, Much Improved UI.
96
  -- Featured image issues fixed for WordPress-3.6.
@@ -176,10 +240,11 @@ Or view our hoe to guide video guide in our [Youtube Channel](www.youtube.com/us
176
 
177
  == Upgrade Notice ==
178
 
179
- =v 3.2.0 = WordPress 3.6 compatibility added, Much Improved UI.
180
- -- Featured image issues fixed for WordPress-3.6.
181
- -- Plugin deactivate bug fixed.
182
- -- Custom Post issue fixed.
 
183
 
184
  =v 3.1.0 = Now Much Improved Featured Image and url handling
185
 
@@ -211,25 +276,6 @@ Or view our hoe to guide video guide in our [Youtube Channel](www.youtube.com/us
211
 
212
 
213
 
214
- == Frequently Asked Questions ==
215
- How to Format a CSV file for WP Ultimate CSV Importer Plugin?
216
-
217
- This video helps you to tweak/format your CSV file to make a fast, simple and easy import using WP Ultimate CSV importer plugin without missing all the
218
- features. We have used MS Excel as CSV editor here. You can use other applications also. Take advantage of our importer format by slightly tweaking your csv.
219
-
220
- <p>http://www.youtube.com/watch?v=pnObJdiedus</p>
221
-
222
- For more details visit www.smackcoders.com
223
-
224
- How to creat a well formatted csv? - the other way to learn tweaking
225
-
226
- We have used text editor here to explain how to create a well formatted csv in seconds for importing. You can use this format to take advantage of our importer format by slightly tweaking your csv. This video helps you to tweak/format your CSV file to make a fast, simple and easy import using WP Ultimate CSV importer plugin without missing all the features.
227
-
228
- <p>http://www.youtube.com/watch?v=9W_my0rSybE</p>
229
-
230
- Please click here for [ Detailed Frequently Asked Questions](http://www.smackcoders.com/blog/category/free-wordpress-plugins/wordpress-ultimate-csv-importer-plugin/)
231
-
232
- For quick response and reply please create issues in our [support](http://forge.smackcoders.com/projects/wp-ultimate-csv-importer-free/issues) instead of WordPress support forum.
233
 
234
 
235
 
4
  Tags: batch, excel, import, spreadsheet, plugin, admin, csv, importer,
5
  Requires at least: 3.4.0
6
  Tested up to: 3.6
7
+ Stable tag: 3.2.2
8
+ Version: 3.2.2
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
15
 
16
  == Description ==
17
 
18
+ Version 3.2.2 is out now with bug fix and UI improvements. Please visit http://www.smackcoders.com/category/free-wordpress-plugins.html for guides and tutorials.
19
 
20
+ Make you CSV imports as easy as with simple cicks. Just relate or map your csv header (column name or field name) to wordpress fields. Turn your every CSV import as your wordpress content. WP Ultimate CSV Importer Plugin helps in this way to import any CSV file as post, page or even as custom post type. Also do periodical content changes, maintenance, content update, prices, offers, coupons and inventory etc.
21
 
22
+ This simple but ultimate plugin as you can import everything needed to create as any WP post types from admin as simple as CSV import. Just in few clicks to map your CSV import set to match the Wordpress fields to import. Thats all, now your imports are turned as Wordpress site content in matter of seconds. No more pain of creating post content one by one of converting your offline data. You can import all the essential data as Wordpress post and skip unwanted things. Or you can import as many as custom fields without missing even a single data. Provided you should have a theme that supports custom fields. So you can now make use of your offline data, inventory, price catalog, information data, database and any other excel data sheet for online content distribution to your valuable visitor or customers.
23
 
24
  1. Admin can import the data's from any CSV file.
25
  2. Can import as post, page or custom post.
63
  Import, update and maintain your WP Commerce / eshop inventory, prices, periodical and short term offers, coupons, bonus etc.
64
 
65
 
 
 
 
 
 
 
66
 
67
  == Installation ==
68
+ Wp Ultimate CSV Importer is very easy to install like any other wordpress plugin. No need to edit or modify anything here.
69
 
70
+ 1. Unzip the file 'wp-ultimate-csv-importer.zip'.
71
+ 2. Upload the ' wp-ultimate-csv-importer ' directory to '/wp-content/plugins/' directory using ftp client or upload and install wp-ultimate-csv-importer.zip through plugin install wizard in wp admin panel .
72
+ 3. Activate the plugin through the 'Plugins' menu in WordPress.
73
+ 4. After activating, you will see an option for 'Wp Ultimate CSV Importer' in the admin menu (left navigation) and you will import the csv files to import the data's.
74
 
75
  Please click here for [Detailed Installation Instructions](http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html)
76
+ Or view our how to guide video guide in our [Youtube Channel](www.youtube.com/user/smackcoders)
77
 
78
 
79
  == Screenshots ==
80
 
81
  1. Admin settings for WP Ultimate CSV Importer Plugin .
82
  2. Admin settings for Import Data and Header Mapping configuration to import data's from a csv file.
83
+ 3. Explained -How to CSV Mapping Headers works and how CSV can be related to wordpress fields?
84
+
85
+ == Frequently Asked Questions ==
86
+
87
+ 1. How to install the plugin?
88
+ Like other plugins wp-ultimate-csv-importer is easy to install. Upload the wp-ultimate-csv-importer.zip file through plugin install page through wp admin. Everything will work fine with it.
89
+
90
+ 2. How to use the plugin?
91
+ After plugin activation you can see the ' Wp Ultimate CSV Importer ' menu in admin backend.
92
+ 1)Browse csv file to import the data's.
93
+ 2)You can mapping the headers to import the data's.
94
+ 3)If you checked the import as draft,it will import as draft then you can publish the data's later.
95
+ 4)The data's are imported based on the post type you selected.
96
+ Configuring our plugin is as simple as that.
97
+
98
+ 3. What to do when an import broke in the middle of import?
99
+ Check your CSV format. It should be UTF-8. If you get memory related issue, change or create a custom php.ini with increased value for max_execution_time and memory limt
100
+
101
+ 4. I am cant get my featured image imported?
102
+ Check that allow_url_fopen is allowed in your php ini. If not, request your hosting or you can enable it in custom php ini settings.
103
+
104
+ 5. How to import other languages using ultimate csv importer?
105
+ It should strictly UTF-8 format. Users have reported that utf-8 without BOM works well for languages like Polish characters etc. Follow these simple steps to import other languages. Thanks for the steps mojeprogramy.com.
106
+ 1) Prepare a CSV file with the data (I used Excel)
107
+ 2) Saving files to CSV (Excel function)
108
+ 3) I opened the CSV file in Notepad + +
109
+ 4) CTR + A, CTR + C (copy all the text)
110
+ 5) The "Encoding"> "Encode without BOM"
111
+ 6) CTR + V to paste all text
112
+ 7) Save the file
113
+ 8) Imports for WordPress ;)
114
+
115
+ 6. How to Format a CSV file for WP Ultimate CSV Importer Plugin?
116
+ This video helps you to tweak/format your CSV file to make a fast, simple and easy import using WP Ultimate CSV importer plugin without missing all the
117
+ features. We have used MS Excel as CSV editor here. You can use other applications also. Take advantage of our importer format by slightly tweaking your csv.
118
+ <p>http://www.youtube.com/watch?v=pnObJdiedus</p>
119
+ For more details visit www.smackcoders.com
120
+
121
+ 7. How to creat a well formatted csv? - the other way to learn tweaking
122
+ We have used text editor here to explain how to create a well formatted csv in seconds for importing. You can use this format to take advantage of our importer format by slightly tweaking your csv. This video helps you to tweak/format your CSV file to make a fast, simple and easy import using WP Ultimate CSV importer plugin without missing all the features.
123
+ <p>http://www.youtube.com/watch?v=9W_my0rSybE</p>
124
 
125
+ 8. Where can i get sample files and other references?
126
+ We have a set of sample/template files for different purposes with supported plugin fields. All the sample/templates are auto mapping headers enabled which will almost removes manual mapping. [You can find updated news and links to download here] (http://www.smackcoders.com/category/free-wordpress-plugins.html). You can use these sample/template files to prepare your CSV to make your import just in few clicks
127
+ Post & Page
128
+ Post with All in SEO fields
129
+ Post with SEO by YOAST fields
130
+ Post with Advanced custom fields
131
+ Custom Posts for Custom post type UI plugin
132
+ Custom Posts for CCTM plugin
133
+ Custom Posts for Types plugin
134
+ Nested Category
135
+ Nested Category with category icons
136
+ Tags and Custom Taxonomies
137
+ Users with roles
138
+ Advanced eshop import
139
+ WP ecommerce import
140
+ WP ecommerce import with wp ecommerce custom fields,
141
+ Advanced Woo commerce import
142
+
143
+ Please click here for [ More Details](http://www.smackcoders.com/blog/category/free-wordpress-plugins.html)
144
 
145
 
146
  == Changelog ==
147
 
148
+ = 3.2.2 = WordPress 3.6.1 compatibility added.
149
+ -- Post slug issue fixed and tested for 3.6 and 3.6.1
150
+ -- Help content added
151
+ -- Mapping UI improved with on select dynamic update feature
152
+
153
  = 3.2.1 = Performance improvements on SQL and CSV parsing
154
+ -- Plugin deactivation issue fixed and updated the code.
155
+ -- Links in the cells makes problems with the "quote"
156
+ -- Loading content from more than one colunm
157
+ -- Custom Post type issues fixed
158
 
159
  = 3.2.0 = WordPress 3.6 compatibility added, Much Improved UI.
160
  -- Featured image issues fixed for WordPress-3.6.
240
 
241
  == Upgrade Notice ==
242
 
243
+ =v 3.2.2 = WordPress 3.6.1 compatibile, bug fix and UI improvements
244
+
245
+ =v 3.2.1 = Performance improvements on SQL and CSV parsing
246
+
247
+ =v 3.2.0 = Now compatible with 3.6 and improved featured image
248
 
249
  =v 3.1.0 = Now Much Improved Featured Image and url handling
250
 
276
 
277
 
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
 
281
 
SmackImpCE.php CHANGED
@@ -87,9 +87,6 @@ class SmackImpCE extends SmackWpHandler
87
  // @var int inserted post count
88
  public $insPostCount = 0;
89
 
90
- // @var int updated post count
91
- public $updatedPostCount = 0;
92
-
93
  // @var int no post author count
94
  public $noPostAuthCount = 0;
95
 
@@ -148,22 +145,6 @@ class SmackImpCE extends SmackWpHandler
148
  return false;
149
  }
150
 
151
- function getMatchedId($text, $gettype)
152
- {
153
- global $wpdb;
154
- $type = 'title';
155
-
156
- $post_exist = $wpdb->get_results("select ID from " . $wpdb->posts . " where post_title = \"{$text}\" and post_type = \"{$gettype}\" and post_status in('publish','future','draft','pending','private')");
157
- return $post_exist;
158
- }
159
-
160
- function getCreatedRecords($csvname)
161
- {
162
- global $wpdb;
163
- return $wpdb->get_results("select created_records from smack_dashboard_manager where csv_name = \"{$csvname}\"");
164
- }
165
-
166
-
167
  /**
168
  * Get upload directory
169
  */
@@ -280,13 +261,6 @@ class SmackImpCE extends SmackWpHandler
280
  return $data_rows;
281
  }
282
 
283
- /**function to form data_rows**/
284
- function getDataRows($filename, $delim)
285
- {
286
- $data_rows = $this->csv_file_data($this->getUploadDirectory() . "/" . $filename, $delim);
287
- return $data_rows;
288
- }
289
-
290
  /**
291
  * function to map the csv file and process it
292
  *
@@ -511,29 +485,39 @@ class SmackImpCE extends SmackWpHandler
511
 
512
  }
513
  // Author name/id update
514
- $authorLen = strlen($data_array ['post_author']);
515
- $postuserid = $data_array ['post_author'];
516
- $checkpostuserid = intval($data_array ['post_author']);
517
- $postAuthorLen = strlen($checkpostuserid);
518
- $postauthor = array();
519
-
520
- if ($authorLen == $postAuthorLen) {
521
- $postauthor = $wpdb->get_results("select ID from $wpdb->users where ID = \"{$postuserid}\"");
522
- } else {
523
- $postauthor = $wpdb->get_results("select ID from $wpdb->users where user_login = \"{$postuserid}\"");
524
- }
525
-
526
- if (empty($postauthor) || !$postauthor[0]->ID) {
527
- $data_array ['post_author'] = 1;
528
- $this->noPostAuthCount++;
529
- } else {
530
- $data_array ['post_author'] = $postauthor [0]->ID;
531
- }
532
-
 
 
 
 
 
533
  // Date format post
534
- if (!$data_array ['post_date'])
535
  $data_array ['post_date'] = date('Y-m-d H:i:s');
536
- $data_array ['post_date'] = date('Y-m-d H:i:s', strtotime($data_array ['post_date']));
 
 
 
 
 
537
 
538
  if ($data_array)
539
  $post_id = wp_insert_post($data_array);
87
  // @var int inserted post count
88
  public $insPostCount = 0;
89
 
 
 
 
90
  // @var int no post author count
91
  public $noPostAuthCount = 0;
92
 
145
  return false;
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  /**
149
  * Get upload directory
150
  */
261
  return $data_rows;
262
  }
263
 
 
 
 
 
 
 
 
264
  /**
265
  * function to map the csv file and process it
266
  *
485
 
486
  }
487
  // Author name/id update
488
+ if(isset($data_array ['post_author'])){
489
+ $authorLen = strlen($data_array ['post_author']);
490
+ $postuserid = $data_array ['post_author'];
491
+ $checkpostuserid = intval($data_array ['post_author']);
492
+ $postAuthorLen = strlen($checkpostuserid);
493
+ $postauthor = array();
494
+
495
+ if ($authorLen == $postAuthorLen) {
496
+ $postauthor = $wpdb->get_results("select ID from $wpdb->users where ID = \"{$postuserid}\"");
497
+ } else {
498
+ $postauthor = $wpdb->get_results("select ID from $wpdb->users where user_login = \"{$postuserid}\"");
499
+ }
500
+
501
+ if (empty($postauthor) || !$postauthor[0]->ID) {
502
+ $data_array ['post_author'] = 1;
503
+ $this->noPostAuthCount++;
504
+ } else {
505
+ $data_array ['post_author'] = $postauthor [0]->ID;
506
+ }
507
+ }
508
+ else{
509
+ $data_array ['post_author'] = 1;
510
+ $this->noPostAuthCount++;
511
+ }
512
  // Date format post
513
+ if (!isset($data_array ['post_date'])){
514
  $data_array ['post_date'] = date('Y-m-d H:i:s');
515
+ }else{
516
+ $data_array ['post_date'] = date('Y-m-d H:i:s', strtotime($data_array ['post_date']));
517
+ }
518
+ if(isset($data_array ['post_slug'])){
519
+ $data_array ['post_name'] = $data_array ['post_slug'];
520
+ }
521
 
522
  if ($data_array)
523
  $post_id = wp_insert_post($data_array);
class.rendercsv.php CHANGED
@@ -58,7 +58,7 @@ class RenderCSVCE
58
  */
59
  function renderSettings()
60
  {
61
- $selected_var = array('disable', 'enable', 'yoastseo', 'aioseo', 'nonerseooption', 'cctm', 'custompostuitype', 'wpcommerce', 'eshop', 'users', 'automapping', 'utfsupport', 'categories', 'customtaxonomy', 'comments', 'ecommerce');
62
  foreach ($selected_var as $single_selected_var) {
63
  $$single_selected_var = "";
64
  }
@@ -73,17 +73,23 @@ class RenderCSVCE
73
  $cptutd = $this->getPluginState('custom-post-type-ui/custom-post-type-ui.php');
74
  $eshoptd = $this->getPluginState('eshop/eshop.php');
75
  $wpcomtd = $this->getPluginState('wp-e-commerce/wp-shopping-cart.php');
 
76
  $aioseotd = $this->getPluginState('all-in-one-seo-pack/all_in_one_seo_pack.php');
77
  $yoasttd = $this->getPluginState('wordpress-seo/wp-seo.php');
78
  $cateicontd = $this->getPluginState('category-icons/category_icons.php');
 
 
79
 
80
  $cctmtdi = $this->getPluginStateImg('custom-content-type-manager/index.php');
81
  $cptutdi = $this->getPluginStateImg('custom-post-type-ui/custom-post-type-ui.php');
82
  $eshoptdi = $this->getPluginStateImg('eshop/eshop.php');
83
  $wpcomtdi = $this->getPluginStateImg('wp-e-commerce/wp-shopping-cart.php');
 
84
  $aioseotdi = $this->getPluginStateImg('all-in-one-seo-pack/all_in_one_seo_pack.php');
85
  $yoasttdi = $this->getPluginStateImg('wordpress-seo/wp-seo.php');
86
  $cateicontdi = $this->getPluginStateImg('category-icons/category_icons.php');
 
 
87
 
88
  if (!$ecommerce)
89
  $ecommercedisabled = 'disabled';
@@ -117,11 +123,18 @@ class RenderCSVCE
117
  $setString .= "<tr><td><div id='thirdPartyBox' class = 'switchercontent newboxes2'><table>";
118
  $setString .= "<tr><td><b>Ecommerce</b></td></tr>";
119
  $setString .= "<tr><td><label class=$nonerecommerce><input type = 'radio' name ='recommerce' value='nonerecommerce' onclick='savePluginSettings()' " . $nonerecommerce . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
120
- $setString .= "<td><label class=\"$eshoptd $eshop\"><input type='radio' name='recommerce' value='eshop' onclick='savePluginSettings()' " . $eshop . " " . " class='ecommerce'>Eshop</label></td><td><label class=\"$wpcomtd $wpcommerce\"><input type='radio' name='recommerce' value='wpcommerce' onclick='savePluginSettings()' " . $wpcommerce . " class = 'ecommerce'>WP e-Commerce</label></td></tr>";
 
 
 
 
 
 
121
  $setString .= "<tr><td><b>" . $impCESett->t('CUSTOMPOST') . "</b></td></tr>";
122
  $setString .= "<tr><td><label class=$nonercustompost><input type = 'radio' name ='rcustompost' value='nonercustompost' onclick='savePluginSettings()' " . $nonercustompost . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
123
  $setString .= "<td><label class=\"$cptutd $custompostuitype\"><input type ='radio' name = 'rcustompost' value='custompostuitype' onclick='savePluginSettings()' " . $custompostuitype . ">" . $impCESett->t('CUSTOMPOSTTYPE') . "</label></td>";
124
- $setString .= "<td><label class=\"$cctmtd $cctm\"><input type ='radio' name = 'rcustompost' value='cctm' onclick='savePluginSettings()' " . $cctm . ">" . $impCESett->t('CCTM') . "</label>" . "</td></tr>";
 
125
  $setString .= "<tr><td><b>" . $impCESett->t('SEO_OPTIONS') . "</b></td></tr>";
126
  $setString .= "<tr><td><label class=$nonerseooption><input type = 'radio' name ='rseooption' value='nonerseooption' onclick='savePluginSettings()' " . $nonerseooption . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
127
  $setString .= "<td><label class=\"$aioseotd $aioseo\"><input type ='radio' name = 'rseooption' value='aioseo' onclick='savePluginSettings()' " . $aioseo . ">" . $impCESett->t('ALLINONESEO') . "</label></td>";
58
  */
59
  function renderSettings()
60
  {
61
+ $selected_var = array('disable', 'enable', 'yoastseo', 'aioseo', 'nonerseooption', 'cctm', 'custompostuitype', 'wpcommerce', 'eshop', 'users', 'automapping', 'utfsupport', 'categories', 'customtaxonomy', 'comments', 'ecommerce', 'woocommerce', 'acf');
62
  foreach ($selected_var as $single_selected_var) {
63
  $$single_selected_var = "";
64
  }
73
  $cptutd = $this->getPluginState('custom-post-type-ui/custom-post-type-ui.php');
74
  $eshoptd = $this->getPluginState('eshop/eshop.php');
75
  $wpcomtd = $this->getPluginState('wp-e-commerce/wp-shopping-cart.php');
76
+ $woocomtd = $this->getPluginState('woocommerce/woocommerce.php');
77
  $aioseotd = $this->getPluginState('all-in-one-seo-pack/all_in_one_seo_pack.php');
78
  $yoasttd = $this->getPluginState('wordpress-seo/wp-seo.php');
79
  $cateicontd = $this->getPluginState('category-icons/category_icons.php');
80
+ $wecftd = $this->getPluginState('wp-e-commerce-custom-fields/custom-fields.php');
81
+ $acftd = $this->getPluginState('advanced-custom-fields/acf.php');
82
 
83
  $cctmtdi = $this->getPluginStateImg('custom-content-type-manager/index.php');
84
  $cptutdi = $this->getPluginStateImg('custom-post-type-ui/custom-post-type-ui.php');
85
  $eshoptdi = $this->getPluginStateImg('eshop/eshop.php');
86
  $wpcomtdi = $this->getPluginStateImg('wp-e-commerce/wp-shopping-cart.php');
87
+ $woocomtdi = $this->getPluginStateImg('woocommerce/woocommerce.php');
88
  $aioseotdi = $this->getPluginStateImg('all-in-one-seo-pack/all_in_one_seo_pack.php');
89
  $yoasttdi = $this->getPluginStateImg('wordpress-seo/wp-seo.php');
90
  $cateicontdi = $this->getPluginStateImg('category-icons/category_icons.php');
91
+ $cateicontdi = $this->getPluginStateImg('category-icons/category_icons.php');
92
+ $acftdi = $this->getPluginStateImg('advanced-custom-fields/acf.php');
93
 
94
  if (!$ecommerce)
95
  $ecommercedisabled = 'disabled';
123
  $setString .= "<tr><td><div id='thirdPartyBox' class = 'switchercontent newboxes2'><table>";
124
  $setString .= "<tr><td><b>Ecommerce</b></td></tr>";
125
  $setString .= "<tr><td><label class=$nonerecommerce><input type = 'radio' name ='recommerce' value='nonerecommerce' onclick='savePluginSettings()' " . $nonerecommerce . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
126
+ $setString .= "<td><label class=\"$eshoptd $eshop\"><input type='radio' name='recommerce' value='eshop' onclick='enablewpcustomfield(\"none\")' " . $eshop . " " . " class='ecommerce'>Eshop</label></td><td><label class=\"$wpcomtd $wpcommerce\"><input type='radio' name='recommerce' value='wpcommerce' onclick='enablewpcustomfield(\"wpcustomfields\")' " . $wpcommerce . " class = 'ecommerce'>WP e-Commerce</label></td><td><label class=\"$woocomtd $woocommerce\"><input type='radio' name='recommerce' value='woocommerce' ".$woocommerce." class = 'woocommerce' onclick='enablewpcustomfield(\"none\")'>WooCommerce</label></td></tr>";
127
+ $chkwecfstate = get_option('wpcsvprosettings');
128
+ if($chkwecfstate['recommerce'] == 'wpcommerce'){
129
+ $setString .= "<tr id='wpcustomfieldstr'><td></td><td></td><td><input type='checkbox' name='wpcustomfields' id='wpcustomfields' onclick='savePluginSettings()' checked />WP e-Commerce Custom Fields</td></tr>";
130
+ }else{
131
+ $setString .= "<tr id='wpcustomfieldstr' style='display:none;'><td></td><td></td><td><input type='checkbox' name='wpcustomfields' id='wpcustomfields' onclick='savePluginSettings()' />WP e-Commerce Custom Fields</td></tr>";
132
+ }
133
  $setString .= "<tr><td><b>" . $impCESett->t('CUSTOMPOST') . "</b></td></tr>";
134
  $setString .= "<tr><td><label class=$nonercustompost><input type = 'radio' name ='rcustompost' value='nonercustompost' onclick='savePluginSettings()' " . $nonercustompost . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
135
  $setString .= "<td><label class=\"$cptutd $custompostuitype\"><input type ='radio' name = 'rcustompost' value='custompostuitype' onclick='savePluginSettings()' " . $custompostuitype . ">" . $impCESett->t('CUSTOMPOSTTYPE') . "</label></td>";
136
+ $setString .= "<td><label class=\"$cctmtd $cctm\"><input type ='radio' name = 'rcustompost' value='cctm' onclick='savePluginSettings()' " . $cctm . ">" . $impCESett->t('CCTM') . "</label></td>";
137
+ $setString .= "<td><label class=\"$acftd $acf\"><input type ='checkbox' name = 'rcustomfield' value='acf' ".$acf.">".$impCESett->t('ACF')."</label>"."</td></tr>";
138
  $setString .= "<tr><td><b>" . $impCESett->t('SEO_OPTIONS') . "</b></td></tr>";
139
  $setString .= "<tr><td><label class=$nonerseooption><input type = 'radio' name ='rseooption' value='nonerseooption' onclick='savePluginSettings()' " . $nonerseooption . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
140
  $setString .= "<td><label class=\"$aioseotd $aioseo\"><input type ='radio' name = 'rseooption' value='aioseo' onclick='savePluginSettings()' " . $aioseo . ">" . $impCESett->t('ALLINONESEO') . "</label></td>";
class.settings.php CHANGED
@@ -44,29 +44,6 @@ class IMPSettings
44
  $this->activePlugins = get_option('active_plugins');
45
  }
46
 
47
- public function chkCustomPostPlugin()
48
- {
49
- $customPostType = $this->chkCustomTypePost();
50
- $cctm = $this->chkCCTM();
51
- if (($cctm) || ($customPostType))
52
- return true;
53
- else
54
- return false;
55
- }
56
-
57
- public function chkCCTM()
58
- {
59
- if (in_array('custom-content-type-manager/index.php', $this->activePlugins))
60
- return true;
61
- else
62
- return false;
63
- }
64
-
65
- public function chkCustomTypePost()
66
- {
67
- return true;
68
- }
69
-
70
  public function isPluginPresent($plugin)
71
  {
72
  $plugins = get_plugins();
44
  $this->activePlugins = get_option('active_plugins');
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  public function isPluginPresent($plugin)
48
  {
49
  $plugins = get_plugins();
css/custom-style.css CHANGED
@@ -470,3 +470,36 @@ div.helpatright h4 {
470
  font-weight: bold;
471
  text-align: center;
472
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
  font-weight: bold;
471
  text-align: center;
472
  }
473
+
474
+ /* Tooltip */
475
+
476
+ a.tooltip {outline:none; }
477
+ a.tooltip strong {line-height:20px;}
478
+ a.tooltip:hover {text-decoration:none;}
479
+ a.tooltip span {
480
+ z-index:10;display:none; padding:3px 12px;
481
+ }
482
+ a.tooltip:hover span{
483
+ display:inline; position:absolute; color:#111;
484
+ border:1px solid #DCA; background:#fffAF0;}
485
+ .callout {z-index:20;position:absolute;top:8px;border:0;left:-12px;}
486
+
487
+ /*CSS3 extras*/
488
+ a.tooltip span
489
+ {
490
+ border-radius:4px;
491
+ -moz-border-radius: 4px;
492
+ -webkit-border-radius: 4px;
493
+
494
+ -moz-box-shadow: 5px 5px 8px #CCC;
495
+ -webkit-box-shadow: 5px 5px 8px #CCC;
496
+ box-shadow: 5px 5px 8px #CCC;
497
+ }
498
+
499
+ .tooltipOne {margin-top:-12px;margin-left:10px;width:225px; line-height:30px;}
500
+ .tooltipTwo {margin-top:-37px;margin-left:160px;width:245px; line-height:20px;}
501
+ .tooltipThree {margin-top:-12px;margin-left:10px;width:160px; line-height:30px;}
502
+ .tooltipFour {margin-top:-35px;margin-left:360px;width:240px; line-height:30px;}
503
+ .tooltipFive {margin-top:-35px;margin-left:160px;width:245px; line-height:20px;}
504
+
505
+
images/HeadersExplained.jpeg CHANGED
File without changes
images/Importicon_24.png CHANGED
File without changes
images/SubscribeViaEmail.gif CHANGED
File without changes
images/arrow_down.gif CHANGED
File without changes
images/arrow_up.gif CHANGED
File without changes
images/bg.gif CHANGED
File without changes
images/callout.gif ADDED
Binary file
images/csv_delete.png CHANGED
File without changes
images/csv_download.png CHANGED
File without changes
images/csv_download_all.png CHANGED
File without changes
images/csv_records_delete.png CHANGED
File without changes
images/custompostuitype.png CHANGED
File without changes
images/delete_records.png CHANGED
File without changes
images/eshop.png CHANGED
File without changes
images/facebook.png CHANGED
File without changes
images/googleplus.png CHANGED
File without changes
images/help.png ADDED
Binary file
images/icon.png CHANGED
File without changes
images/importerpro.png CHANGED
File without changes
images/linkedin.png CHANGED
File without changes
images/notactive.png CHANGED
File without changes
images/notok.png CHANGED
File without changes
images/ok.png CHANGED
File without changes
images/paypal_donate_button.png CHANGED
File without changes
images/sprite.png CHANGED
File without changes
images/trash_records.png CHANGED
File without changes
images/twitter.png CHANGED
File without changes
languages/en_us.php CHANGED
@@ -62,6 +62,7 @@ $slang = Array(
62
  'SETTINGS' => 'Settings',
63
  'CUSTOMPOSTTYPE' => 'Custom Post Type UI',
64
  'CCTM' => 'CCTM',
 
65
  'PLUGINSUPPORT' => 'Plugin Support',
66
  'NONE' => 'None',
67
  'ESHOP' => 'EShop',
62
  'SETTINGS' => 'Settings',
63
  'CUSTOMPOSTTYPE' => 'Custom Post Type UI',
64
  'CCTM' => 'CCTM',
65
+ 'ACF' => 'ACF',
66
  'PLUGINSUPPORT' => 'Plugin Support',
67
  'NONE' => 'None',
68
  'ESHOP' => 'EShop',
screenshot-2.png CHANGED
Binary file
screenshot-3.png ADDED
Binary file
wp_ultimate_csv_importer.js CHANGED
@@ -76,39 +76,34 @@ function importAllPostStatus(selectedId, headerCount) {
76
  }
77
  }
78
 
79
- function loadSelectedPost(selectedCateg, contenturl) {
80
- jQuery.ajax({
81
- url: contenturl + '/plugins/wp-ultimate-csv-importer/commentspost.php?categid=' + selectedCateg,
82
- type: 'post',
83
- data: selectedCateg,
84
- success: function (response) {
85
- jQuery("#showPosts").html(response);
86
- }
87
- });
88
- }
89
- function showRadioSett(id) {
90
- var inputs = document.getElementsByClassName(id);
91
- if (document.getElementById(id).checked) {
92
- for (var i = 0; i < inputs.length; i++) {
93
- inputs[i].disabled = false;
94
- }
95
- }
96
- else {
97
- for (var i = 0; i < inputs.length; i++) {
98
- inputs[i].disabled = true;
99
- }
100
- }
101
- }
102
  // Function for add customfield
103
 
104
- function addcustomfield(myval, selected_id) {
105
  var a = document.getElementById('h1').value;
106
  var importer = document.getElementById('selectedImporter').value;
107
  var aa = document.getElementById('h2').value;
108
- var selected_value;
109
  if (importer == 'custompost' || importer == 'post' || importer == 'page') {
 
 
 
 
 
 
 
 
 
110
  for (var i = 0; i < aa; i++) {
111
  var b = document.getElementById('mapping' + i).value;
 
 
 
 
 
 
 
 
 
 
112
  if (b == 'add_custom' + i) {
113
  document.getElementById('textbox' + i).style.display = "";
114
  document.getElementById('customspan' + i).style.display = "";
@@ -118,8 +113,13 @@ function addcustomfield(myval, selected_id) {
118
  document.getElementById('customspan' + i).style.display = "none";
119
  }
120
  }
 
 
 
 
 
121
  }
122
- var header_count = document.getElementById('h2').value;
123
  for (var j = 0; j < header_count; j++) {
124
  var selected_value = document.getElementById('mapping' + j);
125
  var value1 = selected_value.options[selected_value.selectedIndex].value;
@@ -129,24 +129,16 @@ function addcustomfield(myval, selected_id) {
129
  selected_dropdown.selectedIndex = '-- Select --';
130
  showMapMessages('error', myval + ' is already selected!');
131
  }
 
 
132
  }
133
- }
134
  }
135
 
136
  // Function for check file exist
137
 
138
  function file_exist() {
139
  var requestaction = document.getElementById('requestaction').value;
140
- if (requestaction == 'post' || requestaction == 'custompost' || requestaction == 'page') {
141
- if (document.getElementById('filenameupdate').checked) {
142
- if ((!document.getElementById('updatewithpostid').checked) && (!document.getElementById('updatewithposttitle').checked)) {
143
- showMessages('error', 'Select Update Based On.');
144
- return false;
145
- }
146
-
147
- }
148
- }
149
-
150
  if (document.getElementById('csv_import').value == '') {
151
  showMessages('error', "Please attach your CSV.");
152
  return false;
@@ -225,42 +217,6 @@ function import_csv() {
225
  }
226
 
227
  // Select the Mapper for Post/Page
228
- function selectType(id, adminurl) {
229
- var headercount = document.getElementById('h2').value;
230
- var getdropdownvalue = document.getElementById(id);
231
- var selectedvalue = getdropdownvalue.options[getdropdownvalue.selectedIndex].text;
232
- for (var i = 0; i < headercount; i++) {
233
- var x = document.getElementById("mapping" + i);
234
- var myOpts = x.options;
235
- var postCatePresent = false;
236
- var postTagPresent = false;
237
- if (selectedvalue == 'post') {
238
- for (var j = 0; j < myOpts.length; j++) {
239
- if (myOpts[j].value == 'post_category')
240
- postCatePresent = true;
241
- if (myOpts[j].value == 'post_tag')
242
- postTagPresent = true;
243
- }
244
- if (!postCatePresent) {
245
- var option = document.createElement("option");
246
- option.value = "post_category";
247
- option.text = "post_category";
248
- x.add(option);
249
- }
250
- if (!postTagPresent) {
251
- var option1 = document.createElement("option");
252
- option1.value = 'post_tag';
253
- option1.text = 'post_tag';
254
- x.add(option1);
255
- }
256
- }
257
- else {
258
- jQuery("#mapping" + i + " option[value='post_category']").remove();
259
- jQuery("#mapping" + i + " option[value='post_tag']").remove();
260
- }
261
- }
262
- }
263
-
264
  function slideonlyone(thechosenone, content_url) {
265
  jQuery('.newboxes2').each(function (index) {
266
  if (jQuery(this).attr("id") == thechosenone) {
@@ -291,3 +247,30 @@ function hideSuccessMessage() {
291
  document.getElementById('upgradetopro').style.display = "none";
292
  }
293
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
  }
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  // Function for add customfield
80
 
81
+ function addcustomfield(myval, selected_id) {
82
  var a = document.getElementById('h1').value;
83
  var importer = document.getElementById('selectedImporter').value;
84
  var aa = document.getElementById('h2').value;
 
85
  if (importer == 'custompost' || importer == 'post' || importer == 'page') {
86
+ var selected_dropdown = document.getElementById('mapping' + selected_id);
87
+ var selected_value = selected_dropdown.value;
88
+ var prevoptionindex = document.getElementById('prevoptionindex').value;
89
+ var prevoptionvalue = document.getElementById('prevoptionvalue').value;
90
+ var mappedID = 'mapping' + selected_id;
91
+ var add_prev_option = false;
92
+ if(mappedID == prevoptionindex){
93
+ add_prev_option = true;
94
+ }
95
  for (var i = 0; i < aa; i++) {
96
  var b = document.getElementById('mapping' + i).value;
97
+ var id = 'mapping' + i;
98
+ if(add_prev_option){
99
+ if(i != selected_id){
100
+ jQuery('#'+id).append( new Option(prevoptionvalue,prevoptionvalue) );
101
+ }
102
+ }
103
+ if(i != selected_id){
104
+ var x=document.getElementById('mapping' + i);
105
+ jQuery('#'+id+' option[value="'+selected_value+'"]').remove();
106
+ }
107
  if (b == 'add_custom' + i) {
108
  document.getElementById('textbox' + i).style.display = "";
109
  document.getElementById('customspan' + i).style.display = "";
113
  document.getElementById('customspan' + i).style.display = "none";
114
  }
115
  }
116
+ document.getElementById('prevoptionindex').value = 'mapping' + selected_id;
117
+ var customField = selected_value.indexOf("add_custom");
118
+ if(selected_value != '-- Select --' && customField != 0){
119
+ document.getElementById('prevoptionvalue').value = selected_value;
120
+ }
121
  }
122
+ /* var header_count = document.getElementById('h2').value;
123
  for (var j = 0; j < header_count; j++) {
124
  var selected_value = document.getElementById('mapping' + j);
125
  var value1 = selected_value.options[selected_value.selectedIndex].value;
129
  selected_dropdown.selectedIndex = '-- Select --';
130
  showMapMessages('error', myval + ' is already selected!');
131
  }
132
+ //var x=document.getElementById('mapping' + j);
133
+ //x.remove(x.selectedIndex);
134
  }
135
+ }*/
136
  }
137
 
138
  // Function for check file exist
139
 
140
  function file_exist() {
141
  var requestaction = document.getElementById('requestaction').value;
 
 
 
 
 
 
 
 
 
 
142
  if (document.getElementById('csv_import').value == '') {
143
  showMessages('error', "Please attach your CSV.");
144
  return false;
217
  }
218
 
219
  // Select the Mapper for Post/Page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  function slideonlyone(thechosenone, content_url) {
221
  jQuery('.newboxes2').each(function (index) {
222
  if (jQuery(this).attr("id") == thechosenone) {
247
  document.getElementById('upgradetopro').style.display = "none";
248
  }
249
 
250
+ function clearmapping(){
251
+ var total_mfields = document.getElementById('h2').value;
252
+ var mfields_arr = document.getElementById('mapping_fields_array').value;
253
+ var n=mfields_arr.split(",");
254
+ var options = '<option id="select">-- Select --</option>';
255
+ for(var i=0;i<n.length;i++){
256
+ options +="<option value='"+n[i]+"'>"+n[i]+"</option>";
257
+ }
258
+ for(var j=0;j<total_mfields;j++){
259
+ document.getElementById('mapping'+j).innerHTML = options;
260
+ document.getElementById('mapping'+j).innerHTML += "<option value='add_custom"+j+"'>Add Custom Field</option>";
261
+ document.getElementById('textbox'+j).style.display = 'none';
262
+ document.getElementById('customspan'+j).style.display = 'none';
263
+ }
264
+ }
265
+
266
+ // Enable/Disable WP-e-Commerce Custom Fields
267
+ function enablewpcustomfield(val){
268
+ if(val == 'wpcustomfields'){
269
+ document.getElementById('wpcustomfieldstr').style.display = '';
270
+ }
271
+ else{
272
+ document.getElementById('wpcustomfields').checked = false;
273
+ document.getElementById('wpcustomfieldstr').style.display = 'none';
274
+ }
275
+ savePluginSettings();
276
+ }
wp_ultimate_csv_importer.php CHANGED
@@ -3,7 +3,7 @@
3
  *Plugin Name: WP Ultimate CSV Importer
4
  *Plugin URI: http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html
5
  *Description: A plugin that helps to import the data's from a CSV file.
6
- *Version: 3.2.1
7
  *Author: smackcoders.com
8
  *Author URI: http://www.smackcoders.com
9
  *
@@ -96,357 +96,391 @@ register_deactivation_hook(__FILE__, 'wp_ultimate_csv_importer_deactivate');
96
  */
97
  function upload_csv_file()
98
  {
99
- global $impCE, $impRen, $pluginActive, $custo_taxo;
100
- global $custom_array;
101
- global $wpdb;
102
-
103
- if (!isset($_REQUEST['action']) || !$_REQUEST['action']) {
104
- ?>
105
- <script>
106
- window.location.href = "<?php echo WP_PLUGIN_URL;?>/../../wp-admin/admin.php?page=upload_csv_file&action=post";
107
- </script>
108
- <?php
109
- }
110
- $importdir = $impCE->getUploadDirectory();
111
- if (!$_REQUEST['action'] || (isset($_POST['post_csv']) && $_POST['post_csv']))
112
- echo "<input type = 'hidden' value ='dashboard' id='requestaction'>";
113
- else
114
- echo "<input type='hidden' value='" . $_REQUEST['action'] . "' id ='requestaction'>";
115
- echo '<input type="hidden" value="' . WP_CONTENT_URL . '" id="contenturl">';
116
- /*
117
- * Get POST data
118
- */
119
- if (isset ($_POST ['delim']) && in_array($_POST ['delim'], $impCE->delim_avail))
120
- $impCE->delim = $_POST ['delim'];
121
- if (isset ($_POST ['titleduplicatecheck']) && trim($_POST ['titleduplicatecheck'] != ""))
122
- $impCE->titleDupCheck = true;
123
-
124
- if (isset ($_POST ['contentduplicatecheck']) && trim($_POST ['contentduplicatecheck'] != ""))
125
- $impCE->conDupCheck = true;
126
-
127
- $custom_array = array();
128
- if (isset ($_POST ['Import'])) {
129
- ?>
130
- <input type="hidden" name="versionedname" id="versionedname" value=""/>
131
- <input type="hidden" name="fileversion" id="fileversion" value=""/>
132
- <?php
133
- $data_rows = $impCE->csv_file_data($_FILES ['csv_import'] ['tmp_name'], $impCE->delim);
134
- require_once ("SmackImpCE.php");
135
- $impObj = new SmackImpCE();
136
- $impObj->move_file();
137
- ?>
138
- <div class="smack-wrap" id="smack-content">
139
- <?php
140
- echo $impRen->renderMenu();
141
- if (count($impCE->headers) >= 1 && count($data_rows) >= 1) {
142
- ?>
143
-
144
- <form class="add:the-list: validate" name="secondform" method="post" onsubmit="return import_csv();"
145
- class="secondform">
146
- <div style="float: left; min-width: 45%">
147
- <div style="float: left; margin-top: 11px; margin-right: 5px;"><img
148
- src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/Importicon_24.png">
149
- </div>
150
- <div style="float:left;">
151
- <h3>Import Data Configuration</h3>
152
- </div>
153
- </br>
154
- <?php $cnt = count($impCE->defCols) + 2;
155
- $cnt1 = count($impCE->headers); ?>
156
- <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>"/>
157
- <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>"/>
158
- <input type="hidden" name="renamestatus" value="<?php echo $_POST['filenameupdate']; ?>"/>
159
- <input type="hidden" name="updatewithpostid" value="<?php echo $_POST['updatewithpostid']; ?>"/>
160
- <input type="hidden" name="updatewithposttitle"
161
- value="<?php echo $_POST['updatewithposttitle']; ?>"/>
162
- <input type="hidden" name="filerenamevalue" value="<?php echo $_POST['renameFile']; ?>"/>
163
-
164
- <?php
165
- // second form starts here
166
- if (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'custompost') || ($_REQUEST['action'] == 'page')) {
167
-
168
- //set custom fields value
169
- $taxo = get_taxonomies();
170
- foreach ($taxo as $taxokey => $taxovalue) {
171
- if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format' && $taxokey != 'product_tag' && $taxokey != 'wpsc_product_category' && $taxokey != 'wpsc-variation') {
172
- $custo_taxo .= $taxokey . ',';
173
- }
174
- }
175
- $custo_taxo = substr($custo_taxo, 0, -1);
176
-
177
- ?>
178
- <input type='hidden' name='cust_taxo' id='cust_taxo' value='<?php echo $custo_taxo; ?>'/>
179
- <div id="posttypecss" style="margin-top: 30px;">
180
- <table>
181
- <tr>
182
- <td>
183
- <input name="_csv_importer_import_as_draft" type="hidden" value="publish"/>
184
- <?php if($_REQUEST['action'] == 'custompost'){ ?>
185
- <label> Select Post Type<span class="mandatory"> *</span> </label></td>
186
- <td>
187
- <select name='csv_importer_cat' id='csv_importer_cat'>
188
- <option>-- Select --</option>
189
- <?php
190
- foreach (get_post_types() as $key => $value) {
191
- if (($value != 'featured_image') && ($value != 'attachment') && ($value != 'wpsc-product') && ($value != 'wpsc-product-file') && ($value != 'revision') && ($value != 'nav_menu_item') && ($value != 'post') && ($value != 'page')) {
192
- ?>
193
- <option id="<?php echo($value); ?>"> <?php echo($value);?> </option>
194
- <?php
195
- }
196
- }
197
- ?>
198
- </select>
199
- <?php } else if ($_REQUEST['action'] == 'post' || $_REQUEST['action'] == 'page') { ?>
200
- <input name='csv_importer_cat' type='hidden' id='csv_importer_cat'
201
- value=<?php echo $_REQUEST['action']; ?>>
202
- <?php } ?>
203
- </td>
204
- </tr>
205
- <tr>
206
- <td>
207
- <?php $cnt1 = count($impCE->headers);?>
208
-
209
- <label>Import with post status<span class="mandatory"> *</span></label></td>
210
- <td><select
211
- name='importallwithps' id='importallwithps'
212
- onchange='importAllPostStatus(this.value, "<?php echo $cnt1 ?>")'>
213
- <option value='0'>Status as in CSV</option>
214
- <option value='1'>Publish</option>
215
- <option value='2'>Sticky</option>
216
- <option value='4'>Private</option>
217
- <option value='3'>Protected</option>
218
- <option value='5'>Draft</option>
219
- <option value='6'>Pending</option>
220
- </select></td>
221
- </tr>
222
- <tr>
223
- <td>
224
- <label id='passwordlabel' style="display:none;">Password</label></td>
225
- <td>
226
- <input type='text' id='postsPassword' name='postsPassword' value='admin'
227
- style="display:none;">
228
- <span style="display: none; color: red; margin-left: 5px;" id='passwordhint'
229
- style="display:none;">Replace the default value</span>
230
- </td>
231
- </tr>
232
- </table>
233
- </div>
234
- <h3>Map Fields</h3>
235
- <div id='display_area'>
236
- <?php $cnt = count($impCE->defCols) + 2; ?>
237
- <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>"/>
238
- <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>"/>
239
- <?php if (isset($_POST['titleduplicatecheck'])) { ?>
240
- <input type="hidden" id="titleduplicatecheck"
241
- name="titleduplicatecheck"
242
- value="<?php echo $_POST['titleduplicatecheck'] ?>"/>
243
- <?php } ?>
244
- <?php if (isset($_POST['contentduplicatecheck'])) { ?>
245
- <input type="hidden" id="contentduplicatecheck" name="contentduplicatecheck"
246
- value="<?php echo $_POST['contentduplicatecheck'] ?>"/>
247
- <?php } ?><input
248
- type="hidden" id="delim" name="delim"
249
- value="<?php echo $_POST['delim']; ?>"/> <input type="hidden"
250
- id="header_array" name="header_array"
251
- value="<?php print_r($impCE->headers); ?>"/>
252
- <table style="font-size: 12px;">
253
- <?php
254
- $count = 0;
255
- if ($_REQUEST['action'] == 'page') {
256
- unset($impCE->defCols['post_category']);
257
- unset($impCE->defCols['post_tag']);
258
- }
259
- foreach ($impCE->headers as $key => $value) {
260
- ?>
261
- <tr>
262
- <td><label><?php print($value);?></label></td>
263
- <td><select name="mapping<?php print($count); ?>"
264
- id="mapping<?php print($count); ?>" class='uiButton'
265
- onchange="addcustomfield(this.value,<?php echo $count; ?>);">
266
- <option id="select">-- Select --</option>
267
- <?php
268
- foreach ($impCE->defCols as $key1 => $value1) {
269
- if ($key1 == 'post_name')
270
- $key1 = 'post_slug';
271
- $strip_CF = strpos($key1, 'CF: '); //Auto mapping
272
- if ($strip_CF === 0) {
273
- $custom_key = substr($key1, 4);
274
- }
275
- ?>
276
- <option value="<?php print($key1); ?>">
277
- <?php
278
- if ($key1 != 'post_name')
279
- print ($key1);
280
- else
281
- print 'post_slug';
282
- ?>
283
- </option>
284
- <?php
285
-
286
- }
287
- foreach (get_taxonomies() as $taxokey => $taxovalue) {
288
- if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
289
- ?>
290
- <option
291
- value="<?php print($taxokey); ?>"><?php print($taxovalue);?></option>
292
- <?php
293
-
294
- }
295
- }
296
- ?>
297
- <option value="add_custom<?php print($count); ?>">Add Custom Field
298
- </option>
299
-
300
- </select> <!-- added to solve issue id 1072-->
301
- <input class="customfieldtext" type="text"
302
- id="textbox<?php print($count); ?>"
303
- name="textbox<?php print($count); ?>" style="display: none;"
304
- value="<?php echo $value ?>"/> <span
305
- style="display: none; color: red; margin-left: 5px;"
306
- id="customspan<?php echo $count ?>">Replace the default value</span>
307
- </td>
308
- </tr>
309
- <?php
310
- $count++;
311
- }
312
- ?>
313
- </table>
314
- </div>
315
- <br/>
316
- <?php
317
- } elseif ($_REQUEST['action'] == 'dashboard') {
318
- echo $impRen->renderDashboard();
319
- } elseif ($_REQUEST['action'] == 'help') {
320
-
321
- }
322
-
323
-
324
- //second form exits ?>
325
- <input type='hidden' name='filename' id='filename'
326
- value="<?php echo($_FILES['csv_import']['name']); ?>"/>
327
- <?php
328
- $explodeCsv = explode('.csv', $_FILES['csv_import']['name']);
329
- $exactFIlename = $explodeCsv[0] . '-' . $_REQUEST['action'] . '.csv';
330
- ?>
331
- <input type='hidden' name='realfilename' id='realfilename'
332
- value="<?php echo($_FILES['csv_import']['name']); ?>"/>
333
- <input type="hidden" name="version" id="version" value=""/>
334
- <input type='hidden' name='selectedImporter' id='selectedImporter'
335
- value="<?php echo $_REQUEST['action']; ?>"/>
336
- <input type='hidden' name='delim' id='delim' value="<?php echo($_POST['delim']) ?>"/>
337
- <button type='submit' class="action" name='post_csv' id='post_csv' value='Import'>Import</button>
338
-
339
- </form>
340
- </div>
341
- <div style="min-width: 45%;float:right;margin-right:9px;">
342
- <div style="width:100%;">
343
- <div style="float:left;"><h3>CSV Mapping Headers Explained</h3></div>
344
- <div style="float:right;margin-top:15px;margin-right:25px;"><a
345
- href="http://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html"
346
- target="_blank">Download Sample Files Here</a></div>
347
- </div>
348
- <a href="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/HeadersExplained.jpeg"
349
- target="_blank" title="Headers Explained"><img
350
- src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/HeadersExplained.jpeg"
351
- width=600 style='border:1px solid;padding:2px;'/></a>
352
- </div>
353
- <?php
354
- } else {
355
- ?>
356
- <div style="font-size: 16px; margin-left: 20px;"><?php echo $impCE->t("CHOOSE_ANOTHER_DELIMITER"); ?>
357
- </div>
358
- <br/>
359
- <div style="margin-left: 20px;">
360
- <form class="add:the-list: validate" method="post" action="">
361
- <input type="submit" class="button-primary" name="Import Again"
362
- value="Import Again"/>
363
- </form>
364
- </div>
365
- <div style="margin-left: 20px; margin-top: 30px;">
366
- <b><?php echo $impCE->t("NOTE"); ?> :-</b>
367
-
368
- <p>1. <?php echo $impCE->t("NOTE_CONTENT_1"); ?></p>
369
-
370
- <p>2. <?php echo $impCE->t("NOTE_CONTENT_2"); ?></p>
371
- </div>
372
- <?php
373
- }
374
- } else if ((isset ($_POST ['post_csv'])) && (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'page') || ($_REQUEST['action'] == 'custompost'))) {
375
- //third form starts here
376
- $impCE->processDataInWP();
377
- echo $impRen->renderMenu();
378
- if (($impCE->insPostCount != 0) || ($impCE->dupPostCount != 0) || ($impCE->updatedPostCount != 0)) {
379
- ?>
380
- <div>
381
-
382
- <?php
383
- echo $impRen->setDashboardAction();
384
- $messageString = $impCE->insPostCount . " records are successfully Imported.";
385
- if ((isset($_POST['titleduplicatecheck']) && $_POST['titleduplicatecheck'] == 1) || (isset($_POST['contentduplicatecheck']) && $_POST['contentduplicatecheck'] == 1))
386
- $messageString .= $impCE->dupPostCount . " duplicate records found.";
387
- if (($impCE->noPostAuthCount != 0) && (in_array('post_author', $_POST)))
388
- $messageString .= '<br>' . $impCE->noPostAuthCount . " posts with no valid UserID/Name are assigned admin as author.";
389
- if ($impCE->updatedPostCount != 0)
390
- $messageString .= '<br>' . $impCE->updatedPostCount . ' posts has been updated.';
391
- echo $impRen->showMessage('success', $messageString); ?>
392
- </div>
393
- <?php
394
- } else if (($impCE->insPostCount == 0) && ($impCE->dupPostCount == 0) && ($impCE->updatedPostCount == 0)) {
395
- ?>
396
- <div>
397
- <?php echo $impRen->showMessage('error', "Check your CSV file and format."); ?>
398
- </div>
399
- <?php } ?>
400
- <?php
401
- $_REQUEST['action'] = 'dashboard';
402
- echo $impRen->renderDashboard();
403
- } else {
404
- ?>
405
- <!-- first form gets displayed from here -->
406
- <?php
407
- if (!$_REQUEST['action']) {
408
- $_REQUEST['action'] = 'post';
409
- } elseif ($_REQUEST['action'] == 'dashboard') {
410
- echo $impRen->renderMenu();
411
- echo $impRen->renderDashboard();
412
- } elseif ($_REQUEST['action'] == 'settings') {
413
- echo $impRen->renderMenu();
414
- if ($pluginActive != null)
415
- echo $impRen->showMessage('error', $pluginActive);
416
- echo $impRen->renderSettings();
417
- } elseif ($_REQUEST['action'] == 'custompost') {
418
- ?>
419
- <div class="wrap" id="smack-content">
420
- <?php
421
- echo $impRen->renderMenu();
422
- $sett = new IMPSettings();
423
- if ($sett->chkCustomPostPlugin()) {
424
- ?>
425
- <div class="smack-postform">
426
- <?php echo $impRen->renderPostPage(); ?>
427
- </div>
428
- <div class="module-desc">
429
- <?php print($impRen->renderDesc()); ?>
430
- </div>
431
- </div>
432
- <?php
433
- } else
434
- echo $impRen->showMessage('error', 'Custom Post Plugin Not Found.');
435
- } else {
436
- ?>
437
- <div class="wrap" id="smack-content">
438
- <?php echo $impRen->renderMenu(); ?>
439
- <div class="smack-postform">
440
- <?php echo $impRen->renderPostPage(); ?>
441
- </div>
442
- <div class="module-desc">
443
- <?php print($impRen->renderDesc()); ?>
444
- </div>
445
- </div>
446
- <!-- end wrap -->
447
- <?php
448
- }
449
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  }
451
 
452
  ?>
3
  *Plugin Name: WP Ultimate CSV Importer
4
  *Plugin URI: http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html
5
  *Description: A plugin that helps to import the data's from a CSV file.
6
+ *Version: 3.2.2
7
  *Author: smackcoders.com
8
  *Author URI: http://www.smackcoders.com
9
  *
96
  */
97
  function upload_csv_file()
98
  {
99
+ global $impCE, $impRen, $pluginActive, $custo_taxo;
100
+ global $custom_array;
101
+ global $wpdb;
102
+ $mFieldsArr = '';
103
+ if (!isset($_REQUEST['action']) || !$_REQUEST['action']) {
104
+ ?>
105
+ <script>
106
+ window.location.href = "<?php echo WP_PLUGIN_URL;?>/../../wp-admin/admin.php?page=upload_csv_file&action=post";
107
+ </script>
108
+ <?php
109
+ }
110
+ $importdir = $impCE->getUploadDirectory();
111
+ if (!$_REQUEST['action'] || (isset($_POST['post_csv']) && $_POST['post_csv']))
112
+ echo "<input type = 'hidden' value ='dashboard' id='requestaction'>";
113
+ else
114
+ echo "<input type='hidden' value='" . $_REQUEST['action'] . "' id ='requestaction'>";
115
+ echo '<input type="hidden" value="' . WP_CONTENT_URL . '" id="contenturl">';
116
+ /*
117
+ * Get POST data
118
+ */
119
+ if (isset ($_POST ['delim']) && in_array($_POST ['delim'], $impCE->delim_avail))
120
+ $impCE->delim = $_POST ['delim'];
121
+ if (isset ($_POST ['titleduplicatecheck']) && trim($_POST ['titleduplicatecheck'] != ""))
122
+ $impCE->titleDupCheck = true;
123
+
124
+ if (isset ($_POST ['contentduplicatecheck']) && trim($_POST ['contentduplicatecheck'] != ""))
125
+ $impCE->conDupCheck = true;
126
+
127
+ $custom_array = array();
128
+ if (isset ($_POST ['Import'])) {
129
+ ?>
130
+ <input type="hidden" name="versionedname" id="versionedname" value=""/>
131
+ <input type="hidden" name="fileversion" id="fileversion" value=""/>
132
+ <?php
133
+ $data_rows = $impCE->csv_file_data($_FILES ['csv_import'] ['tmp_name'], $impCE->delim);
134
+ require_once ("SmackImpCE.php");
135
+ $impObj = new SmackImpCE();
136
+ $impObj->move_file();
137
+ ?>
138
+ <div class="smack-wrap" id="smack-content">
139
+ <?php
140
+ echo $impRen->renderMenu();
141
+ if (count($impCE->headers) >= 1 && count($data_rows) >= 1) {
142
+ ?>
143
+ <form class="add:the-list: validate" name="secondform" id="secondform" method="post" onsubmit="return import_csv();"
144
+ class="secondform">
145
+ <div style="float: left; min-width: 45%">
146
+ <div style="float: left; margin-top: 11px; margin-right: 5px;"><img
147
+ src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/Importicon_24.png">
148
+ </div>
149
+ <div style="float:left;">
150
+ <h3>Import Data Configuration</h3>
151
+ </div>
152
+ </br>
153
+ <?php $cnt = count($impCE->defCols) + 2;
154
+ $cnt1 = count($impCE->headers); ?>
155
+ <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>"/>
156
+ <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>"/>
157
+ <input type="hidden" id="prevoptionindex" name="prevoptionindex" value=""/>
158
+ <input type="hidden" id="prevoptionvalue" name="prevoptionvalue" value=""/>
159
+ <?php
160
+ // second form starts here
161
+ if (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'custompost') || ($_REQUEST['action'] == 'page')) {
162
+
163
+ //set custom fields value
164
+ $taxo = get_taxonomies();
165
+ foreach ($taxo as $taxokey => $taxovalue) {
166
+ if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format' && $taxokey != 'product_tag' && $taxokey != 'wpsc_product_category' && $taxokey != 'wpsc-variation') {
167
+ $custo_taxo .= $taxokey . ',';
168
+ }
169
+ }
170
+ $custo_taxo = substr($custo_taxo, 0, -1);
171
+
172
+ ?>
173
+ <input type='hidden' name='cust_taxo' id='cust_taxo' value='<?php echo $custo_taxo; ?>'/>
174
+ <div id="posttypecss" style="margin-top: 30px;">
175
+ <table>
176
+ <tr>
177
+ <td>
178
+ <input name="_csv_importer_import_as_draft" type="hidden" value="publish"/>
179
+ <?php if($_REQUEST['action'] == 'custompost'){ ?>
180
+ <label> Select Post Type<span class="mandatory"> *</span> </label></td>
181
+ <td>
182
+ <select name='csv_importer_cat' id='csv_importer_cat'>
183
+ <option>-- Select --</option>
184
+ <?php
185
+ foreach (get_post_types() as $key => $value) {
186
+ if (($value != 'featured_image') && ($value != 'attachment') && ($value != 'wpsc-product') && ($value != 'wpsc-product-file') && ($value != 'revision') && ($value != 'nav_menu_item') && ($value != 'post') && ($value != 'page') && ($value != 'wp-types-group') && ($value != 'wp-types-user-group')) {
187
+ ?>
188
+ <option id="<?php echo($value); ?>"> <?php echo($value);?> </option>
189
+ <?php
190
+ }
191
+ }
192
+ ?>
193
+ </select>
194
+ <a href="#" class="tooltip">
195
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" />
196
+ <span class="tooltipOne">
197
+ <img class="callout" src="../wp-content/plugins/wp-ultimate-csv-importer/images/callout.gif" />
198
+ <strong>Select a custom post type to import</strong>
199
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" style="margin-top: 6px;float:right;" />
200
+ </span>
201
+ </a>
202
+
203
+ <?php } else if ($_REQUEST['action'] == 'post' || $_REQUEST['action'] == 'page') { ?>
204
+ <input name='csv_importer_cat' type='hidden' id='csv_importer_cat'
205
+ value=<?php echo $_REQUEST['action']; ?>>
206
+ <?php } ?>
207
+ </td>
208
+ </tr>
209
+ <tr>
210
+ <td>
211
+ <?php $cnt1 = count($impCE->headers);?>
212
+
213
+ <label>Import with post status<span class="mandatory"> *</span></label></td>
214
+ <td><select
215
+ name='importallwithps' id='importallwithps'
216
+ onchange='importAllPostStatus(this.value, "<?php echo $cnt1 ?>")'>
217
+ <option value='0'>Status as in CSV</option>
218
+ <option value='1'>Publish</option>
219
+ <option value='2'>Sticky</option>
220
+ <option value='4'>Private</option>
221
+ <option value='3'>Protected</option>
222
+ <option value='5'>Draft</option>
223
+ <option value='6'>Pending</option>
224
+ </select>
225
+ <a href="#" class="tooltip">
226
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" /> <?php if($_REQUEST['action'] == 'custompost'){?>
227
+ <span class="tooltipTwo">
228
+ <?php } else { ?>
229
+ <span class="tooltipFive">
230
+ <?php } ?>
231
+ <img class="callout" src="../wp-content/plugins/wp-ultimate-csv-importer/images/callout.gif" />
232
+ <strong>Select a status for the post imported, if not defined within your csv. E.g. Publish</strong>
233
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" style="margin-top: 6px;float:right;" />
234
+ </span>
235
+ </a>
236
+ </td>
237
+ </tr>
238
+ <tr>
239
+ <td>
240
+ <label id='passwordlabel' style="display:none;">Password</label></td>
241
+ <td>
242
+ <input type='text' id='postsPassword' name='postsPassword' value='admin'
243
+ style="display:none;">
244
+ <span style="display: none; color: red; margin-left: 5px;" id='passwordhint'
245
+ style="display:none;">Replace the default value</span>
246
+ </td>
247
+ </tr>
248
+ </table>
249
+ </div>
250
+ <div style="width:50%;float:left;"><h3>Map Fields</h3></div><div style="width:50%;float:right;"><input type="button" name="remap" id="remap" value="Clear Mapping" onclick="clearmapping();" />
251
+ <a href="#" class="tooltip">
252
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" />
253
+ <span class="tooltipThree">
254
+ <img class="callout" src="../wp-content/plugins/wp-ultimate-csv-importer/images/callout.gif" />
255
+ <strong>Refresh to re-map fields</strong>
256
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" style="margin-top: 6px;float:right;" />
257
+ </span>
258
+ </a></div></br></br></br>
259
+ <div id='display_area'>
260
+ <?php $cnt = count($impCE->defCols) + 2; ?>
261
+ <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>"/>
262
+ <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>"/>
263
+ <?php if (isset($_POST['titleduplicatecheck'])) { ?>
264
+ <input type="hidden" id="titleduplicatecheck"
265
+ name="titleduplicatecheck"
266
+ value="<?php echo $_POST['titleduplicatecheck'] ?>"/>
267
+ <?php } ?>
268
+ <?php if (isset($_POST['contentduplicatecheck'])) { ?>
269
+ <input type="hidden" id="contentduplicatecheck" name="contentduplicatecheck"
270
+ value="<?php echo $_POST['contentduplicatecheck'] ?>"/>
271
+ <?php }?>
272
+ <input type="hidden" id="delim" name="delim" value="<?php echo $_POST['delim']; ?>"/> <input type="hidden" id="header_array" name="header_array" value="<?php print_r($impCE->headers); ?>"/>
273
+ <table style="font-size: 12px;">
274
+ <?php
275
+ $count = 0;
276
+ if ($_REQUEST['action'] == 'page') {
277
+ unset($impCE->defCols['post_category']);
278
+ unset($impCE->defCols['post_tag']);
279
+ }
280
+ foreach ($impCE->headers as $key => $value) {
281
+ ?>
282
+ <tr>
283
+ <td><label><?php print($value);?></label></td>
284
+ <td><select name="mapping<?php print($count); ?>"
285
+ id="mapping<?php print($count); ?>" class='uiButton'
286
+ onchange="addcustomfield(this.value,<?php echo $count; ?>);">
287
+ <option id="select">-- Select --</option>
288
+ <?php
289
+ foreach ($impCE->defCols as $key1 => $value1) {
290
+ if ($key1 == 'post_name')
291
+ $key1 = 'post_slug';
292
+ $strip_CF = strpos($key1, 'CF: '); //Auto mapping
293
+ if ($strip_CF === 0) {
294
+ $custom_key = substr($key1, 4);
295
+ }
296
+ ?>
297
+ <option value="<?php print($key1); ?>">
298
+ <?php
299
+ if ($key1 != 'post_name'){
300
+ print ($key1);
301
+ $mappingFields_arr[$key1] = $key1;
302
+ }else{
303
+ print 'post_slug';
304
+ $mappingFields_arr['post_slug'] = 'post_slug';
305
+ }
306
+ ?>
307
+ </option>
308
+ <?php
309
+
310
+ }
311
+ foreach (get_taxonomies() as $taxokey => $taxovalue) {
312
+ if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
313
+ ?>
314
+ <option
315
+ value="<?php print($taxokey); ?>"><?php print($taxovalue);?></option>
316
+ <?php
317
+ $mappingFields_arr[$taxovalue] = $taxovalue;
318
+
319
+ }
320
+ }
321
+ ?>
322
+ <option value="add_custom<?php print($count); ?>">Add Custom Field
323
+ </option>
324
+
325
+ </select> <!-- added to solve issue id 1072-->
326
+ <input class="customfieldtext" type="text"
327
+ id="textbox<?php print($count); ?>"
328
+ name="textbox<?php print($count); ?>" TITLE="Replace the default value" style="display: none;" value="<?php echo $value ?>"/>
329
+ <span style="display: none;" id="customspan<?php echo $count ?>">
330
+ <a href="#" class="tooltip">
331
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" />
332
+ <span class="tooltipFour">
333
+ <img class="callout" src="../wp-content/plugins/wp-ultimate-csv-importer/images/callout.gif" />
334
+ <strong>Give a name for your new custom field</strong>
335
+ <img src="../wp-content/plugins/wp-ultimate-csv-importer/images/help.png" style="margin-top: 6px;float:right;" />
336
+ </span>
337
+ </a>
338
+ </span>
339
+ <!--<span style="display: none; color: red; margin-left: 5px;"
340
+ id="customspan<?php //echo $count ?>">Replace the default value</span>-->
341
+ </td>
342
+ </tr>
343
+ <?php
344
+ $count++;
345
+ }
346
+ foreach($mappingFields_arr as $mkey => $mval){
347
+ $mFieldsArr .= $mkey.',';
348
+ }
349
+ $mFieldsArr = substr($mFieldsArr, 0, -1);
350
+ ?>
351
+ </table>
352
+ <input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php print_r($mFieldsArr); ?>"/>
353
+ </div>
354
+ <br/>
355
+ <?php
356
+ } elseif ($_REQUEST['action'] == 'dashboard') {
357
+ echo $impRen->renderDashboard();
358
+ } elseif ($_REQUEST['action'] == 'help') {
359
+
360
+ }
361
+
362
+
363
+ //second form exits ?>
364
+ <input type='hidden' name='filename' id='filename'
365
+ value="<?php echo($_FILES['csv_import']['name']); ?>"/>
366
+ <?php
367
+ $explodeCsv = explode('.csv', $_FILES['csv_import']['name']);
368
+ $exactFIlename = $explodeCsv[0] . '-' . $_REQUEST['action'] . '.csv';
369
+ ?>
370
+ <input type='hidden' name='realfilename' id='realfilename'
371
+ value="<?php echo($_FILES['csv_import']['name']); ?>"/>
372
+ <input type="hidden" name="version" id="version" value=""/>
373
+ <input type='hidden' name='selectedImporter' id='selectedImporter'
374
+ value="<?php echo $_REQUEST['action']; ?>"/>
375
+ <input type='hidden' name='delim' id='delim' value="<?php echo($_POST['delim']) ?>"/>
376
+ <button type='submit' class="action" name='post_csv' id='post_csv' value='Import'>Import</button>
377
+
378
+ </form>
379
+ </div>
380
+ <div style="min-width: 45%;float:right;margin-right:9px;">
381
+ <div style="width:100%;">
382
+ <div style="float:left;"><h3>CSV Mapping Headers Explained</h3></div>
383
+ <div style="float:right;margin-top:15px;margin-right:25px;"><a
384
+ href="http://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html"
385
+ target="_blank">Download Sample Files Here</a></div>
386
+ </div>
387
+ <a href="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/HeadersExplained.jpeg"
388
+ target="_blank" title="Headers Explained"><img
389
+ src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/HeadersExplained.jpeg"
390
+ width=600 style='border:1px solid;padding:2px;'/></a>
391
+ </div>
392
+ <?php
393
+ } else {
394
+ ?>
395
+ <div style="font-size: 16px; margin-left: 20px;"><?php echo $impCE->t("CHOOSE_ANOTHER_DELIMITER"); ?>
396
+ </div>
397
+ <br/>
398
+ <div style="margin-left: 20px;">
399
+ <form class="add:the-list: validate" method="post" action="">
400
+ <input type="submit" class="button-primary" name="Import Again"
401
+ value="Import Again"/>
402
+ </form>
403
+ </div>
404
+ <div style="margin-left: 20px; margin-top: 30px;">
405
+ <b><?php echo $impCE->t("NOTE"); ?> :-</b>
406
+
407
+ <p>1. <?php echo $impCE->t("NOTE_CONTENT_1"); ?></p>
408
+
409
+ <p>2. <?php echo $impCE->t("NOTE_CONTENT_2"); ?></p>
410
+ </div>
411
+ <?php
412
+ }
413
+ } else if ((isset ($_POST ['post_csv'])) && (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'page') || ($_REQUEST['action'] == 'custompost'))) {
414
+ //third form starts here
415
+ $impCE->processDataInWP();
416
+ echo $impRen->renderMenu();
417
+ if (($impCE->insPostCount != 0) || ($impCE->dupPostCount != 0)) {
418
+ ?>
419
+ <div>
420
+
421
+ <?php
422
+ echo $impRen->setDashboardAction();
423
+ $messageString = $impCE->insPostCount . " records are successfully Imported.";
424
+ if ((isset($_POST['titleduplicatecheck']) && $_POST['titleduplicatecheck'] == 1) || (isset($_POST['contentduplicatecheck']) && $_POST['contentduplicatecheck'] == 1))
425
+ $messageString .= $impCE->dupPostCount . " duplicate records found.";
426
+ if (($impCE->noPostAuthCount != 0) && (in_array('post_author', $_POST)))
427
+ $messageString .= '<br>' . $impCE->noPostAuthCount . " posts with no valid UserID/Name are assigned admin as author.";
428
+ echo $impRen->showMessage('success', $messageString); ?>
429
+ </div>
430
+ <?php
431
+ } else if (($impCE->insPostCount == 0) && ($impCE->dupPostCount == 0)) {
432
+ ?>
433
+ <div>
434
+ <?php echo $impRen->showMessage('error', "Check your CSV file and format."); ?>
435
+ </div>
436
+ <?php } ?>
437
+ <?php
438
+ $_REQUEST['action'] = 'dashboard';
439
+ echo $impRen->renderDashboard();
440
+ } else {
441
+ ?>
442
+ <!-- first form gets displayed from here -->
443
+ <?php
444
+ if (!$_REQUEST['action']) {
445
+ $_REQUEST['action'] = 'post';
446
+ } elseif ($_REQUEST['action'] == 'dashboard') {
447
+ echo $impRen->renderMenu();
448
+ echo $impRen->renderDashboard();
449
+ } elseif ($_REQUEST['action'] == 'settings') {
450
+ echo $impRen->renderMenu();
451
+ if ($pluginActive != null)
452
+ echo $impRen->showMessage('error', $pluginActive);
453
+ echo $impRen->renderSettings();
454
+ } elseif ($_REQUEST['action'] == 'custompost') {
455
+ ?>
456
+ <div class="wrap" id="smack-content">
457
+ <?php
458
+ echo $impRen->renderMenu();
459
+ $sett = new IMPSettings();
460
+ ?>
461
+ <div class="smack-postform">
462
+ <?php echo $impRen->renderPostPage(); ?>
463
+ </div>
464
+ <div class="module-desc">
465
+ <?php print($impRen->renderDesc()); ?>
466
+ </div>
467
+ </div>
468
+ <?php
469
+ } else {
470
+ ?>
471
+ <div class="wrap" id="smack-content">
472
+ <?php echo $impRen->renderMenu(); ?>
473
+ <div class="smack-postform">
474
+ <?php echo $impRen->renderPostPage(); ?>
475
+ </div>
476
+ <div class="module-desc">
477
+ <?php print($impRen->renderDesc()); ?>
478
+ </div>
479
+ </div>
480
+ <!-- end wrap -->
481
+ <?php
482
+ }
483
+ }
484
  }
485
 
486
  ?>