Version Description
Download this release
Release Info
Developer | smackcoders |
Plugin | Ultimate CSV Importer |
Version | 3.8.2 |
Comparing to | |
See all releases |
Code changes from version 3.8.1 to 3.8.2
- Readme.txt +25 -12
- includes/WPImporter_includes_helper.php +62 -12
- index.php +11 -2
- js/dashchart.js +2 -1
- js/ultimate-importer-free.js +34 -3
- modules/custompost/templates/index.php +7 -2
- modules/eshop/actions/actions.php +42 -11
- modules/eshop/templates/index.php +7 -2
- modules/page/templates/index.php +5 -1
- modules/post/templates/index.php +5 -1
- modules/settings/templates/index.php +10 -10
- templates/Addcustomfields.php +18 -0
- templates/import.php +3 -6
Readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== Import CSV with Ultimate CSV Importer ===
|
2 |
Contributors: smackcoders
|
3 |
Donate link: http://www.smackcoders.com/donate.html
|
4 |
-
Tags:
|
5 |
-
Requires at least: 4.
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 3.8.
|
8 |
-
Version: 3.8.
|
9 |
Author: smackcoders
|
10 |
Author URI: http://profiles.wordpress.org/smackcoders/
|
11 |
|
@@ -53,10 +53,14 @@ It is more easy to import csv database maintained in Excel xls or spread sheets
|
|
53 |
Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best WordPress themes available online. Now manage multi site & buddy press, Amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
|
54 |
|
55 |
= Helpful Links =
|
56 |
-
|
|
|
|
|
57 |
[Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
|
58 |
-
|
59 |
-
|
|
|
|
|
60 |
|
61 |
|
62 |
= Video Walkthrough =
|
@@ -203,11 +207,17 @@ This will solve your issue or get support from hosting if you dint have sufficie
|
|
203 |
|
204 |
== Changelog ==
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
|
207 |
= 3.8.1 =
|
208 |
-
*
|
209 |
-
* Fixed : Fixed all
|
210 |
-
* Fixed : XSS vulnerability
|
211 |
* Fixed : Removed the ../../../../../../wp-load.php and used the wordpress ajax call.
|
212 |
* Fixed : Removed the wp-content that are directly used in some files.
|
213 |
* Added : Checked the ABSPATH in each file.
|
@@ -471,8 +481,11 @@ This will solve your issue or get support from hosting if you dint have sufficie
|
|
471 |
|
472 |
== Upgrade Notice ==
|
473 |
|
|
|
|
|
|
|
474 |
= 3.8.1 =
|
475 |
-
*
|
476 |
|
477 |
= 3.8 =
|
478 |
* Upgrade now for Multi language support and bug fixes
|
1 |
=== Import CSV with Ultimate CSV Importer ===
|
2 |
Contributors: smackcoders
|
3 |
Donate link: http://www.smackcoders.com/donate.html
|
4 |
+
Tags: admin, administration, author, automatic, blog, categories, category, cms, contact, content, custom, custom post, dashboard, database, e-commerce, ecommerce, edit, event, events, feed, Formatting, free, gallery, image, images, import, integration, language, link, links, list, marketing, media, menu, meta, mobile, multisite, navigation, News, page, pages, performance, photo, photos, picture, pictures, plugin, plugins, Post, posts, profile, registration, rss, seo, Share, sharing, shop, shortcode, shortcodes, statistics, stats, store, tag, tags, Taxonomy, template, text, thumbnail, thumbnails, title, upload, url, user, users, video, woocommerce, wordpress, wpmu, xml, youtube,
|
5 |
+
Requires at least: 4.2
|
6 |
+
Tested up to: 4.3.1
|
7 |
+
Stable tag: 3.8.2
|
8 |
+
Version: 3.8.2
|
9 |
Author: smackcoders
|
10 |
Author URI: http://profiles.wordpress.org/smackcoders/
|
11 |
|
53 |
Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best WordPress themes available online. Now manage multi site & buddy press, Amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
|
54 |
|
55 |
= Helpful Links =
|
56 |
+
|
57 |
+
[Get More Details Here>>](https://www.smackcoders.com/wp-ultimate-csv-importer-pro.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
|
58 |
+
|
59 |
[Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
|
60 |
+
|
61 |
+
[Get Started Sample CSV Files](https://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
|
62 |
+
|
63 |
+
[Documentation and Tutorial for CSV Importer ](https://www.smackcoders.com/documentation/ultimate-csv-importer-pro?utm_source=WpOrg&utm_medium=Readme&utm_campaign=ListingTraffic)
|
64 |
|
65 |
|
66 |
= Video Walkthrough =
|
207 |
|
208 |
== Changelog ==
|
209 |
|
210 |
+
= 3.8.2 =
|
211 |
+
* Fixed : Wordpress 4.3.1 compatibility added.
|
212 |
+
* Fixed : Dashboard entry issue fix.
|
213 |
+
* Fixed : Featured image filename with empty space import issue fix.
|
214 |
+
* Fixed : Duplicate featured images on import fixed.
|
215 |
+
* Fixed : Core custom Field mapping group added
|
216 |
|
217 |
= 3.8.1 =
|
218 |
+
* Fixed : WordPress 4.2.3 and 4.2.4 compatibility checked.
|
219 |
+
* Fixed : Fixed the unwanted warnings in all files.
|
220 |
+
* Fixed : XSS vulnerability.
|
221 |
* Fixed : Removed the ../../../../../../wp-load.php and used the wordpress ajax call.
|
222 |
* Fixed : Removed the wp-content that are directly used in some files.
|
223 |
* Added : Checked the ABSPATH in each file.
|
481 |
|
482 |
== Upgrade Notice ==
|
483 |
|
484 |
+
= 3.8.2 =
|
485 |
+
* Upgrade now for more improvements.
|
486 |
+
|
487 |
= 3.8.1 =
|
488 |
+
* Upgrade now for ABSPATH used in all files and also fixed all the warnings,bugs.
|
489 |
|
490 |
= 3.8 =
|
491 |
* Upgrade now for Multi language support and bug fixes
|
includes/WPImporter_includes_helper.php
CHANGED
@@ -364,6 +364,7 @@ class WPImporter_includes_helper {
|
|
364 |
* @param string $logObj
|
365 |
*/
|
366 |
public static function get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit = null, $logObj = ""){
|
|
|
367 |
if($fimg_path!="" && $fimg_path){
|
368 |
$fimg_path = $fimg_path . "/" . $fimg_name;
|
369 |
}
|
@@ -409,8 +410,17 @@ class WPImporter_includes_helper {
|
|
409 |
$seo_custom_array= array();
|
410 |
$imported_feature_img = array();
|
411 |
$headr_count = $ret_array['h2'];
|
412 |
-
for ($i = 0; $i < count($data_rows); $i++) {
|
413 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
if($ret_array ['mapping' . $i] != '-- Select --'){
|
415 |
if ($ret_array ['mapping' . $i] != 'add_custom' . $i) {
|
416 |
$strip_CF = strpos($ret_array['mapping' . $i], 'CF: ');
|
@@ -433,6 +443,17 @@ class WPImporter_includes_helper {
|
|
433 |
}
|
434 |
}
|
435 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
for ($inc = 0; $inc < count($data_rows); $inc++) {
|
437 |
foreach ($this->keys as $k => $v) {
|
438 |
if (array_key_exists($v, $new_post)) {
|
@@ -501,29 +522,31 @@ class WPImporter_includes_helper {
|
|
501 |
|
502 |
$fimg_name = @basename($f_img);
|
503 |
$featured_image = $fimg_name;
|
504 |
-
$fimg_name = preg_replace('/\.[^.]*$/', '', $fimg_name);
|
505 |
$fimg_name = strtolower(str_replace(' ','-',$fimg_name));
|
|
|
506 |
$fimg_name = urlencode($fimg_name);
|
507 |
|
508 |
$parseURL = parse_url($f_img);
|
509 |
$path_parts = pathinfo($f_img);
|
510 |
if(!isset($path_parts['extension']))
|
511 |
$fimg_name = $fimg_name . '.jpg';
|
|
|
|
|
|
|
512 |
$f_img_slug = '';
|
513 |
-
$f_img_slug = preg_replace('/\.[^.]*$/', '',$f_img_slug);
|
514 |
$f_img_slug = strtolower(str_replace('','-',$f_img_slug));
|
|
|
515 |
|
516 |
$post_slug_value = strtolower($f_img_slug);
|
517 |
if(array_key_exists('extension',$path_parts)){
|
518 |
-
|
519 |
-
$fimg_name = $fimg_name.'.'.$path_parts['extension'];
|
520 |
}
|
521 |
$this->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this);
|
522 |
$filepath = $fimg_path ."/" . $fimg_name;
|
523 |
|
524 |
if(@getimagesize($filepath)){
|
525 |
$img = wp_get_image_editor($filepath);
|
526 |
-
if (!is_wp_error($img)) {
|
527 |
$sizes_array = array(
|
528 |
// #1 - resizes to 1024x768 pixel, square-cropped image
|
529 |
array('width' => 1024, 'height' => 768, 'crop' => true),
|
@@ -535,8 +558,8 @@ class WPImporter_includes_helper {
|
|
535 |
array('width' => 624, 'height' => 468, 'crop' => false)
|
536 |
);
|
537 |
$resize = $img->multi_resize($sizes_array);
|
538 |
-
}
|
539 |
-
$file ['guid'] = $baseurl."/".$
|
540 |
$file ['post_title'] = $fimg_name;
|
541 |
$file ['post_content'] = '';
|
542 |
$file ['post_status'] = 'attachment';
|
@@ -849,7 +872,7 @@ class WPImporter_includes_helper {
|
|
849 |
$attachment = array(
|
850 |
'guid' => $file ['guid'],
|
851 |
'post_mime_type' => 'image/jpeg',
|
852 |
-
'post_title' => preg_replace('
|
853 |
'post_content' => '',
|
854 |
'post_status' => 'inherit'
|
855 |
);
|
@@ -859,9 +882,24 @@ class WPImporter_includes_helper {
|
|
859 |
$generate_attachment = $fimg_name;
|
860 |
}
|
861 |
$uploadedImage = $wp_upload_dir['path'] . '/' . $fimg_name;
|
862 |
-
|
863 |
$attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
|
864 |
-
wp_update_attachment_metadata($attach_id, $attach_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
865 |
set_post_thumbnail($post_id, $attach_id);
|
866 |
}
|
867 |
}
|
@@ -1168,6 +1206,18 @@ class WPImporter_includes_helper {
|
|
1168 |
$convert_str = substr($convert_str,0,4) . '..';
|
1169 |
return $convert_str;
|
1170 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1171 |
}
|
1172 |
|
1173 |
class CallWPImporterObj extends WPImporter_includes_helper
|
364 |
* @param string $logObj
|
365 |
*/
|
366 |
public static function get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit = null, $logObj = ""){
|
367 |
+
$f_img = str_replace( " ","%20", $f_img );
|
368 |
if($fimg_path!="" && $fimg_path){
|
369 |
$fimg_path = $fimg_path . "/" . $fimg_name;
|
370 |
}
|
410 |
$seo_custom_array= array();
|
411 |
$imported_feature_img = array();
|
412 |
$headr_count = $ret_array['h2'];
|
413 |
+
//for ($i = 0; $i < count($data_rows); $i++) {
|
414 |
+
for ($i = 0; $i <= $ret_array['basic_count']; $i++) {
|
415 |
+
if(array_key_exists('coremapping' . $i,$ret_array)){
|
416 |
+
if($ret_array['coretextbox' . $i] != '-- Select --' && $ret_array['coremapping'.$i] != ''){
|
417 |
+
$mappedindex = str_replace('textbox','',$ret_array['coretextbox'.$i]);
|
418 |
+
$new_post[$ret_array['coremapping'.$i]] = $data_rows[$mappedindex];
|
419 |
+
$custom_array[$ret_array['coremapping'.$i]] = $data_rows[$mappedindex];
|
420 |
+
}
|
421 |
+
}
|
422 |
+
|
423 |
+
else if (array_key_exists('mapping' . $i, $ret_array)) {
|
424 |
if($ret_array ['mapping' . $i] != '-- Select --'){
|
425 |
if ($ret_array ['mapping' . $i] != 'add_custom' . $i) {
|
426 |
$strip_CF = strpos($ret_array['mapping' . $i], 'CF: ');
|
443 |
}
|
444 |
}
|
445 |
}
|
446 |
+
/* for($j = 0; $j< $ret_array['corecustomcount'];j++){
|
447 |
+
if(array_key_exists('coremapping' . $i,$ret_array)){
|
448 |
+
echo '<pre>';print_r($ret_array['coretextbox' . $i]);echo '</pre>';
|
449 |
+
if($ret_array['coretextbox' . $i] != '-- Select --'){
|
450 |
+
$mappedindex = str_replace('textbox','',$ret_array['coretextbox'.$i]);
|
451 |
+
echo '<pre>';print_r($mappedindex);echo '</pre>';die;
|
452 |
+
//$new_post[$ret_array['coretextbox'.$i]] = $data_rows[];
|
453 |
+
//$custom_array[$ret_array['coremapping'.$i]] = $data_rows[$i];
|
454 |
+
}
|
455 |
+
}
|
456 |
+
}*/
|
457 |
for ($inc = 0; $inc < count($data_rows); $inc++) {
|
458 |
foreach ($this->keys as $k => $v) {
|
459 |
if (array_key_exists($v, $new_post)) {
|
522 |
|
523 |
$fimg_name = @basename($f_img);
|
524 |
$featured_image = $fimg_name;
|
|
|
525 |
$fimg_name = strtolower(str_replace(' ','-',$fimg_name));
|
526 |
+
$fimg_name = preg_replace('/[^a-zA-Z0-9._\s]/', '', $fimg_name);
|
527 |
$fimg_name = urlencode($fimg_name);
|
528 |
|
529 |
$parseURL = parse_url($f_img);
|
530 |
$path_parts = pathinfo($f_img);
|
531 |
if(!isset($path_parts['extension']))
|
532 |
$fimg_name = $fimg_name . '.jpg';
|
533 |
+
//else
|
534 |
+
// $fimg_name = $fimg_name.'.'.$path_parts['extension'];
|
535 |
+
|
536 |
$f_img_slug = '';
|
|
|
537 |
$f_img_slug = strtolower(str_replace('','-',$f_img_slug));
|
538 |
+
$f_img_slug = preg_replace('/[^a-zA-Z0-9._\s]/', '',$f_img_slug);
|
539 |
|
540 |
$post_slug_value = strtolower($f_img_slug);
|
541 |
if(array_key_exists('extension',$path_parts)){
|
542 |
+
//$fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']);
|
|
|
543 |
}
|
544 |
$this->get_fimg_from_URL($f_img, $fimg_path, $fimg_name, $post_slug_value, $currentLimit, $this);
|
545 |
$filepath = $fimg_path ."/" . $fimg_name;
|
546 |
|
547 |
if(@getimagesize($filepath)){
|
548 |
$img = wp_get_image_editor($filepath);
|
549 |
+
/*if (!is_wp_error($img)) {
|
550 |
$sizes_array = array(
|
551 |
// #1 - resizes to 1024x768 pixel, square-cropped image
|
552 |
array('width' => 1024, 'height' => 768, 'crop' => true),
|
558 |
array('width' => 624, 'height' => 468, 'crop' => false)
|
559 |
);
|
560 |
$resize = $img->multi_resize($sizes_array);
|
561 |
+
}*/
|
562 |
+
$file ['guid'] = $baseurl."/".$fimg_name;
|
563 |
$file ['post_title'] = $fimg_name;
|
564 |
$file ['post_content'] = '';
|
565 |
$file ['post_status'] = 'attachment';
|
872 |
$attachment = array(
|
873 |
'guid' => $file ['guid'],
|
874 |
'post_mime_type' => 'image/jpeg',
|
875 |
+
'post_title' => preg_replace('/[^a-zA-Z0-9._\s]/', '', @basename($file ['guid'])),
|
876 |
'post_content' => '',
|
877 |
'post_status' => 'inherit'
|
878 |
);
|
882 |
$generate_attachment = $fimg_name;
|
883 |
}
|
884 |
$uploadedImage = $wp_upload_dir['path'] . '/' . $fimg_name;
|
885 |
+
/*$attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
|
886 |
$attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
|
887 |
+
wp_update_attachment_metadata($attach_id, $attach_data);*/
|
888 |
+
$existing_attachment = array();
|
889 |
+
$query = $wpdb->get_results("select post_title from $wpdb->posts where post_type = 'attachment' and post_mime_type = 'image/jpeg'");
|
890 |
+
foreach($query as $key){
|
891 |
+
$existing_attachment[] = $key->post_title;
|
892 |
+
}
|
893 |
+
if(!in_array($fimg_name ,$existing_attachment)){
|
894 |
+
$attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
|
895 |
+
$attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
|
896 |
+
wp_update_attachment_metadata($attach_id, $attach_data);
|
897 |
+
}else{
|
898 |
+
$query2 = $wpdb->get_results("select ID from $wpdb->posts where post_title = '$fimg_name' and post_type = 'attachment'");
|
899 |
+
foreach($query2 as $key2){
|
900 |
+
$attach_id = $key2->ID;
|
901 |
+
}
|
902 |
+
}
|
903 |
set_post_thumbnail($post_id, $attach_id);
|
904 |
}
|
905 |
}
|
1206 |
$convert_str = substr($convert_str,0,4) . '..';
|
1207 |
return $convert_str;
|
1208 |
}
|
1209 |
+
function customfieldui($count){
|
1210 |
+
$result = "<div style='background-color: #E5E4E2; border: 1px solid #d6e9c6;padding: 10px; width:100%;'>
|
1211 |
+
<div id = 'custfield_core'><b>New Custom Fields</b>
|
1212 |
+
</div>
|
1213 |
+
</div>";
|
1214 |
+
$result .= "<table style='font-size: 12px;' class = 'table table-striped' id='CORECUST'><tr>
|
1215 |
+
<td class='left_align columnheader'><b>CUSTOM FIELD</b></td>
|
1216 |
+
<td class='columnheader'><b>CSV HEADER</b></td><td></td><td></td></tr></table>
|
1217 |
+
<input type='button' class='btn btn-primary' name='addcustomfd' value='Add Custom Field' style='margin-left:20px;margin-bottom:15px;margin-top:20px;' onclick = 'addcorecustomfield(CORECUST,".$count.");'>";
|
1218 |
+
return $result;
|
1219 |
+
|
1220 |
+
}
|
1221 |
}
|
1222 |
|
1223 |
class CallWPImporterObj extends WPImporter_includes_helper
|
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.8.
|
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
|
@@ -77,7 +77,7 @@ define('WP_CONST_ULTIMATE_CSV_IMP_URL', 'http://www.smackcoders.com/wp-ultimate-
|
|
77 |
define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
|
78 |
define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
|
79 |
define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
|
80 |
-
define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.8.
|
81 |
define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
|
82 |
define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
|
83 |
define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
|
@@ -301,4 +301,13 @@ function export_submit(){
|
|
301 |
}
|
302 |
add_action('wp_ajax_export_file','export_submit');
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
|
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.8.2
|
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
|
77 |
define('WP_CONST_ULTIMATE_CSV_IMP_NAME', 'WP Ultimate CSV Importer');
|
78 |
define('WP_CONST_ULTIMATE_CSV_IMP_SLUG', 'wp-ultimate-csv-importer');
|
79 |
define('WP_CONST_ULTIMATE_CSV_IMP_SETTINGS', 'WP Ultimate CSV Importer');
|
80 |
+
define('WP_CONST_ULTIMATE_CSV_IMP_VERSION', '3.8.2');
|
81 |
define('WP_CONST_ULTIMATE_CSV_IMP_DIR', WP_PLUGIN_URL . '/' . WP_CONST_ULTIMATE_CSV_IMP_SLUG . '/');
|
82 |
define('WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY', plugin_dir_path(__FILE__));
|
83 |
define('WP_CSVIMP_PLUGIN_BASE', WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY);
|
301 |
}
|
302 |
add_action('wp_ajax_export_file','export_submit');
|
303 |
|
304 |
+
/**
|
305 |
+
*
|
306 |
+
*/
|
307 |
+
function addcorecustomfd(){
|
308 |
+
require_once("templates/Addcustomfields.php");
|
309 |
+
die;
|
310 |
+
}
|
311 |
+
|
312 |
+
add_action('wp_ajax_addcorecustomfd','addcorecustomfd');
|
313 |
|
js/dashchart.js
CHANGED
@@ -72,7 +72,8 @@ jQuery.ajax({
|
|
72 |
cache: false,
|
73 |
success: function(data) {
|
74 |
var val = JSON.parse(data);
|
75 |
-
|
|
|
76 |
jQuery('#lineStats').highcharts({
|
77 |
title: {
|
78 |
text: '',
|
72 |
cache: false,
|
73 |
success: function(data) {
|
74 |
var val = JSON.parse(data);
|
75 |
+
// Removed the val[2] for comments (smackcoders)
|
76 |
+
var line = [val[0],val[1],val[3],val[4],val[5]];
|
77 |
jQuery('#lineStats').highcharts({
|
78 |
title: {
|
79 |
text: '',
|
js/ultimate-importer-free.js
CHANGED
@@ -663,13 +663,14 @@ function importRecordsbySettings(siteurl)
|
|
663 |
}
|
664 |
if(parseInt(tmpCnt) < parseInt(tot_no_of_records)){
|
665 |
var terminate_action = document.getElementById('terminateaction').value;
|
666 |
-
if(terminate_action == 'continue'){
|
667 |
currentlimit = parseInt(currentlimit)+parseInt(importlimit);
|
668 |
document.getElementById('currentlimit').value = currentlimit;
|
669 |
console.log('impLmt: '+importlimit+'totRecds: '+tot_no_of_records);
|
670 |
document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
|
|
|
671 |
setTimeout(function(){importRecordsbySettings()},0);
|
672 |
} else {
|
|
|
673 |
document.getElementById('log').innerHTML += "<p style='margin-left:10px;color:red;'>"+translateAlertString('Import process has been terminated.')+"</p>";
|
674 |
document.getElementById('ajaxloader').style.display="none";
|
675 |
document.getElementById('startbutton').style.display = "none";
|
@@ -938,6 +939,36 @@ function export_check(value) {
|
|
938 |
jQuery('#ShowMsg').delay(7000).fadeOut();
|
939 |
}
|
940 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
function choose_import_method(id) {
|
942 |
if(id == 'uploadfilefromcomputer') {
|
943 |
document.getElementById('boxmethod1').style.border = "1px solid #ccc";
|
@@ -963,7 +994,7 @@ function selectModules(id) {
|
|
963 |
document.getElementById('post').checked = true;
|
964 |
document.getElementById('page').checked = true;
|
965 |
document.getElementById('users').checked = true;
|
966 |
-
document.getElementById('comments').checked = true;
|
967 |
document.getElementById('custompost').checked = true;
|
968 |
|
969 |
jQuery('#postlabel').removeClass("disablesetting");
|
@@ -993,7 +1024,7 @@ function selectModules(id) {
|
|
993 |
document.getElementById('post').checked = false;
|
994 |
document.getElementById('page').checked = false;
|
995 |
document.getElementById('users').checked = false;
|
996 |
-
document.getElementById('comments').checked = false;
|
997 |
document.getElementById('custompost').checked = false;
|
998 |
|
999 |
jQuery('#nopostlabel').removeClass("disablesetting");
|
663 |
}
|
664 |
if(parseInt(tmpCnt) < parseInt(tot_no_of_records)){
|
665 |
var terminate_action = document.getElementById('terminateaction').value;
|
|
|
666 |
currentlimit = parseInt(currentlimit)+parseInt(importlimit);
|
667 |
document.getElementById('currentlimit').value = currentlimit;
|
668 |
console.log('impLmt: '+importlimit+'totRecds: '+tot_no_of_records);
|
669 |
document.getElementById('tmpcount').value = parseInt(tmpCnt)+parseInt(importlimit);
|
670 |
+
if(terminate_action == 'continue'){
|
671 |
setTimeout(function(){importRecordsbySettings()},0);
|
672 |
} else {
|
673 |
+
document.getElementById('log').innerHTML += data+'<br/>';
|
674 |
document.getElementById('log').innerHTML += "<p style='margin-left:10px;color:red;'>"+translateAlertString('Import process has been terminated.')+"</p>";
|
675 |
document.getElementById('ajaxloader').style.display="none";
|
676 |
document.getElementById('startbutton').style.display = "none";
|
939 |
jQuery('#ShowMsg').delay(7000).fadeOut();
|
940 |
}
|
941 |
}
|
942 |
+
|
943 |
+
function addcorecustomfield(id,countold,csvheader){
|
944 |
+
var table_id = id;
|
945 |
+
var newrow = table_id.insertRow(-1);
|
946 |
+
var count = document.getElementById('basic_count').value;
|
947 |
+
count = parseInt(count)+1;
|
948 |
+
newrow.id = 'custrow'+count;
|
949 |
+
var filename = document.getElementById('uploadedFile').value;
|
950 |
+
var row_count = document.getElementById('corecustomcount').value;
|
951 |
+
jQuery.ajax({
|
952 |
+
url: ajaxurl,
|
953 |
+
type: 'post',
|
954 |
+
//dataType: 'json',
|
955 |
+
data: {
|
956 |
+
'headerdata' : csvheader,
|
957 |
+
'filename' : filename,
|
958 |
+
'corecount' : count,
|
959 |
+
'action' : 'addcorecustomfd',
|
960 |
+
},
|
961 |
+
success: function (response) {
|
962 |
+
newrow.innerHTML = response;
|
963 |
+
row_count = parseInt(row_count) + 1;
|
964 |
+
document.getElementById('corecustomcount').value = row_count;
|
965 |
+
document.getElementById('basic_count').value = count;
|
966 |
+
}
|
967 |
+
});
|
968 |
+
|
969 |
+
}
|
970 |
+
|
971 |
+
|
972 |
function choose_import_method(id) {
|
973 |
if(id == 'uploadfilefromcomputer') {
|
974 |
document.getElementById('boxmethod1').style.border = "1px solid #ccc";
|
994 |
document.getElementById('post').checked = true;
|
995 |
document.getElementById('page').checked = true;
|
996 |
document.getElementById('users').checked = true;
|
997 |
+
//document.getElementById('comments').checked = true;
|
998 |
document.getElementById('custompost').checked = true;
|
999 |
|
1000 |
jQuery('#postlabel').removeClass("disablesetting");
|
1024 |
document.getElementById('post').checked = false;
|
1025 |
document.getElementById('page').checked = false;
|
1026 |
document.getElementById('users').checked = false;
|
1027 |
+
//document.getElementById('comments').checked = false;
|
1028 |
document.getElementById('custompost').checked = false;
|
1029 |
|
1030 |
jQuery('#nopostlabel').removeClass("disablesetting");
|
modules/custompost/templates/index.php
CHANGED
@@ -449,7 +449,7 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
449 |
}
|
450 |
}
|
451 |
?>
|
452 |
-
|
453 |
</select>
|
454 |
<script type="text/javascript">
|
455 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
@@ -493,6 +493,11 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
493 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
494 |
?>
|
495 |
</table>
|
|
|
|
|
|
|
|
|
|
|
496 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php if(isset($mFieldsArr)) { print_r($mFieldsArr); } ?>"/>
|
497 |
<div>
|
498 |
<div class="goto_import_options" align=center>
|
@@ -585,7 +590,7 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
585 |
<label id="importalign"><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> <?php echo __('Detect duplicate post content',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
586 |
<input type='hidden' name='wpnoncekey' id='wpnoncekey' value='<?php echo $nonce_Key; ?>' />
|
587 |
<label id="importalign"><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > <?php echo __('Detect duplicate post title',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
588 |
-
<label id="importalign"><?php __('No. of posts/rows per server request',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <span class="mandatory" style="margin-left:-13px;margin-right:10px">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
|
589 |
<span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo __('You can set upto',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
|
590 |
<input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
|
591 |
<input type="hidden" id="tmpcount" name="tmpcount" value="0" />
|
449 |
}
|
450 |
}
|
451 |
?>
|
452 |
+
<!--<option value="add_custom<?php //print($count); ?>"><?php //echo __('Add Custom Field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></option>-->
|
453 |
</select>
|
454 |
<script type="text/javascript">
|
455 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
493 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
494 |
?>
|
495 |
</table>
|
496 |
+
<?php $basic_count = $count - 1; ?>
|
497 |
+
<input type="hidden" id="basic_count" name="basic_count" value="<?php echo $basic_count; ?>" />
|
498 |
+
<input type="hidden" id="corecustomcount" name="corecustomcount" value=0 />
|
499 |
+
<?php echo $impCE->customfieldui($count);?>
|
500 |
+
|
501 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php if(isset($mFieldsArr)) { print_r($mFieldsArr); } ?>"/>
|
502 |
<div>
|
503 |
<div class="goto_import_options" align=center>
|
590 |
<label id="importalign"><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> <?php echo __('Detect duplicate post content',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
591 |
<input type='hidden' name='wpnoncekey' id='wpnoncekey' value='<?php echo $nonce_Key; ?>' />
|
592 |
<label id="importalign"><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > <?php echo __('Detect duplicate post title',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
593 |
+
<label id="importalign"><?php echo __('No. of posts/rows per server request',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <span class="mandatory" style="margin-left:-13px;margin-right:10px">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
|
594 |
<span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo __('You can set upto',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> per request.</span>
|
595 |
<input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
|
596 |
<input type="hidden" id="tmpcount" name="tmpcount" value="0" />
|
modules/eshop/actions/actions.php
CHANGED
@@ -317,11 +317,22 @@ class EshopActions extends SkinnyActions {
|
|
317 |
$new_post = array();
|
318 |
$smack_taxo = array();
|
319 |
$custom_array = array();
|
|
|
320 |
$seo_custom_array= array();
|
321 |
$imported_feature_img = array();
|
322 |
$headr_count = $ret_array['h2'];
|
323 |
-
for ($i = 0; $i < count($data_rows); $i++) {
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
if($ret_array ['mapping' . $i] != '-- Select --'){
|
326 |
if ($ret_array ['mapping' . $i] != 'add_custom' . $i) {
|
327 |
$strip_CF = strpos($ret_array['mapping' . $i], 'CF: ');
|
@@ -411,7 +422,7 @@ class EshopActions extends SkinnyActions {
|
|
411 |
$fimg_path = $full_path;
|
412 |
|
413 |
$fimg_name = @basename($f_img);
|
414 |
-
$fimg_name = preg_replace('
|
415 |
$fimg_name = strtolower(str_replace(' ','-',$fimg_name));
|
416 |
|
417 |
$fimg_name = urlencode($fimg_name);
|
@@ -422,7 +433,7 @@ class EshopActions extends SkinnyActions {
|
|
422 |
$fimg_name = $fimg_name . '.jpg';
|
423 |
|
424 |
$f_img_slug = '';
|
425 |
-
$f_img_slug = preg_replace('
|
426 |
$f_img_slug = strtolower(str_replace('','-',$f_img_slug));
|
427 |
|
428 |
|
@@ -430,14 +441,14 @@ class EshopActions extends SkinnyActions {
|
|
430 |
require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
|
431 |
$impCE = new WPImporter_includes_helper();
|
432 |
$path_parts['extension'] = isset($path_parts['extension']) ? $path_parts['extension'] : '';
|
433 |
-
|
434 |
-
|
435 |
$impCE->get_fimg_from_URL($f_img,$fimg_path,$fimg_name,$post_slug_value,$currentLimit,$this);
|
436 |
$filepath = $fimg_path."/" . $fimg_name;
|
437 |
|
438 |
if(@getimagesize($filepath)){
|
439 |
$img = wp_get_image_editor($filepath);
|
440 |
-
|
441 |
$sizes_array = array(
|
442 |
// #1 - resizes to 1024x768 pixel, square-cropped image
|
443 |
array('width' => 1024, 'height' => 768, 'crop' => true),
|
@@ -449,7 +460,7 @@ class EshopActions extends SkinnyActions {
|
|
449 |
array('width' => 624, 'height' => 468, 'crop' => false)
|
450 |
);
|
451 |
$resize = $img->multi_resize($sizes_array);
|
452 |
-
}
|
453 |
$file ['guid'] = $baseurl."/".$fimg_name;
|
454 |
$file ['post_title'] = $fimg_name;
|
455 |
$file ['post_content'] = '';
|
@@ -611,6 +622,11 @@ class EshopActions extends SkinnyActions {
|
|
611 |
|
612 |
unset($postauthor);
|
613 |
if ($post_id) {
|
|
|
|
|
|
|
|
|
|
|
614 |
$custom_array = $this->eshopMetaData($new_post, $post_id, $currentLimit);
|
615 |
$uploaded_file_name=$session_arr['uploadedFile'];
|
616 |
$real_file_name = $session_arr['uploaded_csv_name'];
|
@@ -695,7 +711,7 @@ class EshopActions extends SkinnyActions {
|
|
695 |
$attachment = array(
|
696 |
'guid' => $file ['guid'],
|
697 |
'post_mime_type' => 'image/jpeg',
|
698 |
-
'post_title' => preg_replace('
|
699 |
'post_content' => '',
|
700 |
'post_status' => 'inherit'
|
701 |
);
|
@@ -705,9 +721,24 @@ class EshopActions extends SkinnyActions {
|
|
705 |
$generate_attachment = $fimg_name;
|
706 |
}
|
707 |
$uploadedImage = $wp_upload_dir['path'] . '/' . $fimg_name;
|
708 |
-
|
709 |
$attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
|
710 |
-
wp_update_attachment_metadata($attach_id, $attach_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
711 |
set_post_thumbnail($post_id, $attach_id);
|
712 |
}
|
713 |
}
|
317 |
$new_post = array();
|
318 |
$smack_taxo = array();
|
319 |
$custom_array = array();
|
320 |
+
$corecustom_arr = array();
|
321 |
$seo_custom_array= array();
|
322 |
$imported_feature_img = array();
|
323 |
$headr_count = $ret_array['h2'];
|
324 |
+
//for ($i = 0; $i < count($data_rows); $i++) {
|
325 |
+
for ($i = 0; $i <= $ret_array['basic_count']; $i++) {
|
326 |
+
if(array_key_exists('coremapping' . $i,$ret_array)){
|
327 |
+
if($ret_array['coretextbox' . $i] != '-- Select --' && $ret_array['coremapping'.$i] != ''){
|
328 |
+
$mappedindex = str_replace('textbox','',$ret_array['coretextbox'.$i]);
|
329 |
+
$new_post[$ret_array['coremapping'.$i]] = $data_rows[$mappedindex];
|
330 |
+
$custom_array[$ret_array['coremapping'.$i]] = $data_rows[$mappedindex];
|
331 |
+
$corecustom_arr[$ret_array['coremapping'.$i]] = $data_rows[$mappedindex];
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
else if (array_key_exists('mapping' . $i, $ret_array)) {
|
336 |
if($ret_array ['mapping' . $i] != '-- Select --'){
|
337 |
if ($ret_array ['mapping' . $i] != 'add_custom' . $i) {
|
338 |
$strip_CF = strpos($ret_array['mapping' . $i], 'CF: ');
|
422 |
$fimg_path = $full_path;
|
423 |
|
424 |
$fimg_name = @basename($f_img);
|
425 |
+
$fimg_name = preg_replace('/[^a-zA-Z0-9._\s]/', '', $fimg_name);
|
426 |
$fimg_name = strtolower(str_replace(' ','-',$fimg_name));
|
427 |
|
428 |
$fimg_name = urlencode($fimg_name);
|
433 |
$fimg_name = $fimg_name . '.jpg';
|
434 |
|
435 |
$f_img_slug = '';
|
436 |
+
$f_img_slug = preg_replace('/[^a-zA-Z0-9._\s]/', '',$f_img_slug);
|
437 |
$f_img_slug = strtolower(str_replace('','-',$f_img_slug));
|
438 |
|
439 |
|
441 |
require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'/includes/WPImporter_includes_helper.php');
|
442 |
$impCE = new WPImporter_includes_helper();
|
443 |
$path_parts['extension'] = isset($path_parts['extension']) ? $path_parts['extension'] : '';
|
444 |
+
//$fimg_name = wp_unique_filename($fimg_path, $fimg_name, $path_parts['extension']);
|
445 |
+
//$fimg_name = $fimg_name.'.'.$path_parts['extension'];
|
446 |
$impCE->get_fimg_from_URL($f_img,$fimg_path,$fimg_name,$post_slug_value,$currentLimit,$this);
|
447 |
$filepath = $fimg_path."/" . $fimg_name;
|
448 |
|
449 |
if(@getimagesize($filepath)){
|
450 |
$img = wp_get_image_editor($filepath);
|
451 |
+
/* if (!is_wp_error($img)) {
|
452 |
$sizes_array = array(
|
453 |
// #1 - resizes to 1024x768 pixel, square-cropped image
|
454 |
array('width' => 1024, 'height' => 768, 'crop' => true),
|
460 |
array('width' => 624, 'height' => 468, 'crop' => false)
|
461 |
);
|
462 |
$resize = $img->multi_resize($sizes_array);
|
463 |
+
}*/
|
464 |
$file ['guid'] = $baseurl."/".$fimg_name;
|
465 |
$file ['post_title'] = $fimg_name;
|
466 |
$file ['post_content'] = '';
|
622 |
|
623 |
unset($postauthor);
|
624 |
if ($post_id) {
|
625 |
+
if(!empty($corecustom_arr)){
|
626 |
+
foreach ($corecustom_arr as $corecustom_key => $corecustom_value) {
|
627 |
+
update_post_meta($post_id, $corecustom_key, $corecustom_value);
|
628 |
+
}
|
629 |
+
}
|
630 |
$custom_array = $this->eshopMetaData($new_post, $post_id, $currentLimit);
|
631 |
$uploaded_file_name=$session_arr['uploadedFile'];
|
632 |
$real_file_name = $session_arr['uploaded_csv_name'];
|
711 |
$attachment = array(
|
712 |
'guid' => $file ['guid'],
|
713 |
'post_mime_type' => 'image/jpeg',
|
714 |
+
'post_title' => preg_replace('/[^a-zA-Z0-9._\s]/', '', @basename($file ['guid'])),
|
715 |
'post_content' => '',
|
716 |
'post_status' => 'inherit'
|
717 |
);
|
721 |
$generate_attachment = $fimg_name;
|
722 |
}
|
723 |
$uploadedImage = $wp_upload_dir['path'] . '/' . $fimg_name;
|
724 |
+
/*$attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
|
725 |
$attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
|
726 |
+
wp_update_attachment_metadata($attach_id, $attach_data);*/
|
727 |
+
$existing_attachment = array();
|
728 |
+
$query = $wpdb->get_results("select post_title from $wpdb->posts where post_type = 'attachment' and post_mime_type = 'image/jpeg'");
|
729 |
+
foreach($query as $key){
|
730 |
+
$existing_attachment[] = $key->post_title;
|
731 |
+
}
|
732 |
+
if(!in_array($fimg_name ,$existing_attachment)){
|
733 |
+
$attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
|
734 |
+
$attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
|
735 |
+
wp_update_attachment_metadata($attach_id, $attach_data);
|
736 |
+
}else{
|
737 |
+
$query2 = $wpdb->get_results("select ID from $wpdb->posts where post_title = '$fimg_name' and post_type = 'attachment'");
|
738 |
+
foreach($query2 as $key2){
|
739 |
+
$attach_id = $key2->ID;
|
740 |
+
}
|
741 |
+
}
|
742 |
set_post_thumbnail($post_id, $attach_id);
|
743 |
}
|
744 |
}
|
modules/eshop/templates/index.php
CHANGED
@@ -433,7 +433,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
|
|
433 |
}
|
434 |
}
|
435 |
?>
|
436 |
-
|
437 |
</select>
|
438 |
<script type="text/javascript">
|
439 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
@@ -476,6 +476,11 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
|
|
476 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
477 |
?>
|
478 |
</table>
|
|
|
|
|
|
|
|
|
|
|
479 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php if(isset($mFieldsArr)) { print_r($mFieldsArr); } ?>"/>
|
480 |
<div>
|
481 |
<div class="goto_import_options" align=center>
|
@@ -569,7 +574,7 @@ if ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['isplugin_avail'] != 'not_avail'
|
|
569 |
<label id='importalign'><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> <?php echo __('Detect duplicate post content',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
570 |
<input type='hidden' name='wpnoncekey' id='wpnoncekey' value='<?php echo $nonce_Key; ?>' />
|
571 |
<label id='importalign'><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > <?php echo __('Detect duplicate post title',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
572 |
-
<label id='importalign'><?php __('No. of posts/rows per server request',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <span class="mandatory" style="margin-left:-13px;margin-right:10px">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
|
573 |
<span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo __('You can set upto',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> <?php echo __('per request.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span>
|
574 |
<input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
|
575 |
<input type="hidden" id="tmpcount" name="tmpcount" value="0" />
|
433 |
}
|
434 |
}
|
435 |
?>
|
436 |
+
<!--<option value="add_custom<?php //print($count); ?>"><?php //echo __('Add Custom Field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></option>-->
|
437 |
</select>
|
438 |
<script type="text/javascript">
|
439 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
476 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
477 |
?>
|
478 |
</table>
|
479 |
+
<?php $basic_count = $count - 1; ?>
|
480 |
+
<input type="hidden" id="basic_count" name="basic_count" value="<?php echo $basic_count; ?>" />
|
481 |
+
<input type="hidden" id="corecustomcount" name="corecustomcount" value=0 />
|
482 |
+
<?php echo $impCE->customfieldui($count);?>
|
483 |
+
|
484 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php if(isset($mFieldsArr)) { print_r($mFieldsArr); } ?>"/>
|
485 |
<div>
|
486 |
<div class="goto_import_options" align=center>
|
574 |
<label id='importalign'><input name='duplicatecontent' id='duplicatecontent' type="checkbox" value=""> <?php echo __('Detect duplicate post content',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
575 |
<input type='hidden' name='wpnoncekey' id='wpnoncekey' value='<?php echo $nonce_Key; ?>' />
|
576 |
<label id='importalign'><input name='duplicatetitle' id='duplicatetitle' type="checkbox" value="" > <?php echo __('Detect duplicate post title',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <br>
|
577 |
+
<label id='importalign'><?php echo __('No. of posts/rows per server request',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></label> <span class="mandatory" style="margin-left:-13px;margin-right:10px">*</span> <input name="importlimit" id="importlimit" type="text" value="1" placeholder="10" onblur="check_allnumeric(this.value);"></label> <?php echo $impCE->helpnotes(); ?><br>
|
578 |
<span class='msg' id='server_request_warning' style="display:none;color:red;margin-left:-10px;"><?php echo __('You can set upto',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?> <?php echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; ?> <?php echo __('per request.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></span>
|
579 |
<input type="hidden" id="currentlimit" name="currentlimit" value="0"/>
|
580 |
<input type="hidden" id="tmpcount" name="tmpcount" value="0" />
|
modules/page/templates/index.php
CHANGED
@@ -387,7 +387,7 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
387 |
}
|
388 |
}
|
389 |
?>
|
390 |
-
|
391 |
</select>
|
392 |
<script type="text/javascript">
|
393 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
@@ -431,6 +431,10 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
431 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
432 |
?>
|
433 |
</table>
|
|
|
|
|
|
|
|
|
434 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php print_r($mFieldsArr); ?>"/>
|
435 |
<div>
|
436 |
<div class="goto_import_options" align=center>
|
387 |
}
|
388 |
}
|
389 |
?>
|
390 |
+
<!--<option value="add_custom<?php //print($count); ?>"><?php //echo __('Add Custom Field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></option>-->
|
391 |
</select>
|
392 |
<script type="text/javascript">
|
393 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
431 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
432 |
?>
|
433 |
</table>
|
434 |
+
<?php $basic_count = $count - 1; ?>
|
435 |
+
<input type="hidden" id="basic_count" name="basic_count" value="<?php echo $basic_count; ?>" />
|
436 |
+
<input type="hidden" id="corecustomcount" name="corecustomcount" value=0 />
|
437 |
+
<?php echo $impCE->customfieldui($count);?>
|
438 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php print_r($mFieldsArr); ?>"/>
|
439 |
<div>
|
440 |
<div class="goto_import_options" align=center>
|
modules/post/templates/index.php
CHANGED
@@ -396,7 +396,7 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
396 |
}
|
397 |
}
|
398 |
?>
|
399 |
-
|
400 |
</select>
|
401 |
<script type="text/javascript">
|
402 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
@@ -439,6 +439,10 @@ $nonce_Key = $impCE->create_nonce_key();
|
|
439 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
440 |
?>
|
441 |
</table>
|
|
|
|
|
|
|
|
|
442 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php if(isset($mFieldsArr)) { print_r($mFieldsArr); } ?>"/>
|
443 |
<div>
|
444 |
<div class="goto_import_options" align=center>
|
396 |
}
|
397 |
}
|
398 |
?>
|
399 |
+
<!--<option value="add_custom<?php print($count); ?>"><?php echo __('Add Custom Field',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></option>-->
|
400 |
</select>
|
401 |
<script type="text/javascript">
|
402 |
jQuery("select#mapping<?php print($count); ?>").find('option').each(function() {
|
439 |
$mFieldsArr = substr($mFieldsArr, 0, -1);
|
440 |
?>
|
441 |
</table>
|
442 |
+
<?php $basic_count = $count - 1; ?>
|
443 |
+
<input type="hidden" id="basic_count" name="basic_count" value="<?php echo $basic_count; ?>" />
|
444 |
+
<input type="hidden" id="corecustomcount" name="corecustomcount" value=0 />
|
445 |
+
<?php echo $impCE->customfieldui($count);?>
|
446 |
<input type="hidden" id="mapping_fields_array" name="mapping_fields_array" value="<?php if(isset($mFieldsArr)) { print_r($mFieldsArr); } ?>"/>
|
447 |
<div>
|
448 |
<div class="goto_import_options" align=center>
|
modules/settings/templates/index.php
CHANGED
@@ -160,17 +160,17 @@ global $wpdb; ?>
|
|
160 |
<label id="userlabel" title = "<?php echo __('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['users']; ?>" ><input type='checkbox' name='users' id='users' style="display:none" value='users' <?php echo $skinnyData['users']; ?> onclick="usersetting(this.id);" ><?php echo $impCE->reduceStringLength(__('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Enable'); ?></label>
|
161 |
<label id="nouserlabel" title = "<?php echo __('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['nousers']; ?>" ><input type='checkbox' name='users' style="display:none" onclick="usersetting(this.id);" ><?php echo $impCE->reduceStringLength(__('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Disable'); ?></label>
|
162 |
</td></tr>
|
163 |
-
|
164 |
-
<h3 id="innertitle"><?php echo __('Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
|
165 |
-
<label><div><?php echo __('Enables to import posts with custompost and customfields.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div>
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
</td><td style="width:112px">
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
<h3 id="innertitle"><?php echo __('Custom Post',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
|
175 |
<label><div><?php echo __('Enables to import Customposts.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div>
|
176 |
<div><?php echo __('Enable to import custom posts with attributes from csv',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div></label></td><td>
|
160 |
<label id="userlabel" title = "<?php echo __('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['users']; ?>" ><input type='checkbox' name='users' id='users' style="display:none" value='users' <?php echo $skinnyData['users']; ?> onclick="usersetting(this.id);" ><?php echo $impCE->reduceStringLength(__('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Enable'); ?></label>
|
161 |
<label id="nouserlabel" title = "<?php echo __('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php echo $skinnyData['nousers']; ?>" ><input type='checkbox' name='users' style="display:none" onclick="usersetting(this.id);" ><?php echo $impCE->reduceStringLength(__('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Disable'); ?></label>
|
162 |
</td></tr>
|
163 |
+
<!--<tr><td>
|
164 |
+
<h3 id="innertitle"><?php //echo __('Comments',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
|
165 |
+
<label><div><?php //echo __('Enables to import posts with custompost and customfields.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div>
|
166 |
+
<div><?php //echo __('Enable to import comments for post ids from csv.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div>
|
167 |
+
</label>
|
168 |
+
</td><td>
|
169 |
</td><td style="width:112px">
|
170 |
+
<label id="commentslabel" title = "<?php //echo __('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php //echo $skinnyData['comments']; ?>"><input type='checkbox' name='comments' id='comments' style="display:none" value='comments' <?php //echo $skinnyData['comments']; ?> onclick="commentsetting(this.id);" ><?php //echo $impCE->reduceStringLength(__('Enable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Enable'); ?> </label>
|
171 |
+
<label id="nocommentslabel" title = "<?php //echo __('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?>" class="<?php //echo $skinnyData['nocomments']; ?>"><input type='checkbox' name='comments' style="display:none" onclick="commentsetting(this.id);" ><?php //echo $impCE->reduceStringLength(__('Disable',WP_CONST_ULTIMATE_CSV_IMP_SLUG),'Disable'); ?> </label>
|
172 |
+
</td></tr>-->
|
173 |
+
<tr><td>
|
174 |
<h3 id="innertitle"><?php echo __('Custom Post',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></h3>
|
175 |
<label><div><?php echo __('Enables to import Customposts.',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div>
|
176 |
<div><?php echo __('Enable to import custom posts with attributes from csv',WP_CONST_ULTIMATE_CSV_IMP_SLUG); ?></div></label></td><td>
|
templates/Addcustomfields.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) )
|
3 |
+
exit; // Exit if accessed directly
|
4 |
+
$filename = isset($_POST['filename']) ? $_POST['filename'] : '';
|
5 |
+
$count = isset($_POST['corecount']) ? $_POST['corecount'] : '';
|
6 |
+
$impobj = new WPImporter_includes_helper();
|
7 |
+
$getrec = $impobj->csv_file_data($filename);
|
8 |
+
$csvheaders = $impobj->headers;
|
9 |
+
$returndata = "<table><tr><td><input type='text' name='coremapping$count' id = 'coremapping$count'/></td>";
|
10 |
+
$returndata .= "<td class='left_align'> <select name='coretextbox$count' id='coretextbox$count' class='uiButton'>";
|
11 |
+
$returndata .= "<option id = 'select'>-- Select --</option>";
|
12 |
+
foreach($csvheaders as $headerkey => $headervalue){
|
13 |
+
$returndata .= "<option value = 'textbox$headerkey'>$headervalue</option>";
|
14 |
+
}
|
15 |
+
$returndata .= "</select></td>";
|
16 |
+
$returndata .= "<td></td><td></td></tr></table>";
|
17 |
+
print_r($returndata);die;
|
18 |
+
?>
|
templates/import.php
CHANGED
@@ -219,18 +219,15 @@ if ($importObj->insPostCount != 0 || $importObj->dupPostCount != 0 || $importObj
|
|
219 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId'] = $importObj->capturedId;
|
220 |
}
|
221 |
}
|
222 |
-
if ($totRecords <= ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'] + $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['dupPostCount'] + $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['updatedPostCount'])) {
|
|
|
|
|
223 |
if (!isset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId'])) {
|
224 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId'] = 0;
|
225 |
}
|
226 |
-
$inserted_post_count = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'];
|
227 |
-
if ($inserted_post_count != 0) {
|
228 |
$importObj->addStatusLog($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'], $importedAs);
|
229 |
-
}
|
230 |
-
if ($inserted_post_count != 0) {
|
231 |
$importObj->addPieChartEntry($importedAs, $inserted_post_count);
|
232 |
$inserted_post_count = 0;
|
233 |
-
}
|
234 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'] = 0;
|
235 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['dupPostCount'] = 0;
|
236 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['updatedPostCount'] = 0;
|
219 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId'] = $importObj->capturedId;
|
220 |
}
|
221 |
}
|
222 |
+
//if ($totRecords <= ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'] + $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['dupPostCount'] + $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['updatedPostCount'])) {
|
223 |
+
$inserted_post_count = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'];
|
224 |
+
if ($inserted_post_count != 0) {
|
225 |
if (!isset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId'])) {
|
226 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['captureId'] = 0;
|
227 |
}
|
|
|
|
|
228 |
$importObj->addStatusLog($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'], $importedAs);
|
|
|
|
|
229 |
$importObj->addPieChartEntry($importedAs, $inserted_post_count);
|
230 |
$inserted_post_count = 0;
|
|
|
231 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['insPostCount'] = 0;
|
232 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['dupPostCount'] = 0;
|
233 |
$_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['updatedPostCount'] = 0;
|