Plugin Directory

Changeset 1006992


Ignore:
Timestamp:
10/14/2014 02:39:30 AM (11 years ago)
Author:
mikelynn
Message:

Updated for WP4
Added country_flag shortcode

Location:
wpgeocode
Files:
612 added
2 edited

Legend:

Unmodified
Added
Removed
  • wpgeocode/trunk/readme.txt

    r735090 r1006992  
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GDQD948MQ3G3G
    55Tags: geocode, geocode filter, geotag, geomarketing, geomarking, geolocation, geofilter, location, local marketing, keywords
    6 Version: 1.0.11
     6Version: 1.0.13
    77Requires at least: 3.0
    8 Tested up to: 3.2.4
    9 Stable tag: 3.2
     8Tested up to: 4.0
     9Stable tag: 4
    1010
    1111== Description ==
     
    2626* [wpgc_country_name] - Country name of the reader
    2727* [wpgc_country_code] - Two letter Country code of the reader
     28* [wpgc_country_flag] - Display the country flag of the reader
    2829* [wpgc_latitude] - Latitude of the reader
    2930* [wpgc_longitude] - Latitude of the reader
     
    8788
    8889== Change Log ==
     90= 1.0.13 =
     91* Updated GeoLite City and testing on WP 4
    8992
    9093= 1.0.12 =
     
    166169= 1.0.12 =
    167170* Fixed missing requirement
     171
     172= 1.0.13 =
     173* Updated for WP 4
  • wpgeocode/trunk/wpgeocode.php

    r735090 r1006992  
    55Tags: geocode, geotagging, geolocation, geotags, latitude, longitude, city, state, geomarketing, geolocation marketing
    66Description: Use WPGeocode to customize the content of your blog based on the location of your readers.
    7 Version: 1.0.12
     7Version: 1.0.13
    88Author: Michael Lynn
    99Author URI: http://www.mlynn.org/
     
    1212
    1313if ( ! defined( 'ABSPATH' ) )
    14         die( "Can't load this file directly" );
     14        die( "Can't load this file directly" ); 
    1515
    1616register_activation_hook(__FILE__, 'wpgc_add_defaults');
     
    3434}
    3535$log = new logfile();
    36 // $log->write("test");
    37 
     36//$log->write("test");
     37
     38function wpgc_shortcode_country_flag($atts, $content="") {
     39    return do_shortcode(wpgc_conditional_shortcode($atts,$content,'country_flag'));
     40}
    3841function wpgc_country_list($atts, $content="") {
    3942    return wpgc_list_all_countries();
     
    196199                'cities' => '',
    197200                'city' => '',
     201                'height' => '',
     202                'width' => '',
    198203                'miles' => '',
    199             'kilometers' => ''
     204        'kilometers' => ''
    200205        ), $atts));
    201206        $user_ip = wpgc_get_ip_address();
     
    335340            }
    336341            break;
     342        case 'country_flag':
     343            $images_path= plugins_url( 'images' , __FILE__ );
     344            if ($atts['country']) {
     345                $country=strtolower($atts['country_code']);
     346            } else {
     347                $country=strtolower($user_country_code);
     348            }
     349            if ($atts['height'] || $atts['width']) {
     350                $img = "<img src='$images_path/flags/normal/" . $country  . ".png' height='".$atts['height']. "' width='". $atts['width'] ."'>";
     351            } else {
     352                if (!$options['txt_flag_height'] && !$options['txt_flag_width']) {
     353                    $img = ".<img src='$images_path/flags/normal/" . strtolower($user_country_code) . ".png'>";
     354                } else {
     355                    $img = "<img src='$images_path" . strtolower($user_country_code) . ".png'>";
     356                }
     357            }
     358            return $img;
     359            break;
    337360        case 'is_within':
    338361            if (!$options['txt_home_latitude'] && !$options['txt_home_longitude']) {
     
    502525
    503526add_shortcode("wpgc_country_list", "wpgc_country_list");
     527add_shortcode("wpgc_country_flag", "wpgc_shortcode_country_flag");
    504528add_shortcode("wpgc_env", "wpgc_shortcode_env");
    505529add_shortcode("wpgc_database_date", "wpgc_shortcode_database_date");
     
    629653<li> [wpgc_country_name] - Country name of the reader
    630654<li> [wpgc_country_code] - Two letter Country code of the reader
     655<li> [wpgc_country_flag] - Image of the flag for the reader's country
    631656<li> [wpgc_latitude] - Latitude of the reader
    632657<li> [wpgc_longitude] - Latitude of the reader
     
    923948    $input['txt_def_latitude'] = wp_filter_nohtml_kses($input['txt_def_latitude']);
    924949    $input['txt_def_longitude'] = wp_filter_nohtml_kses($input['txt_def_longitude']);
     950    $input['txt_flag_height'] = wp_filter_nohtml_kses($input['txt_flag_height']);
     951    $input['txt_flag_width'] = wp_filter_nohtml_kses($input['txt_flag_width']);
    925952    return $input;
    926953}
Note: See TracChangeset for help on using the changeset viewer.