Changeset 1134670
- Timestamp:
- 04/14/2015 05:21:21 PM (11 years ago)
- Location:
- freshmail-newsletter/trunk
- Files:
-
- 3 edited
-
CHANGELOG.md (modified) (1 diff)
-
include/display_popup.php (modified) (11 diffs)
-
wp-freshmail.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
freshmail-newsletter/trunk/CHANGELOG.md
r1116142 r1134670 1 1 ### Changelog 2 3 - 1.5.6 - 2015-04-14 4 * Fix: fixed issue with popup 2 5 3 6 - 1.5.5 - 2015-03-18 -
freshmail-newsletter/trunk/include/display_popup.php
r1081877 r1134670 22 22 function fm_add_popup_to_header() 23 23 { 24 25 24 global $wpdb; 26 25 $results = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'fm_forms', OBJECT); … … 29 28 foreach ($results as $key => $val) { 30 29 $form_var = unserialize($val->freshmail_form_var); 31 $postType = get_post_type( get_the_ID()); 32 if(($postType == 'page') ) { 33 if (!isset($form_var['allowed_pages']) || !in_array(get_the_ID(), $form_var['allowed_pages'])) 34 { 30 $postType = get_post_type(get_the_ID()); 31 if (($postType == 'page')) { 32 if (!isset($form_var['allowed_pages']) || !in_array(get_the_ID(), $form_var['allowed_pages'])) { 35 33 break; 36 34 } 37 35 } elseif ($postType == 'post') { 38 if(!isset($form_var['allowed_main_posts']) || !in_array(get_the_ID(), $form_var['allowed_main_posts'])) 39 { 36 if (!isset($form_var['allowed_main_posts']) || !in_array(get_the_ID(), $form_var['allowed_main_posts'])) { 40 37 break; 41 38 } 42 } elseif ($postType == 'product') { 43 if(!isset($form_var['allowed_products']) || !in_array(get_the_ID(), $form_var['allowed_products'])) 44 { 39 } elseif ($postType == 'product') { 40 if (!isset($form_var['allowed_products']) || !in_array(get_the_ID(), $form_var['allowed_products'])) { 45 41 break; 46 42 } … … 51 47 $allowedPages = array_merge((isset($form_var['allowed_pages']) ? $form_var['allowed_pages'] : array()), (isset($form_var['allowed_main_posts']) ? $form_var['allowed_main_posts'] : array())); 52 48 $allowedPages = array_merge($allowedPages, (isset($form_var['allowed_products']) ? $form_var['allowed_products'] : array())); 53 /* check if page/post is allowed to display pop-up */54 if (!in_array(get_the_ID(), $allowedPages)) {49 /* check if page/post is allowed to display pop-up */ 50 if (!in_array(get_the_ID(), $allowedPages)) { 55 51 break; 56 52 } 57 53 58 if (isset($_SESSION['fm_form_popup'][$val->form_id]['count'])) {54 if (isset($_SESSION['fm_form_popup'][$val->form_id]['count'])) { 59 55 $_SESSION['fm_form_popup'][$val->form_id]['count'] += 1;; 60 56 } else { … … 98 94 $javascript_included = true; ?> 99 95 <script type="text/javascript"> 100 jQuery(document).ready(function() {101 jQuery(document).bind("mousemove", function(event) {102 if (event.pageY < 15){96 jQuery(document).ready(function(){ 97 jQuery(document).bind("mousemove", function(event){ 98 if(event.pageY < 15){ 103 99 jQuery("#fm_popup_<?php echo $val->form_id; ?>").dialog({ modal: true, resizable: false, draggable: false, autoOpen: false, width: 'auto', dialogClass: 'freshmail_dialog' }); 104 100 jQuery("#fm_popup_<?php echo $val->form_id; ?>").parent().css({position: "fixed"}).end().dialog('open'); … … 119 115 $form_var['sec_min'][0] = $form_var['sec_min'][0] / 60; 120 116 } 121 $javascript_included = true; 122 ?> 123 <script type="text/javascript"> 124 jQuery(document).ready(function() { 117 $javascript_included = true; ?> 118 <script type="text/javascript"> 119 jQuery(document).ready(function(){ 125 120 console.log('FreshMail - show pop-ups after <?php echo $form_var['sec_min'][0]; ?>seconds.'); 126 setTimeout(function() {121 setTimeout(function(){ 127 122 console.log('FreshMail - form <?php echo $val->form_id; ?> opened.'); 128 123 jQuery("#fm_popup_<?php echo $val->form_id; ?>").dialog({ modal: true, resizable: false, draggable: false, autoOpen: false, width: 'auto', dialogClass: 'freshmail_dialog' }); … … 136 131 137 132 if ($form_var['when_to_show'] == "per_px") { 138 $javascript_included = true; 139 ?>140 <script type="text/javascript">141 jQuery(document).ready(function() {133 $javascript_included = true; ?> 134 <script type="text/javascript"> 135 window.showFreshmailPopup = true; 136 jQuery(document).ready(function(){ 142 137 console.log('FreshMail - show pop-ups after <?php echo $form_var['per_px'][0].' '.$form_var['per_px'][1]; ?> scrolled.'); 143 jQuery(document).bind("scroll", function(event) {144 var max = <?php138 jQuery(document).bind("scroll", function(event){ 139 var max = <?php 145 140 if ($form_var['per_px'][1]=="percent") { 146 141 echo "jQuery(document).height() * ".($form_var['per_px'][0]/100); 147 142 } else { 148 143 echo $form_var['per_px'][0]; 149 } 150 ?>; 151 if ((jQuery(document).scrollTop() + jQuery(window).height()) > max) { 144 } ?>; 145 if((jQuery(document).scrollTop() + jQuery(window).height()) > max && window.showFreshmailPopup == true){ 152 146 console.log('FreshMail - form <?php echo $val->form_id; ?> opened after ' + jQuery(window).scrollTop() + 'px scrolled. <?php echo $form_var['per_px'][0].' '.$form_var['per_px'][1]; ?> - ' + max); 153 147 jQuery("#fm_popup_<?php echo $val->form_id; ?>").dialog({ modal: true, resizable: false, draggable: false, autoOpen: false, width: 'auto', dialogClass: 'freshmail_dialog' }); 154 148 jQuery("#fm_popup_<?php echo $val->form_id; ?>").parent().css({position: "fixed"}).end().dialog('open'); 155 149 jQuery.post(static_var.ajax, {'action': 'popup_show', 'form_id':<?php echo $val->form_id; ?>}); 156 jQuery(document).unbind("scroll");150 window.showFreshmailPopup = false; 157 151 } 158 152 }); … … 166 160 $javascript_included = true; ?> 167 161 <script type="text/javascript"> 168 jQuery(document).ready(function() {162 jQuery(document).ready(function(){ 169 163 jQuery("#fm_popup_<?php echo $val->form_id; ?>").dialog({ modal: true, resizable: false, draggable: false, autoOpen: false, width: 'auto', dialogClass: 'freshmail_dialog' }); 170 164 jQuery("#fm_popup_<?php echo $val->form_id; ?>").parent().css({position: "fixed"}).end().dialog('open'); … … 178 172 } 179 173 180 echo " 181 <!-- END FRESHMAIL POPUPS JAVASCRIPT CODE --> 182 "; 174 echo "<!-- END FRESHMAIL POPUPS JAVASCRIPT CODE -->"; 183 175 184 176 } … … 186 178 function fm_add_popup_to_footer() 187 179 { 188 189 180 global $wpdb; 190 181 $results = $wpdb->get_results('SELECT * FROM '.$wpdb->prefix.'fm_forms', OBJECT); … … 233 224 } 234 225 235 if ($show_popup) { 236 ?> 226 if ($show_popup) { ?> 237 227 238 228 <!-- FRESHMAIL POPUPS --> 239 229 <div id="fm_popup_<?php echo $val->form_id; ?>" class="freshmail_popup"> 240 <?php echo do_shortcode('[FM_form'.$shortcode_atts.' id="'.$val->form_id.'"]'); ?>241 </div>230 <?php echo do_shortcode('[FM_form'.$shortcode_atts.' id="'.$val->form_id.'"]'); ?> 231 </div> 242 232 <div class="fm_popup_pos"> </div> 243 233 <!-- END FRESHMAIL POPUPS --> … … 247 237 } 248 238 } 249 250 239 } 251 240 -
freshmail-newsletter/trunk/wp-freshmail.php
r1116142 r1134670 4 4 * Plugin URI: http://freshmail.com/plugin/wordpress-newsletter/ 5 5 * Description: FreshMail is an email marketing tool for creating and sending amazing newsletters. Our intuitive system leads users from campaign planning and creation to final reports. A free account lets you send up to 2000 messages to a maximum of 500 recipients each month. 6 * Version: 1.5. 56 * Version: 1.5.6 7 7 * Author: Borbis Media 8 8 * Author URI: http://www.borbis.com … … 21 21 // Define plugin version for upgrade 22 22 if (!defined('WP_FRESHMAIL_VERSION')) { 23 define('WP_FRESHMAIL_VERSION', '1.5. 5');23 define('WP_FRESHMAIL_VERSION', '1.5.6'); 24 24 } 25 25
Note: See TracChangeset
for help on using the changeset viewer.