Ultimate CSV Importer - Version 3.2.0

Version Description

Download this release

Release Info

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

Code changes from version 3.1.0 to 3.2.0

Files changed (68) hide show
  1. Readme.txt +14 -4
  2. SmackImpCE.php +522 -476
  3. SmackWpHandler.php +1 -1
  4. class.rendercsv.php +223 -0
  5. class.settings.php +62 -0
  6. css/blank.gif +0 -0
  7. css/custom-style.css +973 -0
  8. css/fancybox_loading.gif +0 -0
  9. css/fancybox_loading@2x.gif +0 -0
  10. css/fancybox_overlay.png +0 -0
  11. css/fancybox_sprite.png +0 -0
  12. css/fancybox_sprite@2x.png +0 -0
  13. images/HeadersExplained.jpeg +0 -0
  14. images/Importicon_24.png +0 -0
  15. images/SubscribeViaEmail.gif +0 -0
  16. images/arrow_down.gif +0 -0
  17. images/arrow_up.gif +0 -0
  18. images/bg.gif +0 -0
  19. images/csv-pro_01.png +0 -0
  20. images/csv-pro_02.png +0 -0
  21. images/csv-pro_04.png +0 -0
  22. images/csv-pro_06.png +0 -0
  23. images/csv-pro_07.png +0 -0
  24. images/csv-pro_08.png +0 -0
  25. images/csv-pro_10.png +0 -0
  26. images/csv-pro_11.png +0 -0
  27. images/csv-pro_13.png +0 -0
  28. images/csv-pro_14.png +0 -0
  29. images/csv-pro_16.png +0 -0
  30. images/csv-pro_18.png +0 -0
  31. images/csv-pro_19.png +0 -0
  32. images/csv-pro_20.png +0 -0
  33. images/csv-pro_21.png +0 -0
  34. images/csv_delete.png +0 -0
  35. images/csv_download.png +0 -0
  36. images/csv_download_all.png +0 -0
  37. images/csv_records_delete.png +0 -0
  38. images/custompostuitype.png +0 -0
  39. images/delete_records.png +0 -0
  40. images/eshop.png +0 -0
  41. images/facebook.png +0 -0
  42. images/googleplus.png +0 -0
  43. images/icon.png +0 -0
  44. images/importerpro.png +0 -0
  45. images/linkedin.png +0 -0
  46. images/notactive.png +0 -0
  47. images/notok.png +0 -0
  48. images/ok.png +0 -0
  49. images/paypal_donate_button.png +0 -0
  50. images/spacer.gif +0 -0
  51. images/sprite.png +0 -0
  52. images/stats.png +0 -0
  53. images/stats5263_03.png +0 -0
  54. images/stats5263_05.png +0 -0
  55. images/stats5263_09.png +0 -0
  56. images/stats5263_12.png +0 -0
  57. images/stats5263_15.png +0 -0
  58. images/stats5263_17.png +0 -0
  59. images/trash_records.png +0 -0
  60. images/twitter.png +0 -0
  61. imported_csv/readme.txt +0 -0
  62. languages/en_us.php +35 -4
  63. plugin_config.php +9 -0
  64. screenshot-1.png +0 -0
  65. screenshot-2.png +0 -0
  66. stats.php +85 -0
  67. wp_ultimate_csv_importer.js +206 -82
  68. wp_ultimate_csv_importer.php +394 -276
Readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: Smackcoders
3
  Donate link: http://www.smackcoders.com/donate.html
4
  Tags: batch, excel, import, spreadsheet, plugin, admin, csv, importer,
5
  Requires at least: 3.4.0
