Changeset 3190096
- Timestamp:
- 11/16/2024 09:40:37 AM (17 months ago)
- Location:
- csv-to-html/trunk
- Files:
-
- 2 edited
-
csvtohtml.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
csv-to-html/trunk/csvtohtml.php
r3190079 r3190096 4 4 Plugin URI: http://www.wibergsweb.se/plugins/csvtohtml 5 5 Description:Display/edit/synchronize csv-file(s) dynamically into a html-table 6 Version: 3.0 66 Version: 3.07 7 7 Author: Wibergs Web 8 8 Author URI: http://www.wibergsweb.se/ … … 59 59 $this->init(); 60 60 } 61 62 63 /**64 * uploadfile_ajax()65 *66 * Used when uploading a file. Used for csv or json-files.67 *68 * @param N/A69 * @return N/A70 *71 */72 public function uploadfile_ajax()73 {74 if (!empty($_FILES['csv_file']))75 {76 $file = $_FILES['csv_file'];77 78 if ($file['error'] === UPLOAD_ERR_OK)79 {80 $file_name = $file['name'];81 $temp_file = $file['tmp_name'];82 83 //Move uploaded file to Wordpress upload folder84 $upload_dir = wp_upload_dir();85 86 //This copies files into plugin examples folder87 //These files will not be there after an updatet of the plugin88 if ( $_POST['frm_path'] == '%temp%' )89 {90 $upload_dir['basedir'] = WP_PLUGIN_DIR . '/csv-to-html/examples';91 $upload_dir['baseurl'] = 'file uploaded into plugin examples folder';92 }93 94 $destination = $upload_dir['basedir'] . '/' . $file_name;95 if (move_uploaded_file($temp_file, $destination))96 {97 $file_url = $upload_dir['baseurl'] . '/' . $file_name;98 echo json_encode( __('File uploaded successfully', 'csv-to-html') . ': ' . $file_url);99 }100 else101 {102 echo json_encode( __('Error moving uploaded file.', 'csv-to-html') );103 }104 }105 else106 {107 echo json_encode( __('Error uploading file: ', 'csv-to-html') );108 }109 }110 else111 {112 echo json_encode( __('No file selected.', 'csv-to-html') );113 }114 115 wp_die();116 }117 61 118 62 … … 699 643 <strong>Get started!</strong><br> 700 644 * <strong>Select source file(s).</strong> 701 Local file\'s root are in wp-content/uploads: <strong>Do this by clicking on General section down below and modify path and file(s).</strong><br> 702 * If you don\'t have access to the uploads-folder, then upload your file to the upload folder here: 703 <input type="hidden" name="action" value="upload_file"> 704 <input type="file" name="csv_file" accept=".csv,.json,.xlsx"> 705 <input type="submit" value="Upload file"> 706 <div id="upload-result"><b>Note! <span style="color:red;">If you\'re using Wordpress Playground</span> (Live Preview from plugin page), then <span style="color:red;">set %temp% in path</span> and delimiter to semicolon (;) to view an example csv-file and do a lot of testing with different settings. <span style="color:red;">Uploading files in the Playground environment does not work at the moment</span>.<br><br>When using IMPORT-functionality ALL files with the same name will be overwritten!</div> 707 645 Local file\'s root are in wp-content/uploads: <strong>Do this by clicking on General section down below and modify path and file(s).</strong> 646 </p> 708 647 <p style="font-size:1.3em;padding:0.5em;margin:0;color:darkgreen;"> 709 648 * Click on different sections down below and <strong>make changes of settings and then click on Update/Preview</strong> button<br> -
csv-to-html/trunk/readme.txt
r3190079 r3190096 141 141 == Changelog == 142 142 143 = 3.07 = 144 Removal of uploading files manually (usage with Playground-functionality). Removal also because of security issues with uploading. 145 143 146 = 3.06 = 144 147 Stable tag folder/content added to follow Wordpress new policies regarding structure of svn. (2024-11-16)
Note: See TracChangeset
for help on using the changeset viewer.