diff --git a/README.txt b/README.txt index c64a216..7b8acfb 100644 --- a/README.txt +++ b/README.txt @@ -6,8 +6,8 @@ Donate link: http://rsvpmaker.com/ License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html Requires at least: 3.0 -Tested up to: 4.8 -Stable tag: 4.7.1 +Tested up to: 4.8.1 +Stable tag: 4.7.2 Schedule events, send invitations, track RSVPs, and collect PayPal payments. @@ -115,6 +115,11 @@ For basic usage, you can also have a look at the [plugin homepage](http://www.rs == Changelog == += 4.7.2 = + +* Improvements to clone event / create template from event functions +* Fix to prevent other plugins from modifying the mce editor on reminders editor page + = 4.7.1 = * Fix to rsvpmaker_upcoming display so doesn't show "No events listed" when future events out of date range diff --git a/rsvpmaker-admin.php b/rsvpmaker-admin.php index f32505d..533b894 100644 --- a/rsvpmaker-admin.php +++ b/rsvpmaker-admin.php @@ -2033,22 +2033,6 @@ function rsvpmaker_replay_email ( $post_id, $rsvp_id, $hours ) { $mail["from"] = $rsvp_to; $mail["fromname"] = get_bloginfo('name'); rsvpmaker_tx_email(get_post($post_id), $mail); - /* - if(isset($rsvp_options["smtp"]) && !empty($rsvp_options["smtp"]) ) - { - $mail["subject"] = $subject; - $mail["html"] = $confirm; - $mail["to"] = $notify; - $mail["from"] = $rsvp_to; - $mail["fromname"] = get_bloginfo('name'); - $result = rsvpmailer($mail); - } - else - { - echo wpautop("Notification to $notify"); - wp_mail($notify,$subject,$notification,"From: $rsvpto\nContent-Type: text/html; charset=UTF-8"); - } - */ } // RSVPMaker Reminders @@ -2324,7 +2308,17 @@ function rsvp_reminders () { if(empty($content) ) $content = get_post_meta($post_id,'_rsvp_confirm',true); -$settings = array(); + +$settings = array( + 'media_buttons' => false, + 'tinymce' => array( + 'toolbar1' => 'bold,italic,separator,alignleft,aligncenter,alignright,separator,link,unlink,undo,redo', + 'toolbar2' => '', + 'toolbar3' => '', + ), +); +//prevent other plugins from modifying editor +add_filter('mce_external_plugins',function( $p ) { return array(); },99); wp_editor( $content, $editor_id, $settings ); ?>