6
- Tested up to: 3.5.1
7
- Stable tag: 3.1.0
8
- Version: 3.1.0
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
@@ -88,7 +88,12 @@ Or view our hoe to guide video guide in our [Youtube Channel](www.youtube.com/us
88
 
89
  == Changelog ==
90
 
91
- =v 3.1.0 = Much Improved Featured Image feature
 
 
 
 
 
92
  -- Image url for featured image issues fixed
93
  -- PHP 5.4 upgrade fix
94
 
@@ -168,6 +173,11 @@ Or view our hoe to guide video guide in our [Youtube Channel](www.youtube.com/us
168
 
169
  == Upgrade Notice ==
170
 
 
 
 
 
 
171
  =v 3.1.0 = Now Much Improved Featured Image and url handling
172
 
173
  =v 3.0.0 = Must upgrade to have Major improvements, performance fixes and issue fixes
3
  Donate link: http://www.smackcoders.com/donate.html
4
  Tags: batch, excel, import, spreadsheet, plugin, admin, csv, importer,
5
  Requires at least: 3.4.0
6
+ Tested up to: 3.6
7
+ Stable tag: 3.2.0
8
+ Version: 3.2.0
9
  Author: smackcoders
10
  Author URI: http://profiles.wordpress.org/smackcoders/
11
  License: GPLv2 or later
88
 
89
  == Changelog ==
90
 
91
+ = 3.2.0 = WordPress 3.6 compatibility added, Much Improved UI.
92
+ -- Featured image issues fixed for WordPress-3.6.
93
+ -- Plugin deactivate bug fixed.
94
+ -- Custom Post issue fixed.
95
+
96
+ = 3.1.0 = Much Improved Featured Image feature
97
  -- Image url for featured image issues fixed
98
  -- PHP 5.4 upgrade fix
99
 
173
 
174
  == Upgrade Notice ==
175
 
176
+ =v 3.2.0 = WordPress 3.6 compatibility added, Much Improved UI.
177
+ -- Featured image issues fixed for WordPress-3.6.
178
+ -- Plugin deactivate bug fixed.
179
+ -- Custom Post issue fixed.
180
+
181
  =v 3.1.0 = Now Much Improved Featured Image and url handling
182
 
183
  =v 3.0.0 = Must upgrade to have Major improvements, performance fixes and issue fixes
SmackImpCE.php CHANGED
@@ -4,491 +4,537 @@
4
  * Common class for Smackcoder's CSV Importer CE
5
  */
6
  require_once ("SmackWpHandler.php");
7
- class SmackImpCE extends SmackWpHandler {
8
-
9
- // @var string CSV upload directory name
10
- public $uploadDir = 'ultimate_importer';
11
-
12
- // @var boolean post title check
13
- public $titleDupCheck = false;
14
-
15
- // @var boolean content title check
16
- public $conDupCheck = false;
17
-
18
- // @var string delimiter
19
- public $delim = ",";
20
-
21
- // @var array delilimters supported by CSV importer
22
- public $delim_avail = array (
23
- ',',
24
- ';'
25
- );
26
-
27
- // @var array wp field keys
28
- public $keys = array ();
29
-
30
- // @var array for default columns
31
- public $defCols = array (
32
- 'post_title' => null,
33
- 'post_content' => null,
34
- 'post_excerpt' => null,
35
- 'post_date' => null,
36
- 'post_name' => null,
37
- 'post_tag' => null,
38
- 'post_category' => null,
39
- 'post_author' => null,
40
- 'featured_image' => null,
41
- 'post_parent' => 0,
42
- 'post_status' => 0
43
- );
44
-
45
- // @var array CSV headers
46
- public $headers = array ();
47
-
48
- // @var boolean for post flag
49
- public $postFlag = false;
50
-
51
- // @var int duplicate post count
52
- public $dupPostCount = 0;
53
-
54
- // @var int inserted post count
55
- public $insPostCount = 0;
56
-
57
- // @var int no post author count
58
- public $noPostAuthCount = 0;
59
-
60
- // @var string CSV file name
61
- public $csvFileName;
62
-
63
- /**
64
- */
65
- function __construct() {
66
- $this->getKeyVals ();
67
- }
68
-
69
- /**
70
- * Manage duplicates
71
- *
72
- * @param
73
- * string type = (title|content), string content
74
- */
75
- function duplicateChecks($type = 'title', $text, $gettype) {
76
- global $wpdb;
77
-
78
- if ($type == 'content') {
79
- $contentLength = strlen ( $text );
80
- $post_exist = $wpdb->get_results ( "select ID from " . $wpdb->posts . " where length(post_content) = \"{$contentLength}\"" );
81
- if (count ( $post_exist ) > 0) {
82
- $chkforeach = 0;
83
- foreach ( $post_exist as $singlepost ) {
84
- $postdata = $wpdb->get_results ( "select post_content from " . $wpdb->posts . " where id = \"{$singlepost->ID}\"" );
85
- if (substr ( $postdata [0]->post_content, 0, 50 ) == substr ( $text, 0, 50 )) {
86
- $this->dupPostCount ++;
87
- return false;
88
- }
89
- }
90
- } else {
91
- return true;
92
- }
93
- } else if ($type == 'title') {
94
- $post_exist = $wpdb->get_results ( "select ID from " . $wpdb->posts . " where post_title = \"{$text}\" and post_type = \"{$gettype}\" and post_status in('publish','future','draft','pending','private')" );
95
- if (count ( $post_exist ) == 0 && ($text != null || $text != ''))
96
- return true;
97
- }
98
- $this->dupPostCount ++;
99
- return false;
100
- }
101
-
102
- /**
103
- * Get upload directory
104
- */
105
- function getUploadDirectory() {
106
- $upload_dir = wp_upload_dir ();
107
- return $upload_dir ['basedir'] . "/" . $this->uploadDir;
108
- }
109
-
110
- /**
111
- * Move CSV to the upload directory
112
- */
113
- function move_file() {
114
- if ($_FILES ["csv_import"] ["error"] == 0) {
115
- $tmp_name = $_FILES ["csv_import"] ["tmp_name"];
116
- $this->csvFileName = $_FILES ["csv_import"] ["name"];
117
- move_uploaded_file ( $tmp_name, $this->getUploadDirectory () . "/$this->csvFileName" );
118
- }
119
- }
120
-
121
- /**
122
- * Remove CSV file
123
- */
124
- function fileDelete($filepath, $filename) {
125
- if (file_exists ( $filepath . $filename ) && $filename != "" && $filename != "n/a") {
126
- unlink ( $filepath . $filename );
127
- return TRUE;
128
- }
129
- return FALSE;
130
- }
131
-
132
- /**
133
- * Get field colum keys
134
- */
135
- function getKeyVals() {
136
- global $wpdb;
137
- $limit = ( int ) apply_filters ( 'postmeta_form_limit', 30 );
138
- $this->keys = $wpdb->get_col ( "SELECT meta_key FROM $wpdb->postmeta
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  GROUP BY meta_key
140
  HAVING meta_key NOT LIKE '\_%'
141
  ORDER BY meta_key
142
- LIMIT $limit" );
143
-
144
- foreach ( $this->keys as $val ) {
145
- $this->defCols ["CF: " . $val] = $val;
146
- }
147
- }
148
-
149
- /**
150
- * Check upload dirctory permission
151
- */
152
- function checkUploadDirPermission() {
153
- $this->getUploadDirectory ();
154
- $upload_dir = wp_upload_dir ();
155
- if (! is_dir ( $upload_dir ['basedir'] )) {
156
- print " <div style='font-size:16px;margin-left:20px;margin-top:25px;'>" . $this->t ( "UPLOAD_PERMISSION_ERROR" ) . "
 
157
  </div><br/>
158
  <div style='margin-left:20px;'>
159
  <form class='add:the-list: validate' method='post' action=''>
160
- <input type='submit' class='button-primary' name='Import Again' value='" . $this->t ( "IMPORT_AGAIN" ) . "'/>
161
  </form>
162
  </div>";
163
- $this->freeze ();
164
- } else {
165
- if (! is_dir ( $this->getUploadDirectory () )) {
166
- wp_mkdir_p ( $this->getUploadDirectory () );
167
- }
168
- }
169
- }
170
-
171
- /**
172
- * Function converts CSV data to formatted array.
173
- *
174
- * @param $file CSV
175
- * input filename
176
- * @param $delim delimiter
177
- * for the CSV
178
- * @return array formatted CSV output as array
179
- */
180
- function csv_file_data($file, $delim) {
181
- $this->checkUploadDirPermission ();
182
- ini_set ( "auto_detect_line_endings", true );
183
-
184
- $data_rows = array ();
185
- $resource = fopen ( $file, 'r' );
186
-
187
- $init = 0;
188
- while ( $keys = fgetcsv ( $resource, '', $this->delim, '"' ) ) {
189
- if ($init == 0) {
190
- $this->headers = $keys;
191
- } else {
192
- array_push ( $data_rows, $keys );
193
- }
194
- $init ++;
195
- }
196
- fclose ( $resource );
197
- ini_set ( "auto_detect_line_endings", false );
198
- return $data_rows;
199
- }
200
-
201
- /**
202
- * function to map the csv file and process it
203
- *
204
- * @return boolean
205
- */
206
- function processDataInWP() {
207
- global $wpdb;
208
-
209
- $smack_taxo = array ();
210
- $custom_array = array ();
211
-
212
- $data_rows = $this->csv_file_data ( $this->getUploadDirectory () . "/" . $_POST ['filename'], $this->delim );
213
-
214
- foreach ( $_POST as $postkey => $postvalue ) {
215
- if ($postvalue != '-- Select --') {
216
- $ret_array [$postkey] = $postvalue;
217
- }
218
- }
219
-
220
- foreach ( $data_rows as $key => $value ) {
221
-
222
- for($i = 0; $i < count ( $value ); $i ++) {
223
- if (array_key_exists ( 'mapping' . $i, $ret_array )) {
224
- if ($ret_array ['mapping' . $i] != 'add_custom' . $i) {
225
- $strip_CF = strpos($ret_array['mapping'.$i],'CF: ');
226
- if($strip_CF === 0){
227
- $custom_key = substr($ret_array['mapping'.$i], 4);
228
- $custom_array[$custom_key] = $value[$i];
229
- }
230
- else{
231
- $new_post[$ret_array['mapping'.$i]] = $value[$i];
232
- }
233
-
234
- } else {
235
- $new_post [$ret_array ['textbox' . $i]] = $value [$i];
236
- $custom_array [$ret_array ['textbox' . $i]] = $value [$i];
237
- }
238
- }
239
- }
240
- for($inc = 0; $inc < count ( $value ); $inc ++) {
241
- foreach ( $this->keys as $k => $v ) {
242
- if (array_key_exists ( $v, $new_post )) {
243
- $custom_array [$v] = $new_post [$v];
244
- }
245
- }
246
- }
247
-
248
- foreach ( $new_post as $ckey => $cval ) {
249
- $this->postFlag = true;
250
- $taxo = get_taxonomies ();
251
- foreach ( $taxo as $taxokey => $taxovalue ) {
252
- if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
253
- if ($taxokey == $ckey) {
254
- $smack_taxo [$ckey] = $new_post [$ckey];
255
- }
256
- }
257
- }
258
- if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo [$ckey]) {
259
- if (array_key_exists ( $ckey, $custom_array )) {
260
- $darray [$ckey] = $new_post [$ckey];
261
- } else {
262
- if (array_key_exists ( $ckey, $smack_taxo )) {
263
- } else {
264
- $data_array [$ckey] = $new_post [$ckey];
265
- }
266
- }
267
- } else {
268
-
269
- switch ($ckey) {
270
- case 'post_tag' :
271
- $tags [$ckey] = $new_post [$ckey];
272
- break;
273
- case 'post_category' :
274
- $categories [$ckey] = $new_post [$ckey];
275
- break;
276
- case 'featured_image' :
277
- /*
278
- * TODO: Cleanup required
279
- */
280
- $split_filename = explode ( '/', htmlentities ( $new_post [$ckey] ) );
281
- $arr_filename = count ( $split_filename );
282
- $plain_filename = $split_filename [$arr_filename - 1];
283
- $new_post [$ckey] = str_replace ( ' ', '%20', $new_post [$ckey] );
284
- $file_url = $filetype [$ckey] = $new_post [$ckey];
285
- $file_type = explode ( '.', $filetype [$ckey] );
286
- $count = count ( $file_type );
287
- $type = $file_type [$count - 1];
288
- if ($type == 'png') {
289
- $file ['post_mime_type'] = 'image/png';
290
- } else if ($type == 'jpg' || $type == 'jpeg') {
291
- $file ['post_mime_type'] = 'image/jpeg';
292
- } else if ($type == 'gif') {
293
- $file ['post_mime_type'] = 'image/gif';
294
- }
295
- $img_name = explode ( '/', $file_url );
296
- $imgurl_split = count ( $img_name );
297
- $img_name = explode ( '.', $img_name [$imgurl_split - 1] );
298
- if(count($img_name) > 2){
299
- for($r=0;$r<(count($img_name)-1);$r++){
300
- if($r==0)
301
- $img_title = $img_name[$r];
302
- else
303
- $img_title .= '.'.$img_name[$r];
304
- }
305
- $img_name = $img_title;
306
- }
307
- else{
308
- $img_title = $img_name = $img_name [0];
309
- }
310
- $dir = wp_upload_dir ();
311
- $dirname = date('Y').'/'.date('m');
312
- $full_path = $dir ['basedir'] . '/' . $dirname;
313
- $baseurl = $dir ['baseurl'] . '/' . $dirname;
314
- $filename = explode ( '/', $file_url );
315
- $file_split = count ( $filename );
316
- $filepath = $full_path . '/' . $plain_filename;
317
- $fileurl = $baseurl . '/' . $filename [$file_split - 1];
318
- if(is_dir($full_path)){
319
- $smack_fileCopy = @copy($file_url,$filepath);
320
- }
321
- else{
322
- wp_mkdir_p($full_path);
323
- $smack_fileCopy = @copy($file_url,$filepath);
324
- }
325
- $img = wp_get_image_editor( $filepath );
326
- if ( ! is_wp_error( $img ) ) {
327
-
328
- $sizes_array = array(
329
- // #1 - resizes to 1024x768 pixel, square-cropped image
330
- array ('width' => 1024, 'height' => 768, 'crop' => false),
331
- // #2 - resizes to 100px max width/height, non-cropped image
332
- array ('width' => 150, 'height' => 150, 'crop' => false),
333
- // #3 - resizes to 100 pixel max height, non-cropped image
334
- array ('width' => 330, 'height' => 220, 'crop' => false),
335
- // #3 - resizes to 624x468 pixel max width, non-cropped image
336
- array ('width' => 624, 'height' => 468, 'crop' => false)
337
- );
338
- $resize = $img->multi_resize( $sizes_array );
339
- }
340
- if ($smack_fileCopy) {
341
- $file ['guid'] = $fileurl;
342
- $file ['post_title'] = $img_title;
343
- $file ['post_content'] = '';
344
- $file ['post_status'] = 'inherit';
345
- } else {
346
- $file = false;
347
- }
348
- break;
349
- }
350
- }
351
- }
352
-
353
- $data_array['post_type'] = $_POST['csv_importer_cat'];
354
-
355
- if ($this->titleDupCheck)
356
- $this->postFlag = $this->duplicateChecks ( 'title', $data_array ['post_title'], $data_array ['post_type'] );
357
-
358
- if ($this->conDupCheck && $this->postFlag)
359
- $this->postFlag = $this->duplicateChecks ( 'content', $data_array ['post_content'], '' );
360
-
361
- if ($this->postFlag) {
362
- unset ( $sticky );
363
- if($_POST['importallwithps'] != 0)
364
- $data_array['post_status'] = $_POST['importallwithps'];
365
- switch ($data_array ['post_status']) {
366
- case 1 :
367
- $data_array['post_status'] = 'publish';
368
- break;
369
- case 2 :
370
- $data_array['post_status'] = 'publish';
371
- $sticky = true;
372
- break;
373
- case 3 :
374
- $data_array['post_status'] = 'publish';
375
- $data_array ['post_password'] = $_POST ['postsPassword'];
376
- break;
377
- case 4 :
378
- $data_array ['post_status'] = 'private';
379
- break;
380
- case 5 :
381
- $data_array ['post_status'] = 'draft';
382
- break;
383
- case 6 :
384
- $data_array ['post_status'] = 'pending';
385
- break;
386
- default :
387
- $poststatus = $data_array['post_status'] = strtolower( $data_array['post_status'] );
388
- if($data_array['post_status'] != 'publish' && $data_array['post_status'] != 'private' && $data_array['post_status'] != 'draft' && $data_array['post_status'] != 'pending' && $data_array['post_status'] != 'sticky'){
389
- $stripPSF = strpos($data_array['post_status'],'{');
390
- if($stripPSF === 0){
391
- $poststatus = substr($data_array['post_status'], 1);
392
- $stripPSL = substr($poststatus, -1);
393
- if($stripPSL == '}'){
394
- $postpwd = substr($poststatus,0, -1);
395
- $data_array['post_status'] = 'publish';
396
- $data_array ['post_password'] = $postpwd;
397
- }
398
- else{
399
- $data_array['post_status'] = 'publish';
400
- $data_array ['post_password'] = $poststatus;
401
- }
402
- }
403
- else{
404
- $data_array['post_status'] = 'publish';
405
- }
406
- }
407
- if($data_array['post_status'] == 'sticky'){
408
- $data_array['post_status'] = 'publish';
409
- $sticky = true;
410
- }
411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  }
413
- // Author name/id update
414
- $authorLen = strlen($data_array ['post_author']);
415
- $postuserid = $data_array ['post_author'];
416
- $checkpostuserid = intval($data_array ['post_author']);
417
- $postAuthorLen = strlen($checkpostuserid);
418
-
419
- if($authorLen == $postAuthorLen){
420
- $postauthor = $wpdb->get_results ( "select ID from $wpdb->users where ID = \"{$postuserid}\"" );
421
- }
422
- else{
423
- $postauthor = $wpdb->get_results ( "select ID from $wpdb->users where user_login = \"{$postuserid}\"" );
424
- }
425
-
426
- if (! $postauthor [0]->ID) {
427
- $data_array ['post_author'] = 1;
428
- $this->noPostAuthCount ++;
429
- } else {
430
- $data_array ['post_author'] = $postauthor [0]->ID;
431
- }
432
-
433
- // Date format post
434
- if (! $data_array ['post_date'])
435
- $data_array ['post_date'] = date ( 'Y-m-d H:i:s' );
436
- $data_array ['post_date'] = date ( 'Y-m-d H:i:s', strtotime ( $data_array ['post_date'] ) );
437
- if ($data_array)
438
- $post_id = wp_insert_post ( $data_array );
439
- unset($data_array);
440
- unset($postauthor);
441
- if ($post_id) {
442
- $this->insPostCount ++;
443
- if ($sticky)
444
- stick_post ( $post_id );
445
-
446
- if (! empty ( $custom_array )) {
447
- foreach ( $custom_array as $custom_key => $custom_value ) {
448
- add_post_meta ( $post_id, $custom_key, $custom_value );
449
- }
450
- }
451
-
452
- // Create custom taxonomy to post
453
- if (! empty ( $smack_taxo )) {
454
- foreach ( $smack_taxo as $taxo_key => $taxo_value ) {
455
- $split_line = explode ( '|', $taxo_value );
456
- wp_set_object_terms ( $post_id, $split_line, $taxo_key );
457
- }
458
- }
459
-
460
- // Create/Add tags to post
461
- if (! empty ( $tags )) {
462
- foreach ( $tags as $tag_key => $tag_value ) {
463
- wp_set_post_tags ( $post_id, $tag_value );
464
- }
465
- }
466
-
467
- // Create/Add category to post
468
- if (! empty ( $categories )) {
469
- $split_cate = explode ( '|', $categories ['post_category'] );
470
- foreach ( $split_cate as $key => $val ) {
471
- if (is_numeric ( $val ))
472
- $split_cate[$key] = 'uncategorized';
473
- }
474
- wp_set_object_terms ( $post_id, $split_cate, 'category' );
475
- }
476
- // Add featured image
477
- if (! empty ( $file )) {
478
- $file_name = $dirname . '/' . $img_title . '.' . $type;
479
- $attach_id = wp_insert_attachment ( $file, $file_name, $post_id );
480
- require_once (ABSPATH . 'wp-admin/includes/image.php');
481
- $attach_data = wp_generate_attachment_metadata ( $attach_id, $fileurl );
482
- wp_update_attachment_metadata ( $attach_id, $attach_data );
483
- set_post_thumbnail ( $post_id, $attach_id );
484
- }
485
- }
486
- }
487
- }
488
-
489
- if (file_exists ( $this->getUploadDirectory () . $_POST ['filename'] )) {
490
- $this->fileDelete ( $this->getUploadDirectory (), $_POST ['filename'] );
491
- }
492
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  }
494
  ?>
4
  * Common class for Smackcoder's CSV Importer CE
5
  */
6
  require_once ("SmackWpHandler.php");
7
+
8
+ class SmackImpCE extends SmackWpHandler
9
+ {
10
+
11
+ // @var string CSV upload directory name
12
+ public $uploadDir = 'ultimate_importer';
13
+
14
+ // @var boolean post title check
15
+ public $titleDupCheck = false;
16
+
17
+ // @var boolean content title check
18
+ public $conDupCheck = false;
19
+
20
+ // @var string delimiter
21
+ public $delim = ",";
22
+
23
+ // @var array delilimters supported by CSV importer
24
+ public $delim_avail = array(
25
+ ',',
26
+ ';'
27
+ );
28
+
29
+ // @var array wp field keys
30
+ public $keys = array();
31
+
32
+ // @var array for default columns
33
+ public $defCols = array(
34
+ 'post_title' => null,
35
+ 'post_content' => null,
36
+ 'post_excerpt' => null,
37
+ 'post_date' => null,
38
+ 'post_name' => null,
39
+ 'post_tag' => null,
40
+ 'post_category' => null,
41
+ 'post_author' => null,
42
+ 'featured_image' => null,
43
+ 'post_parent' => 0,
44
+ 'post_status' => 0
45
+ );
46
+
47
+ // @var array CSV headers
48
+ public $headers = array();
49
+
50
+ // @var boolean for post flag
51
+ public $postFlag = true;
52
+
53
+ // @var int duplicate post count
54
+ public $dupPostCount = 0;
55
+
56
+ // @var int inserted post count
57
+ public $insPostCount = 0;
58
+
59
+ // @var int updated post count
60
+ public $updatedPostCount = 0;
61
+
62
+ // @var int no post author count
63
+ public $noPostAuthCount = 0;
64
+
65
+ // @var string CSV file name
66
+ public $csvFileName;
67
+
68
+ /**
69
+ */
70
+ function __construct()
71
+ {
72
+ $this->getKeyVals();
73
+ }
74
+
75
+ /**
76
+ * Manage duplicates
77
+ *
78
+ * @param
79
+ * string type = (title|content), string content
80
+ */
81
+ function duplicateChecks($type = 'title', $text, $gettype)
82
+ {
83
+ global $wpdb;
84
+
85
+ if ($type == 'content') {
86
+ $htmlDecode = html_entity_decode($text);
87
+ $strippedText = strip_tags($htmlDecode);
88
+ $contentLength = strlen($strippedText);
89
+ $allPosts_count = $wpdb->get_results("SELECT COUNT(ID) as count FROM $wpdb->posts WHERE post_status IN('publish','future','draft','pending','private')");
90
+ $allPosts_count = $allPosts_count[0]->count;
91
+ $allPosts = $wpdb->get_results("SELECT ID,post_title,post_date,post_content FROM $wpdb->posts WHERE post_status IN('publish','future','draft','pending','private')");
92
+ foreach ($allPosts as $allPost) {
93
+ $htmlDecodePCont = html_entity_decode($allPost->post_content);
94
+ $strippedTextPCont = strip_tags($htmlDecodePCont);
95
+ similar_text($strippedTextPCont, $strippedText, $p);
96
+ if ($p == 100) {
97
+ $this->dupPostCount++;
98
+ return false;
99
+ }
100
+ }
101
+ return true;
102
+ } else if ($type == 'title') {
103
+ $post_exist = $wpdb->get_results("select ID from " . $wpdb->posts . " where post_title = \"{$text}\" and post_type = \"{$gettype}\" and post_status in('publish','future','draft','pending','private')");
104
+ if (count($post_exist) == 0 && ($text != null || $text != ''))
105
+ return true;
106
+ }
107
+ $this->dupPostCount++;
108
+ return false;
109
+ }
110
+
111
+ function getMatchedId($text, $gettype)
112
+ {
113
+ global $wpdb;
114
+ $type = 'title';
115
+
116
+ $post_exist = $wpdb->get_results("select ID from " . $wpdb->posts . " where post_title = \"{$text}\" and post_type = \"{$gettype}\" and post_status in('publish','future','draft','pending','private')");
117
+ return $post_exist;
118
+ }
119
+
120
+ function getCreatedRecords($csvname)
121
+ {
122
+ global $wpdb;
123
+ return $wpdb->get_results("select created_records from smack_dashboard_manager where csv_name = \"{$csvname}\"");
124
+ }
125
+
126
+
127
+ /**
128
+ * Get upload directory
129
+ */
130
+ function getUploadDirectory()
131
+ {
132
+ $upload_dir = wp_upload_dir();
133
+ return $upload_dir ['basedir'] . "/" . $this->uploadDir;
134
+ }
135
+
136
+ /**
137
+ * Move CSV to the upload directory
138
+ */
139
+ function move_file()
140
+ {
141
+ if ($_FILES ["csv_import"] ["error"] == 0) {
142
+ $tmp_name = $_FILES ["csv_import"] ["tmp_name"];
143
+ $this->csvFileName = $_FILES ["csv_import"] ["name"];
144
+ move_uploaded_file($tmp_name, $this->getUploadDirectory() . "/$this->csvFileName");
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Remove CSV file
150
+ */
151
+ function fileDelete($filepath, $filename)
152
+ {
153
+ if (file_exists($filepath . $filename) && $filename != "" && $filename != "n/a") {
154
+ unlink($filepath . $filename);
155
+ return TRUE;
156
+ }
157
+ return FALSE;
158
+ }
159
+
160
+ /**
161
+ * Get field colum keys
162
+ */
163
+ function getKeyVals()
164
+ {
165
+ global $wpdb;
166
+ $limit = ( int )apply_filters('postmeta_form_limit', 30);
167
+ $this->keys = $wpdb->get_col("SELECT meta_key FROM $wpdb->postmeta
168
  GROUP BY meta_key
169
  HAVING meta_key NOT LIKE '\_%'
170
  ORDER BY meta_key
171
+ LIMIT $limit");
172
+
173
+ foreach ($this->keys as $val) {
174
+ $this->defCols ["CF: " . $val] = $val;
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Check upload dirctory permission
180
+ */
181
+ function checkUploadDirPermission()
182
+ {
183
+ $this->getUploadDirectory();
184
+ $upload_dir = wp_upload_dir();
185
+ if (!is_dir($upload_dir ['basedir'])) {
186
+ print " <div style='font-size:16px;margin-left:20px;margin-top:25px;'>" . $this->t("UPLOAD_PERMISSION_ERROR") . "
187
  </div><br/>
188
  <div style='margin-left:20px;'>
189
  <form class='add:the-list: validate' method='post' action=''>
190
+ <input type='submit' class='button-primary' name='Import Again' value='" . $this->t("IMPORT_AGAIN") . "'/>
191
  </form>
192
  </div>";
193
+ $this->freeze();
194
+ } else {
195
+ if (!is_dir($this->getUploadDirectory())) {
196
+ wp_mkdir_p($this->getUploadDirectory());
197
+ }
198
+ }
199
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
+ /**
202
+ * Function converts CSV data to formatted array.
203
+ *
204
+ * @param $file CSV
205
+ * input filename
206
+ * @param $delim delimiter
207
+ * for the CSV
208
+ * @return array formatted CSV output as array
209
+ */
210
+ function csv_file_data($file, $delim)
211
+ {
212
+ $this->checkUploadDirPermission();
213
+ ini_set("auto_detect_line_endings", true);
214
+
215
+ $data_rows = array();
216
+ $resource = fopen($file, 'r');
217
+
218
+ $init = 0;
219
+ while ($keys = fgetcsv($resource, '', $this->delim, '"')) {
220
+ if ($init == 0) {
221
+ $this->headers = $keys;
222
+ } else {
223
+ if (!(($keys[0] == null) && (count($keys) == 1)))
224
+ array_push($data_rows, $keys);
225
+ }
226
+ $init++;
227
+ }
228
+ fclose($resource);
229
+ ini_set("auto_detect_line_endings", false);
230
+ return $data_rows;
231
+ }
232
+
233
+ /**function to form data_rows**/
234
+ function getDataRows($filename, $delim)
235
+ {
236
+ $data_rows = $this->csv_file_data($this->getUploadDirectory() . "/" . $filename, $delim);
237
+ return $data_rows;
238
+ }
239
+
240
+ /**
241
+ * function to map the csv file and process it
242
+ *
243
+ * @return boolean
244
+ */
245
+ function processDataInWP()
246
+ {
247
+ global $wpdb;
248
+
249
+ $smack_taxo = array();
250
+ $custom_array = array();
251
+
252
+ $data_rows = $this->csv_file_data($this->getUploadDirectory() . "/" . $_POST ['filename'], $this->delim);
253
+
254
+ foreach ($_POST as $postkey => $postvalue) {
255
+ if ($postvalue != '-- Select --') {
256
+ $ret_array [$postkey] = $postvalue;
257
+ }
258
+ }
259
+
260
+ foreach ($data_rows as $key => $value) {
261
+
262
+ for ($i = 0; $i < count($value); $i++) {
263
+ if (array_key_exists('mapping' . $i, $ret_array)) {
264
+ if ($ret_array ['mapping' . $i] != 'add_custom' . $i) {
265
+ $strip_CF = strpos($ret_array['mapping' . $i], 'CF: ');
266
+ if ($strip_CF === 0) {
267
+ $custom_key = substr($ret_array['mapping' . $i], 4);
268
+ $custom_array[$custom_key] = $value[$i];
269
+ } else {
270
+ $new_post[$ret_array['mapping' . $i]] = $value[$i];
271
+ }
272
+
273
+ } else {
274
+ $new_post [$ret_array ['textbox' . $i]] = $value [$i];
275
+ $custom_array [$ret_array ['textbox' . $i]] = $value [$i];
276
+ }
277
+ }
278
+ }
279
+ for ($inc = 0; $inc < count($value); $inc++) {
280
+ foreach ($this->keys as $k => $v) {
281
+ if (array_key_exists($v, $new_post)) {
282
+ $custom_array [$v] = $new_post [$v];
283
+ }
284
+ }
285
+ }
286
+
287
+ foreach ($new_post as $ckey => $cval) {
288
+ $this->postFlag = true;
289
+ $taxo = get_taxonomies();
290
+ foreach ($taxo as $taxokey => $taxovalue) {
291
+ if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
292
+ if ($taxokey == $ckey) {
293
+ $smack_taxo [$ckey] = $new_post [$ckey];
294
+ }
295
+ }
296
+ }
297
+ if ($ckey != 'post_category' && $ckey != 'post_tag' && $ckey != 'featured_image' && $ckey != $smack_taxo [$ckey]) {
298
+ if (array_key_exists($ckey, $custom_array)) {
299
+ $darray [$ckey] = $new_post [$ckey];
300
+ } else {
301
+ if (array_key_exists($ckey, $smack_taxo)) {
302
+ } else {
303
+ $data_array [$ckey] = $new_post [$ckey];
304
+ }
305
+ }
306
+ } else {
307
+
308
+ switch ($ckey) {
309
+ case 'post_tag' :
310
+ $tags [$ckey] = $new_post [$ckey];
311
+ break;
312
+ case 'post_category' :
313
+ $categories [$ckey] = $new_post [$ckey];
314
+ break;
315
+ case 'featured_image' :
316
+ /*
317
+ * TODO: Cleanup required
318
+ */
319
+ $split_filename = explode('/', htmlentities($new_post [$ckey]));
320
+ $arr_filename = count($split_filename);
321
+ $plain_filename = $split_filename [$arr_filename - 1];
322
+ $new_post [$ckey] = str_replace(' ', '%20', $new_post [$ckey]);
323
+ $file_url = $filetype [$ckey] = $new_post [$ckey];
324
+ $file_type = explode('.', $filetype [$ckey]);
325
+ $count = count($file_type);
326
+ $type = $file_type [$count - 1];
327
+ if ($type == 'png') {
328
+ $file ['post_mime_type'] = 'image/png';
329
+ } else if ($type == 'jpg' || $type == 'jpeg') {
330
+ $file ['post_mime_type'] = 'image/jpeg';
331
+ } else if ($type == 'gif') {
332
+ $file ['post_mime_type'] = 'image/gif';
333
+ }
334
+ $img_name = explode('/', $file_url);
335
+ $imgurl_split = count($img_name);
336
+ $img_name = explode('.', $img_name [$imgurl_split - 1]);
337
+ if (count($img_name) > 2) {
338
+ for ($r = 0; $r < (count($img_name) - 1); $r++) {
339
+ if ($r == 0)
340
+ $img_title = $img_name[$r];
341
+ else
342
+ $img_title .= '.' . $img_name[$r];
343
  }
344
+ $img_name = $img_title;
345
+ } else {
346
+ $img_title = $img_name = $img_name [0];
347
+ }
348
+ $attachmentName = $img_title . '.' . $type;
349
+ $dir = wp_upload_dir();
350
+ $dirname = date('Y') . '/' . date('m');
351
+ $full_path = $dir ['basedir'] . '/' . $dirname;
352
+ $baseurl = $dir ['baseurl'] . '/' . $dirname;
353
+ $filename = explode('/', $file_url);
354
+ $file_split = count($filename);
355
+ $filepath = $full_path . '/' . $plain_filename;
356
+ $fileurl = $baseurl . '/' . $filename [$file_split - 1];
357
+ if (is_dir($full_path)) {
358
+ $smack_fileCopy = @copy($file_url, $filepath);
359
+ } else {
360
+ wp_mkdir_p($full_path);
361
+ $smack_fileCopy = @copy($file_url, $filepath);
362
+ }
363
+ $img = wp_get_image_editor($filepath);
364
+ if (!is_wp_error($img)) {
365
+
366
+ $sizes_array = array(
367
+ // #1 - resizes to 1024x768 pixel, square-cropped image
368
+ array('width' => 1024, 'height' => 768, 'crop' => true),
369
+ // #2 - resizes to 100px max width/height, non-cropped image
370
+ array('width' => 100, 'height' => 100, 'crop' => false),
371
+ // #3 - resizes to 100 pixel max height, non-cropped image
372
+ array('width' => 300, 'height' => 100, 'crop' => false),
373
+ // #3 - resizes to 624x468 pixel max width, non-cropped image
374
+ array('width' => 624, 'height' => 468, 'crop' => false)
375
+ );
376
+ $resize = $img->multi_resize($sizes_array);
377
+ }
378
+ if ($smack_fileCopy) {
379
+ $file ['guid'] = $fileurl;
380
+ $file ['post_title'] = $img_title;
381
+ $file ['post_content'] = '';
382
+ $file ['post_status'] = 'attachment';
383
+ } else {
384
+ $file = false;
385
+ }
386
+ break;
387
+ }
388
+ }
389
+ }
390
+
391
+ $data_array['post_type'] = $_POST['csv_importer_cat'];
392
+
393
+ if ($this->titleDupCheck)
394
+ $this->postFlag = $this->duplicateChecks('title', $data_array ['post_title'], $data_array ['post_type']);
395
+
396
+ if ($this->conDupCheck && $this->postFlag)
397
+ $this->postFlag = $this->duplicateChecks('content', $data_array ['post_content'], '');
398
+
399
+ if ($this->postFlag) {
400
+ unset ($sticky);
401
+ if ($_POST['importallwithps'] != 0)
402
+ $data_array['post_status'] = $_POST['importallwithps'];
403
+ switch ($data_array ['post_status']) {
404
+ case 1 :
405
+ $data_array['post_status'] = 'publish';
406
+ break;
407
+ case 2 :
408
+ $data_array['post_status'] = 'publish';
409
+ $sticky = true;
410
+ break;
411
+ case 3 :
412
+ $data_array['post_status'] = 'publish';
413
+ $data_array ['post_password'] = $_POST ['postsPassword'];
414
+ break;
415
+ case 4 :
416
+ $data_array ['post_status'] = 'private';
417
+ break;
418
+ case 5 :
419
+ $data_array ['post_status'] = 'draft';
420
+ break;
421
+ case 6 :
422
+ $data_array ['post_status'] = 'pending';
423
+ break;
424
+ default :
425
+ $poststatus = $data_array['post_status'] = strtolower($data_array['post_status']);
426
+ if ($data_array['post_status'] != 'publish' && $data_array['post_status'] != 'private' && $data_array['post_status'] != 'draft' && $data_array['post_status'] != 'pending' && $data_array['post_status'] != 'sticky') {
427
+ $stripPSF = strpos($data_array['post_status'], '{');
428
+ if ($stripPSF === 0) {
429
+ $poststatus = substr($data_array['post_status'], 1);
430
+ $stripPSL = substr($poststatus, -1);
431
+ if ($stripPSL == '}') {
432
+ $postpwd = substr($poststatus, 0, -1);
433
+ $data_array['post_status'] = 'publish';
434
+ $data_array ['post_password'] = $postpwd;
435
+ } else {
436
+ $data_array['post_status'] = 'publish';
437
+ $data_array ['post_password'] = $poststatus;
438
+ }
439
+ } else {
440
+ $data_array['post_status'] = 'publish';
441
+ }
442
+ }
443
+ if ($data_array['post_status'] == 'sticky') {
444
+ $data_array['post_status'] = 'publish';
445
+ $sticky = true;
446
+ }
447
+
448
+ }
449
+ // Author name/id update
450
+ $authorLen = strlen($data_array ['post_author']);
451
+ $postuserid = $data_array ['post_author'];
452
+ $checkpostuserid = intval($data_array ['post_author']);
453
+ $postAuthorLen = strlen($checkpostuserid);
454
+
455
+ if ($authorLen == $postAuthorLen) {
456
+ $postauthor = $wpdb->get_results("select ID from $wpdb->users where ID = \"{$postuserid}\"");
457
+ } else {
458
+ $postauthor = $wpdb->get_results("select ID from $wpdb->users where user_login = \"{$postuserid}\"");
459
+ }
460
+
461
+ if (!$postauthor [0]->ID) {
462
+ $data_array ['post_author'] = 1;
463
+ $this->noPostAuthCount++;
464
+ } else {
465
+ $data_array ['post_author'] = $postauthor [0]->ID;
466
+ }
467
+
468
+ // Date format post
469
+ if (!$data_array ['post_date'])
470
+ $data_array ['post_date'] = date('Y-m-d H:i:s');
471
+ $data_array ['post_date'] = date('Y-m-d H:i:s', strtotime($data_array ['post_date']));
472
+ if ($data_array)
473
+ $post_id = wp_insert_post($data_array);
474
+ unset($data_array);
475
+ unset($postauthor);
476
+ if ($post_id) {
477
+ $this->insPostCount++;
478
+ if ($sticky)
479
+ stick_post($post_id);
480
+
481
+ if (!empty ($custom_array)) {
482
+ foreach ($custom_array as $custom_key => $custom_value) {
483
+ add_post_meta($post_id, $custom_key, $custom_value);
484
+ }
485
+ }
486
+
487
+ // Create custom taxonomy to post
488
+ if (!empty ($smack_taxo)) {
489
+ foreach ($smack_taxo as $taxo_key => $taxo_value) {
490
+ $split_line = explode('|', $taxo_value);
491
+ wp_set_object_terms($post_id, $split_line, $taxo_key);
492
+ }
493
+ }
494
+
495
+ // Create/Add tags to post
496
+ if (!empty ($tags)) {
497
+ foreach ($tags as $tag_key => $tag_value) {
498
+ wp_set_post_tags($post_id, $tag_value);
499
+ }
500
+ }
501
+
502
+ // Create/Add category to post
503
+ if (!empty ($categories)) {
504
+ $split_cate = explode('|', $categories ['post_category']);
505
+ foreach ($split_cate as $key => $val) {
506
+ if (is_numeric($val))
507
+ $split_cate[$key] = 'uncategorized';
508
+ }
509
+ wp_set_object_terms($post_id, $split_cate, 'category');
510
+ }
511
+ // Add featured image
512
+ if (!empty ($file)) {
513
+ $wp_filetype = wp_check_filetype(basename($attachmentName), null);
514
+ $wp_upload_dir = wp_upload_dir();
515
+ $attachment = array(
516
+ 'guid' => $wp_upload_dir['url'] . '/' . basename($attachmentName),
517
+ 'post_mime_type' => $wp_filetype['type'],
518
+ 'post_title' => preg_replace('/\.[^.]+$/', '', basename($attachmentName)),
519
+ 'post_content' => '',
520
+ 'post_status' => 'inherit'
521
+ );
522
+ $generate_attachment = $dirname . '/' . $attachmentName;
523
+ $uploadedImage = $wp_upload_dir['path'] . '/' . $attachmentName;
524
+ $attach_id = wp_insert_attachment($attachment, $generate_attachment, $post_id);
525
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
526
+ $attach_data = wp_generate_attachment_metadata($attach_id, $uploadedImage);
527
+ wp_update_attachment_metadata($attach_id, $attach_data);
528
+ set_post_thumbnail($post_id, $attach_id);
529
+ }
530
+ }
531
+ }
532
+ }
533
+
534
+ if (file_exists($this->getUploadDirectory() . '/' . $_POST ['filename'])) {
535
+ $filePath = $this->getUploadDirectory() . '/';
536
+ $this->fileDelete($filePath, $_POST ['filename']);
537
+ }
538
+ }
539
  }
540
  ?>
SmackWpHandler.php CHANGED
@@ -39,4 +39,4 @@ class SmackWpHandler {
39
  }
40
  }
41
 
42
- ?>
39
  }
40
  }
41
 
42
+ ?>
class.rendercsv.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * User: fenzik
4
+ * Date: 21/08/13
5
+ * Time: 10:34 AM
6
+ * Class to be used for rendering.
7
+ */
8
+
9
+ class RenderCSVCE
10
+ {
11
+
12
+ /**
13
+ * Render dashboard action
14
+ */
15
+ function setDashboardAction()
16
+ {
17
+ return '<div id = "requestaction" type = "hidden" value = "dashboard">';
18
+ }
19
+
20
+ /**
21
+ * Shows status message
22
+ */
23
+ function showMessage($status, $message)
24
+ {
25
+ return "<div class = \"$status msg\"> $message</div>";
26
+ }
27
+
28
+ /**
29
+ * Function to display the plugin home description
30
+ */
31
+ function renderSettings()
32
+ {
33
+ $impCESett = new SmackImpCE();
34
+ $settobj = new IMPSettings();
35
+ $sett = $settobj->getSettings();
36
+ foreach ($sett as $key)
37
+ $$key = 'checked';
38
+
39
+ $cctmtd = $this->getPluginState('custom-content-type-manager/index.php');
40
+ $cptutd = $this->getPluginState('custom-post-type-ui/custom-post-type-ui.php');
41
+ $eshoptd = $this->getPluginState('eshop/eshop.php');
42
+ $wpcomtd = $this->getPluginState('wp-e-commerce/wp-shopping-cart.php');
43
+ $aioseotd = $this->getPluginState('all-in-one-seo-pack/all_in_one_seo_pack.php');
44
+ $yoasttd = $this->getPluginState('wordpress-seo/wp-seo.php');
45
+ $cateicontd = $this->getPluginState('category-icons/category_icons.php');
46
+
47
+ $cctmtdi = $this->getPluginStateImg('custom-content-type-manager/index.php');
48
+ $cptutdi = $this->getPluginStateImg('custom-post-type-ui/custom-post-type-ui.php');
49
+ $eshoptdi = $this->getPluginStateImg('eshop/eshop.php');
50
+ $wpcomtdi = $this->getPluginStateImg('wp-e-commerce/wp-shopping-cart.php');
51
+ $aioseotdi = $this->getPluginStateImg('all-in-one-seo-pack/all_in_one_seo_pack.php');
52
+ $yoasttdi = $this->getPluginStateImg('wordpress-seo/wp-seo.php');
53
+ $cateicontdi = $this->getPluginStateImg('category-icons/category_icons.php');
54
+
55
+ if (!$ecommerce)
56
+ $ecommercedisabled = 'disabled';
57
+
58
+ $setString = "<div class = 'settingscontainer'><form class=\"add:the-list: validate\" method=\"post\" enctype=\"multipart/form-data\">";
59
+ $setString .= "<div class='upgradetopro' id='upgradetopro' style='display:none;'>This feature is only available in Pro Version, Please <a href='http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html' target='_blank' >UPGRADE TO PRO</a></div>";
60
+ $setString .= "<table>";
61
+
62
+ $setString .= '<tr><td><a href="javascript:slideonlyone(\'featuresBox\',\'' . WP_CONTENT_URL . '\');" id="myHead2" class="smackhelpswitcher_anchor">
63
+ <div class="smackhelpswitcher">' . $impCESett->t('FEATURE') . '<img src="' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/arrow_up.gif" id="featuresBox_img" class="smackhelpswitcher_img"></div></a></td></tr><tr><td>';
64
+ $setString .= "<tr><td><div id='featuresBox' class = 'switchercontent newboxes2'><table>";
65
+ $setString .= "<tr><td><label class=$automapping><input type='checkbox' name='automapping' value='automapping' onclick='savePluginSettings()' " . $automapping . ">" . $impCESett->t('ENABLEAUTOMAPPING') . "</label></td>";
66
+ $setString .= "<td><label class=$utfsupport><input type='checkbox' name='rutfsupport' value='utfsupport' onclick='savePluginSettings()' " . $utfsupport . ">" . $impCESett->t('ENABLEUTFSUPPORT') . "</label></td></tr></table></div></td></tr>";
67
+
68
+
69
+ $setString .= '<tr><td><a href="javascript:slideonlyone(\'moduleBox\',\'' . WP_CONTENT_URL . '\');" id="myHead2" class="smackhelpswitcher_anchor">
70
+ <div class="smackhelpswitcher">Modules<img src="' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/arrow_up.gif" id="featuresBox_img" class="smackhelpswitcher_img"></div></a></td></tr><tr><td>';
71
+ $setString .= "<div id = 'moduleBox' class = 'switchercontent newboxes2'><table><tr><td><ul>";
72
+ $setString .= "<li><label class='checked'><input type='checkbox' name='post' value='post' onclick='savePluginSettings()' disabled checked>" . $impCESett->t('POST') . "</label>";
73
+ $setString .= "<label class='checked'><input type='checkbox' name='custompost' value='custompost' onclick='savePluginSettings()' disabled checked>" . $impCESett->t('CUSTOMPOST') . "</label>";
74
+ $setString .= "<label class='checked'><input type='checkbox' name='page' value='page' onclick='savePluginSettings()' disabled checked>" . $impCESett->t('PAGE') . '</label>';
75
+ $setString .= "<label class=\"$comments\"><input type='checkbox' name='comments' value='comments' onclick='savePluginSettings()' " . $comments . ">" . $impCESett->t('COMMENTS') . "</label></li>";
76
+ $setString .= "<li><label class=$categories><input type='checkbox' name='categories' value='categories' onclick='savePluginSettings()' " . $categories . " >Categories/Tags</label>";
77
+ $setString .= "<label class=$customtaxonomy><input type='checkbox' name='customtaxonomy' value='customtaxonomy' onclick='savePluginSettings()' " . $customtaxonomy . " >Custom Taxonomy</label>";
78
+ $setString .= "<label class=$users><input type='checkbox' name='users' value='users' onclick='savePluginSettings()' " . $users . ">Users/Roles</label></li>";
79
+ $setString .= "</ul></td></tr></table></div></td></tr>";
80
+
81
+
82
+ $setString .= '<tr><td><a href="javascript:slideonlyone(\'thirdPartyBox\',\'' . WP_CONTENT_URL . '\');" id="myHead2" class="smackhelpswitcher_anchor">
83
+ <div class="smackhelpswitcher">' . $impCESett->t('THIRDPARTY') . '<img src="' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/arrow_up.gif" id="featuresBox_img" class="smackhelpswitcher_img"></div></a></td></tr><tr><td>';
84
+ $setString .= "<tr><td><div id='thirdPartyBox' class = 'switchercontent newboxes2'><table>";
85
+ $setString .= "<tr><td><b>Ecommerce</b></td></tr>";
86
+ $setString .= "<tr><td><label class=$nonerecommerce><input type = 'radio' name ='recommerce' value='nonerecommerce' onclick='savePluginSettings()' " . $nonerecommerce . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
87
+ $setString .= "<td><label class=\"$eshoptd $eshop\"><input type='radio' name='recommerce' value='eshop' onclick='savePluginSettings()' " . $eshop . " " . " class='ecommerce'>Eshop</label></td><td><label class=\"$wpcomtd $wpcommerce\"><input type='radio' name='recommerce' value='wpcommerce' onclick='savePluginSettings()' " . $wpcommerce . " class = 'ecommerce'>WP e-Commerce</label></td></tr>";
88
+ $setString .= "<tr><td><b>" . $impCESett->t('CUSTOMPOST') . "</b></td></tr>";
89
+ $setString .= "<tr><td><label class=$nonercustompost><input type = 'radio' name ='rcustompost' value='nonercustompost' onclick='savePluginSettings()' " . $nonercustompost . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
90
+ $setString .= "<td><label class=\"$cptutd $custompostuitype\"><input type ='radio' name = 'rcustompost' value='custompostuitype' onclick='savePluginSettings()' " . $custompostuitype . ">" . $impCESett->t('CUSTOMPOSTTYPE') . "</label></td>";
91
+ $setString .= "<td><label class=\"$cctmtd $cctm\"><input type ='radio' name = 'rcustompost' value='cctm' onclick='savePluginSettings()' " . $cctm . ">" . $impCESett->t('CCTM') . "</label>" . "</td></tr>";
92
+ $setString .= "<tr><td><b>" . $impCESett->t('SEO_OPTIONS') . "</b></td></tr>";
93
+ $setString .= "<tr><td><label class=$nonerseooption><input type = 'radio' name ='rseooption' value='nonerseooption' onclick='savePluginSettings()' " . $nonerseooption . " class='ecommerce'>" . $impCESett->t('NONE') . "</label></td>";
94
+ $setString .= "<td><label class=\"$aioseotd $aioseo\"><input type ='radio' name = 'rseooption' value='aioseo' onclick='savePluginSettings()' " . $aioseo . ">" . $impCESett->t('ALLINONESEO') . "</label></td>";
95
+ $setString .= "<td><label class=\"$yoasttd $yoastseo\"><input type ='radio' name = 'rseooption' value='yoastseo' onclick='savePluginSettings()' " . $yoastseo . ">" . $impCESett->t('YOASTSEO') . "</label></td></tr>";
96
+ $setString .= "<tr><td><b>" . $impCESett->t('CATEGORY_ICONS') . "</b></td></tr>";
97
+ $setString .= "<tr><td>" . $impCESett->t('PLUGINCHECK') . "</td></tr>";
98
+ $setString .= "<tr><td><label class=$enable><input type = 'radio' name ='rcateicons' value='enable' onclick='savePluginSettings()' " . $enable . " class='ecommerce'>" . $impCESett->t('ENABLE_CATEGOTY_ICONS') . "</label></td>";
99
+ $setString .= "<td><label><input type ='radio' name = 'rcateicons' value='disable' onclick='savePluginSettings()' " . $disable . ">" . $impCESett->t('DISABLE_CATEGORY_ICONS') . "</label></td></tr>";
100
+ $setString .= "</table></div></td></tr>";
101
+ $setString .= "<tr></tr></table><input type='button' class='action' name='savesettings' value='Save' style='float:left;' onclick='savePluginSettings()' /></form></div>";
102
+ return $setString;
103
+ }
104
+
105
+ /**
106
+ * Render description for each modules
107
+ */
108
+ function renderDesc()
109
+ {
110
+ return "<p>WP Ultimate CSV Importer Plugin helps you to manage the post,page and </br> custom post data's from a CSV file.</p>
111
+ <p>1. Admin can import the data's from any csv file.</p>
112
+ <p>2. Can define the type of post and post status while importing.</p>
113
+ <p>3. Provides header mapping feature to import the data's as your need.</p>
114
+ <p>4. Users can map coloumn headers to existing fields or assign as custom fileds.</p>
115
+ <p>5. Import unlimited datas as post.</p>
116
+ <p>6. Make imported post as published or make it as draft.</p>
117
+ <p>7. Added featured image import functionality.</p>
118
+ <p><b> Important Note:- </b></p>
119
+ <p><span style='color:red;'>1. Your csv should have the seperate column for post_date.
120
+ <br/>2. It must be in the following format. ( yyyy-mm-dd hh:mm:ss ).</span></p>
121
+ <p>Configuring our plugin is as simple as that. If you have any questions, issues and request on new features, plaese visit <a href='http://www.smackcoders.com/blog/category/free-wordpress-plugins' target='_blank'>Smackcoders.com blog </a></p>
122
+ <div align='center' style='margin-top:40px;'> 'While the scripts on this site are free, donations are greatly appreciated. '<br/><br/><a href='http://www.smackcoders.com/donate.html' target='_blank'><img src='" . WP_CONTENT_URL . "/plugins/wp-ultimate-csv-importer/images/paypal_donate_button.png' /></a><br/><br/><a href='http://www.smackcoders.com/' target='_blank'><img src='http://www.smackcoders.com/wp-content/uploads/2012/09/Smack_poweredby_200.png'></a>
123
+ </div><br/>";
124
+ }
125
+
126
+ /**
127
+ * Render menu for the plugin
128
+ */
129
+ function renderMenu()
130
+ {
131
+ $impSet = new IMPSettings();
132
+ $settings = $impSet->getSettings();
133
+ $impCEM = new SmackImpCE();
134
+ foreach ($settings as $key)
135
+ $$key = true;
136
+ if ($_POST['post_csv'] == 'Import')
137
+ $dashboard = 'selected';
138
+ else {
139
+ $action = $_REQUEST['action'];
140
+ $$action = 'selected';
141
+ }
142
+
143
+ if (!$_REQUEST['action'])
144
+ $dashboard = 'selected';
145
+ $menuHTML = "<div class='csv-top-navigation-wrapper' id='header' name='mainNavigation'><ul id='topNavigation'>";
146
+ $menuHTML .= "<li class=\"navigationMenu $post\" style='margin-left:0px;'><a href = 'admin.php?page=upload_csv_file&action=post' class = 'navigationMenu-link' id='module1'>" . $impCEM->t('POST') . "</a></li>";
147
+ $menuHTML .= "<li class=\"navigationMenu $page\"><a href = 'admin.php?page=upload_csv_file&action=page' class = 'navigationMenu-link' id='module1'>" . $impCEM->t("PAGE") . "</a></li>";
148
+ $menuHTML .= "<li class=\"navigationMenu $custompost\"><a href = 'admin.php?page=upload_csv_file&action=custompost' class = 'navigationMenu-link' id = 'module2'>" . $impCEM->t('CUSTOMPOST') . "</a></li>";
149
+ $menuHTML .= "<li class=\"navigationMenu $settings\"><a href = 'admin.php?page=upload_csv_file&action=settings' class='navigationMenu-link' id='module9'>" . $impCEM->t('SETTINGS') . "</a></li>";
150
+ $menuHTML .= "<li class=\"navigationMenu $dashboard\"><a href = 'admin.php?page=upload_csv_file&action=dashboard' class='navigationMenu-link' id='module0'>" . $impCEM->t('DASHBOARD') . "</a></li>";
151
+ $menuHTML .= "</ul></div> <div style='margin-top:-55px;float:right;margin-right:300px'><a href='http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html' target='_blank'><input type='button' class='button-primary' name='Upgradetopro' id='Upgradetopro' value='Upgrade To PRO' /></a></div> <div class='msg' id = 'showMsg' style = 'display:none;'></div>";
152
+ return $menuHTML;
153
+
154
+ }
155
+
156
+ /**
157
+ * Render post/page section
158
+ */
159
+ function renderPostPage()
160
+ {
161
+ $impCE = new SmackImpCE ();
162
+ $postForm = ' <div style="float: left; margin-top: 11px; margin-right: 5px;"><img src = "' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/Importicon_24.png"></div><div style="float:left;"><h2>' . $impCE->t('IMPORT_CSV_FILE') . '</h2></div></br></br><form class="add:the-list: validate" method="post"enctype="multipart/form-data" onsubmit="return file_exist();"><table class="importform">
163
+ <tr><td><label for="csv_import" class="uploadlabel" >' . $impCE->t('UPLOAD_FILE') . '<span class="mandatory"> *</span></label>
164
+ <input type="hidden" value="' . WP_CONTENT_URL . '" id="contenturl" />
165
+ <input name="csv_import" id="csv_import" class="btn" type="file" value="" />
166
+
167
+ </td></tr>';
168
+
169
+ if (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'custompost') || ($_REQUEST['action'] == 'page')) {
170
+
171
+ $postForm .= '<tr style="display:block;" id="detect"><td><label class="detectDup"><input type="checkbox" name="titleduplicatecheck" value=1> ' . $impCE->t("ENABLE_DUPLICATION_POST_TITLE") . '</label></td><td><label class="detectDup"><input type="checkbox" name="contentduplicatecheck" value=1> ' . $impCE->t("ENABLE_DUPLICATION_POST_CONTENT") . '</label></td></tr>';
172
+
173
+ }
174
+ $postForm .= '<tr><td><label class="uploadlabel">Delimiter</label><select name="delim" id="delim">
175
+ <option value=",">,</option>
176
+ <option value=";">;</option>
177
+ </select></td></tr>
178
+ </table>
179
+ <p>
180
+ <button type="submit" class="action addmarginright" name="Import" value="Import" align="right" onclick = "return validateFirstForm();"> Import</button>
181
+ </p>
182
+ </form></br></br>';
183
+ return $postForm;
184
+ }
185
+
186
+ /**
187
+ *return state of plugins - absent,present and active
188
+ */
189
+ function getPluginStateImg($plugin)
190
+ {
191
+ $state = '<img src ="' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/notdetected.png" class = "settingsicon">';
192
+ $settobj = new IMPSettings();
193
+ if ($settobj->isPluginPresent($plugin))
194
+ $state = '<img src ="' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/notactive.png" class = "settingsicon">';
195
+ if ($settobj->isPluginActive($plugin))
196
+ $state = '<img src ="' . WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/images/installed.png" class = "settingsicon">';
197
+ return $state;
198
+ }
199
+
200
+
201
+ /**
202
+ * Function to render the dashboard
203
+ */
204
+ function renderDashboard()
205
+ {
206
+ require_once('stats.php');
207
+ }
208
+
209
+ /**
210
+ *return state of plugins - absent,present and active
211
+ */
212
+ function getPluginState($plugin)
213
+ {
214
+ $state = 'pluginAbsent';
215
+ $settobj = new IMPSettings();
216
+ if ($settobj->isPluginPresent($plugin))
217
+ $state = 'pluginPresent';
218
+ if ($settobj->isPluginActive($plugin))
219
+ $state = 'pluginActive';
220
+ return $state;
221
+ }
222
+ }
223
+ ?>
class.settings.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class IMPSettings
3
+ {
4
+
5
+ public $activePlugins = array();
6
+
7
+ function __construct()
8
+ {
9
+ $this->activePlugins = get_option('active_plugins');
10
+ }
11
+
12
+ public function chkCustomPostPlugin()
13
+ {
14
+ $customPostType = $this->chkCustomTypePost();
15
+ $cctm = $this->chkCCTM();
16
+ if (($cctm) || ($customPostType))
17
+ return true;
18
+ else
19
+ return false;
20
+ }
21
+
22
+ public function chkCCTM()
23
+ {
24
+ if (in_array('custom-content-type-manager/index.php', $this->activePlugins))
25
+ return true;
26
+ else
27
+ return false;
28
+ }
29
+
30
+ public function chkCustomTypePost()
31
+ {
32
+ return true;
33
+ }
34
+
35
+ public function isPluginPresent($plugin)
36
+ {
37
+ $plugins = get_plugins();
38
+ $pluginName = array();
39
+ foreach ($plugins as $plug => $key)
40
+ $pluginName[] = $plug;
41
+ if (in_array($plugin, $pluginName))
42
+ return true;
43
+ else
44
+ return false;
45
+ }
46
+
47
+ public function isPluginActive($plugin)
48
+ {
49
+ if (in_array($plugin, $this->activePlugins))
50
+ return true;
51
+ else
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * Get Saved Settings
57
+ */
58
+ function getSettings()
59
+ {
60
+ return get_option('wpcsvprosettings');
61
+ }
62
+ }
css/blank.gif ADDED
Binary file
css/custom-style.css ADDED
@@ -0,0 +1,973 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .navigationMenu{
2
+ float:left;
3
+ cursor:pointer;
4
+ }
5
+ #helpatright li {
6
+ padding: 6px;
7
+ }
8
+ .versionbox{
9
+ width:100px;
10
+ }
11
+ .success {
12
+ background:#EFF5EA !important;
13
+ border: 1px solid #95A486 !important;
14
+ color: #3D6611 !important;
15
+ }
16
+ #dispLabel {
17
+ font-weight: bold;
18
+ text-align: center;
19
+ }
20
+ .mandatory{
21
+ color:red;
22
+ }
23
+ .addmarginright{
24
+ margin-right:30px;
25
+ }
26
+ .smack-wrap{
27
+ width:100%;
28
+ overflow:hidden;
29
+ }
30
+ .smack-postform{
31
+ width:50%;
32
+ float:left;
33
+ }
34
+ .module-desc{
35
+ width:50%;
36
+ float:right;
37
+ }
38
+ /*menu css*/
39
+ #header ul {
40
+ list-style: none;
41
+ padding: 0;
42
+ margin: 0;
43
+ }
44
+ .selected{
45
+ font-weight:bold;
46
+ border-bottom:1px solid white;
47
+ }
48
+ #header li {
49
+ float: left;
50
+ border: 2px solid #BCD5E1;
51
+ border-bottom-width: 0;
52
+ margin-left:5px;
53
+ -webkit-border-radius: 6px 6px 0 0;
54
+ -moz-border-radius: 6px 6px 0 0;
55
+ border-radius: 6px 6px 0 0;
56
+ }
57
+
58
+ #header a {
59
+ text-decoration: none;
60
+ display: block;
61
+ background: #E8F1F5;
62
+ padding: 7px 10px;
63
+ color: #103A4D;
64
+ text-align: center;
65
+ }
66
+
67
+ #header a:hover {
68
+ background: #D2E3EB;
69
+ }
70
+
71
+ #header #selected {
72
+ border-color: black;
73
+ }
74
+
75
+ #header #selected a {
76
+ position: relative;
77
+ top: 1px;
78
+ background: white;
79
+ color: black;
80
+ font-weight: bold;
81
+ }
82
+
83
+ #content {
84
+ border: 1px solid black;
85
+ clear: both;
86
+ padding: 0 1em;
87
+ }
88
+ .error {
89
+ background: #FAEBE7 !important;
90
+ border: 1px solid #F16048 !important;
91
+ color: #DF280A !important;
92
+ }
93
+ #topNavigation{
94
+ margin:20px;
95
+ font-size: 1.2em;
96
+ }
97
+ .success{
98
+ background-color:#EFF5EA;
99
+ border: 1px solid #95A486 !important;
100
+ color: #3D6611 !important;
101
+ }
102
+ .msg{
103
+ font-weight: bold !important;
104
+ margin: 0 auto !important;
105
+ width:60%;
106
+ text-align:center;
107
+ min-height: 23px !important;
108
+ padding: 8px 8px 2px 32px !important;
109
+ margin-top:5px !important;
110
+ }
111
+ .settingscontainer td input{
112
+ }
113
+ .settingscontainer td label{
114
+ margin:5px;
115
+ }
116
+ .error{
117
+ background-color:#FAEBE7 !important;
118
+ border: 1px solid #F16048 !important;
119
+ color: #DF280A !important;
120
+ }
121
+ .navigationMenu-link-active {
122
+ background-color: #808080;
123
+ border-top:1px solid #464646;
124
+ border-left:1px solid #464646;
125
+ border-right:1px solid #464646;
126
+ border-bottom:1px solid #FFFFFF;
127
+ padding: 5px;
128
+ margin: 3px;
129
+ border-top-left-radius: 6px;
130
+ border-top-right-radius: 6px;
131
+ color: #FFFFFF;
132
+ text-decoration: none;
133
+ }
134
+
135
+ .navigationMenu-link-active:hover {
136
+ color:#FFFFFF;
137
+ }
138
+ .formandhelp{
139
+ margin-top:20px;
140
+ }
141
+ .csv-top-navigation-wrapper {
142
+ padding-bottom: 6px;
143
+ display:block;
144
+ width:100%;
145
+ margin-top:20px;
146
+ margin-bottom:20px;
147
+ height:27px;
148
+ border-bottom:2px solid #BCD5E1;
149
+ }
150
+ #topNavigation .selected a{
151
+ background-color:#fff;
152
+ }
153
+ #topNavigation .selected{
154
+ border-bottom:2px solid white;
155
+ }
156
+ @media screen and (-webkit-min-device-pixel-ratio:0){
157
+ .csv-top-navigation-wrapper{
158
+ height:26px;
159
+ }
160
+ }
161
+ #pluginDetails h3,#overview-detail h3,#pluginManager h3{
162
+ padding: 7px;
163
+ font-weight:bold;
164
+ // color:#FFFFFF;
165
+ // border : 1px solid #21759B;
166
+ background-color: #F1F1F1;
167
+ font-style:oblique;
168
+ font-size:medium;
169
+ }
170
+
171
+ .dash-inside{
172
+ padding: 10px;
173
+ margin-top:-14px;
174
+ line-height:1.5;
175
+ border: 1px solid #EEEEEE;
176
+ }
177
+
178
+ .plugin-details{
179
+ height: 130px;
180
+ }
181
+
182
+ .company-detials{
183
+ // height:90px;
184
+ // margin-top:-25px;
185
+ }
186
+
187
+ .sociallinks{
188
+ float: right;
189
+ margin-top:-63px;
190
+ }
191
+
192
+ .poweredby{
193
+ margin-top:-30px;
194
+ float:right;
195
+ }
196
+ #csv_import{
197
+ float:left;
198
+ }
199
+ .rateus{
200
+ width:25%;
201
+ }
202
+
203
+ .dash-manager{
204
+ padding:7px;
205
+ }
206
+
207
+ .dashboard-box{
208
+ font-weight: normal;
209
+ line-height: 1;
210
+ margin: 0;
211
+ width:75%;
212
+ float:left;
213
+ padding: 7px 10px;
214
+ }
215
+
216
+ .dashboardbox {
217
+ width: 99%;
218
+ }
219
+
220
+ .smack-left{
221
+ font-size:1.2em;
222
+ font-style:oblique;
223
+ font-family:Georgia;
224
+ text-align:left;
225
+ }
226
+
227
+ .smack-right{
228
+ font-weight:bold;
229
+ font-style:oblique;
230
+ font-size:medium;
231
+ font-family:Georgia;
232
+ text-align:right;
233
+ }
234
+
235
+ .smack-thead{
236
+ font-size: 1em;
237
+ }
238
+
239
+ .t-head{
240
+ text-align:center;
241
+ font-weight:bold;
242
+ }
243
+
244
+ .t-small{
245
+ min-width: 13%;
246
+ }
247
+
248
+ .t-medium{
249
+ min-width: 20%;
250
+ }
251
+
252
+ .t-big{
253
+ min-width: 28%;
254
+ }
255
+
256
+ .t-tiny{
257
+ min-width: 6%;
258
+ padding:5px;
259
+ }
260
+
261
+ .dash-action{
262
+ cursor:pointer;
263
+ text-decoration:none;
264
+ }
265
+
266
+ .smackHeler{
267
+ font-weight: bold;
268
+ font-size: 1.2em;
269
+ text-align: center;
270
+ width: 100%;
271
+ color:red;
272
+ }
273
+
274
+ .smackaltrow{
275
+ background-color: #F9F9F9;
276
+ }
277
+
278
+ .smackhelpswitcher{
279
+ border-bottom: 1px solid #A2A29D;
280
+ background-color: #E8F1F5;
281
+ text-decoration:none;
282
+ padding: 5px;
283
+ font-size: medium;
284
+ font-weight: bold;
285
+ padding: 7px;
286
+ min-width:600px;
287
+ }
288
+ .switchercontent{
289
+ border: 1px solid #EEEEEE;
290
+ background-color: #FFFFFF;
291
+ display: none;
292
+ padding: 5px;
293
+ }
294
+
295
+ .switchercontentodd{
296
+ border: 1px solid #EEEEEE;
297
+ background-color: #FFFFFF;
298
+ display: block;
299
+ font-style: oblique;
300
+ padding: 5px;
301
+ }
302
+
303
+ .smackhelpswitcher_anchor{
304
+ text-decoration:none;
305
+ color:#515151;
306
+ width:100%;
307
+ }
308
+
309
+ .smackhelpswitcher_img{
310
+ float:right;
311
+ }
312
+ .settingsicon {
313
+ margin-bottom: -4px;
314
+ }
315
+ .pluginAbsent:hover{
316
+ color:red;
317
+ }
318
+ .pluginPresent:hover{
319
+ color:red;
320
+ }
321
+ .pluginActive:hover{
322
+ color:green;
323
+ }
324
+ /*settings page*/
325
+ /* added now -- */
326
+ /*html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin: 0;padding: 0;border: 0;outline: 0;font-size: 100%;vertical-align: baseline;background: transparent;}body {line-height: 1;}ol, ul {list-style: none;}blockquote, q {quotes:none;}blockquote:before, blockquote:after, q:before, q:after {content: '';content: none;}:focus {outline: 0;}ins {text-decoration: none;}del {text-decoration: line-through;}table {border-collapse: collapse;border-spacing: 0;}
327
+ body {font-size:87.5%;font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;font-weight:300;color:#8c8a8b;text-align:center;line-height:1.7em;}
328
+ a:link, a:visited, strong {color:#e15d46;}
329
+ a:hover {text-decoration:none;}
330
+ h1 {font-size:6em;font-family: 'Engagement', cursive;line-height:1.89em;text-shadow:1px 1px 0px #fff, 2px 2px 0px rgba(0, 0, 0, 0.1), 3px 3px 0px #fff, 4px 4px 0px rgba(0, 0, 0, 0.1), 5px 5px 0px #fff;}
331
+ .left {float:left;}
332
+ .right {float:right;}
333
+ form {width:560px;margin:0px auto;text-align:left;}
334
+ p {border-top:1px dotted #c7c7c7;}
335
+ li {border-top:1px dotted #c7c7c7;min-height:27px;}
336
+
337
+ /*****************/
338
+ /* The actual form */
339
+ /*****************/
340
+ /*
341
+ label {
342
+ float:left;
343
+ width:180px;
344
+ }
345
+
346
+ input,
347
+ select,
348
+ textarea,
349
+ button {
350
+ background:#fff;
351
+ font-size:1em;
352
+ font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
353
+ font-weight:300;
354
+ color:#8c8a8b;
355
+ }
356
+
357
+ input[type=text],
358
+ input[type=password],
359
+ input[type=email],
360
+ textarea {
361
+ border:1px solid #c7c7c7;
362
+ outline:5px solid rgba(0, 0, 0, 0.1);
363
+ padding:3px 5px;
364
+ }
365
+
366
+ input[type=text]:focus,
367
+ input[type=text]:active,
368
+ input[type=password]:active,
369
+ input[type=password]:focus,
370
+ input[type=email]:active,
371
+ input[type=email]:focus,
372
+ textarea:active,
373
+ textarea:focus {
374
+ outline:5px solid rgba(0, 0, 0, 0.2);
375
+ }
376
+
377
+ textarea {
378
+ height:174px;
379
+ }
380
+
381
+ button {
382
+ background: #f2f2f2;
383
+ background: -moz-linear-gradient(top, #f2f2f2 0%, #e8e8e8 100%);
384
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f2f2), color-stop(100%,#e8e8e8));
385
+ background: -webkit-linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
386
+ background: -o-linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
387
+ background: -ms-linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
388
+ background: linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
389
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f2f2f2', endColorstr='#e8e8e8',GradientType=0 );
390
+ -webkit-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 1);
391
+ -moz-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 1);
392
+ box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 1);
393
+ border-color: #eeeced #eeeced #9b9b9b;
394
+ border-style: solid;
395
+ border-width: 1px;
396
+ -webkit-border-radius: 20px;
397
+ -moz-border-radius: 20px;
398
+ border-radius: 20px;
399
+ padding:5px 30px;
400
+ font-weight:bold;
401
+ text-shadow:0px 1px 0px #fff;
402
+ cursor:pointer;
403
+ }
404
+
405
+ button:hover {
406
+ background:#f5f5f5;
407
+ }
408
+
409
+ button:focus,
410
+ button:active {
411
+ background:#e8e8e8;
412
+ }
413
+
414
+ button.action {
415
+ background: #fa765f;
416
+ background: -moz-linear-gradient(top, #fa765f 0%, #e15d46 100%);
417
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fa765f), color-stop(100%,#e15d46));
418
+ background: -webkit-linear-gradient(top, #fa765f 0%,#e15d46 100%);
419
+ background: -o-linear-gradient(top, #fa765f 0%,#e15d46 100%);
420
+ background: -ms-linear-gradient(top, #fa765f 0%,#e15d46 100%);
421
+ background: linear-gradient(top, #fa765f 0%,#e15d46 100%);
422
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fa765f', endColorstr='#e15d46',GradientType=0 );
423
+ -webkit-box-shadow: inset 0px 1px 0px 0px rgba(255, 179, 166, 1);
424
+ -moz-box-shadow: inset 0px 1px 0px 0px rgba(255, 179, 166, 1);
425
+ box-shadow: inset 0px 1px 0px 0px rgba(255, 179, 166, 1);
426
+ border-color: #fc7f6b #fc7f6b #d0432f;
427
+ color:#b13e2d;
428
+ text-shadow:0px 1px 0px #ffb3a5;
429
+ float:right;
430
+ }
431
+
432
+ button.action:hover {
433
+ background:#fa765f;
434
+ }
435
+
436
+ button.action:focus,
437
+ button.action:active {
438
+ background:#e15d46;
439
+ }
440
+
441
+ /*
442
+
443
+ Uniform Theme: Sexy Peach
444
+ Version: 1.0
445
+ By: Peter Wimren
446
+ License: Creative Commons Share Alike
447
+ ---
448
+ For use with the Uniform plugin:
449
+ http://pixelmatrixdesign.com/uniform/
450
+
451
+
452
+
453
+
454
+ div.selector,
455
+ div.selector span,
456
+ div.checker span,
457
+ div.radio span,
458
+ div.uploader,
459
+ div.uploader span.action {
460
+ background-image: url(../images/sprite.png);
461
+ background-repeat: no-repeat;
462
+ }
463
+
464
+ .selector,
465
+ .radio,
466
+ .checker,
467
+ .uploader,
468
+ .selector *,
469
+ .radio *,
470
+ .checker *,
471
+ .uploader *{
472
+ margin: 0;
473
+ padding: 0;
474
+ }
475
+
476
+ /* SPRITES */
477
+
478
+ /* Select */
479
+ /*
480
+ div.selector {
481
+ background-position: -483px -160px;
482
+ line-height: 32px;
483
+ height: 32px;float:left;
484
+ }
485
+
486
+ div.selector span {
487
+ background-position: right 0px;
488
+ height: 32px;
489
+ line-height: 32px;
490
+ }
491
+ .selector option {padding:3px;border-bottom:1px dotted #ccc;}
492
+ div.selector select {
493
+ top:2px;
494
+ left:10px;border:1px solid #333;
495
+ }
496
+
497
+ div.selector:active,
498
+ div.selector.active {
499
+ background-position: -483px -192px;
500
+ }
501
+
502
+ div.selector:active span,
503
+ div.selector.active span {
504
+ background-position: right -32px;
505
+ }
506
+
507
+ div.selector.focus, div.selector.hover, div.selector:hover {
508
+ background-position: -483px -224px;
509
+ }
510
+
511
+ div.selector.focus span, div.selector.hover span, div.selector:hover span {
512
+ background-position: right -64px;
513
+ }
514
+
515
+ div.selector.focus:active,
516
+ div.selector.focus.active,
517
+ div.selector:hover:active,
518
+ div.selector.active:hover {
519
+ background-position: -483px -256px;
520
+ }
521
+
522
+ div.selector.focus:active span,
523
+ div.selector:hover:active span,
524
+ div.selector.active:hover span,
525
+ div.selector.focus.active span {
526
+ background-position: right -96px;
527
+ }
528
+
529
+ div.selector.disabled,
530
+ div.selector.disabled:active,
531
+ div.selector.disabled.active {
532
+ background-position: -483px -288px;
533
+ }
534
+
535
+ div.selector.disabled span,
536
+ div.selector.disabled:active span,
537
+ div.selector.disabled.active span {
538
+ background-position: right -128px;
539
+ }
540
+
541
+ div.checker {
542
+ width: 23px;
543
+ height: 23px;
544
+ top: -4px;
545
+ }
546
+
547
+ div.checker input {
548
+ width: 23px;
549
+ height: 23px;
550
+ }
551
+
552
+ div.checker span {
553
+ background-position: 0px -320px;
554
+ height: 23px;
555
+ width: 23px;
556
+ }
557
+
558
+ div.checker:active span,
559
+ div.checker.active span {
560
+ background-position: -23px -320px;
561
+ }
562
+
563
+ div.checker.focus span,
564
+ div.checker:hover span {
565
+ background-position: -46px -320px;
566
+ }
567
+
568
+ div.checker.focus:active span,
569
+ div.checker:active:hover span,
570
+ div.checker.active:hover span,
571
+ div.checker.focus.active span {
572
+ background-position: -69px -320px;
573
+ }
574
+
575
+ div.checker span.checked {
576
+ background-position: -92px -320px;
577
+ }
578
+
579
+ div.checker:active span.checked,
580
+ div.checker.active span.checked {
581
+ background-position: -115px -320px;
582
+ }
583
+
584
+ div.checker.focus span.checked,
585
+ div.checker:hover span.checked {
586
+ background-position: -138px -320px;
587
+ }
588
+
589
+ div.checker.focus:active span.checked,
590
+ div.checker:hover:active span.checked,
591
+ div.checker.active:hover span.checked,
592
+ div.checker.active.focus span.checked {
593
+ background-position: -161px -320px;
594
+ }
595
+
596
+ div.checker.disabled span,
597
+ div.checker.disabled:active span,
598
+ div.checker.disabled.active span {
599
+ background-position: -184px -320px;
600
+ }
601
+
602
+ div.checker.disabled span.checked,
603
+ div.checker.disabled:active span.checked,
604
+ div.checker.disabled.active span.checked {
605
+ background-position: -207px -320px;
606
+ }
607
+
608
+ div.radio {
609
+ width: 23px;
610
+ height: 23px;
611
+ top: -4px;
612
+ }
613
+
614
+ div.radio input {
615
+ width: 23px;
616
+ height: 23px;
617
+ }
618
+
619
+ div.radio span {
620
+ height: 23px;
621
+ width: 23px;
622
+ background-position: 0px -343px;
623
+ }
624
+
625
+ div.radio:active span,
626
+ div.radio.active span {
627
+ background-position: -23px -343px;
628
+ }
629
+
630
+ div.radio.focus span,
631
+ div.radio:hover span {
632
+ background-position: -46px -343px;
633
+ }
634
+
635
+ div.radio.focus:active span,
636
+ div.radio:active:hover span,
637
+ div.radio.active:hover span,
638
+ div.radio.active.focus span {
639
+ background-position: -69px -343px;
640
+ }
641
+
642
+ div.radio span.checked {
643
+ background-position: -92px -343px;
644
+ }
645
+
646
+ div.radio:active span.checked,
647
+ div.radio.active span.checked {
648
+ background-position: -115px -343px;
649
+ }
650
+
651
+ div.radio.focus span.checked, div.radio:hover span.checked {
652
+ background-position: -138px -343px;
653
+ }
654
+
655
+ div.radio.focus:active span.checked,
656
+ div.radio:hover:active span.checked,
657
+ div.radio.focus.active span.checked,
658
+ div.radio.active:hover span.checked {
659
+ background-position: -161px -343px;
660
+ }
661
+
662
+ div.radio.disabled span,
663
+ div.radio.disabled:active span,
664
+ div.radio.disabled.active span {
665
+ background-position: -184px -343px;
666
+ }
667
+
668
+ div.radio.disabled span.checked,
669
+ div.radio.disabled:active span.checked,
670
+ div.radio.disabled.active span.checked {
671
+ background-position: -207px -343px;
672
+ }
673
+
674
+ div.uploader {
675
+ background-position: 0px -366px;
676
+ height: 32px;
677
+ }
678
+
679
+ div.uploader span.action {
680
+ background-position: right -494px;
681
+ height: 24px;
682
+ line-height: 24px;
683
+ }
684
+
685
+ div.uploader span.filename {
686
+ height: 24px;
687
+
688
+ margin: 4px 0px 4px 0px;
689
+ line-height: 24px;
690
+ }
691
+
692
+ div.uploader.focus,
693
+ div.uploader.hover,
694
+ div.uploader:hover {
695
+ background-position: 0px -430px;
696
+ }
697
+
698
+ div.uploader.focus span.action,
699
+ div.uploader.hover span.action,
700
+ div.uploader:hover span.action {
701
+ background:#f2f2f2;
702
+ }
703
+
704
+ div.uploader.active span.action,
705
+ div.uploader:active span.action {
706
+ background-position: right -558px;
707
+ }
708
+
709
+ div.uploader.focus.active span.action,
710
+ div.uploader:focus.active span.action,
711
+ div.uploader.focus:active span.action,
712
+ div.uploader:focus:active span.action {
713
+ background-position: right -590px;
714
+ }
715
+
716
+ div.uploader.disabled {
717
+ background-position: 0px -398px;
718
+ }
719
+
720
+ div.uploader.disabled span.action {
721
+ background-position: right -462px;
722
+ }
723
+
724
+
725
+
726
+
727
+ div.selector {
728
+ margin-bottom:0px;
729
+ width: 250px;
730
+ color: #464545;
731
+ font-size: 14px;cursor:pointer;
732
+ }
733
+
734
+ div.selector select {
735
+ width: 250px;
736
+ }
737
+
738
+ div.selector span {
739
+ padding: 2px 25px 0px 2px;
740
+ cursor: pointer;
741
+ color:#8c8a8b;
742
+ width: 226px;
743
+ text-shadow: 0px 1px 0px #fff;
744
+ }
745
+
746
+ div.selector.disabled span {
747
+ color: #bbb;
748
+ }
749
+
750
+
751
+ div.checker {
752
+ margin-right: 10px;
753
+ }
754
+ div.radio {
755
+ margin-right: 10px;
756
+ }
757
+
758
+
759
+ div.uploader {
760
+ width: 282px;
761
+ margin-bottom: 20px;
762
+ cursor: pointer;
763
+ outline:5px solid rgba(0, 0, 0, 0.1);
764
+ }
765
+
766
+ div.uploader:focus, div.uploader:active {
767
+ outline:5px solid rgba(0, 0, 0, 0.2);
768
+ }
769
+
770
+ div.uploader span.action {
771
+ width: 120px;
772
+ text-align: center;
773
+ text-shadow:#fff 0px 1px 0px;
774
+ font-weight: bold;
775
+ background: #f2f2f2;
776
+ background: -moz-linear-gradient(top, #f2f2f2 0%, #e8e8e8 100%);
777
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f2f2), color-stop(100%,#e8e8e8));
778
+ background: -webkit-linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
779
+ background: -o-linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
780
+ background: -ms-linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
781
+ background: linear-gradient(top, #f2f2f2 0%,#e8e8e8 100%);
782
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f2f2f2', endColorstr='#e8e8e8',GradientType=0 );
783
+ -webkit-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 1);
784
+ -moz-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 1);
785
+ box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 1);
786
+ border-right:1px solid #c7c7c7;
787
+ border-left:1px solid #c7c7c7;
788
+ }
789
+
790
+ div.uploader:focus span.action, div.uploader:active span.action {
791
+ background:#e8e8e8;
792
+ }
793
+
794
+ div.uploader span.filename {
795
+ width: 140px;
796
+ }
797
+
798
+ div.uploader input {
799
+ width: 282px;
800
+ }
801
+
802
+ div.uploader.disabled span.action {
803
+ color: #aaa;
804
+ }
805
+
806
+ div.uploader.disabled span.filename {
807
+ border-color: #ddd;
808
+ color: #aaa;
809
+ }
810
+
811
+
812
+ CORE FUNCTIONALITY
813
+
814
+ Not advised to edit stuff below this line
815
+ -----------------------------------------------------
816
+ .selector select:focus, .radio input:focus, .checker input:focus, uploader input:focus {
817
+ outline: 0;
818
+ }
819
+
820
+ div.selector {
821
+ position: relative;
822
+ padding-left: 10px;
823
+ }
824
+
825
+ div.selector span {
826
+ display: block;
827
+ float: left;
828
+ }
829
+
830
+ div.selector select {
831
+ position: absolute;
832
+ opacity: 0;
833
+ }
834
+
835
+
836
+ div.checker {
837
+ position: relative;
838
+ float: left;
839
+ }
840
+
841
+ div.checker span {
842
+ display: block;
843
+ float: left;
844
+ text-align: center;
845
+ }
846
+
847
+ div.checker input {
848
+ opacity: 0;
849
+ display: inline-block;
850
+ }
851
+
852
+
853
+ div.radio {
854
+ position: relative;
855
+ float: left;
856
+ }
857
+
858
+ div.radio span {
859
+ display: block;
860
+ float: left;
861
+ text-align: center;
862
+ }
863
+
864
+ div.radio input {
865
+ opacity: 0;
866
+ text-align: center;
867
+ display: inline-block;
868
+ }
869
+
870
+ div.uploader {
871
+ position: relative;
872
+ float: left;
873
+ overflow: hidden;
874
+ }
875
+
876
+ div.uploader span.action {
877
+ float: left;
878
+ display: inline;
879
+ margin:1px 0px;
880
+ overflow: hidden;
881
+ cursor: pointer;
882
+ padding:3px 0px;*//*
883
+ }
884
+
885
+ div.uploader span.filename {
886
+ padding: 0px 10px;
887
+ float: left;
888
+ display: block;
889
+ overflow: hidden;
890
+ text-overflow: ellipsis;
891
+ white-space: nowrap;
892
+ }
893
+
894
+ div.uploader input {
895
+ opacity: 0;
896
+ position: absolute;
897
+ top: 0;
898
+ right: 0;
899
+ bottom: 0;
900
+ float: right;
901
+ }
902
+ label.checked{
903
+ color:#203E7C;
904
+ #text-decoration:underline;
905
+ }*/
906
+ table.importform{
907
+ width:100%;
908
+ margin-top:25px;
909
+ }
910
+ .detectDup {
911
+ width: 220px;
912
+ }
913
+ .detectDup1 {
914
+ width: 150px;
915
+ }
916
+
917
+ table.importform td{
918
+ padding-top:20px;
919
+ }
920
+ .maperror{
921
+ position:fixed;
922
+ z-index:999;
923
+ width:250px;
924
+ right:200px;
925
+ }
926
+ .iconatright{
927
+ float:right;
928
+ }
929
+ .helpatright{
930
+ border: 1px solid #EEEEEE;
931
+ margin-top: 25px;
932
+ }
933
+ .helpatright li{
934
+ padding:15px;
935
+ }
936
+ .helpatright > ul{
937
+ margin-top:40px;
938
+ }
939
+ div.helpatright h4{
940
+ float:left;
941
+ padding:0 0 0 18px;
942
+ }
943
+ .tickWrongImg{
944
+ display: block;
945
+ padding-left: 10px;
946
+ }
947
+ #dashboard-wrap{
948
+ margin-bottom:20px;
949
+ }
950
+ .uploadlabel{
951
+ float:left;
952
+ width:100px;
953
+ }
954
+ .renameOrUpdate{
955
+ display:none;
956
+ }
957
+ .secondform{
958
+ }
959
+ #posttypecss td{
960
+ padding:10px;
961
+ }
962
+ #display_area td{
963
+ padding:10px;
964
+ }
965
+ .customfieldtext{
966
+ margin-left:25px;
967
+ }
968
+
969
+ .upgradetopro {
970
+ color: red;
971
+ font-weight: bold;
972
+ text-align: center;
973
+ }
css/fancybox_loading.gif ADDED
Binary file
css/fancybox_loading@2x.gif ADDED
Binary file
css/fancybox_overlay.png ADDED
Binary file
css/fancybox_sprite.png ADDED
Binary file
css/fancybox_sprite@2x.png ADDED
Binary file
images/HeadersExplained.jpeg ADDED
Binary file
images/Importicon_24.png ADDED
Binary file
images/SubscribeViaEmail.gif ADDED
Binary file
images/arrow_down.gif ADDED
Binary file
images/arrow_up.gif ADDED
Binary file
images/bg.gif ADDED
Binary file
images/csv-pro_01.png ADDED
Binary file
images/csv-pro_02.png ADDED
Binary file
images/csv-pro_04.png ADDED
Binary file
images/csv-pro_06.png ADDED
Binary file
images/csv-pro_07.png ADDED
Binary file
images/csv-pro_08.png ADDED
Binary file
images/csv-pro_10.png ADDED
Binary file
images/csv-pro_11.png ADDED
Binary file
images/csv-pro_13.png ADDED
Binary file
images/csv-pro_14.png ADDED
Binary file
images/csv-pro_16.png ADDED
Binary file
images/csv-pro_18.png ADDED
Binary file
images/csv-pro_19.png ADDED
Binary file
images/csv-pro_20.png ADDED
Binary file
images/csv-pro_21.png ADDED
Binary file
images/csv_delete.png ADDED
Binary file
images/csv_download.png ADDED
Binary file
images/csv_download_all.png ADDED
Binary file
images/csv_records_delete.png ADDED
Binary file
images/custompostuitype.png ADDED
Binary file
images/delete_records.png ADDED
Binary file
images/eshop.png ADDED
Binary file
images/facebook.png ADDED
Binary file
images/googleplus.png ADDED
Binary file
images/icon.png CHANGED
Binary file
images/importerpro.png ADDED
Binary file
images/linkedin.png ADDED
Binary file
images/notactive.png ADDED
Binary file
images/notok.png ADDED
Binary file
images/ok.png ADDED
Binary file
images/paypal_donate_button.png CHANGED
File without changes
images/spacer.gif ADDED
Binary file
images/sprite.png ADDED
Binary file
images/stats.png ADDED
Binary file
images/stats5263_03.png ADDED
Binary file
images/stats5263_05.png ADDED
Binary file
images/stats5263_09.png ADDED
Binary file
images/stats5263_12.png ADDED
Binary file
images/stats5263_15.png ADDED
Binary file
images/stats5263_17.png ADDED
Binary file
images/trash_records.png ADDED
Binary file
images/twitter.png ADDED
Binary file
imported_csv/readme.txt DELETED
File without changes
languages/en_us.php CHANGED
@@ -5,18 +5,49 @@
5
  */
