Plugin Directory

Changeset 621687


Ignore:
Timestamp:
11/06/2012 02:17:44 PM (13 years ago)
Author:
vicchi
Message:

Committing v1.2.0 changes

Location:
wp-quadratum/trunk
Files:
9 added
16 edited

Legend:

Unmodified
Added
Removed
  • wp-quadratum/trunk/includes/wp-quadratum-admin.php

    r580206 r621687  
    55 */
    66
    7 class WP_QuadratumAdmin extends WP_PluginBase {
     7class WP_QuadratumAdmin extends WP_PluginBase_v1_1 {
    88    private $mxn;
    99   
     
    1515   
    1616    function __construct () {
    17         $this->mxn = new WP_MXNHelper;
     17        $this->mxn = new WP_MXNHelper_v2_0;
    1818       
    1919        self::$tab_names = array (
     
    8585            wp_enqueue_script ('jquery');
    8686            $deps = array ('jquery');
    87             wp_enqueue_script ('wp-quadratum-admin-script', WPQUADRATUM_URL . 'js/wp-quadratum-admin.min.js', $deps);
    88             //wp_enqueue_script ('wp-quadratum-admin-script', WPQUADRATUM_URL . 'js/wp-quadratum-admin.js', $deps);
     87           
     88            if (WP_DEBUG || WPQUADRATUM_DEBUG) {
     89                $js_url = 'js/wp-quadratum-admin.js';
     90            }
     91           
     92            else {
     93                $js_url = 'js/wp-quadratum-admin.min.js';
     94            }
     95           
     96            wp_enqueue_script ('wp-quadratum-admin-script', WPQUADRATUM_URL . $js_url, $deps);
    8997        }
    9098    }
     
    103111            wp_enqueue_style ('global');
    104112            wp_enqueue_style ('wp-admin');
    105             wp_enqueue_style ('wp-quadratum-admin', WPQUADRATUM_URL . 'css/wp-quadratum-admin.min.css');
    106             //wp_enqueue_style ('wp-quadratum-admin',   WPQUADRATUM_URL . 'css/wp-quadratum-admin.css');
     113           
     114            if (WP_DEBUG || WPQUADRATUM_DEBUG) {
     115                $css_url = 'css/wp-quadratum-admin.css';
     116            }
     117           
     118            else {
     119                $css_url = 'css/wp-quadratum-admin.min.css';
     120            }
     121           
     122            wp_enqueue_style ('wp-quadratum-admin', WPQUADRATUM_URL . $css_url);
    107123        }
    108124    }
     
    186202                    $this->admin_upgrade_option ($options, 'cloudmade_key', '');
    187203               
     204                case '120':
    188205                    $options['version'] = WP_Quadratum::VERSION;
    189206                    $upgrade_settings = true;
     
    224241       
    225242        $tab = $this->admin_validate_tab ();
    226         $providers = WP_MXNHelper::get_supported_providers ();
     243        $providers = $this->mxn->get_supported_providers ();
    227244       
    228245        switch ($tab) {
     
    390407                        $client_secret = $options['client_secret'];
    391408                        $redirect_url = WP_Quadratum::make_redirect_url ();
    392                         $fh = new FoursquareHelper ($client_id, $client_secret, $redirect_url);
     409                        $fh = new FoursquareHelper_v1_0 ($client_id, $client_secret, $redirect_url);
    393410                        $foursquare_settings[] = '<p class="submit">'
    394411                            . '<a href="' . $fh->authentication_link () . '" class="button-primary">'
     
    647664            . '</li>'
    648665            . '<li>'
    649             . __('Then ... ask a question on the <a href="http://wordpress.org/tags/wp-quadratum?forum_id=10">WordPress support forum</a>; this is by far the best way so that other users can follow the conversation.')
     666            . __('Then ... ask a question on the <a href="http://wordpress.org/support/plugin/wp-quadratum">WordPress support forum</a>; this is by far the best way so that other users can follow the conversation.')
    650667            . '</li>'
    651668            . '<li>'
     
    667684            . '</li>'
    668685            . '<li>'
    669             . __('WP Quadratum is both free as in speech and free as in beer. No donations are required; <a href="http://www.vicchi.org/codeage/donate/">here\'s why</a>.')
     686            . __('WP Quadratum is both free as in speech and free as in beer; <a href="http://www.vicchi.org/codeage/donate/">here\'s why</a>.')
    670687            . '</li>'
    671688            . '</ul>'
  • wp-quadratum/trunk/includes/wp-quadratum-callback.php

    r580206 r621687  
    1717        . '/wp-quadratum-callback.php';
    1818   
    19     $fh = new FoursquareHelper ($client_id, $client_secret, $redirect_url);
     19    $fh = new FoursquareHelper_v1_0 ($client_id, $client_secret, $redirect_url);
    2020   
    2121    $token = $fh->get_token ($_GET['code']);
  • wp-quadratum/trunk/includes/wp-quadratum-frontend.php

    r580206 r621687  
    55 */
    66
    7 class WP_QuadratumFrontEnd extends WP_PluginBase {
     7class WP_QuadratumFrontEnd extends WP_PluginBase_v1_1 {
    88    private $mxn;
    99   
     
    1313   
    1414    function __construct () {
    15         $this->mxn = new WP_MXNHelper;
     15        $this->mxn = new WP_MXNHelper_v2_0;
    1616        $this->mxn->register_callback ('cloudmade', array ($this, 'cloudmade_mxn_callback'));
    1717        $this->mxn->register_callback ('nokia', array ($this, 'nokia_mxn_callback'));
     
    1919
    2020        $provider = WP_Quadratum::get_option ('provider');
    21         $this->mxn->set_providers (array ($provider));
     21        $this->mxn->set_frontend_providers (array ($provider));
    2222       
    2323        add_shortcode ('wp_quadratum', array ($this, 'shortcode'));
     
    134134        $content[] = '<div id="' . $args['map-id'] . '" class="' . $args['map-class'] . '" style="width:' . $args['width'] . 'px; height:' . $args['height'] . 'px;"></div>';
    135135        $content[] = '<div class="' . $args['venue-class'] . '">';
    136         $content[] = '<h5>Last seen at <a href="' . $venue_url . '" target="_blank">' . $venue->name . '</a> on ' . date ("d M Y G:i T", $checkin->createdAt) . '</h5>';
     136       
     137        $params = array (
     138            'venue-url' => $venue_url,
     139            'venue-name' => $venue->name,
     140            'checked-in-at' => $checkin->createdAt
     141        );
     142       
     143        $strapline = '<h5>Last seen at <a href="' . $venue_url . '" target="_blank">' . $venue->name . '</a> on ' . date ("d M Y G:i T", $checkin->createdAt) . '</h5>';
     144        $content[] = apply_filters ('wp_quadratum_strapline', $strapline, $params);
     145       
    137146        $content[] = '</div>';
    138147        $content[] = '</div>';
  • wp-quadratum/trunk/includes/wp-quadratum-widget.php

    r580206 r621687  
    55 */
    66
    7 require_once (WPQUADRATUM_PATH . '/foursquare-helper/foursquare-helper.php');
     7require_once (WPQUADRATUM_PATH . '/includes/foursquare-helper/foursquare-helper.php');
    88
    99class WP_QuadratumWidget extends WP_Widget {
  • wp-quadratum/trunk/readme.txt

    r580206 r621687  
    44Tags: wp-quadratum, maps, map, foursquare, checkins, checkin, widget
    55Requires at least: 3.4
    6 Tested up to: 3.4.1
    7 Stable tag: 1.1
     6Tested up to: 3.4.2
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    28281. Choose the zoom level of the map display.
    29291. Choose whether to show private checkins on the map.
     30
     31The <em>strapline</em> text containing the venue name, venue URL and timestamp of your last Foursquare checkin can be customised via the plugin's filters. See the *Filter Support And Usage* section for more information.
    3032
    3133The current version of this plugin allows you to associate a single Foursquare account with your WordPress site; associating multiple Foursquare accounts, one per user account is not currently supported.
     
    8385Right now, all of these maps providers are supported by Mapstraction but they have issues when the sidebar's widget map is so small (200px by 200px by default). As and when these issues are resolved in Mapstraction, they'll be supported by a future release of the plugin.
    8486
     87= Can I change the format of the strapline that appears under the checkin map? =
     88
     89Yes. The `wp_quadratum_strapline` filter is for just this purpose. The filter is passed the default strapline as well as the URL to the Foursquare venue checked in at, the name of the venue and the date and time of the checkin as a UNIX timestamp. See the *Filter Support And Usage* section for more information.
     90
    8591= I want to amend/hack/augment this plugin; can I do the same? =
    8692
     
    110116== Changelog ==
    111117
    112 The current version is 1.1 (2012.07.01)
     118The current version is 1.2.0 (2012.11.06)
     119
     120= 1.2 =
     121* Released: 2012.11.06
     122* Added: Support for the `wp_quadratum_strapline` filter.
     123* Added: Enqueue non-minified versions of the plugin's CSS and JS files if WP_DEBUG or WQUADRATUM_DEBUG are defined.
     124* Other: Updated to latest versions of WP_PluginBase and WP_MXNHelper.
     125* Other: Moved all submodule classes/libraries from the plugin's root directory to /includes.
    113126
    114127= 1.1 =
     
    131144
    132145== Upgrade Notice ==
     146= 1.2 =
     147Adds support for the `wp_quadratum_strapline` filter plus internal housekeeping and library upgrades.
     148
    133149= 1.1 =
    134 Adds support for multiple map privders, Internet Explorer map rendering issues and a new shortcode. This is the 4th. version of WP Quadratum.
     150Adds support for multiple map providers, Internet Explorer map rendering issues and a new shortcode. This is the 4th. version of WP Quadratum.
    135151
    136152= 1.0.2 =
     
    164180
    165181The `zoom` attribute specifies the zoom level to be used when displaying the checkin map. If omitted, the zoom level defaults to a value of `16` which is roughly analogous to a neighbourhood zoom.
     182
     183== Filter Support And Usage ==
     184
     185WP Quadratum supports a single filter, which is described below.
     186
     187= wp_quadratum_strapline =
     188
     189Applied to the strapline that is displayed via the plugin's widget or shortcode. The strapline is the text that appears immediately below the checkin map.
     190
     191*Example:* Change the date and time formatting in the strapline
     192
     193`add_filter ('wp_quadratum_strapline', 'format_strapline', 10, 2);
     194function format_strapline ($content, $params) {
     195    // $params = array (
     196    //      'venue-url' => '4Sq venue url for checkin',
     197    //      'venue-name' => 'checkin venue name',
     198    //      'checked-in-at' => 'timestamp of checkin'
     199    //  );
     200   
     201    $strapline = '<h5>Last seen at <a href="' . $params['venue-url'] . '" target="_blank">' . $params['venue-name'] . '</a> on ' . date ('l jS \of F Y h:i:s A', $params['checked-in-at']) . '</h5>';
     202    return $strapline;
     203}`
  • wp-quadratum/trunk/wp-quadratum.php

    r580206 r621687  
    44Plugin URI: http://www.vicchi.org/codeage/wp-quadratum/
    55Description: A WordPress plugin to display your last Foursquare checkin as a map widget, fully authenticated via OAuth 2.0.
    6 Version: 1.1
     6Version: 1.2.0
    77Author: Gary Gale
    88Author URI: http://www.garygale.com/
     
    1313define ('WPQUADRATUM_URL', plugin_dir_url (__FILE__));
    1414define ('WPQUADRATUM_PATH', plugin_dir_path (__FILE__));
     15//define ('WPQUADRATUM_DEBUG', true);
    1516
    1617/*
     
    3233    define ('WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins');
    3334
    34 require_once (WPQUADRATUM_PATH . '/wp-plugin-base/wp-plugin-base.php');
    35 require_once (WPQUADRATUM_PATH . '/wp-mxn-helper/wp-mxn-helper.php');
     35require_once (WPQUADRATUM_PATH . '/includes/wp-plugin-base/wp-plugin-base.php');
     36require_once (WPQUADRATUM_PATH . '/includes/wp-mxn-helper/wp-mxn-helper.php');
    3637require_once (WPQUADRATUM_PATH . '/includes/wp-quadratum-widget.php');
    3738
     
    4546include_once (ABSPATH . 'wp-admin/includes/plugin.php');
    4647
    47 class WP_Quadratum extends WP_PluginBase {
     48class WP_Quadratum extends WP_PluginBase_v1_1 {
    4849    static $instance;
    4950   
    5051    const OPTIONS = 'wp_quadratum_settings';
    51     const VERSION = '110';
    52     const DISPLAY_VERSION = 'v1.1.0';
     52    const VERSION = '120';
     53    const DISPLAY_VERSION = 'v1.2.0';
    5354   
    5455    /**
     
    250251        $params = array ('limit' => 1);
    251252
    252         $fsq = new FoursquareHelper ($client_id, $client_secret, $redirect_url);
     253        $fsq = new FoursquareHelper_v1_0 ($client_id, $client_secret, $redirect_url);
    253254        $fsq->set_access_token ($oauth_token);
    254255        $rsp = $fsq->get_private ($endpoint, $params);
Note: See TracChangeset for help on using the changeset viewer.