Changeset 2251865
- Timestamp:
- 02/28/2020 09:54:22 AM (6 years ago)
- Location:
- simple-ftp-directory-lister
- Files:
-
- 28 added
- 3 edited
-
tags/1.0 (added)
-
tags/1.0/assets (added)
-
tags/1.0/assets/css (added)
-
tags/1.0/assets/css/simple-ftp-directory-lister.css (added)
-
tags/1.0/assets/js (added)
-
tags/1.0/assets/js/jquery-3.4.1.js (added)
-
tags/1.0/assets/js/jquery-3.4.1.min.js (added)
-
tags/1.0/assets/js/simple-ftp-directory-lister.js (added)
-
tags/1.0/assets/screenshot-1.png (added)
-
tags/1.0/assets/screenshot-2.png (added)
-
tags/1.0/assets/screenshot-3.png (added)
-
tags/1.0/assets/sfdl-options.php (added)
-
tags/1.0/readme.txt (added)
-
tags/1.0/simple-ftp-directory-lister.php (added)
-
tags/1.1 (added)
-
tags/1.1/assets (added)
-
tags/1.1/assets/css (added)
-
tags/1.1/assets/css/simple-ftp-directory-lister.css (added)
-
tags/1.1/assets/js (added)
-
tags/1.1/assets/js/jquery-3.4.1.js (added)
-
tags/1.1/assets/js/jquery-3.4.1.min.js (added)
-
tags/1.1/assets/js/simple-ftp-directory-lister.js (added)
-
tags/1.1/assets/screenshot-1.png (added)
-
tags/1.1/assets/screenshot-2.png (added)
-
tags/1.1/assets/screenshot-3.png (added)
-
tags/1.1/assets/sfdl-options.php (added)
-
tags/1.1/readme.txt (added)
-
tags/1.1/simple-ftp-directory-lister.php (added)
-
trunk/assets/sfdl-options.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/simple-ftp-directory-lister.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-ftp-directory-lister/trunk/assets/sfdl-options.php
r2245864 r2251865 127 127 { 128 128 print '<div>Plugin register path to folder within wordpress upload folder, therefore add only relative path to the folder you want to list. <br> When the path to folder is properly set, just copy the shortcode and past it anywhere to the page where you want to show the listing. </div><div style="color: red; margin-top:10px;">Please keep in mind that this plugin is not suitable for listing thousands of items since it loads all the information at once.</div>'; 129 print '<br><b>You can also define path within the shortcode to use the plugin in serveral places and listing different folders: [simple-ftp-directory-lister path="/path-to-folder"]</b>'; 129 130 } 130 131 … … 137 138 global $full_safe_dir_path; 138 139 $pathcheck = "<br>Set directory for listing: " . $full_safe_dir_path . "<br><br>"; 139 global $full_safe_dir_path; 140 140 141 if (! file_exists($full_safe_dir_path)) { 141 142 $pathcheck .= '<div style="color:red;font-size:20px;font-weight:600;"> ERROR --> Set path does not exist.</div>'; -
simple-ftp-directory-lister/trunk/readme.txt
r2245864 r2251865 6 6 Tested up to: 5.2 7 7 Requires PHP: 7.2 8 Stable tag: 1. 08 Stable tag: 1.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 21 21 22 22 Please keep in mind that this plugin is not suitable for listing thousands of items since it loads all the information at once. 23 24 You can also define path within the shortcode to use the plugin in serveral places and listing different folders: [simple-ftp-directory-lister path="/path-to-folder"] 23 25 24 26 == Installation == 25 27 26 1. Upload `simple-ftp-directory-lister folder` to the `/wp-content/plugins/` directory28 1. Upload simple-ftp-directory-lister folder` to the `/wp-content/plugins/` directory 27 29 2. Activate the plugin through the 'Plugins' menu in WordPress 28 30 3. Go to settings -> Simple FTP Directory Lister Settings … … 40 42 = Can I list multiple folders? = 41 43 42 Not at the moment, SFDL supports only one folder to list. 44 Yes, you can define path within the shortcode to use the plugin in serveral places and listing different folders: [simple-ftp-directory-lister path="/path-to-folder"] 43 45 44 46 == Screenshots == 45 screenshot-1.png `46 screenshot-2.png `47 screenshot-3.png `47 screenshot-1.png 48 screenshot-2.png 49 screenshot-3.png 48 50 49 51 == Changelog == 52 = 1.1 = 53 * adding support for defining path directly in shortcode, thus allowing multiple different listings across website 50 54 51 55 = 1.0 = -
simple-ftp-directory-lister/trunk/simple-ftp-directory-lister.php
r2245864 r2251865 3 3 * Plugin Name: Simple FTP Directory Lister 4 4 * Description: Choose folder from FTP - WP UPLOAD DIRECTORY - and display all its files and subfolders. Easy integration. 5 * Version: 1. 05 * Version: 1.1 6 6 * Requires at least: 5.2 7 7 * Requires PHP: 7.2 … … 22 22 add_shortcode( 'simple-ftp-directory-lister', 'sfdl_main_function'); 23 23 24 // set directory25 24 $directory = get_option( 'simple_file_directory_lister_option_name'); 26 25 $user_input_path = $directory["id_path_to_folder"]; 26 27 27 28 /* set full path and remove all dot dot slashes from the path */ 28 29 $upload_dir = wp_upload_dir(); … … 41 42 $full_safe_dir_path = realpath($full_dir_path); 42 43 44 43 45 /* functions declaration */ 44 45 46 if (!function_exists('array_key_first')) { 46 47 function array_key_first(array $arr) { … … 109 110 110 111 /*main function of the lister */ 111 function sfdl_main_function(){ 112 function sfdl_main_function($path){ 113 114 112 115 global $full_safe_dir_path; 113 116 global $full_dir_path; 114 117 global $upload_dir; 118 global $directory; 119 global $id_path_to_folder; 115 120 global $user_input_path; 121 122 // set directory 123 if (isset($path['path'])){ 124 $directory = $path['path']; 125 $user_input_path = $path['path']; 126 } 127 128 // add / to beginning of user input path if missing 129 if (substr($user_input_path, 0, 1) !== '/' && substr($user_input_path, 0, 1) !== '\\' && substr($user_input_path, 0, 1) !== '.') { 130 $user_input_path = "/" . $user_input_path; 131 } 132 133 // change all \ to / within user input path 134 elseif (substr($user_input_path, 0, 1) === '\\') { 135 $user_input_path = str_replace("\\", "/", $user_input_path); 136 } 137 138 $full_dir_path = $upload_dir['basedir'] . $user_input_path; 139 $full_safe_dir_path = realpath($full_dir_path); 140 141 116 142 117 143 /*dont run in admin area */
Note: See TracChangeset
for help on using the changeset viewer.