6
 
7
  $slang = Array(
8
- 'ENABLE_DUPLICATION_POST_TITLE'=>'Enable duplicate Post Title detection',
9
- 'ENABLE_DUPLICATION_POST_CONTENT'=>'Enable duplicate Post Content detection',
10
  'UPLOAD_PERMISSION_ERROR'=>'Your WordPress doesn\'t have the uploads folder. Please create the uploads folders and set write permission for that.',
11
  'IMPORT_AGAIN'=>'Import Again',
12
  'NOTE' => 'Note',
13
  'NOTE_CONTENT_1' => 'Your CSV should contain "," or ";" as delimiters.',
14
  'NOTE_CONTENT_2' => 'In CSV, tags should be seperated by "," to import mutiple tags and categories should be seperated by "|" to import multiple categories.',
15
  'CHOOSE_ANOTHER_DELIMITER' => 'Your CSV file cannot be processed. It may contains wrong delimiter, kindly choose another delimiter.',
 
16
  'IMPORT_CSV_FILE' => 'Import CSV File',
17
  'UPLOAD_FILE' => 'Upload file',
18
- 'ENABLE_DUPLICATION_HINT' => '(Enabling this options may slow down the import process)',
19
- 'PASSWORD_HINT' => 'Type your password here',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  );
21
 
