?> </div> <div id='mappingheader' class='mappingheader' > <?php $allcustomposts = ''; $filename = ''; $records = ''; if (isset($_POST['uploadfilename']) && $_POST['uploadfilename'] != '') { $file_name = sanitize_text_field($_POST['uploadfilename']); $filename = $impCE->convert_string2hash_key($file_name); } if (isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') { $uploaded_csv_name = sanitize_file_name($_POST['upload_csv_realname']); } $total_row_count = ''; $parserObj = new SmackCSVParser(); $file = $impCE->getUploadDirectory() . '/' . $filename; $parserObj->parseCSV($file, 0, -1); $headers = $parserObj->get_CSVheaders(); $headers = $headers[0]; $total_row_count = $parserObj->total_row_count - 1; $getcustomposts = get_post_types(); if (!empty($getcustomposts) && is_array($getcustomposts)) { foreach ($getcustomposts as $keys => $value) { if ($value !== 'featured_image' && $value !== 'attachment' && $value !== 'wpsc-product' && $value !== 'wpsc-product-file' && $value !== 'revision' && $value !== 'nav_menu_item' && $value !== 'post' && $value !== 'page' && $value !== 'wp-types-group' && $value !== 'wp-types-user-group') { $allcustomposts .= $value . ','; } } } ?>
function csv_file_readdata($file, $path, $delim) { $data_rows = array(); $path = $this->getUploadDirectory() . '/' . $file; require_once WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'includes/SmackCSVParser.php'; $csv = new SmackCSVParser(); $csv->parseCSV($path, 1, 1); $delim = $csv->delimiter; # Check whether file is present in the given file location $fileexists = file_exists($path); if ($fileexists) { $resource = fopen($path, 'r'); $init = 0; while ($keys = fgetcsv($resource, '', $delim, '"')) { if ($init == 0) { $this->headers = $keys; } else { if (!($keys[0] == null && count($keys) == 1)) { array_push($data_rows, $keys); } } $init++; } fclose($resource); ini_set("auto_detect_line_endings", false); } else { return false; } return $data_rows; }
if ($count <= $totRecords) { $count = $tmpCnt + $count; if ($count > $totRecords) { $count = $totRecords; } } else { $count = $totRecords; } $resultArr = array(); $res2 = array(); $res1 = array(); $get_mapped_array = array(); $mapping_value = ''; $import_obj = new WPImporter_includes_helper(); $filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile']; $parserObj = new SmackCSVParser(); $file = $import_obj->getUploadDirectory() . '/' . $filename; $resultArr = $parserObj->parseCSV($file, $limit, $get_request_limit); if (sanitize_text_field($_POST['postdata']['dupTitle'])) { $importObj->titleDupCheck = sanitize_text_field($_POST['postdata']['dupTitle']); } if (sanitize_text_field($_POST['postdata']['dupContent'])) { $importObj->conDupCheck = sanitize_text_field($_POST['postdata']['dupContent']); } $csv_rec_count = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['h2']; $available_groups = $skinnyObj->get_availgroups($curr_action); //mapped and unmapped count if (!empty($_SESSION['SMACK_MAPPING_SETTINGS_VALUES']) && is_array($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'])) { foreach ($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'] as $seskey => $sesval) { foreach ($available_groups as $groupKey => $groupVal) { $current_mapped = explode($groupVal . 'mapping', $seskey);