Ultimate CSV Importer - Version 3.6.5

Version Description

Download this release

Release Info

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

Code changes from version 3.6.4 to 3.6.5

Readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.smackcoders.com/donate.html
4
  Tags: batch, csv, excel, import, spreadsheet, autoblog, Autoblogger, csvimporter, data, dataimport, importer, wpcsvimporter, wpimporter, acf, auto blog, csv import, csv to post, data import, Easy CSV Importer, eci, import plugin, admin, user, users, Advanced CSV Import, Advanced CSV Importer, affiliate, amazon, author, automatic, blog, buddypress, bulk, bulk edit, bulk editor, categories, comments, content, csv file, csv format, csv importer, custom post, e-commerce, free, images, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, video, eshop, woocommerce, wordpress, xml, youtube, export
5
  Requires at least: 3.8
6
  Tested up to: 4.0
7
- Stable tag: 3.6.4
8
- Version: 3.6.4
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
@@ -15,7 +15,7 @@ Advanced CSV Importer plugin to import/export posts, pages, eshop products, cust
15
 
16
  == Description ==
17
 
18
- ** Now version 3.6.4 available with much advanced log and advanced filtered export features. Visit [www.wpultimatecsvimporter.com](http://www.wpultimatecsvimporter.com) for more news and future plans.
19
 
20
  WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
21
 
@@ -24,6 +24,8 @@ WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer
24
  <p>http://www.youtube.com/watch?v=OwKdt_NlT2U&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC</p>
25
 
26
  = Highlights =
 
 
27
  * Auto delimiter
28
  * Auto UTF-8 handling
29
  * All-in-SEO import support.
@@ -175,6 +177,8 @@ This will solve your issue or get support from hosting if you dint have sufficie
175
  == Changelog ==
176
 
177
  = 3.6.5 =
 
 
178
 
179
  = 3.6.4 =
180
  * Added: Advanced export features with filter options.
@@ -356,6 +360,8 @@ This will solve your issue or get support from hosting if you dint have sufficie
356
 
357
 
358
  == Upgrade Notice ==
 
 
359
 
360
  = 3.6.4 =
361
  * Upgrade Now for filtered export and improved log features.
4
  Tags: batch, csv, excel, import, spreadsheet, autoblog, Autoblogger, csvimporter, data, dataimport, importer, wpcsvimporter, wpimporter, acf, auto blog, csv import, csv to post, data import, Easy CSV Importer, eci, import plugin, admin, user, users, Advanced CSV Import, Advanced CSV Importer, affiliate, amazon, author, automatic, blog, buddypress, bulk, bulk edit, bulk editor, categories, comments, content, csv file, csv format, csv importer, custom post, e-commerce, free, images, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, video, eshop, woocommerce, wordpress, xml, youtube, export
5
  Requires at least: 3.8
6
  Tested up to: 4.0
7
+ Stable tag: 3.6.5
8
+ Version: 3.6.5
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
 
15
 
16
  == Description ==
17
 
18
+ ** Now version 3.6.5 available with much advanced media handling of in line images in any posts features. Visit [www.wpultimatecsvimporter.com](http://www.wpultimatecsvimporter.com) for more news and future plans.
19
 
20
  WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
21
 
24
  <p>http://www.youtube.com/watch?v=OwKdt_NlT2U&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC</p>
25
 
26
  = Highlights =
27
+ * Import external/internal images in line to any posts
28
+ * Upload images related to each csv
29
  * Auto delimiter
30
  * Auto UTF-8 handling
31
  * All-in-SEO import support.
177
  == Changelog ==
178
 
179
  = 3.6.5 =
180
+ * Added in line image support with advance media handling
181
+ * PDO check added
182
 
183
  = 3.6.4 =
184
  * Added: Advanced export features with filter options.
360
 
361
 
362
  == Upgrade Notice ==
363
+ = 3.6.5 =
364
+ * Upgrade Now for advanced media handling for post in line images
365
 
366
  = 3.6.4 =
367
  * Upgrade Now for filtered export and improved log features.
css/main.css CHANGED
@@ -114,7 +114,7 @@ padding-top: 8px;
114
  }
115
 
116
  .importfile{
117
- height : 300px;
118
  }
119
 
120
  .uploadlabel{
114
  }
115
 
116
  .importfile{
117
+ /* height : 300px; */
118
  }
119
 
120
  .uploadlabel{
css/style.css CHANGED
@@ -300,6 +300,25 @@ vertical-align: top;
300
  border-top: 1px solid #ffffff !important;
301
  }
302
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  /*.mappingheader .table-condensed label {
304
  margin-top:13px;
305
  }
300
  border-top: 1px solid #ffffff !important;
301
  }
302
 
303
+ .advancemediahandling {
304
+ padding-right:15px;
305
+ float:left;
306
+ }
307
+
308
+ .media_handling {
309
+ height: 50px;
310
+ padding-top: 15px;
311
+ padding-left: 15px;
312
+ }
313
+
314
+ .inside input[type=radio] {
315
+ margin-top: -2px;
316
+ }
317
+
318
+ .inside label {
319
+ padding-right: 20px;
320
+ }
321
+
322
  /*.mappingheader .table-condensed label {
323
  margin-top:13px;
324
  }
includes/WPImporter_includes_helper.php CHANGED
@@ -77,6 +77,9 @@ class WPImporter_includes_helper {
77
  // @var array wp field keys
78
  public $keys = array();
79
 
 
 
 
80
  // @var array for default columns
81
  public $defCols = array(
82
  'post_title' => null,
@@ -91,8 +94,8 @@ class WPImporter_includes_helper {
91
  'post_parent' => 0,
92
  'post_status' => 0,
93
  'menu_order' => 0,
94
- 'post_format' => 0,
95
- 'wp_page_template' => null,
96
  );
97
 
98
  // @var array CSV headers
@@ -164,7 +167,7 @@ class WPImporter_includes_helper {
164
 
165
  public static function output_fd_page()
166
  {
167
- $get_pluginData = get_plugin_data(plugin_dir_path(__FILE__) . '../index.php');
168
  $plugin_version = get_option('ULTIMATE_CSV_IMPORTER_UPGRADE_FREE_VERSION');
169
  if(!$plugin_version) {
170
  $plugin_version = get_option('ULTIMATE_CSV_IMP_FREE_VERSION');
@@ -172,16 +175,16 @@ class WPImporter_includes_helper {
172
  if ($get_pluginData['Version'] == '3.6' && $plugin_version == '') {
173
  if (file_exists(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/upgrade/migrationfreev3.6.php')) {
174
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/upgrade/migrationfreev3.6.php');
175
- die();
176
  }
177
  }
178
  else if (!isset($_REQUEST['__module']))
179
  {
180
- if (!isset($_REQUEST['__module'])) {
181
- wp_redirect(get_admin_url() . 'admin.php?page=' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/index.php&__module=dashboard');
182
 
 
183
  }
184
- }
185
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'config/settings.php');
186
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'lib/skinnymvc/controller/SkinnyController.php');
187
 
@@ -266,13 +269,13 @@ class WPImporter_includes_helper {
266
  }
267
  $wpcsvfreesettings = get_option('wpcsvfreesettings');
268
  if($wpcsvfreesettings)
269
- if(in_array('aioseo',$wpcsvfreesettings)){
270
- if(in_array('all-in-one-seo-pack/all_in_one_seo_pack.php', $active_plugins)){
271
- $seo_custoFields =array('SEO: keywords','SEO: description','SEO: title','SEO: noindex','SEO: nofollow','SEO: titleatr','SEO: menulabel','SEO: disable','SEO: disable_analytics','SEO: noodp','SEO: noydir');
272
- foreach($seo_custoFields as $val)
273
- $this->defCols[$val]=$val;
274
- }
275
- }
276
  }
277
 
278
  /**
@@ -284,7 +287,7 @@ class WPImporter_includes_helper {
284
  function csv_file_data($file)
285
  {
286
  $file = $this->getUploadDirectory().'/'.$file;
287
- require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'includes/Importer.php');
288
  $csv = new ImporterLib();
289
  $csv->delim($file);
290
  foreach($csv->data as $hkey => $hval) {
@@ -335,17 +338,17 @@ class WPImporter_includes_helper {
335
  }
336
 
337
  /**
338
- * function to fetch the featured image from remote URL
339
- * @param $f_img
340
- * @param $fimg_path
341
- * @param $fimg_name
342
- * @param $post_slug_value
343
- * @param $currentLimit
344
- * @param string $logObj
345
  */
346
  public static function get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit = null, $logObj = ""){
347
  if($fimg_path!="" && $fimg_path){
348
- $fimg_path = $fimg_path . "/" . $post_slug_value . "-" . $fimg_name;
349
  }
350
  $ch = curl_init ($f_img);
351
  curl_setopt($ch, CURLOPT_HEADER, 0);
@@ -363,14 +366,14 @@ class WPImporter_includes_helper {
363
  $logObj->detailedLog[$currentLimit]['image'] = "<b>Image -</b> host not resolved";
364
  }
365
  } else {
366
- if (file_exists($fimg_path)) {
367
- unlink($fimg_path);
368
- }
369
- $fp = fopen($fimg_path, 'x');
370
- fwrite($fp, $rawdata);
371
- fclose($fp);
372
- $logObj->detailedLog[$currentLimit]['image'] = "<b>Image -</b>" . $fimg_name;
373
- }
374
  curl_close($ch);
375
  }
376
 
