Plugin Directory

Changeset 515560


Ignore:
Timestamp:
03/06/2012 08:50:48 PM (14 years ago)
Author:
aitosoftware
Message:

Automatically update site name and URL on map details page.

Location:
pulsemaps/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pulsemaps/trunk/pm-config.php

    r496995 r515560  
    55
    66global $pulsemaps_version;
    7 $pulsemaps_version = 9;
     7$pulsemaps_version = 10;
    88
    99$local_config = dirname(__FILE__) . '/pm-config-local.php';
  • pulsemaps/trunk/pm-widget.php

    r496995 r515560  
    7575</script>
    7676<?php
     77        echo $opts['after_text'];
    7778        echo $after_widget;
    7879    }
  • pulsemaps/trunk/pulsemaps.php

    r499390 r515560  
    44Plugin URI: http://pulsemaps.com/wordpress/
    55Description: Show off your visitors on the world map.  When people around the world visit your blog, the corresponding areas on the heat map widget light up!
    6 Version: 1.5.2
     6Version: 1.5.3
    77Author: Aito Software Inc.
    88License: GPLv2 or later
     
    153153        $opts['activated'] = false;
    154154    }
     155    if (!isset($opts['after_text'])) {
     156        $opts['after_text'] = '';
     157    }
    155158
    156159    update_option('pulsemaps_options', $opts);
    157160
    158 }
     161    if (!wp_next_scheduled('pulsemaps_daily')) {
     162        wp_schedule_event(time(), 'daily', 'pulsemaps_daily');
     163    }
     164}
     165
     166register_deactivation_hook(__FILE__, 'pulsemaps_uninstall');
     167function pulsemaps_uninstall() {
     168    wp_clear_scheduled_hook('pulsemaps_daily');
     169}
     170
     171function pulsemaps_refresh() {
     172    global $pulsemaps_url;
     173    $opts = get_option('pulsemaps_options', array());
     174    $c = curl_init($pulsemaps_url . '/refresh');
     175    $data = array('key' => $opts['key'],
     176                  'name' => get_option('blogname'),
     177                  'url' => get_option('home'));
     178    curl_setopt($c, CURLOPT_POSTFIELDS, $data);
     179    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
     180    $ret = curl_exec($c);
     181    $code = curl_getinfo($c, CURLINFO_HTTP_CODE);
     182    curl_close($c);
     183    foreach (json_decode($ret, true) as $k => $v) {
     184        $opts[$k] = $v;
     185    }
     186    update_option('pulsemaps_options', $opts);
     187}
     188add_action('pulsemaps_daily', 'pulsemaps_refresh');
     189
    159190
    160191function pulsemaps_tracking_active() {
  • pulsemaps/trunk/readme.txt

    r499390 r515560  
    88Requires at least: 2.9
    99Tested up to: 3.3.1
    10 Stable tag: 1.5.2
     10Stable tag: 1.5.3
    1111
    1212Show off your visitors on the world map. When people around the world visit your blog, the corresponding areas on the heat map widget light up!
     
    6868
    6969== Changelog ==
     70
     71= 1.5.3 =
     72
     73* Site name and URL on map details page updated automatically.
    7074
    7175= 1.5.2 =
Note: See TracChangeset for help on using the changeset viewer.