Changeset 2814758
- Timestamp:
- 11/09/2022 12:23:20 AM (3 years ago)
- Location:
- checkfront-wp-booking/trunk
- Files:
-
- 4 added
- 2 deleted
- 5 edited
-
CheckfrontWidget.php (modified) (4 diffs)
-
README.md (added)
-
checkfront-custom-template-sample.php (deleted)
-
checkfront.php (modified) (7 diffs)
-
examples (added)
-
examples/booking-template.php (added)
-
examples/shortcodes.html (added)
-
pipe.html (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
setup.js (deleted)
-
setup.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
checkfront-wp-booking/trunk/CheckfrontWidget.php
r2806003 r2814758 5 5 * 6 6 * @package CheckfrontWidget 7 * @version 3.0 7 * @version 3.0 8 8 * @author Checkfront <[email protected]> 9 * @copyright 2008-2018 Checkfront Inc 9 * @copyright 2008-2018 Checkfront Inc 10 10 * @license http://opensource.org/licenses/bsd-license.php New BSD License 11 11 * @link http://www.checkfront.com/developers/ … … 60 60 public $src = ''; 61 61 public $plugin_url = ''; 62 private $nextDropletId = 1; 62 63 63 64 … … 151 152 152 153 /** 153 * clean short code params154 * clean shortcode params 154 155 * 155 156 * @param array $cnf shortcode paramaters … … 209 210 } 210 211 211 $cnf['widget_id'] = (isset($cnf['widget_id']) and $cnf['widget_id'] > 0) ? $cnf['widget_id'] : '01'; 212 $cnf['widget_id'] = (isset($cnf['widget_id']) and $cnf['widget_id'] > 0) 213 ? (int)$cnf['widget_id'] 214 : $this->nextDropletId++; 212 215 $html = "\n<!-- CHECKFRONT BOOKING PLUGIN v{$this->interface_version}-->\n"; 213 216 $html .= '<div id="CHECKFRONT_WIDGET_' . $cnf['widget_id'] . '"><p id="CHECKFRONT_LOADER" style="background: url(\'//' . $this->host . '/images/loader.gif\') left center no-repeat; padding: 5px 5px 5px 20px">' . $this->load_msg . '...</p></div>'; -
checkfront-wp-booking/trunk/checkfront.php
r2806063 r2814758 5 5 Plugin URI: https://www.checkfront.com/wordpress 6 6 Description: Connects Wordpress to the Checkfront Online Booking System. Checkfront allows Tour, Activity, Accommodation, and Rental businesses to manage their availability, track inventories, centralize reservations, and process online payments. This plugin connects your WordPress site to your Checkfront account, and provides a powerful real-time booking interface – right within your existing website. 7 Version: 3. 57 Version: 3.6 8 8 Author: Checkfront Inc. 9 9 Author URI: https://www.checkfront.com/ … … 36 36 'partner_id' => '', 37 37 'popup' => '', 38 'widget_id' => '', 38 39 ], $cnf); 39 40 return checkfront($cnf); … … 64 65 { 65 66 global $Checkfront; 66 wp_enqueue_script('jquery');67 wp_enqueue_script(WP_PLUGIN_URL . '/setup.js');68 67 include(dirname(__FILE__).'/setup.php'); 69 68 } 70 69 71 // Init Checkfront, include any required js / css only when required72 function checkfront_ head()70 // include required js, if the page will use it 71 function checkfront_enqueue_scripts() 73 72 { 74 $embedded = 0;75 76 73 global $post, $Checkfront; 77 74 if (!isset($Checkfront->host)) { … … 80 77 81 78 // does this page have any shortcode. If not, back out. 82 $pos = stripos($post->post_content, '[checkfront'); 83 if ($pos || $pos === 0) { 84 $embedded = 1; 79 if (stripos($post->post_content, '[checkfront') === false) { 80 return; 85 81 } 86 82 87 // calendar widget 88 if ($Checkfront->arg['widget']) { 89 $checkfront_widget_post = get_option("checkfront_widget_post"); 90 $checkfront_widget_page = get_option("checkfront_widget_page"); 91 $checkfront_widget_booking = get_option("checkfront_widget_booking"); 83 wp_enqueue_script('cf/interface.js', "//{$Checkfront->host}/lib/interface--{$Checkfront->interface_version}.js", ['jquery']); 84 // Disable Comments 85 add_filter('comments_open', 'checkfront_comments_open_filter', 10, 2); 86 add_filter('comments_template', 'checkfront_comments_template_filter', 10, 1); 92 87 93 if ($embedded && !$checkfront_widget_booking) { 94 $Checkfront->arg['widget'] = 0; 95 } else { 96 if (is_page() && !$checkfront_widget_page) { 97 $Checkfront->arg['widget'] = 0; 98 } 99 if (is_single() && !$checkfront_widget_post) { 100 $Checkfront->arg['widget'] = 0; 101 } 102 } 103 } 88 // disable auto p 89 // remove_filter ('the_content', 'wpautop'); 104 90 105 if ($Checkfront->arg['widget'] || $embedded) { 106 echo ' <script src="//' . $Checkfront->host . '/lib/interface--' . $Checkfront->interface_version . '.js" type="text/javascript"></script>' ."\n"; 107 if ($embedded) { 108 // Disable Comments 109 add_filter('comments_open', 'checkfront_comments_open_filter', 10, 2); 110 add_filter('comments_template', 'checkfront_comments_template_filter', 10, 1); 111 112 // disable auto p 113 // remove_filter ('the_content', 'wpautop'); 114 115 // disable wptexturize 116 remove_filter('the_content', 'wptexturize'); 117 } 118 } 91 // disable wptexturize 92 remove_filter('the_content', 'wptexturize'); 119 93 } 120 94 121 // disable comments on booking pag fe95 // disable comments on booking page 122 96 function checkfront_comments_open_filter($open, $post_id=null) 123 97 { … … 134 108 function checkfront_init() 135 109 { 136 global $Checkfront;137 wp_register_sidebar_widget(138 'checkfront_widget',139 'Checkfront',140 'checkfront_widget',141 ['description' => __('Availability calendar and search')]142 );143 144 wp_register_widget_control('checkfront_widget', 'Checkfront', 'checkfront_widget_ctrl');145 add_action('wp_head', 'checkfront_head');146 // required includes147 110 wp_enqueue_script('jquery'); 148 if (!isset($Checkfront->arg)) { 149 $Checkfront->arg = []; 150 } 151 152 $Checkfront->arg['widget'] = (is_active_widget('checkfront_widget')) ? 1 : 0; 111 add_action('wp_enqueue_scripts', 'checkfront_enqueue_scripts'); 153 112 } 154 113 … … 168 127 } 169 128 return $links; 170 }171 172 // Show widget173 function checkfront_widget()174 {175 global $Checkfront;176 if (!$Checkfront->arg['widget']) {177 return;178 }179 $checkfront_widget_title = get_option("checkfront_widget_title");180 if ($checkfront_book_url = get_option("checkfront_book_url")) {181 if (!(strpos('http', $checkfront_book_url) === 0)) {182 $checkfront_book_url = 'http://' . $_SERVER['HTTP_HOST'] . $checkfront_book_url;183 }184 }185 if (!empty($checkfront_widget_title)) {186 echo '<h2 class="widgettitle">' . $checkfront_widget_title . '</h2>';187 }188 echo '<div id="checkfront-cal"><iframe allowTransparency=true border=0 style="border:0; height: 260px;" src="//' . $Checkfront->host . '/reserve/widget/calendar/?return=' . urlencode($checkfront_book_url) . '"></iframe></div>';189 }190 191 // Widget control192 function checkfront_widget_ctrl()193 {194 if ($_POST['checkfront_update']) {195 update_option("checkfront_book_url", $_POST['checkfront_book_url']);196 update_option("checkfront_widget_title", $_POST['checkfront_widget_title']);197 update_option("checkfront_widget_post ", $_POST['checkfront_widget_post']);198 update_option("checkfront_widget_page ", $_POST['checkfront_widget_page']);199 update_option("checkfront_widget_booking", $_POST['checkfront_widget_booking']);200 }201 202 $checkfront_book_url = get_option("checkfront_book_url");203 204 // try and find booking page in content205 if (!$checkfront_book_url) {206 global $wpdb;207 $checkfront_book_url = $wpdb->get_var("select guid FROM `{$wpdb->prefix}posts` where post_content like '%[checkfront%' and post_type = 'page' limit 1");208 update_option("checkfront_widget_url", $checkfront_book_url);209 }210 211 $checkfront_widget_title = get_option("checkfront_widget_title");212 $checkfront_widget_post = (get_option("checkfront_widget_post")) ? ' checked="checked"' : '';213 $checkfront_widget_page = (get_option("checkfront_widget_page")) ? ' checked="checked"' : '';214 $checkfront_widget_booking = (get_option("checkfront_widget_booking")) ? ' checked="checked"' : '';215 216 echo '<input type="hidden" name="checkfront_update" value="1" />';217 echo '<ul>';218 echo '<li><label for="checkfront_book_url">' . __('Internal Booking Page (URL)') . ': </label><input type="text" id="checkfront_book_url" name="checkfront_book_url" value="' . $checkfront_book_url . '" /> </li>';219 echo '<li><label for="checkfront_widget_title">' . __('Title') . ': </label><input type="text" id="checkfront_widget_title" name="checkfront_widget_title" value="' . $checkfront_widget_title . '" /> </li>';220 echo '<li style="color: firebrick">It is not recommended to use this with the v2 interface.</li>';221 echo '<li><input type="checkbox" id="checkfront_widget_post" name="checkfront_widget_post" value="1"' . $checkfront_widget_post . '/><label for="checkfront_widget_post" />' . __('Show on posts') . '</li>';222 echo '<li><input type="checkbox" id="checkfront_widget_page" name="checkfront_widget_page" value="1"' . $checkfront_widget_page . '/><label for="checkfront_widget_post" />' . __('Show on pages') . '</li>';223 echo '<li><input type="checkbox" id="checkfront_widget_booking" name="checkfront_widget_booking" value="1"' . $checkfront_widget_booking . '/><label for="checkfront_widget_booking" />' . __('Show on booking page') . '</li>';224 echo '</ul>';225 129 } 226 130 … … 243 147 add_action('admin_menu', 'checkfront_conf'); 244 148 add_action('init', 'checkfront_init'); 245 246 ?> -
checkfront-wp-booking/trunk/pipe.html
r780597 r2814758 19 19 <pre> 20 20 This is a static helper file that improves performance, rendering and sizing of the Checkfront Booking System. 21 It should be placed on the same server where the booking portal is hosted and referenced in the embed code. 21 It should be placed on the same server where the booking portal is hosted and referenced in the embed code. 22 22 For more information see: <a href="http://www.checkfront.com/support/droplet#helper">http://www.checkfront.com/support/droplet#helper</a> 23 23 </pre> -
checkfront-wp-booking/trunk/readme.txt
r2806003 r2814758 2 2 3 3 Contributors: checkfront 4 Stable tag: trunk4 Stable tag: 3.6 5 5 Tags: Booking, Booking System, Reservation, Reservation System, Online Booking, Booking Engine, Tours, Tour Operator, Booking Plugin, Reservation Plugin, Booking Software, Reservation Payment System, Activity Booking, Rental Booking, Reservation Payments, Tour Booking, Passbook, Availability, Payments, Bookings 6 6 Requires at least: 2.0 … … 32 32 * Multi-gateway payment processing including Stripe, Square, Paypal, Authorize.net, SagePay & dozens more 33 33 * SSL support keeps the customer on your website while making payment 34 * Support for short codes, or custom theme pages in Wordpress.34 * Support for shortcodes, or custom theme pages in Wordpress. 35 35 * Tailored onboarding session and a 24/7 support team 36 36 * **No commissions!** … … 73 73 ### Changelog 74 74 75 * *November 2nd 2022:* 76 * Wordpress 6.1 compatibility 77 * Removed deprecated sidebar widget 75 78 * *February 25th 2021:* 76 79 * Fixed broken image links in plugin setup -
checkfront-wp-booking/trunk/setup.php
r2806063 r2814758 1 1 <?php 2 if ( isset($_POST['checkfront_host'])) {2 if (!empty($_POST['checkfront_host'])) { 3 3 if ($host = $Checkfront->valid_host($_POST['checkfront_host'])) { 4 4 update_option('checkfront_host', trim($host)); … … 11 11 ?> 12 12 <div style="width: 800px"> 13 <script type="text/javascript">14 jQuery(document).ready(function() {15 16 function clean(str) {17 return str.replace(/[^\d\w\-\_ , "]/ig, '');18 }19 20 jQuery('#shortcode_generator').click(function() {21 height = 600;22 width = 1150;23 var cwidth = (window.screen.width - width) / 2;24 var cheight = (window.screen.height - height) / 2;25 var param = "location=yes,status=yes,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,width=" + width + ',height=' + height + ',left=' + cwidth + ',top=' + cheight;26 var sw = window.open(this.href, '', param);27 sw.focus();28 return false;29 });30 });31 </script>32 13 <div style="width: 500px; float: left"> 33 14 <h1>Online Bookings For Wordpress</h1> … … 38 19 <li style="padding: 5px 0; height: 25px; line-height: 25px;"><strong style="margin-right: 10px; background-color: #ccc; border-radius: 20px; clear: none; color: #000; display: inline-block; float: left; font-style: normal; height: 25px; font-weight: bold; line-height: 25px;font-size:14px; text-align: center; width: 25px;">1</strong> Create and configure <a href="https://www.checkfront.com/start/?src=wp-setup" target="_blank">your Checkfront account</a>.</li> 39 20 <li style="padding: 5px 0; height: 25px; line-height: 25px;"><strong style="margin-right: 10px; background-color: #ccc; border-radius: 20px; clear: none; color: #000; display: inline-block; float: left; font-style: normal; height: 25px; font-weight: bold; line-height: 25px;font-size:14px; text-align: center; width: 25px;">2</strong> Supply your Checkfront URL and optional settings <a href="#checkfront_setup">below</a>.</li> 40 <li style="padding: 5px 0; height: 25px; line-height: 25px;"><strong style="margin-right: 10px; background-color: #ccc; border-radius: 20px; clear: none; color: #000; display: inline-block; float: left; font-style: normal; height: 25px; font-weight: bold; line-height: 25px;font-size:14px; text-align: center; width: 25px;">3</strong> Create a new page and supply the <a href="#shortcode">short code</a> you created.</li>21 <li style="padding: 5px 0; height: 25px; line-height: 25px;"><strong style="margin-right: 10px; background-color: #ccc; border-radius: 20px; clear: none; color: #000; display: inline-block; float: left; font-style: normal; height: 25px; font-weight: bold; line-height: 25px;font-size:14px; text-align: center; width: 25px;">3</strong> Create a new page and supply the <a href="#shortcode">shortcode</a> you created.</li> 41 22 <li style="padding: 5px 0; height: 25px; line-height: 25px;"><strong style="margin-right: 10px; background-color: #ccc; border-radius: 20px; clear: none; color: #000; display: inline-block; float: left; font-style: normal; height: 25px; font-weight: bold; line-height: 25px;font-size:14px; text-align: center; width: 25px;">4</strong> Start accepting online bookings.</li> 42 23 <li style="padding: 5px 0; height: 25px; line-height: 25px;"><strong style="margin-right: 10px; background-color: #ccc; border-radius: 20px; clear: none; color: #000; display: inline-block; float: left; font-style: normal; height: 25px; font-weight: bold; line-height: 25px;font-size:14px; text-align: center; width: 25px;">5</strong> Have questions? <a href="https://www.checkfront.com/support/?src=wp-setup">We're here to help</a>.</li> … … 48 29 <strong>Smart, Simplified Online Bookings</strong><br /><br /> 49 30 </div> 50 <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fcheckfront.bookings&send=false&layout=button_count&width=250&show_faces=false&action=like&colorscheme=light&font&height=21&appId=132896805841" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:290px; margin-bottom: 10px; height:21px;" allowTransparency="true"></iframe>51 <!-- Place this tag in your head or just before your close body tag -->52 <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>53 <!-- Place this tag where you want the +1 button to render -->54 <div class="g-plusone" data-size="small" data-annotation="inline" data-href="https://www.checkfront.com/?src=wp-setup"></div>55 31 <br /> 56 32 <br /> … … 65 41 <h3 class="hndle">Setup</h3> 66 42 <?php 67 if ( isset($cf_msg)) { ?>43 if (!empty($cf_msg)) { ?> 68 44 <div style="background-color: rgb(255, 251, 204); margin:1em 1em 0em 1em" id="message" class="updated fade"> 69 <p><strong><?php echo $cf_msg?></strong></p>45 <p><strong><?php echo esc_html($cf_msg) ?></strong></p> 70 46 </div> 71 47 <?php } ?> … … 75 51 <tr valign="top"> 76 52 <th scope="row"><label for="checkfront_email">Checkfront Host Url:</label></th> 77 <td nowrap>https://<input name="checkfront_host" style="width: 15em;font-weight: bold" id="CF_id" value="<?php echo $Checkfront->host?>" class="regular-text" type="text" /><br /><em style="color: #888">Eg: demo.checkfront.com</em> </td>53 <td nowrap>https://<input name="checkfront_host" style="width: 15em;font-weight: bold" id="CF_id" value="<?php echo esc_attr($Checkfront->host) ?>" class="regular-text" type="text" /><br /><em style="color: #888">Eg: demo.checkfront.com</em> </td> 78 54 <td id="CF_status"><em>Location of your Checkfront Admin</td> 79 55 </tr>
Note: See TracChangeset
for help on using the changeset viewer.