@@ -2899,4 +2893,10 @@ function rsvpmaker_admin_page_bottom($hook = '') { printf("\n".'

%s

',$hook); } +function rsvpmaker_editors() { +if(isset($_GET['page']) && ($_GET['page'] ='rsvp_reminders')) + wp_enqueue_editor(); +} + +add_action('admin_init','rsvpmaker_editors'); ?> \ No newline at end of file diff --git a/rsvpmaker-display.php b/rsvpmaker-display.php index 42f1073..3b645a0 100644 --- a/rsvpmaker-display.php +++ b/rsvpmaker-display.php @@ -1657,11 +1657,31 @@ function rsvpmaker_archive_loop_end () { //keep jetpack from messing up function rsvpmaker_no_related_posts( $options ) { global $post; - if(($post->post_type =='rsvpmaker' ) || ($post->post_type =='rsvpemail' )) + if(($post->post_type == 'rsvpmaker' ) || ($post->post_type == 'rsvpemail' )) { - $options['enabled'] = false; + $options['enabled'] = $options['headline'] = false; } return $options; } add_filter( 'jetpack_relatedposts_filter_options', 'rsvpmaker_no_related_posts' ); + +function rsvp_report_this_post() { +global $wpdb; +global $rsvp_options; +global $post; +if(empty($post->ID)) + return; + + $eventid = $post->ID; +$o = "

".__("RSVPs",'rsvpmaker')."

\n"; + $sql = "SELECT * FROM ".$wpdb->prefix."rsvpmaker WHERE event=$eventid ORDER BY yesno DESC, last, first"; + $wpdb->show_errors(); + $results = $wpdb->get_results($sql, ARRAY_A); + if(empty($results)) + return $o . '

'.__('None','rsvpmaker').'

'; + ob_start(); + format_rsvp_details($results, false); + $o .= ob_get_clean(); +return $o; +} ?> \ No newline at end of file diff --git a/rsvpmaker-email.php b/rsvpmaker-email.php index 6edb5c2..7183bd0 100644 --- a/rsvpmaker-email.php +++ b/rsvpmaker-email.php @@ -17,7 +17,8 @@ class MailChimpRSVP { private $api_key; private $api_endpoint = 'https://.api.mailchimp.com/3.0'; - /* SSL Verification + private $data_center; + /* SSL Verification Read before disabling: http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/ */ @@ -40,13 +41,19 @@ public function __construct($api_key) list(, $data_center) = explode('-', $this->api_key); $this->api_endpoint = str_replace('', $data_center, $this->api_endpoint); $this->last_response = array('headers' => null, 'body' => null); + $this->data_center = $data_center; } + /* when saved as draft, direct user to url for draft */ + public function draft_link() { + return 'https://'.$this->data_center.'.admin.mailchimp.com/campaigns/'; + } + /** * Create a new instance of a Batch request. Optionally with the ID of an existing batch. * @param string $batch_id Optional ID of an existing batch, if you need to check its status for example. * @return Batch New Batch object. */ - public function new_batch($batch_id = null) + public function new_batch($batch_id = null) { return new Batch($this, $batch_id); } @@ -919,20 +926,30 @@ function default_rsvpemail_title($title) { function default_rsvpemail_content($content) { global $post; +if(!empty($_GET["get_post"]) && empty($_GET["rsvpemail"]) ) + { + $post = get_post($_GET["get_post"]); + return $post->post_content; // used for creating post draft based on email + } + if(!empty($_GET["get_post"])) { + if(isset($_GET["rsvpemail"])) + { //don't add embed code for YouTube etc remove_filter( 'the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 ); $content .= "INTRO\n\n"; + } $parts = explode(':',$_GET["get_post"]); if(!empty($parts[1])) $cq = new WP_Query('posts_per_page='.$parts[1]); else $cq = new WP_Query('posts_per_page=1&p='. (int) $_GET["get_post"]); + ob_start(); -//// print_r($cq); while ( $cq->have_posts() ) : $cq->the_post(); global $post; + $post_backup = $post; if(!$subject) $subject = get_the_title(); @@ -1235,11 +1252,19 @@ function rsvpmaker_email_send_ui($chimp_html, $chimp_text, $rsvp_html, $rsvp_tex echo '
'.__('MailChimp API error','rsvpmaker').': '.$MailChimp->getLastError().'
'; return; } +if(empty($_POST["chimp_send_now"])) + { + $link = $MailChimp->draft_link(); + echo '
'.__('View draft','rsvpmaker').' '. __('on mailchimp.com','rsvpmaker').'
'; + } +else // send now + { $send_result = $MailChimp->post("campaigns/".$campaign["id"].'/actions/send'); if($MailChimp->success()) echo '
'.__('Sent MailChimp campaign','rsvpmaker').': '.$campaign["id"].'
'; else echo '
'.__('MailChimp API error','rsvpmaker').': '.$MailChimp->getLastError().'
'; + } } } @@ -1277,7 +1302,7 @@ function rsvpmaker_email_send_ui($chimp_html, $chimp_text, $rsvp_html, $rsvp_tex $chosen = (isset($custom_fields["_email_list"][0])) ? $custom_fields["_email_list"][0] : $chimp_options["chimp-list"]; echo mailchimp_list_dropdown($chimp_options["chimp-key"], $chosen); ?> - +

- Create Draft Blog Post from Email + +posts WHERE post_status='publish' AND post_type='rsvpemail' ORDER BY ID DESC LIMIT 0, 50"; +$wpdb->show_errors(); +$results = $wpdb->get_results($sql, ARRAY_A); +if($results) +{ +foreach ($results as $row) + { + $posts .= sprintf("\n",$row["ID"],substr($row["post_title"],0,80)); + } +} +?> +
+

: +

+ +
+"; - if(!isset($_GET["rsvp_print"]) && current_user_can('edit_others_posts')) + if(!isset($_GET["rsvp_print"]) && current_user_can('edit_others_posts') && $editor_options) echo sprintf('

Delete record for: %s %s

',admin_url().'edit.php?post_type=rsvpmaker&page=rsvp',$row["id"],esc_attr($row["first"]),esc_attr($row["last"]) ); $userrsvps[] = $row["user_id"]; } diff --git a/rsvpmaker.php b/rsvpmaker.php index 01e4900..d000559 100644 --- a/rsvpmaker.php +++ b/rsvpmaker.php @@ -5,7 +5,7 @@ Plugin URI: http://www.rsvpmaker.com Description: Schedule events, send invitations to your mailing list and track RSVPs. You get all your familiar WordPress editing tools with extra options for setting dates and RSVP options. PayPal payments can be added with a little extra configuration. Email invitations can be sent through MailChimp or to members of your website community who have user accounts. Recurring events can be tracked according to a schedule such as "First Monday" or "Every Friday" at a specified time, and the software will calculate future dates according to that schedule and let you track them together.RSVPMaker now also specifically supports organizing online events or webinars with Google's YouTube Live video broadcast service (formerly Hangouts on Air). Options / Shortcode documentation. Author: David F. Carr -Version: 4.7.1 +Version: 4.7.2 Author URI: http://www.carrcommunications.com Text Domain: rsvpmaker Domain Path: /translations @@ -133,7 +133,7 @@ function get_rsvpmaker_custom($post_id) { ); -if(strpos($_SERVER['REQUEST_URI'],'post-new.php')) +if(strpos($_SERVER['REQUEST_URI'],'post-new.php') && !isset($_GET['clone'])) { $custom['_rsvp_on'][0] = $rsvp_options['rsvp_on']; foreach($defaults as $default_key => $custom_key)