Changeset 2186089
- Timestamp:
- 11/05/2019 11:36:32 AM (6 years ago)
- Location:
- nacc-wordpress-plugin/trunk
- Files:
-
- 2 edited
-
nacc-wordpress-plugin.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nacc-wordpress-plugin/trunk/nacc-wordpress-plugin.php
r2185859 r2186089 4 4 Plugin URI: http://magshare.org/nacc 5 5 Description: This is a WordPress plugin implementation of the N.A. Cleantime Calculator. To use this, specify <!-- NACC --> or [[NACC]] in your text code. That text will be replaced with this cleantime calculator. 6 Version: 3.1. 26 Version: 3.1.3 7 7 Install: Drop this directory in the "wp-content/plugins/" directory and activate it. You need to specify "<!-- NACC -->" or "[[NACC]]" in the code section of a page or a post. 8 8 */ … … 28 28 function nacc_content ( $the_content ) 29 29 { 30 $shortcode_obj = explode(',', get_shortcode ( $the_content));31 30 $shortcode_obj = explode(',', html_entity_decode(get_shortcode ( $the_content ))); 31 32 32 if ( $shortcode_obj ) 33 33 { … … 36 36 $cc_text .= '<h1 style="text-align:center">JavaScript Required</h1>'; 37 37 $cc_text .= '<h2 style="text-align:center">Sadly, you must enable JavaScript on your browser in order to use this cleantime calculator.</h2>'; 38 $siteURI = '"'. esc_url ( plugins_url ( 'nacc2', __FILE__ )).'"';38 $siteURI = '"'.plugins_url ( 'nacc2', __FILE__ ).'"'; 39 39 40 40 if ( ($shortcode_obj !== true) && (!is_array ( $shortcode_obj )) ) … … 45 45 if ( is_array ( $shortcode_obj ) && (count ( $shortcode_obj ) > 0) ) 46 46 { 47 $theme = '"'.trim(strval ( $shortcode_obj[0] ), ' "').'"';47 $theme = '"'.trim(strval ( $shortcode_obj[0] ), '\'"').'"'; 48 48 $lang = '"en"'; 49 49 $layout = '"linear"'; … … 52 52 if ( count ( $shortcode_obj ) > 1 ) 53 53 { 54 $lang_temp = strval ( $shortcode_obj[1] );54 $lang_temp = '"'.trim(strval ( $shortcode_obj[1] ), '\'"').'"'; 55 55 56 56 if ( $lang_temp ) … … 62 62 if ( count ( $shortcode_obj ) > 2 ) 63 63 { 64 $layout = '"'. strval ( $shortcode_obj[2]).'"';64 $layout = '"'.trim(strval ( $shortcode_obj[2] ), '\'"').'"'; 65 65 } 66 66 67 67 if ( count ( $shortcode_obj ) > 3 ) 68 68 { 69 $showSpecial = $shortcode_obj[3] ? 'true' : 'false';69 $showSpecial = trim(strval ( $shortcode_obj[3] ), '\'"'); 70 70 } 71 71 72 $cc_text .= '</noscript><script type="text/javascript">var nacc = new NACC("nacc_container", '.$theme.', '.$lang.', '.$layout.', '.$showSpecial.', '.$siteURI.');</script>'."\n"; 72 73 } -
nacc-wordpress-plugin/trunk/readme.txt
r2185859 r2186089 4 4 Requires at least: 2.0 5 5 Tested up to: 5.2.4 6 Stable tag: 3.1. 26 Stable tag: 3.1.3 7 7 8 8 == Description == … … 17 17 2. Activate the plugin through the 'Plugins' menu in WordPress 18 18 3. Place `<!-- NACC -->`in the HTML view, or `[[NACC]]` in either view, of a page. It will be replaced by the plugin. 19 4. You can change how the plugin appears like so: `<!-- NACC( "THEME") -->`, where `THEME` is currently `NACC-BT` (Dark blue and white), or `NACC-GNYR2` (Light blue style customized for the Greater New York Region). Leave it out for default (gray).20 5. You can change the language like so: `<!-- NACC( "THEME","LANG") -->`, where `LANG` is currently `en` (English -Default), `es` (Spanish), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese), or `it` (Italian).21 6. You can specify which layout (vertical or horizontal) you want the tags to appear in by default, like so: `<!-- NACC( "THEME","LANG","LAYOUT") -->`, where `LAYOUT` is `linear` (default, in a long line), or `tabular` (In a horizontal row).22 7. You can specify whether or not the "special" tags are shown, like so: `<!-- NACC( "THEME","LANG","LAYOUT","SPECIAL") -->`, where `SPECIAL` is `true` or `false`.19 4. You can change how the plugin appears like so: `<!-- NACC(`THEME`) -->`, where `THEME` is currently `NACC-BT` (Dark blue and white), `NACC-GNYR2` (Light blue style customized for the Greater New York Region), or "NACC-HOLI" (Black and Red, customized for the Heart of Long Island ASC). Leave it out for default (gray). 20 5. You can change the language like so: `<!-- NACC(`THEME`,`LANG`) -->`, where `LANG` is currently `en` (English -Default), `es` (Spanish), `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional Chinese), or `it` (Italian). 21 6. You can specify which layout (vertical or horizontal) you want the tags to appear in by default, like so: `<!-- NACC(`THEME`,`LANG`,`LAYOUT`) -->`, where `LAYOUT` is `linear` (default, in a long line), or `tabular` (In a horizontal row). 22 7. You can specify whether or not the "special" tags are shown, like so: `<!-- NACC(`THEME`,`LANG`,`LAYOUT`,`SPECIAL`) -->`, where `SPECIAL` is `true` or `false`. 23 23 24 24 == Changelog == 25 26 Version 3.1.3- November 5, 2019 27 Fixed a bug in shortcode setup. 25 28 26 29 Version 3.1.2- November 4, 2019
Note: See TracChangeset
for help on using the changeset viewer.