Plugin Directory

Changeset 2185859


Ignore:
Timestamp:
11/04/2019 11:04:34 PM (6 years ago)
Author:
magblogapi
Message:

3.1.2
Fixes an old parsing issue, and adds full Italian support.

Location:
nacc-wordpress-plugin
Files:
183 added
2 edited

Legend:

Unmodified
Added
Removed
  • nacc-wordpress-plugin/trunk/nacc-wordpress-plugin.php

    r2185726 r2185859  
    44Plugin URI: http://magshare.org/nacc
    55Description: 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.1
     6Version: 3.1.2
    77Install: 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.
    88*/
     
    2828function nacc_content ( $the_content )
    2929    {
    30     $shortcode_obj = get_shortcode ( $the_content );
     30    $shortcode_obj = explode(',', get_shortcode ( $the_content ));
    3131   
    3232    if ( $shortcode_obj )
     
    3636        $cc_text .= '<h1 style="text-align:center">JavaScript Required</h1>';
    3737        $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 = get_option('siteurl').'/wp-content/plugins/nacc-wordpress-plugin/nacc2/';
     38        $siteURI = '"'.esc_url ( plugins_url ( 'nacc2', __FILE__ ) ).'"';
    3939       
    4040        if ( ($shortcode_obj !== true) && (!is_array ( $shortcode_obj )) )
     
    4545        if ( is_array ( $shortcode_obj ) && (count ( $shortcode_obj ) > 0) )
    4646            {
    47             $theme = trim(strval ( $shortcode_obj[0] ), '"');
    48             $lang = 0;
     47            $theme = '"'.trim(strval ( $shortcode_obj[0] ), '"').'"';
     48            $lang = '"en"';
    4949            $layout = '"linear"';
    5050            $showSpecial = 'true';
     
    5252            if ( count ( $shortcode_obj ) > 1 )
    5353                {
    54                 $lang = '"'.strval ( $shortcode_obj[1] ).'"';
     54                $lang_temp = strval ( $shortcode_obj[1] );
     55               
     56                if ( $lang_temp )
     57                    {
     58                    $lang = $lang_temp;
     59                    }
    5560                }
    5661           
     
    6469                $showSpecial = $shortcode_obj[3] ? 'true' : 'false';
    6570                }
    66            
    67             $cc_text .= '</noscript><script type="text/javascript">var nacc = new NACC("nacc_container", "'.$theme.'", '.$lang.', '.$layout.', '.$showSpecial.', "'.$siteURI.'");</script>'."\n";
     71            $cc_text .= '</noscript><script type="text/javascript">var nacc = new NACC("nacc_container", '.$theme.', '.$lang.', '.$layout.', '.$showSpecial.', '.$siteURI.');</script>'."\n";
    6872            }
    6973        else
    7074            {
    71             $cc_text .= '</noscript><script type="text/javascript">var nacc = new NACC("nacc_container", 0, 0, 0, 1, "'.$siteURI.'");</script>'."\n";
     75            $cc_text .= '</noscript><script type="text/javascript">var nacc = new NACC("nacc_container", 0, 0, 0, 1, '.$siteURI.');</script>'."\n";
    7276            }
    7377       
  • nacc-wordpress-plugin/trunk/readme.txt

    r2185726 r2185859  
    44Requires at least: 2.0
    55Tested up to: 5.2.4
    6 Stable tag: 3.1.1
     6Stable tag: 3.1.2
    77
    88== Description ==
     
    2424== Changelog ==
    2525
     26Version 3.1.2- November 4, 2019
     27    Fixed a bug in the image directory URI.
     28
    2629Version 3.1.1- November 4, 2019
    27     There was a bug in the Italian translation that was fixed..
     30    There was a bug in the Italian translation that was fixed.
    2831   
    2932Version 3.1.0- November 4, 2019
Note: See TracChangeset for help on using the changeset viewer.