Changeset 1111735
- Timestamp:
- 03/13/2015 06:14:02 AM (11 years ago)
- Location:
- ab-google-map-travel
- Files:
-
- 9 added
- 4 edited
-
tags/4.0 (added)
-
tags/4.0/ab-google-map-travel.php (added)
-
tags/4.0/css (added)
-
tags/4.0/css/styles.css (added)
-
tags/4.0/images (added)
-
tags/4.0/images/icon.png (added)
-
tags/4.0/js (added)
-
tags/4.0/js/ab-get-distance.js (added)
-
tags/4.0/readme.txt (added)
-
trunk/ab-google-map-travel.php (modified) (15 diffs)
-
trunk/css/styles.css (modified) (7 diffs)
-
trunk/js/ab-get-distance.js (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ab-google-map-travel/trunk/ab-google-map-travel.php
r886394 r1111735 3 3 Plugin Name: AB Google Map Travel (AB-MAP) 4 4 Plugin URI: http://wp.aboobacker.com 5 Version: 3.45 Version: 4.0 6 6 Author: Aboobacker P Ummer 7 7 Author URI: http://aboobacker.com … … 9 9 Tags: Google Maps, Distance Calculator, Google Maps, Calculate Distance, Driving Directions, Google Travel, AB Google Map Travel, Abooze Map Plugin 10 10 */ 11 12 11 global $wp_version; 13 14 12 // Wordppress Version Check 15 13 if (version_compare($wp_version, '3.0', '<')) { 16 14 exit($exit_msg . " Please upgrade your wordpress."); 17 15 } 18 16 //Accept only numeric values 17 function admin_scripts() { 18 if(isset($_GET['page']) && $_GET['page'] == 'ab_map_options' ) { 19 ?> 20 <script type="text/javascript"> 21 jQuery(document).ready(function(e) { 22 jQuery('#ab_sec_form input:text').not('#curr_format').keyup(function(){ 23 var this_field = jQuery(this).val(); 24 if (isNaN( this_field / 1) == true) { 25 alert('Value should be numeric'); 26 jQuery(this).val(''); 27 } 28 }); 29 }); 30 </script> 31 <?php } } 32 add_action('admin_head','admin_scripts'); 19 33 // Link javascript & css files 20 34 function abinclude_files($lang) { … … 24 38 wp_enqueue_script('abdistance_calc_js', plugins_url('/js/ab-get-distance.js', __FILE__)); 25 39 } 26 27 40 // Include files on page load 28 41 add_action('init', 'abinclude_files'); 29 30 42 function map_onload($lat, $lng) { 31 43 $output = ''; … … 35 47 echo $output; 36 48 } 37 38 49 function abdistance_calculator() { 39 50 $lat = get_option('latitude'); … … 49 60 50 61 </script> 51 52 62 <div id="abgdc-wrap"> 53 63 <div id="map_canvas" style="position: relative;width:' . get_option('map_width') . 'px;height:' . get_option('map_height') . 'px;margin:0px auto;border:solid 5px #003;" ></div><!-- #map_canvas --> … … 58 68 <td>To: </td><td><input type="text" name="place_to" class="txt" /></td> 59 69 <td>Travel Time: 60 61 70 <input type="radio" id="day_time" name="travel_time" value="day" checked="checked" /> Day 62 71 <input type="radio" id="night_time" name="travel_time" value="night" /> Night 63 64 72 </td> 65 73 <br /> … … 67 75 <input type="hidden" value="'. get_option('zoom').'" id="map_zoom"/> 68 76 <input type="hidden" value="'. get_option('curr_format').'" id="curr_format"/> 69 70 77 </td> 71 78 </tr> … … 75 82 <div id="steps"></div><!-- #steps --> 76 83 </div><!-- #abgdc-wrap -->';?> 77 78 84 <input type="hidden" value="<?php echo get_option('day_more_five_fare');?>" id="day_more_five" /> 79 85 <input type="hidden" value="<?php echo get_option('day_less_five_fare');?>" id="day_less_five" /> 80 81 86 <input type="hidden" value="<?php echo get_option('more_five_fare');?>" id="night_more_five" /> 82 87 <input type="hidden" value="<?php echo get_option('less_five_fare');?>" id="night_less_five" /> 83 84 85 88 <?php 86 89 return $result; 87 90 } 88 89 91 function ab_shortcode($atts) { 90 92 $result = abdistance_calculator(); 91 93 return $result; 92 94 } 93 94 95 // Add [AB-MAP] shortcode 95 96 add_shortcode("AB-MAP", "ab_shortcode"); 96 97 98 97 /* ============================================================================== 99 98 * … … 101 100 * 102 101 ============================================================================== */ 103 104 102 function ab_set_options() { 105 103 add_option('latitude', '9.93123', 'Default Latitude'); … … 116 114 add_option('curr_format', '$', 'Currency format'); 117 115 } 118 119 116 function ab_unset_options() { 120 117 delete_option('latitude'); … … 128 125 delete_option('day_less_five_fare'); 129 126 delete_option('day_more_five_fare'); 130 131 127 delete_option('curr_format'); 132 128 } 133 134 129 register_activation_hook(__FILE__, 'ab_set_options'); 135 130 register_deactivation_hook(__FILE__, 'ab_unset_options'); 136 137 131 function ab_options_page() { ?> 138 139 < div class="wrap">140 <table class="widefat" style="width: 600px;">141 <thead>142 <tr>143 <th colspan="2"><div class="icon32" id="icon-edit"></div><h2>AB Google Map Travel Options</h2></th>144 </tr>145 </thead>146 </table>147 <br/>148 <?php132 <div class="wrap"> 133 <table class="widefat" style="width: 600px;" > 134 <thead> 135 <tr> 136 <th colspan="2"><div class="icon32" id="icon-edit"></div> 137 <h2>AB Google Map Travel Options</h2></th> 138 </tr> 139 </thead> 140 </table> 141 <br/> 142 <?php 149 143 if ($_REQUEST['submit']) { 150 144 ab_update_options(); … … 152 146 ab_print_options_form(); 153 147 ?> 154 </div> 155 <?php 156 } 157 148 </div> 149 <?php 150 } 158 151 function ab_update_options() { 159 152 $lat = isset($_REQUEST['lat']) ? $_REQUEST['lat'] != "" ? $_REQUEST['lat'] : 9.93123 : 9.93123; 160 153 update_option('latitude', $lat); 161 162 154 $long = isset($_REQUEST['long']) ? $_REQUEST['long'] != "" ? $_REQUEST['long'] : 76.26730 : 76.26730; 163 155 update_option('longitude', $long); 164 165 156 $lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] != "" ? $_REQUEST['lang'] : 'en' : 'en'; 166 157 update_option('language', $lang); 167 168 158 $map_width = isset($_REQUEST['map_width']) ? $_REQUEST['map_width'] != "" ? $_REQUEST['map_width'] : 500 : 500; 169 159 update_option('map_width', $map_width); 170 171 160 $map_height = isset($_REQUEST['map_height']) ? $_REQUEST['map_height'] != "" ? $_REQUEST['map_height'] : 300 : 300; 172 161 update_option('map_height', $map_height); … … 180 169 $more_five_fare = isset($_REQUEST['more_five_fare']) ? $_REQUEST['more_five_fare'] != "" ? $_REQUEST['more_five_fare'] : 2.5 : 2.5; 181 170 update_option('more_five_fare', $more_five_fare); 182 183 171 $day_less_five_fare = isset($_REQUEST['day_less_five_fare']) ? $_REQUEST['day_less_five_fare'] != "" ? $_REQUEST['day_less_five_fare'] : 2 : 2; 184 172 update_option('day_less_five_fare', $day_less_five_fare); … … 186 174 $day_more_five_fare = isset($_REQUEST['day_more_five_fare']) ? $_REQUEST['day_more_five_fare'] != "" ? $_REQUEST['day_more_five_fare'] : 1.5 : 1.5; 187 175 update_option('day_more_five_fare', $day_more_five_fare); 188 189 176 $curr_format = isset($_REQUEST['curr_format']) ? $_REQUEST['curr_format'] != "" ? $_REQUEST['curr_format'] : '$' : '$'; 190 177 update_option('curr_format', $curr_format); 191 192 178 echo '<div id="message" class="updated fade"><p><strong>Options Saved...</strong></p></div>'; 193 179 } 194 195 180 function ab_print_options_form() { 196 181 $default_latitude = get_option('latitude'); … … 204 189 $default_day_less_five_fare = get_option('day_less_five_fare'); 205 190 $default_day_more_five_fare = get_option('day_more_five_fare'); 206 207 191 $default_curr_format = get_option('curr_format'); 208 192 209 193 ?> 210 <form method="post"> 211 <table class="widefat" style="width: 600px;" > 212 <thead> 213 <tr> 214 <th colspan="2">To configure the AB-MAP Plugin update the following values</th> 215 </tr> 216 </thead> 217 <tfoot> 218 <tr> 219 <th colspan="2"> </th> 220 </tr> 221 </tfoot> 222 <tbody> 223 <tr> 224 <td><label for="latitude">Latitude: </label></td> 225 <td><input type="text" name="lat" size="30" value="<?php echo $default_latitude; ?>" /> <small>Default latitudes for the google map</small></td> 226 </tr> 227 <tr> 228 <td><label for="longitude">Longitude: </label></td> 229 <td><input type="text" name="long" size="30" value="<?php echo $default_longitude; ?>" /> <small>Default longitudes for the google map</small></td> 230 </tr> 231 <tr> 232 <td><label for="language">Language: </label></td> 233 <td> 234 <select name="lang" value="<?php echo $default_language; ?>" > 235 <option value="ar" <?php echo ($default_language == "ar") ? 'selected="selected"' : ''; ?> >Arabic</option> 236 <option value="eu" <?php echo ($default_language == "eu") ? 'selected="selected"' : ''; ?> >Basque</option> 237 <option value="bg" <?php echo ($default_language == "bg") ? 'selected="selected"' : ''; ?> >Bulgarian</option> 238 <option value="ca" <?php echo ($default_language == "ca") ? 'selected="selected"' : ''; ?> >Catalan</option> 239 <option value="cs" <?php echo ($default_language == "cs") ? 'selected="selected"' : ''; ?> >Czech</option> 240 <option value="da" <?php echo ($default_language == "da") ? 'selected="selected"' : ''; ?> >Danish</option> 241 <option value="en" <?php echo ($default_language == "en") ? 'selected="selected"' : ''; ?> >English</option> 242 <option value="de" <?php echo ($default_language == "de") ? 'selected="selected"' : ''; ?> >German</option> 243 <option value="el" <?php echo ($default_language == "el") ? 'selected="selected"' : ''; ?> >Greek</option> 244 <option value="es" <?php echo ($default_language == "es") ? 'selected="selected"' : ''; ?> >Spanish</option> 245 <option value="fa" <?php echo ($default_language == "fa") ? 'selected="selected"' : ''; ?> >Farsi</option> 246 <option value="fi" <?php echo ($default_language == "fi") ? 'selected="selected"' : ''; ?> >Finnish</option> 247 <option value="fil" <?php echo ($default_language == "fil") ? 'selected="selected"' : ''; ?>>Filipino</option> 248 <option value="fr" <?php echo ($default_language == "fr") ? 'selected="selected"' : ''; ?> >French</option> 249 <option value="gl" <?php echo ($default_language == "gl") ? 'selected="selected"' : ''; ?> >Galician</option> 250 <option value="gu" <?php echo ($default_language == "gu") ? 'selected="selected"' : ''; ?> >Gujarati</option> 251 <option value="hi" <?php echo ($default_language == "hi") ? 'selected="selected"' : ''; ?> >Hindi</option> 252 <option value="hr" <?php echo ($default_language == "hr") ? 'selected="selected"' : ''; ?> >Croatian</option> 253 <option value="hu" <?php echo ($default_language == "hu") ? 'selected="selected"' : ''; ?> >Hungarian</option> 254 <option value="id" <?php echo ($default_language == "id") ? 'selected="selected"' : ''; ?> >Indonesian</option> 255 <option value="iw" <?php echo ($default_language == "iw") ? 'selected="selected"' : ''; ?> >Hebrew</option> 256 <option value="ja" <?php echo ($default_language == "ja") ? 'selected="selected"' : ''; ?> >Japanese</option> 257 <option value="kn" <?php echo ($default_language == "kn") ? 'selected="selected"' : ''; ?> >Kannada</option> 258 <option value="ko" <?php echo ($default_language == "ko") ? 'selected="selected"' : ''; ?> >Korean</option> 259 <option value="lt" <?php echo ($default_language == "lt") ? 'selected="selected"' : ''; ?> >Lithuanian</option> 260 <option value="lv" <?php echo ($default_language == "lv") ? 'selected="selected"' : ''; ?> >Latvian</option> 261 <option value="ml" <?php echo ($default_language == "ml") ? 'selected="selected"' : ''; ?> >Malayalam</option> 262 <option value="mr" <?php echo ($default_language == "mr") ? 'selected="selected"' : ''; ?> >Marathi</option> 263 <option value="nl" <?php echo ($default_language == "nl") ? 'selected="selected"' : ''; ?> >Dutch</option> 264 <option value="nn" <?php echo ($default_language == "nn") ? 'selected="selected"' : ''; ?> >Norwegian Nynorsk</option> 265 <option value="no" <?php echo ($default_language == "no") ? 'selected="selected"' : ''; ?> >Norwegian</option> 266 <option value="or" <?php echo ($default_language == "or") ? 'selected="selected"' : ''; ?> >Oriya</option> 267 <option value="pl" <?php echo ($default_language == "pl") ? 'selected="selected"' : ''; ?> >Polish</option> 268 <option value="pt" <?php echo ($default_language == "pt") ? 'selected="selected"' : ''; ?> >PortuguesE</option> 269 <option value="pt-BR" <?php echo ($default_language == "pt-BR") ? 'selected="selected"' : ''; ?> >Portuguese(Brazil)</option> 270 <option value="pt-PT" <?php echo ($default_language == "pt-PT") ? 'selected="selected"' : ''; ?> >Portuguese(Portugal)</option> 271 <option value="rm" <?php echo ($default_language == "rm") ? 'selected="selected"' : ''; ?> >Romansch</option> 272 <option value="ro" <?php echo ($default_language == "ro") ? 'selected="selected"' : ''; ?> >Romanian</option> 273 <option value="ru" <?php echo ($default_language == "ru") ? 'selected="selected"' : ''; ?> >Russian</option> 274 <option value="sk" <?php echo ($default_language == "sk") ? 'selected="selected"' : ''; ?> >Slovak</option> 275 <option value="sr" <?php echo ($default_language == "sr") ? 'selected="selected"' : ''; ?> >Serbian</option> 276 <option value="sv" <?php echo ($default_language == "sv") ? 'selected="selected"' : ''; ?> >Swedish</option> 277 <option value="tl" <?php echo ($default_language == "tl") ? 'selected="selected"' : ''; ?> >Tagalog</option> 278 <option value="ta" <?php echo ($default_language == "ta") ? 'selected="selected"' : ''; ?> >Tamil</option> 279 <option value="te" <?php echo ($default_language == "te") ? 'selected="selected"' : ''; ?> >Telugu</option> 280 <option value="th" <?php echo ($default_language == "th") ? 'selected="selected"' : ''; ?> >Thai</option> 281 <option value="tr" <?php echo ($default_language == "tr") ? 'selected="selected"' : ''; ?> >Turkish</option> 282 <option value="uk" <?php echo ($default_language == "uk") ? 'selected="selected"' : ''; ?> >Ukrainian</option> 283 <option value="vi" <?php echo ($default_language == "vi") ? 'selected="selected"' : ''; ?> >Vietnamese</option> 284 <option value="zh-CN" <?php echo ($default_language == "zh-CN") ? 'selected="selected"' : ''; ?> >Chinese (Simplified)</option> 285 <option value="zh-TW" <?php echo ($default_language == "zh-TW") ? 'selected="selected"' : ''; ?> >Chinese (Traditional)</option> 286 </select> <small>Default language for directions</small> 287 </td> 288 </tr> 289 <tr> 290 <td><label for="map_width">Map Width: </label></td> 291 <td><input type="text" name="map_width" size="30" value="<?php echo $default_map_width; ?>" /> <small>Default google map width</small></td> 292 </tr> 293 <tr> 294 <td><label for="map_height">Map Height: </label></td> 295 <td><input type="text" name="map_height" size="30" value="<?php echo $default_map_height; ?>" /> <small>Default google map height</small></td> 296 </tr> 297 <tr> 298 <td><label for="zoom">Map Zoom: </label></td> 299 <td><input type="text" name="zoom" size="30" value="<?php echo $default_zoom; ?>" /> <small>Default google map zoom</small></td> 300 </tr> 301 </tbody> 302 </table> 303 <br /> 304 305 <table class="widefat" style="width: 600px;" > 306 <thead> 307 <tr> 308 <th colspan="2"><strong>Day Time Charge: </strong> To configure the travel charges update the following values</th> 309 </tr> 310 </thead> 311 <tbody> 312 <tr> 313 <td><label for="day_less_five_fare">Charge: <5 kms: </label></td> 314 <td><input type="text" name="day_less_five_fare" size="30" value="<?php echo $default_day_less_five_fare; ?>" /> <small>Default charge for less than 5kms (Day time)</small></td> 315 </tr> 316 <tr> 317 <td><label for="day_more_five_fare">Charge: >5 kms: </label></td> 318 <td><input type="text" name="day_more_five_fare" size="30" value="<?php echo $default_day_more_five_fare; ?>" /> <small>Default charge for more than 5kms (Day time)</small></td> 319 </tr> 320 </tbody> 321 </table> 322 323 <table class="widefat" style="width: 600px;" > 324 <thead> 325 <tr> 326 <th colspan="2"><strong>Night Time Charge: </strong> To configure the travel charges update the following values</th> 327 </tr> 328 </thead> 329 <tfoot> 330 <tr> 331 <th colspan="2">Add <strong>[AB-MAP]</strong> shortcode to the post/page.</th> 332 </tr> 333 </tfoot> 334 <tbody> 335 <tr> 336 <td><label for="less_five_fare">Charge: <5 kms: </label></td> 337 <td><input type="text" name="less_five_fare" size="30" value="<?php echo $default_less_five_fare; ?>" /> <small>Default charge for less than 5kms (Night time)</small></td> 338 </tr> 339 <tr> 340 <td><label for="more_five_fare">Charge: >5 kms: </label></td> 341 <td><input type="text" name="more_five_fare" size="30" value="<?php echo $default_more_five_fare; ?>" /> <small>Default charge for more than 5kms (Night time)</small></td> 342 </tr> 343 <tr><td></td><td></td></tr> 344 <tr> 345 <td><label for="curr_format">Currency format: </label></td> 346 <td><input type="text" name="curr_format" size="30" value="<?php echo $default_curr_format; ?>" /> <small>Default currency format</small></td> 347 </tr> 348 349 <tr> 350 <td></td> 351 <td><input class="button-primary" type="submit" name="submit" value="Update Settings"/></td> 352 </tr> 353 </tbody> 354 </table> 355 356 </form> 357 <?php 358 } 359 194 <form method="post" id="ab_sec_form"> 195 <table class="widefat" style="width: 600px;" > 196 <thead> 197 <tr> 198 <th colspan="2">To configure the AB-MAP Plugin update the following values</th> 199 </tr> 200 </thead> 201 <tfoot> 202 <tr> 203 <th colspan="2"> </th> 204 </tr> 205 </tfoot> 206 <tbody> 207 <tr> 208 <td><label for="latitude">Latitude: </label></td> 209 <td><input type="text" name="lat" size="30" id="map_lat" value="<?php echo strip_tags($default_latitude); ?>" /> 210 <small>Default: 9.93123</small></td> 211 </tr> 212 <tr> 213 <td><label for="longitude">Longitude: </label></td> 214 <td><input type="text" name="long" size="30" id="map_long" value="<?php echo strip_tags($default_longitude); ?>" /> 215 <small>Default: 76.26730</small></td> 216 </tr> 217 <tr> 218 <td><label for="language">Language: </label></td> 219 <td><select name="lang" value="<?php echo $default_language; ?>" > 220 <option value="ar" <?php echo ($default_language == "ar") ? 'selected="selected"' : ''; ?> >Arabic</option> 221 <option value="eu" <?php echo ($default_language == "eu") ? 'selected="selected"' : ''; ?> >Basque</option> 222 <option value="bg" <?php echo ($default_language == "bg") ? 'selected="selected"' : ''; ?> >Bulgarian</option> 223 <option value="ca" <?php echo ($default_language == "ca") ? 'selected="selected"' : ''; ?> >Catalan</option> 224 <option value="cs" <?php echo ($default_language == "cs") ? 'selected="selected"' : ''; ?> >Czech</option> 225 <option value="da" <?php echo ($default_language == "da") ? 'selected="selected"' : ''; ?> >Danish</option> 226 <option value="en" <?php echo ($default_language == "en") ? 'selected="selected"' : ''; ?> >English</option> 227 <option value="de" <?php echo ($default_language == "de") ? 'selected="selected"' : ''; ?> >German</option> 228 <option value="el" <?php echo ($default_language == "el") ? 'selected="selected"' : ''; ?> >Greek</option> 229 <option value="es" <?php echo ($default_language == "es") ? 'selected="selected"' : ''; ?> >Spanish</option> 230 <option value="fa" <?php echo ($default_language == "fa") ? 'selected="selected"' : ''; ?> >Farsi</option> 231 <option value="fi" <?php echo ($default_language == "fi") ? 'selected="selected"' : ''; ?> >Finnish</option> 232 <option value="fil" <?php echo ($default_language == "fil") ? 'selected="selected"' : ''; ?>>Filipino</option> 233 <option value="fr" <?php echo ($default_language == "fr") ? 'selected="selected"' : ''; ?> >French</option> 234 <option value="gl" <?php echo ($default_language == "gl") ? 'selected="selected"' : ''; ?> >Galician</option> 235 <option value="gu" <?php echo ($default_language == "gu") ? 'selected="selected"' : ''; ?> >Gujarati</option> 236 <option value="hi" <?php echo ($default_language == "hi") ? 'selected="selected"' : ''; ?> >Hindi</option> 237 <option value="hr" <?php echo ($default_language == "hr") ? 'selected="selected"' : ''; ?> >Croatian</option> 238 <option value="hu" <?php echo ($default_language == "hu") ? 'selected="selected"' : ''; ?> >Hungarian</option> 239 <option value="id" <?php echo ($default_language == "id") ? 'selected="selected"' : ''; ?> >Indonesian</option> 240 <option value="iw" <?php echo ($default_language == "iw") ? 'selected="selected"' : ''; ?> >Hebrew</option> 241 <option value="ja" <?php echo ($default_language == "ja") ? 'selected="selected"' : ''; ?> >Japanese</option> 242 <option value="kn" <?php echo ($default_language == "kn") ? 'selected="selected"' : ''; ?> >Kannada</option> 243 <option value="ko" <?php echo ($default_language == "ko") ? 'selected="selected"' : ''; ?> >Korean</option> 244 <option value="lt" <?php echo ($default_language == "lt") ? 'selected="selected"' : ''; ?> >Lithuanian</option> 245 <option value="lv" <?php echo ($default_language == "lv") ? 'selected="selected"' : ''; ?> >Latvian</option> 246 <option value="ml" <?php echo ($default_language == "ml") ? 'selected="selected"' : ''; ?> >Malayalam</option> 247 <option value="mr" <?php echo ($default_language == "mr") ? 'selected="selected"' : ''; ?> >Marathi</option> 248 <option value="nl" <?php echo ($default_language == "nl") ? 'selected="selected"' : ''; ?> >Dutch</option> 249 <option value="nn" <?php echo ($default_language == "nn") ? 'selected="selected"' : ''; ?> >Norwegian Nynorsk</option> 250 <option value="no" <?php echo ($default_language == "no") ? 'selected="selected"' : ''; ?> >Norwegian</option> 251 <option value="or" <?php echo ($default_language == "or") ? 'selected="selected"' : ''; ?> >Oriya</option> 252 <option value="pl" <?php echo ($default_language == "pl") ? 'selected="selected"' : ''; ?> >Polish</option> 253 <option value="pt" <?php echo ($default_language == "pt") ? 'selected="selected"' : ''; ?> >PortuguesE</option> 254 <option value="pt-BR" <?php echo ($default_language == "pt-BR") ? 'selected="selected"' : ''; ?> >Portuguese(Brazil)</option> 255 <option value="pt-PT" <?php echo ($default_language == "pt-PT") ? 'selected="selected"' : ''; ?> >Portuguese(Portugal)</option> 256 <option value="rm" <?php echo ($default_language == "rm") ? 'selected="selected"' : ''; ?> >Romansch</option> 257 <option value="ro" <?php echo ($default_language == "ro") ? 'selected="selected"' : ''; ?> >Romanian</option> 258 <option value="ru" <?php echo ($default_language == "ru") ? 'selected="selected"' : ''; ?> >Russian</option> 259 <option value="sk" <?php echo ($default_language == "sk") ? 'selected="selected"' : ''; ?> >Slovak</option> 260 <option value="sr" <?php echo ($default_language == "sr") ? 'selected="selected"' : ''; ?> >Serbian</option> 261 <option value="sv" <?php echo ($default_language == "sv") ? 'selected="selected"' : ''; ?> >Swedish</option> 262 <option value="tl" <?php echo ($default_language == "tl") ? 'selected="selected"' : ''; ?> >Tagalog</option> 263 <option value="ta" <?php echo ($default_language == "ta") ? 'selected="selected"' : ''; ?> >Tamil</option> 264 <option value="te" <?php echo ($default_language == "te") ? 'selected="selected"' : ''; ?> >Telugu</option> 265 <option value="th" <?php echo ($default_language == "th") ? 'selected="selected"' : ''; ?> >Thai</option> 266 <option value="tr" <?php echo ($default_language == "tr") ? 'selected="selected"' : ''; ?> >Turkish</option> 267 <option value="uk" <?php echo ($default_language == "uk") ? 'selected="selected"' : ''; ?> >Ukrainian</option> 268 <option value="vi" <?php echo ($default_language == "vi") ? 'selected="selected"' : ''; ?> >Vietnamese</option> 269 <option value="zh-CN" <?php echo ($default_language == "zh-CN") ? 'selected="selected"' : ''; ?> >Chinese (Simplified)</option> 270 <option value="zh-TW" <?php echo ($default_language == "zh-TW") ? 'selected="selected"' : ''; ?> >Chinese (Traditional)</option> 271 </select> 272 <small>Default language for directions</small></td> 273 </tr> 274 <tr> 275 <td><label for="map_width">Map Width: </label></td> 276 <td><input type="text" name="map_width" size="30" id="map_width" value="<?php echo strip_tags($default_map_width); ?>" /> 277 <small>Default: 500</small></td> 278 </tr> 279 <tr> 280 <td><label for="map_height">Map Height: </label></td> 281 <td><input type="text" name="map_height" size="30" id="map_height" value="<?php echo strip_tags($default_map_height); ?>" /> 282 <small>Default: 300</small></td> 283 </tr> 284 <tr> 285 <td><label for="zoom">Map Zoom: </label></td> 286 <td><input type="text" name="zoom" size="30" id="map_zoom" value="<?php echo strip_tags($default_zoom); ?>" /> 287 <small>Default: 7</small></td> 288 </tr> 289 </tbody> 290 </table> 291 <br /> 292 <table class="widefat" style="width: 600px;" > 293 <thead> 294 <tr> 295 <th colspan="2"><strong>Day Time Charge: </strong> To configure the travel charges update the following values</th> 296 </tr> 297 </thead> 298 <tbody> 299 <tr> 300 <td><label for="day_less_five_fare">Charge: <5 kms: </label></td> 301 <td><input type="text" name="day_less_five_fare" size="30" value="<?php echo strip_tags($default_day_less_five_fare); ?>" /> 302 <small>Default: 2</small></td> 303 </tr> 304 <tr> 305 <td><label for="day_more_five_fare">Charge: >5 kms: </label></td> 306 <td><input type="text" name="day_more_five_fare" size="30" value="<?php echo strip_tags($default_day_more_five_fare); ?>" /> 307 <small>Default: 1.5</small></td> 308 </tr> 309 </tbody> 310 </table> 311 <table class="widefat" style="width: 600px;" > 312 <thead> 313 <tr> 314 <th colspan="2"><strong>Night Time Charge: </strong> To configure the travel charges update the following values</th> 315 </tr> 316 </thead> 317 <tfoot> 318 <tr> 319 <th colspan="2">Add <strong>[AB-MAP]</strong> shortcode to the post/page.</th> 320 </tr> 321 </tfoot> 322 <tbody> 323 <tr> 324 <td><label for="less_five_fare">Charge: <5 kms: </label></td> 325 <td><input type="text" name="less_five_fare" size="30" value="<?php echo strip_tags($default_less_five_fare); ?>" /> 326 <small>Default: 3</small></td> 327 </tr> 328 <tr> 329 <td><label for="more_five_fare">Charge: >5 kms: </label></td> 330 <td><input type="text" name="more_five_fare" size="30" value="<?php echo strip_tags($default_more_five_fare); ?>" /> 331 <small>Default: 2.5</small></td> 332 </tr> 333 <tr> 334 <td></td> 335 <td></td> 336 </tr> 337 <tr> 338 <td><label for="curr_format">Currency format: </label></td> 339 <td><input type="text" name="curr_format" id="curr_format" size="30" value="<?php echo strip_tags($default_curr_format); ?>" /> 340 <small>Default: $</small></td> 341 </tr> 342 <tr> 343 <td></td> 344 <td><input class="button-primary" type="submit" name="submit" value="Update Settings"/></td> 345 </tr> 346 </tbody> 347 </table> 348 </form> 349 <?php 350 } 360 351 function add_menu_item() { 361 352 add_menu_page('AB-MAP Options', 'Google Map Travel', 'add_users','ab_map_options', 'ab_options_page', plugins_url('/images/icon.png', __FILE__)); 362 353 } 363 364 354 add_action('admin_menu', 'add_menu_item'); 365 355 ?> -
ab-google-map-travel/trunk/css/styles.css
r752142 r1111735 2 2 clear:both; 3 3 } 4 5 4 #abgdc-wrap 6 5 .abgdc-table{ … … 8 7 margin:20px 0px; 9 8 } 10 11 9 #abgdc-wrap 12 10 .abgdc-table tr td{ … … 15 13 float:left; 16 14 } 17 18 15 .abgdc-table 19 16 .txt{ … … 23 20 border:solid 1px #000; 24 21 } 25 26 22 #distance 27 23 .distance-inner{ … … 33 29 margin:0px 0px 10px 0px; 34 30 } 35 36 31 #steps 37 32 .steps-inner{ … … 43 38 margin:0px 0px 10px 0px; 44 39 } 45 46 40 #steps 47 41 .steps-inner h2{ … … 50 44 text-decoration:underline; 51 45 } 52 53 46 #steps 54 47 .steps-inner ul li{ -
ab-google-map-travel/trunk/js/ab-get-distance.js
r738271 r1111735 8 8 9 9 var zm = parseInt(document.getElementById('map_zoom').value); 10 11 10 var myOptions = { 12 11 … … 18 17 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 19 18 directionsDisplay.setMap(map); 20 21 19 } 22 23 20 function calcRoute(from,to){ 24 21 var start = from; … … 35 32 return Math.round(number*Math.pow(10,X))/Math.pow(10,X); 36 33 } 37 38 34 directionsService.route(request, function(response, status) { 39 35 if (status == google.maps.DirectionsStatus.OK) { 40 36 directionsDisplay.setDirections(response); 41 42 37 var distance = response.routes[0].legs[0].distance.text; 43 38 var time_taken = response.routes[0].legs[0].duration.text; 44 39 45 40 var calc_distance = response.routes[0].legs[0].distance.value; 46 47 41 48 49 42 if(document.getElementById('day_time').checked) { 50 43 var less_five = document.getElementById('day_less_five').value; … … 57 50 var travel_time = 'Night'; 58 51 } 59 60 52 var curr_format = document.getElementById('curr_format').value; 61 53 … … 66 58 var amount_to_pay = calc_distance * more_five; 67 59 } 68 69 60 function roundNumber(numbr,decimalPlaces) 70 61 { … … 76 67 var mi = mi/1000; 77 68 var mi = roundNumber(mi, 2); //Sets value to 2 decimal places. 78 79 69 80 70 var rounded_amount_to_pay = round(amount_to_pay/1000,2); 81 82 71 document.getElementById('distance').innerHTML = '<div class="distance-inner">'+ "The distance between <em>"+from+"</em> and <em>"+to+"</em>: <strong>"+distance+" / "+mi+ " mi</strong>\n\ 83 72 <br/>\n\ … … 99 88 } 100 89 }); 101 102 90 } 103 104 91 //window.onload=function(){initialize();} -
ab-google-map-travel/trunk/readme.txt
r886394 r1111735 4 4 Tags: Google Maps, Distance Calculator, Google Maps, Calculate Distance, Driving Directions, Google Travel, AB Google Map Travel, Abooze Map Plugin 5 5 Requires at least: 3.0 6 Tested up to: 3.8.1 7 Stable tag: 3.4 8 6 Tested up to: 4.1.1 7 Stable tag: 4.0 9 8 This plugin will display the distance & driving direction between two points on earth. 10 11 9 == Description == 12 13 10 If you are a taxi provider, make your customers allow to calculate their travel distance from source to destination, fare with different charges for day and night travels. 14 11 You can get the results of the plugin in any language supported by the google direction. 15 16 12 <strong>Usage</strong> 17 13 Add the following shortcode in the page: 18 14 <code>[AB-MAP]</code> 19 20 15 <p>Created By: Aboobacker P Ummer</p> 21 16 <p>Email : mail@aboobacker.com</p> 22 17 <p>Demo: http://wp.aboobacker.com/</p> 23 24 18 == Installation == 25 26 19 1. Upload the plugin to your /wp-content/plugins/ directory. 27 28 20 2. Activate the plugin through the 'Plugins' menu in WordPress. 29 30 21 3. In the Wordpress admin panel, you can see the menu named "Google Map Travel". Go to this page and set the parameters according to your requirements. 31 32 22 4. Now place the [AB-MAP] shortcode on the post/page where you want the AB Google Map Travel to appear. 33 34 35 23 == Frequently Asked Questions == 36 37 24 = What is the shortcode for inserting the plugin to Post/Page? = 38 25 You can use [AB-MAP] 39 40 26 == Screenshots == 41 42 27 Coming soon. 43 44 28 == Changelog == 45 46 29 = 1.0 = 47 48 30 Released on 17/01/2012 49 31 <ul> 50 32 <li>Initial release</li> 51 33 </ul> 52 53 34 = 1.1 54 55 35 Released on 20/01/2012 56 36 <ul> 57 37 <li>Added option to set different currency formats.</li> 58 38 </ul> 59 60 39 = 1.2= 61 62 40 Released on 23/01/2012 63 41 <ul> 64 42 <li>Fixed compatibility with IE versions.</li> 65 43 </ul> 66 67 44 = 2.1= 68 69 45 Released on 15/08/2012 70 46 <ul> 71 47 <li>Quick Fix</li> 72 48 </ul> 73 74 49 = 3.1= 75 76 50 Released on 25/09/2012 77 51 <ul> … … 79 53 <li>Display the distance in both Kms and Miles.</li> 80 54 </ul> 81 82 55 = 3.2= 83 84 56 Released on 09/07/2013 85 57 <ul> … … 87 59 <li>Demo URL updated.</li> 88 60 </ul> 89 90 61 = 3.3= 91 92 62 Released on 06/08/2013 93 63 <ul> 94 64 <li>Fixed a floating problem on most of the themes.</li> 95 65 </ul> 96 97 66 = 3.4= 98 99 67 Released on 02/04/2014 100 68 <ul> 101 69 <li>Fixed a small bug.</li> 102 70 </ul> 71 72 = 4.0= 73 Released on 12/03/2015 74 <ul> 75 <li>Fixed a major vulnerability.</li> 76 </ul>
Note: See TracChangeset
for help on using the changeset viewer.