Changeset 1967164
- Timestamp:
- 11/01/2018 01:10:11 PM (7 years ago)
- Location:
- files-addon-for-event-espresso-4
- Files:
-
- 4 edited
-
assets/screenshot-1.png (modified) (previous)
-
trunk/EE_File.class.php (modified) (1 diff)
-
trunk/eea-file.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
files-addon-for-event-espresso-4/trunk/EE_File.class.php
r1793549 r1967164 65 65 $table = $wpdb->prefix.'esp_question_allowed_ext'; 66 66 $question_id = $args['QST_ID']; 67 68 $count = $wpdb->get_var("SELECT COUNT(id) FROM $table WHERE qst_id='{$question_id}'"); 69 $ext = $_POST['question_ext']; 70 71 72 if ($count > 0) { 73 74 $wpdb->update( 75 $table, 76 array('ext'=>$ext), 77 array('qst_id'=>$question_id), 78 array('%s'), 79 array('%d') 80 ); 81 } else { 82 83 $wpdb->insert( 84 $table, 85 array('ext'=>$ext, 86 'qst_id'=>$question_id), 87 array( '%s', 88 '%d') 89 ); 67 if($_POST['QST_type'] == 'file') 68 { 69 $count = $wpdb->get_var("SELECT COUNT(id) FROM $table WHERE qst_id='{$question_id}'"); 70 $ext = $_POST['question_ext']; 71 72 73 if ($count > 0) { 74 75 $wpdb->update( 76 $table, 77 array('ext'=>$ext), 78 array('qst_id'=>$question_id), 79 array('%s'), 80 array('%d') 81 ); 82 } else { 83 84 $wpdb->insert( 85 $table, 86 array('ext'=>$ext, 87 'qst_id'=>$question_id), 88 array( '%s', 89 '%d') 90 ); 91 } 90 92 } 91 93 -
files-addon-for-event-espresso-4/trunk/eea-file.php
r1793549 r1967164 6 6 * Author URI: http://aparnascodex.com/ 7 7 * License: GPL2 8 * Version: 1.0. 78 * Version: 1.0.8 9 9 * TextDomain: wordfile 10 10 */ … … 104 104 } 105 105 106 $upload_overrides = array( 'test_form' => false );106 $upload_overrides = array( 'test_form' => false ,'unique_filename_callback' => 'ssa_change_filename' ); 107 107 108 108 add_filter('upload_dir', 'ssa_change_uploads_directory_path'); … … 124 124 echo json_encode($data); 125 125 die(); 126 } 127 128 //override filename 129 function ssa_change_filename($dir, $name, $ext){ 130 $filename = $name.$ext; 131 $filename = apply_filters('ssa_override_filename',$filename); 132 return $filename; 126 133 } 127 134 -
files-addon-for-event-espresso-4/trunk/readme.txt
r1793549 r1967164 3 3 Tags: Event espresso, file , upload file, questions, form, events 4 4 Requires at least: 4.1 5 Tested up to: WordPress 4.9. 16 Stable tag: 1.0. 75 Tested up to: WordPress 4.9.8 6 Stable tag: 1.0.8 7 7 License: GPL2 8 8 … … 27 27 Following steps should be followed to install plugin manually 28 28 29 1. Upload 'files-addon-for-event-espresso-4' folder to the '/wp-content/plugins/' directory or upload 'files-addon-for-event-espresso-4.1.0. 7.zip' through WordPress admin panel29 1. Upload 'files-addon-for-event-espresso-4' folder to the '/wp-content/plugins/' directory or upload 'files-addon-for-event-espresso-4.1.0.8.zip' through WordPress admin panel 30 30 2. Activate the plugin through the 'Plugins' menu in WordPress 31 31 3. You are ready to create file type question. … … 60 60 61 61 == Changelog == 62 = 1.0.8 = 63 64 1. Added filter to rename file before uploading - Filter - ssa_override_filename 65 2. Tested plugin with latest WordPress and Event Espresso version 66 62 67 = 1.0.7 = 63 68
Note: See TracChangeset
for help on using the changeset viewer.