Plugin Directory

Changeset 522040


Ignore:
Timestamp:
03/22/2012 02:33:14 AM (14 years ago)
Author:
WhiteCubes
Message:

Added new config parameter to force script presence

Location:
worldcurrency/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • worldcurrency/trunk/readme.txt

    r517155 r522040  
    55Requires at least: 2.8.0
    66Tested up to: 3.3.1
    7 Stable tag: 1.10
     7Stable tag: 1.11
    88
    99Recognises users by IP address and shows them converted values in their local currency, you can write post/pages in multiple currencies.
     
    8787Feel free to propose them.
    8888
     89=I use the shortcode in another plugin (like wp-table-reloaded) and the convesions are not working=
     90This is because in this cases the WorldCurrency plugin is not aware of the presence of these conversions and the necessary code is not loaded.
     91You can add a wc_force = 1 custom field to posts or pages to force the loading of the necessary code in this cases.
     92
    8993== Screenshots ==
    9094There are no screenshots for this plugin, but there is a full demo on the [Plugin's Homepage](http://www.cometicucinoilweb.it/blog/en/worldcurrency-plugin-for-wordpress/)
    9195
    9296== Changelog ==
     97
     98= 1.11 (22 March 2012) =
     99* Added: new configuration parameter to force the script presence on every page
    93100
    94101= 1.10 (10 March 2012) =
  • worldcurrency/trunk/worldcurrency-admin.php

    r512360 r522040  
    2626            $dt_wc_options['bottom_select']         = isset($_POST['bottom_select']) ? 'true' : 'false';
    2727            $dt_wc_options['include_jquery']        = isset($_POST['include_jquery']) ? 'true' : 'false';
     28            $dt_wc_options['include_always']        = isset($_POST['include_always']) ? 'true' : 'false';
    2829            $dt_wc_options['jquery_no_conflict']    = isset($_POST['jquery_no_conflict']) ? 'true' : 'false';
    2930            $dt_wc_options['ajax_over_ssl']         = isset($_POST['ajax_over_ssl']) ? 'true' : 'false';
     
    179180                        <p>
    180181                            <h4>
     182                                Always include the script:
     183                                <input type="checkbox" name="include_always" id="include_always" <?php if ($dt_wc_options['include_always']=='true') {echo 'checked="checked"';}?> />
     184                            </h4>
     185                            Always include the script in the page. Usefull if you want to use the currency conversions also in other parts than pages/posts. (in pages/posts you can force the script presence with a wc_force=1 custom fiels)
     186                        </p>
     187                       
     188                        <p>
     189                            <h4>
    181190                                Ajax over SSL:
    182191                                <input type="checkbox" name="ajax_over_ssl" id="ajax_over_ssl" <?php if ($dt_wc_options['ajax_over_ssl']=='true') {echo 'checked="checked"';}?> />
  • worldcurrency/trunk/worldcurrency.php

    r517155 r522040  
    44Plugin URI: http://www.cometicucinoilweb.it/blog/en/worldcurrency-plugin-for-wordpress/
    55Description: Recognises users by IP address and shows them converted values in their local currency, you can write post/pages in multiple currencies.
    6 Version: 1.10
    7 Date: 10 March 2012
     6Version: 1.11
     7Date: 22 March 2012
    88Author: Daniele Tieghi
    99Author URI: http://www.cometicucinoilweb.it/blog/chi-siamo/daniele-tieghi/
     
    7070            if ($force || !isset($dt_wc_options['bottom_select']))          $dt_wc_options['bottom_select'] = 'true';
    7171            if ($force || !isset($dt_wc_options['include_jquery']))         $dt_wc_options['include_jquery'] = 'true';
     72            if ($force || !isset($dt_wc_options['include_always']))         $dt_wc_options['include_always'] = 'false';
    7273            if ($force || !isset($dt_wc_options['jquery_no_conflict']))     $dt_wc_options['jquery_no_conflict'] = 'false';
    7374            if ($force || !isset($dt_wc_options['ajax_over_ssl']))          $dt_wc_options['ajax_over_ssl'] = 'false';
     
    106107           
    107108            // Include the script only if necessary
    108             if (get_post_meta($post->ID, 'wc_force', true) == 1 || strpos($post->post_content, 'worldcurrency') !== false) {
     109            if ($dt_wc_options['include_always'] == 'true' || get_post_meta($post->ID, 'wc_force', true) == 1 || strpos($post->post_content, 'worldcurrency') !== false) {
    109110               
    110111                $usercurrency = dt_wc_userlocation();
Note: See TracChangeset for help on using the changeset viewer.