Changeset 508782
- Timestamp:
- 02/22/2012 11:18:15 AM (14 years ago)
- Location:
- worldcurrency/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (2 diffs)
-
worldcurrency-admin.php (modified) (3 diffs)
-
worldcurrency.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
worldcurrency/trunk/readme.txt
r508115 r508782 5 5 Requires at least: 2.8.0 6 6 Tested up to: 3.3.1 7 Stable tag: 1. 57 Stable tag: 1.6 8 8 9 9 Recognises users by IP address and shows them converted values in their local currency, you can write post/pages in multiple currencies. … … 86 86 == Changelog == 87 87 88 = 1.6 (22th February 2012) = 89 * Added option to use a jQuery.noconflict to increase compatibility with other themes/plugins 90 88 91 = 1.5 (21th February 2012) = 89 92 * Hides the widget if no currency on page/post -
worldcurrency/trunk/worldcurrency-admin.php
r507825 r508782 15 15 if (isset($_POST['dt_wc_options_submit']) && check_admin_referer('worldcurrency_admin_page_submit')) { 16 16 17 $dt_wc_options['historic_rates'] = isset($_POST['historic_rates']) ? 'true' : 'false'; 18 $dt_wc_options['hide_if_same'] = isset($_POST['hide_if_same']) ? 'true' : 'false'; 19 $dt_wc_options['plugin_link'] = isset($_POST['plugin_link']) ? 'true' : 'false'; 20 $dt_wc_options['yahoo_link'] = isset($_POST['yahoo_link']) ? 'true' : 'false'; 21 $dt_wc_options['plugin_priority'] = absint($_POST['plugin_priority']); 22 $dt_wc_options['output_format'] = $_POST['output_format']; 23 $dt_wc_options['additional_css'] = $_POST['additional_css']; 24 $dt_wc_options['bottom_select'] = isset($_POST['bottom_select']) ? 'true' : 'false'; 25 $dt_wc_options['include_jquery'] = isset($_POST['include_jquery']) ? 'true' : 'false'; 17 $dt_wc_options['historic_rates'] = isset($_POST['historic_rates']) ? 'true' : 'false'; 18 $dt_wc_options['hide_if_same'] = isset($_POST['hide_if_same']) ? 'true' : 'false'; 19 $dt_wc_options['plugin_link'] = isset($_POST['plugin_link']) ? 'true' : 'false'; 20 $dt_wc_options['yahoo_link'] = isset($_POST['yahoo_link']) ? 'true' : 'false'; 21 $dt_wc_options['plugin_priority'] = absint($_POST['plugin_priority']); 22 $dt_wc_options['output_format'] = $_POST['output_format']; 23 $dt_wc_options['additional_css'] = $_POST['additional_css']; 24 $dt_wc_options['bottom_select'] = isset($_POST['bottom_select']) ? 'true' : 'false'; 25 $dt_wc_options['include_jquery'] = isset($_POST['include_jquery']) ? 'true' : 'false'; 26 $dt_wc_options['jquery_no_conflict'] = isset($_POST['jquery_no_conflict']) ? 'true' : 'false'; 26 27 27 28 update_option('dt_wc_options', $dt_wc_options); … … 123 124 </p> 124 125 125 126 126 <p> 127 127 <h4> … … 130 130 </h4> 131 131 This plugin uses and includes jQuery, if you already have jQuery included in your blog pages (by theme or other plugins), you may want to disable this. 132 </p> 133 134 <p> 135 <h4> 136 jQuery no conflict: 137 <input type="checkbox" name="jquery_no_conflict" id="jquery_no_conflict" <?php if ($dt_wc_options['jquery_no_conflict']=='true') {echo 'checked="checked"';}?> /> 138 </h4> 139 Uses "jQuery" instead of "$" for calling jQuery functions. Usefull also if you have a noconflict version of jQuery included by other themes/plugins 132 140 </p> 133 141 -
worldcurrency/trunk/worldcurrency.php
r508115 r508782 4 4 Plugin URI: http://www.cometicucinoilweb.it/blog/en/worldcurrency-plugin-for-wordpress/ 5 5 Description: 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. 56 Version: 1.6 7 7 Date: 21th February 2012 8 8 Author: Daniele Tieghi … … 62 62 if ($force || !isset($dt_wc_options['bottom_select'])) $dt_wc_options['bottom_select'] = 'true'; 63 63 if ($force || !isset($dt_wc_options['include_jquery'])) $dt_wc_options['include_jquery'] = 'true'; 64 if ($force || !isset($dt_wc_options['jquery_no_conflict'])) $dt_wc_options['jquery_no_conflict'] = 'false'; 64 65 if ($force || !isset($dt_wc_options['plugin_priority'])) $dt_wc_options['plugin_priority'] = 10; 65 66 if ($force || !isset($dt_wc_options['additional_css'])) $dt_wc_options['additional_css'] = <<<EOT … … 93 94 $dt_wc_options = get_option('dt_wc_options'); 94 95 96 $jQuerySymbol = $dt_wc_options['jquery_no_conflict'] == 'true' ? 'jQuery' : '$'; 97 95 98 // Include the script only if necessary 96 99 if (strpos($post->post_content, 'worldcurrency') !== false) { … … 108 111 <script type="text/javascript"> 109 112 <!-- 113 114 <?php if ($dt_wc_options['jquery_no_conflict'] == 'true'): ?> 115 jQuery.noConflict(); 116 <?php endif; ?> 110 117 111 118 dt_worldCurrency_update = function(userCurrency) { 112 119 // For each worldcurrency <span> get the value 113 $('.worldcurrency').each(function() {114 115 var theSpan = $(this);116 $.ajax({120 <?php echo $jQuerySymbol; ?>('.worldcurrency').each(function() { 121 122 var theSpan = <?php echo $jQuerySymbol; ?>(this); 123 <?php echo $jQuerySymbol; ?>.ajax({ 117 124 url: '<?php echo wp_nonce_url(plugins_url(dirname(plugin_basename(__FILE__))).'/_getexchangerate.php', 'worldcurrency_safe'); ?>', 118 125 dataType: 'html', … … 129 136 130 137 // For each Currency selection box, chose the right value 131 $('.worldcurrency_select').val(userCurrency);138 <?php echo $jQuerySymbol; ?>('.worldcurrency_select').val(userCurrency); 132 139 133 140 } 134 141 135 142 // When the page is loaded 136 $(document).ready(function() {143 <?php echo $jQuerySymbol; ?>(document).ready(function() { 137 144 138 145 // Register already rendere currency selection boxes 139 $('.worldcurrency_select').change(function() {140 dt_worldCurrency_update( $(this).attr('value'));146 <?php echo $jQuerySymbol; ?>('.worldcurrency_select').change(function() { 147 dt_worldCurrency_update(<?php echo $jQuerySymbol; ?>(this).attr('value')); 141 148 }); 142 149 143 150 // Render Currency selection boxes 144 $('.worldcurrency_selection_box_placeholder').each(function() {145 146 var theDiv = $(this);147 $.ajax({151 <?php echo $jQuerySymbol; ?>('.worldcurrency_selection_box_placeholder').each(function() { 152 153 var theDiv = <?php echo $jQuerySymbol; ?>(this); 154 <?php echo $jQuerySymbol; ?>.ajax({ 148 155 url: '<?php echo wp_nonce_url(plugins_url(dirname(plugin_basename(__FILE__))).'/_getcurrencyselectionbox.php', 'worldcurrency_safe'); ?>', 149 156 dataType: 'html', … … 158 165 // On change update currency 159 166 theSelect.change(function() { 160 dt_worldCurrency_update( $(this).attr('value'));167 dt_worldCurrency_update(<?php echo $jQuerySymbol; ?>(this).attr('value')); 161 168 }); 162 169 },
Note: See TracChangeset
for help on using the changeset viewer.