@@ -379,8 +382,7 @@ class WPImporter_includes_helper {
379
  *
380
  * @return boolean
381
  */
382
- function processDataInWP($data_rows,$ret_array,$session_arr,$currentLimit)
383
- {
384
  global $wpdb;
385
  $post_id = '';
386
  $new_post = array();
@@ -400,9 +402,9 @@ class WPImporter_includes_helper {
400
  $custom_array[$custom_key] = $data_rows[$i];
401
  }
402
  elseif($strip_SEO === 0){
403
- $seo_key = substr($ret_array['mapping'.$i], 5);
404
- $seo_custom_array[$seo_key] = $data_rows[$i];
405
- }
406
  else {
407
  $new_post[$ret_array['mapping' . $i]] = $data_rows[$i];
408
  }
@@ -437,8 +439,8 @@ class WPImporter_includes_helper {
437
  $smack_taxo [$ckey] = null;
438
  $taxo_check = 1;
439
  }
440
- if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo [$ckey] && $ckey != 'wp_page_template') {
441
- if ($taxo_check == 1) {
442
  unset($smack_taxo[$ckey]);
443
  $taxo_check = 0;
444
  }
@@ -459,10 +461,10 @@ class WPImporter_includes_helper {
459
  case 'post_category' :
460
  $categories [$ckey] = $new_post [$ckey];
461
  break;
462
- case 'wp_page_template' :
463
- $custom_array['_wp_page_template'] = $new_post [$ckey];
464
- break;
465
- case 'featured_image' :
466
  require_once(ABSPATH . "wp-includes/pluggable.php");
467
  require_once(ABSPATH . 'wp-admin/includes/image.php');
468
  $dir = wp_upload_dir();
@@ -483,7 +485,7 @@ class WPImporter_includes_helper {
483
  $fimg_name = preg_replace("/[^a-zA-Z0-9._\s]/", "", $fimg_name);
484
  $fimg_name = preg_replace('/\s/', '-', $fimg_name);
485
  $fimg_name = urlencode($fimg_name);
486
-
487
  $parseURL = parse_url($f_img);
488
  $path_parts = pathinfo($f_img);
489
  if(!isset($path_parts['extension']))
@@ -494,8 +496,8 @@ class WPImporter_includes_helper {
494
 
495
  $post_slug_value = strtolower($f_img_slug);
496
  $this->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this);
497
- $filepath = $fimg_path."/" . $post_slug_value . "-" . $fimg_name;
498
-
499
  if(@getimagesize($filepath)){
500
  $img = wp_get_image_editor($filepath);
501
  if (!is_wp_error($img)) {
@@ -602,37 +604,37 @@ class WPImporter_includes_helper {
602
  $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>" . $data_array['post_status'];
603
  }
604
  }
605
- // Post Format Options
606
-
607
- if(isset($data_array ['post_format'])) {
608
- $post_format = 0;
609
- switch ($data_array ['post_format']) {
610
- case 1 :
611
- $post_format = 'post-format-aside';
612
- break;
613
- case 2 :
614
- $post_format = 'post-format-image';
615
- break;
616
- case 3 :
617
- $post_format = 'post-format-video';
618
- break;
619
- case 4 :
620
- $post_format = 'post-format-audio';
621
- break;
622
- case 5 :
623
- $post_format = 'post-format-quote';
624
- break;
625
- case 6 :
626
- $post_format = 'post-format-link';
627
- break;
628
- case 7 :
629
- $post_format = 'post-format-gallery';
630
- break;
631
- default :
632
- $post_format = 0;
633
-
634
- }
635
- }
636
 
637
 
638
  // Author name/id update
@@ -655,7 +657,7 @@ class WPImporter_includes_helper {
655
  if (empty($postauthor) || !$postauthor[0]->ID) {
656
  $data_array ['post_author'] = 1;
657
  $admindet = $wpdb->get_results("select ID,user_login from $wpdb->users where ID = 1");
658
- $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - not found (assigned to </b>" . $admindet[0]->user_login . ")";
659
  $this->noPostAuthCount++;
660
  } else {
661
  $data_array ['post_author'] = $postauthor [0]->ID;
@@ -665,7 +667,7 @@ class WPImporter_includes_helper {
665
  else{
666
  $data_array ['post_author'] = 1;
667
  $admindet = $wpdb->get_results("select ID,user_login from $wpdb->users where ID = 1");
668
- $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - not found (assigned to </b>" . $admindet[0]->user_login . ")";
669
  $this->noPostAuthCount++;
670
  }
671
 
@@ -690,8 +692,13 @@ class WPImporter_includes_helper {
690
  }
691
  }
692
  if ($data_array) {
693
- $post_id = wp_insert_post($data_array);
694
- $this->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success";
 
 
 
 
 
695
  }
696
  unset($postauthor);
697
  if ($post_id) {
@@ -729,20 +736,20 @@ class WPImporter_includes_helper {
729
 
730
  if (!empty ($custom_array)) {
731
  foreach ($custom_array as $custom_key => $custom_value) {
732
- update_post_meta($post_id, $custom_key, $custom_value);
733
  }
734
  }
735
-
736
 
737
- // Import post formats added by fredrick marks
738
- if(isset($post_format)) {
739
- wp_set_object_terms($post_id, $post_format, 'post_format');
740
 
741
- }
742
- //Import SEO Values
743
- if(!empty($seo_custom_array)){
744
- $this->importSEOfields($seo_custom_array,$post_id);
745
- }
 
 
 
 
746
 
747
  // Create custom taxonomy to post
748
  if (!empty ($smack_taxo)) {
@@ -773,13 +780,13 @@ class WPImporter_includes_helper {
773
  if (is_numeric($val)) {
774
  $split_cate[$key] = 'uncategorized';
775
  $assigned_categories['uncategorized'] = 'uncategorized';
776
- }
777
- $assigned_categories[$val] = $val;
778
  }
779
  foreach($assigned_categories as $cateKey => $cateVal) {
780
- $this->detailedLog[$currentLimit]['category'] .= $cateKey . "|";
781
- }
782
- $this->detailedLog[$currentLimit]['category'] = "<b>Category - </b>" .substr($this->detailedLog[$currentLimit]['category'], 0, -1);
783
  wp_set_object_terms($post_id, $split_cate, 'category');
784
  }
785
  // Add featured image
@@ -794,11 +801,11 @@ class WPImporter_includes_helper {
794
  'post_status' => 'inherit'
795
  );
796
  if($get_media_settings == 1){
797
- $generate_attachment = $dirname . '/' . $post_slug_value . '-' . $fimg_name;
798
  }else{
799
  $generate_attachment = $fimg_name;
800
  }
801
- $uploadedImage = $wp_upload_dir['path'] . '/' . $post_slug_value . '-' . $fimg_name;
802
  $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
803
  $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
804
  wp_update_attachment_metadata($attach_id, $attach_data);
@@ -850,33 +857,33 @@ class WPImporter_includes_helper {
850
  }
851
  }
852
 
853
- //Drop Database While Deactivate plugin
854
- public function deactivate() {
855
- global $wpdb;
856
- $sql1 = "DROP TABLE smackcsv_pie_log;";
857
- $wpdb->query($sql1);
858
-
859
- $sql2 = "DROP TABLE smackcsv_line_log;";
860
- $wpdb->query($sql2);
861
-
862
-
863
- }
864
- public function addPieChartEntry($imported_as, $count) {
865
- //add total counts
866
- global $wpdb;
867
- $getTypeID = $wpdb->get_results("select * from smackcsv_pie_log where type = '$imported_as'");
868
- if(count($getTypeID) == 0)
869
- $wpdb->insert('smackcsv_pie_log',array('type'=>$imported_as,'value'=>$count));
870
- else
871
- $wpdb->update('smackcsv_pie_log', array('value' =>$getTypeID[0]->value+$count), array('id'=>$getTypeID[0]->id));
872
- }
873
- function addStatusLog($inserted,$imported_as){
874
- global $wpdb;
875
- $today = date('Y-m-d h:i:s');
876
- $mon = date("M",strtotime($today));
877
- $year = date("Y",strtotime($today));
878
- $wpdb->insert('smackcsv_line_log', array('month'=>$mon,'year'=>$year,'imported_type'=>$imported_as,'imported_on'=>date('Y-m-d h:i:s'), 'inserted'=>$inserted ));
879
- }
880
 
881
  /**
882
  * Function for importing the all in seo data
@@ -988,32 +995,32 @@ class WPImporter_includes_helper {
988
  $footer = '';
989
  $footer .= '<div style="padding:10px;">';
990
  $footer .= '<label class="plugintags"><a href="http://www.wpultimatecsvimporter.com" target="_blank">Home</a></label> <label class="plugintags"><a href="http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer" target="_blank">Wiki</a></label>
991
- <label class="plugintags"><a href="http://www.wpultimatecsvimporter.com" target="_blank">Tutorials</a></label> <label class="plugintags"><a href="http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_Videos" target="_blank">Videos</a></label>
992
  <label class="plugintags"><a href="http://blog.smackcoders.com/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html" target="_blank">Sample Files</a></label>';
993
  $footer .= '</div>';
994
  $footer .= '<div style="padding:10px;margin-bottom:20px;">';
995
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] != 'settings')
996
- $footer .= "<div style='float:right;margin-top:-49px;'><a class='label label-info' href='".get_admin_url()."admin.php?page=".WP_CONST_ULTIMATE_CSV_IMP_SLUG."/index.php&__module=settings'>Click here to Enable any disabled module</a></div>";
997
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] == 'settings') {
998
- $footer .= "<div style='float:right;margin-top:-48px;'><span style='margin-right:20px;'><a class='label label-info' href='http://wordpress.org/plugins/wp-ultimate-csv-importer/developers/'>Get Old Versions</a></span><a class='label label-info' href='".get_admin_url()."admin.php?page=".WP_CONST_ULTIMATE_CSV_IMP_SLUG."/index.php&__module=support'>Click here to Get some useful links</a></div>";
999
- $footer .= "<div style='float:right;margin-right:15px;'> </span> Current Version: ".$get_pluginData['Version']." </div>";
1000
  }
1001
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] != 'support' && $_REQUEST['__module'] != 'settings') {
1002
- $footer .= "<div style='float:right;margin-right:225px;margin-top:-48px;'><span style='margin-right:20px;'> <a class='label label-info' href='http://wordpress.org/plugins/wp-ultimate-csv-importer/developers/'>Get Old Versions</a></span><a class='label label-info' href='".get_admin_url()."admin.php?page=".WP_CONST_ULTIMATE_CSV_IMP_SLUG."/index.php&__module=support'>Click here to Get some useful links</a></div>";
1003
- $footer .= "<div style='float:right;margin-right:15px;'> Current Version: ".$get_pluginData['Version']." </div>";
1004
  }
1005
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] == 'support'){
1006
  $footer .= "<div style='float:right;margin-right:15px;'><span style='margin-right:20px;'>Current Version: ".$get_pluginData['Version']." </span><span style='margin-right:10px;'><a class='label label-info' href='http://wordpress.org/plugins/wp-ultimate-csv-importer/developers/'>Get Old Versions</a></span></div>";
1007
  }
1008
  $footer .= '</div>';
1009
  $footer .= '<div style="float:right;margin-right:15px;margin-top:-10px;"> <label>Plugin By <a href="http://www.smackcoders.com"> Smackcoders</a></label> </div>';
1010
- echo $footer;
1011
  }
1012
 
1013
- function smack_csv_import_method() {
1014
-
1015
  $smack_csv_import_method = '<div class="importfileoption">
1016
-
1017
  <div align="center" style="text-align:left;margin-top:-33px;">
1018
  <div id="boxmethod1" class="method1">
1019
  <label><span class="radio-icon"><input type="radio" name="importmethod" id="uploadfilefromcomputer" onclick="choose_import_method(this.id);" checked/></span> <span class="header-text">' . __('From Computer') . '</span> </label> <br>
@@ -1022,7 +1029,7 @@ class WPImporter_includes_helper {
1022
  <span class="btn btn-success fileinput-button">
1023
  <span>' . __('Browse') . '</span>
1024
  <input id="fileupload" type="file" name="files[]" multiple>
1025
- <a href="#" id="zip_process" style = "display:none"> Click Here To Process Zip </a>
1026
  </span>';
1027
  // The global progress bar
1028
  $smack_csv_import_method .= '<span style="padding-top:10px;">
@@ -1033,26 +1040,48 @@ class WPImporter_includes_helper {
1033
  </span>
1034
  </div>
1035
  </div>
1036
- <div style = "opacity: 0.3;background-color: ghostwhite;">
1037
- <div id="boxmethod2" class="method2">
1038
- <label><span class="radio-icon"><input type="radio" name="importmethod" id="dwnldftpfile" /></span> <span class="header-text">' . __('From FTP') . '</span> </label> <br>
1039
- </div>
1040
- <div id="boxmethod3" class="method3">
1041
- <label> <span class="radio-icon"><input type="radio" name="importmethod" id="dwnldextrfile" /></span> <span class="header-text">' . __('From URL') . '</span></label> <br>
1042
- </div>
1043
- <div id="boxmethod4" class="method4">
1044
- <label><span class="radio-icon"><input type="radio" name="importmethod" id="useuploadedfile" /></span> <span class="header-text">' . __('From Already Uploaded') . '</span></label> <br>
1045
- </div>
1046
- </div>
1047
-
1048
- </div>
1049
- </div>';
 
 
 
 
 
 
 
 
 
1050
 
1051
  return $smack_csv_import_method;
1052
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1053
  }
1054
 
1055
-
1056
  class CallWPImporterObj extends WPImporter_includes_helper
1057
  {
1058
  private static $_instance = null;
77
  // @var array wp field keys
78
  public $keys = array();
79
 
80
+ // @var Multi images
81
+ public $MultiImages = false;
82
+
83
  // @var array for default columns
84
  public $defCols = array(
85
  'post_title' => null,
94
  'post_parent' => 0,
95
  'post_status' => 0,
96
  'menu_order' => 0,
97
+ 'post_format' => 0,
98
+ 'wp_page_template' => null,
99
  );
100
 
101
  // @var array CSV headers
167
 
168
  public static function output_fd_page()
169
  {
170
+ $get_pluginData = get_plugin_data(plugin_dir_path(__FILE__) . '../index.php');
171
  $plugin_version = get_option('ULTIMATE_CSV_IMPORTER_UPGRADE_FREE_VERSION');
172
  if(!$plugin_version) {
173
  $plugin_version = get_option('ULTIMATE_CSV_IMP_FREE_VERSION');
175
  if ($get_pluginData['Version'] == '3.6' && $plugin_version == '') {
176
  if (file_exists(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/upgrade/migrationfreev3.6.php')) {
177
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . '/upgrade/migrationfreev3.6.php');
178
+ die();
179
  }
180
  }
181
  else if (!isset($_REQUEST['__module']))
182
  {
183
+ if (!isset($_REQUEST['__module'])) {
184
+ wp_redirect(get_admin_url() . 'admin.php?page=' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/index.php&__module=dashboard');
185
 
186
+ }
187
  }
 
188
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'config/settings.php');
189
  require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'lib/skinnymvc/controller/SkinnyController.php');
190
 
269
  }
270
  $wpcsvfreesettings = get_option('wpcsvfreesettings');
271
  if($wpcsvfreesettings)
272
+ if(in_array('aioseo',$wpcsvfreesettings)){
273
+ if(in_array('all-in-one-seo-pack/all_in_one_seo_pack.php', $active_plugins)){
274
+ $seo_custoFields =array('SEO: keywords','SEO: description','SEO: title','SEO: noindex','SEO: nofollow','SEO: titleatr','SEO: menulabel','SEO: disable','SEO: disable_analytics','SEO: noodp','SEO: noydir');
275
+ foreach($seo_custoFields as $val)
276
+ $this->defCols[$val]=$val;
277
+ }
278
+ }
279
  }
280
 
281
  /**
287
  function csv_file_data($file)
288
  {
289
  $file = $this->getUploadDirectory().'/'.$file;
290
+ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'includes/Importer.php');
291
  $csv = new ImporterLib();
292
  $csv->delim($file);
293
  foreach($csv->data as $hkey => $hval) {
338
  }
339
 
340
  /**
341
+ * function to fetch the featured image from remote URL
342
+ * @param $f_img
343
+ * @param $fimg_path
344
+ * @param $fimg_name
345
+ * @param $post_slug_value
346
+ * @param $currentLimit
347
+ * @param string $logObj
348
  */
349
  public static function get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit = null, $logObj = ""){
350
  if($fimg_path!="" && $fimg_path){
351
+ $fimg_path = $fimg_path . "/" . $fimg_name;
352
  }
353
  $ch = curl_init ($f_img);
354
  curl_setopt($ch, CURLOPT_HEADER, 0);
366
  $logObj->detailedLog[$currentLimit]['image'] = "<b>Image -</b> host not resolved";
367
  }
368
  } else {
369
+ if (file_exists($fimg_path)) {
370
+ unlink($fimg_path);
371
+ }
372
+ $fp = fopen($fimg_path, 'x');
373
+ fwrite($fp, $rawdata);
374
+ fclose($fp);
375
+ $logObj->detailedLog[$currentLimit]['image'] = "<b>Image -</b>" . $fimg_name;
376
+ }
377
  curl_close($ch);
378
  }
379
 
382
  *
383
  * @return boolean
384
  */
385
+ function processDataInWP($data_rows,$ret_array,$session_arr,$currentLimit,$extractedimagelocation,$importinlineimageoption,$sample_inlineimage_url = null) {
 
386
  global $wpdb;
387
  $post_id = '';
388
  $new_post = array();
402
  $custom_array[$custom_key] = $data_rows[$i];
403
  }
404
  elseif($strip_SEO === 0){
405
+ $seo_key = substr($ret_array['mapping'.$i], 5);
406
+ $seo_custom_array[$seo_key] = $data_rows[$i];
407
+ }
408
  else {
409
  $new_post[$ret_array['mapping' . $i]] = $data_rows[$i];
410
  }
439
  $smack_taxo [$ckey] = null;
440
  $taxo_check = 1;
441
  }
442
+ if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo [$ckey] && $ckey != 'wp_page_template') {
443
+ if ($taxo_check == 1) {
444
  unset($smack_taxo[$ckey]);
445
  $taxo_check = 0;
446
  }
461
  case 'post_category' :
462
  $categories [$ckey] = $new_post [$ckey];
463
  break;
464
+ case 'wp_page_template' :
465
+ $custom_array['_wp_page_template'] = $new_post [$ckey];
466
+ break;
467
+ case 'featured_image' :
468
  require_once(ABSPATH . "wp-includes/pluggable.php");
469
  require_once(ABSPATH . 'wp-admin/includes/image.php');
470
  $dir = wp_upload_dir();
485
  $fimg_name = preg_replace("/[^a-zA-Z0-9._\s]/", "", $fimg_name);
486
  $fimg_name = preg_replace('/\s/', '-', $fimg_name);
487
  $fimg_name = urlencode($fimg_name);
488
+
489
  $parseURL = parse_url($f_img);
490
  $path_parts = pathinfo($f_img);
491
  if(!isset($path_parts['extension']))
496
 
497
  $post_slug_value = strtolower($f_img_slug);
498
  $this->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this);
499
+ $filepath = $fimg_path ."/" . $fimg_name;
500
+
501
  if(@getimagesize($filepath)){
502
  $img = wp_get_image_editor($filepath);
503
  if (!is_wp_error($img)) {
604
  $this->detailedLog[$currentLimit]['poststatus'] = "<b>Status - </b>" . $data_array['post_status'];
605
  }
606
  }
607
+ // Post Format Options
608
+
609
+ if(isset($data_array ['post_format'])) {
610
+ $post_format = 0;
611
+ switch ($data_array ['post_format']) {
612
+ case 1 :
613
+ $post_format = 'post-format-aside';
614
+ break;
615
+ case 2 :
616
+ $post_format = 'post-format-image';
617
+ break;
618
+ case 3 :
619
+ $post_format = 'post-format-video';
620
+ break;
621
+ case 4 :
622
+ $post_format = 'post-format-audio';
623
+ break;
624
+ case 5 :
625
+ $post_format = 'post-format-quote';
626
+ break;
627
+ case 6 :
628
+ $post_format = 'post-format-link';
629
+ break;
630
+ case 7 :
631
+ $post_format = 'post-format-gallery';
632
+ break;
633
+ default :
634
+ $post_format = 0;
635
+
636
+ }
637
+ }
638
 
639
 
640
  // Author name/id update
657
  if (empty($postauthor) || !$postauthor[0]->ID) {
658
  $data_array ['post_author'] = 1;
659
  $admindet = $wpdb->get_results("select ID,user_login from $wpdb->users where ID = 1");
660
+ $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - not found (assigned to </b>" . $admindet[0]->user_login . ")";
661
  $this->noPostAuthCount++;
662
  } else {
663
  $data_array ['post_author'] = $postauthor [0]->ID;
667
  else{
668
  $data_array ['post_author'] = 1;
669
  $admindet = $wpdb->get_results("select ID,user_login from $wpdb->users where ID = 1");
670
+ $this->detailedLog[$currentLimit]['assigned_author'] = "<b>Author - not found (assigned to </b>" . $admindet[0]->user_login . ")";
671
  $this->noPostAuthCount++;
672
  }
673
 
692
  }
693
  }
694
  if ($data_array) {
695
+ if($this->MultiImages == 'true') {
696
+ $inlineImagesObj = new WPImporter_inlineImages();
697
+ $post_id = $inlineImagesObj->importwithInlineImages($data_array['ID'], $currentLimit, $data_array, $this, $importinlineimageoption, $extractedimagelocation, $sample_inlineimage_url);
698
+ } else {
699
+ $post_id = wp_insert_post($data_array);
700
+ $this->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success";
701
+ }
702
  }
703
  unset($postauthor);
704
  if ($post_id) {
736
 
737
  if (!empty ($custom_array)) {
738
  foreach ($custom_array as $custom_key => $custom_value) {
739
+ update_post_meta($post_id, $custom_key, $custom_value);
740
  }
741
  }
 
742
 
 
 
 
743
 
744
+ // Import post formats added by fredrick marks
745
+ if(isset($post_format)) {
746
+ wp_set_object_terms($post_id, $post_format, 'post_format');
747
+
748
+ }
749
+ //Import SEO Values
750
+ if(!empty($seo_custom_array)){
751
+ $this->importSEOfields($seo_custom_array,$post_id);
752
+ }
753
 
754
  // Create custom taxonomy to post
755
  if (!empty ($smack_taxo)) {
780
  if (is_numeric($val)) {
781
  $split_cate[$key] = 'uncategorized';
782
  $assigned_categories['uncategorized'] = 'uncategorized';
783
+ }
784
+ $assigned_categories[$val] = $val;
785
  }
786
  foreach($assigned_categories as $cateKey => $cateVal) {
787
+ $this->detailedLog[$currentLimit]['category'] .= $cateKey . "|";
788
+ }
789
+ $this->detailedLog[$currentLimit]['category'] = "<b>Category - </b>" .substr($this->detailedLog[$currentLimit]['category'], 0, -1);
790
  wp_set_object_terms($post_id, $split_cate, 'category');
791
  }
792
  // Add featured image
801
  'post_status' => 'inherit'
802
  );
803
  if($get_media_settings == 1){
804
+ $generate_attachment = $dirname . '/' . $fimg_name;
805
  }else{
806
  $generate_attachment = $fimg_name;
807
  }
808
+ $uploadedImage = $wp_upload_dir['path'] . '/' . $fimg_name;
809
  $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
810
  $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
811
  wp_update_attachment_metadata($attach_id, $attach_data);
857
  }
