Plugin Directory

Changeset 779643


Ignore:
Timestamp:
09/28/2013 04:53:13 PM (13 years ago)
Author:
MicahBlu
Message:

Fixed an sql error on creating the respondents table

Location:
rsvp-me/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • rsvp-me/trunk/includes/rsvpme_functions.php

    r779404 r779643  
    1818    if($wpdb->get_var("show tables like '" . $table_prefix . "respondents" . "'") != $table_prefix . "respondents" ) {
    1919   
    20         $sql = "CREATE TABLE " . $tables["respondents"] . " (
    21             id mediumint(9) NOT NULL AUTO_INCREMENT,
    22             event_id mediumint(9) NOT NULL,
     20        $sql = "CREATE TABLE " . $table_prefix . "respondents (
     21            id INT NOT NULL AUTO_INCREMENT,
     22            event_id INT NOT NULL,
    2323            fname varchar(255) NOT NULL,
    2424            lname varchar(255) NOT NULL,
     
    2626            response enum('accepted', 'declined', 'maybe') NOT NULL,
    2727            msg mediumtext NULL,
    28             time_accepted datetime NOT NULL,
    29             UNIQUE KEY id (id)
     28            time_accepted DATETIME NOT NULL,
     29            UNIQUE KEY id (id),
     30            PRIMARY KEY (id)
    3031        );";
    3132               
    32         $wpdb->query($sql);
    33        
     33        $affected = $wpdb->query($sql);
    3434    }
    3535    //set a temporary activeated_plugin option to be refereneced for after registration specific actions
    36     add_option('Activated_Plugin', 'rsvp-me');
     36    //add_option('Activated_Plugin', 'rsvp-me');
    3737}
    3838
  • rsvp-me/trunk/js/rsvp_me.js

    r779404 r779643  
    134134            }
    135135                   
     136       
    136137            $.post(ajaxurl, data, function(data){
    137138
  • rsvp-me/trunk/rsvpme.php

    r779416 r779643  
    6464  <script type='text/javascript'>
    6565
    66         var plugin_path = "<?= RSVP_ME_PLUGIN_URI ?>";
    67         var ajaxurl = "<?= admin_url('admin-ajax.php'); ?>";
     66        var plugin_path = "<?php echo RSVP_ME_PLUGIN_URI ?>";
     67        var ajaxurl = "<?php echo str_replace(get_site_url(), "", admin_url('admin-ajax.php')); ?>";
    6868        var rsvpCookie; //put our cookie var in the main scope
    6969       
     
    118118        $affected = $wpdb->query("INSERT INTO " . $wpdb->prefix . "rsvp_me_respondents
    119119                      VALUES(NULL, '$event_id', '$fname', '$lname', '$email', '$response', '$msg', NOW())");
    120         echo json_encode(array("success" => true));
     120       
     121                     
     122        if($affected > 0) echo json_encode(array("success" => true));
     123        else echo json_encode(array("error" => "There was an error adding your RSVP"));
    121124    }
    122125}
  • rsvp-me/trunk/themes/default/event.html

    r779418 r779643  
     1    <div class="rsvp_msg"></div>
    12    <p>{:description}</p>
    23    <section class="rsvp-me-event-meta">
Note: See TracChangeset for help on using the changeset viewer.