22
  ?>
5
  */
6
 
7
  $slang = Array(
8
+ 'ENABLE_DUPLICATION_POST_TITLE'=>'Detect Duplicate Post Title',
9
+ 'ENABLE_DUPLICATION_POST_CONTENT'=>'Detect Duplicate Post Content',
10
  'UPLOAD_PERMISSION_ERROR'=>'Your WordPress doesn\'t have the uploads folder. Please create the uploads folders and set write permission for that.',
11
  'IMPORT_AGAIN'=>'Import Again',
12
  'NOTE' => 'Note',
13
  'NOTE_CONTENT_1' => 'Your CSV should contain "," or ";" as delimiters.',
14
  'NOTE_CONTENT_2' => 'In CSV, tags should be seperated by "," to import mutiple tags and categories should be seperated by "|" to import multiple categories.',
15
  'CHOOSE_ANOTHER_DELIMITER' => 'Your CSV file cannot be processed. It may contains wrong delimiter, kindly choose another delimiter.',
16
+ 'THIRDPARTY' => 'Third Party Plugins',
17
  'IMPORT_CSV_FILE' => 'Import CSV File',
18
  'UPLOAD_FILE' => 'Upload file',
19
+ 'DASHBOARD' => 'Dashboard',
20
+ 'POST' => 'Post',
21
+ 'PAGE' => 'Page',
22
+ 'CUSTOMPOST' => 'Custom Post',
23
+ 'CATEGORIESTAGS' => 'Categories/Tags',
24
+ 'USERSROLES' => 'Users/Roles',
25
+ 'CUSTOMTAXONOMY' => 'Custom Taxonomy',
26
+ 'COMMENTS' => 'Comments',
27
+ 'HELP' => 'Help',
28
+ 'SETTINGS' => 'Settings',
29
+ 'CUSTOMPOSTTYPE' => 'Custom Post Type UI',
30
+ 'CCTM' => 'CCTM',
31
+ 'PLUGINSUPPORT' => 'Plugin Support',
32
+ 'NONE' => 'None',
33
+ 'ESHOP' => 'EShop',
34
+ 'PROMODULES' => 'Pro Modules',
35
+ 'WPECOMMERCE' => 'WP e-Commerce',
36
+ 'SEO_OPTIONS' => 'SEO Plugins',
37
+ 'FEATURE' => 'Features',
38
+ 'ECOMMERCE' => 'Ecommerce',
39
+ 'ALLINONESEO' => 'All-in-one-SEO',
40
+ 'YOASTSEO' => 'WordPress SEO by Yoast',
41
+ 'CATEGORY_ICONS' => 'Category Icons',
42
+ 'ENABLE_CATEGOTY_ICONS' => 'Enable',
43
+ 'DISABLE_CATEGORY_ICONS' => 'Disable',
44
+ 'PLUGINCHECK' => 'Active/In Active/Not Present',
45
+ 'AUTOMAPPING' => 'Auto Mapping',
46
+ 'ENABLEAUTOMAPPING' => 'Enable Auto-Mapping',
47
+ 'UTFSUPPORT' => 'UTF-Support',
48
+ 'ENABLEUTFSUPPORT' => 'Enable UTF-8 Support',
49
+ 'UPDATE_WITH_POST_ID' => 'Update With Post Id',
50
+ 'UPDATE_WITH_POST_TITLE' => 'Update With Post Title',
51
  );
