Plugin Directory

Changeset 1448668


Ignore:
Timestamp:
07/04/2016 03:53:11 PM (10 years ago)
Author:
randyjensen
Message:

lots of bug fixes for all crud ops

Location:
rj-quickcharts/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • rj-quickcharts/trunk/README.txt

    r821960 r1448668  
    77Requires at least: 3.0
    88Tested up to: 3.8
    9 Stable tag: 0.5.9
     9Stable tag: 0.6.0
    1010
    1111Build Complex, Powerful HTML5 Bar Charts, Line Charts and Pie Charts in Just Minutes. No Programming Knowledge Required!
     
    7777== Changelog ==
    7878
     79= 0.6.0 =
     80* Bug fixes
     81
    7982= 0.5.9 =
    8083* Updated CSS for custom icon with WordPress 3.8
  • rj-quickcharts/trunk/admin/rjqc-admin-new.php

    r761892 r1448668  
    88$series_colors = array('#40C0CB', '#AEE239', '#CC333F', '#EB6841', '#2A363B','#F9D423','#00DFFC','#FF847C','#F9F2E7','#E84A5F');
    99
    10 $id = $_GET['id'];
     10$id = false;
     11if (isset($_GET['id'])) $id = $_GET['id'];
    1112if ($id) {
    1213    $sql = "SELECT * FROM $table_name WHERE id=$id";
     
    3233    echo '<input id="rjqc-chart-id" type="hidden" value="'.$id.'" />';
    3334
    34     if ($_GET['message']) {
     35    if (isset($_GET['message'])) {
    3536        echo '<div class="updated" style="margin: 15px 20px 0 0;"><p>Chart saved successfully. Now you can go to your Page or Post and choose <b>"Add Media" -&gt; "Insert Quickchart"</b>.</p></div>';
    3637    }
     
    156157</script>
    157158
    158 <?php if (!$_GET['id']) { ?>
     159<?php if (!isset($_GET['id'])) { ?>
    159160<script>
    160161(function ($) {
     
    202203<?php } ?>
    203204
    204 <?php if ($_GET['id']) { ?>
     205<?php if (isset($_GET['id'])) { ?>
    205206<script>
    206207(function ($) {
    207     <?php if ($_GET['message']) { ?>
     208    <?php if (isset($_GET['message'])) { ?>
    208209    var path = window.location.pathname + window.location.search;
    209     path = path.slice(0,-13);
     210    //path = path.slice(0,-13);
    210211    window.history.pushState("", "", path);
    211212    setTimeout(function() {
     
    437438    });
    438439
    439     <?php if ($_GET['id']) { ?>
     440    <?php if (isset($_GET['id'])) { ?>
    440441    if (<?php echo $legend ?> === 0) {
    441442        setTimeout(function(){
  • rj-quickcharts/trunk/ajax/init.php

    r740035 r1448668  
    4949                }
    5050
     51                if (!$_POST['sub_title']) $sub_title = '';
     52
    5153                $type           = $_POST['type'];
    5254                $legend         = (int)$_POST['legend'];
    5355                $title          = $_POST['title'];
    54                 $sub_title      = $_POST['sub_title'];
     56                $sub_title      = $sub_title;
    5557                $tooltip_suffix = $_POST['tooltip_suffix'];
    5658                $y_axis_title   = $_POST['y_axis_title'];
     
    7577                                );
    7678
     79
    7780                $new_id = mysql_insert_id();
     81                if (!$new_id) $new_id = $wpdb->insert_id;
    7882
    7983                echo '{"id": "'.$new_id.'"}';
     
    9397                $chart = $wpdb->get_results($sql);
    9498
     99                $sub_title = $chart[0]->subtitle;
     100                if (!$sub_title) $sub_title = '';
     101
    95102                $id             = $chart[0]->id;
    96103                $type           = $chart[0]->type;
    97104                $title          = $chart[0]->title;
    98                 $sub_title      = $chart[0]->subtitle;
     105                $sub_title      = $sub_title;
    99106                $tooltip_suffix = $chart[0]->tooltipSuffix;
    100107                $y_axis_cats    = $chart[0]->xAxisCats;
     
    110117                        'type' => $type,
    111118                        'title' => $title,
    112                         'subtitle' => $subtitle,
     119                        'subtitle' => $sub_title,
    113120                        'tooltipSuffix' => $tooltip_suffix,
    114121                        'xAxisCats' => $y_axis_cats,
     
    121128                );
    122129
     130                $new_id = mysql_insert_id();
     131                if (!$new_id) $new_id = $wpdb->insert_id;
     132
    123133                echo '{"success":1,
    124134                        "message":"Chart duplicated successfully.",
    125                         "id": "'.mysql_insert_id().'",
     135                        "id": "'.$new_id.'",
    126136                        "created":"'.current_time("mysql").'",
    127137                        "title":'.json_encode($title).',
     
    168178                }
    169179
     180                $sub_title = $_POST['sub_title'];
     181                if (!$sub_title) $sub_title = '';
     182
    170183                $wpdb->update(
    171184                    $table_name,
     
    175188                        'type'          => $_POST['type'],
    176189                        'title'         => $_POST['title'],
    177                         'subtitle'      => $_POST['sub_title'],
     190                        'subtitle'      => $sub_title,
    178191                        'tooltipSuffix' => $_POST['tooltip_suffix'],
    179192                        'yAxisTitleText'=> $_POST['y_axis_title'],
  • rj-quickcharts/trunk/rj_charts.php

    r821949 r1448668  
    44Plugin URI: http://www.randyjensen.com
    55Description: Easily create charts for your WordPress site. Line charts, bar charts and pie charts currently supported.
    6 Version: 0.5.9
     6Version: 0.6.0
    77Author: Randy Jensen
    88Author URI: http://www.randyjensen.com
     
    1515    global $table_name;
    1616
    17     $rjqc_db_version = '0.5.9';
     17    $rjqc_db_version = '0.6.0';
    1818    $table_name = $wpdb->prefix . 'rj_quickcharts';
    1919
Note: See TracChangeset for help on using the changeset viewer.