Changeset 3422358
- Timestamp:
- 12/17/2025 10:29:56 PM (3 months ago)
- Location:
- wp-tournament-registration/trunk
- Files:
-
- 7 edited
-
assets/load.php (modified) (2 diffs)
-
assets/wptournreg.js (modified) (1 diff)
-
readme.md (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
shortcodes/field.php (modified) (3 diffs)
-
shortcodes/list.php (modified) (1 diff)
-
wp-tournament-registration.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-tournament-registration/trunk/assets/load.php
r2390367 r3422358 7 7 'wptournreg', // $handle 8 8 WP_TOURNREG_JS_URL, // $url 9 array( 'jquery', 'wptournreg tablesorter' ), // $deps9 array( 'jquery', 'wptournreginputdropdown', 'wptournregtablesorter' ), // $deps 10 10 WP_TOURNREG_PLUGIN_VER, // $ver 11 11 true // $in_footer … … 15 15 'wptournreg', // $handle 16 16 WP_TOURNREG_CSS_URL, // $url 17 array( 'wptournreg tablesorter' ), // $deps17 array( 'wptournreginputdropdown', 'wptournregtablesorter' ), // $deps 18 18 WP_TOURNREG_PLUGIN_VER, // $ver 19 19 false // $in_footer 20 20 ); 21 21 22 } 22 23 -
wp-tournament-registration/trunk/assets/wptournreg.js
r2390367 r3422358 39 39 } 40 40 }); 41 42 var wptournregsuggestions = false; 43 $( '.wptournreg-form [data-field-suggestions]').on( 'mouseover touchover', function() { 44 45 if ( wptournregsuggestions === false ) { 46 47 wptournregsuggestions = true; 48 let elem = jQuery( this ); 49 let arr = elem.data('field-suggestions').split(','); 50 let dataList = []; 51 52 for (let index = 0; index < arr.length; ++index) { 53 const element = arr[index]; 54 const value = 55 dataList[index] = { name:element, value:element.replace(/\s+/g, ' ') } 56 } 57 58 elem.inputDropdown(dataList, { 59 formatter: data => { 60 return `<li language=${data.value}>${data.name}</li>` 61 }, 62 valueKey: 'language' // default: data-value 63 }) 64 elem.removeData( 'field-suggestions' ); 65 } 66 }); -
wp-tournament-registration/trunk/readme.md
r3421479 r3422358 11 11 ## License 12 12 13 © 2020–202 5Ingram Braun [https://ingram-braun.net/](https://ingram-braun.net/#ib_campaign=wptournreg&ib_medium=repository&ib_source=readme&ib_content=copyright)13 © 2020–2026 Ingram Braun [https://ingram-braun.net/](https://ingram-braun.net/#ib_campaign=wptournreg&ib_medium=repository&ib_source=readme&ib_content=copyright) 14 14 15 15 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. … … 19 19 `jQuery.tablesorter` is © Christian Bach and Rob Garrison [MIT or GPL](https://mottie.github.io/tablesorter/docs/) 20 20 21 `jquery.input-dropdown` is © Kohei Mizobata [MIT](https://github.com/kohei-kp/jquery.input-dropdown) 22 21 23 ## Donate 22 24 -
wp-tournament-registration/trunk/readme.txt
r3421476 r3422358 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.0 8 Stable tag: 1.4. 08 Stable tag: 1.4.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 96 96 * `field` one of the field names (cf. list above). 97 97 * `label` the label of the field. 98 * `options` a comma separated list of options for a suggestion list. Takes only effect in text input fields. 98 99 * `placeholder` the placeholder is shown in an empty field. 99 100 * `required` if set to any value the field is marked as required. … … 103 104 The first example is a registration form. Several `wptournregfield` shortcodes are wrapped by a `wptournregfield` one. You can put HTML elements between (fi. fieldsets) in order to design your form: 104 105 105 `[wptournregform tournament_id="my_tournament" css_id="my_tournament" email="subscription@example.com"]<p>Red labels indicate required fields!</p><fieldset><legend>Who you are</legend>[wptournregfield field="lastname" label="Family name" required="1" /][wptournregfield field="firstname" label="Christian name" required="1" /][wptournregfield field="affiliation" label="Club" required="1" placeholder="or 'free agent'" /][wptournregfield field="rating1" label="DWZ" /]</fieldset><fieldset><legend>Your contact data (not to be published)</legend>[wptournregfield field="email" label="E-mail" /][wptournregfield field="phone1" label="Phone 1" required="1" /][wptournregfield field="phone2" label="Phone 2" /]</fieldset>[wptournregfield field="message" label="Your message" placeholder="Whatever you like to tell us." /][/wptournregform]`106 `[wptournregform tournament_id="my_tournament" css_id="my_tournament" email="subscription@example.com"]<p>Red labels indicate required fields!</p><fieldset><legend>Who you are</legend>[wptournregfield field="lastname" label="Family name" required="1" /][wptournregfield field="firstname" label="Christian name" required="1" /][wptournregfield field="affiliation" label="Club" required="1" placeholder="or 'free agent'" options="Paris SG, Hertha Berlin, Oslo CC" /][wptournregfield field="rating1" label="DWZ" /]</fieldset><fieldset><legend>Your contact data (not to be published)</legend>[wptournregfield field="email" label="E-mail" /][wptournregfield field="phone1" label="Phone 1" required="1" /][wptournregfield field="phone2" label="Phone 2" /]</fieldset>[wptournregfield field="message" label="Your message" placeholder="Whatever you like to tell us." /][/wptournregform]` 106 107 107 108 The next instance is an editor for the data of the tournament. The non-approved players are highlihted in the selection list: … … 172 173 == Changelog == 173 174 175 = 1.4.1 = 176 177 * dropdown lists for text fields 178 * some internal code optimizations 179 174 180 = 1.4.0 = 175 181 176 * Security issue fixed182 * security fix 177 183 178 184 = 1.3.0 = -
wp-tournament-registration/trunk/shortcodes/field.php
r3421476 r3422358 22 22 'field' => null, 23 23 'label' => null, 24 'options' => null, 24 25 'placeholder' => null, 25 26 'required' => null, … … 30 31 $label = '<label for="' . $field . '">' . ( empty ( $a[ 'label' ] ) ? $field : sanitize_text_field( $a[ 'label' ] ) ) . '</label>'; 31 32 $name=' name="' . $field . '"'; 33 $options = ( empty ( $a[ 'options' ] ) ) ? '' : preg_split( '/\s*,\s*/', sanitize_text_field( trim( $a[ 'options' ] ) ) ); 34 if ( is_array( $options ) ) { 35 $options = "autocomplete='off' data-field-suggestions='" . implode( ',', $options ) . "'"; 36 } 32 37 $placeholder = ( empty ( $a[ 'placeholder' ] ) ) ? '' : ' placeholder="' . esc_attr( trim( $a[ 'placeholder' ] ) ) . '"'; 33 38 $required = ( !isset( $a[ 'required' ] ) ) ? '' : ' required'; … … 66 71 else if ( preg_match( '/char|string|text/i', $scheme[ $field ] ) ) { 67 72 68 return "<p$id$class$css>$label<input$id$class$name$required$disabled$placeholder type='text' size='$bigsize'></p>";73 return "<p$id$class$css>$label<input$id$class$name$required$disabled$placeholder$options type='text' size='$bigsize'></p>"; 69 74 } 70 75 else if ( preg_match( '/bool|int\(1\)/i', $scheme[ $field ] ) ) { -
wp-tournament-registration/trunk/shortcodes/list.php
r2432703 r3422358 43 43 $scheme = wptournreg_get_field_list(); 44 44 45 $fields = preg_split( '/\s*,\s*/', $a[ 'display_fields' ]);46 $protected_fields = preg_split( '/\s*,\s*/', $a[ 'protected_fields' ]);45 $fields = preg_split( '/\s*,\s*/', sanitize_text_field( trim( $a[ 'display_fields' ] ) ) ); 46 $protected_fields = ( empty ( $a[ 'protected_fields' ] ) ) ? '' : preg_split( '/\s*,\s*/', sanitize_text_field( trim( $a[ 'protected_fields' ] ) ) ); 47 47 48 48 /* add custom CSS */ -
wp-tournament-registration/trunk/wp-tournament-registration.php
r3421476 r3422358 6 6 * Plugin Name: WP Tournament Registration 7 7 * Plugin URI: https://ingram-braun.net/erga/wp-tournament-registration-wordpress-plugin/ 8 * Version: 1.4. 08 * Version: 1.4.1 9 9 * Requires at least: 5.3 10 10 * Requires PHP: 7.0 … … 20 20 /* VERSIONS */ 21 21 define( "WP_TOURNREG_DB_VER", 5 ); 22 define( "WP_TOURNREG_PLUGIN_VER", '1.4. 0' );22 define( "WP_TOURNREG_PLUGIN_VER", '1.4.1' ); 23 23 define( "WP_TOURNREG_TBSORT_VER", '2.31.3' ); 24 24 … … 39 39 define( "WP_TOURNREG_TBSORTJS_URL", plugins_url( 'assets/jquery.tablesorter/js/jquery.tablesorter.min.js', __FILE__ ) ); 40 40 define( "WP_TOURNREG_TBSORTCSS_URL", plugins_url( 'assets/jquery.tablesorter/css/theme.default.min.css', __FILE__ ) ); 41 define( "WP_TOURNREG_DROPDOWNJS_URL", plugins_url( 'assets/suggestion-input-dropdown/jquery.input-dropdown.js', __FILE__ ) ); 42 define( "WP_TOURNREG_DROPDOWNCSS_URL", plugins_url( 'assets/suggestion-input-dropdown/jquery.input-dropdown.css', __FILE__ ) ); 43 41 44 42 45 /* TABLE NAME */ … … 69 72 require_once WP_TOURNREG_SHORTCODE_PATH . 'export.php'; 70 73 74 require_once WP_TOURNREG_ASSETS_PATH . 'input_dropdown.php'; 71 75 require_once WP_TOURNREG_ASSETS_PATH . 'tablesort.php'; 72 76 require_once WP_TOURNREG_ASSETS_PATH . 'load.php';
Note: See TracChangeset
for help on using the changeset viewer.