52
 
53
  ?>
plugin_config.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $settings = Array
3
+ (
4
+ 'recommerce' => 'nonerecommerce',
5
+ 'rcustompost' => 'nonercustompost',
6
+ 'savesettings' => 'Save',
7
+ );
8
+ update_option('wpcsvprosettings', $settings );
9
+ ?>
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
stats.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='upgradetopro' id='upgradetopro' style=''>Dashboard feature is only available in Pro Version, Please <a href='http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html' target='_blank' >UPGRADE TO PRO</a></div>
2
+ <div style="margin-left:-13px;width:95%;clear:both;">
3
+ <table id="Table_01" width="100%" height="873" border="0" cellpadding="0" cellspacing="0">
4
+ <tbody><tr>
5
+ <td colspan="11">
6
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_01.png" width="100%" height="73" alt="" title="Upgrade to PRO Now"></td>
7
+ </tr>
8
+ <tr>
9
+ <td rowspan="6">
10
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_02.png" width="142" height="799" alt="" title="Upgrade to PRO Now" style="margin-top:-22px;"></td>
11
+ <td colspan="3">
12
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/stats5263_03.png" width="306" height="252" border="0" alt="Upgrade to Pro Now" title="Upgrade to PRO Now" style="margin-top:-27px;cursor:pointer;" /></td>
13
+ <td colspan="2" rowspan="2">
14
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_04.png" width="173" height="294" alt="" title="Upgrade to PRO Now" style="margin-top:-23px;"></td>
15
+ <td colspan="5">
16
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/stats5263_05.png" width="580" height="252" border="0" alt="Upgrade to Pro Now" style="cursor:pointer;" title="Upgrade to PRO Now" /></td>
17
+ </tr>
18
+ <tr>
19
+ <td colspan="3" rowspan="3">
20
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_06.png" width="306" height="166" alt="" title="Upgrade to PRO Now" style="margin-top: -23px;"></td>
21
+ <td colspan="5">
22
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_07.png" width="580" height="42" alt="" title="Upgrade to PRO Now" style="margin-top:-27px;"></td>
23
+ </tr>
24
+ <tr>
25
+ <td rowspan="4">
26
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_08.png" width="105" height="505" alt="" title="Upgrade to PRO Now" style="margin-top: -3px;"></td>
27
+ <td colspan="6">
28
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/stats5263_09.png" width="648" height="35" border="0" alt="Upgrade to Pro Now" title="Upgrade to PRO Now" style="cursor:pointer;" /></td>
29
+ </tr>
30
+ <tr>
31
+ <td colspan="6">
32
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_10.png" width="648" height="89" alt="" title="Upgrade to PRO Now" style="margin-top: -4px;"></td>
33
+ </tr>
34
+ <tr>
35
+ <td rowspan="2">
36
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_11.png" width="111" height="381" alt="" title="Upgrade to PRO Now" style="margin-top: -7px;"></td>
37
+ <td>
38
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/stats5263_12.png" width="171" height="359" border="0" alt="Upgrade to Pro Now" title="Upgrade to PRO Now" style="margin-top: -4px;cursor:pointer;" /></td>
39
+ <td rowspan="2">
40
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_13.png" width="24" height="381" alt="" title="Upgrade to PRO Now" style="margin-top: -7px;"></td>
41
+ <td colspan="2" rowspan="2">
42
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_14.png" width="233" height="381" alt="" title="Upgrade to PRO Now" style="margin-top: -8px;"></td>
43
+ <td>
44
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/stats5263_15.png" width="132" height="359" border="0" alt="Upgrade to Pro Now" title="Upgrade to PRO Now" style="margin-top: -4px;cursor:pointer;" /></td>
45
+ <td rowspan="2">
46
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_16.png" width="37" height="381" alt="" title="Upgrade to PRO Now" style="margin-top: -8px;"></td>
47
+ <td>
48
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/stats5263_17.png" width="200" height="359" border="0" alt="Upgrade to Pro Now" title="Upgrade to PRO Now" style="margin-top: -4px;cursor:pointer;" /></td>
49
+ <td rowspan="2">
50
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_18.png" width="46" height="381" alt="" title="Upgrade to PRO Now" style="margin-top: -8px;"></td>
51
+ </tr>
52
+ <tr>
53
+ <td>
54
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_19.png" width="171" alt="" title="Upgrade to PRO Now" style="margin-top:-8px;"></td>
55
+ <td>
56
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_20.png" width="132" height="22" alt="" title="Upgrade to PRO Now" style="margin-top:-7px;"></td>
57
+ <td>
58
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/csv-pro_21.png" width="200" height="22" alt="" title="Upgrade to PRO Now" style="margin-top: 0px;"></td>
59
+ </tr>
60
+ <tr>
61
+ <td>
62
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="142" height="1" alt=""></td>
63
+ <td>
64
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="111" height="1" alt=""></td>
65
+ <td>
66
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="171" height="1" alt=""></td>
67
+ <td>
68
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="24" height="1" alt=""></td>
69
+ <td>
70
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="105" height="1" alt=""></td>
71
+ <td>
72
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="68" height="1" alt=""></td>
73
+ <td>
74
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="165" height="1" alt=""></td>
75
+ <td>
76
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="132" height="1" alt=""></td>
77
+ <td>
78
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="37" height="1" alt=""></td>
79
+ <td>
80
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="200" height="1" alt=""></td>
81
+ <td>
82
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/spacer.gif" width="46" height="1" alt=""></td>
83
+ </tr>
84
+ </tbody></table>
85
+ </div>
wp_ultimate_csv_importer.js CHANGED
@@ -1,55 +1,82 @@
 
 
 
 
 