858
  }
859
 
860
+ //Drop Database While Deactivate plugin
861
+ public function deactivate() {
862
+ global $wpdb;
863
+ $sql1 = "DROP TABLE smackcsv_pie_log;";
864
+ $wpdb->query($sql1);
865
+
866
+ $sql2 = "DROP TABLE smackcsv_line_log;";
867
+ $wpdb->query($sql2);
868
+
869
+
870
+ }
871
+ public function addPieChartEntry($imported_as, $count) {
872
+ //add total counts
873
+ global $wpdb;
874
+ $getTypeID = $wpdb->get_results("select * from smackcsv_pie_log where type = '$imported_as'");
875
+ if(count($getTypeID) == 0)
876
+ $wpdb->insert('smackcsv_pie_log',array('type'=>$imported_as,'value'=>$count));
877
+ else
878
+ $wpdb->update('smackcsv_pie_log', array('value' =>$getTypeID[0]->value+$count), array('id'=>$getTypeID[0]->id));
879
+ }
880
+ function addStatusLog($inserted,$imported_as){
881
+ global $wpdb;
882
+ $today = date('Y-m-d h:i:s');
883
+ $mon = date("M",strtotime($today));
884
+ $year = date("Y",strtotime($today));
885
+ $wpdb->insert('smackcsv_line_log', array('month'=>$mon,'year'=>$year,'imported_type'=>$imported_as,'imported_on'=>date('Y-m-d h:i:s'), 'inserted'=>$inserted ));
886
+ }
887
 
