Version Description
Download this release
Release Info
Developer | smackcoders |
Plugin | Ultimate CSV Importer |
Version | 3.6.1 |
Comparing to | |
See all releases |
Code changes from version 3.6.0 to 3.6.1
- Readme.txt +419 -414
- images/Importicon_24.png +0 -0
- images/csv_importer_dashboard_v3.5.png +0 -0
- images/facebook.png +0 -0
- images/googleplus.png +0 -0
- images/icon.png +0 -0
- images/linkedin.png +0 -0
- images/twitter.png +0 -0
- includes/ImportLib.php +0 -601
- includes/WPImporter_includes_helper.php +1 -7
- index.php +14 -9
- lib/jquery-plugins/UploadHandler.php +1425 -0
- lib/jquery-plugins/index.php +0 -0
- lib/jquery-plugins/uploader.php +15 -0
- modules/comments/templates/index.php +1 -2
- modules/custompost/templates/index.php +1 -2
- modules/dashboard/actions/chartone.php +0 -4
- modules/dashboard/actions/managefiles.php +2 -2
- modules/export/actions/actions.php +1 -1
- modules/export/templates/export.php +2 -10
- modules/page/templates/index.php +1 -2
- modules/post/templates/index.php +2 -2
- modules/users/actions/actions.php +0 -6
- modules/users/templates/index.php +1 -1
- plugins/README +8 -0
- templates/UploadHandler.php +0 -1
- templates/import.php +7 -5
- templates/readfile.php +2 -3
- wp_ultimate_csv_importer.php +0 -15
Readme.txt
CHANGED
@@ -1,414 +1,419 @@
|
|
1 |
-
=== WP Ultimate CSV Importer Plugin ===
|
2 |
-
Contributors: smackcoders
|
3 |
-
Donate link: http://www.smackcoders.com/donate.html
|
4 |
-
Tags: batch, csv, excel, import, spreadsheet, autoblog, Autoblogger, csvimporter, data, dataimport, importer, wpcsvimporter, wpimporter, acf, auto blog, csv import, csv to post, data import, Easy CSV Importer, eci, import plugin, admin, user, users, Advanced CSV Import, Advanced CSV Importer, affiliate, amazon, author, automatic, blog, buddypress, bulk, bulk edit, bulk editor, categories, comments, content, csv file, csv format, csv importer, custom post, e-commerce, free, images, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, video, woocommerce, wordpress, xml, youtube
|
5 |
-
Requires at least: 3.6.0
|
6 |
-
Tested up to: 3.9.1
|
7 |
-
Stable tag: 3.6
|
8 |
-
Version: 3.6
|
9 |
-
Author: smackcoders
|
10 |
-
Author URI: http://profiles.wordpress.org/smackcoders/
|
11 |
-
|
12 |
-
License: GPLv2 or later
|
13 |
-
|
14 |
-
Advanced CSV Importer plugin to import posts, pages, custom posts with custom fields with few simple clicks
|
15 |
-
|
16 |
-
== Description ==
|
17 |
-
|
18 |
-
**Version 3.6 is now available with new users much requested features like auto UTF-8 handling, auto mapping, auto delimiter and more. Visit [www.wpultimatecsvimporter.com](http://www.wpultimatecsvimporter.com) for more news and future plans.
|
19 |
-
|
20 |
-
WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
|
21 |
-
|
22 |
-
= Video Walkthrough =
|
23 |
-
|
24 |
-
<p>http://www.youtube.com/watch?v=OwKdt_NlT2U&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC</p>
|
25 |
-
|
26 |
-
= Highlights =
|
27 |
-
* Auto delimiter
|
28 |
-
* Auto UTF-8 handling
|
29 |
-
* All-in-SEO import support.
|
30 |
-
* Drag drop import
|
31 |
-
* Define any type of post
|
32 |
-
* Control post status (Publish, Private, Pending, Draft, Sticky and Protected)
|
33 |
-
* Simple yet Powerful mapping feature
|
34 |
-
* Convert any csv import as perfect posts and fields
|
35 |
-
* Scheduled Publishing
|
36 |
-
* Duplicate Title and content handling
|
37 |
-
* Multi Lingual import (CSV format must be UTF-8 without BOM)
|
38 |
-
* Mutisite and Buddypress also supported now
|
39 |
-
* Compatible to wordpress themes
|
40 |
-
* Better alternative for xml
|
41 |
-
* Post Format option added
|
42 |
-
* Page template attribute feature
|
43 |
-
|
44 |
-
= Power Import Features to Control your csv import =
|
45 |
-
* Post title, content and even excerpt
|
46 |
-
* Text, WYSIWYG/HTML, in line CSS in post content
|
47 |
-
* Images, Youtube, Videos in post content
|
48 |
-
* Featured image by Url
|
49 |
-
* Multi authors
|
50 |
-
* Multiple tags and categories
|
51 |
-
* Non existing tags and categories are created automatically
|
52 |
-
* Any Short Codes in post content
|
53 |
-
* Assign sidebar widget, slider, slide show as short codes
|
54 |
-
* Manual slug feature for SEO friendly urls
|
55 |
-
* Different post status for each post in CSV file.
|
56 |
-
* Custom fields support for WP standard
|
57 |
-
* Map custom fields by adding new on the fly.
|
58 |
-
|
59 |
-
The csv importer supports almost every wordpress modules and plugin fields as follows. Import data feed periodically from csv file as
|
60 |
-
|
61 |
-
= Supported Core Modules and Attributes =
|
62 |
-
* Post
|
63 |
-
* Page
|
64 |
-
* Standard WP Custom Post types
|
65 |
-
* Wordpress themes custom posts
|
66 |
-
* Custom post type UI plugin Post types
|
67 |
-
* Users with roles
|
68 |
-
* Comments
|
69 |
-
* Custom Fields
|
70 |
-
* Author
|
71 |
-
* Tags
|
72 |
-
* Categories
|
73 |
-
|
74 |
-
It is more easy to convert any off line database maintained in Excel xls or spread sheets into valuable content for your web site without missing any. It is possible now to schedule a periodical content update, maintenance, prices, offers, coupons and inventory etc.
|
75 |
-
|
76 |
-
Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best wordpress themes available online. Now manage multi site & buddy press, amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
|
77 |
-
|
78 |
-
= Common Issues =
|
79 |
-
|
80 |
-
How to solve auto_prepend_file and auto_append_file error?
|
81 |
-
|
82 |
-
Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled. If not you can disable it in php.ini settings file your self. You can also do it by a .htaccess file
|
83 |
-
|
84 |
-
Create an .htaccess file in root and set the following values.
|
85 |
-
php_value auto_prepend_file none
|
86 |
-
php_value auto_append_file none
|
87 |
-
|
88 |
-
This will solve your issue or get support from hosting if you dint have sufficient permission.
|
89 |
-
|
90 |
-
= Extended Pro Power Features in Wp Ultimate CSV Importer =
|
91 |
-
* Types Plugin support
|
92 |
-
* Woocommerce CSV importer with product variation
|
93 |
-
* Marketpress Lite Importer
|
94 |
-
* WP Members Importer
|
95 |
-
* WP Customer Reviews Importer
|
96 |
-
* Auto Schedule all your Imports
|
97 |
-
* Save mapping as Templates for reuse
|
98 |
-
* Auto Mapping Feature
|
99 |
-
* Strict UTF-8 auto conversion
|
100 |
-
* All In One SEO Fields Import
|
101 |
-
* Wordpress SEO by Yoast Fields Import
|
102 |
-
* Custom Post Type UI plugin import
|
103 |
-
* Advanced Custom Fields Import
|
104 |
-
* CCTM Posts and Fields Import
|
105 |
-
* Woocommerce CSV Importer,
|
106 |
-
* eshop CSV Importer
|
107 |
-
* wp ecommerce Products CSV Importer with WP e-Commerce Custom Fields
|
108 |
-
* Categories & tags Import with Category icons plugin support
|
109 |
-
* Custom Taxonomy import
|
110 |
-
* [Get Complete List of supported 3rd party plugins here](http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html)
|
111 |
-
|
112 |
-
|
113 |
-
[Read More about Pro>>](http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html) or [Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard)
|
114 |
-
|
115 |
-
= Imp. Notes =
|
116 |
-
* All CSV files should be should be strictly UTF-8 CSV format. Now this can be handled by plugin.
|
117 |
-
* All wordpress supported languages can imported with csv format as UTF-8 without BOM (See FAQ for instructions).
|
118 |
-
* User import option is disabled for multi site mode.
|
119 |
-
* To Schedule posts for publishing provide future date and time in date column in CSV File.
|
120 |
-
|
121 |
-
Featured Image Support
|
122 |
-
Your wordpress theme should support featured image. If not, please add the following code to where you need to display E.g. wp-contents/themes/header.php
|
123 |
-
`<?php add_theme_support( 'post-thumbnails' ); ?>`
|
124 |
-
|
125 |
-
Also you can follow the instructions as given here
|
126 |
-
|
127 |
-
* [http://codex.wordpress.org/Function_Reference/the_post_thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
|
128 |
-
* [http://codex.wordpress.org/Post_Thumbnails](http://codex.wordpress.org/Post_Thumbnails)
|
129 |
-
* [http://wordpress.org/support/topic/featured-image-not-showing-7?replies=5](http://wordpress.org/support/topic/featured-image-not-showing-7?replies=5)
|
130 |
-
|
131 |
-
Need More Help, Cool. Browse Below Links
|
132 |
-
|
133 |
-
* [Get Pro Power Features, check here](http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html)
|
134 |
-
* [Wiki and Documentation](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer)
|
135 |
-
* [Tutorials, Guides, Blog News and Updates](http://blog.smackcoders.com/category/free-wordpress-plugins/wordpress-ultimate-csv-importer-plugin/)
|
136 |
-
* [Video Walkthrough](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_Videos)
|
137 |
-
* [Get the Sample CSV Files Here](http://blog.smackcoders.com/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html)
|
138 |
-
* [Download CSV Format Cheat Sheets Here](http://blog.smackcoders.com/how-to-make-one-click-easy-csv-import-in-wordpress-free-cheat-sheet-downloads.html)
|
139 |
-
|
140 |
-
== Installation ==
|
141 |
-
|
142 |
-
* [Step By Step Installation Wiki with Snaps](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_Free_Version_1.1.1_Installation_and_Configuration)
|
143 |
-
|
144 |
-
|
145 |
-
== Screenshots ==
|
146 |
-
|
147 |
-
1. New Interactive Dashboard with Chart and Graph
|
148 |
-
2. Advanced CSV Importer With Ultimate User Friendly Features with drag and drop etc.
|
149 |
-
3. User friendly easy mapping for any csv file data to wordpress field attributes with sampling.
|
150 |
-
4. Advanced duplicate post name and content check with server request control for high performance factor.
|
151 |
-
5. Detailed real time log to know pinpoint status.
|
152 |
-
6. Module based environment for easy and reduced interface to enable most required modules and when ever needed.
|
153 |
-
7. Inbuilt support form for easy feedback, support, feature request with all useful links for easy and better csv import.
|
154 |
-
8. New export module for posts, page, users, comments and all custom posts type plugins.
|
155 |
-
|
156 |
-
|
157 |
-
== Frequently Asked Questions ==
|
158 |
-
|
159 |
-
= Common Issues =
|
160 |
-
|
161 |
-
How to solve auto_prepend_file and auto_append_file error?
|
162 |
-
|
163 |
-
Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled. If not you can disable it in php.ini settings file your self. You can also do it by a .htaccess file
|
164 |
-
|
165 |
-
Create an .htaccess file in root and set the following values.
|
166 |
-
php_value auto_prepend_file none
|
167 |
-
php_value auto_append_file none
|
168 |
-
|
169 |
-
This will solve your issue or get support from hosting if you dint have sufficient permission.
|
170 |
-
|
171 |
-
[Click Here for Detailed FAQs](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_FAQ)
|
172 |
-
[CSV File and Format Related](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_FAQ#CSV_File_and_Format_Related)
|
173 |
-
|
174 |
-
|
175 |
-
== Changelog ==
|
176 |
-
|
177 |
-
= 3.6 =
|
178 |
-
*
|
179 |
-
*
|
180 |
-
*
|
181 |
-
|
182 |
-
|
183 |
-
*
|
184 |
-
|
185 |
-
|
186 |
-
*
|
187 |
-
*
|
188 |
-
*
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
*
|
193 |
-
*
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
* Added:
|
198 |
-
*
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
*
|
203 |
-
*
|
204 |
-
*
|
205 |
-
|
206 |
-
|
207 |
-
* Import
|
208 |
-
*
|
209 |
-
|
210 |
-
|
211 |
-
*
|
212 |
-
*
|
213 |
-
*
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
*
|
218 |
-
*
|
219 |
-
*
|
220 |
-
|
221 |
-
|
222 |
-
*
|
223 |
-
*
|
224 |
-
*
|
225 |
-
|
226 |
-
|
227 |
-
* Added:
|
228 |
-
* Added:
|
229 |
-
*
|
230 |
-
|
231 |
-
= 3.3.
|
232 |
-
* Added:
|
233 |
-
* Added:
|
234 |
-
*
|
235 |
-
|
236 |
-
= 3.
|
237 |
-
* Added: WordPress 3.
|
238 |
-
* Added:
|
239 |
-
* Added:
|
240 |
-
|
241 |
-
|
242 |
-
*
|
243 |
-
|
244 |
-
|
245 |
-
*
|
246 |
-
*
|
247 |
-
*
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
*
|
252 |
-
*
|
253 |
-
* Fixed:
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
*
|
259 |
-
*
|
260 |
-
* Fixed:
|
261 |
-
|
262 |
-
= 3.
|
263 |
-
* Improved:
|
264 |
-
*
|
265 |
-
* Fixed:
|
266 |
-
|
267 |
-
= 3.
|
268 |
-
*
|
269 |
-
*
|
270 |
-
*
|
271 |
-
|
272 |
-
|
273 |
-
*
|
274 |
-
*
|
275 |
-
*
|
276 |
-
* Improved:
|
277 |
-
* Improved:
|
278 |
-
* Improved:
|
279 |
-
* Improved:
|
280 |
-
* Improved:
|
281 |
-
* Improved:
|
282 |
-
*
|
283 |
-
*
|
284 |
-
*
|
285 |
-
*
|
286 |
-
|
287 |
-
|
288 |
-
*
|
289 |
-
*
|
290 |
-
*
|
291 |
-
|
292 |
-
|
293 |
-
* Added:
|
294 |
-
* Added:
|
295 |
-
* Added:
|
296 |
-
* Added:
|
297 |
-
*
|
298 |
-
*
|
299 |
-
*
|
300 |
-
*
|
301 |
-
*
|
302 |
-
*
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
*
|
307 |
-
* Fixed:
|
308 |
-
|
309 |
-
|
310 |
-
= 2.
|
311 |
-
* Major
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
*
|
394 |
-
|
395 |
-
= 2.0
|
396 |
-
*
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
=== WP Ultimate CSV Importer Plugin ===
|
2 |
+
Contributors: smackcoders
|
3 |
+
Donate link: http://www.smackcoders.com/donate.html
|
4 |
+
Tags: batch, csv, excel, import, spreadsheet, autoblog, Autoblogger, csvimporter, data, dataimport, importer, wpcsvimporter, wpimporter, acf, auto blog, csv import, csv to post, data import, Easy CSV Importer, eci, import plugin, admin, user, users, Advanced CSV Import, Advanced CSV Importer, affiliate, amazon, author, automatic, blog, buddypress, bulk, bulk edit, bulk editor, categories, comments, content, csv file, csv format, csv importer, custom post, e-commerce, free, images, language, manage, media, meta, multisite, News, page, photos, pictures, plugin, Post, seo, shop, shortcode, tags, Taxonomy, text, title, video, woocommerce, wordpress, xml, youtube
|
5 |
+
Requires at least: 3.6.0
|
6 |
+
Tested up to: 3.9.1
|
7 |
+
Stable tag: 3.6.1
|
8 |
+
Version: 3.6.1
|
9 |
+
Author: smackcoders
|
10 |
+
Author URI: http://profiles.wordpress.org/smackcoders/
|
11 |
+
|
12 |
+
License: GPLv2 or later
|
13 |
+
|
14 |
+
Advanced CSV Importer plugin to import posts, pages, custom posts with custom fields with few simple clicks
|
15 |
+
|
16 |
+
== Description ==
|
17 |
+
|
18 |
+
**Version 3.6 is now available with new users much requested features like auto UTF-8 handling, auto mapping, auto delimiter and more. Visit [www.wpultimatecsvimporter.com](http://www.wpultimatecsvimporter.com) for more news and future plans.
|
19 |
+
|
20 |
+
WP Ultimate CSV Importer Plugin proven much effective advanced CSV File Importer With Ultimate User Friendly Features. It is much easy now even for newbies to import any csv file as any wordpress post type and associated fields by simple mapping feature. Now import any CSV file as thousands of post, page and custom post types. This is admin side free plugin helps you in bulk edit, create and import posts type for your blog or site.
|
21 |
+
|
22 |
+
= Video Walkthrough =
|
23 |
+
|
24 |
+
<p>http://www.youtube.com/watch?v=OwKdt_NlT2U&list=PL2k3Ck1bFtbQqFhOK7g08kxENI4qQkmC</p>
|
25 |
+
|
26 |
+
= Highlights =
|
27 |
+
* Auto delimiter
|
28 |
+
* Auto UTF-8 handling
|
29 |
+
* All-in-SEO import support.
|
30 |
+
* Drag drop import
|
31 |
+
* Define any type of post
|
32 |
+
* Control post status (Publish, Private, Pending, Draft, Sticky and Protected)
|
33 |
+
* Simple yet Powerful mapping feature
|
34 |
+
* Convert any csv import as perfect posts and fields
|
35 |
+
* Scheduled Publishing
|
36 |
+
* Duplicate Title and content handling
|
37 |
+
* Multi Lingual import (CSV format must be UTF-8 without BOM)
|
38 |
+
* Mutisite and Buddypress also supported now
|
39 |
+
* Compatible to wordpress themes
|
40 |
+
* Better alternative for xml
|
41 |
+
* Post Format option added
|
42 |
+
* Page template attribute feature
|
43 |
+
|
44 |
+
= Power Import Features to Control your csv import =
|
45 |
+
* Post title, content and even excerpt
|
46 |
+
* Text, WYSIWYG/HTML, in line CSS in post content
|
47 |
+
* Images, Youtube, Videos in post content
|
48 |
+
* Featured image by Url
|
49 |
+
* Multi authors
|
50 |
+
* Multiple tags and categories
|
51 |
+
* Non existing tags and categories are created automatically
|
52 |
+
* Any Short Codes in post content
|
53 |
+
* Assign sidebar widget, slider, slide show as short codes
|
54 |
+
* Manual slug feature for SEO friendly urls
|
55 |
+
* Different post status for each post in CSV file.
|
56 |
+
* Custom fields support for WP standard
|
57 |
+
* Map custom fields by adding new on the fly.
|
58 |
+
|
59 |
+
The csv importer supports almost every wordpress modules and plugin fields as follows. Import data feed periodically from csv file as
|
60 |
+
|
61 |
+
= Supported Core Modules and Attributes =
|
62 |
+
* Post
|
63 |
+
* Page
|
64 |
+
* Standard WP Custom Post types
|
65 |
+
* Wordpress themes custom posts
|
66 |
+
* Custom post type UI plugin Post types
|
67 |
+
* Users with roles
|
68 |
+
* Comments
|
69 |
+
* Custom Fields
|
70 |
+
* Author
|
71 |
+
* Tags
|
72 |
+
* Categories
|
73 |
+
|
74 |
+
It is more easy to convert any off line database maintained in Excel xls or spread sheets into valuable content for your web site without missing any. It is possible now to schedule a periodical content update, maintenance, prices, offers, coupons and inventory etc.
|
75 |
+
|
76 |
+
Much improved User interface with most flexible jquery plugin features and bootstrap UI design makes csv import more simple, easy, fast and even more flexible for better user experience. With improved Multi site, buddy press compatibility (except user import module) works well for most of the best wordpress themes available online. Now manage multi site & buddy press, amazon data import, affiliates blog, product inventory, ecommerce store, multi author blog, automatic news import, photo blog etc periodically with simple click import.
|
77 |
+
|
78 |
+
= Common Issues =
|
79 |
+
|
80 |
+
How to solve auto_prepend_file and auto_append_file error?
|
81 |
+
|
82 |
+
Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled. If not you can disable it in php.ini settings file your self. You can also do it by a .htaccess file
|
83 |
+
|
84 |
+
Create an .htaccess file in root and set the following values.
|
85 |
+
php_value auto_prepend_file none
|
86 |
+
php_value auto_append_file none
|
87 |
+
|
88 |
+
This will solve your issue or get support from hosting if you dint have sufficient permission.
|
89 |
+
|
90 |
+
= Extended Pro Power Features in Wp Ultimate CSV Importer =
|
91 |
+
* Types Plugin support
|
92 |
+
* Woocommerce CSV importer with product variation
|
93 |
+
* Marketpress Lite Importer
|
94 |
+
* WP Members Importer
|
95 |
+
* WP Customer Reviews Importer
|
96 |
+
* Auto Schedule all your Imports
|
97 |
+
* Save mapping as Templates for reuse
|
98 |
+
* Auto Mapping Feature
|
99 |
+
* Strict UTF-8 auto conversion
|
100 |
+
* All In One SEO Fields Import
|
101 |
+
* Wordpress SEO by Yoast Fields Import
|
102 |
+
* Custom Post Type UI plugin import
|
103 |
+
* Advanced Custom Fields Import
|
104 |
+
* CCTM Posts and Fields Import
|
105 |
+
* Woocommerce CSV Importer,
|
106 |
+
* eshop CSV Importer
|
107 |
+
* wp ecommerce Products CSV Importer with WP e-Commerce Custom Fields
|
108 |
+
* Categories & tags Import with Category icons plugin support
|
109 |
+
* Custom Taxonomy import
|
110 |
+
* [Get Complete List of supported 3rd party plugins here](http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html)
|
111 |
+
|
112 |
+
|
113 |
+
[Read More about Pro>>](http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html) or [Test Drive Our Live Demo](http://demo.smackcoders.com/demowpthree/wp-admin/admin.php?page=wp-ultimate-csv-importer-pro/index.php&__module=dashboard)
|
114 |
+
|
115 |
+
= Imp. Notes =
|
116 |
+
* All CSV files should be should be strictly UTF-8 CSV format. Now this can be handled by plugin.
|
117 |
+
* All wordpress supported languages can imported with csv format as UTF-8 without BOM (See FAQ for instructions).
|
118 |
+
* User import option is disabled for multi site mode.
|
119 |
+
* To Schedule posts for publishing provide future date and time in date column in CSV File.
|
120 |
+
|
121 |
+
Featured Image Support
|
122 |
+
Your wordpress theme should support featured image. If not, please add the following code to where you need to display E.g. wp-contents/themes/header.php
|
123 |
+
`<?php add_theme_support( 'post-thumbnails' ); ?>`
|
124 |
+
|
125 |
+
Also you can follow the instructions as given here
|
126 |
+
|
127 |
+
* [http://codex.wordpress.org/Function_Reference/the_post_thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
|
128 |
+
* [http://codex.wordpress.org/Post_Thumbnails](http://codex.wordpress.org/Post_Thumbnails)
|
129 |
+
* [http://wordpress.org/support/topic/featured-image-not-showing-7?replies=5](http://wordpress.org/support/topic/featured-image-not-showing-7?replies=5)
|
130 |
+
|
131 |
+
Need More Help, Cool. Browse Below Links
|
132 |
+
|
133 |
+
* [Get Pro Power Features, check here](http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html)
|
134 |
+
* [Wiki and Documentation](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer)
|
135 |
+
* [Tutorials, Guides, Blog News and Updates](http://blog.smackcoders.com/category/free-wordpress-plugins/wordpress-ultimate-csv-importer-plugin/)
|
136 |
+
* [Video Walkthrough](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_Videos)
|
137 |
+
* [Get the Sample CSV Files Here](http://blog.smackcoders.com/wordpress-ultimate-csv-importer-csv-sample-files-and-updates.html)
|
138 |
+
* [Download CSV Format Cheat Sheets Here](http://blog.smackcoders.com/how-to-make-one-click-easy-csv-import-in-wordpress-free-cheat-sheet-downloads.html)
|
139 |
+
|
140 |
+
== Installation ==
|
141 |
+
|
142 |
+
* [Step By Step Installation Wiki with Snaps](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_Free_Version_1.1.1_Installation_and_Configuration)
|
143 |
+
|
144 |
+
|
145 |
+
== Screenshots ==
|
146 |
+
|
147 |
+
1. New Interactive Dashboard with Chart and Graph
|
148 |
+
2. Advanced CSV Importer With Ultimate User Friendly Features with drag and drop etc.
|
149 |
+
3. User friendly easy mapping for any csv file data to wordpress field attributes with sampling.
|
150 |
+
4. Advanced duplicate post name and content check with server request control for high performance factor.
|
151 |
+
5. Detailed real time log to know pinpoint status.
|
152 |
+
6. Module based environment for easy and reduced interface to enable most required modules and when ever needed.
|
153 |
+
7. Inbuilt support form for easy feedback, support, feature request with all useful links for easy and better csv import.
|
154 |
+
8. New export module for posts, page, users, comments and all custom posts type plugins.
|
155 |
+
|
156 |
+
|
157 |
+
== Frequently Asked Questions ==
|
158 |
+
|
159 |
+
= Common Issues =
|
160 |
+
|
161 |
+
How to solve auto_prepend_file and auto_append_file error?
|
162 |
+
|
163 |
+
Check your phpinfo.php. Ensure that auto_prepend_file and auto_append_file options are disabled. If not you can disable it in php.ini settings file your self. You can also do it by a .htaccess file
|
164 |
+
|
165 |
+
Create an .htaccess file in root and set the following values.
|
166 |
+
php_value auto_prepend_file none
|
167 |
+
php_value auto_append_file none
|
168 |
+
|
169 |
+
This will solve your issue or get support from hosting if you dint have sufficient permission.
|
170 |
+
|
171 |
+
[Click Here for Detailed FAQs](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_FAQ)
|
172 |
+
[CSV File and Format Related](http://wiki.smackcoders.com/WP_Ultimate_CSV_Importer_FAQ#CSV_File_and_Format_Related)
|
173 |
+
|
174 |
+
|
175 |
+
== Changelog ==
|
176 |
+
|
177 |
+
= 3.6.1 =
|
178 |
+
* Multi-site support issue fixed
|
179 |
+
* Duplicate import issue fixed
|
180 |
+
* Security issue fixed
|
181 |
+
|
182 |
+
= 3.6 =
|
183 |
+
* New interactive graphs and charts in plugin dashboard
|
184 |
+
* New Admin dashboard widgets
|
185 |
+
* Added Users and comments export feature
|
186 |
+
* Auto delimiter handling
|
187 |
+
* Auto mapping feature
|
188 |
+
* Now allow authors to access import features
|
189 |
+
|
190 |
+
= 3.5.5 =
|
191 |
+
* post_format attribute support added
|
192 |
+
* page_template attribute added
|
193 |
+
* update_post_meta added for duplicate meta issue (Thanks to @alantygel)
|
194 |
+
* Type error issue in jQuery fixed
|
195 |
+
|
196 |
+
= 3.5.4 =
|
197 |
+
* Added: All-in-SEO import support.
|
198 |
+
* WordPress 3.9.1 compatibility added.
|
199 |
+
|
200 |
+
= 3.5.3 =
|
201 |
+
* Added: Compatible up to WordPress 3.9.
|
202 |
+
* Added: Export feature added for posts, page, custom posts type plugins.
|
203 |
+
* Improved: Removed all warnings.
|
204 |
+
* Fixed reported bugs
|
205 |
+
|
206 |
+
= 3.5.2 =
|
207 |
+
* Import posts with author names as numerical apart from User ID
|
208 |
+
* Added menu_order attribute import
|
209 |
+
* Added Auto image rename option
|
210 |
+
* Option to cancel an partial import at middle
|
211 |
+
* Improved image handling even special characters in Url
|
212 |
+
* Import can handle image urls without any extensions
|
213 |
+
* User reported bugs fixed
|
214 |
+
|
215 |
+
= 3.5.1 =
|
216 |
+
* User reported issue fixes
|
217 |
+
* Activation and other plugin conflict issue solved like Jet pack
|
218 |
+
* Admin UI freezing issues - screen option, Help links issues fixed.
|
219 |
+
* WYSIWIG editor UI issue fixed.
|
220 |
+
|
221 |
+
= 3.5.0 =
|
222 |
+
* Combined major release version of 3.5 and 3.4
|
223 |
+
* Improved MVC structure.
|
224 |
+
* Improved User interface with drag and drop feature.
|
225 |
+
* Improved: WordPress 3.8.1 compatibility added.
|
226 |
+
* Module based system allows simplify UI
|
227 |
+
* Added: Detailed log feature added.
|
228 |
+
* Added: Support and Useful links added.
|
229 |
+
* Added: Support made easy now from plugin.
|
230 |
+
|
231 |
+
= 3.3.1 =
|
232 |
+
* Added: Multi site compatibility except User import.
|
233 |
+
* Added: Comments, Users modules mandatory fields validation added.
|
234 |
+
* Improved: Removed unwanted warnings.
|
235 |
+
|
236 |
+
= 3.3.0 =
|
237 |
+
* Added: WordPress 3.8 compatibility.
|
238 |
+
* Added: Bulk users with role import feature.
|
239 |
+
* Added: Comments import feature with relevant post ids.
|
240 |
+
|
241 |
+
= 3.2.3 =
|
242 |
+
* Added: WordPress 3.7.1 compatibility added.
|
243 |
+
* Added: Different media path support added.
|
244 |
+
* Added: Sub folder installations support added.
|
245 |
+
* Improved: Updated plugin directory path.
|
246 |
+
* Improved: Removed unwanted warnings.
|
247 |
+
* Improved: Performance check.
|
248 |
+
|
249 |
+
= 3.2.2 =
|
250 |
+
* Added: WordPress 3.6.1 compatibility added.
|
251 |
+
* Added: Mapping UI improved with on select dynamic update feature
|
252 |
+
* Added: Help content added
|
253 |
+
* Fixed: Post slug issue fixed and tested for 3.6 and 3.6.1
|
254 |
+
|
255 |
+
= 3.2.1 =
|
256 |
+
* Improved: Performance improvements on SQL and CSV parsing
|
257 |
+
* Fixed: Plugin deactivation issue fixed and updated the code.
|
258 |
+
* Fixed: Links in the cells makes problems with the "quote"
|
259 |
+
* Fixed: Loading content from more than one column
|
260 |
+
* Fixed: Custom Post type issues fixed
|
261 |
+
|
262 |
+
= 3.2.0 =
|
263 |
+
* Improved: User interface improvements
|
264 |
+
* Improved:WordPress 3.6 compatibility added, Much Improved UI.
|
265 |
+
* Fixed: Featured image issues fixed for WordPress-3.6.
|
266 |
+
|
267 |
+
= 3.1.0 =
|
268 |
+
* Improved: Much Improved Featured Image feature
|
269 |
+
* Fixed: Image url for featured image issues fixed
|
270 |
+
* Fixed: PHP 5.4 upgrade fix
|
271 |
+
|
272 |
+
= 3.0.0 =
|
273 |
+
* Added: Category in numericals are restricted and skipped to Uncategorized
|
274 |
+
* Added: Now password should be mentioned as {password}
|
275 |
+
* Added: Post authors can be User ID or name
|
276 |
+
* Improved: Much improved work flow
|
277 |
+
* Improved: Add custom field option improved.
|
278 |
+
* Improved: Date format handling improved
|
279 |
+
* Improved: Any Date format is supported now
|
280 |
+
* Improved: Future scheduling and status improved
|
281 |
+
* Improved: Can apply post status for individual post via csv itself
|
282 |
+
* Improved: Featured image handling improved and fixed. More improvement are scheduled.
|
283 |
+
* Improved: Duplicate check options improved for both title and content option.
|
284 |
+
* Improved: Post author issue fixed and improved
|
285 |
+
* Improved: Wrong user id or name are automatically assigned under admin
|
286 |
+
* Improved: Multi category and tags improved
|
287 |
+
* Fixed: Custom Field mapping and import fixed
|
288 |
+
* Fixed: Overall Status option improved and issue fixed
|
289 |
+
* Fixed: Password field fixed for Protected
|
290 |
+
* Fixed: Status as in CSV option improved and fixed
|
291 |
+
|
292 |
+
= 2.7.0 =
|
293 |
+
* Added: Added more post status options
|
294 |
+
* Added: Publish, Sticky, Private, Draft and Pending Status for whole import
|
295 |
+
* Added: Protected status with a common password option added
|
296 |
+
* Added: "Status as in CSV" to assign status for individual post through CSV as ID or Field Tag
|
297 |
+
* Added: User ID and User Name support for Post author feature added
|
298 |
+
* Added: In case of missing or false IDs post assigned to admin as draft
|
299 |
+
* Added: Add Custom Field Text box auto-filled with CSV header tag.
|
300 |
+
* Added: Duplicate detection for post content and post title added as options.
|
301 |
+
* Added: User can choose either one or both to avoid duplicate issues.
|
302 |
+
* Improved: 6 Standard date format added as drop down to choose.
|
303 |
+
* Improved: Renamed post_name as post_slug to avoid confusion
|
304 |
+
* Improved: Mapping Fields
|
305 |
+
* Improved: Field tags are formatted to support auto mapping option (next milestone)
|
306 |
+
* Improved: Listed custom fields with prefix as CF: Name for easy identification.
|
307 |
+
* Fixed: Date format conflict at import fixed.
|
308 |
+
|
309 |
+
|
310 |
+
= 2.6.0 =
|
311 |
+
* Fixed: Major Bug fixed
|
312 |
+
* Fixed: Added UTF-8 support.
|
313 |
+
* Fixed: Fixed Html tag conflicts.
|
314 |
+
|
315 |
+
= 2.5.0 =
|
316 |
+
* Major issues fixed and updated to WordPress-3.5.1 compatibility.
|
317 |
+
|
318 |
+
= 2.0.1 =
|
319 |
+
* Update to WordPress-3.5 compatibility.
|
320 |
+
|
321 |
+
= 2.0.0 =
|
322 |
+
* WPDEBUG errors fixed. CSV import folder changed to WP native uploads folder.
|
323 |
+
|
324 |
+
= 1.1.1 =
|
325 |
+
* Renamed the mapping field attachment as featured_image and category as post_category.
|
326 |
+
|
327 |
+
= 1.1.0 =
|
328 |
+
* Added featured image import feature along with post/page/custom post.
|
329 |
+
|
330 |
+
= 1.0.2 =
|
331 |
+
* Bug fixed to recognize the trimmed trailing space in the CSV file
|
332 |
+
* Added validation for the duplicate field mapping.
|
333 |
+
|
334 |
+
= 1.0.1 =
|
335 |
+
* Added features to import multiple tags and categories with different delimiters.
|
336 |
+
|
337 |
+
= 1.0.0 =
|
338 |
+
* Initial release version. Tested and found works well without any issues.
|
339 |
+
|
340 |
+
|
341 |
+
|
342 |
+
== Upgrade Notice ==
|
343 |
+
|
344 |
+
= 3.6 =
|
345 |
+
* Must upgrade with major values added features
|
346 |
+
|
347 |
+
= 3.5.5 =
|
348 |
+
* Upgrade for minor bug fix, conflicts and new attribute support.
|
349 |
+
|
350 |
+
= 3.5.4 =
|
351 |
+
* Upgrade now for All-in-SEO import support.
|
352 |
+
|
353 |
+
= 3.5.3 =
|
354 |
+
* Upgrade for added export feature and bug fixes
|
355 |
+
|
356 |
+
= 3.5.2 =
|
357 |
+
* Upgrade for bug free version and improved image handling
|
358 |
+
|
359 |
+
= 3.5.1 =
|
360 |
+
* Must upgrade now for 3.5 bug fixes
|
361 |
+
|
362 |
+
= 3.5.0 =
|
363 |
+
* Upgrade now for major release 3.5. Note - Old version files need to be deleted.
|
364 |
+
|
365 |
+
= 3.3.1 =
|
366 |
+
* Upgrade now for multi site compatibility.
|
367 |
+
|
368 |
+
= 3.3.0 =
|
369 |
+
* Upgrade now for WP 3.8 compatibility and added bulk user,comments feature.
|
370 |
+
|
371 |
+
= 3.2.3 =
|
372 |
+
* Upgrade for WordPress 3.7.1 compatibility and minor bug fixes
|
373 |
+
|
374 |
+
= 3.2.2 =
|
375 |
+
* WordPress 3.6.1 compatible, bug fix and UI improvements
|
376 |
+
|
377 |
+
= 3.2.1 =
|
378 |
+
* Performance improvements on SQL and CSV parsing
|
379 |
+
|
380 |
+
= 3.2.0 =
|
381 |
+
* Now compatible with 3.6 and improved featured image
|
382 |
+
|
383 |
+
= 3.1.0 =
|
384 |
+
* Now Much Improved Featured Image and url handling
|
385 |
+
|
386 |
+
= 3.0.0 =
|
387 |
+
* Must upgrade to have Major improvements, performance fixes and issue fixes
|
388 |
+
|
389 |
+
= 2.7.0 =
|
390 |
+
* Major improvements and feature changes.
|
391 |
+
|
392 |
+
= 2.6.0 =
|
393 |
+
* Bug fixed and should upgrade.
|
394 |
+
|
395 |
+
= 2.5.0 =
|
396 |
+
* Duplicate detection added.
|
397 |
+
* Added more information in success message.
|
398 |
+
* Import memory issues solved.
|
399 |
+
|
400 |
+
= 2.0.1 =
|
401 |
+
* Update to WordPress-3.5 compatibility.
|
402 |
+
|
403 |
+
= 2.0.0 =
|
404 |
+
* Major Bug fixed and should upgrade. WPDEBUG errors fixed. CSV import folder changed to WP native uploads folder.
|
405 |
+
|
406 |
+
= 1.1.1 =
|
407 |
+
* Minor correction and fix applied.
|
408 |
+
|
409 |
+
= 1.1.0 =
|
410 |
+
* A major new feature added in this version. Update needed.
|
411 |
+
|
412 |
+
= 1.0.2 =
|
413 |
+
* This version have important bug fixes and newly added features. Must be upgrade immediately.
|
414 |
+
|
415 |
+
= 1.0.1 =
|
416 |
+
* Added features to import multiple tags and categories with different delimiters.
|
417 |
+
|
418 |
+
= 1.0.0 =
|
419 |
+
* Initial release of plugin.
|
images/Importicon_24.png
CHANGED
File without changes
|
images/csv_importer_dashboard_v3.5.png
ADDED
Binary file
|
images/facebook.png
CHANGED
File without changes
|
images/googleplus.png
CHANGED
File without changes
|
images/icon.png
CHANGED
File without changes
|
images/linkedin.png
CHANGED
File without changes
|
images/twitter.png
CHANGED
File without changes
|
includes/ImportLib.php
DELETED
@@ -1,601 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$jg18 = new ImporterLib();
|
3 |
-
$jg18->hs5('/Users/fenzik/Desktop/Trash/CSV samples/post.csv');
|
4 |
-
print_r($jg18->rm19);
|
5 |
-
|
6 |
-
|
7 |
-
class ImporterLib {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
var $za20 = true;
|
16 |
-
|
17 |
-
|
18 |
-
var $me21 = array();
|
19 |
-
|
20 |
-
|
21 |
-
var $zt22 = null;
|
22 |
-
var $ul23 = false;
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
var $ic24 = null;
|
29 |
-
|
30 |
-
|
31 |
-
var $jq25 = ',';
|
32 |
-
var $mz26 = '"';
|
33 |
-
|
34 |
-
|
35 |
-
var $ca27 = null;
|
36 |
-
|
37 |
-
|
38 |
-
var $oi28 = null;
|
39 |
-
|
40 |
-
|
41 |
-
var $jm29 = null;
|
42 |
-
|
43 |
-
|
44 |
-
var $ra30 = 15;
|
45 |
-
|
46 |
-
|
47 |
-
var $cm31 = "a-zA-Z0-9\n\r";
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
var $yl32 = ",;\t.:|";
|
52 |
-
|
53 |
-
|
54 |
-
var $kc33 = false;
|
55 |
-
var $dq34 = 'ISO-8859-1';
|
56 |
-
var $bt35 = 'ISO-8859-1';
|
57 |
-
|
58 |
-
|
59 |
-
var $fj36 = "\r\n";
|
60 |
-
|
61 |
-
|
62 |
-
var $wu37 = ',';
|
63 |
-
var $oi38 = 'data.csv';
|
64 |
-
|
65 |
-
|
66 |
-
var $fz39 = false;
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
var $kc40;
|
72 |
-
|
73 |
-
|
74 |
-
var $ch41;
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
var $rf42 = 0;
|
85 |
-
|
86 |
-
|
87 |
-
var $wu43 = array();
|
88 |
-
|
89 |
-
|
90 |
-
var $ez44 = array();
|
91 |
-
|
92 |
-
|
93 |
-
var $pa45 = array();
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
function sh0 ($jm46 = null, $oi28 = null, $jm29 = null, $ca27 = null) {
|
98 |
-
if ( $oi28 !== null ) $this->eu47 = $oi28;
|
99 |
-
if ( $jm29 !== null ) $this->lf48 = $jm29;
|
100 |
-
if ( count($ca27) > 0 ) $this->eq49 = $ca27;
|
101 |
-
if ( !empty($jm46) ) $this->ch1($jm46);
|
102 |
-
}
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
function ch1 ($jm46 = null, $oi28 = null, $jm29 = null, $ca27 = null) {
|
111 |
-
if ( $jm46 === null ) $jm46 = $this->ip50;
|
112 |
-
if ( !empty($jm46) ) {
|
113 |
-
if ( $oi28 !== null ) $this->eu47 = $oi28;
|
114 |
-
if ( $jm29 !== null ) $this->lf48 = $jm29;
|
115 |
-
if ( count($ca27) > 0 ) $this->eq49 = $ca27;
|
116 |
-
if ( is_readable($jm46) ) {
|
117 |
-
$this->rm19 = $this->ph6($jm46);
|
118 |
-
} else {
|
119 |
-
$this->pq51 = &$jm46;
|
120 |
-
$this->rm19 = $this->om7();
|
121 |
-
}
|
122 |
-
if ( $this->rm19 === false ) return false;
|
123 |
-
}
|
124 |
-
return true;
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
function af2 ($kc40 = null, $pa45 = array(), $bf52 = false, $me21 = array()) {
|
129 |
-
if ( empty($kc40) ) $kc40 = &$this->ip50;
|
130 |
-
$qi53 = ( $bf52 ) ? 'at' : 'wt' ;
|
131 |
-
$zs54 = ( preg_match('/\.php$/i', $kc40) ) ? true : false ;
|
132 |
-
return $this->jn17($kc40, $this->re8($pa45, $me21, $bf52, $zs54), $qi53);
|
133 |
-
}
|
134 |
-
|
135 |
-
|
136 |
-
function su3 ($iu55 = null, $pa45 = array(), $me21 = array(), $jq25 = null) {
|
137 |
-
if ( empty($iu55) ) $iu55 = $this->ns56;
|
138 |
-
if ( $jq25 === null ) $jq25 = $this->qd57;
|
139 |
-
$pa45 = $this->re8($pa45, $me21, null, null, $jq25);
|
140 |
-
if ( $iu55 !== null ) {
|
141 |
-
header('Content-type: application/csv');
|
142 |
-
header('Content-Disposition: attachment; filename="'.$iu55.'"');
|
143 |
-
echo $pa45;
|
144 |
-
}
|
145 |
-
return $pa45;
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
-
function xo4 ($jm46 = null, $su3 = null) {
|
150 |
-
$this->kp58 = true;
|
151 |
-
if ( $jm46 !== null ) $this->lh59 = $jm46;
|
152 |
-
if ( $su3 !== null ) $this->rk60 = $su3;
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
function hs5 ($kc40 = null, $ch1 = true, $mm61 = null, $qh62 = null, $mz26 = null) {
|
157 |
-
|
158 |
-
if ( $kc40 === null ) $kc40 = $this->ip50;
|
159 |
-
if ( empty($mm61) ) $mm61 = $this->yf63;
|
160 |
-
if ( $mz26 === null ) $mz26 = $this->zu64;
|
161 |
-
|
162 |
-
if ( $qh62 === null ) $qh62 = $this->dv65;
|
163 |
-
|
164 |
-
if ( empty($this->pq51) ) {
|
165 |
-
if ( $this->xy14($kc40) ) {
|
166 |
-
$pa45 = &$this->pq51;
|
167 |
-
} else return false;
|
168 |
-
} else {
|
169 |
-
$pa45 = &$this->pq51;
|
170 |
-
}
|
171 |
-
|
172 |
-
$dl66 = array();
|
173 |
-
$strlen = strlen($pa45);
|
174 |
-
$ue68 = false;
|
175 |
-
$hl69 = 1;
|
176 |
-
$wx70 = true;
|
177 |
-
|
178 |
-
|
179 |
-
for ( $wg71=0; $wg71 < $strlen; $wg71++ ) {
|
180 |
-
$ye72 = $pa45{$wg71};
|
181 |
-
$tf73 = ( isset($pa45{$wg71+1}) ) ? $pa45{$wg71+1} : false ;
|
182 |
-
$rl74 = ( isset($pa45{$wg71-1}) ) ? $pa45{$wg71-1} : false ;
|
183 |
-
|
184 |
-
|
185 |
-
if ( $ye72 == $mz26 ) {
|
186 |
-
if ( !$ue68 || $tf73 != $mz26 ) {
|
187 |
-
$ue68 = ( $ue68 ) ? false : true ;
|
188 |
-
} elseif ( $ue68 ) {
|
189 |
-
$wg71++;
|
190 |
-
}
|
191 |
-
|
192 |
-
|
193 |
-
} elseif ( ($ye72 == "\n" && $rl74 != "\r" || $ye72 == "\r") && !$ue68 ) {
|
194 |
-
if ( $hl69 >= $mm61 ) {
|
195 |
-
$strlen = 0;
|
196 |
-
$wx70 = false;
|
197 |
-
} else {
|
198 |
-
$hl69++;
|
199 |
-
}
|
200 |
-
|
201 |
-
|
202 |
-
} elseif (!$ue68) {
|
203 |
-
if ( !preg_match('/['.preg_quote($this->lz75, '/').']/i', $ye72) ) {
|
204 |
-
if ( !isset($dl66[$ye72][$hl69]) ) {
|
205 |
-
$dl66[$ye72][$hl69] = 1;
|
206 |
-
} else {
|
207 |
-
$dl66[$ye72][$hl69]++;
|
208 |
-
}
|
209 |
-
}
|
210 |
-
}
|
211 |
-
}
|
212 |
-
|
213 |
-
|
214 |
-
$ft76 = ( $wx70 ) ? $hl69-1 : $hl69 ;
|
215 |
-
$wn77 = array();
|
216 |
-
foreach( $dl66 as $hh78 => $ss79 ) {
|
217 |
-
if ( $si80 = $this->qf15($hh78, $ss79, $ft76, $qh62) ) {
|
218 |
-
$wn77[$si80] = $hh78;
|
219 |
-
}
|
220 |
-
}
|
221 |
-
|
222 |
-
|
223 |
-
ksort($wn77);
|
224 |
-
$this->wy81 = reset($wn77);
|
225 |
-
|
226 |
-
|
227 |
-
if ( $ch1 ) $this->rm19 = $this->om7();
|
228 |
-
|
229 |
-
return $this->wy81;
|
230 |
-
|
231 |
-
}
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
function ph6 ($kc40 = null) {
|
240 |
-
if ( $kc40 === null ) $kc40 = $this->ip50;
|
241 |
-
if ( empty($this->pq51) ) $this->nm9($kc40);
|
242 |
-
return ( !empty($this->pq51) ) ? $this->om7() : false ;
|
243 |
-
}
|
244 |
-
|
245 |
-
|
246 |
-
function om7 ($pa45 = null) {
|
247 |
-
if ( empty($pa45) ) {
|
248 |
-
if ( $this->xy14() ) {
|
249 |
-
$pa45 = &$this->pq51;
|
250 |
-
} else return false;
|
251 |
-
}
|
252 |
-
|
253 |
-
$uc82 = str_replace($this->wy81, '', " \t\x0B\0");
|
254 |
-
|
255 |
-
$hs83 = array();
|
256 |
-
$iz84 = array();
|
257 |
-
$gx85 = 0;
|
258 |
-
$pu86 = '';
|
259 |
-
$jf87 = ( !empty($this->nt88) ) ? $this->nt88 : array() ;
|
260 |
-
$fu89 = 0;
|
261 |
-
$ue68 = false;
|
262 |
-
$jp90 = false;
|
263 |
-
$strlen = strlen($pa45);
|
264 |
-
|
265 |
-
|
266 |
-
for ( $wg71=0; $wg71 < $strlen; $wg71++ ) {
|
267 |
-
$ye72 = $pa45{$wg71};
|
268 |
-
$tf73 = ( isset($pa45{$wg71+1}) ) ? $pa45{$wg71+1} : false ;
|
269 |
-
$rl74 = ( isset($pa45{$wg71-1}) ) ? $pa45{$wg71-1} : false ;
|
270 |
-
|
271 |
-
|
272 |
-
if ( $ye72 == $this->zu64 ) {
|
273 |
-
if ( !$ue68 ) {
|
274 |
-
if ( ltrim($pu86, $uc82) == '' ) {
|
275 |
-
$ue68 = true;
|
276 |
-
$jp90 = true;
|
277 |
-
} else {
|
278 |
-
$this->hf91 = 2;
|
279 |
-
$wn92 = count($hs83) + 1;
|
280 |
-
$vi93 = $fu89 + 1;
|
281 |
-
if ( !isset($this->cd94[$wn92.'-'.$vi93]) ) {
|
282 |
-
$this->cd94[$wn92.'-'.$vi93] = array(
|
283 |
-
'type' => 2,
|
284 |
-
'info' => 'Syntax error found on row '.$wn92.'. Non-enclosed fields can not contain double-quotes.',
|
285 |
-
'row' => $wn92,
|
286 |
-
'field' => $vi93,
|
287 |
-
'field_name' => (!empty($jf87[$fu89])) ? $jf87[$fu89] : null,
|
288 |
-
);
|
289 |
-
}
|
290 |
-
$pu86 .= $ye72;
|
291 |
-
}
|
292 |
-
} elseif ($tf73 == $this->zu64) {
|
293 |
-
$pu86 .= $ye72;
|
294 |
-
$wg71++;
|
295 |
-
} elseif ( $tf73 != $this->wy81 && $tf73 != "\r" && $tf73 != "\n" ) {
|
296 |
-
for ( $ci95=($wg71+1); isset($pa45{$ci95}) && ltrim($pa45{$ci95}, $uc82) == ''; $ci95++ ) {}
|
297 |
-
if ( $pa45{$ci95} == $this->wy81 ) {
|
298 |
-
$ue68 = false;
|
299 |
-
$wg71 = $ci95;
|
300 |
-
} else {
|
301 |
-
if ( $this->hf91 < 1 ) {
|
302 |
-
$this->hf91 = 1;
|
303 |
-
}
|
304 |
-
$wn92 = count($hs83) + 1;
|
305 |
-
$vi93 = $fu89 + 1;
|
306 |
-
if ( !isset($this->cd94[$wn92.'-'.$vi93]) ) {
|
307 |
-
$this->cd94[$wn92.'-'.$vi93] = array(
|
308 |
-
'type' => 1,
|
309 |
-
'info' =>
|
310 |
-
'Syntax error found on row '.(count($hs83) + 1).'. '.
|
311 |
-
'A single double-quote was found within an enclosed string. '.
|
312 |
-
'Enclosed double-quotes must be escaped with a second double-quote.',
|
313 |
-
'row' => count($hs83) + 1,
|
314 |
-
'field' => $fu89 + 1,
|
315 |
-
'field_name' => (!empty($jf87[$fu89])) ? $jf87[$fu89] : null,
|
316 |
-
);
|
317 |
-
}
|
318 |
-
$pu86 .= $ye72;
|
319 |
-
$ue68 = false;
|
320 |
-
}
|
321 |
-
} else {
|
322 |
-
$ue68 = false;
|
323 |
-
}
|
324 |
-
|
325 |
-
|
326 |
-
} elseif ( ($ye72 == $this->wy81 || $ye72 == "\n" || $ye72 == "\r") && !$ue68 ) {
|
327 |
-
$qp96 = ( !empty($jf87[$fu89]) ) ? $jf87[$fu89] : $fu89 ;
|
328 |
-
$iz84[$qp96] = ( $jp90 ) ? $pu86 : trim($pu86) ;
|
329 |
-
$pu86 = '';
|
330 |
-
$jp90 = false;
|
331 |
-
$fu89++;
|
332 |
-
|
333 |
-
|
334 |
-
if ( $ye72 == "\n" || $ye72 == "\r" ) {
|
335 |
-
if ( $this->tr12($gx85) && $this->ps10($iz84, $this->eq49) ) {
|
336 |
-
if ( $this->rv97 && empty($jf87) ) {
|
337 |
-
$jf87 = $iz84;
|
338 |
-
} elseif ( empty($this->nt88) || (!empty($this->nt88) && (($this->rv97 && $gx85 > 0) || !$this->rv97)) ) {
|
339 |
-
if ( !empty($this->pq98) && !empty($iz84[$this->pq98]) ) {
|
340 |
-
if ( isset($hs83[$iz84[$this->pq98]]) ) {
|
341 |
-
$hs83[$iz84[$this->pq98].'_0'] = &$hs83[$iz84[$this->pq98]];
|
342 |
-
unset($hs83[$iz84[$this->pq98]]);
|
343 |
-
for ( $zv99=1; isset($hs83[$iz84[$this->pq98].'_'.$zv99]); $zv99++ ) {}
|
344 |
-
$hs83[$iz84[$this->pq98].'_'.$zv99] = $iz84;
|
345 |
-
} else $hs83[$iz84[$this->pq98]] = $iz84;
|
346 |
-
} else $hs83[] = $iz84;
|
347 |
-
}
|
348 |
-
}
|
349 |
-
$iz84 = array();
|
350 |
-
$fu89 = 0;
|
351 |
-
$gx85++;
|
352 |
-
if ( $this->pq98 === null && $this->lf48 !== null && count($hs83) == $this->lf48 ) {
|
353 |
-
$wg71 = $strlen;
|
354 |
-
}
|
355 |
-
if ( $ye72 == "\r" && $tf73 == "\n" ) $wg71++;
|
356 |
-
}
|
357 |
-
|
358 |
-
|
359 |
-
} else {
|
360 |
-
$pu86 .= $ye72;
|
361 |
-
}
|
362 |
-
}
|
363 |
-
$this->vh100 = $jf87;
|
364 |
-
if ( !empty($this->pq98) ) {
|
365 |
-
$ic24 = SORT_REGULAR;
|
366 |
-
if ( $this->tc101 == 'numeric' ) {
|
367 |
-
$ic24 = SORT_NUMERIC;
|
368 |
-
} elseif ( $this->tc101 == 'string' ) {
|
369 |
-
$ic24 = SORT_STRING;
|
370 |
-
}
|
371 |
-
( $this->sn102 ) ? krsort($hs83, $ic24) : ksort($hs83, $ic24) ;
|
372 |
-
if ( $this->eu47 !== null || $this->lf48 !== null ) {
|
373 |
-
$hs83 = array_slice($hs83, ($this->eu47 === null ? 0 : $this->eu47) , $this->lf48, true);
|
374 |
-
}
|
375 |
-
}
|
376 |
-
if ( !$this->qi103 ) {
|
377 |
-
$this->pq51 = null;
|
378 |
-
}
|
379 |
-
return $hs83;
|
380 |
-
}
|
381 |
-
|
382 |
-
|
383 |
-
function re8 ( $pa45 = array(), $me21 = array(), $bf52 = false , $zs54 = false, $jq25 = null) {
|
384 |
-
if ( !is_array($pa45) || empty($pa45) ) $pa45 = &$this->rm19;
|
385 |
-
if ( !is_array($me21) || empty($me21) ) $me21 = &$this->vh100;
|
386 |
-
if ( $jq25 === null ) $jq25 = $this->wy81;
|
387 |
-
|
388 |
-
$os104 = ( $zs54 ) ? "<?php header('Status: 403'); die(' '); ?>".$this->tj105 : '' ;
|
389 |
-
$rw106 = array();
|
390 |
-
|
391 |
-
|
392 |
-
if ( $this->rv97 && !$bf52 && !empty($me21) ) {
|
393 |
-
foreach( $me21 as $qp96 => $ss79 ) {
|
394 |
-
$rw106[] = $this->ng13($ss79);
|
395 |
-
}
|
396 |
-
$os104 .= implode($jq25, $rw106).$this->tj105;
|
397 |
-
$rw106 = array();
|
398 |
-
}
|
399 |
-
|
400 |
-
|
401 |
-
foreach( $pa45 as $qp96 => $iz84 ) {
|
402 |
-
foreach( $iz84 as $qr107 => $ss79 ) {
|
403 |
-
$rw106[] = $this->ng13($ss79);
|
404 |
-
}
|
405 |
-
$os104 .= implode($jq25, $rw106).$this->tj105;
|
406 |
-
$rw106 = array();
|
407 |
-
}
|
408 |
-
|
409 |
-
return $os104;
|
410 |
-
}
|
411 |
-
|
412 |
-
|
413 |
-
function nm9 ($jm46 = null) {
|
414 |
-
$pa45 = null;
|
415 |
-
$kc40 = null;
|
416 |
-
if ( $jm46 === null ) {
|
417 |
-
$kc40 = $this->ip50;
|
418 |
-
} elseif ( file_exists($jm46) ) {
|
419 |
-
$kc40 = $jm46;
|
420 |
-
} else {
|
421 |
-
$pa45 = $jm46;
|
422 |
-
}
|
423 |
-
if ( !empty($pa45) || $pa45 = $this->cq16($kc40) ) {
|
424 |
-
if ( $this->ip50 != $kc40 ) $this->ip50 = $kc40;
|
425 |
-
if ( preg_match('/\.php$/i', $kc40) && preg_match('/<\?.*?\?>(.*)/ims', $pa45, $tc108) ) {
|
426 |
-
$pa45 = ltrim($tc108[1]);
|
427 |
-
}
|
428 |
-
if ( $this->kp58 ) $pa45 = iconv($this->lh59, $this->rk60, $pa45);
|
429 |
-
if ( substr($pa45, -1) != "\n" ) $pa45 .= "\n";
|
430 |
-
$this->pq51 = &$pa45;
|
431 |
-
return true;
|
432 |
-
}
|
433 |
-
return false;
|
434 |
-
}
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
function ps10 ($iz84 = array(), $ca27 = null) {
|
443 |
-
if ( !empty($iz84) ) {
|
444 |
-
if ( !empty($ca27) ) {
|
445 |
-
$ca27 = (strpos($ca27, ' OR ') !== false) ? explode(' OR ', $ca27) : array($ca27) ;
|
446 |
-
$bh109 = '';
|
447 |
-
foreach( $ca27 as $qp96 => $ss79 ) {
|
448 |
-
if ( strpos($ss79, ' AND ') !== false ) {
|
449 |
-
$ss79 = explode(' AND ', $ss79);
|
450 |
-
$qn110 = '';
|
451 |
-
foreach( $ss79 as $sj111 => $ix112 ) {
|
452 |
-
$qn110 .= $this->dp11($iz84, $ix112);
|
453 |
-
}
|
454 |
-
$bh109 .= (strpos($qn110, '0') !== false) ? '0' : '1' ;
|
455 |
-
} else {
|
456 |
-
$bh109 .= $this->dp11($iz84, $ss79);
|
457 |
-
}
|
458 |
-
}
|
459 |
-
return (strpos($bh109, '1') !== false) ? true : false ;
|
460 |
-
}
|
461 |
-
return true;
|
462 |
-
}
|
463 |
-
return false;
|
464 |
-
}
|
465 |
-
|
466 |
-
|
467 |
-
function dp11 ($iz84, $to113) {
|
468 |
-
$wz114 = array(
|
469 |
-
'=', 'equals', 'is',
|
470 |
-
'!=', 'is not',
|
471 |
-
'<', 'is less than',
|
472 |
-
'>', 'is greater than',
|
473 |
-
'<=', 'is less than or equals',
|
474 |
-
'>=', 'is greater than or equals',
|
475 |
-
'contains',
|
476 |
-
'does not contain',
|
477 |
-
);
|
478 |
-
$pr115 = array();
|
479 |
-
foreach( $wz114 as $ss79 ) {
|
480 |
-
$pr115[] = preg_quote($ss79, '/');
|
481 |
-
}
|
482 |
-
$pr115 = implode('|', $pr115);
|
483 |
-
if ( preg_match('/^(.+) ('.$pr115.') (.+)$/i', trim($to113), $jn116) ) {
|
484 |
-
$qr107 = $jn116[1];
|
485 |
-
$pv117 = $jn116[2];
|
486 |
-
$ss79 = $jn116[3];
|
487 |
-
if ( preg_match('/^([\'\"]{1})(.*)([\'\"]{1})$/i', $ss79, $jn116) ) {
|
488 |
-
if ( $jn116[1] == $jn116[3] ) {
|
489 |
-
$ss79 = $jn116[2];
|
490 |
-
$ss79 = str_replace("\\n", "\n", $ss79);
|
491 |
-
$ss79 = str_replace("\\r", "\r", $ss79);
|
492 |
-
$ss79 = str_replace("\\t", "\t", $ss79);
|
493 |
-
$ss79 = stripslashes($ss79);
|
494 |
-
}
|
495 |
-
}
|
496 |
-
if ( array_key_exists($qr107, $iz84) ) {
|
497 |
-
if ( ($pv117 == '=' || $pv117 == 'equals' || $pv117 == 'is') && $iz84[$qr107] == $ss79 ) {
|
498 |
-
return '1';
|
499 |
-
} elseif ( ($pv117 == '!=' || $pv117 == 'is not') && $iz84[$qr107] != $ss79 ) {
|
500 |
-
return '1';
|
501 |
-
} elseif ( ($pv117 == '<' || $pv117 == 'is less than' ) && $iz84[$qr107] < $ss79 ) {
|
502 |
-
return '1';
|
503 |
-
} elseif ( ($pv117 == '>' || $pv117 == 'is greater than') && $iz84[$qr107] > $ss79 ) {
|
504 |
-
return '1';
|
505 |
-
} elseif ( ($pv117 == '<=' || $pv117 == 'is less than or equals' ) && $iz84[$qr107] <= $ss79 ) {
|
506 |
-
return '1';
|
507 |
-
} elseif ( ($pv117 == '>=' || $pv117 == 'is greater than or equals') && $iz84[$qr107] >= $ss79 ) {
|
508 |
-
return '1';
|
509 |
-
} elseif ( $pv117 == 'contains' && preg_match('/'.preg_quote($ss79, '/').'/i', $iz84[$qr107]) ) {
|
510 |
-
return '1';
|
511 |
-
} elseif ( $pv117 == 'does not contain' && !preg_match('/'.preg_quote($ss79, '/').'/i', $iz84[$qr107]) ) {
|
512 |
-
return '1';
|
513 |
-
} else {
|
514 |
-
return '0';
|
515 |
-
}
|
516 |
-
}
|
517 |
-
}
|
518 |
-
return '1';
|
519 |
-
}
|
520 |
-
|
521 |
-
|
522 |
-
function tr12 ($jj118) {
|
523 |
-
if ( $this->pq98 === null && $this->eu47 !== null && $jj118 < $this->eu47 ) return false;
|
524 |
-
return true;
|
525 |
-
}
|
526 |
-
|
527 |
-
|
528 |
-
function ng13 ($ss79 = null) {
|
529 |
-
if ( $ss79 !== null && $ss79 != '' ) {
|
530 |
-
$jq25 = preg_quote($this->wy81, '/');
|
531 |
-
$mz26 = preg_quote($this->zu64, '/');
|
532 |
-
if ( preg_match("/".$jq25."|".$mz26."|\n|\r/i", $ss79) || ($ss79{0} == ' ' || substr($ss79, -1) == ' ') ) {
|
533 |
-
$ss79 = str_replace($this->zu64, $this->zu64.$this->zu64, $ss79);
|
534 |
-
$ss79 = $this->zu64.$ss79.$this->zu64;
|
535 |
-
}
|
536 |
-
}
|
537 |
-
return $ss79;
|
538 |
-
}
|
539 |
-
|
540 |
-
|
541 |
-
function xy14 ($kc40 = null) {
|
542 |
-
if ( empty($this->pq51) ) {
|
543 |
-
if ( $kc40 === null ) $kc40 = $this->ip50;
|
544 |
-
return $this->nm9($kc40);
|
545 |
-
}
|
546 |
-
return true;
|
547 |
-
}
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
function qf15 ($hh78, $ag119, $ft76, $qh62) {
|
552 |
-
if ( $ft76 == count($ag119) ) {
|
553 |
-
$gc120 = null;
|
554 |
-
$iw121 = null;
|
555 |
-
$yu122 = false;
|
556 |
-
foreach( $ag119 as $qp96 => $ss79 ) {
|
557 |
-
if ( $gc120 == null ) {
|
558 |
-
$gc120 = $ss79;
|
559 |
-
} elseif ( $ss79 == $gc120 && $iw121 !== false) {
|
560 |
-
$iw121 = true;
|
561 |
-
} elseif ( $ss79 == $gc120+1 && $iw121 !== false ) {
|
562 |
-
$iw121 = true;
|
563 |
-
$yu122 = true;
|
564 |
-
} else {
|
565 |
-
$iw121 = false;
|
566 |
-
}
|
567 |
-
}
|
568 |
-
if ( $iw121 ) {
|
569 |
-
$si80 = ( $yu122 ) ? 2 : 1 ;
|
570 |
-
$yp123 = strpos($qh62, $hh78);
|
571 |
-
$yp123 = ( $yp123 !== false ) ? str_pad($yp123, 3, '0', STR_PAD_LEFT) : '999' ;
|
572 |
-
return $yp123.$si80.'.'.(99999 - str_pad($gc120, 5, '0', STR_PAD_LEFT));
|
573 |
-
} else return false;
|
574 |
-
}
|
575 |
-
}
|
576 |
-
|
577 |
-
|
578 |
-
function cq16 ($kc40 = null) {
|
579 |
-
if ( is_readable($kc40) ) {
|
580 |
-
if ( !($qs124 = fopen($kc40, 'r')) ) return false;
|
581 |
-
$pa45 = fread($qs124, filesize($kc40));
|
582 |
-
fclose($qs124);
|
583 |
-
return $pa45;
|
584 |
-
}
|
585 |
-
return false;
|
586 |
-
}
|
587 |
-
|
588 |
-
|
589 |
-
function jn17 ($kc40, $os104 = '', $qi53 = 'wb', $nu125 = 2) {
|
590 |
-
if ( $qw126 = fopen($kc40, $qi53) ) {
|
591 |
-
flock($qw126, $nu125);
|
592 |
-
$mr127 = fwrite($qw126, $os104);
|
593 |
-
$ri128 = fclose($qw126);
|
594 |
-
if ( $mr127 != false && $ri128 != false ) return true;
|
595 |
-
}
|
596 |
-
return false;
|
597 |
-
}
|
598 |
-
|
599 |
-
}
|
600 |
-
|
601 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/WPImporter_includes_helper.php
CHANGED
@@ -284,7 +284,7 @@ class WPImporter_includes_helper {
|
|
284 |
* for the CSV
|
285 |
* @return array formatted CSV output as array
|
286 |
*/
|
287 |
-
function csv_file_data($file
|
288 |
{
|
289 |
$file = $this->getUploadDirectory().'/'.$file;
|
290 |
$csv = new parseCSV();
|
@@ -383,7 +383,6 @@ class WPImporter_includes_helper {
|
|
383 |
$custom_array = array();
|
384 |
$seo_custom_array= array();
|
385 |
$imported_feature_img = array();
|
386 |
-
|
387 |
$headr_count = $ret_array['h2'];
|
388 |
for ($i = 0; $i < count($data_rows); $i++) {
|
389 |
if (array_key_exists('mapping' . $i, $ret_array)) {
|
@@ -665,7 +664,6 @@ class WPImporter_includes_helper {
|
|
665 |
|
666 |
}
|
667 |
}
|
668 |
-
//print('<pre>');print_r($data_array);die;
|
669 |
if ($data_array)
|
670 |
$post_id = wp_insert_post($data_array);
|
671 |
|
@@ -717,10 +715,6 @@ class WPImporter_includes_helper {
|
|
717 |
}
|
718 |
//Import SEO Values
|
719 |
if(!empty($seo_custom_array)){
|
720 |
-
//require_once("class.customfields.php");
|
721 |
-
//$seoObj = new Customfields();
|
722 |
-
//$seoObj->importSEOFields($seo_custom_array, $post_id);
|
723 |
-
//print '<pre>';print_r($seo_custom_array);die;
|
724 |
$this->importSEOfields($seo_custom_array,$post_id);
|
725 |
}
|
726 |
|
284 |
* for the CSV
|
285 |
* @return array formatted CSV output as array
|
286 |
*/
|
287 |
+
function csv_file_data($file)
|
288 |
{
|
289 |
$file = $this->getUploadDirectory().'/'.$file;
|
290 |
$csv = new parseCSV();
|
383 |
$custom_array = array();
|
384 |
$seo_custom_array= array();
|
385 |
$imported_feature_img = array();
|
|
|
386 |
$headr_count = $ret_array['h2'];
|
387 |
for ($i = 0; $i < count($data_rows); $i++) {
|
388 |
if (array_key_exists('mapping' . $i, $ret_array)) {
|
664 |
|
665 |
}
|
666 |
}
|
|
|
667 |
if ($data_array)
|
668 |
$post_id = wp_insert_post($data_array);
|
669 |
|
715 |
}
|
716 |
//Import SEO Values
|
717 |
if(!empty($seo_custom_array)){
|
|
|
|
|
|
|
|
|
718 |
$this->importSEOfields($seo_custom_array,$post_id);
|
719 |
}
|
720 |
|
index.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/******************************
|
3 |
* Plugin Name: WP Ultimate CSV Importer
|
4 |
* Description: A plugin that helps to import the data's from a CSV file.
|
5 |
-
* Version: 3.6
|
6 |
* Author: smackcoders.com
|
7 |
* Plugin URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
|
8 |
* Author URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
|
@@ -70,6 +70,13 @@ function action_csv_imp_admin_menu() {
|
|
70 |
if(!function_exists('wp_get_current_user')) {
|
71 |
include(ABSPATH . "wp-includes/pluggable.php");
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
if ( current_user_can( 'author' ) ) {
|
74 |
$HelperObj = new WPImporter_includes_helper();
|
75 |
$settings = $HelperObj->getSettings();
|
@@ -79,9 +86,9 @@ function action_csv_imp_admin_menu() {
|
|
79 |
} else if ( current_user_can( 'administrator' ) ) {
|
80 |
add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
|
81 |
}
|
|
|
82 |
}
|
83 |
-
|
84 |
-
add_action("admin_menu", "action_csv_imp_admin_menu");
|
85 |
|
86 |
function action_csv_imp_admin_init() {
|
87 |
if (isset($_REQUEST['page']) && ($_REQUEST['page'] == 'wp-ultimate-csv-importer/index.php' || $_REQUEST['page'] == 'page')) {
|
@@ -147,12 +154,11 @@ function roundchart() {
|
|
147 |
require_once("modules/dashboard/actions/actions.php");
|
148 |
?>
|
149 |
<?php
|
150 |
-
$myObj = new DashboardActions();
|
151 |
|
152 |
$content = "<form name='piechart' onload='pieStats();'> <div id ='pieStats' style='height:250px;'>";
|
153 |
$content .= $myObj->piechart();
|
154 |
-
$content .= "</div></form>";
|
155 |
-
<!-- <input type='hidden' id ='checkmodule' value=''> <input type='hidden' id='log' value=''><input type='hidden' id='stepstatus' value=''><input type='hidden' id='checkfile' value=''><input type='hidden' id='uploadedFile' value=''><input type=><div id='pieStats'> </div> --><?php
|
156 |
echo $content;
|
157 |
}
|
158 |
|
@@ -165,12 +171,11 @@ function linetwoStats() {
|
|
165 |
require_once("modules/dashboard/actions/actions.php");
|
166 |
?>
|
167 |
<?php
|
168 |
-
$myObj = new DashboardActions();
|
169 |
|
170 |
$content = "<form name='piechart' onload='pieStats();'> <div id ='lineStats' style='height:250px'>";
|
171 |
$content .= $myObj->getStatsWithDate();
|
172 |
-
$content .= "</div></form>";
|
173 |
-
<!-- <input type='hidden' id ='checkmodule' value=''> <input type='hidden' id='log' value=''><input type='hidden' id='stepstatus' value=''><input type='hidden' id='checkfile' value=''><input type='hidden' id='uploadedFile' value=''><input type=><div id='pieStats'> </div> --><?php
|
174 |
echo $content;
|
175 |
}
|
176 |
|
2 |
/******************************
|
3 |
* Plugin Name: WP Ultimate CSV Importer
|
4 |
* Description: A plugin that helps to import the data's from a CSV file.
|
5 |
+
* Version: 3.6.1
|
6 |
* Author: smackcoders.com
|
7 |
* Plugin URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
|
8 |
* Author URI: http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html
|
70 |
if(!function_exists('wp_get_current_user')) {
|
71 |
include(ABSPATH . "wp-includes/pluggable.php");
|
72 |
}
|
73 |
+
if(is_multisite()) {
|
74 |
+
if ( current_user_can( 'administrator' ) ) {
|
75 |
+
add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
|
76 |
+
}
|
77 |
+
|
78 |
+
}
|
79 |
+
else {
|
80 |
if ( current_user_can( 'author' ) ) {
|
81 |
$HelperObj = new WPImporter_includes_helper();
|
82 |
$settings = $HelperObj->getSettings();
|
86 |
} else if ( current_user_can( 'administrator' ) ) {
|
87 |
add_menu_page(WP_CONST_ULTIMATE_CSV_IMP_SETTINGS, WP_CONST_ULTIMATE_CSV_IMP_NAME, 'manage_options', __FILE__, array('WPImporter_includes_helper', 'output_fd_page'), WP_CONST_ULTIMATE_CSV_IMP_DIR . "images/icon.png");
|
88 |
}
|
89 |
+
}
|
90 |
}
|
91 |
+
add_action("admin_menu" , "action_csv_imp_admin_menu");
|
|
|
92 |
|
93 |
function action_csv_imp_admin_init() {
|
94 |
if (isset($_REQUEST['page']) && ($_REQUEST['page'] == 'wp-ultimate-csv-importer/index.php' || $_REQUEST['page'] == 'page')) {
|
154 |
require_once("modules/dashboard/actions/actions.php");
|
155 |
?>
|
156 |
<?php
|
157 |
+
$myObj = new DashboardActions();
|
158 |
|
159 |
$content = "<form name='piechart' onload='pieStats();'> <div id ='pieStats' style='height:250px;'>";
|
160 |
$content .= $myObj->piechart();
|
161 |
+
$content .= "</div></form>";
|
|
|
162 |
echo $content;
|
163 |
}
|
164 |
|
171 |
require_once("modules/dashboard/actions/actions.php");
|
172 |
?>
|
173 |
<?php
|
174 |
+
$myObj = new DashboardActions();
|
175 |
|
176 |
$content = "<form name='piechart' onload='pieStats();'> <div id ='lineStats' style='height:250px'>";
|
177 |
$content .= $myObj->getStatsWithDate();
|
178 |
+
$content .= "</div></form>";
|
|
|
179 |
echo $content;
|
180 |
}
|
181 |
|
lib/jquery-plugins/UploadHandler.php
ADDED
@@ -0,0 +1,1425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* jQuery File Upload Plugin PHP Class 7.0.1
|
4 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
5 |
+
*
|
6 |
+
* Copyright 2010, Sebastian Tschan
|
7 |
+
* https://blueimp.net
|
8 |
+
*
|
9 |
+
* Licensed under the MIT license:
|
10 |
+
* http://www.opensource.org/licenses/MIT
|
11 |
+
*/
|
12 |
+
|
13 |
+
require_once("../../../../../wp-load.php");
|
14 |
+
require_once("../../includes/WPImporter_includes_helper.php");
|
15 |
+
|
16 |
+
class UploadHandler
|
17 |
+
{
|
18 |
+
|
19 |
+
protected $options;
|
20 |
+
|
21 |
+
// PHP File Upload error message codes:
|
22 |
+
// http://php.net/manual/en/features.file-upload.errors.php
|
23 |
+
protected $error_messages = array(
|
24 |
+
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
|
25 |
+
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
|
26 |
+
3 => 'The uploaded file was only partially uploaded',
|
27 |
+
4 => 'No file was uploaded',
|
28 |
+
6 => 'Missing a temporary folder',
|
29 |
+
7 => 'Failed to write file to disk',
|
30 |
+
8 => 'A PHP extension stopped the file upload',
|
31 |
+
'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',
|
32 |
+
'max_file_size' => 'File is too big',
|
33 |
+
'min_file_size' => 'File is too small',
|
34 |
+
'accept_file_types' => 'Filetype not allowed',
|
35 |
+
'max_number_of_files' => 'Maximum number of files exceeded',
|
36 |
+
'max_width' => 'Image exceeds maximum width',
|
37 |
+
'min_width' => 'Image requires a minimum width',
|
38 |
+
'max_height' => 'Image exceeds maximum height',
|
39 |
+
'min_height' => 'Image requires a minimum height'
|
40 |
+
);
|
41 |
+
|
42 |
+
protected $image_objects = array();
|
43 |
+
|
44 |
+
function __construct($options = null, $initialize = true, $error_messages = null)
|
45 |
+
{
|
46 |
+
$this->options = array(
|
47 |
+
'script_url' => $this->get_full_url() . '/',
|
48 |
+
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')) . '/files/',
|
49 |
+
'upload_url' => $this->get_full_url() . '/files/',
|
50 |
+
'user_dirs' => false,
|
51 |
+
'mkdir_mode' => 0755,
|
52 |
+
'param_name' => 'files',
|
53 |
+
// Set the following option to 'POST', if your server does not support
|
54 |
+
// DELETE requests. This is a parameter sent to the client:
|
55 |
+
'delete_type' => 'DELETE',
|
56 |
+
'access_control_allow_origin' => '*',
|
57 |
+
'access_control_allow_credentials' => false,
|
58 |
+
'access_control_allow_methods' => array(
|
59 |
+
'OPTIONS',
|
60 |
+
'HEAD',
|
61 |
+
'GET',
|
62 |
+
'POST',
|
63 |
+
'PUT',
|
64 |
+
'PATCH',
|
65 |
+
'DELETE'
|
66 |
+
),
|
67 |
+
'access_control_allow_headers' => array(
|
68 |
+
'Content-Type',
|
69 |
+
'Content-Range',
|
70 |
+
'Content-Disposition'
|
71 |
+
),
|
72 |
+
// Enable to provide file downloads via GET requests to the PHP script:
|
73 |
+
// 1. Set to 1 to download files via readfile method through PHP
|
74 |
+
// 2. Set to 2 to send a X-Sendfile header for lighttpd/Apache
|
75 |
+
// 3. Set to 3 to send a X-Accel-Redirect header for nginx
|
76 |
+
// If set to 2 or 3, adjust the upload_url option to the base path of
|
77 |
+
// the redirect parameter, e.g. '/files/'.
|
78 |
+
'download_via_php' => false,
|
79 |
+
// Read files in chunks to avoid memory limits when download_via_php
|
80 |
+
// is enabled, set to 0 to disable chunked reading of files:
|
81 |
+
'readfile_chunk_size' => 10 * 1024 * 1024, // 10 MiB
|
82 |
+
// Defines which files can be displayed inline when downloaded:
|
83 |
+
'inline_file_types' => '/\.(gif|jpe?g|png)$/i',
|
84 |
+
// Defines which files (based on their names) are accepted for upload:
|
85 |
+
'accept_file_types' => '/.+$/i',
|
86 |
+
// The php.ini settings upload_max_filesize and post_max_size
|
87 |
+
// take precedence over the following max_file_size setting:
|
88 |
+
'max_file_size' => null,
|
89 |
+
'min_file_size' => 1,
|
90 |
+
// The maximum number of files for the upload directory:
|
91 |
+
'max_number_of_files' => null,
|
92 |
+
// Defines which files are handled as image files:
|
93 |
+
'image_file_types' => '/\.(gif|jpe?g|png)$/i',
|
94 |
+
// Image resolution restrictions:
|
95 |
+
'max_width' => null,
|
96 |
+
'max_height' => null,
|
97 |
+
'min_width' => 1,
|
98 |
+
'min_height' => 1,
|
99 |
+
// Set the following option to false to enable resumable uploads:
|
100 |
+
'discard_aborted_uploads' => true,
|
101 |
+
// Set to 0 to use the GD library to scale and orient images,
|
102 |
+
// set to 1 to use imagick (if installed, falls back to GD),
|
103 |
+
// set to 2 to use the ImageMagick convert binary directly:
|
104 |
+
'image_library' => 1,
|
105 |
+
// Uncomment the following to define an array of resource limits
|
106 |
+
// for imagick:
|
107 |
+
/*
|
108 |
+
'imagick_resource_limits' => array(
|
109 |
+
imagick::RESOURCETYPE_MAP => 32,
|
110 |
+
imagick::RESOURCETYPE_MEMORY => 32
|
111 |
+
),
|
112 |
+
*/
|
113 |
+
// Command or path for to the ImageMagick convert binary:
|
114 |
+
'convert_bin' => 'convert',
|
115 |
+
// Uncomment the following to add parameters in front of each
|
116 |
+
// ImageMagick convert call (the limit constraints seem only
|
117 |
+
// to have an effect if put in front):
|
118 |
+
/*
|
119 |
+
'convert_params' => '-limit memory 32MiB -limit map 32MiB',
|
120 |
+
*/
|
121 |
+
// Command or path for to the ImageMagick identify binary:
|
122 |
+
'identify_bin' => 'identify',
|
123 |
+
'image_versions' => array(
|
124 |
+
// The empty image version key defines options for the original image:
|
125 |
+
'' => array(
|
126 |
+
// Automatically rotate images based on EXIF meta data:
|
127 |
+
'auto_orient' => true
|
128 |
+
),
|
129 |
+
// Uncomment the following to create medium sized images:
|
130 |
+
/*
|
131 |
+
'medium' => array(
|
132 |
+
'max_width' => 800,
|
133 |
+
'max_height' => 600
|
134 |
+
),
|
135 |
+
*/
|
136 |
+
'thumbnail' => array(
|
137 |
+
// Uncomment the following to use a defined directory for the thumbnails
|
138 |
+
// instead of a subdirectory based on the version identifier.
|
139 |
+
// Make sure that this directory doesn't allow execution of files if you
|
140 |
+
// don't pose any restrictions on the type of uploaded files, e.g. by
|
141 |
+
// copying the .htaccess file from the files directory for Apache:
|
142 |
+
//'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/thumb/',
|
143 |
+
//'upload_url' => $this->get_full_url().'/thumb/',
|
144 |
+
// Uncomment the following to force the max
|
145 |
+
// dimensions and e.g. create square thumbnails:
|
146 |
+
//'crop' => true,
|
147 |
+
'max_width' => 80,
|
148 |
+
'max_height' => 80
|
149 |
+
)
|
150 |
+
)
|
151 |
+
);
|
152 |
+
if ($options) {
|
153 |
+
$this->options = $options + $this->options;
|
154 |
+
}
|
155 |
+
if ($error_messages) {
|
156 |
+
$this->error_messages = $error_messages + $this->error_messages;
|
157 |
+
}
|
158 |
+
if ($initialize) {
|
159 |
+
$this->initialize();
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
protected function initialize()
|
164 |
+
{
|
165 |
+
switch ($this->get_server_var('REQUEST_METHOD')) {
|
166 |
+
case 'OPTIONS':
|
167 |
+
case 'HEAD':
|
168 |
+
$this->head();
|
169 |
+
break;
|
170 |
+
case 'GET':
|
171 |
+
$this->get();
|
172 |
+
break;
|
173 |
+
case 'PATCH':
|
174 |
+
case 'PUT':
|
175 |
+
case 'POST':
|
176 |
+
$this->post();
|
177 |
+
break;
|
178 |
+
case 'DELETE':
|
179 |
+
$this->delete();
|
180 |
+
break;
|
181 |
+
default:
|
182 |
+
$this->header('HTTP/1.1 405 Method Not Allowed');
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
protected function get_full_url()
|
187 |
+
{
|
188 |
+
$https = !empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'on') === 0;
|
189 |
+
return
|
190 |
+
($https ? 'https://' : 'http://') .
|
191 |
+
(!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] . '@' : '') .
|
192 |
+
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'] .
|
193 |
+
($https && $_SERVER['SERVER_PORT'] === 443 ||
|
194 |
+
$_SERVER['SERVER_PORT'] === 80 ? '' : ':' . $_SERVER['SERVER_PORT']))) .
|
195 |
+
substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
|
196 |
+
}
|
197 |
+
|
198 |
+
protected function get_user_id()
|
199 |
+
{
|
200 |
+
@session_start();
|
201 |
+
return session_id();
|
202 |
+
}
|
203 |
+
|
204 |
+
protected function get_user_path()
|
205 |
+
{
|
206 |
+
if ($this->options['user_dirs']) {
|
207 |
+
return $this->get_user_id() . '/';
|
208 |
+
}
|
209 |
+
return '';
|
210 |
+
}
|
211 |
+
|
212 |
+
protected function get_upload_path($file_name = null, $version = null)
|
213 |
+
{
|
214 |
+
$HelperObj = new WPImporter_includes_helper();
|
215 |
+
//$uploadDir = 'ultimate_importer';
|
216 |
+
$uploadDir = $HelperObj->uploadDir;
|
217 |
+
|
218 |
+
$file_name = $file_name ? $file_name : '';
|
219 |
+
if (empty($version)) {
|
220 |
+
$version_path = '';
|
221 |
+
} else {
|
222 |
+
$version_dir = @$this->options['image_versions'][$version]['upload_dir'];
|
223 |
+
if ($version_dir) {
|
224 |
+
return $version_dir . $this->get_user_path() . $file_name;
|
225 |
+
}
|
226 |
+
$version_path = $version . '/';
|
227 |
+
}
|
228 |
+
|
229 |
+
$uploadpath = $_REQUEST['uploadPath'];
|
230 |
+
$file_name = $HelperObj->convert_string2hash_key($file_name); // Code added by Fredrick Marks
|
231 |
+
|
232 |
+
return $uploadpath . '/' . $uploadDir . '/' . $this->get_user_path() . $version_path . $file_name;
|
233 |
+
}
|
234 |
+
|
235 |
+
|
236 |
+
protected function get_query_separator($url)
|
237 |
+
{
|
238 |
+
return strpos($url, '?') === false ? '?' : '&';
|
239 |
+
}
|
240 |
+
|
241 |
+
protected function get_download_url($file_name, $version = null, $direct = false)
|
242 |
+
{
|
243 |
+
if (!$direct && $this->options['download_via_php']) {
|
244 |
+
$url = $this->options['script_url']
|
245 |
+
. $this->get_query_separator($this->options['script_url'])
|
246 |
+
. 'file=' . rawurlencode($file_name);
|
247 |
+
if ($version) {
|
248 |
+
$url .= '&version=' . rawurlencode($version);
|
249 |
+
}
|
250 |
+
return $url . '&download=1';
|
251 |
+
}
|
252 |
+
if (empty($version)) {
|
253 |
+
$version_path = '';
|
254 |
+
} else {
|
255 |
+
$version_url = @$this->options['image_versions'][$version]['upload_url'];
|
256 |
+
if ($version_url) {
|
257 |
+
return $version_url . $this->get_user_path() . rawurlencode($file_name);
|
258 |
+
}
|
259 |
+
$version_path = rawurlencode($version) . '/';
|
260 |
+
}
|
261 |
+
return $this->options['upload_url'] . $this->get_user_path()
|
262 |
+
. $version_path . rawurlencode($file_name);
|
263 |
+
}
|
264 |
+
|
265 |
+
protected function set_additional_file_properties($file)
|
266 |
+
{
|
267 |
+
$file->deleteUrl = $this->options['script_url']
|
268 |
+
. $this->get_query_separator($this->options['script_url'])
|
269 |
+
. $this->get_singular_param_name()
|
270 |
+
. '=' . rawurlencode($file->name);
|
271 |
+
$file->deleteType = $this->options['delete_type'];
|
272 |
+
if ($file->deleteType !== 'DELETE') {
|
273 |
+
$file->deleteUrl .= '&_method=DELETE';
|
274 |
+
}
|
275 |
+
if ($this->options['access_control_allow_credentials']) {
|
276 |
+
$file->deleteWithCredentials = true;
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
// Fix for overflowing signed 32 bit integers,
|
281 |
+
// works for sizes up to 2^32-1 bytes (4 GiB - 1):
|
282 |
+
protected function fix_integer_overflow($size)
|
283 |
+
{
|
284 |
+
if ($size < 0) {
|
285 |
+
$size += 2.0 * (PHP_INT_MAX + 1);
|
286 |
+
}
|
287 |
+
return $size;
|
288 |
+
}
|
289 |
+
|
290 |
+
protected function get_file_size($file_path, $clear_stat_cache = false)
|
291 |
+
{
|
292 |
+
if ($clear_stat_cache) {
|
293 |
+
clearstatcache(true, $file_path);
|
294 |
+
}
|
295 |
+
return $this->fix_integer_overflow(filesize($file_path));
|
296 |
+
|
297 |
+
}
|
298 |
+
|
299 |
+
protected function is_valid_file_object($file_name)
|
300 |
+
{
|
301 |
+
$file_path = $this->get_upload_path($file_name);
|
302 |
+
if (is_file($file_path) && $file_name[0] !== '.') {
|
303 |
+
return true;
|
304 |
+
}
|
305 |
+
return false;
|
306 |
+
}
|
307 |
+
|
308 |
+
protected function get_file_object($file_name)
|
309 |
+
{
|
310 |
+
if ($this->is_valid_file_object($file_name)) {
|
311 |
+
$file = new stdClass();
|
312 |
+
$file->name = $file_name;
|
313 |
+
$file->size = $this->get_file_size(
|
314 |
+
$this->get_upload_path($file_name)
|
315 |
+
);
|
316 |
+
$file->url = $this->get_download_url($file->name);
|
317 |
+
foreach ($this->options['image_versions'] as $version => $options) {
|
318 |
+
if (!empty($version)) {
|
319 |
+
if (is_file($this->get_upload_path($file_name, $version))) {
|
320 |
+
$file->{$version . 'Url'} = $this->get_download_url(
|
321 |
+
$file->name,
|
322 |
+
$version
|
323 |
+
);
|
324 |
+
}
|
325 |
+
}
|
326 |
+
}
|
327 |
+
$this->set_additional_file_properties($file);
|
328 |
+
return $file;
|
329 |
+
}
|
330 |
+
return null;
|
331 |
+
}
|
332 |
+
|
333 |
+
protected function get_file_objects($iteration_method = 'get_file_object')
|
334 |
+
{
|
335 |
+
$upload_dir = $this->get_upload_path();
|
336 |
+
if (!is_dir($upload_dir)) {
|
337 |
+
return array();
|
338 |
+
}
|
339 |
+
return array_values(array_filter(array_map(
|
340 |
+
array($this, $iteration_method),
|
341 |
+
scandir($upload_dir)
|
342 |
+
)));
|
343 |
+
}
|
344 |
+
|
345 |
+
protected function count_file_objects()
|
346 |
+
{
|
347 |
+
return count($this->get_file_objects('is_valid_file_object'));
|
348 |
+
}
|
349 |
+
|
350 |
+
protected function get_error_message($error)
|
351 |
+
{
|
352 |
+
return array_key_exists($error, $this->error_messages) ?
|
353 |
+
$this->error_messages[$error] : $error;
|
354 |
+
}
|
355 |
+
|
356 |
+
function get_config_bytes($val)
|
357 |
+
{
|
358 |
+
$val = trim($val);
|
359 |
+
$last = strtolower($val[strlen($val) - 1]);
|
360 |
+
switch ($last) {
|
361 |
+
case 'g':
|
362 |
+
$val *= 1024;
|
363 |
+
case 'm':
|
364 |
+
$val *= 1024;
|
365 |
+
case 'k':
|
366 |
+
$val *= 1024;
|
367 |
+
}
|
368 |
+
return $this->fix_integer_overflow($val);
|
369 |
+
}
|
370 |
+
|
371 |
+
protected function validate($uploaded_file, $file, $error, $index)
|
372 |
+
{
|
373 |
+
if ($error) {
|
374 |
+
$file->error = $this->get_error_message($error);
|
375 |
+
return false;
|
376 |
+
}
|
377 |
+
$content_length = $this->fix_integer_overflow(intval(
|
378 |
+
$this->get_server_var('CONTENT_LENGTH')
|
379 |
+
));
|
380 |
+
$post_max_size = $this->get_config_bytes(ini_get('post_max_size'));
|
381 |
+
if ($post_max_size && ($content_length > $post_max_size)) {
|
382 |
+
$file->error = $this->get_error_message('post_max_size');
|
383 |
+
return false;
|
384 |
+
}
|
385 |
+
if (!preg_match($this->options['accept_file_types'], $file->name)) {
|
386 |
+
$file->error = $this->get_error_message('accept_file_types');
|
387 |
+
return false;
|
388 |
+
}
|
389 |
+
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
|
390 |
+
$file_size = $this->get_file_size($uploaded_file);
|
391 |
+
} else {
|
392 |
+
$file_size = $content_length;
|
393 |
+
}
|
394 |
+
if ($this->options['max_file_size'] && (
|
395 |
+
$file_size > $this->options['max_file_size'] ||
|
396 |
+
$file->size > $this->options['max_file_size'])
|
397 |
+
) {
|
398 |
+
$file->error = $this->get_error_message('max_file_size');
|
399 |
+
return false;
|
400 |
+
}
|
401 |
+
if ($this->options['min_file_size'] &&
|
402 |
+
$file_size < $this->options['min_file_size']
|
403 |
+
) {
|
404 |
+
$file->error = $this->get_error_message('min_file_size');
|
405 |
+
return false;
|
406 |
+
}
|
407 |
+
if (is_int($this->options['max_number_of_files']) && (
|
408 |
+
$this->count_file_objects() >= $this->options['max_number_of_files'])
|
409 |
+
) {
|
410 |
+
$file->error = $this->get_error_message('max_number_of_files');
|
411 |
+
return false;
|
412 |
+
}
|
413 |
+
$max_width = @$this->options['max_width'];
|
414 |
+
$max_height = @$this->options['max_height'];
|
415 |
+
$min_width = @$this->options['min_width'];
|
416 |
+
$min_height = @$this->options['min_height'];
|
417 |
+
if (($max_width || $max_height || $min_width || $min_height)) {
|
418 |
+
list($img_width, $img_height) = $this->get_image_size($uploaded_file);
|
419 |
+
}
|
420 |
+
if (!empty($img_width)) {
|
421 |
+
if ($max_width && $img_width > $max_width) {
|
422 |
+
$file->error = $this->get_error_message('max_width');
|
423 |
+
return false;
|
424 |
+
}
|
425 |
+
if ($max_height && $img_height > $max_height) {
|
426 |
+
$file->error = $this->get_error_message('max_height');
|
427 |
+
return false;
|
428 |
+
}
|
429 |
+
if ($min_width && $img_width < $min_width) {
|
430 |
+
$file->error = $this->get_error_message('min_width');
|
431 |
+
return false;
|
432 |
+
}
|
433 |
+
if ($min_height && $img_height < $min_height) {
|
434 |
+
$file->error = $this->get_error_message('min_height');
|
435 |
+
return false;
|
436 |
+
}
|
437 |
+
}
|
438 |
+
return true;
|
439 |
+
}
|
440 |
+
|
441 |
+
protected function upcount_name_callback($matches)
|
442 |
+
{
|
443 |
+
$index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;
|
444 |
+
$ext = isset($matches[2]) ? $matches[2] : '';
|
445 |
+
|
446 |
+
return '-' . $index . $ext; // Code modified by Fredrick Marks
|
447 |
+
}
|
448 |
+
|
449 |
+
protected function upcount_name($name)
|
450 |
+
{ // Code modified by Fredrick Marks
|
451 |
+
return preg_replace_callback(
|
452 |
+
'/(?:(?:\-([\d]+))?(\.[^.]+))?$/',
|
453 |
+
array($this, 'upcount_name_callback'),
|
454 |
+
$name,
|
455 |
+
1
|
456 |
+
);
|
457 |
+
}
|
458 |
+
|
459 |
+
protected function get_unique_filename($name,
|
460 |
+
$type = null, $index = null, $content_range = null)
|
461 |
+
{
|
462 |
+
while (is_dir($this->get_upload_path($name))) {
|
463 |
+
$name = $this->upcount_name($name);
|
464 |
+
}
|
465 |
+
// Keep an existing filename if this is part of a chunked upload:
|
466 |
+
$uploaded_bytes = $this->fix_integer_overflow(intval($content_range[1]));
|
467 |
+
while (is_file($this->get_upload_path($name))) {
|
468 |
+
if ($uploaded_bytes === $this->get_file_size(
|
469 |
+
$this->get_upload_path($name))
|
470 |
+
) {
|
471 |
+
|
472 |
+
break;
|
473 |
+
} else {
|
474 |
+
|
475 |
+
}
|
476 |
+
$name = $this->upcount_name($name);
|
477 |
+
}
|
478 |
+
return $name;
|
479 |
+
}
|
480 |
+
|
481 |
+
protected function trim_file_name($name,
|
482 |
+
$type = null, $index = null, $content_range = null)
|
483 |
+
{
|
484 |
+
// Remove path information and dots around the filename, to prevent uploading
|
485 |
+
// into different directories or replacing hidden system files.
|
486 |
+
// Also remove control characters and spaces (\x00..\x20) around the filename:
|
487 |
+
$name = trim(basename(stripslashes($name)), ".\x00..\x20");
|
488 |
+
// Use a timestamp for empty filenames:
|
489 |
+
if (!$name) {
|
490 |
+
$name = str_replace('.', '-', microtime(true));
|
491 |
+
}
|
492 |
+
// Add missing file extension for known image types:
|
493 |
+
if (strpos($name, '.') === false &&
|
494 |
+
preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)
|
495 |
+
) {
|
496 |
+
$name .= '.' . $matches[1];
|
497 |
+
}
|
498 |
+
//return $name;
|
499 |
+
|
500 |
+
//Edited original file starts
|
501 |
+
|
502 |
+
//Add version as (1), if the file import first time
|
503 |
+
$version_zero = array();
|
504 |
+
$rem_csv = array();
|
505 |
+
|
506 |
+
$temp_name = str_replace("(", "[", $name);
|
507 |
+
$name = str_replace(")", "]", $temp_name);
|
508 |
+
|
509 |
+
$rem_csv = explode(".csv", $name);
|
510 |
+
$version_zero = explode("(", $rem_csv[0]);
|
511 |
+
/* if(!is_array($version_zero)){
|
512 |
+
return $version_zero[0];
|
513 |
+
}else{
|
514 |
+
return 'HERE';
|
515 |
+
}*/
|
516 |
+
$file_name_arr = array();
|
517 |
+
$file_name_arr = explode('.csv', $name);
|
518 |
+
$current_action = $_REQUEST['curr_action'];
|
519 |
+
if (!is_array($version_zero))
|
520 |
+
return $file_name_arr[0] . '-' . $current_action . ' .csv'; // Code modified by Fredrick Marks
|
521 |
+
else
|
522 |
+
return $file_name_arr[0] . '-' . $current_action . '-1.csv'; // Code modified by Fredrick Marks
|
523 |
+
//Edited original file ends
|
524 |
+
}
|
525 |
+
|
526 |
+
protected function get_file_name($name,
|
527 |
+
$type = null, $index = null, $content_range = null)
|
528 |
+
{
|
529 |
+
return $this->get_unique_filename(
|
530 |
+
$this->trim_file_name($name, $type, $index, $content_range),
|
531 |
+
$type,
|
532 |
+
$index,
|
533 |
+
$content_range
|
534 |
+
);
|
535 |
+
}
|
536 |
+
|
537 |
+
protected function handle_form_data($file, $index)
|
538 |
+
{
|
539 |
+
// Handle form data, e.g. $_REQUEST['description'][$index]
|
540 |
+
}
|
541 |
+
|
542 |
+
protected function get_scaled_image_file_paths($file_name, $version)
|
543 |
+
{
|
544 |
+
$file_path = $this->get_upload_path($file_name);
|
545 |
+
if (!empty($version)) {
|
546 |
+
$version_dir = $this->get_upload_path(null, $version);
|
547 |
+
if (!is_dir($version_dir)) {
|
548 |
+
mkdir($version_dir, $this->options['mkdir_mode'], true);
|
549 |
+
}
|
550 |
+
$new_file_path = $version_dir . '/' . $file_name;
|
551 |
+
} else {
|
552 |
+
$new_file_path = $file_path;
|
553 |
+
}
|
554 |
+
return array($file_path, $new_file_path);
|
555 |
+
}
|
556 |
+
|
557 |
+
protected function gd_get_image_object($file_path, $func, $no_cache = false)
|
558 |
+
{
|
559 |
+
if (empty($this->image_objects[$file_path]) || $no_cache) {
|
560 |
+
$this->gd_destroy_image_object($file_path);
|
561 |
+
$this->image_objects[$file_path] = $func($file_path);
|
562 |
+
}
|
563 |
+
return $this->image_objects[$file_path];
|
564 |
+
}
|
565 |
+
|
566 |
+
protected function gd_set_image_object($file_path, $image)
|
567 |
+
{
|
568 |
+
$this->gd_destroy_image_object($file_path);
|
569 |
+
$this->image_objects[$file_path] = $image;
|
570 |
+
}
|
571 |
+
|
572 |
+
protected function gd_destroy_image_object($file_path)
|
573 |
+
{
|
574 |
+
$image = @$this->image_objects[$file_path];
|
575 |
+
return $image && imagedestroy($image);
|
576 |
+
}
|
577 |
+
|
578 |
+
protected function gd_imageflip($image, $mode)
|
579 |
+
{
|
580 |
+
if (function_exists('imageflip')) {
|
581 |
+
return imageflip($image, $mode);
|
582 |
+
}
|
583 |
+
$new_width = $src_width = imagesx($image);
|
584 |
+
$new_height = $src_height = imagesy($image);
|
585 |
+
$new_img = imagecreatetruecolor($new_width, $new_height);
|
586 |
+
$src_x = 0;
|
587 |
+
$src_y = 0;
|
588 |
+
switch ($mode) {
|
589 |
+
case '1': // flip on the horizontal axis
|
590 |
+
$src_y = $new_height - 1;
|
591 |
+
$src_height = -$new_height;
|
592 |
+
break;
|
593 |
+
case '2': // flip on the vertical axis
|
594 |
+
$src_x = $new_width - 1;
|
595 |
+
$src_width = -$new_width;
|
596 |
+
break;
|
597 |
+
case '3': // flip on both axes
|
598 |
+
$src_y = $new_height - 1;
|
599 |
+
$src_height = -$new_height;
|
600 |
+
$src_x = $new_width - 1;
|
601 |
+
$src_width = -$new_width;
|
602 |
+
break;
|
603 |
+
default:
|
604 |
+
return $image;
|
605 |
+
}
|
606 |
+
imagecopyresampled(
|
607 |
+
$new_img,
|
608 |
+
$image,
|
609 |
+
0,
|
610 |
+
0,
|
611 |
+
$src_x,
|
612 |
+
$src_y,
|
613 |
+
$new_width,
|
614 |
+
$new_height,
|
615 |
+
$src_width,
|
616 |
+
$src_height
|
617 |
+
);
|
618 |
+
return $new_img;
|
619 |
+
}
|
620 |
+
|
621 |
+
protected function gd_orient_image($file_path, $src_img)
|
622 |
+
{
|
623 |
+
if (!function_exists('exif_read_data')) {
|
624 |
+
return false;
|
625 |
+
}
|
626 |
+
$exif = @exif_read_data($file_path);
|
627 |
+
if ($exif === false) {
|
628 |
+
return false;
|
629 |
+
}
|
630 |
+
$orientation = intval(@$exif['Orientation']);
|
631 |
+
if ($orientation < 2 || $orientation > 8) {
|
632 |
+
return false;
|
633 |
+
}
|
634 |
+
switch ($orientation) {
|
635 |
+
case 2:
|
636 |
+
$new_img = $this->gd_imageflip(
|
637 |
+
$src_img,
|
638 |
+
defined('IMG_FLIP_VERTICAL') ? IMG_FLIP_VERTICAL : 2
|
639 |
+
);
|
640 |
+
break;
|
641 |
+
case 3:
|
642 |
+
$new_img = imagerotate($src_img, 180, 0);
|
643 |
+
break;
|
644 |
+
case 4:
|
645 |
+
$new_img = $this->gd_imageflip(
|
646 |
+
$src_img,
|
647 |
+
defined('IMG_FLIP_HORIZONTAL') ? IMG_FLIP_HORIZONTAL : 1
|
648 |
+
);
|
649 |
+
break;
|
650 |
+
case 5:
|
651 |
+
$tmp_img = $this->gd_imageflip(
|
652 |
+
$src_img,
|
653 |
+
defined('IMG_FLIP_HORIZONTAL') ? IMG_FLIP_HORIZONTAL : 1
|
654 |
+
);
|
655 |
+
$new_img = imagerotate($tmp_img, 270, 0);
|
656 |
+
imagedestroy($tmp_img);
|
657 |
+
break;
|
658 |
+
case 6:
|
659 |
+
$new_img = imagerotate($src_img, 270, 0);
|
660 |
+
break;
|
661 |
+
case 7:
|
662 |
+
$tmp_img = $this->gd_imageflip(
|
663 |
+
$src_img,
|
664 |
+
defined('IMG_FLIP_VERTICAL') ? IMG_FLIP_VERTICAL : 2
|
665 |
+
);
|
666 |
+
$new_img = imagerotate($tmp_img, 270, 0);
|
667 |
+
imagedestroy($tmp_img);
|
668 |
+
break;
|
669 |
+
case 8:
|
670 |
+
$new_img = imagerotate($src_img, 90, 0);
|
671 |
+
break;
|
672 |
+
default:
|
673 |
+
return false;
|
674 |
+
}
|
675 |
+
$this->gd_set_image_object($file_path, $new_img);
|
676 |
+
return true;
|
677 |
+
}
|
678 |
+
|
679 |
+
protected function gd_create_scaled_image($file_name, $version, $options)
|
680 |
+
{
|
681 |
+
if (!function_exists('imagecreatetruecolor')) {
|
682 |
+
error_log('Function not found: imagecreatetruecolor');
|
683 |
+
return false;
|
684 |
+
}
|
685 |
+
list($file_path, $new_file_path) =
|
686 |
+
$this->get_scaled_image_file_paths($file_name, $version);
|
687 |
+
$type = strtolower(substr(strrchr($file_name, '.'), 1));
|
688 |
+
switch ($type) {
|
689 |
+
case 'jpg':
|
690 |
+
case 'jpeg':
|
691 |
+
$src_func = 'imagecreatefromjpeg';
|
692 |
+
$write_func = 'imagejpeg';
|
693 |
+
$image_quality = isset($options['jpeg_quality']) ?
|
694 |
+
$options['jpeg_quality'] : 75;
|
695 |
+
break;
|
696 |
+
case 'gif':
|
697 |
+
$src_func = 'imagecreatefromgif';
|
698 |
+
$write_func = 'imagegif';
|
699 |
+
$image_quality = null;
|
700 |
+
break;
|
701 |
+
case 'png':
|
702 |
+
$src_func = 'imagecreatefrompng';
|
703 |
+
$write_func = 'imagepng';
|
704 |
+
$image_quality = isset($options['png_quality']) ?
|
705 |
+
$options['png_quality'] : 9;
|
706 |
+
break;
|
707 |
+
default:
|
708 |
+
return false;
|
709 |
+
}
|
710 |
+
$src_img = $this->gd_get_image_object(
|
711 |
+
$file_path,
|
712 |
+
$src_func,
|
713 |
+
!empty($options['no_cache'])
|
714 |
+
);
|
715 |
+
$image_oriented = false;
|
716 |
+
if (!empty($options['auto_orient']) && $this->gd_orient_image(
|
717 |
+
$file_path,
|
718 |
+
$src_img
|
719 |
+
)
|
720 |
+
) {
|
721 |
+
$image_oriented = true;
|
722 |
+
$src_img = $this->gd_get_image_object(
|
723 |
+
$file_path,
|
724 |
+
$src_func
|
725 |
+
);
|
726 |
+
}
|
727 |
+
$max_width = $img_width = imagesx($src_img);
|
728 |
+
$max_height = $img_height = imagesy($src_img);
|
729 |
+
if (!empty($options['max_width'])) {
|
730 |
+
$max_width = $options['max_width'];
|
731 |
+
}
|
732 |
+
if (!empty($options['max_height'])) {
|
733 |
+
$max_height = $options['max_height'];
|
734 |
+
}
|
735 |
+
$scale = min(
|
736 |
+
$max_width / $img_width,
|
737 |
+
$max_height / $img_height
|
738 |
+
);
|
739 |
+
if ($scale >= 1) {
|
740 |
+
if ($image_oriented) {
|
741 |
+
return $write_func($src_img, $new_file_path, $image_quality);
|
742 |
+
}
|
743 |
+
if ($file_path !== $new_file_path) {
|
744 |
+
return copy($file_path, $new_file_path);
|
745 |
+
}
|
746 |
+
return true;
|
747 |
+
}
|
748 |
+
if (empty($options['crop'])) {
|
749 |
+
$new_width = $img_width * $scale;
|
750 |
+
$new_height = $img_height * $scale;
|
751 |
+
$dst_x = 0;
|
752 |
+
$dst_y = 0;
|
753 |
+
$new_img = imagecreatetruecolor($new_width, $new_height);
|
754 |
+
} else {
|
755 |
+
if (($img_width / $img_height) >= ($max_width / $max_height)) {
|
756 |
+
$new_width = $img_width / ($img_height / $max_height);
|
757 |
+
$new_height = $max_height;
|
758 |
+
} else {
|
759 |
+
$new_width = $max_width;
|
760 |
+
$new_height = $img_height / ($img_width / $max_width);
|
761 |
+
}
|
762 |
+
$dst_x = 0 - ($new_width - $max_width) / 2;
|
763 |
+
$dst_y = 0 - ($new_height - $max_height) / 2;
|
764 |
+
$new_img = imagecreatetruecolor($max_width, $max_height);
|
765 |
+
}
|
766 |
+
// Handle transparency in GIF and PNG images:
|
767 |
+
switch ($type) {
|
768 |
+
case 'gif':
|
769 |
+
case 'png':
|
770 |
+
imagecolortransparent($new_img, imagecolorallocate($new_img, 0, 0, 0));
|
771 |
+
case 'png':
|
772 |
+
imagealphablending($new_img, false);
|
773 |
+
imagesavealpha($new_img, true);
|
774 |
+
break;
|
775 |
+
}
|
776 |
+
$success = imagecopyresampled(
|
777 |
+
$new_img,
|
778 |
+
$src_img,
|
779 |
+
$dst_x,
|
780 |
+
$dst_y,
|
781 |
+
0,
|
782 |
+
0,
|
783 |
+
$new_width,
|
784 |
+
$new_height,
|
785 |
+
$img_width,
|
786 |
+
$img_height
|
787 |
+
) && $write_func($new_img, $new_file_path, $image_quality);
|
788 |
+
$this->gd_set_image_object($file_path, $new_img);
|
789 |
+
return $success;
|
790 |
+
}
|
791 |
+
|
792 |
+
protected function imagick_get_image_object($file_path, $no_cache = false)
|
793 |
+
{
|
794 |
+
if (empty($this->image_objects[$file_path]) || $no_cache) {
|
795 |
+
$this->imagick_destroy_image_object($file_path);
|
796 |
+
$image = new Imagick();
|
797 |
+
if (!empty($this->options['imagick_resource_limits'])) {
|
798 |
+
foreach ($this->options['imagick_resource_limits'] as $type => $limit) {
|
799 |
+
$image->setResourceLimit($type, $limit);
|
800 |
+
}
|
801 |
+
}
|
802 |
+
$image->readImage($file_path);
|
803 |
+
$this->image_objects[$file_path] = $image;
|
804 |
+
}
|
805 |
+
return $this->image_objects[$file_path];
|
806 |
+
}
|
807 |
+
|
808 |
+
protected function imagick_set_image_object($file_path, $image)
|
809 |
+
{
|
810 |
+
$this->imagick_destroy_image_object($file_path);
|
811 |
+
$this->image_objects[$file_path] = $image;
|
812 |
+
}
|
813 |
+
|
814 |
+
protected function imagick_destroy_image_object($file_path)
|
815 |
+
{
|
816 |
+
$image = @$this->image_objects[$file_path];
|
817 |
+
return $image && $image->destroy();
|
818 |
+
}
|
819 |
+
|
820 |
+
protected function imagick_orient_image($image)
|
821 |
+
{
|
822 |
+
$orientation = $image->getImageOrientation();
|
823 |
+
$background = new ImagickPixel('none');
|
824 |
+
switch ($orientation) {
|
825 |
+
case imagick::ORIENTATION_TOPRIGHT: // 2
|
826 |
+
$image->flopImage(); // horizontal flop around y-axis
|
827 |
+
break;
|
828 |
+
case imagick::ORIENTATION_BOTTOMRIGHT: // 3
|
829 |
+
$image->rotateImage($background, 180);
|
830 |
+
break;
|
831 |
+
case imagick::ORIENTATION_BOTTOMLEFT: // 4
|
832 |
+
$image->flipImage(); // vertical flip around x-axis
|
833 |
+
break;
|
834 |
+
case imagick::ORIENTATION_LEFTTOP: // 5
|
835 |
+
$image->flopImage(); // horizontal flop around y-axis
|
836 |
+
$image->rotateImage($background, 270);
|
837 |
+
break;
|
838 |
+
case imagick::ORIENTATION_RIGHTTOP: // 6
|
839 |
+
$image->rotateImage($background, 90);
|
840 |
+
break;
|
841 |
+
case imagick::ORIENTATION_RIGHTBOTTOM: // 7
|
842 |
+
$image->flipImage(); // vertical flip around x-axis
|
843 |
+
$image->rotateImage($background, 270);
|
844 |
+
break;
|
845 |
+
case imagick::ORIENTATION_LEFTBOTTOM: // 8
|
846 |
+
$image->rotateImage($background, 270);
|
847 |
+
break;
|
848 |
+
default:
|
849 |
+
return false;
|
850 |
+
}
|
851 |
+
$image->setImageOrientation(imagick::ORIENTATION_TOPLEFT); // 1
|
852 |
+
return true;
|
853 |
+
}
|
854 |
+
|
855 |
+
protected function imagick_create_scaled_image($file_name, $version, $options)
|
856 |
+
{
|
857 |
+
list($file_path, $new_file_path) =
|
858 |
+
$this->get_scaled_image_file_paths($file_name, $version);
|
859 |
+
$image = $this->imagick_get_image_object(
|
860 |
+
$file_path,
|
861 |
+
!empty($options['no_cache'])
|
862 |
+
);
|
863 |
+
if ($image->getImageFormat() === 'GIF') {
|
864 |
+
// Handle animated GIFs:
|
865 |
+
$images = $image->coalesceImages();
|
866 |
+
foreach ($images as $frame) {
|
867 |
+
$image = $frame;
|
868 |
+
$this->imagick_set_image_object($file_name, $image);
|
869 |
+
break;
|
870 |
+
}
|
871 |
+
}
|
872 |
+
$image_oriented = false;
|
873 |
+
if (!empty($options['auto_orient'])) {
|
874 |
+
$image_oriented = $this->imagick_orient_image($image);
|
875 |
+
}
|
876 |
+
$new_width = $max_width = $img_width = $image->getImageWidth();
|
877 |
+
$new_height = $max_height = $img_height = $image->getImageHeight();
|
878 |
+
if (!empty($options['max_width'])) {
|
879 |
+
$new_width = $max_width = $options['max_width'];
|
880 |
+
}
|
881 |
+
if (!empty($options['max_height'])) {
|
882 |
+
$new_height = $max_height = $options['max_height'];
|
883 |
+
}
|
884 |
+
if (!($image_oriented || $max_width < $img_width || $max_height < $img_height)) {
|
885 |
+
if ($file_path !== $new_file_path) {
|
886 |
+
return copy($file_path, $new_file_path);
|
887 |
+
}
|
888 |
+
return true;
|
889 |
+
}
|
890 |
+
$crop = !empty($options['crop']);
|
891 |
+
if ($crop) {
|
892 |
+
$x = 0;
|
893 |
+
$y = 0;
|
894 |
+
if (($img_width / $img_height) >= ($max_width / $max_height)) {
|
895 |
+
$new_width = 0; // Enables proportional scaling based on max_height
|
896 |
+
$x = ($img_width / ($img_height / $max_height) - $max_width) / 2;
|
897 |
+
} else {
|
898 |
+
$new_height = 0; // Enables proportional scaling based on max_width
|
899 |
+
$y = ($img_height / ($img_width / $max_width) - $max_height) / 2;
|
900 |
+
}
|
901 |
+
}
|
902 |
+
$success = $image->resizeImage(
|
903 |
+
$new_width,
|
904 |
+
$new_height,
|
905 |
+
isset($options['filter']) ? $options['filter'] : imagick::FILTER_LANCZOS,
|
906 |
+
isset($options['blur']) ? $options['blur'] : 1,
|
907 |
+
$new_width && $new_height // fit image into constraints if not to be cropped
|
908 |
+
);
|
909 |
+
if ($success && $crop) {
|
910 |
+
$success = $image->cropImage(
|
911 |
+
$max_width,
|
912 |
+
$max_height,
|
913 |
+
$x,
|
914 |
+
$y
|
915 |
+
);
|
916 |
+
if ($success) {
|
917 |
+
$success = $image->setImagePage($max_width, $max_height, 0, 0);
|
918 |
+
}
|
919 |
+
}
|
920 |
+
$type = strtolower(substr(strrchr($file_name, '.'), 1));
|
921 |
+
switch ($type) {
|
922 |
+
case 'jpg':
|
923 |
+
case 'jpeg':
|
924 |
+
if (!empty($options['jpeg_quality'])) {
|
925 |
+
$image->setImageCompression(Imagick::COMPRESSION_JPEG);
|
926 |
+
$image->setImageCompressionQuality($options['jpeg_quality']);
|
927 |
+
}
|
928 |
+
break;
|
929 |
+
}
|
930 |
+
if (!empty($options['strip'])) {
|
931 |
+
$image->stripImage();
|
932 |
+
}
|
933 |
+
return $success && $image->writeImage($new_file_path);
|
934 |
+
}
|
935 |
+
|
936 |
+
protected function imagemagick_create_scaled_image($file_name, $version, $options)
|
937 |
+
{
|
938 |
+
list($file_path, $new_file_path) =
|
939 |
+
$this->get_scaled_image_file_paths($file_name, $version);
|
940 |
+
$resize = @$options['max_width']
|
941 |
+
. (empty($options['max_height']) ? '' : 'x' . $options['max_height']);
|
942 |
+
if (!$resize && empty($options['auto_orient'])) {
|
943 |
+
if ($file_path !== $new_file_path) {
|
944 |
+
return copy($file_path, $new_file_path);
|
945 |
+
}
|
946 |
+
return true;
|
947 |
+
}
|
948 |
+
$cmd = $this->options['convert_bin'];
|
949 |
+
if (!empty($this->options['convert_params'])) {
|
950 |
+
$cmd .= ' ' . $this->options['convert_params'];
|
951 |
+
}
|
952 |
+
$cmd .= ' ' . escapeshellarg($file_path);
|
953 |
+
if (!empty($options['auto_orient'])) {
|
954 |
+
$cmd .= ' -auto-orient';
|
955 |
+
}
|
956 |
+
if ($resize) {
|
957 |
+
// Handle animated GIFs:
|
958 |
+
$cmd .= ' -coalesce';
|
959 |
+
if (empty($options['crop'])) {
|
960 |
+
$cmd .= ' -resize ' . escapeshellarg($resize . '>');
|
961 |
+
} else {
|
962 |
+
$cmd .= ' -resize ' . escapeshellarg($resize . '^');
|
963 |
+
$cmd .= ' -gravity center';
|
964 |
+
$cmd .= ' -crop ' . escapeshellarg($resize . '+0+0');
|
965 |
+
}
|
966 |
+
// Make sure the page dimensions are correct (fixes offsets of animated GIFs):
|
967 |
+
$cmd .= ' +repage';
|
968 |
+
}
|
969 |
+
if (!empty($options['convert_params'])) {
|
970 |
+
$cmd .= ' ' . $options['convert_params'];
|
971 |
+
}
|
972 |
+
$cmd .= ' ' . escapeshellarg($new_file_path);
|
973 |
+
exec($cmd, $output, $error);
|
974 |
+
if ($error) {
|
975 |
+
error_log(implode('\n', $output));
|
976 |
+
return false;
|
977 |
+
}
|
978 |
+
return true;
|
979 |
+
}
|
980 |
+
|
981 |
+
protected function get_image_size($file_path)
|
982 |
+
{
|
983 |
+
if ($this->options['image_library']) {
|
984 |
+
if (extension_loaded('imagick')) {
|
985 |
+
$image = new Imagick();
|
986 |
+
try {
|
987 |
+
if (@$image->pingImage($file_path)) {
|
988 |
+
$dimensions = array($image->getImageWidth(), $image->getImageHeight());
|
989 |
+
$image->destroy();
|
990 |
+
return $dimensions;
|
991 |
+
}
|
992 |
+
return false;
|
993 |
+
} catch (Exception $e) {
|
994 |
+
error_log($e->getMessage());
|
995 |
+
}
|
996 |
+
}
|
997 |
+
if ($this->options['image_library'] === 2) {
|
998 |
+
$cmd = $this->options['identify_bin'];
|
999 |
+
$cmd .= ' -ping ' . escapeshellarg($file_path);
|
1000 |
+
exec($cmd, $output, $error);
|
1001 |
+
if (!$error && !empty($output)) {
|
1002 |
+
// image.jpg JPEG 1920x1080 1920x1080+0+0 8-bit sRGB 465KB 0.000u 0:00.000
|
1003 |
+
$infos = preg_split('/\s+/', $output[0]);
|
1004 |
+
$dimensions = preg_split('/x/', $infos[2]);
|
1005 |
+
return $dimensions;
|
1006 |
+
}
|
1007 |
+
return false;
|
1008 |
+
}
|
1009 |
+
}
|
1010 |
+
if (!function_exists('getimagesize')) {
|
1011 |
+
error_log('Function not found: getimagesize');
|
1012 |
+
return false;
|
1013 |
+
}
|
1014 |
+
return @getimagesize($file_path);
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
protected function create_scaled_image($file_name, $version, $options)
|
1018 |
+
{
|
1019 |
+
if ($this->options['image_library'] === 2) {
|
1020 |
+
return $this->imagemagick_create_scaled_image($file_name, $version, $options);
|
1021 |
+
}
|
1022 |
+
if ($this->options['image_library'] && extension_loaded('imagick')) {
|
1023 |
+
return $this->imagick_create_scaled_image($file_name, $version, $options);
|
1024 |
+
}
|
1025 |
+
return $this->gd_create_scaled_image($file_name, $version, $options);
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
protected function destroy_image_object($file_path)
|
1029 |
+
{
|
1030 |
+
if ($this->options['image_library'] && extension_loaded('imagick')) {
|
1031 |
+
return $this->imagick_destroy_image_object($file_path);
|
1032 |
+
}
|
1033 |
+
}
|
1034 |
+
|
1035 |
+
protected function is_valid_image_file($file_path)
|
1036 |
+
{
|
1037 |
+
if (!preg_match($this->options['image_file_types'], $file_path)) {
|
1038 |
+
return false;
|
1039 |
+
}
|
1040 |
+
if (function_exists('exif_imagetype')) {
|
1041 |
+
return @exif_imagetype($file_path);
|
1042 |
+
}
|
1043 |
+
$image_info = $this->get_image_size($file_path);
|
1044 |
+
return $image_info && $image_info[0] && $image_info[1];
|
1045 |
+
}
|
1046 |
+
|
1047 |
+
protected function handle_image_file($file_path, $file)
|
1048 |
+
{
|
1049 |
+
$failed_versions = array();
|
1050 |
+
foreach ($this->options['image_versions'] as $version => $options) {
|
1051 |
+
if ($this->create_scaled_image($file->name, $version, $options)) {
|
1052 |
+
if (!empty($version)) {
|
1053 |
+
$file->{$version . 'Url'} = $this->get_download_url(
|
1054 |
+
$file->name,
|
1055 |
+
$version
|
1056 |
+
);
|
1057 |
+
} else {
|
1058 |
+
$file->size = $this->get_file_size($file_path, true);
|
1059 |
+
}
|
1060 |
+
} else {
|
1061 |
+
$failed_versions[] = $version;
|
1062 |
+
}
|
1063 |
+
}
|
1064 |
+
switch (count($failed_versions)) {
|
1065 |
+
case 0:
|
1066 |
+
break;
|
1067 |
+
case 1:
|
1068 |
+
$file->error = 'Failed to create scaled version: '
|
1069 |
+
. $failed_versions[0];
|
1070 |
+
break;
|
1071 |
+
default:
|
1072 |
+
$file->error = 'Failed to create scaled versions: '
|
1073 |
+
. implode($failed_versions, ', ');
|
1074 |
+
}
|
1075 |
+
// Free memory:
|
1076 |
+
$this->destroy_image_object($file_path);
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,
|
1080 |
+
$index = null, $content_range = null)
|
1081 |
+
{
|
1082 |
+
$file = new stdClass();
|
1083 |
+
$file->name = $this->get_file_name($name, $type, $index, $content_range);
|
1084 |
+
$file->size = $this->fix_integer_overflow(intval($size));
|
1085 |
+
$file->type = $type;
|
1086 |
+
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
1087 |
+
$this->handle_form_data($file, $index);
|
1088 |
+
$upload_dir = $this->get_upload_path();
|
1089 |
+
if (!is_dir($upload_dir)) {
|
1090 |
+
mkdir($upload_dir, $this->options['mkdir_mode'], true);
|
1091 |
+
}
|
1092 |
+
$file_path = $this->get_upload_path($file->name);
|
1093 |
+
$append_file = $content_range && is_file($file_path) &&
|
1094 |
+
$file->size > $this->get_file_size($file_path);
|
1095 |
+
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
|
1096 |
+
// multipart/formdata uploads (POST method uploads)
|
1097 |
+
if ($append_file) {
|
1098 |
+
file_put_contents(
|
1099 |
+
$file_path,
|
1100 |
+
fopen($uploaded_file, 'r'),
|
1101 |
+
FILE_APPEND
|
1102 |
+
);
|
1103 |
+
} else {
|
1104 |
+
move_uploaded_file($uploaded_file, $file_path);
|
1105 |
+
}
|
1106 |
+
} else {
|
1107 |
+
// Non-multipart uploads (PUT method support)
|
1108 |
+
file_put_contents(
|
1109 |
+
$file_path,
|
1110 |
+
fopen('php://input', 'r'),
|
1111 |
+
$append_file ? FILE_APPEND : 0
|
1112 |
+
);
|
1113 |
+
}
|
1114 |
+
$file_size = $this->get_file_size($file_path, $append_file);
|
1115 |
+
if ($file_size === $file->size) {
|
1116 |
+
$file->url = $this->get_download_url($file->name);
|
1117 |
+
if ($this->is_valid_image_file($file_path)) {
|
1118 |
+
$this->handle_image_file($file_path, $file);
|
1119 |
+
}
|
1120 |
+
} else {
|
1121 |
+
$file->size = $file_size;
|
1122 |
+
if (!$content_range && $this->options['discard_aborted_uploads']) {
|
1123 |
+
unlink($file_path);
|
1124 |
+
$file->error = 'abort';
|
1125 |
+
}
|
1126 |
+
}
|
1127 |
+
$this->set_additional_file_properties($file);
|
1128 |
+
}
|
1129 |
+
return $file;
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
protected function readfile($file_path)
|
1133 |
+
{
|
1134 |
+
$file_size = $this->get_file_size($file_path);
|
1135 |
+
$chunk_size = $this->options['readfile_chunk_size'];
|
1136 |
+
if ($chunk_size && $file_size > $chunk_size) {
|
1137 |
+
$handle = fopen($file_path, 'rb');
|
1138 |
+
while (!feof($handle)) {
|
1139 |
+
echo fread($handle, $chunk_size);
|
1140 |
+
ob_flush();
|
1141 |
+
flush();
|
1142 |
+
}
|
1143 |
+
fclose($handle);
|
1144 |
+
return $file_size;
|
1145 |
+
}
|
1146 |
+
return readfile($file_path);
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
protected function body($str)
|
1150 |
+
{
|
1151 |
+
echo $str;
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
protected function header($str)
|
1155 |
+
{
|
1156 |
+
header($str);
|
1157 |
+
}
|
1158 |
+
|
1159 |
+
protected function get_server_var($id)
|
1160 |
+
{
|
1161 |
+
return isset($_SERVER[$id]) ? $_SERVER[$id] : '';
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
protected function generate_response($content, $print_response = true)
|
1165 |
+
{
|
1166 |
+
if ($print_response) {
|
1167 |
+
$json = json_encode($content);
|
1168 |
+
$redirect = isset($_REQUEST['redirect']) ?
|
1169 |
+
stripslashes($_REQUEST['redirect']) : null;
|
1170 |
+
if ($redirect) {
|
1171 |
+
$this->header('Location: ' . sprintf($redirect, rawurlencode($json)));
|
1172 |
+
return;
|
1173 |
+
}
|
1174 |
+
$this->head();
|
1175 |
+
if ($this->get_server_var('HTTP_CONTENT_RANGE')) {
|
1176 |
+
$files = isset($content[$this->options['param_name']]) ?
|
1177 |
+
$content[$this->options['param_name']] : null;
|
1178 |
+
if ($files && is_array($files) && is_object($files[0]) && $files[0]->size) {
|
1179 |
+
$this->header('Range: 0-' . (
|
1180 |
+
$this->fix_integer_overflow(intval($files[0]->size)) - 1
|
1181 |
+
));
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
$this->body($json);
|
1185 |
+
}
|
1186 |
+
return $content;
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
protected function get_version_param()
|
1190 |
+
{
|
1191 |
+
return isset($_GET['version']) ? basename(stripslashes($_GET['version'])) : null;
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
protected function get_singular_param_name()
|
1195 |
+
{
|
1196 |
+
return substr($this->options['param_name'], 0, -1);
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
protected function get_file_name_param()
|
1200 |
+
{
|
1201 |
+
$name = $this->get_singular_param_name();
|
1202 |
+
return isset($_GET[$name]) ? basename(stripslashes($_GET[$name])) : null;
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
protected function get_file_names_params()
|
1206 |
+
{
|
1207 |
+
$params = isset($_GET[$this->options['param_name']]) ?
|
1208 |
+
$_GET[$this->options['param_name']] : array();
|
1209 |
+
foreach ($params as $key => $value) {
|
1210 |
+
$params[$key] = basename(stripslashes($value));
|
1211 |
+
}
|
1212 |
+
return $params;
|
1213 |
+
}
|
1214 |
+
|
1215 |
+
protected function get_file_type($file_path)
|
1216 |
+
{
|
1217 |
+
switch (strtolower(pathinfo($file_path, PATHINFO_EXTENSION))) {
|
1218 |
+
case 'jpeg':
|
1219 |
+
case 'jpg':
|
1220 |
+
return 'image/jpeg';
|
1221 |
+
case 'png':
|
1222 |
+
return 'image/png';
|
1223 |
+
case 'gif':
|
1224 |
+
return 'image/gif';
|
1225 |
+
default:
|
1226 |
+
return '';
|
1227 |
+
}
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
protected function download()
|
1231 |
+
{
|
1232 |
+
switch ($this->options['download_via_php']) {
|
1233 |
+
case 1:
|
1234 |
+
$redirect_header = null;
|
1235 |
+
break;
|
1236 |
+
case 2:
|
1237 |
+
$redirect_header = 'X-Sendfile';
|
1238 |
+
break;
|
1239 |
+
case 3:
|
1240 |
+
$redirect_header = 'X-Accel-Redirect';
|
1241 |
+
break;
|
1242 |
+
default:
|
1243 |
+
return $this->header('HTTP/1.1 403 Forbidden');
|
1244 |
+
}
|
1245 |
+
$file_name = $this->get_file_name_param();
|
1246 |
+
if (!$this->is_valid_file_object($file_name)) {
|
1247 |
+
return $this->header('HTTP/1.1 404 Not Found');
|
1248 |
+
}
|
1249 |
+
if ($redirect_header) {
|
1250 |
+
return $this->header(
|
1251 |
+
$redirect_header . ': ' . $this->get_download_url(
|
1252 |
+
$file_name,
|
1253 |
+
$this->get_version_param(),
|
1254 |
+
true
|
1255 |
+
)
|
1256 |
+
);
|
1257 |
+
}
|
1258 |
+
$file_path = $this->get_upload_path($file_name, $this->get_version_param());
|
1259 |
+
// Prevent browsers from MIME-sniffing the content-type:
|
1260 |
+
$this->header('X-Content-Type-Options: nosniff');
|
1261 |
+
if (!preg_match($this->options['inline_file_types'], $file_name)) {
|
1262 |
+
$this->header('Content-Type: application/octet-stream');
|
1263 |
+
$this->header('Content-Disposition: attachment; filename="' . $file_name . '"');
|
1264 |
+
} else {
|
1265 |
+
$this->header('Content-Type: ' . $this->get_file_type($file_path));
|
1266 |
+
$this->header('Content-Disposition: inline; filename="' . $file_name . '"');
|
1267 |
+
}
|
1268 |
+
$this->header('Content-Length: ' . $this->get_file_size($file_path));
|
1269 |
+
$this->header('Last-Modified: ' . gmdate('D, d M Y H:i:s T', filemtime($file_path)));
|
1270 |
+
$this->readfile($file_path);
|
1271 |
+
}
|
1272 |
+
|
1273 |
+
protected function send_content_type_header()
|
1274 |
+
{
|
1275 |
+
$this->header('Vary: Accept');
|
1276 |
+
if (strpos($this->get_server_var('HTTP_ACCEPT'), 'application/json') !== false) {
|
1277 |
+
$this->header('Content-type: application/json');
|
1278 |
+
} else {
|
1279 |
+
$this->header('Content-type: text/plain');
|
1280 |
+
}
|
1281 |
+
}
|
1282 |
+
|
1283 |
+
protected function send_access_control_headers()
|
1284 |
+
{
|
1285 |
+
$this->header('Access-Control-Allow-Origin: ' . $this->options['access_control_allow_origin']);
|
1286 |
+
$this->header('Access-Control-Allow-Credentials: '
|
1287 |
+
. ($this->options['access_control_allow_credentials'] ? 'true' : 'false'));
|
1288 |
+
$this->header('Access-Control-Allow-Methods: '
|
1289 |
+
. implode(', ', $this->options['access_control_allow_methods']));
|
1290 |
+
$this->header('Access-Control-Allow-Headers: '
|
1291 |
+
. implode(', ', $this->options['access_control_allow_headers']));
|
1292 |
+
}
|
1293 |
+
|
1294 |
+
public function head()
|
1295 |
+
{
|
1296 |
+
$this->header('Pragma: no-cache');
|
1297 |
+
$this->header('Cache-Control: no-store, no-cache, must-revalidate');
|
1298 |
+
$this->header('Content-Disposition: inline; filename="files.json"');
|
1299 |
+
// Prevent Internet Explorer from MIME-sniffing the content-type:
|
1300 |
+
$this->header('X-Content-Type-Options: nosniff');
|
1301 |
+
if ($this->options['access_control_allow_origin']) {
|
1302 |
+
$this->send_access_control_headers();
|
1303 |
+
}
|
1304 |
+
$this->send_content_type_header();
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
public function get($print_response = true)
|
1308 |
+
{
|
1309 |
+
if ($print_response && isset($_GET['download'])) {
|
1310 |
+
return $this->download();
|
1311 |
+
}
|
1312 |
+
$file_name = $this->get_file_name_param();
|
1313 |
+
if ($file_name) {
|
1314 |
+
$response = array(
|
1315 |
+
$this->get_singular_param_name() => $this->get_file_object($file_name)
|
1316 |
+
);
|
1317 |
+
} else {
|
1318 |
+
$response = array(
|
1319 |
+
$this->options['param_name'] => $this->get_file_objects()
|
1320 |
+
);
|
1321 |
+
}
|
1322 |
+
return $this->generate_response($response, $print_response);
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
public function checkFileExists($fileName)
|
1326 |
+
{
|
1327 |
+
$file_contents = array();
|
1328 |
+
$file_contents = $_REQUEST;
|
1329 |
+
$file_with_path = $file_contents['uploadPath'] . '/ultimate_importer/' . $fileName;
|
1330 |
+
|
1331 |
+
if (file_exists($file_with_path))
|
1332 |
+
return true;
|
1333 |
+
else
|
1334 |
+
return false;
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
public function post($print_response = true)
|
1338 |
+
{
|
1339 |
+
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
1340 |
+
return $this->delete($print_response);
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
|
1344 |
+
$upload = isset($_FILES[$this->options['param_name']]) ?
|
1345 |
+
$_FILES[$this->options['param_name']] : null;
|
1346 |
+
// Parse the Content-Disposition header, if available:
|
1347 |
+
/*added by prem
|
1348 |
+
$fil_nam=explode(".csv",$upload['name'][0]);
|
1349 |
+
$fileExists = $this->checkFileExists($fil_nam[0].'-'.$_REQUEST['curr_action'].' (1).csv');//var_dump($fileExists);
|
1350 |
+
if($fileExists){
|
1351 |
+
$fileExistsArray = array('fileExists' => $fileExists);
|
1352 |
+
return $this->generate_response($fileExistsArray,true);
|
1353 |
+
}*/
|
1354 |
+
|
1355 |
+
|
1356 |
+
$file_name = $this->get_server_var('HTTP_CONTENT_DISPOSITION') ?
|
1357 |
+
rawurldecode(preg_replace(
|
1358 |
+
'/(^[^"]+")|("$)/',
|
1359 |
+
'',
|
1360 |
+
$this->get_server_var('HTTP_CONTENT_DISPOSITION')
|
1361 |
+
)) : null;
|
1362 |
+
$content_range = $this->get_server_var('HTTP_CONTENT_RANGE') ?
|
1363 |
+
preg_split('/[^0-9]+/', $this->get_server_var('HTTP_CONTENT_RANGE')) : null;
|
1364 |
+
$size = $content_range ? $content_range[3] : null;
|
1365 |
+
$files = array();
|
1366 |
+
if ($upload && is_array($upload['tmp_name'])) {
|
1367 |
+
foreach ($upload['tmp_name'] as $index => $value) {
|
1368 |
+
$files[] = $this->handle_file_upload(
|
1369 |
+
$upload['tmp_name'][$index],
|
1370 |
+
$file_name ? $file_name : $upload['name'][$index],
|
1371 |
+
$size ? $size : $upload['size'][$index],
|
1372 |
+
$upload['type'][$index],
|
1373 |
+
$upload['error'][$index],
|
1374 |
+
$index,
|
1375 |
+
$content_range
|
1376 |
+
);
|
1377 |
+
}
|
1378 |
+
} else {
|
1379 |
+
$files[] = $this->handle_file_upload(
|
1380 |
+
isset($upload['tmp_name']) ? $upload['tmp_name'] : null,
|
1381 |
+
$file_name ? $file_name : (isset($upload['name']) ?
|
1382 |
+
$upload['name'] : null),
|
1383 |
+
$size ? $size : (isset($upload['size']) ?
|
1384 |
+
$upload['size'] : $this->get_server_var('CONTENT_LENGTH')),
|
1385 |
+
isset($upload['type']) ?
|
1386 |
+
$upload['type'] : $this->get_server_var('CONTENT_TYPE'),
|
1387 |
+
isset($upload['error']) ? $upload['error'] : null,
|
1388 |
+
null,
|
1389 |
+
$content_range
|
1390 |
+
);
|
1391 |
+
}
|
1392 |
+
# code added by goku to get the uploaded filename
|
1393 |
+
$files[0]->uploadedname = $upload['name'][0];
|
1394 |
+
return $this->generate_response(
|
1395 |
+
array($this->options['param_name'] => $files),
|
1396 |
+
$print_response
|
1397 |
+
);
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
public function delete($print_response = true)
|
1401 |
+
{
|
1402 |
+
$file_names = $this->get_file_names_params();
|
1403 |
+
if (empty($file_names)) {
|
1404 |
+
$file_names = array($this->get_file_name_param());
|
1405 |
+
}
|
1406 |
+
$response = array();
|
1407 |
+
foreach ($file_names as $file_name) {
|
1408 |
+
$file_path = $this->get_upload_path($file_name);
|
1409 |
+
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
|
1410 |
+
if ($success) {
|
1411 |
+
foreach ($this->options['image_versions'] as $version => $options) {
|
1412 |
+
if (!empty($version)) {
|
1413 |
+
$file = $this->get_upload_path($file_name, $version);
|
1414 |
+
if (is_file($file)) {
|
1415 |
+
unlink($file);
|
1416 |
+
}
|
1417 |
+
}
|
1418 |
+
}
|
1419 |
+
}
|
1420 |
+
$response[$file_name] = $success;
|
1421 |
+
}
|
1422 |
+
return $this->generate_response($response, $print_response);
|
1423 |
+
}
|
1424 |
+
|
1425 |
+
}
|
lib/jquery-plugins/index.php
ADDED
File without changes
|
lib/jquery-plugins/uploader.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* jQuery File Upload Plugin PHP Example 5.14
|
4 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
5 |
+
*
|
6 |
+
* Copyright 2010, Sebastian Tschan
|
7 |
+
* https://blueimp.net
|
8 |
+
*
|
9 |
+
* Licensed under the MIT license:
|
10 |
+
* http://www.opensource.org/licenses/MIT
|
11 |
+
*/
|
12 |
+
|
13 |
+
error_reporting(E_ALL | E_STRICT);
|
14 |
+
require('UploadHandler.php');
|
15 |
+
$upload_handler = new UploadHandler();
|
modules/comments/templates/index.php
CHANGED
@@ -196,7 +196,7 @@ if (isset($_POST['mydelimeter'])) {
|
|
196 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
197 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
198 |
}
|
199 |
-
$getrecords = $impCE->csv_file_data($filename
|
200 |
$getcustomposts=get_post_types();
|
201 |
$allcustomposts='';
|
202 |
$records = '';
|
@@ -346,7 +346,6 @@ $mFieldsArr = substr($mFieldsArr, 0, -1);
|
|
346 |
<tr>
|
347 |
<td>
|
348 |
<h3>Settings and Performance</h3>
|
349 |
-
<!--<?php //echo $_POST['uploadedFile']; ?><?php //echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; die;?>-->
|
350 |
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
351 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
352 |
<?php if(isset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'])) { ?>
|
196 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
197 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
198 |
}
|
199 |
+
$getrecords = $impCE->csv_file_data($filename);
|
200 |
$getcustomposts=get_post_types();
|
201 |
$allcustomposts='';
|
202 |
$records = '';
|
346 |
<tr>
|
347 |
<td>
|
348 |
<h3>Settings and Performance</h3>
|
|
|
349 |
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
350 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
351 |
<?php if(isset($_SESSION['SMACK_MAPPING_SETTINGS_VALUES'])) { ?>
|
modules/custompost/templates/index.php
CHANGED
@@ -278,7 +278,7 @@ $impCE = new WPImporter_includes_helper();
|
|
278 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
279 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
280 |
}
|
281 |
-
$getrecords = $impCE->csv_file_data($filename
|
282 |
$getcustomposts=get_post_types();
|
283 |
foreach($getcustomposts as $keys => $value)
|
284 |
{
|
@@ -448,7 +448,6 @@ $impCE = new WPImporter_includes_helper();
|
|
448 |
<tr>
|
449 |
<td>
|
450 |
<h3>Settings and Performance</h3>
|
451 |
-
<!--<?php //echo $_POST['uploadedFile']; ?><?php //echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; die;?>-->
|
452 |
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
453 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
454 |
<?php //$prevoptionindex='';?>
|
278 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
279 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
280 |
}
|
281 |
+
$getrecords = $impCE->csv_file_data($filename);
|
282 |
$getcustomposts=get_post_types();
|
283 |
foreach($getcustomposts as $keys => $value)
|
284 |
{
|
448 |
<tr>
|
449 |
<td>
|
450 |
<h3>Settings and Performance</h3>
|
|
|
451 |
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
452 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
453 |
<?php //$prevoptionindex='';?>
|
modules/dashboard/actions/chartone.php
CHANGED
@@ -54,7 +54,3 @@ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY.'lib/skinnymvc/core/SkinnyActio
|
|
54 |
}
|
55 |
|
56 |
|
57 |
-
elseif($_REQUEST['postdata']=='showDetailedGraph')
|
58 |
-
{
|
59 |
-
require_once($_REQUEST['wpcontenturl'].'/'.$_REQUEST['csvimpslug'].'/modules/dashboard/actions/getInlineGraphValues.php');
|
60 |
-
}
|
54 |
}
|
55 |
|
56 |
|
|
|
|
|
|
|
|
modules/dashboard/actions/managefiles.php
CHANGED
@@ -40,7 +40,7 @@ require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/base/Skin
|
|
40 |
require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php');
|
41 |
require_once('actions.php');
|
42 |
|
43 |
-
$dashObj = new DashboardActions();
|
44 |
$maincontent = array();
|
45 |
$totalfilescount = '';
|
46 |
$content = $_REQUEST['postdata'];
|
@@ -77,4 +77,4 @@ if ($maincontent['action'] == 'download') {
|
|
77 |
$importedas = $maincontent['importedas'];
|
78 |
$perform = $maincontent['perform'];
|
79 |
echo($dashObj->restoreTrashAllRecords($managerID, $importedas, $perform));
|
80 |
-
}
|
40 |
require_once(WP_CONST_ULTIMATE_CSV_IMP_DIRECTORY . 'lib/skinnymvc/core/SkinnyActions.php');
|
41 |
require_once('actions.php');
|
42 |
|
43 |
+
$dashObj = new DashboardActions();
|
44 |
$maincontent = array();
|
45 |
$totalfilescount = '';
|
46 |
$content = $_REQUEST['postdata'];
|
77 |
$importedas = $maincontent['importedas'];
|
78 |
$perform = $maincontent['perform'];
|
79 |
echo($dashObj->restoreTrashAllRecords($managerID, $importedas, $perform));
|
80 |
+
}
|
modules/export/actions/actions.php
CHANGED
@@ -181,7 +181,7 @@ class ExportActions extends SkinnyActions
|
|
181 |
}
|
182 |
if(is_array($checkbox_option_fields) && in_array($postmeta->meta_key,$checkbox_option_fields)){
|
183 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
|
184 |
-
$eshop_products = unserialize($eshop_products);
|
185 |
foreach ($eshop_products as $key) {
|
186 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
|
187 |
}
|
181 |
}
|
182 |
if(is_array($checkbox_option_fields) && in_array($postmeta->meta_key,$checkbox_option_fields)){
|
183 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
|
184 |
+
$eshop_products = unserialize($eshop_products);
|
185 |
foreach ($eshop_products as $key) {
|
186 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
|
187 |
}
|
modules/export/templates/export.php
CHANGED
@@ -211,7 +211,7 @@ if ($exporttype == 'post' || $exporttype == 'page' || $exporttype == 'custompost
|
|
211 |
}
|
212 |
if (is_array($checkbox_option_fields) && in_array($postmeta->meta_key, $checkbox_option_fields)) {
|
213 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
|
214 |
-
$eshop_products = unserialize($eshop_products);
|
215 |
foreach ($eshop_products as $key) {
|
216 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
|
217 |
}
|
@@ -220,7 +220,6 @@ if ($exporttype == 'post' || $exporttype == 'page' || $exporttype == 'custompost
|
|
220 |
}
|
221 |
}
|
222 |
}
|
223 |
-
#print('<pre>'); print_r($PostMetaData); die;
|
224 |
// Tags & Categories
|
225 |
$get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
|
226 |
$postTags = $postCategory = '';
|
@@ -393,7 +392,6 @@ elseif($exporttype=='users')
|
|
393 |
$Header[] = $rhq2_headkey->meta_key;
|
394 |
}
|
395 |
}
|
396 |
-
// echo '<pre>'; print_r($Header); die('dsd');
|
397 |
$get_user_ids = "select DISTINCT ID from $wpdb->users u join $wpdb->usermeta um on um.user_id = u.ID";
|
398 |
|
399 |
$result = $wpdb->get_col($get_user_ids);
|
@@ -410,14 +408,11 @@ elseif($exporttype=='users')
|
|
410 |
}
|
411 |
}
|
412 |
}
|
413 |
-
// echo '<pre>'; print_r($UserData); die ('dfdf');
|
414 |
$query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where ID=$userID";
|
415 |
$possible_values = array('s:', 'a:', ':{');
|
416 |
$result_query2 = $wpdb->get_results($query2);
|
417 |
if (!empty($result_query2)) {
|
418 |
foreach ($result_query2 as $usermeta) {
|
419 |
-
// echo '<pre>'; print_r($usermeta);
|
420 |
-
|
421 |
foreach($possible_values as $posval){
|
422 |
if(strpos($usermeta->meta_value,$posval)){
|
423 |
if($usermeta->meta_key == 'mp_shipping_info' || $usermeta->meta_key == 'mp_billing_info')
|
@@ -455,7 +450,6 @@ elseif($exporttype=='users')
|
|
455 |
} else {
|
456 |
if($usermeta->meta_key == 'wp_capabilities') {
|
457 |
$getUserRole = unserialize($usermeta->meta_value);
|
458 |
-
// echo '<pre>'; print_r($getUserRole); die('ddf');
|
459 |
foreach($getUserRole as $urKey => $urVal) {
|
460 |
$getUserRole = get_role($urKey);
|
461 |
}
|
@@ -467,7 +461,6 @@ elseif($exporttype=='users')
|
|
467 |
$rolelevel = $rolelevel + 1;
|
468 |
}
|
469 |
} $rolelevel = $rolelevel - 1;
|
470 |
-
#$UserData[$userID][$usermeta->meta_key] = $rolelevel;
|
471 |
}
|
472 |
}
|
473 |
} else {
|
@@ -481,7 +474,7 @@ elseif($exporttype=='users')
|
|
481 |
}
|
482 |
|
483 |
}
|
484 |
-
}
|
485 |
}
|
486 |
}
|
487 |
}
|
@@ -494,7 +487,6 @@ elseif($exporttype=='users')
|
|
494 |
$CSVContent[$header_key][] = '';
|
495 |
}
|
496 |
}
|
497 |
-
// echo '<pre>'; print_r($CSVContent); die('it sded');
|
498 |
for ($j = 0; $j < $fieldsCount; $j++) {
|
499 |
foreach ($Header as $value) {
|
500 |
if ( ! isset($CSVDATA[$j])) {
|
211 |
}
|
212 |
if (is_array($checkbox_option_fields) && in_array($postmeta->meta_key, $checkbox_option_fields)) {
|
213 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] = '';
|
214 |
+
$eshop_products = unserialize($eshop_products);
|
215 |
foreach ($eshop_products as $key) {
|
216 |
$PostMetaData[$postmeta->post_id][$postmeta->meta_key] .= $key . ',';
|
217 |
}
|
220 |
}
|
221 |
}
|
222 |
}
|
|
|
223 |
// Tags & Categories
|
224 |
$get_tags = wp_get_post_tags($postID, array('fields' => 'names'));
|
225 |
$postTags = $postCategory = '';
|
392 |
$Header[] = $rhq2_headkey->meta_key;
|
393 |
}
|
394 |
}
|
|
|
395 |
$get_user_ids = "select DISTINCT ID from $wpdb->users u join $wpdb->usermeta um on um.user_id = u.ID";
|
396 |
|
397 |
$result = $wpdb->get_col($get_user_ids);
|
408 |
}
|
409 |
}
|
410 |
}
|
|
|
411 |
$query2 = "SELECT user_id, meta_key, meta_value FROM $wpdb->users wp JOIN $wpdb->usermeta wpm ON wpm.user_id = wp.ID where ID=$userID";
|
412 |
$possible_values = array('s:', 'a:', ':{');
|
413 |
$result_query2 = $wpdb->get_results($query2);
|
414 |
if (!empty($result_query2)) {
|
415 |
foreach ($result_query2 as $usermeta) {
|
|
|
|
|
416 |
foreach($possible_values as $posval){
|
417 |
if(strpos($usermeta->meta_value,$posval)){
|
418 |
if($usermeta->meta_key == 'mp_shipping_info' || $usermeta->meta_key == 'mp_billing_info')
|
450 |
} else {
|
451 |
if($usermeta->meta_key == 'wp_capabilities') {
|
452 |
$getUserRole = unserialize($usermeta->meta_value);
|
|
|
453 |
foreach($getUserRole as $urKey => $urVal) {
|
454 |
$getUserRole = get_role($urKey);
|
455 |
}
|
461 |
$rolelevel = $rolelevel + 1;
|
462 |
}
|
463 |
} $rolelevel = $rolelevel - 1;
|
|
|
464 |
}
|
465 |
}
|
466 |
} else {
|
474 |
}
|
475 |
|
476 |
}
|
477 |
+
}
|
478 |
}
|
479 |
}
|
480 |
}
|
487 |
$CSVContent[$header_key][] = '';
|
488 |
}
|
489 |
}
|
|
|
490 |
for ($j = 0; $j < $fieldsCount; $j++) {
|
491 |
foreach ($Header as $value) {
|
492 |
if ( ! isset($CSVDATA[$j])) {
|
modules/page/templates/index.php
CHANGED
@@ -219,7 +219,7 @@ $impCE = new WPImporter_includes_helper();
|
|
219 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
220 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
221 |
}
|
222 |
-
$getrecords = $impCE->csv_file_data($filename
|
223 |
$getcustomposts=get_post_types();
|
224 |
foreach($getcustomposts as $keys => $value)
|
225 |
{
|
@@ -385,7 +385,6 @@ $impCE = new WPImporter_includes_helper();
|
|
385 |
<tr>
|
386 |
<td>
|
387 |
<h3>Settings and Performance</h3>
|
388 |
-
<!--<?php //echo $_POST['uploadedFile']; ?><?php //echo $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['totRecords']; die;?>-->
|
389 |
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
390 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
391 |
<?php //$prevoptionindex='';?>
|
219 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
220 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
221 |
}
|
222 |
+
$getrecords = $impCE->csv_file_data($filename);
|
223 |
$getcustomposts=get_post_types();
|
224 |
foreach($getcustomposts as $keys => $value)
|
225 |
{
|
385 |
<tr>
|
386 |
<td>
|
387 |
<h3>Settings and Performance</h3>
|
|
|
388 |
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
389 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
390 |
<?php //$prevoptionindex='';?>
|
modules/post/templates/index.php
CHANGED
@@ -225,7 +225,7 @@ $impCE = new WPImporter_includes_helper();
|
|
225 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
226 |
}
|
227 |
|
228 |
-
$getrecords = $impCE->csv_file_data($filename
|
229 |
$getcustomposts=get_post_types();
|
230 |
foreach($getcustomposts as $keys => $value)
|
231 |
{
|
@@ -393,7 +393,7 @@ $impCE = new WPImporter_includes_helper();
|
|
393 |
<tr>
|
394 |
<td>
|
395 |
<h3>Settings and Performance</h3>
|
396 |
-
|
397 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
398 |
<?php //$prevoptionindex='';?>
|
399 |
<input type="hidden" id="prevoptionindex" name="prevoptionindex" value="<?php
|
225 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
226 |
}
|
227 |
|
228 |
+
$getrecords = $impCE->csv_file_data($filename);
|
229 |
$getcustomposts=get_post_types();
|
230 |
foreach($getcustomposts as $keys => $value)
|
231 |
{
|
393 |
<tr>
|
394 |
<td>
|
395 |
<h3>Settings and Performance</h3>
|
396 |
+
<?php if(isset($_REQUEST['step']) && $_REQUEST['step'] == 'importoptions') { ?>
|
397 |
<div id='sec-three' <?php if($_REQUEST['step']!= 'importoptions'){ ?> style='display:none;' <?php } ?> >
|
398 |
<?php //$prevoptionindex='';?>
|
399 |
<input type="hidden" id="prevoptionindex" name="prevoptionindex" value="<?php
|
modules/users/actions/actions.php
CHANGED
@@ -240,16 +240,10 @@ class UsersActions extends SkinnyActions {
|
|
240 |
}
|
241 |
function addStatusLog($inserted,$imported_as){
|
242 |
global $wpdb;
|
243 |
-
// $lid = $wpdb->get_results("SELECT LAST_INSERT_ID() as id FROM smackcsv_pie_log");
|
244 |
-
// $sdm_id = $lid[0]->id;
|
245 |
-
// $imp_as = $wpdb->get_results("select id,type from smackcsv_pie_log where id = {$sdm_id} ");
|
246 |
-
// $import = $imp_as[0]->type;
|
247 |
-
// $lid = $imp_as[1]->id;
|
248 |
$today = date('Y-m-d h:i:s');
|
249 |
$mon = date("M",strtotime($today));
|
250 |
$year = date("Y",strtotime($today));
|
251 |
$wpdb->insert('smackcsv_line_log', array('month'=>$mon,'year'=>$year,'imported_type'=>$imported_as,'imported_on'=>date('Y-m-d h:i:s'), 'inserted'=>$inserted ));
|
252 |
-
// echo '<pre>'; print_r($wpdb); die('sd');
|
253 |
}
|
254 |
|
255 |
|
240 |
}
|
241 |
function addStatusLog($inserted,$imported_as){
|
242 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
243 |
$today = date('Y-m-d h:i:s');
|
244 |
$mon = date("M",strtotime($today));
|
245 |
$year = date("Y",strtotime($today));
|
246 |
$wpdb->insert('smackcsv_line_log', array('month'=>$mon,'year'=>$year,'imported_type'=>$imported_as,'imported_on'=>date('Y-m-d h:i:s'), 'inserted'=>$inserted ));
|
|
|
247 |
}
|
248 |
|
249 |
|
modules/users/templates/index.php
CHANGED
@@ -196,7 +196,7 @@ if (isset($_POST['mydelimeter'])) {
|
|
196 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
197 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
198 |
}
|
199 |
-
$getrecords = $impCE->csv_file_data($filename
|
200 |
$getcustomposts=get_post_types();
|
201 |
$allcustomposts='';
|
202 |
foreach($getcustomposts as $keys => $value)
|
196 |
if(isset($_POST['upload_csv_realname']) && $_POST['upload_csv_realname'] != '') {
|
197 |
$uploaded_csv_name = $_POST['upload_csv_realname'];
|
198 |
}
|
199 |
+
$getrecords = $impCE->csv_file_data($filename);
|
200 |
$getcustomposts=get_post_types();
|
201 |
$allcustomposts='';
|
202 |
foreach($getcustomposts as $keys => $value)
|
plugins/README
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Put your plugins here.
|
3 |
+
The file name of a plugin must be formatted like this:
|
4 |
+
skinnyPlugin*.php
|
5 |
+
|
6 |
+
For example:
|
7 |
+
skinnyPluginCaptcha.php
|
8 |
+
|
templates/UploadHandler.php
CHANGED
@@ -1066,7 +1066,6 @@ class UploadHandler
|
|
1066 |
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
1067 |
$this->handle_form_data($file, $index);
|
1068 |
$upload_dir = $this->get_upload_path();
|
1069 |
-
//print $upload_dir; print($_REQUEST['uploadPath']);die;
|
1070 |
if (!is_dir($upload_dir)) {
|
1071 |
mkdir($upload_dir, $this->options['mkdir_mode'], true);
|
1072 |
}
|
1066 |
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
1067 |
$this->handle_form_data($file, $index);
|
1068 |
$upload_dir = $this->get_upload_path();
|
|
|
1069 |
if (!is_dir($upload_dir)) {
|
1070 |
mkdir($upload_dir, $this->options['mkdir_mode'], true);
|
1071 |
}
|
templates/import.php
CHANGED
@@ -86,7 +86,6 @@ $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['importlimit'] = $_POST['postdata']['
|
|
86 |
$count = $_POST['postdata']['importlimit'];
|
87 |
$requested_limit = $_POST['postdata']['importlimit'];
|
88 |
$tmpCnt = $_POST['postdata']['tmpcount'];
|
89 |
-
|
90 |
if ($count < $totRecords) {
|
91 |
$count = $tmpCnt + $count;
|
92 |
if ($count > $totRecords) {
|
@@ -98,8 +97,7 @@ if ($count < $totRecords) {
|
|
98 |
$resultArr = array();
|
99 |
$filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
|
100 |
$delim = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['select_delimeter'];
|
101 |
-
$resultArr = $skinnyObj->csv_file_data($filename
|
102 |
-
#print('<pre>'); print_r($resultArr); die;
|
103 |
if ($_POST['postdata']['dupTitle']) {
|
104 |
$importObj->titleDupCheck = $_POST['postdata']['dupTitle'];
|
105 |
}
|
@@ -112,10 +110,13 @@ for ($i = $limit; $i < $count; $i++) {
|
|
112 |
$_SESSION['SMACK_SKIPPED_RECORDS'] = $i;
|
113 |
foreach($resultArr[$i] as $resultKey => $resultVal) {
|
114 |
$to_be_import_rec[] = $resultVal;
|
115 |
-
}
|
116 |
-
|
|
|
117 |
$limit++;
|
|
|
118 |
}
|
|
|
119 |
if ($limit >= $totRecords) {
|
120 |
$dir = $skinnyObj->getUploadDirectory();
|
121 |
$skinnyObj->deletefileafterprocesscomplete($dir);
|
@@ -241,6 +242,7 @@ if ($curr_action == 'users') {
|
|
241 |
echo "[" . date('h:m:s') . "] - No of " . $customposttype . " are assigned as admin - " . $importObj->noPostAuthCount . ".<br>";
|
242 |
if ($limit == $totRecords) {
|
243 |
echo "<br><div style='margin-left:3px;'>Import successfully completed!.</div>";
|
|
|
244 |
}
|
245 |
echo "</div>";
|
246 |
}
|
86 |
$count = $_POST['postdata']['importlimit'];
|
87 |
$requested_limit = $_POST['postdata']['importlimit'];
|
88 |
$tmpCnt = $_POST['postdata']['tmpcount'];
|
|
|
89 |
if ($count < $totRecords) {
|
90 |
$count = $tmpCnt + $count;
|
91 |
if ($count > $totRecords) {
|
97 |
$resultArr = array();
|
98 |
$filename = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['uploadedFile'];
|
99 |
$delim = $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']['select_delimeter'];
|
100 |
+
$resultArr = $skinnyObj->csv_file_data($filename);
|
|
|
101 |
if ($_POST['postdata']['dupTitle']) {
|
102 |
$importObj->titleDupCheck = $_POST['postdata']['dupTitle'];
|
103 |
}
|
110 |
$_SESSION['SMACK_SKIPPED_RECORDS'] = $i;
|
111 |
foreach($resultArr[$i] as $resultKey => $resultVal) {
|
112 |
$to_be_import_rec[] = $resultVal;
|
113 |
+
}
|
114 |
+
|
115 |
+
$importObj->processDataInWP($to_be_import_rec,$_SESSION['SMACK_MAPPING_SETTINGS_VALUES'], $_SESSION['SMACK_MAPPING_SETTINGS_VALUES']);
|
116 |
$limit++;
|
117 |
+
unset($to_be_import_rec);
|
118 |
}
|
119 |
+
|
120 |
if ($limit >= $totRecords) {
|
121 |
$dir = $skinnyObj->getUploadDirectory();
|
122 |
$skinnyObj->deletefileafterprocesscomplete($dir);
|
242 |
echo "[" . date('h:m:s') . "] - No of " . $customposttype . " are assigned as admin - " . $importObj->noPostAuthCount . ".<br>";
|
243 |
if ($limit == $totRecords) {
|
244 |
echo "<br><div style='margin-left:3px;'>Import successfully completed!.</div>";
|
245 |
+
|
246 |
}
|
247 |
echo "</div>";
|
248 |
}
|
templates/readfile.php
CHANGED
@@ -37,11 +37,10 @@
|
|
37 |
|
38 |
require_once('../includes/WPImporter_includes_helper.php');
|
39 |
require_once('../../../../wp-load.php');
|
40 |
-
$impObj = CallWPImporterObj::getInstance();
|
41 |
$filename=$_POST['file_name'];
|
42 |
$delimeter = '';
|
43 |
-
|
44 |
-
$result = $impObj->csv_file_data($filename, $delimeter);
|
45 |
foreach($result[$_REQUEST['record_no']] as $key => $value) {
|
46 |
$data[] = $value;
|
47 |
}
|
37 |
|
38 |
require_once('../includes/WPImporter_includes_helper.php');
|
39 |
require_once('../../../../wp-load.php');
|
40 |
+
$impObj = CallWPImporterObj::getInstance();
|
41 |
$filename=$_POST['file_name'];
|
42 |
$delimeter = '';
|
43 |
+
$result = $impObj->csv_file_data($filename);
|
|
|
44 |
foreach($result[$_REQUEST['record_no']] as $key => $value) {
|
45 |
$data[] = $value;
|
46 |
}
|
wp_ultimate_csv_importer.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Activate the CSV importer free plugin
|
4 |
-
*/
|
5 |
-
$get_active_plugins = get_option('active_plugins');
|
6 |
-
$pluginArr = array();
|
7 |
-
foreach($get_active_plugins as $plugin){
|
8 |
-
if($plugin == 'wp-ultimate-csv-importer/wp_ultimate_csv_importer.php'){
|
9 |
-
$pluginArr[] = 'wp-ultimate-csv-importer/index.php';
|
10 |
-
} else {
|
11 |
-
$pluginArr[] = $plugin;
|
12 |
-
}
|
13 |
-
}
|
14 |
-
update_option('active_plugins', $pluginArr);
|
15 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|