1
  function importAllPostStatus(selectedId,headerCount){
2
- var select;
3
- var options;
4
- if(selectedId != 0){
5
- // document.getElementById('poststatusalert').style.display = 'none';
6
- for(var u=0;u< headerCount;u++){
7
- select = document.getElementById('mapping'+u);
8
- options = select.options;
9
- for(var o=0;o<options.length;o++){
10
- if(options[o].value == 'post_status'){
11
- select.remove(o);
12
- }
13
- }
14
- }
15
- }
16
- else{
17
- // document.getElementById('poststatusalert').style.display = 'block';
18
-
19
- for(var v=0;v<headerCount;v++){
20
- select = document.getElementById('mapping'+v);
21
- options = select.options;
22
- poststatus = 0;
23
- for(var o=0;o<options.length;o++){
24
- if(options[o].value == 'post_status')
25
- poststatus = 1;
26
- }
27
- if(poststatus == 0){
28
- var option=document.createElement("option");
29
- option.text="post_status";
30
- select.add(option);
31
- }
32
 
33
- }
34
- }//exits post_status show hide
35
- if(selectedId == 3){
36
- document.getElementById('postsPassword').style.display = "";
37
- document.getElementById('passwordlabel').style.display = "";
38
- document.getElementById('passwordhint').style.display = "";
39
- }
40
- else{
41
- document.getElementById('postsPassword').style.display = "none";
42
- document.getElementById('passwordlabel').style.display = "none";
43
- document.getElementById('passwordhint').style.display = "none";
44
- }
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  // Function for add customfield
48
 
49
  function addcustomfield(myval,selected_id){
50
  var a = document.getElementById('h1').value;
 
51
  var aa = document.getElementById('h2').value;
52
  var selected_value;
 
53
  for(var i=0;i<aa;i++){
54
  var b = document.getElementById('mapping'+i).value;
55
  if(b=='add_custom'+i){
@@ -57,12 +84,12 @@ function addcustomfield(myval,selected_id){
57
  document.getElementById('customspan'+i).style.display = "";
58
  }
59
  else{
60
- document.getElementById('textbox'+i).style.display="none";
61
- document.getElementById('customspan'+i).style.display = "none";
62
-
63
  }
64
  }
65
- var header_count = document.getElementById('h2').value;
 
66
  for(var j=0;j<header_count;j++){
67
  var selected_value = document.getElementById('mapping'+j);
68
  var value1 = selected_value.options[selected_value.selectedIndex].value;
@@ -70,20 +97,28 @@ function addcustomfield(myval,selected_id){
70
  if(myval == value1 && myval != '-- Select --'){
71
  var selected_dropdown = document.getElementById('mapping'+selected_id);
72
  selected_dropdown.selectedIndex = '-- Select --';
73
- if(myval == 'post_date'){
74
- document.getElementById('date'+selected_id).style.display="none";
75
- }
76
- alert(myval+' is already selected!');
77
  }
78
  }
79
  }
80
  }
81
 
82
  // Function for check file exist
 
83
  function file_exist(){
 
 
 
 
 
 
 
 
 
 
84
 
85
  if(document.getElementById('csv_import').value==''){
86
- alert('Please attach your csv');
87
  return false;
88
  }
89
  else{
@@ -91,49 +126,138 @@ function file_exist(){
91
  }
92
  }
93
 
94
- function import_csv(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  var header_count = document.getElementById('h2').value;
96
- var chk_status_in_csv;
97
- var post_status_msg;
98
- var error_msg = '';
99
- post_status_msg = 'Off';
100
- chk_status_in_csv = document.getElementById('importallwithps').value;
101
- if(chk_status_in_csv != 0)
102
- post_status_msg = 'On';
103
  var array = new Array();
104
- var val1,val2;
105
- val1 = val2 = 'Off';
106
  for(var i=0;i<header_count;i++){
107
  var e = document.getElementById("mapping"+i);
108
  var value = e.options[e.selectedIndex].value;
109
  array[i] = value;
110
  }
111
- for(var j=0;j<array.length;j++){
112
- if(array[j] == 'post_title'){
113
- val1 = 'On';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
- if(array[j] == 'post_content'){
116
- val2 = 'On';
117
  }
118
- if(post_status_msg == 'Off'){
119
- if(array[j] == 'post_status')
120
- post_status_msg = 'On';
 
 
 
 
 
 
 
 
 
121
  }
122
-
123
- }
124
- if(val1 == 'On' && val2 == 'On' && post_status_msg == 'On') {
125
- return true;
126
  }
127
- else {
128
- if(val1 == 'Off')
129
- error_msg += " post_title,";
130
- if(val2 == 'Off')
131
- error_msg += " post_content,";
132
- if(post_status_msg == 'Off')
133
- error_msg += " post_status";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
 
135
 
136
- alert('Error: '+error_msg+' are mandatory fields. Please map the fields to proceed.');
137
- return false;
 
 
 
 
 
 
 
 
 
138
 
 
 
139
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ // settings script starts
3
+
4
+ //settings sript ends
5
+
6
  function importAllPostStatus(selectedId,headerCount){
7
+ var select;
8
+ var options;
9
+ if(selectedId != 0){
10
+ for(var u=0;u< headerCount;u++){
11
+ select = document.getElementById('mapping'+u);
12
+ options = select.options;
13
+ for(var o=0;o<options.length;o++){
14
+ if(options[o].value == 'post_status'){
15
+ select.remove(o);
16
+ }
17
+ }
18
+ }
19
+ }
20
+ else{
21
+ for(var v=0;v<headerCount;v++){
22
+ select = document.getElementById('mapping'+v);
23
+ options = select.options;
24
+ poststatus = 0;
25
+ for(var o=0;o<options.length;o++){
26
+ if(options[o].value == 'post_status')
27
+ poststatus = 1;
28
+ }
29
+ if(poststatus == 0){
30
+ var option=document.createElement("option");
31
+ option.text="post_status";
32
+ select.add(option);
33
+ }
 
 
 
34
 
35
+ }
36
+ }//exits post_status show hide
37
+ if(selectedId == 3){
38
+ document.getElementById('postsPassword').style.display = "";
39
+ document.getElementById('passwordlabel').style.display = "";
40
+ document.getElementById('passwordhint').style.display = "";
41
+ }
42
+ else{
43
+ document.getElementById('postsPassword').style.display = "none";
44
+ document.getElementById('passwordlabel').style.display = "none";
45
+ document.getElementById('passwordhint').style.display = "none";
46
+ }
47
  }
48
 
49
+ function loadSelectedPost(selectedCateg,contenturl){
50
+ jQuery.ajax({
51
+ url: contenturl+'/plugins/wp-ultimate-csv-importer/commentspost.php?categid='+selectedCateg,
52
+ type: 'post',
53
+ data:selectedCateg,
54
+ success: function(response){
55
+ jQuery("#showPosts").html(response);
56
+ }
57
+ });
58
+ }
59
+ function showRadioSett(id){
60
+ var inputs = document.getElementsByClassName(id);
61
+ if(document.getElementById(id).checked){
62
+ for(var i = 0; i < inputs.length; i++) {
63
+ inputs[i].disabled = false;
64
+ }
65
+ }
66
+ else{
67
+ for(var i = 0; i < inputs.length; i++) {
68
+ inputs[i].disabled = true;
69
+ }
70
+ }
71
+ }
72
  // Function for add customfield
73
 
74
  function addcustomfield(myval,selected_id){
75
  var a = document.getElementById('h1').value;
76
+ var importer = document.getElementById('selectedImporter').value;
77
  var aa = document.getElementById('h2').value;
78
  var selected_value;
79
+ if(importer == 'custompost'|| importer == 'post'|| importer == 'page'){
80
  for(var i=0;i<aa;i++){
81
  var b = document.getElementById('mapping'+i).value;
82
  if(b=='add_custom'+i){
84
  document.getElementById('customspan'+i).style.display = "";
85
  }
86
  else{
87
+ document.getElementById('textbox'+i).style.display="none";
88
+ document.getElementById('customspan'+i).style.display = "none";
 
89
  }
90
  }
91
+ }
92
+ var header_count = document.getElementById('h2').value;
93
  for(var j=0;j<header_count;j++){
94
  var selected_value = document.getElementById('mapping'+j);
95
  var value1 = selected_value.options[selected_value.selectedIndex].value;
97
  if(myval == value1 && myval != '-- Select --'){
98
  var selected_dropdown = document.getElementById('mapping'+selected_id);
99
  selected_dropdown.selectedIndex = '-- Select --';
100
+ showMapMessages('error',myval+' is already selected!');
 
 
 
101
  }
102
  }
103
  }
104
  }
105
 
106
  // Function for check file exist
107
+
108
  function file_exist(){
109
+ var requestaction = document.getElementById('requestaction').value;
110
+ if(requestaction == 'post' || requestaction == 'custompost' || requestaction == 'page'){
111
+ if(document.getElementById('filenameupdate').checked){
112
+ if((!document.getElementById('updatewithpostid').checked) && (!document.getElementById('updatewithposttitle').checked)){
113
+ showMessages('error','Select Update Based On.');
114
+ return false;
115
+ }
116
+
117
+ }
118
+ }
119
 
120
  if(document.getElementById('csv_import').value==''){
121
+ showMessages('error',"Please attach your CSV.");
122
  return false;
123
  }
124
  else{
126
  }
127
  }
128
 
129
+ //function show messages
130
+ function showMessages(alerttype,msg){
131
+ document.getElementById('showMsg').innerHTML = msg;
132
+ document.getElementById('showMsg').className += ' '+alerttype;
133
+ document.getElementById('showMsg').style.display = '';
134
+ }
135
+
136
+ function showMapMessages(alerttype,msg){
137
+ jQuery("#showMsg").addClass("maperror");
138
+ document.getElementById('showMsg').innerHTML = msg;
139
+ document.getElementById('showMsg').className += ' '+alerttype;
140
+ document.getElementById('showMsg').style.display = '';
141
+ jQuery("#showMsg").fadeOut(10000);
142
+ }
143
+
144
+ // Function for import csv
145
+
146
+ function import_csv(){
147
+ var importer = document.getElementById('selectedImporter').value;
148
  var header_count = document.getElementById('h2').value;
 
 
 
 
 
 
 
149
  var array = new Array();
150
+ var val1,val2,val3,val4,val5,val6,val7,error_msg;
151
+ val1 = val2 = val3 = val4 = val5 = val6 = val7 = post_status_msg = 'Off';
152
  for(var i=0;i<header_count;i++){
153
  var e = document.getElementById("mapping"+i);
154
  var value = e.options[e.selectedIndex].value;
155
  array[i] = value;
156
  }
157
+ if(importer == 'post'|| importer == 'page' || importer == 'custompost'){
158
+ var getSelectedIndex = document.getElementById('csv_importer_cat');
159
+ var SelectedIndex = getSelectedIndex.value;
160
+ var chk_status_in_csv;
161
+ var post_status_msg;
162
+ chk_status_in_csv = document.getElementById('importallwithps').value;
163
+ if(chk_status_in_csv != 0)
164
+ post_status_msg = 'On';
165
+
166
+ for(var j=0;j<array.length;j++){
167
+ if(array[j] == 'post_title'){
168
+ val1 = 'On';
169
+ }
170
+ if(array[j] == 'post_content'){
171
+ val2 = 'On';
172
+ }
173
+ if(post_status_msg == 'Off'){
174
+ if(array[j] == 'post_status')
175
+ post_status_msg = 'On';
176
+ }
177
  }
178
+ if(val1 == 'On' && val2 == 'On' && SelectedIndex != '-- Select --'&& post_status_msg == 'On') {
179
+ return true;
180
  }
181
+ else{
182
+ error_msg = '';
183
+ if(val1 == 'Off')
184
+ error_msg += " post_title,";
185
+ if(val2 == 'Off')
186
+ error_msg += " post_content,";
187
+ if(SelectedIndex == '-- Select --')
188
+ error_msg += " post type";
189
+ if(post_status_msg == 'Off')
190
+ error_msg += " post_status";
191
+ showMapMessages('error','Error: '+error_msg+' - Mandatory fields. Please map the fields to proceed.');
192
+ return false;
193
  }
 
 
 
 
194
  }
195
+ }
196
+
197
+ // Select the Mapper for Post/Page
198
+ function selectType(id,adminurl){
199
+ var headercount = document.getElementById('h2').value;
200
+ var getdropdownvalue = document.getElementById(id);
201
+ var selectedvalue = getdropdownvalue.options[getdropdownvalue.selectedIndex].text;
202
+ for(var i=0;i<headercount;i++){
203
+ var x=document.getElementById("mapping"+i);
204
+ var myOpts = x.options;
205
+ var postCatePresent = false;
206
+ var postTagPresent = false;
207
+ if(selectedvalue == 'post'){
208
+ for( var j=0;j<myOpts.length;j++){
209
+ if(myOpts[j].value == 'post_category')
210
+ postCatePresent = true;
211
+ if(myOpts[j].value == 'post_tag')
212
+ postTagPresent = true;
213
+ }
214
+ if(!postCatePresent){
215
+ var option=document.createElement("option");
216
+ option.value = "post_category";
217
+ option.text = "post_category";
218
+ x.add(option);
219
+ }
220
+ if(!postTagPresent){
221
+ var option1 = document.createElement("option");
222
+ option1.value = 'post_tag';
223
+ option1.text = 'post_tag';
224
+ x.add(option1);
225
+ }
226
+ }
227
+ else{
228
+ jQuery("#mapping"+i+" option[value='post_category']").remove();
229
+ jQuery("#mapping"+i+" option[value='post_tag']").remove();
230
+ }
231
  }
232
+ }
233
 
234
+ function slideonlyone(thechosenone, content_url) {
235
+ jQuery('.newboxes2').each(function(index) {
236
+ if (jQuery(this).attr("id") == thechosenone) {
237
+ jQuery(this).slideDown(200);
238
+ var id = jQuery(this).attr('id');
239
+ jQuery("#"+id+"_img").attr('src',content_url+"/plugins/wp-ultimate-csv-importer/images/arrow_down.gif");
240
+ }
241
+ else {
242
+ jQuery(this).slideUp(600);
243
+ var id = jQuery(this).attr('id');
244
+ jQuery("#"+id+"_img").attr('src',content_url+"/plugins/wp-ultimate-csv-importer/images/arrow_up.gif");
245
 
246
+ }
247
+ });
248
  }
249
+
250
+ // Function to save plugin settings
251
+ function savePluginSettings(){
252
+ window.setTimeout("showSuccessMessage()", 100);
253
+ window.setTimeout("hideSuccessMessage()", 15000);
254
+ }
255
+
256
+ function showSuccessMessage(){
257
+ document.getElementById('upgradetopro').style.display = "";
258
+ }
259
+
260
+ function hideSuccessMessage(){
261
+ document.getElementById('upgradetopro').style.display = "none";
262
+ }
263
+
wp_ultimate_csv_importer.php CHANGED
@@ -3,7 +3,7 @@
3
  *Plugin Name: WP Ultimate CSV Importer
4
  *Plugin URI: http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html
5
  *Description: A plugin that helps to import the data's from a CSV file.
6
- *Version: 3.1.0
7
  *Author: smackcoders.com
8
  *Author URI: http://www.smackcoders.com
9
  *
@@ -26,298 +26,416 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  ***********************************************************************************************
27
  */
28
 
29
- require_once (dirname ( __FILE__ ) . '/../../../wp-load.php');
30
 
31
- require_once ("SmackImpCE.php");
32
- $impCE = new SmackImpCE ();
33
 
34
- require_once ("languages/" . $impCE->user_language () . ".php");
35
 
36
- // Admin menu settings
37
- function wp_ultimate_csv_importer() {
38
- add_menu_page ( 'CSV importer settings', 'WP Ultimate CSV Importer', 'manage_options', 'upload_csv_file', 'upload_csv_file', WP_CONTENT_URL . "/plugins/wp-ultimate-csv-importer/images/icon.png" );
39
- }
40
- function LoadWpScript() {
41
- wp_register_script ( 'wp_ultimate_scripts', WP_CONTENT_URL . "/plugins/wp-ultimate-csv-importer/wp_ultimate_csv_importer.js", array (
42
- "jquery"
43
- ) );
44
- wp_enqueue_script ( 'wp_ultimate_scripts' );
45
- }
46
 
47
- add_action ( 'admin_enqueue_scripts', 'LoadWpScript' );
48
- add_action ( "admin_menu", "wp_ultimate_csv_importer" );
 
49
 
50
  /**
51
- * Home page layout and importer
52
  */
53
- function upload_csv_file() {
54
- global $impCE;
55
- global $custom_array;
56
- global $wpdb;
57
-
58
- $importdir = $impCE->getUploadDirectory ();
59
-
60
- /*
61
- * Get POST data
62
- */
63
- if (isset ( $_POST ['delim'] ) && in_array ( $_POST ['delim'], $impCE->delim_avail ))
64
- $impCE->delim = $_POST ['delim'];
65
-
66
- if (isset ( $_POST ['titleduplicatecheck'] ) && trim($_POST ['titleduplicatecheck'] != ""))
67
- $impCE->titleDupCheck = true;
68
-
69
- if (isset ( $_POST ['contentduplicatecheck'] ) && trim($_POST ['contentduplicatecheck'] != ""))
70
- $impCE->conDupCheck = true;
71
-
72
- $custom_array = array ();
73
- if (isset ( $_POST ['Import'] )) {
74
- $data_rows = $impCE->csv_file_data ( $_FILES ['csv_import'] ['tmp_name'], $impCE->delim );
75
- $impCE->move_file ();
76
-
77
- echo renderTop();
78
- if ( count($impCE->headers)>=1 && count($data_rows)>=1 ){?>
79
- <div style="float: left; min-width: 45%">
80
- <form class="add:the-list: validate" method="post"
81
- onsubmit="return import_csv();">
82
- <h3>Import Data Configuration</h3>
83
- <div style="margin-top: 30px;">
84
- <table><tr><td>
85
- <input name="_csv_importer_import_as_draft" type="hidden"
86
- value="publish" /> <label> Select Post Type </label></td><td> <select
87
- name='csv_importer_cat'>
88
- <?php
89
- foreach ( get_post_types () as $key => $value ) {
90
- if (($value != 'featured_image') && ($value != 'attachment') && ($value != 'wpsc-product') && ($value != 'wpsc-product-file') && ($value != 'revision') && ($value != 'nav_menu_item')) {
91
- ?>
92
- <option id="<?php echo($value);?>"> <?php echo($value);?> </option>
93
- <?php
94
-
95
- }
96
- }
97
- ?>
98
- </select> </td></tr><tr><td>
99
- <?php $cnt1 = count($impCE->headers);?>
100
-
101
- <label>Import with post status</label></td> <td><select
102
- name='importallwithps' id='importallwithps'
103
- onchange='importAllPostStatus(this.value, "<?php echo $cnt1?>")'>
104
- <option value='0'>Status as in CSV</option>
105
- <option value='1'>Publish</option>
106
- <option value='2'>Sticky</option>
107
- <option value='4'>Private</option>
108
- <option value='3'>Protected</option>
109
- <option value='5'>Draft</option>
110
- <option value='6'>Pending</option>
111
- </select></td></tr></table>
112
- </div>
113
- <br />
114
- <label id='passwordlabel' style="display:none">Password</label>&nbsp;&nbsp;
115
- <input type='text' id='postsPassword' name='postsPassword' value = 'admin' style="display:none">
116
- <label id='passwordhint' style="display:none;color:red;"><?php echo $impCE->t("PASSWORD_HINT"); ?></label>
117
- <h3>Mapping the Fields</h3>
118
- <div id='display_area'>
119
- <?php $cnt =count($impCE->defCols) +2; ?>
120
- <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>" />
121
- <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>" />
122
- <input type="hidden" id="titleduplicatecheck"
123
- name="titleduplicatecheck"
124
- value="<?php echo $_POST['titleduplicatecheck'] ?>" /> <input
125
- type="hidden" id="contentduplicatecheck"
126
- name="contentduplicatecheck"
127
- value="<?php echo $_POST['contentduplicatecheck'] ?>" /> <input
128
- type="hidden" id="delim" name="delim"
129
- value="<?php echo $_POST['delim']; ?>" /> <input type="hidden"
130
- id="header_array" name="header_array"
131
- value="<?php print_r($impCE->headers);?>" />
132
- <table style="font-size: 12px;">
133
- <?php
134
- $count = 0;
135
- foreach ( $impCE->headers as $key => $value ) {
136
- ?>
137
- <tr>
138
- <td><label><?php print($value);?></label></td>
139
- <td><select name="mapping<?php print($count);?>"
140
- id="mapping<?php print($count);?>" class='uiButton'
141
- onchange="addcustomfield(this.value,<?php echo $count; ?>);">
142
- <option id="select">-- Select --</option>
143
- <?php
144
- foreach ( $impCE->defCols as $key1 => $value1 ) {
145
- ?>
146
- <option value="<?php print($key1);?>">
147
- <?php
148
-
149
- if ($key1 != 'post_name')
150
- print ($key1) ;
151
- else
152
- print 'post_slug';
153
- ?>
154
- </option>
155
- <?php
156
-
157
  }
158
- foreach ( get_taxonomies () as $taxokey => $taxovalue ) {
159
- if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
160
- ?>
161
- <option value="<?php print($taxokey);?>"><?php print($taxovalue);?></option>
162
- <?php
163
-
164
- }
165
- }
166
- ?>
167
- <option value="add_custom<?php print($count);?>">Add Custom Field</option>
168
- </select> <!-- added to solve issue id 1072--> <input type="text"
169
- id="textbox<?php print($count); ?>"
170
- name="textbox<?php print($count); ?>" style="display: none;"
171
- value="<?php echo $value ?>" /> <span
172
- style="display: none; color: red; margin-left: 5px;"
173
- id="customspan<?php echo $count?>">Name this Field</span>
174
- </td>
175
- </tr>
176
- <?php
177
- $count ++;
178
- }
179
- ?>
180
- </table>
181
- </div>
182
- <br /> <input type='hidden' name='filename' id='filename'
183
- value="<?php echo($_FILES['csv_import']['name']);?>" /> <input
184
- type='submit' class='button-primary' name='post_csv' id='post_csv'
185
- value='Import' />
186
- </form>
187
- </div>
188
- <div style="min-width: 45%;">
189
- <?php print(renderDesc()); ?>
190
- </div>
191
- <?php
192
- } else {
193
- ?>
194
- <div style="font-size: 16px; margin-left: 20px;"><?php echo $impCE->t("CHOOSE_ANOTHER_DELIMITER"); ?>
195
- </div>
196
- <br />
197
- <div style="margin-left: 20px;">
198
- <form class="add:the-list: validate" method="post" action="">
199
- <input type="submit" class="button-primary" name="Import Again"
200
- value="Import Again" />
201
- </form>
202
- </div>
203
- <div style="margin-left: 20px; margin-top: 30px;">
204
- <b><?php echo $impCE->t("NOTE"); ?> :-</b>
205
- <p>1. <?php echo $impCE->t("NOTE_CONTENT_1"); ?></p>
206
- <p>2. <?php echo $impCE->t("NOTE_CONTENT_2"); ?></p>
207
- </div>
208
- <?php
209
-
210
- }
211
- } else if (isset ( $_POST ['post_csv'] )) {
212
-
213
- $impCE->processDataInWP();
214
-
215
- if (( $impCE->insPostCount != 0) || ($impCE->dupPostCount != 0)) {
216
- ?>
217
- <div
218
- style="background-color: #FFFFE0; border-color: #E6DB55; border-radius: 3px 3px 3px 3px; border-style: solid; border-width: 1px; margin: 5px 15px 2px; padding: 5px; text-align: center">
219
- <b> <?php echo '('.$impCE->insPostCount.')'; ?> records are successfully Imported !<br> <?php echo '('.$impCE->dupPostCount.')'; ?> duplicate records found !
220
- <?php if($impCE->noPostAuthCount != 0){ ?><br>
221
- <?php echo $impCE->noPostAuthCount; ?> posts with no valid UserID/Name are assigned admin as author.
222
- <?php
223
- // ask and fill the error msg
224
- }
225
- ?></b>
226
- </div>
227
- <?php }else if(($impCE->insPostCount == 0) && ($impCE->dupPostCount == 0)){ ?>
228
- <div
229
- style="background-color: #FFFFE0; border-color: #E6DB55; border-radius: 3px 3px 3px 3px; border-style: solid; border-width: 1px; margin: 5px 15px 2px; padding: 5px; text-align: center">
230
- <b> Check your CSV file and format. </b>
231
- </div>
232
- <?php } ?>
233
- <div style="margin-top: 30px; margin-left: 10px">
234
- <form class="add:the-list: validate" method="post"
235
- enctype="multipart/form-data">
236
- <input type="submit" class='button-primary' id="goto" name="goto"
237
- value="Continue" />
238
- </form>
239
- </div>
240
- <?php
241
-
242
- } else {
243
- ?>
244
- <div class="wrap">
245
- <?php echo renderTop(); ?>
246
-
247
- <div style="min-width: 45%; float: left; height: 500px;">
248
- <h2><?php echo $impCE->t('IMPORT_CSV_FILE'); ?></h2>
249
- <form class="add:the-list: validate" method="post"
250
- enctype="multipart/form-data" onsubmit="return file_exist();">
251
-
252
- <!-- File input -->
253
- <p>
254
- <label for="csv_import"><?php echo $impCE->t('UPLOAD_FILE'); ?>:</label><br />
255
- <input name="csv_import" id="csv_import" type="file" value=""
256
- required="required" />
257
- </p>
258
- <br />
259
- <p>
260
- <input type="checkbox" name="titleduplicatecheck" value=1> <?php echo $impCE->t("ENABLE_DUPLICATION_POST_TITLE"); ?><br>
261
-
262
-
263
- <p>
264
- <input type="checkbox" name="contentduplicatecheck" value=1> <?php echo $impCE->t("ENABLE_DUPLICATION_POST_CONTENT"); ?> <br>
265
- <!-- added above checkboxes for issueid 1057-->
266
-
267
- <p>
268
- <label id="duplicatehint" style="color:red;" ><?php echo $impCE->t("ENABLE_DUPLICATION_HINT");?></label>
269
- <br>
270
-
271
- <p>
272
- <label>Delimiter</label>&nbsp;&nbsp;&nbsp; <select name="delim"
273
- id="delim">
274
- <option value=",">,</option>
275
- <option value=";">;</option>
276
- </select>
277
- </p>
278
-
279
- <p class="submit">
280
- <input type="submit" class="button-primary" name="Import"
281
- value="Import" />
282
- </p>
283
- </form>
284
- </div>
285
- <div style="min-width: 45%;">
286
- <?php print(renderDesc()); ?>
287
- </div>
288
- </div>
289
- <!-- end wrap -->
290
- <?php
291
- }
292
  }
293
 
 
 
 
 
 
 
 
294
 
295
  /**
296
- * Function to display the plugin home description
297
  */
298
- function renderDesc() {
299
- return "<p>WP Ultimate CSV Importer Plugin helps you to manage the post,page and </br> custom post data's from a CSV file.</p>
300
- <p>1. Admin can import the data's from any csv file.</p>
301
- <p>2. Can define the type of post and post status while importing.</p>
302
- <p>3. Provides header mapping feature to import the data's as your need.</p>
303
- <p>4. Users can map coloumn headers to existing fields or assign as custom fileds.</p>
304
- <p>5. Import unlimited datas as post.</p>
305
- <p>6. Make imported post as published or make it as draft.</p>
306
- <p>7. Added featured image import functionality.</p>
307
- <p><b> Important Note:- </b></p>
308
- <p><span style='color:red;'>1. Your csv should have the seperate column for post_date.
309
- <br/>2. It must be in the following format. ( yyyy-mm-dd hh:mm:ss ).</span></p>
310
- <p>Configuring our plugin is as simple as that. If you have any questions, issues and request on new features, plaese visit <a href='http://www.smackcoders.com/blog/category/free-wordpress-plugins' target='_blank'>Smackcoders.com blog </a></p>
311
- <div align='center' style='margin-top:40px;'> 'While the scripts on this site are free, donations are greatly appreciated. '<br/><br/><a href='http://www.smackcoders.com/donate.html' target='_blank'><img src='" . WP_CONTENT_URL . "/plugins/wp-ultimate-csv-importer/images/paypal_donate_button.png' /></a><br/><br/><a href='http://www.smackcoders.com/' target='_blank'><img src='http://www.smackcoders.com/wp-content/uploads/2012/09/Smack_poweredby_200.png'></a>
312
- </div><br/>";
313
  }
314
 
 
 
 
 
 
 
 
 
 
 
 
315
  /**
316
- * To render the top section
317
  */
318
- function renderTop() {
319
- return "<marquee onmouseover=\"this.setAttribute('scrollamount', 0, 0);\" onmouseout=\"this.setAttribute('scrollamount', 6, 0);\" >Now the <a href='http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html' target='_blank'>Pro Version</a> is Available. For more details,please visit <a href='http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html' target='_blank'>here</a></marquee>
320
- <div style='background-color: #FFFFE0;border-color: #E6DB55;border-radius: 3px 3px 3px 3px;border-style: solid;border-width: 1px;margin: 5px 15px 2px; margin-top:15px;padding: 5px;text-align:center'> Please check out <a href='http://www.smackcoders.com/blog/category/free-wordpress-plugins' target='_blank'>www.smackcoders.com</a> for the latest news and details of other great plugins and tools. </div><br/>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
 
323
  ?>
3
  *Plugin Name: WP Ultimate CSV Importer
4
  *Plugin URI: http://www.smackcoders.com/blog/how-to-guide-for-free-wordpress-ultimate-csv-importer-plugin.html
5
  *Description: A plugin that helps to import the data's from a CSV file.
6
+ *Version: 3.2.0
7
  *Author: smackcoders.com
8
  *Author URI: http://www.smackcoders.com
9
  *
26
  ***********************************************************************************************
27
  */
28
 
29
+ //error_reporting(0);
30
 
31
+ ini_set('max_execution_time', 600);
32
+ ini_set('memory_limit', '128M');
33
 
34
+ require_once (dirname(__FILE__) . '/../../../wp-load.php');
35
 
36
+ require_once "SmackImpCE.php";
37
+ require_once "class.rendercsv.php";
38
+ require_once 'class.settings.php';
 
 
 
 
 
 
 
39
 
40
+ $impCE = new SmackImpCE ();
41
+ $impRen = new RenderCSVCE;
42
+ require_once "languages/" . $impCE->user_language() . ".php";
43
 
44
  /**
45
+ * Activate the CSV importer free plugin
46
  */
47
+ function wp_ultimate_csv_importer_activate()
48
+ {
49
+ require_once 'plugin_config.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
+
52
+ /**
53
+ * Deactivate the CSV importer free plugin
54
+ */
55
+ function wp_ultimate_csv_importer_deactivate()
56
+ {
57
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
+ /**
61
+ * Admin menu settings
62
+ */
63
+ function wp_ultimate_csv_importer()
64
+ {
65
+ add_menu_page('CSV importer settings', 'WP Ultimate CSV Importer', 'manage_options', 'upload_csv_file', 'upload_csv_file', WP_CONTENT_URL . "/plugins/wp-ultimate-csv-importer/images/icon.png");
66
+ }
67
 
68
  /**
69
+ *Function to load script files
70
  */
71
+ function LoadWpScript()
72
+ {
73
+ if ($_REQUEST['page'] == 'upload_csv_file') {
74
+ wp_register_script('wp_ultimate_scripts', WP_CONTENT_URL . "/plugins/wp-ultimate-csv-importer/wp_ultimate_csv_importer.js", array("jquery"));
75
+ }
76
+ wp_enqueue_script('wp_ultimate_scripts');
77
+
 
 
 
 
 
 
 
 
78
  }
79
 
80
+ add_action('admin_enqueue_scripts', 'LoadWpScript');
81
+
82
+ if ($_REQUEST['page'] == 'upload_csv_file') {
83
+ wp_enqueue_style('importer_styles', WP_CONTENT_URL . '/plugins/wp-ultimate-csv-importer/css/custom-style.css');
84
+ }
85
+
86
+ add_action("admin_menu", "wp_ultimate_csv_importer");
87
+
88
+ register_activation_hook(__FILE__, 'wp_ultimate_csv_importer_activate');
89
+ register_deactivation_hook(__FILE__, 'wp_ultimate_csv_importer_deactivate');
90
+
91
  /**
92
+ * Home page layout and importer
93
  */
94
+ function upload_csv_file()
95
+ {
96
+ global $impCE, $impRen;
97
+ global $custom_array;
98
+ global $wpdb;
99
+
100
+ if (!$_REQUEST['action']) {
101
+ ?>
102
+ <script>
103
+ window.location.href = "<?php echo WP_PLUGIN_URL;?>/../../wp-admin/admin.php?page=upload_csv_file&action=post";
104
+ </script>
105
+ <?php
106
+ }
107
+ $importdir = $impCE->getUploadDirectory();
108
+ if (!$_REQUEST['action'] || $_POST['post_csv'])
109
+ echo "<input type = 'hidden' value ='dashboard' id='requestaction'>";
110
+ else
111
+ echo "<input type='hidden' value='" . $_REQUEST['action'] . "' id ='requestaction'>";
112
+ echo '<input type="hidden" value="' . WP_CONTENT_URL . '" id="contenturl">';
113
+ /*
114
+ * Get POST data
115
+ */
116
+ if (isset ($_POST ['delim']) && in_array($_POST ['delim'], $impCE->delim_avail))
117
+ $impCE->delim = $_POST ['delim'];
118
+ if (isset ($_POST ['titleduplicatecheck']) && trim($_POST ['titleduplicatecheck'] != ""))
119
+ $impCE->titleDupCheck = true;
120
+
121
+ if (isset ($_POST ['contentduplicatecheck']) && trim($_POST ['contentduplicatecheck'] != ""))
122
+ $impCE->conDupCheck = true;
123
+
124
+ $custom_array = array();
125
+ if (isset ($_POST ['Import'])) {
126
+ ?>
127
+ <input type="hidden" name="versionedname" id="versionedname" value=""/>
128
+ <input type="hidden" name="fileversion" id="fileversion" value=""/>
129
+ <?php
130
+ $data_rows = $impCE->csv_file_data($_FILES ['csv_import'] ['tmp_name'], $impCE->delim);
131
+ require_once ("SmackImpCE.php");
132
+ $impObj = new SmackImpCE();
133
+ $impObj->move_file();
134
+ ?>
135
+ <div class="smack-wrap" id="smack-content">
136
+ <?php
137
+ echo $impRen->renderMenu();
138
+ if (count($impCE->headers) >= 1 && count($data_rows) >= 1) {
139
+ ?>
140
+
141
+ <form class="add:the-list: validate" name="secondform" method="post" onsubmit="return import_csv();"
142
+ class="secondform">
143
+ <div style="float: left; min-width: 45%">
144
+ <div style="float: left; margin-top: 11px; margin-right: 5px;"><img src = "<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/Importicon_24.png"></div>
145
+ <div style="float:left;">
146
+ <h3>Import Data Configuration</h3>
147
+ </div></br>
148
+ <?php $cnt = count($impCE->defCols) + 2;
149
+ $cnt1 = count($impCE->headers); ?>
150
+ <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>"/>
151
+ <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>"/>
152
+ <input type="hidden" name="renamestatus" value="<?php echo $_POST['filenameupdate']; ?>"/>
153
+ <input type="hidden" name="updatewithpostid" value="<?php echo $_POST['updatewithpostid']; ?>"/>
154
+ <input type="hidden" name="updatewithposttitle"
155
+ value="<?php echo $_POST['updatewithposttitle']; ?>"/>
156
+ <input type="hidden" name="filerenamevalue" value="<?php echo $_POST['renameFile']; ?>"/>
157
+
158
+ <?php
159
+ // second form starts here
160
+ if (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'custompost') || ($_REQUEST['action'] == 'page')) {
161
+
162
+ //set custom fields value
163
+ $taxo = get_taxonomies();
164
+ foreach ($taxo as $taxokey => $taxovalue) {
165
+ if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format' && $taxokey != 'product_tag' && $taxokey != 'wpsc_product_category' && $taxokey != 'wpsc-variation') {
166
+ $custo_taxo .= $taxokey . ',';
167
+ }
168
+ }
169
+ $custo_taxo = substr($custo_taxo, 0, -1);
170
+
171
+ ?>
172
+ <input type='hidden' name='cust_taxo' id='cust_taxo' value='<?php echo $custo_taxo; ?>'/>
173
+ <div id="posttypecss" style="margin-top: 30px;">
174
+ <table>
175
+ <tr>
176
+ <td>
177
+ <input name="_csv_importer_import_as_draft" type="hidden" value="publish"/>
178
+ <?php if($_REQUEST['action'] == 'custompost'){ ?>
179
+ <label> Select Post Type<span class="mandatory"> *</span> </label></td>
180
+ <td>
181
+ <select name='csv_importer_cat' id='csv_importer_cat'>
182
+ <option>-- Select --</option>
183
+ <?php
184
+ foreach (get_post_types() as $key => $value) {
185
+ if (($value != 'featured_image') && ($value != 'attachment') && ($value != 'wpsc-product') && ($value != 'wpsc-product-file') && ($value != 'revision') && ($value != 'nav_menu_item') && ($value != 'post') && ($value != 'page')) {
186
+ ?>
187
+ <option id="<?php echo($value); ?>"> <?php echo($value);?> </option>
188
+ <?php
189
+ }
190
+ }
191
+ ?>
192
+ </select>
193
+ <?php } else if ($_REQUEST['action'] == 'post' || $_REQUEST['action'] == 'page') { ?>
194
+ <input name='csv_importer_cat' type='hidden' id='csv_importer_cat'
195
+ value=<?php echo $_REQUEST['action']; ?>>
196
+ <?php } ?>
197
+ </td>
198
+ </tr>
199
+ <tr>
200
+ <td>
201
+ <?php $cnt1 = count($impCE->headers);?>
202
+
203
+ <label>Import with post status<span class="mandatory"> *</span></label></td>
204
+ <td><select
205
+ name='importallwithps' id='importallwithps'
206
+ onchange='importAllPostStatus(this.value, "<?php echo $cnt1 ?>")'>
207
+ <option value='0'>Status as in CSV</option>
208
+ <option value='1'>Publish</option>
209
+ <option value='2'>Sticky</option>
210
+ <option value='4'>Private</option>
211
+ <option value='3'>Protected</option>
212
+ <option value='5'>Draft</option>
213
+ <option value='6'>Pending</option>
214
+ </select></td>
215
+ </tr>
216
+ <tr>
217
+ <td>
218
+ <label id='passwordlabel' style="display:none;">Password</label></td>
219
+ <td>
220
+ <input type='text' id='postsPassword' name='postsPassword' value='admin'
221
+ style="display:none;">
222
+ <span style="display: none; color: red; margin-left: 5px;" id='passwordhint'
223
+ style="display:none;">Replace the default value</span>
224
+ </td>
225
+ </tr>
226
+ </table>
227
+ </div>
228
+ <h3>Map Fields</h3>
229
+ <div id='display_area'>
230
+ <?php $cnt = count($impCE->defCols) + 2; ?>
231
+ <input type="hidden" id="h1" name="h1" value="<?php echo $cnt; ?>"/>
232
+ <input type="hidden" id="h2" name="h2" value="<?php echo $cnt1; ?>"/>
233
+ <?php if (isset($_POST['titleduplicatecheck'])) { ?>
234
+ <input type="hidden" id="titleduplicatecheck"
235
+ name="titleduplicatecheck"
236
+ value="<?php echo $_POST['titleduplicatecheck'] ?>"/>
237
+ <?php } ?>
238
+ <?php if (isset($_POST['contentduplicatecheck'])) { ?>
239
+ <input type="hidden" id="contentduplicatecheck" name="contentduplicatecheck"
240
+ value="<?php echo $_POST['contentduplicatecheck'] ?>"/>
241
+ <?php } ?><input
242
+ type="hidden" id="delim" name="delim"
243
+ value="<?php echo $_POST['delim']; ?>"/> <input type="hidden"
244
+ id="header_array" name="header_array"
245
+ value="<?php print_r($impCE->headers); ?>"/>
246
+ <table style="font-size: 12px;">
247
+ <?php
248
+ $count = 0;
249
+ if ($_REQUEST['action'] == 'page') {
250
+ unset($impCE->defCols['post_category']);
251
+ unset($impCE->defCols['post_tag']);
252
+ }
253
+ foreach ($impCE->headers as $key => $value) {
254
+ ?>
255
+ <tr>
256
+ <td><label><?php print($value);?></label></td>
257
+ <td><select name="mapping<?php print($count); ?>"
258
+ id="mapping<?php print($count); ?>" class='uiButton'
259
+ onchange="addcustomfield(this.value,<?php echo $count; ?>);">
260
+ <option id="select">-- Select --</option>
261
+ <?php
262
+ foreach ($impCE->defCols as $key1 => $value1) {
263
+ if ($key1 == 'post_name')
264
+ $key1 = 'post_slug';
265
+ $strip_CF = strpos($key1, 'CF: '); //Auto mapping
266
+ if ($strip_CF === 0) {
267
+ $custom_key = substr($key1, 4);
268
+ }
269
+ ?>
270
+ <option value="<?php print($key1); ?>">
271
+ <?php
272
+ if ($key1 != 'post_name')
273
+ print ($key1);
274
+ else
275
+ print 'post_slug';
276
+ ?>
277
+ </option>
278
+ <?php
279
+
280
+ }
281
+ foreach (get_taxonomies() as $taxokey => $taxovalue) {
282
+ if ($taxokey != 'category' && $taxokey != 'link_category' && $taxokey != 'post_tag' && $taxokey != 'nav_menu' && $taxokey != 'post_format') {
283
+ ?>
284
+ <option
285
+ value="<?php print($taxokey); ?>"><?php print($taxovalue);?></option>
286
+ <?php
287
+
288
+ }
289
+ }
290
+ ?>
291
+ <option value="add_custom<?php print($count); ?>">Add Custom Field
292
+ </option>
293
+
294
+ </select> <!-- added to solve issue id 1072-->
295
+ <input class="customfieldtext" type="text"
296
+ id="textbox<?php print($count); ?>"
297
+ name="textbox<?php print($count); ?>" style="display: none;"
298
+ value="<?php echo $value ?>"/> <span
299
+ style="display: none; color: red; margin-left: 5px;"
300
+ id="customspan<?php echo $count ?>">Replace the default value</span>
301
+ </td>
302
+ </tr>
303
+ <?php
304
+ $count++;
305
+ }
306
+ ?>
307
+ </table>
308
+ </div>
309
+ <br/>
310
+ <?php
311
+ } elseif ($_REQUEST['action'] == 'dashboard') {
312
+ echo $impRen->renderDashboard();
313
+ } elseif ($_REQUEST['action'] == 'help') {
314
+
315
+ }
316
+
317
+
318
+ //second form exits ?>
319
+ <input type='hidden' name='filename' id='filename'
320
+ value="<?php echo($_FILES['csv_import']['name']); ?>"/>
321
+ <?php
322
+ $explodeCsv = explode('.csv', $_FILES['csv_import']['name']);
323
+ $exactFIlename = $explodeCsv[0] . '-' . $_REQUEST['action'] . '.csv';
324
+ ?>
325
+ <input type='hidden' name='realfilename' id='realfilename'
326
+ value="<?php echo($_FILES['csv_import']['name']); ?>"/>
327
+ <input type="hidden" name="version" id="version" value=""/>
328
+ <input type='hidden' name='selectedImporter' id='selectedImporter'
329
+ value="<?php echo $_REQUEST['action']; ?>"/>
330
+ <input type='hidden' name='delim' id='delim' value="<?php echo($_POST['delim']) ?>"/>
331
+ <button type='submit' class="action" name='post_csv' id='post_csv' value='Import'>Import</button>
332
+
333
+ </form>
334
+ </div>
335
+ <div style="min-width: 45%;float:right;margin-right:9px;">
336
+ <div style="width:100%;">
337
+ <div style="float:left;"><h3>CSV Mapping Headers Explained</h3></div>
338
+ <div style="float:right;margin-top:15px;margin-right:25px;"><a href="http://www.smackcoders.com/blog/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html" target="_blank">Download Sample Files Here</a></div>
339
+ </div>
340
+ <a href="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/HeadersExplained.jpeg" target="_blank" title="Headers Explained"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/wp-ultimate-csv-importer/images/HeadersExplained.jpeg" width=600 style='border:1px solid;padding:2px;' /></a>
341
+ </div>
342
+ <?php
343
+ } else {
344
+ ?>
345
+ <div style="font-size: 16px; margin-left: 20px;"><?php echo $impCE->t("CHOOSE_ANOTHER_DELIMITER"); ?>
346
+ </div>
347
+ <br/>
348
+ <div style="margin-left: 20px;">
349
+ <form class="add:the-list: validate" method="post" action="">
350
+ <input type="submit" class="button-primary" name="Import Again"
351
+ value="Import Again"/>
352
+ </form>
353
+ </div>
354
+ <div style="margin-left: 20px; margin-top: 30px;">
355
+ <b><?php echo $impCE->t("NOTE"); ?> :-</b>
356
+
357
+ <p>1. <?php echo $impCE->t("NOTE_CONTENT_1"); ?></p>
358
+
359
+ <p>2. <?php echo $impCE->t("NOTE_CONTENT_2"); ?></p>
360
+ </div>
361
+ <?php
362
+ }
363
+ } else if ((isset ($_POST ['post_csv'])) && (($_REQUEST['action'] == 'post') || ($_REQUEST['action'] == 'page') || ($_REQUEST['action'] == 'custompost'))) {
364
+ //third form starts here
365
+ $impCE->processDataInWP();
366
+ echo $impRen->renderMenu();
367
+ if (($impCE->insPostCount != 0) || ($impCE->dupPostCount != 0) || ($impCE->updatedPostCount != 0)) {
368
+ ?>
369
+ <div>
370
+
371
+ <?php
372
+ echo $impRen->setDashboardAction();
373
+ $messageString = $impCE->insPostCount . " records are successfully Imported.";
374
+ if ($_POST['titleduplicatecheck'] == 1 || $_POST['contentduplicatecheck'] == 1)
375
+ $messageString .= $impCE->dupPostCount . " duplicate records found.";
376
+ if (($impCE->noPostAuthCount != 0) && (in_array('post_author', $_POST)))
377
+ $messageString .= '<br>' . $impCE->noPostAuthCount . " posts with no valid UserID/Name are assigned admin as author.";
378
+ if ($impCE->updatedPostCount != 0)
379
+ $messageString .= '<br>' . $impCE->updatedPostCount . ' posts has been updated.';
380
+ echo $impRen->showMessage('success', $messageString); ?>
381
+ </div>
382
+ <?php
383
+ } else if (($impCE->insPostCount == 0) && ($impCE->dupPostCount == 0) && ($impCE->updatedPostCount == 0)) {
384
+ ?>
385
+ <div>
386
+ <?php echo $impRen->showMessage('error', "Check your CSV file and format."); ?>
387
+ </div>
388
+ <?php } ?>
389
+ <?php
390
+ $_REQUEST['action'] = 'dashboard';
391
+ echo $impRen->renderDashboard();
392
+ } else {
393
+ ?>
394
+ <!-- first form gets displayed from here -->
395
+ <?php
396
+ if (!$_REQUEST['action']) {
397
+ $_REQUEST['action'] = 'post';
398
+ } elseif ($_REQUEST['action'] == 'dashboard') {
399
+ echo $impRen->renderMenu();
400
+ echo $impRen->renderDashboard();
401
+ } elseif ($_REQUEST['action'] == 'settings') {
402
+ echo $impRen->renderMenu();
403
+ if ($pluginActive != null)
404
+ echo $impRen->showMessage('error', $pluginActive);
405
+ echo $impRen->renderSettings();
406
+ } elseif ($_REQUEST['action'] == 'custompost') {
407
+ ?>
408
+ <div class="wrap" id="smack-content">
409
+ <?php
410
+ echo $impRen->renderMenu();
411
+ $sett = new IMPSettings();
412
+ if ($sett->chkCustomPostPlugin()) {
413
+ ?>
414
+ <div class="smack-postform">
415
+ <?php echo $impRen->renderPostPage(); ?>
416
+ </div>
417
+ <div class="module-desc">
418
+ <?php print($impRen->renderDesc()); ?>
419
+ </div>
420
+ </div>
421
+ <?php
422
+ } else
423
+ echo $impRen->showMessage('error', 'Custom Post Plugin Not Found.');
424
+ } else {
425
+ ?>
426
+ <div class="wrap" id="smack-content">
427
+ <?php echo $impRen->renderMenu(); ?>
428
+ <div class="smack-postform">
429
+ <?php echo $impRen->renderPostPage(); ?>
430
+ </div>
431
+ <div class="module-desc">
432
+ <?php print($impRen->renderDesc()); ?>
433
+ </div>
434
+ </div>
435
+ <!-- end wrap -->
436
+ <?php
437
+ }
438
+ }
439
  }
440
 
441
  ?>