888
  /**
889
  * Function for importing the all in seo data
995
  $footer = '';
996
  $footer .= '<div style="padding:10px;">';
997
  $footer .= '<label class="plugintags"><a href="http://www.wpultimatecsvimporter.com" target="_blank">Home</a></label> <label class="plugintags"><a href="http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer" target="_blank">Wiki</a></label>
998
+ <label class="plugintags"><a href="http://www.wpultimatecsvimporter.com" target="_blank">Tutorials</a></label> <label class="plugintags"><a href="http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_Videos" target="_blank">Videos</a></label>
999
  <label class="plugintags"><a href="http://blog.smackcoders.com/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html" target="_blank">Sample Files</a></label>';
1000
  $footer .= '</div>';
1001
  $footer .= '<div style="padding:10px;margin-bottom:20px;">';
1002
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] != 'settings')
1003
+ $footer .= "<div style='float:right;margin-top:-49px;'><a class='label label-info' href='".get_admin_url()."admin.php?page=".WP_CONST_ULTIMATE_CSV_IMP_SLUG."/index.php&__module=settings'>Click here to Enable any disabled module</a></div>";
1004
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] == 'settings') {
1005
+ $footer .= "<div style='float:right;margin-top:-48px;'><span style='margin-right:20px;'><a class='label label-info' href='http://wordpress.org/plugins/wp-ultimate-csv-importer/developers/'>Get Old Versions</a></span><a class='label label-info' href='".get_admin_url()."admin.php?page=".WP_CONST_ULTIMATE_CSV_IMP_SLUG."/index.php&__module=support'>Click here to Get some useful links</a></div>";
1006
+ $footer .= "<div style='float:right;margin-right:15px;'> </span> Current Version: ".$get_pluginData['Version']." </div>";
1007
  }
1008
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] != 'support' && $_REQUEST['__module'] != 'settings') {
1009
+ $footer .= "<div style='float:right;margin-right:225px;margin-top:-48px;'><span style='margin-right:20px;'> <a class='label label-info' href='http://wordpress.org/plugins/wp-ultimate-csv-importer/developers/'>Get Old Versions</a></span><a class='label label-info' href='".get_admin_url()."admin.php?page=".WP_CONST_ULTIMATE_CSV_IMP_SLUG."/index.php&__module=support'>Click here to Get some useful links</a></div>";
1010
+ $footer .= "<div style='float:right;margin-right:15px;'> Current Version: ".$get_pluginData['Version']." </div>";
1011
  }
1012
  if(isset ($_REQUEST['__module']) && $_REQUEST['__module'] == 'support'){
1013
  $footer .= "<div style='float:right;margin-right:15px;'><span style='margin-right:20px;'>Current Version: ".$get_pluginData['Version']." </span><span style='margin-right:10px;'><a class='label label-info' href='http://wordpress.org/plugins/wp-ultimate-csv-importer/developers/'>Get Old Versions</a></span></div>";
1014
  }
1015
  $footer .= '</div>';
1016
  $footer .= '<div style="float:right;margin-right:15px;margin-top:-10px;"> <label>Plugin By <a href="http://www.smackcoders.com"> Smackcoders</a></label> </div>';
1017
+ echo $footer;
1018
  }
1019
 
1020
+ function smack_csv_import_method() {
1021
+
1022
  $smack_csv_import_method = '<div class="importfileoption">
1023
+
1024
  <div align="center" style="text-align:left;margin-top:-33px;">
1025
  <div id="boxmethod1" class="method1">
1026
  <label><span class="radio-icon"><input type="radio" name="importmethod" id="uploadfilefromcomputer" onclick="choose_import_method(this.id);" checked/></span> <span class="header-text">' . __('From Computer') . '</span> </label> <br>
1029
  <span class="btn btn-success fileinput-button">
1030
  <span>' . __('Browse') . '</span>
1031
  <input id="fileupload" type="file" name="files[]" multiple>
1032
+ <a href="#" id="zip_process" style = "display:none"> Click Here To Process Zip </a>
1033
  </span>';
1034
  // The global progress bar
1035
  $smack_csv_import_method .= '<span style="padding-top:10px;">
1040
  </span>
1041
  </div>
1042
  </div>
1043
+ <div style = "opacity: 0.3;background-color: ghostwhite;">
1044
+ <div id="boxmethod2" class="method2">
1045
+ <label><span class="radio-icon"><input type="radio" name="importmethod" id="dwnldftpfile" /></span> <span class="header-text">' . __('From FTP') . '</span> </label> <br>
1046
+ </div>
1047
+ <div id="boxmethod3" class="method3">
1048
+ <label> <span class="radio-icon"><input type="radio" name="importmethod" id="dwnldextrfile" /></span> <span class="header-text">' . __('From URL') . '</span></label> <br>
1049
+ </div>
1050
+ <div id="boxmethod4" class="method4">
1051
+ <label><span class="radio-icon"><input type="radio" name="importmethod" id="useuploadedfile" /></span> <span class="header-text">' . __('From Already Uploaded') . '</span></label> <br>
1052
+ </div>
1053
+ </div>
1054
+
1055
+ </div>
1056
+ </div>';
1057
+ $curr_module = $_REQUEST['__module'];
1058
+ if($curr_module == 'post' || $curr_module == 'page' || $curr_module == 'custompost' || $curr_module == 'eshop') {
1059
+ $smack_csv_import_method .= '<div class="media_handling" align="left">
1060
+ <span class="advancemediahandling"> <label> <input type="checkbox" name="advance_media_handling" id="advance_media_handling" onclick = "filezipopen();" /> Advance Media Handling </label> </span>
1061
+ <span id = "filezipup" style ="display:none;">
1062
+ <span class="advancemediahandling" style="padding-left:30px; margin-top:-5px;"> <input type="file" name="inlineimages" id="inlineimages" onchange ="checkextension(this.value);" /> </span>
1063
+ </span>
1064
+ </div>';
1065
+ }
1066
 
1067
  return $smack_csv_import_method;
1068
  }
1069
+ function helpnotes()
1070
+ {
1071
+ $smackhelpnotes = '<span style="position:absolute;">
1072
+ <a href="" class="tooltip">
1073
+ <img src="'. WP_CONST_ULTIMATE_CSV_IMP_DIR .'images/help.png" />
1074
+ <span class="tooltipPostStatus">
1075
+ <img class="callout" src="'. WP_CONST_ULTIMATE_CSV_IMP_DIR . 'images/callout.gif" />
1076
+ Default value is 1. You can give any value based on your environment configuration.
1077
+ <img src="'. WP_CONST_ULTIMATE_CSV_IMP_DIR .'images/help.png" style="margin-top: 6px;float:right;" />
1078
+ </span>
1079
+ </a>
1080
+ </span>';
1081
+ return $smackhelpnotes;
1082
+ }
1083
  }
1084
 
 
1085
  class CallWPImporterObj extends WPImporter_includes_helper
1086
  {
1087
  private static $_instance = null;
index.php CHANGED
@@ -2,7 +2,7 @@
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: A plugin that helps to import the data's from a CSV file.
5
- * Version: 3.6.4
6
  * Author: smackcoders.com
7
  * Plugin URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
8
  * Author URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
@@ -51,7 +51,7 @@ define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-
51
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
52
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
53
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
54
- define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.6.4');
55
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
56
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
57
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
@@ -60,6 +60,7 @@ if (!class_exists('SkinnyControllerWPCsvFree')) {
60
  require_once('lib/skinnymvc/controller/SkinnyController.php');
61
  }
62
 
 
63
  require_once('includes/WPImporter_includes_helper.php');
64
 
65
  # Activation & Deactivation
2
  /******************************
3
  * Plugin Name: WP Ultimate CSV Importer
4
  * Description: A plugin that helps to import the data's from a CSV file.
5
+ * Version: 3.6.5
6
  * Author: smackcoders.com
7
  * Plugin URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
8
  * Author URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
51
  define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
52
  define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
53
  define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
54
+ define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.6.5');
55
  define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
56
  define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
57
  define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
60
  require_once('lib/skinnymvc/controller/SkinnyController.php');
61
  }
62
 
63
+ require_once('plugins/class.inlineimages.php');
64
  require_once('includes/WPImporter_includes_helper.php');
65
 
66
  # Activation & Deactivation
js/ultimate-importer-free.js CHANGED
@@ -470,6 +470,57 @@ function showMapMessages(alerttype, msg) {
470
  jQuery("#showMsg").fadeOut(10000);
471
  }
472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  function importRecordsbySettings(siteurl)
474
  {
475
  var importlimit = document.getElementById('importlimit').value;
@@ -485,6 +536,12 @@ function importRecordsbySettings(siteurl)
485
  var currentlimit = document.getElementById('currentlimit').value;
486
  var tmpCnt = document.getElementById('tmpcount').value;
487
  var no_of_tot_records = document.getElementById('tot_records').value;
 
 
 
 
 
 
488
  var get_log = document.getElementById('log').innerHTML;
489
  document.getElementById('reportLog').style.display = '';
490
  document.getElementById('terminatenow').style.display = '';
@@ -517,7 +574,7 @@ function importRecordsbySettings(siteurl)
517
  }
518
 
519
  var postdata = new Array();
520
- postdata = {'dupContent':dupContent,'dupTitle':dupTitle,'importlimit':importlimit,'limit':currentlimit,'totRecords':tot_no_of_records,'selectedImporter':importas,'uploadedFile':uploadedFile,'tmpcount':tmpCnt,}
521
 
522
  var tmpLoc = document.getElementById('tmpLoc').value;
523
  jQuery.ajax({
470
  jQuery("#showMsg").fadeOut(10000);
471
  }
472
 
473
+ function filezipopen()
474
+ {
475
+ var advancemedia = document.getElementById('advance_media_handling').checked;
476
+ if(advancemedia == true)
477
+ document.getElementById('filezipup').style.display = '';
478
+ else
479
+ document.getElementById('filezipup').style.display = 'none';
480
+
481
+ }
482
+ //var allowedextension ={ '.zip' : 1 };
483
+ function checkextension(filename)
484
+ {
485
+ var allowedextension ={ '.zip' : 1 };
486
+ var match = /\..+$/;
487
+ var ext = filename.match(match);
488
+ if (allowedextension[ext])
489
+ {
490
+ return true;
491
+ }
492
+ else
493
+ {
494
+ alert("File must be .zip!");
495
+ //will clear the file input box.
496
+ location.reload();
497
+ return false;
498
+ }
499
+
500
+ }
501
+
502
+
503
+ function inline_image_option(id) {
504
+ var selected_option = document.getElementById(id).value;
505
+ document.getElementById('inlineimagevalue').value = selected_option;
506
+ if(selected_option == 'inlineimage_location') {
507
+ var image_location = document.getElementById('imagelocation').value;
508
+ document.getElementById('inlineimagevalue').value = image_location;
509
+ }
510
+ }
511
+
512
+ function customimagelocation(val) {
513
+ document.getElementById('inlineimagevalue').value = val;
514
+ }
515
+
516
+ function enableinlineimageoption() {
517
+ var importinlineimage = document.getElementById('multiimage').checked;
518
+ if(importinlineimage == true)
519
+ document.getElementById('inlineimageoption').style.display = '';
520
+ else
521
+ document.getElementById('inlineimageoption').style.display = 'none';
522
+ }
523
+
524
  function importRecordsbySettings(siteurl)
525
  {
526
  var importlimit = document.getElementById('importlimit').value;
536
  var currentlimit = document.getElementById('currentlimit').value;
537
  var tmpCnt = document.getElementById('tmpcount').value;
538
  var no_of_tot_records = document.getElementById('tot_records').value;
539
+ var importinlineimage = document.getElementById('multiimage').checked;
540
+ if(importinlineimage == true) {
541
+ } else {
542
+ }
543
+ var imagehandling = document.getElementById('inlineimagevalue').value;
544
+ var inline_image_location = document.getElementById('inline_image_location').value;
545
  var get_log = document.getElementById('log').innerHTML;
546
  document.getElementById('reportLog').style.display = '';
547
  document.getElementById('terminatenow').style.display = '';
574
  }
575
 
576
  var postdata = new Array();
577
+ postdata = {'dupContent':dupContent,'dupTitle':dupTitle,'importlimit':importlimit,'limit':currentlimit,'totRecords':tot_no_of_records,'selectedImporter':importas,'uploadedFile':uploadedFile,'tmpcount':tmpCnt,'importinlineimage':importinlineimage,'inlineimagehandling':imagehandling,'inline_image_location':inline_image_location,}
578
 
579
  var tmpLoc = document.getElementById('tmpLoc').value;
580
  jQuery.ajax({
modules/comments/templates/index.php CHANGED
@@ -403,7 +403,8 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
403
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
404
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
405
 
406
- No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="" placeholder="10" onblur="check_allnumeric(this.value);"></label> <br> <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
 
407
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
408
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
409
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
403
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
404
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
405
 
406
+ No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
407
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
408
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
409
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
410
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
modules/custompost/templates/index.php CHANGED
@@ -50,7 +50,7 @@ $impCE = new WPImporter_includes_helper();
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
52
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
53
- <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile'>
54
  <div class="importfile" align='center'>
55
  <div id='filenamedisplay'></div>
56
  <div class="container">
@@ -173,6 +173,23 @@ $impCE = new WPImporter_includes_helper();
173
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
174
  <div class='mappingsection'>
175
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
177
  <div class='importstatus' style='display:true;'>
178
  <input type="hidden" id="customposts" name="customposts" value="">
@@ -310,6 +327,7 @@ $impCE = new WPImporter_includes_helper();
310
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
311
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])) { echo $_REQUEST['step']; } ?>' />
312
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
 
313
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
314
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1</label>
315
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
@@ -470,6 +488,7 @@ $impCE = new WPImporter_includes_helper();
470
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
471
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
472
  <input type='hidden' id='uploadedFile' name='uploadedFile' value='<?php echo $_POST['uploadedFile']; ?>' />
 
473
  <?php } ?>
474
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
475
  <!-- Import settings options -->
@@ -508,10 +527,18 @@ $impCE = new WPImporter_includes_helper();
508
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
509
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
510
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
511
- No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="" placeholder="10" onblur="check_allnumeric(this.value);"></label> <br> <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
 
512
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
513
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
514
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
 
 
 
 
 
 
 
515
  </li>
516
  <!--<li>
517
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
52
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
53
+ <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' enctype="multipart/form-data" method='post' name='browsefile'>
54
  <div class="importfile" align='center'>
55
  <div id='filenamedisplay'></div>
56
  <div class="container">
173
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
174
  <div class='mappingsection'>
175
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
176
+ <?php
177
+ if(isset($_FILES['inlineimages'])) {
178
+ $uploaded_compressedFile = $_FILES['inlineimages']['tmp_name'];
179
+ $get_basename_zipfile = explode('.', $_FILES['inlineimages']['name']);
180
+ $basename_zipfile = $get_basename_zipfile[0];
181
+ $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $basename_zipfile;
182
+ $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $basename_zipfile;
183
+ $zip = new ZipArchive;
184
+ if ($zip->open($uploaded_compressedFile) === TRUE) {
185
+ $zip->extractTo($location_to_extract);
186
+ $zip->close();
187
+ $extracted_status = 1;
188
+ } else {
189
+ $extracted_status = 0;
190
+ }
191
+ }
192
+ ?>
193
  <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
194
  <div class='importstatus' style='display:true;'>
195
  <input type="hidden" id="customposts" name="customposts" value="">
327
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
328
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])) { echo $_REQUEST['step']; } ?>' />
329
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
330
+ <input type='hidden' id='inline_image_location' name='inline_image_location' value='<?php echo $extracted_image_location; ?>' />
331
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
332
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1</label>
333
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
488
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
489
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
490
  <input type='hidden' id='uploadedFile' name='uploadedFile' value='<?php echo $_POST['uploadedFile']; ?>' />
491
+ <input type='hidden' id='inline_image_location' name='location_inlineimages' value='<?php echo $_POST['inline_image_location']; ?>' />
492
  <?php } ?>
493
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
494
  <!-- Import settings options -->
527
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
528
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
529
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
530
+ No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
531
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
532
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
533
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
534
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
535
+ <h4>Inline image options</h4>
536
+ <label id='importalign'> <input type ='checkbox' id='multiimage' name='multiimage' value = '' onclick="enableinlineimageoption();"> Insert Inline Images </label><br>
537
+ <div id='inlineimageoption' style="display:none;" >
538
+ <label><input type="radio" name="inlineimage_location" id="imagewithextension" value="imagewithextension" onclick="inline_image_option(this.value);" /> Image name with extension </label>
539
+ <label><input type="radio" name="inlineimage_location" id="inlineimage_location" value="inlineimage_location" onclick="inline_image_option(this.value);" /> <input type="text" name="imagelocation" id="imagelocation" placeholder="Inline Image Location" value="" onblur="customimagelocation(this.value);" /></label>
540
+ </div>
541
+ <input type='hidden' id='inlineimagevalue' name='inlineimagevalue' value='none' />
542
  </li>
543
  <!--<li>
544
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
modules/eshop/actions/actions.php CHANGED
@@ -83,6 +83,9 @@ class EshopActions extends SkinnyActions {
83
  // @var array wp field keys
84
  public $keys = array();
85
 
 
 
 
86
  public $detailedLog = array();
87
 
88
  /**
@@ -305,7 +308,7 @@ class EshopActions extends SkinnyActions {
305
  *
306
  * @return boolean
307
  */
