Plugin Directory

Changeset 499372


Ignore:
Timestamp:
02/02/2012 09:11:57 PM (14 years ago)
Author:
aitosoftware
Message:

Fixes to sign-up process.

Location:
pulsemaps/trunk
Files:
4 edited

Legend:

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

    r496995 r499372  
    1818
    1919require_once('pm-config.php');
    20 $c = curl_init($pulsemaps_url . '/mapInfo/wp/');
     20$c = curl_init($pulsemaps_url . $_POST['path']);
    2121curl_setopt($c, CURLOPT_POSTFIELDS, $_POST);
    22 curl_exec($c);
    23 $code = curl_getinfo($c, CURLINFO_HTTP_CODE);
     22curl_setopt($c, CURLOPT_HEADER, true);
     23curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
     24$data = curl_exec($c);
     25$info = curl_getinfo($c);
    2426curl_close($c);
    25 if ($code != "200") {
    26     echo "Could not retrieve info from PulseMaps server. Please try again later.";
    27     die;
     27$header_size = $info["header_size"];
     28$headers = substr($data, 0, $header_size);
     29foreach (explode("\n", $headers) as $header) {
     30    $header = rtrim($header);
     31    if ($header) {
     32        header($header);
     33    }
    2834}
     35echo substr($data, $header_size);
  • pulsemaps/trunk/pm-settings-page.php

    r497453 r499372  
    4040    $id = $options['id'];
    4141    $widget_url = "$pulsemaps_url/widget.js?id=123456789&notrack=1&target=widget-preview";
    42     $url_load = plugins_url('pm-proxy.php', __FILE__);
     42    $proxy_url = plugins_url('pm-proxy.php', __FILE__);
     43    $siteurl = get_option('siteurl');
    4344?>
    4445<script type='text/javascript'>
     
    4647    pulsemaps.updatePreview('<?php echo $widget_url; ?>');
    4748  }
    48   jQuery(document).ready(function() {
    49     pulsemaps.setHooks('<?php echo $widget_url; ?>');
    50     jQuery("#pulsemaps_plan_load").load("<?php echo $url_load; ?>",
    51                                         {key: "<?php echo $options['key']; ?>",
     49  function showMessage(msg) {
     50      jQuery("#pulsemaps_message").html("<p><strong>" + msg + "</strong></p>").show();
     51  }
     52  function updateInfo() {
     53    jQuery("#pulsemaps_plan_load").html('<img src="<?php echo $siteurl; ?>/wp-admin/images/loading.gif" alt="loading...">');
     54    jQuery("#pulsemaps_plan_load").load("<?php echo $proxy_url; ?>",
     55                                        {path: "/maps/<?php echo $options['id']; ?>/wp-info.html",
     56                                         url: "<?php echo $proxy_url; ?>",
     57                                         site_url: "<?php echo $siteurl; ?>",
     58                                         id: "<?php echo $options['id']; ?>",
     59                                         key: "<?php echo $options['key']; ?>",
    5260                                         version: "<?php echo pulsemaps_plugin_version(); ?>",
     61                                         return_to: "<?php echo pulsemaps_settings_url(); ?>",
    5362                                         svn_id:  "$Id: $",
    5463                                         wp_version: "<?php global $wp_version; echo $wp_version; ?>",
    5564                                         php_version: "<?php echo phpversion(); ?>"});
     65  }
     66  jQuery(document).ready(function() {
     67    pulsemaps.setHooks('<?php echo $widget_url; ?>');
     68    updateInfo();
    5669  });
    5770</script>
     
    7790    $opts = get_option('pulsemaps_options', array());
    7891    $id = $opts['id'];
    79     $siteurl = get_option('siteurl');
    80 ?>
     92?>
     93<div id="pulsemaps_message" style="display: none;" class="updated"></div>
    8194<div class="wrap">
    8295<div id="icon-options-general" class="icon32"><br></div>
    8396<h2>PulseMaps Visitor Map</h2>
    8497<div id="pulsemaps_descr">
    85 <div id="pulsemaps_plan_load" <?php if (!$opts['activated']) { echo 'style="display: none;"'; } ?>>
    86 <img src="<?php echo $siteurl; ?>/wp-admin/images/loading.gif" alt="loading...">
     98<div id="pulsemaps_plan_load">
    8799</div>
    88100</div>
     
    92104</form>
    93105<script>
    94 function pulsemaps_handler(height, active, reload)
     106function pulsemaps_activate(data)
    95107{
    96     document.getElementById('pulsemaps_iframe').height = parseInt(height);
    97     if (active != 0) {
    98         jQuery('#pulsemaps_settings').show();
    99         jQuery.post('options.php', jQuery('#pulsemaps_activate').serialize(),
    100                     function() { if (reload) { top.location.reload(true); } });
    101     }
     108    jQuery('#pulsemaps_settings').show();
     109    <?php if (!$opts['activated']) { ?>
     110    jQuery.post('options.php', jQuery('#pulsemaps_activate').serialize());
     111    jQuery('#pulsemaps_widget_msg').show();
     112    <?php } ?>
     113    if (data.reload) {
     114      updateInfo();
     115    }
     116    if (data.message) {
     117      showMessage(data.message);
     118    }
    102119}
    103120</script>
    104 <?php if (!$opts['activated']) { ?>
    105 <iframe src="<?php echo "$pulsemaps_url/maps/$id/wp-info.html?settings_url=";
    106                    echo urlencode(pulsemaps_settings_url());
    107                    echo "&plugin_url=" . urlencode(plugins_url('', __FILE__));
    108                    echo "&admin_url=" . urlencode(pulsemaps_admin_url()); ?>"
    109         id="pulsemaps_iframe"
    110         frameborder="0"
    111         style="width: 100%; overflow-y: hidden;" scrolling="no"></iframe>
    112 <?php
    113     }
    114     $style = get_option('pulsemaps_widget', 'default');
    115 ?>
    116     <div id="pulsemaps_settings" <?php if (!$opts['activated']) { echo 'style="display: none;"'; } ?>>
     121<div id="pulsemaps_settings" <?php if (!$opts['activated']) { echo 'style="display: none;"'; } ?>>
    117122<form action="options.php" method="post">
    118123     <?php settings_fields('pulsemaps_options'); ?>
  • pulsemaps/trunk/pulsemaps.php

    r496995 r499372  
    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
     6Version: 1.5.1
    77Author: Aito Software Inc.
    88License: GPLv2 or later
     
    217217            echo '">PulseMaps settings page</a> to customize your widget.</strong></p></div>';
    218218        }
    219     }  else if (!pulsemaps_tracking_active() && pulsemaps_activated()) {
    220         echo '<div class="error"><p><strong>Enable the PulseMaps widget on the <a href="';
     219    }  else {
     220        $hide = pulsemaps_tracking_active() || !pulsemaps_activated();
     221        echo '<div id="pulsemaps_widget_msg" class="error"';
     222        if ($hide) {
     223            echo ' style="display: none;"';
     224        }
     225        echo '><p><strong>Enable the PulseMaps widget on the <a href="';
    221226        echo get_option('siteurl') . '/wp-admin/widgets.php';
    222227        echo '">widget admin page</a> to start mapping visitors.</strong></p></div>';
  • pulsemaps/trunk/readme.txt

    r496995 r499372  
    88Requires at least: 2.9
    99Tested up to: 3.3.1
    10 Stable tag: 1.5
     10Stable tag: 1.5.1
    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.1 =
     72
     73* Cross-browser fixes to signup process.
    7074
    7175= 1.5 =
Note: See TracChangeset for help on using the changeset viewer.