Plugin Directory

Changeset 1111735


Ignore:
Timestamp:
03/13/2015 06:14:02 AM (11 years ago)
Author:
abooze
Message:

Fixed a major exploit. Tagged 4.0

Location:
ab-google-map-travel
Files:
9 added
4 edited

Legend:

Unmodified
Added
Removed
  • ab-google-map-travel/trunk/ab-google-map-travel.php

    r886394 r1111735  
    33  Plugin Name: AB Google Map Travel (AB-MAP)
    44  Plugin URI: http://wp.aboobacker.com
    5   Version: 3.4
     5  Version: 4.0
    66  Author: Aboobacker P Ummer
    77  Author URI: http://aboobacker.com
     
    99  Tags: Google Maps, Distance Calculator, Google Maps, Calculate Distance, Driving Directions, Google Travel, AB Google Map Travel, Abooze Map Plugin
    1010 */
    11 
    1211global $wp_version;
    13 
    1412// Wordppress Version Check
    1513if (version_compare($wp_version, '3.0', '<')) {
    1614    exit($exit_msg . " Please upgrade your wordpress.");
    1715}
    18 
     16//Accept only numeric values
     17function admin_scripts() {
     18if(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 } }
     32add_action('admin_head','admin_scripts');
    1933// Link javascript & css files
    2034function abinclude_files($lang) {
     
    2438    wp_enqueue_script('abdistance_calc_js', plugins_url('/js/ab-get-distance.js', __FILE__));
    2539}
    26 
    2740// Include files on page load
    2841add_action('init', 'abinclude_files');
    29 
    3042function map_onload($lat, $lng) {
    3143    $output = '';
     
    3547    echo $output;
    3648}
    37 
    3849function abdistance_calculator() {
    3950    $lat = get_option('latitude');
     
    4960 
    5061</script>
    51 
    5262<div id="abgdc-wrap">
    5363 <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 -->
     
    5868<td>To: </td><td><input type="text" name="place_to" class="txt" /></td>
    5969<td>Travel Time:
    60 
    6170<input type="radio" id="day_time" name="travel_time" value="day" checked="checked" /> Day
    6271<input type="radio" id="night_time" name="travel_time" value="night" /> Night
    63 
    6472</td>
    6573<br />
     
    6775<input type="hidden" value="'. get_option('zoom').'" id="map_zoom"/>
    6876<input type="hidden" value="'. get_option('curr_format').'" id="curr_format"/>
    69 
    7077</td>
    7178</tr>
     
    7582 <div id="steps"></div><!-- #steps -->
    7683</div><!-- #abgdc-wrap -->';?>
    77 
    7884<input type="hidden" value="<?php echo get_option('day_more_five_fare');?>" id="day_more_five" />
    7985<input type="hidden" value="<?php echo get_option('day_less_five_fare');?>" id="day_less_five" />
    80 
    8186<input type="hidden" value="<?php echo get_option('more_five_fare');?>" id="night_more_five" />
    8287<input type="hidden" value="<?php echo get_option('less_five_fare');?>" id="night_less_five" />
    83 
    84 
    8588<?php
    8689    return $result;
    8790}
    88 
    8991function ab_shortcode($atts) {
    9092    $result = abdistance_calculator();
    9193    return $result;
    9294}
    93 
    9495// Add [AB-MAP] shortcode
    9596add_shortcode("AB-MAP", "ab_shortcode");
    96 
    97 
    9897/* ==============================================================================
    9998 *
     
    101100 *
    102101  ============================================================================== */
    103 
    104102function ab_set_options() {
    105103    add_option('latitude', '9.93123', 'Default Latitude');
     
    116114    add_option('curr_format', '$', 'Currency format');
    117115}
    118 
    119116function ab_unset_options() {
    120117    delete_option('latitude');
     
    128125    delete_option('day_less_five_fare');
    129126    delete_option('day_more_five_fare');
    130 
    131127    delete_option('curr_format');
    132128}
    133 
    134129register_activation_hook(__FILE__, 'ab_set_options');
    135130register_deactivation_hook(__FILE__, 'ab_unset_options');
    136 
    137131function 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         <?php
     132<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
    149143        if ($_REQUEST['submit']) {
    150144            ab_update_options();
     
    152146        ab_print_options_form();
    153147        ?>
    154     </div>
    155     <?php
    156 }
    157 
     148</div>
     149<?php
     150}
    158151function ab_update_options() {
    159152    $lat = isset($_REQUEST['lat']) ? $_REQUEST['lat'] != "" ? $_REQUEST['lat'] : 9.93123  : 9.93123;
    160153    update_option('latitude', $lat);
    161 
    162154    $long = isset($_REQUEST['long']) ? $_REQUEST['long'] != "" ? $_REQUEST['long'] : 76.26730  : 76.26730;
    163155    update_option('longitude', $long);
    164 
    165156    $lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] != "" ? $_REQUEST['lang'] : 'en'  : 'en';
    166157    update_option('language', $lang);
    167 
    168158    $map_width = isset($_REQUEST['map_width']) ? $_REQUEST['map_width'] != "" ? $_REQUEST['map_width'] : 500  : 500;
    169159    update_option('map_width', $map_width);
    170 
    171160    $map_height = isset($_REQUEST['map_height']) ? $_REQUEST['map_height'] != "" ? $_REQUEST['map_height'] : 300  : 300;
    172161    update_option('map_height', $map_height);
     
    180169    $more_five_fare = isset($_REQUEST['more_five_fare']) ? $_REQUEST['more_five_fare'] != "" ? $_REQUEST['more_five_fare'] : 2.5  : 2.5;
    181170    update_option('more_five_fare', $more_five_fare);
    182 
    183171    $day_less_five_fare = isset($_REQUEST['day_less_five_fare']) ? $_REQUEST['day_less_five_fare'] != "" ? $_REQUEST['day_less_five_fare'] : 2  : 2;
    184172    update_option('day_less_five_fare', $day_less_five_fare);
     
    186174    $day_more_five_fare = isset($_REQUEST['day_more_five_fare']) ? $_REQUEST['day_more_five_fare'] != "" ? $_REQUEST['day_more_five_fare'] : 1.5  : 1.5;
    187175    update_option('day_more_five_fare', $day_more_five_fare);
    188 
    189176    $curr_format = isset($_REQUEST['curr_format']) ? $_REQUEST['curr_format'] != "" ? $_REQUEST['curr_format'] : '$'  : '$';
    190177    update_option('curr_format', $curr_format);
    191 
    192178    echo '<div id="message" class="updated fade"><p><strong>Options Saved...</strong></p></div>';
    193179}
    194 
    195180function ab_print_options_form() {
    196181    $default_latitude = get_option('latitude');
     
    204189    $default_day_less_five_fare = get_option('day_less_five_fare');
    205190    $default_day_more_five_fare = get_option('day_more_five_fare');
    206 
    207191    $default_curr_format = get_option('curr_format');
    208192   
    209193    ?>
    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}
    360351function add_menu_item() {
    361352    add_menu_page('AB-MAP Options', 'Google Map Travel', 'add_users','ab_map_options', 'ab_options_page', plugins_url('/images/icon.png', __FILE__));
    362353}
    363 
    364354add_action('admin_menu', 'add_menu_item');
    365355?>
  • ab-google-map-travel/trunk/css/styles.css

    r752142 r1111735  
    22    clear:both;
    33}
    4 
    54#abgdc-wrap
    65.abgdc-table{
     
    87    margin:20px 0px;
    98}
    10 
    119#abgdc-wrap
    1210.abgdc-table tr td{
     
    1513    float:left;
    1614}
    17 
    1815.abgdc-table
    1916.txt{
     
    2320    border:solid 1px #000;
    2421}
    25 
    2622#distance
    2723.distance-inner{
     
    3329    margin:0px 0px 10px 0px;
    3430}
    35 
    3631#steps
    3732.steps-inner{
     
    4338    margin:0px 0px 10px 0px;
    4439}
    45 
    4640#steps
    4741.steps-inner h2{
     
    5044    text-decoration:underline;
    5145}
    52 
    5346#steps
    5447.steps-inner ul li{
  • ab-google-map-travel/trunk/js/ab-get-distance.js

    r738271 r1111735  
    88   
    99    var zm =  parseInt(document.getElementById('map_zoom').value);
    10 
    1110    var myOptions = {
    1211 
     
    1817    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    1918    directionsDisplay.setMap(map);
    20 
    2119  }
    22 
    2320  function calcRoute(from,to){
    2421    var start = from;
     
    3532        return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
    3633    }
    37 
    3834    directionsService.route(request, function(response, status) {
    3935      if (status == google.maps.DirectionsStatus.OK) {
    4036        directionsDisplay.setDirections(response);
    41 
    4237        var distance = response.routes[0].legs[0].distance.text;
    4338        var time_taken = response.routes[0].legs[0].duration.text;
    4439               
    4540                var calc_distance = response.routes[0].legs[0].distance.value;
    46 
    4741               
    48 
    4942                if(document.getElementById('day_time').checked) {
    5043                    var less_five =  document.getElementById('day_less_five').value;
     
    5750                    var travel_time = 'Night';
    5851                }
    59 
    6052                var curr_format =  document.getElementById('curr_format').value;
    6153               
     
    6658                    var amount_to_pay = calc_distance * more_five;
    6759                }
    68 
    6960    function roundNumber(numbr,decimalPlaces)
    7061    {
     
    7667    var mi = mi/1000;
    7768    var mi = roundNumber(mi, 2);   //Sets value to 2 decimal places.
    78 
    7969               
    8070                var rounded_amount_to_pay = round(amount_to_pay/1000,2);
    81 
    8271        document.getElementById('distance').innerHTML = '<div class="distance-inner">'+ "The distance between <em>"+from+"</em> and <em>"+to+"</em>: <strong>"+distance+" / "+mi+ " mi</strong>\n\
    8372                <br/>\n\
     
    9988      }
    10089    });
    101 
    10290  }
    103 
    10491//window.onload=function(){initialize();}
  • ab-google-map-travel/trunk/readme.txt

    r886394 r1111735  
    44Tags: Google Maps, Distance Calculator, Google Maps, Calculate Distance, Driving Directions, Google Travel, AB Google Map Travel, Abooze Map Plugin
    55Requires at least: 3.0
    6 Tested up to: 3.8.1
    7 Stable tag: 3.4
    8 
     6Tested up to: 4.1.1
     7Stable tag: 4.0
    98This plugin will display the distance & driving direction between two points on earth.
    10 
    119== Description ==
    12 
    1310If 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.
    1411You can get the results of the plugin in any language supported by the google direction.
    15 
    1612<strong>Usage</strong>
    1713Add the following shortcode in the page:
    1814<code>[AB-MAP]</code>
    19 
    2015<p>Created By: Aboobacker P Ummer</p>
    2116<p>Email : mail@aboobacker.com</p>
    2217<p>Demo: http://wp.aboobacker.com/</p>
    23 
    2418== Installation ==
    25 
    26191. Upload the plugin to your /wp-content/plugins/ directory.
    27 
    28202. Activate the plugin through the 'Plugins' menu in WordPress.
    29 
    30213. 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 
    32224. Now place the [AB-MAP] shortcode on the post/page where you want the AB Google Map Travel to appear.
    33 
    34 
    3523== Frequently Asked Questions ==
    36 
    3724= What is the shortcode for inserting the plugin to Post/Page? =
    3825 You can use [AB-MAP]
    39 
    4026== Screenshots ==
    41 
    4227Coming soon.
    43 
    4428== Changelog ==
    45 
    4629= 1.0 =
    47 
    4830Released on 17/01/2012
    4931<ul>
    5032 <li>Initial release</li>
    5133</ul>
    52 
    5334= 1.1
    54 
    5535Released on 20/01/2012
    5636<ul>
    5737 <li>Added option to set different currency formats.</li>
    5838</ul>
    59 
    6039= 1.2=
    61 
    6240Released on 23/01/2012
    6341<ul>
    6442 <li>Fixed compatibility with IE versions.</li>
    6543</ul>
    66 
    6744= 2.1=
    68 
    6945Released on 15/08/2012
    7046<ul>
    7147 <li>Quick Fix</li>
    7248</ul>
    73 
    7449= 3.1=
    75 
    7650Released on 25/09/2012
    7751<ul>
     
    7953 <li>Display the distance in both Kms and Miles.</li>
    8054</ul>
    81 
    8255= 3.2=
    83 
    8456Released on 09/07/2013
    8557<ul>
     
    8759 <li>Demo URL updated.</li>
    8860</ul>
    89 
    9061= 3.3=
    91 
    9262Released on 06/08/2013
    9363<ul>
    9464 <li>Fixed a floating problem on most of the themes.</li>
    9565</ul>
    96 
    9766= 3.4=
    98 
    9967Released on 02/04/2014
    10068<ul>
    10169 <li>Fixed a small bug.</li>
    10270</ul>
     71
     72= 4.0=
     73Released 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.