308
- function processDataInWP($data_rows,$ret_array,$session_arr,$currentLimit)
309
  {
310
  global $wpdb;
311
  $post_id = '';
@@ -589,8 +592,13 @@ class EshopActions extends SkinnyActions {
589
  }
590
  }
591
  if ($data_array) {
592
- $post_id = wp_insert_post($data_array);
593
- $this->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success";
 
 
 
 
 
594
  }
595
 
596
  unset($postauthor);
83
  // @var array wp field keys
84
  public $keys = array();
85
 
86
+ // @var Multi images
87
+ public $MultiImages = false;
88
+
89
  public $detailedLog = array();
90
 
91
  /**
308
  *
309
  * @return boolean
310
  */
311
+ function processDataInWP($data_rows,$ret_array,$session_arr,$currentLimit,$extractedimagelocation,$importinlineimageoption,$sample_inlineimage_url = null)
312
  {
313
  global $wpdb;
314
  $post_id = '';
592
  }
593
  }
594
  if ($data_array) {
595
+ if($this->MultiImages == 'true') {
596
+ $inlineImagesObj = new WPImporter_inlineImages();
597
+ $post_id = $inlineImagesObj->importwithInlineImages($data_array['ID'], $currentLimit, $data_array, $this, $importinlineimageoption, $extractedimagelocation, $sample_inlineimage_url);
598
+ } else {
599
+ $post_id = wp_insert_post($data_array);
600
+ $this->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success";
601
+ }
602
  }
603
 
604
  unset($postauthor);
modules/eshop/templates/index.php CHANGED
@@ -52,7 +52,7 @@ $eshopObj->isplugin();
52
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
53
  <?php } ?>
54
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
55
- <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile'>
56
  <div class="importfile" align='center'>
57
  <div align=center>
58
  <div id="noPlugin" class="warnings" style="display:none"></div>
@@ -90,7 +90,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
90
  <div id='filenamedisplay'></div><!--<form class="add:the-list: validate" style="clear:both;" method="post" enctype="multipart/form-data" onsubmit="return file_exist();">-->
91
 
92
  <div class="container">
93
- <?php echo $impCE->smack_csv_import_method(); ?>
94
 
95
  <input type ='hidden' id="pluginurl"value="<?php echo WP_CONTENT_URL;?>">
96
  <?php $uploadDir = wp_upload_dir(); ?>
@@ -213,6 +213,23 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
213
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
214
  <div class='mappingsection'>
215
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
217
  <div class='importstatus' style='display:true;'>
218
  <input type="hidden" id="customposts" name="customposts" value="">
@@ -294,6 +311,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
294
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
295
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])){ echo $_REQUEST['step']; } ?>' />
296
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
 
297
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
298
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1 </label>
299
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
@@ -453,6 +471,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
453
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
454
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
455
  <input type='hidden' id='uploadedFile' name='uploadedFile1' value='<?php echo $_POST['uploadedFile']; ?>' />
 
456
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
457
  <?php } ?>
458
  <!-- Import settings options -->
@@ -492,10 +511,18 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
492
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
493
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
494
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
495
- No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="" placeholder="10" onblur="check_allnumeric(this.value);"></label> <br> <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
 
496
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
497
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
498
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
 
 
 
 
 
 
 
499
  </li>
500
  <!-- <li>
501
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
52
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
53
  <?php } ?>
54
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
55
+ <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile' enctype="multipart/form-data">
56
  <div class="importfile" align='center'>
57
  <div align=center>
58
  <div id="noPlugin" class="warnings" style="display:none"></div>
90
  <div id='filenamedisplay'></div><!--<form class="add:the-list: validate" style="clear:both;" method="post" enctype="multipart/form-data" onsubmit="return file_exist();">-->
91
 
92
  <div class="container">
93
+ <?php echo $impCE->smack_csv_import_method(); ?>
94
 
95
  <input type ='hidden' id="pluginurl"value="<?php echo WP_CONTENT_URL;?>">
96
  <?php $uploadDir = wp_upload_dir(); ?>
213
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
214
  <div class='mappingsection'>
215
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
216
+ <?php
217
+ if(isset($_FILES['inlineimages'])) {
218
+ $uploaded_compressedFile = $_FILES['inlineimages']['tmp_name'];
219
+ $get_basename_zipfile = explode('.', $_FILES['inlineimages']['name']);
220
+ $basename_zipfile = $get_basename_zipfile[0];
221
+ $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $basename_zipfile;
222
+ $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $basename_zipfile;
223
+ $zip = new ZipArchive;
224
+ if ($zip->open($uploaded_compressedFile) === TRUE) {
225
+ $zip->extractTo($location_to_extract);
226
+ $zip->close();
227
+ $extracted_status = 1;
228
+ } else {
229
+ $extracted_status = 0;
230
+ }
231
+ }
232
+ ?>
233
  <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
234
  <div class='importstatus' style='display:true;'>
235
  <input type="hidden" id="customposts" name="customposts" value="">
311
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
312
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])){ echo $_REQUEST['step']; } ?>' />
313
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
314
+ <input type='hidden' id='inline_image_location' name='inline_image_location' value='<?php echo $extracted_image_location; ?>' />
315
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
316
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1 </label>
317
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
471
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
472
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
473
  <input type='hidden' id='uploadedFile' name='uploadedFile1' value='<?php echo $_POST['uploadedFile']; ?>' />
474
+ <input type='hidden' id='inline_image_location' name='location_inlineimages' value='<?php echo $_POST['inline_image_location']; ?>' />
475
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
476
  <?php } ?>
477
  <!-- Import settings options -->
511
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
512
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
513
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
514
+ No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
515
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
516
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
517
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
518
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
519
+ <h4>Inline image options</h4>
520
+ <label id='importalign'> <input type ='checkbox' id='multiimage' name='multiimage' value = '' onclick="enableinlineimageoption();"> Insert Inline Images </label><br>
521
+ <div id='inlineimageoption' style="display:none;" >
522
+ <label><input type="radio" name="inlineimage_location" id="imagewithextension" value="imagewithextension" onclick="inline_image_option(this.value);" /> Image name with extension </label>
523
+ <label><input type="radio" name="inlineimage_location" id="inlineimage_location" value="inlineimage_location" onclick="inline_image_option(this.value);" /> <input type="text" name="imagelocation" id="imagelocation" placeholder="Inline Image Location" value="" onblur="customimagelocation(this.value);" /></label>
524
+ </div>
525
+ <input type='hidden' id='inlineimagevalue' name='inlineimagevalue' value='none' />
526
  </li>
527
  <!-- <li>
528
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
modules/page/templates/index.php CHANGED
@@ -50,7 +50,7 @@ $impCE = new WPImporter_includes_helper();
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
52
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
53
- <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile'>
54
  <div class="importfile" align='center'>
55
  <div id='filenamedisplay'></div><!--<form class="add:the-list: validate" style="clear:both;" method="post" enctype="multipart/form-data" onsubmit="return file_exist();">-->
56
  <div class="container">
@@ -173,7 +173,24 @@ $impCE = new WPImporter_includes_helper();
173
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
174
  <div class='mappingsection'>
175
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
176
- <?php if($_REQUEST['__module']=='custompost'){ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  <div class='importstatus' style='display:true;'>
178
  <input type="hidden" id="customposts" name="customposts" value="">
179
  <div style = 'float:left'> <label> Select Post Type </label> <span class="mandatory"> * </span> </div>
@@ -251,6 +268,7 @@ $impCE = new WPImporter_includes_helper();
251
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
252
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])) { echo $_REQUEST['step']; } ?>' />
253
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
 
254
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
255
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1</label>
256
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
@@ -407,6 +425,7 @@ $impCE = new WPImporter_includes_helper();
407
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
408
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
409
  <input type='hidden' id='uploadedFile' name='uploadedFile' value='<?php echo $_POST['uploadedFile']; ?>' />
 
410
  <?php } ?>
411
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
412
  <!-- Import settings options -->
@@ -445,10 +464,18 @@ $impCE = new WPImporter_includes_helper();
445
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
446
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
447
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
448
- No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="" placeholder="10" onblur="check_allnumeric(this.value);"></label> <br> <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
 
449
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
450
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
451
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
 
 
 
 
 
 
 
452
  </li>
453
  <!--<li>
454
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
52
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
53
+ <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' enctype="multipart/form-data" method='post' name='browsefile'>
54
  <div class="importfile" align='center'>
55
  <div id='filenamedisplay'></div><!--<form class="add:the-list: validate" style="clear:both;" method="post" enctype="multipart/form-data" onsubmit="return file_exist();">-->
56
  <div class="container">
173
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
174
  <div class='mappingsection'>
175
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
176
+ <?php
177
+ if(isset($_FILES['inlineimages'])) {
178
+ $uploaded_compressedFile = $_FILES['inlineimages']['tmp_name'];
179
+ $get_basename_zipfile = explode('.', $_FILES['inlineimages']['name']);
180
+ $basename_zipfile = $get_basename_zipfile[0];
181
+ $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $basename_zipfile;
182
+ $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $basename_zipfile;
183
+ $zip = new ZipArchive;
184
+ if ($zip->open($uploaded_compressedFile) === TRUE) {
185
+ $zip->extractTo($location_to_extract);
186
+ $zip->close();
187
+ $extracted_status = 1;
188
+ } else {
189
+ $extracted_status = 0;
190
+ }
191
+ }
192
+ ?>
193
+ <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
194
  <div class='importstatus' style='display:true;'>
195
  <input type="hidden" id="customposts" name="customposts" value="">
196
  <div style = 'float:left'> <label> Select Post Type </label> <span class="mandatory"> * </span> </div>
268
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
269
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])) { echo $_REQUEST['step']; } ?>' />
270
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
271
+ <input type='hidden' id='inline_image_location' name='inline_image_location' value='<?php echo $extracted_image_location; ?>' />
272
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
273
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1</label>
274
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
425
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
426
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
427
  <input type='hidden' id='uploadedFile' name='uploadedFile' value='<?php echo $_POST['uploadedFile']; ?>' />
428
+ <input type='hidden' id='inline_image_location' name='location_inlineimages' value='<?php echo $_POST['inline_image_location']; ?>' />
429
  <?php } ?>
430
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
431
  <!-- Import settings options -->
464
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
465
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
466
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
467
+ No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?> <br>
468
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
469
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
470
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
471
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
472
+ <h4>Inline image options</h4>
473
+ <label id='importalign'> <input type ='checkbox' id='multiimage' name='multiimage' value = '' onclick="enableinlineimageoption();"> Insert Inline Images </label><br>
474
+ <div id='inlineimageoption' style="display:none;" >
475
+ <label><input type="radio" name="inlineimage_location" id="imagewithextension" value="imagewithextension" onclick="inline_image_option(this.value);" /> Image name with extension </label>
476
+ <label><input type="radio" name="inlineimage_location" id="inlineimage_location" value="inlineimage_location" onclick="inline_image_option(this.value);" /> <input type="text" name="imagelocation" id="imagelocation" placeholder="Inline Image Location" value="" onblur="customimagelocation(this.value);" /></label>
477
+ </div>
478
+ <input type='hidden' id='inlineimagevalue' name='inlineimagevalue' value='none' />
479
  </li>
480
  <!--<li>
481
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
modules/post/templates/index.php CHANGED
@@ -50,11 +50,11 @@ $impCE = new WPImporter_includes_helper();
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
52
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
53
- <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' method='post' name='browsefile'>
54
  <div class="importfile" align='center'>
55
  <div id='filenamedisplay'></div><!--<form class="add:the-list: validate" style="clear:both;" method="post" enctype="multipart/form-data" onsubmit="return file_exist();">-->
56
  <div class="container">
57
- <?php echo $impCE->smack_csv_import_method(); ?>
58
 
59
  <input type ='hidden' id="pluginurl"value="<?php echo WP_CONTENT_URL;?>">
60
  <?php $uploadDir = wp_upload_dir(); ?>
@@ -176,6 +176,23 @@ $impCE = new WPImporter_includes_helper();
176
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
177
  <div class='mappingsection'>
178
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
180
  <div class='importstatus' style='display:true;'>
181
  <input type="hidden" id="customposts" name="customposts" value="">
@@ -257,6 +274,7 @@ $impCE = new WPImporter_includes_helper();
257
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
258
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])){ echo $_REQUEST['step']; } ?>' />
259
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
 
260
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
261
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1 </label>
262
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
@@ -415,6 +433,7 @@ $impCE = new WPImporter_includes_helper();
415
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
416
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
417
  <input type='hidden' id='uploadedFile' name='uploadedFile1' value='<?php echo $_POST['uploadedFile']; ?>' />
 
418
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
419
  <?php } ?>
420
  <!-- Import settings options -->
@@ -454,10 +473,18 @@ $impCE = new WPImporter_includes_helper();
454
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
455
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
456
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
457
- No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="" placeholder="10" onblur="check_allnumeric(this.value);"></label> <br> <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
 
458
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
459
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
460
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
 
 
 
 
 
 
 
461
  </li>
462
  <!-- <li>
463
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
50
  <input type='hidden' id='is_uploadfound' name='is_uploadfound' value='notfound' />
51
  <?php } ?>
52
  <div class="warning" id="warning" name="warning" style="display:none;margin: 4% 0 4% 22%;"></div>
53
+ <form action='<?php echo admin_url().'admin.php?page='.WP_CONST_ULTIMATE_CSV_IMP_SLUG.'/index.php&__module='.$_REQUEST['__module'].'&step=mapping_settings'?>' id='browsefile' enctype="multipart/form-data" method='post' name='browsefile'>
54
  <div class="importfile" align='center'>
55
  <div id='filenamedisplay'></div><!--<form class="add:the-list: validate" style="clear:both;" method="post" enctype="multipart/form-data" onsubmit="return file_exist();">-->
56
  <div class="container">
57
+ <?php echo $impCE->smack_csv_import_method(); ?>
58
 
59
  <input type ='hidden' id="pluginurl"value="<?php echo WP_CONTENT_URL;?>">
60
  <?php $uploadDir = wp_upload_dir(); ?>
176
  <div id='sec-two' <?php if($_REQUEST['step']!= 'mapping_settings'){ ?> style='display:none;' <?php } ?> >
177
  <div class='mappingsection'>
178
  <h2><div class="secondformheader">Import Data Configuration</div></h2>
179
+ <?php
180
+ if(isset($_FILES['inlineimages'])) {
181
+ $uploaded_compressedFile = $_FILES['inlineimages']['tmp_name'];
182
+ $get_basename_zipfile = explode('.', $_FILES['inlineimages']['name']);
183
+ $basename_zipfile = $get_basename_zipfile[0];
184
+ $location_to_extract = $uploadDir['basedir'] . '/smack_inline_images/' . $basename_zipfile;
185
+ $extracted_image_location = $uploadDir['baseurl'] . '/smack_inline_images/' . $basename_zipfile;
186
+ $zip = new ZipArchive;
187
+ if ($zip->open($uploaded_compressedFile) === TRUE) {
188
+ $zip->extractTo($location_to_extract);
189
+ $zip->close();
190
+ $extracted_status = 1;
191
+ } else {
192
+ $extracted_status = 0;
193
+ }
194
+ }
195
+ ?>
196
  <?php if(isset($_REQUEST['__module']) && $_REQUEST['__module']=='custompost'){ ?>
197
  <div class='importstatus' style='display:true;'>
198
  <input type="hidden" id="customposts" name="customposts" value="">
274
  <input type='hidden' id='select_delimeter' name='select_delimeter' value="<?php if(isset($delimeter)) { echo $delimeter; } ?>" />
275
  <input type='hidden' id='stepstatus' name='stepstatus' value='<?php if(isset($_REQUEST['step'])){ echo $_REQUEST['step']; } ?>' />
276
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
277
+ <input type='hidden' id='inline_image_location' name='inline_image_location' value='<?php echo $extracted_image_location; ?>' />
278
  <input type='button' id='prev_record' name='prev_record' class="btn btn-primary" value='<<' onclick='gotoelement(this.id);' />
279
  <label style="padding-right:10px;" id='preview_of_row'>Showing preview of row # 1 </label>
280
  <input type='button' id='next_record' name='next_record' class="btn btn-primary" value='>>' onclick='gotoelement(this.id);' />
433
  <input type='hidden' id='checkfile' name='checkfile' value='<?php echo $_POST['uploadedFile']; ?>' />
434
  <input type='hidden' id='select_delim' name='select_delim' value='<?php echo $_POST['select_delimeter']; ?>' />
435
  <input type='hidden' id='uploadedFile' name='uploadedFile1' value='<?php echo $_POST['uploadedFile']; ?>' />
436
+ <input type='hidden' id='inline_image_location' name='location_inlineimages' value='<?php echo $_POST['inline_image_location']; ?>' />
437
  <input type='hidden' id='mappingArr' name='mappingArr' value='' />
438
  <?php } ?>
439
  <!-- Import settings options -->
473
  <input name="filterhtmlentities" id="filterhtmlentities" type="checkbox" value="1"> Decode HTML-Entities before comparing <br>-->
474
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
475
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
476
+ No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
477
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
478
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
479
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
480
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
481
+ <h4>Inline image options</h4>
482
+ <label id='importalign'> <input type ='checkbox' id='multiimage' name='multiimage' value = '' onclick="enableinlineimageoption();"> Insert Inline Images </label><br>
483
+ <div id='inlineimageoption' style="display:none;" >
484
+ <label><input type="radio" name="inlineimage_location" id="imagewithextension" value="imagewithextension" onclick="inline_image_option(this.value);" /> Image name with extension </label>
485
+ <label><input type="radio" name="inlineimage_location" id="inlineimage_location" value="inlineimage_location" onclick="inline_image_option(this.value);" /> <input type="text" name="imagelocation" id="imagelocation" placeholder="Inline Image Location" value="" onblur="customimagelocation(this.value);" /></label>
486
+ </div>
487
+ <input type='hidden' id='inlineimagevalue' name='inlineimagevalue' value='none' />
488
  </li>
489
  <!-- <li>
490
  Ignore these words while comparing <input name="filterwords" id="filterwords" type="text" value="">
modules/users/templates/index.php CHANGED
@@ -400,7 +400,8 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
400
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
401
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
402
 
403
- No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="" placeholder="10" onblur="check_allnumeric(this.value);"></label> <br> <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
 
404
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
405
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
406
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
400
  <label><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> Detect duplicate post content</label> <br>
401
  <label><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > Detect duplicate post title</label> <br>
402
 
403
+ No. of posts/rows per server request <span class="mandatory">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
404
+ <span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;">You can set upto <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
405
  <input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
406
  <input type="hidden" id="tmpcount" name="tmpcount" value="0" />
407
  <input type="hidden" id="terminateaction" name="terminateaction" value="continue" />
plugins/class.inlineimages.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WPImporter_inlineImages {
3
+
4
+ /**
5
+ * Function for update with inline images data
6
+ * @param $array
7
+ * @param $postId
8
+ */
9
+ function importwithInlineImages ($recordID, $currentLimit, $data_array, $impObj, $import_image_method, $imgLoc, $sampleURL) {
10
+ $helperObj = new WPImporter_includes_helper();
11
+ $res_array = $this->process_multi_images($data_array, $helperObj, $currentLimit, $impObj, $import_image_method, $imgLoc, $sampleURL);
12
+ #print_r($res_array); die('am from importwithInlineImages function');
13
+ $data_array['post_content'] = $res_array;
14
+ $post_id = wp_insert_post($data_array);
15
+ $impObj->insPostCount++;
16
+ $impObj->detailedLog[$currentLimit]['post_id'] = "<b>Created Post_ID - </b>" . $post_id . " - success";
17
+ return $post_id;
18
+ }
19
+
20
+ /**
21
+ * Function to process the multi image if the image url given in post content
22
+ * @param data
23
+ * @return
24
+ */
25
+ public function process_multi_images($data_array, $helperObj, $currentLimit, $impObj, $import_image_method, $imgLoc, $sampleURL) {
26
+ $content = $data_array['post_content'];
27
+ $doc = new DOMDocument();
28
+ $doc->loadHTML($content);
29
+ $res = $this->getHtmlChar($doc, 'img');
30
+ foreach($res as $key => $image_url) {
31
+ foreach($image_url as $img_path) {
32
+ $get_name=explode('/',$img_path);
33
+ $count=count($get_name);
34
+ $img_real_name = $get_name[$count - 1];
35
+ $inline_img_slug = preg_replace("/[^a-zA-Z0-9._\s]/", "", $data_array['post_title']);
36
+ $inline_img_slug = preg_replace('/\s/', '-', $inline_img_slug);
37
+ $post_slug_value = strtolower($inline_img_slug);
38
+ $dir = wp_upload_dir();
39
+ $media_location = $dir ['baseurl'];
40
+ $get_media_settings = get_option('uploads_use_yearmonth_folders');
41
+ if ($get_media_settings == 1) {
42
+ $dirname = date('Y') . '/' . date('m');
43
+ $full_path = $dir ['basedir'] . '/' . $dirname;
44
+ $baseurl = $dir ['baseurl'] . '/' . $dirname;
45
+ } else {
46
+ $full_path = $dir ['basedir'];
47
+ $baseurl = $dir ['baseurl'];
48
+ }
49
+ $inline_img_path = $full_path;
50
+ $img_real_name = wp_unique_filename($inline_img_path, $img_real_name, $unique_filename_callback = null);
51
+ if($import_image_method == 'imagewithextension' && $count == 1 ) {
52
+ $new_img_path = $imgLoc . '/' . $img_real_name;
53
+ $helperObj->get_fimg_from_URL($new_img_path, $inline_img_path, $img_real_name, $post_slug_value, $currentLimit, $impObj);
54
+ } else {
55
+ if($sampleURL == null) {
56
+ $helperObj->get_fimg_from_URL($img_path, $inline_img_path, $img_real_name, $post_slug_value, $currentLimit, $impObj);
57
+ } else {
58
+ $new_img_path = $sampleURL . '/' . $img_real_name;
59
+ $helperObj->get_fimg_from_URL($new_img_path, $inline_img_path, $img_real_name, $post_slug_value, $currentLimit, $impObj);
60
+ }
61
+ }
62
+ $inline_filepath = $inline_img_path . "/" . $img_real_name;
63
+ if (@getimagesize($inline_filepath)) {
64
+ $inline_file ['guid'] = $baseurl . "/" . $img_real_name;
65
+ $inline_file ['post_title'] = $img_real_name;
66
+ $inline_file ['post_content'] = '';
67
+ $inline_file ['post_status'] = 'attachment';
68
+ $wp_upload_dir = wp_upload_dir();
69
+ $attachment = array('guid' => $inline_file ['guid'], 'post_mime_type' => 'image/jpg', 'post_title' => preg_replace('/\.[^.]+$/', '', @basename($inline_file ['guid'])), 'post_content' => '', 'post_status' => 'inherit');
70
+ if ($get_media_settings == 1) {
71
+ $generate_attachment = $dirname . '/' . $img_real_name;
72
+ } else {
73
+ $generate_attachment = $img_real_name;
74
+ }
75
+ $uploadedImage = $wp_upload_dir['path'] . '/' . $img_real_name;
76
+ $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
77
+ $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
78
+ wp_update_attachment_metadata($attach_id, $attach_data);
79
+ set_post_thumbnail($post_id, $attach_id);
80
+ $oldWord = $img_path;
81
+ $newWord = $inline_file['guid'];
82
+ $content = str_replace($oldWord , $newWord , $content);
83
+ } else {
84
+ $inline_file = false;
85
+ }
86
+ }
87
+ }
88
+ return $content;
89
+ }
90
+
91
+ public function getHtmlChar($dom_document,$tagname) {
92
+ $tagcontent = array();
93
+ $dom_xpath = new DOMXpath($dom_document);
94
+ $elements = $dom_document->getElementsByTagName($tagname);
95
+ if(!is_null($elements))
96
+ {
97
+ $i = 0;
98
+ foreach ($elements as $element)
99
+ {
100
+ if($tagname == 'img')
101
+ $nodes = $element->attributes;
102
+ else
103
+ $nodes = $element->childNodes;
104
+
105
+ foreach ($nodes as $node)
106
+ {
107
+ $nodevalue = trim($node->nodeValue);
108
+ if($tagname == 'img')
109
+ {
110
+ $nodename = trim($node->nodeName);
111
+ if(isset($nodename) && !empty($nodename) && $nodename != NULL && $nodename == 'src')
112
+ {
113
+ $tagcontent[$tagname][$i] = $nodevalue;
114
+ $i ++;
115
+ }
116
+ }
117
+ else
118
+ {
119
+ if(isset($nodevalue) && !empty($nodevalue) && $nodevalue != NULL)
120
+ {
121
+ $tagcontent[$tagname][$i] = $nodevalue;
122
+ {
123
+ $tagcontent[$tagname][$i] = $nodevalue;
124
+ $i ++;
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ return $tagcontent;
131
+ }
132
+ }
133
+ }
screenshot-2.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
templates/import.php CHANGED
@@ -56,10 +56,11 @@ if ($curr_action == 'post' || $curr_action == 'page' || $curr_action == 'customp
56
  if ($curr_action == 'custompost') {
57
  $importedAs = 'Custom Post';
58
  }
59
-
60
  } elseif ($curr_action == 'eshop') {
61
  $importObj = new EshopActions();
62
- $importedAs = 'Eshop';
 
63
  } elseif ($curr_action == 'wpcommerce') {
64
  $importObj = new WpcommerceActions();
65
  } elseif ($curr_action == 'woocommerce') {
@@ -96,7 +97,6 @@ if ($count < $totRecords) {
96
  $count = $totRecords;
97
  }
98
  $resultArr = array();
99
-
100
  $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
101
  $delim = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['select_delimeter'];
102
  $resultArr = $skinnyObj->csv_file_data($filename);
@@ -134,8 +134,18 @@ for ($i = $limit; $i < $count; $i++) {
134
  $to_be_import_rec[] = $resultVal;
135
  }
136
  $importObj->detailedLog = array();
137
-
138
- $importObj->processDataInWP($to_be_import_rec,$_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $i);
 
 
 
 
 
 
 
 
 
 
139
  if ($curr_action == 'post' || $curr_action == 'page' || $curr_action == 'custompost' || $curr_action == 'eshop') {
140
  foreach($importObj->detailedLog as $logKey => $logVal) {
141
  echo "<p style='margin-left:10px;'> " . $logVal['post_id'] . " , " . $logVal['assigned_author'] . " , " . $logVal['category'] . " , " . $logVal['tags'] . " , " . $logVal['postdate'] . " , " . $logVal['image'] . " , " . $logVal['poststatus'];
@@ -160,6 +170,12 @@ for ($i = $limit; $i < $count; $i++) {
160
 
161
  if ($limit >= $totRecords) {
162
  $dir = $skinnyObj->getUploadDirectory();
 
 
 
 
 
 
163
  $skinnyObj->deletefileafterprocesscomplete($dir);
164
  }
165
  if ($importObj->insPostCount != 0 || $importObj->dupPostCount != 0 || $importObj->updatedPostCount != 0) {
56
  if ($curr_action == 'custompost') {
57
  $importedAs = 'Custom Post';
58
  }
59
+ $importObj->MultiImages = $_POST['postdata']['importinlineimage'];
60
  } elseif ($curr_action == 'eshop') {
61
  $importObj = new EshopActions();
62
+ $importedAs = 'Eshop';
63
+ $importObj->MultiImages = $_POST['postdata']['importinlineimage'];
64
  } elseif ($curr_action == 'wpcommerce') {
65
  $importObj = new WpcommerceActions();
66
  } elseif ($curr_action == 'woocommerce') {
97
  $count = $totRecords;
98
  }
99
  $resultArr = array();
 
100
  $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
101
  $delim = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['select_delimeter'];
102
  $resultArr = $skinnyObj->csv_file_data($filename);
134
  $to_be_import_rec[] = $resultVal;
135
  }
136
  $importObj->detailedLog = array();
137
+ $extracted_image_location = null;
138
+ $importinlineimageoption = null;
139
+ if(isset($_POST['postdata']['inline_image_location'])) {
140
+ $importinlineimageoption = 'imagewithextension';
141
+ $extracted_image_location = $_POST['postdata']['inline_image_location'];
142
+ }
143
+ if($_POST['postdata']['inlineimagehandling'] != 'imagewithextension') {
144
+ $importinlineimageoption = 'imagewithurl';
145
+ $extracted_image_location = $_POST['postdata']['inline_image_location'];
146
+ $sample_inlineimage_url = $_POST['postdata']['inlineimagehandling'];
147
+ }
148
+ $importObj->processDataInWP($to_be_import_rec,$_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $i, $extracted_image_location, $importinlineimageoption, $sample_inlineimage_url);
149
  if ($curr_action == 'post' || $curr_action == 'page' || $curr_action == 'custompost' || $curr_action == 'eshop') {
150
  foreach($importObj->detailedLog as $logKey => $logVal) {
151
  echo "<p style='margin-left:10px;'> " . $logVal['post_id'] . " , " . $logVal['assigned_author'] . " , " . $logVal['category'] . " , " . $logVal['tags'] . " , " . $logVal['postdate'] . " , " . $logVal['image'] . " , " . $logVal['poststatus'];
170
 
171
  if ($limit >= $totRecords) {
172
  $dir = $skinnyObj->getUploadDirectory();
173
+ $get_inline_imageDir = explode('/', $extracted_image_location);
174
+ $explodedCount = count($get_inline_imageDir);
175
+ $inline_image_dirname = $get_inline_imageDir[$explodedCount - 1];
176
+ $uploadDir = $skinnyObj->getUploadDirectory('inlineimages');
177
+ $inline_images_dir = $uploadDir . '/smack_inline_images/' . $inline_image_dirname;
178
+ $skinnyObj->deletefileafterprocesscomplete($inline_images_dir);
179
  $skinnyObj->deletefileafterprocesscomplete($dir);
180
  }
181
  if ($importObj->insPostCount != 0 || $importObj->dupPostCount != 0 || $importObj->updatedPostCount != 0) {