function scan_content_NLform($content) { preg_match_all('/\\<div class="wysija-register">(.*?)\\<\\/div>/i', $content, $matches); foreach ($matches[1] as $key => $mymatch) { if ($mymatch) { $widgetdata = unserialize(base64_decode($mymatch)); $widgetNL = new WYSIJA_NL_Widget(1); $contentTABLE = $widgetNL->widget($widgetdata, $widgetdata); $content = str_replace($matches[0][$key], $contentTABLE, $content); } //endif } //endforeach return $content; }
function scan_content_NLform($content) { preg_match_all('/\\<div class="wysija-register">(.*?)\\<\\/div>/i', $content, $matches); if (!empty($matches[1]) && count($matches[1]) > 0) { require_once WYSIJA_WIDGETS . 'wysija_nl.php'; } foreach ($matches[1] as $key => $mymatch) { if ($mymatch) { $widgetdata = unserialize(base64_decode($mymatch)); $widgetNL = new WYSIJA_NL_Widget(true); $contentTABLE = $widgetNL->widget($widgetdata, $widgetdata); $content = str_replace($matches[0][$key], $contentTABLE, $content); } //endif } //endforeach return $content; }
function registerAdd($datawidget, $edit = false) { //dbg($datawidget,0); $this->head(); ?> <form id="formTable" action="" style="display:block;width:750px;" method="post" > <div id="widget-form" class="widget"> <?php $widgetNL = new WYSIJA_NL_Widget(1); $widgetNL->form($datawidget); ?> <input type="hidden" name="widget_id" value="wysija-nl-<?php echo time(); ?> " /> <input type="submit" class="refresh" value="<?php echo esc_attr(__('Preview', WYSIJA)); ?> " /> </div> <div id="widget-prev"> <?php if ($datawidget) { ?> <div id="widget-preview" class="widget" > <?php echo '<div id="preview-label" class="widget">' . __("Preview", WYSIJA) . "</div>"; echo $widgetNL->widget($datawidget, $datawidget); ?> </div> <?php if ($edit) { if ($_POST && isset($_POST['widget-wysija'])) { ?> <input type="submit" id="widget-insert" class="button-primary action" name="doaction" value="<?php echo esc_attr(__('Update form', WYSIJA)); ?> "><?php } } else { ?> <input type="submit" id="widget-insert" class="button-primary action" name="doaction" value="<?php echo esc_attr(__('Insert form', WYSIJA)); ?> "><?php } ?> <input type="hidden" id="widget-data" name="widget-data" value="<?php unset($datawidget['preview']); echo base64_encode(serialize($datawidget)); ?> "> <?php } ?> </div> <div style="clear:both;"> </form> <?php $this->foot(); }
<div class="modal-content text-center" id="model-content"><br /> <div class="model-header"> <img src="<?php bloginfo('template_directory'); ?> /images/logo.png" alt="saaz_logo"> <button id="close" type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> </div> <h2 id="contact_page_h2"><img src="<?php bloginfo('template_directory'); ?> /images/sign.png" alt=""> Subscriber</h2> <?php $widgetNL = new WYSIJA_NL_Widget(true); echo $widgetNL->widget(array('form' => 1, 'form_type' => 'php')); ?> </div> </div> </div> <!-- end mailpoet --> </div> </div> </div> </div>
public function export($form_id, $type) { switch ($type) { case 'iframe': $url_params = array('wysija-page' => 1, 'controller' => 'subscribers', 'action' => 'wysija_outter', 'wysija_form' => $form_id); $url_params['external_site'] = 1; $model_config = WYSIJA::get('config', 'model'); $source_url = WYSIJA::get_permalink($model_config->getValue('confirm_email_link'), $url_params, true); return '<iframe width="100%" scrolling="no" frameborder="0" src="' . $source_url . '" class="iframe-wysija" vspace="0" tabindex="0" style="position: static; top: 0pt; margin: 0px; border-style: none; height: 330px; left: 0pt; visibility: visible;" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true" title="' . __('Subscription Wysija', WYSIJA) . '"></iframe>'; break; case 'php': $output = array('$widgetNL = new WYSIJA_NL_Widget(true);', 'echo $widgetNL->widget(array(\'form\' => ' . (int) $form_id . ', \'form_type\' => \'php\'));'); return join("\n", $output); break; case 'html': //need some language for the validation $helper_toolbox = WYSIJA::get('toolbox', 'helper'); $wp_language_code = $helper_toolbox->get_language_code(); $wysija_version = WYSIJA::get_version(); $scripts_to_include = '<!--START Scripts : this is the script part you can add to the header of your theme-->' . "\n"; $scripts_to_include .= '<script type="text/javascript" src="' . includes_url() . 'js/jquery/jquery.js' . '?ver=' . $wysija_version . '"></script>' . "\n"; if (file_exists(WYSIJA_DIR . 'js' . DS . 'validate' . DS . 'languages' . DS . 'jquery.validationEngine-' . $wp_language_code . '.js')) { $scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/validate/languages/jquery.validationEngine-' . $wp_language_code . '.js' . '?ver=' . $wysija_version . '"></script>' . "\n"; } else { $scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/validate/languages/jquery.validationEngine-en.js' . '?ver=' . $wysija_version . '"></script>' . "\n"; } $scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/validate/jquery.validationEngine.js' . '?ver=' . $wysija_version . '"></script>' . "\n"; $scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/front-subscribers.js' . '?ver=' . $wysija_version . '"></script>' . "\n"; $scripts_to_include .= '<script type="text/javascript"> /* <![CDATA[ */ var wysijaAJAX = {"action":"wysija_ajax","controller":"subscribers","ajaxurl":"' . admin_url('admin-ajax.php', 'absolute') . '","loadingTrans":"' . __('Loading...', WYSIJA) . '"}; /* ]]> */ </script>'; $scripts_to_include .= '<script type="text/javascript" src="' . WYSIJA_URL . 'js/front-subscribers.js?ver=' . $wysija_version . '"></script>' . "\n"; $scripts_to_include .= '<!--END Scripts-->' . "\n" . "\n"; //enqueue the scripts $html_result = $scripts_to_include; // add the html for the form $widget_NL = new WYSIJA_NL_Widget(true); $html_result .= $widget_NL->widget(array('form' => (int) $form_id, 'form_type' => 'html')); return $html_result; break; case 'shortcode': return '[wysija_form id="' . (int) $form_id . '"]'; break; } }
/** * handles the form generation in iframe mode, basically wysija's iframes call that action to generate the html of the body */ function wysija_outter() { //params used to generate the html in the widget class $widget_data = array(); if (isset($_REQUEST['wysija_form']) && (int) $_REQUEST['wysija_form'] > 0) { // this a wysija form made with the form editor // if it's a preview, we need to dynamically render the form // get form data $widget_data['form'] = (int) $_REQUEST['wysija_form']; $widget_data['form_type'] = 'iframe'; } else { //this is the old way, we need to keep it for backward compatibility if (isset($_REQUEST['encodedForm'])) { $encoded_form = json_decode(base64_decode(urldecode($_REQUEST['encodedForm']))); } else { if (isset($_REQUEST['fullWysijaForm'])) { $encoded_form = json_decode(base64_decode(urldecode($_REQUEST['fullWysijaForm']))); } else { if (isset($_REQUEST['widgetnumber'])) { $widgets = get_option('widget_wysija'); if (isset($widgets[$_REQUEST['widgetnumber']])) { $encoded_form = $widgets[$_REQUEST['widgetnumber']]; } } else { $encoded_form = $_REQUEST['formArray']; $encoded_form = stripslashes_deep($encoded_form); } } } //fill the widget data array based on the parameters found earlier if ($encoded_form) { foreach ($encoded_form as $key => $val) { $widget_data[$key] = $val; //if the value is an object we need to loop through and make an array of it //I think we could simply cast the object as an array not sure if that works on objects within objects... if (is_object($val)) { $object_to_array = array(); foreach ($val as $key_in => $val_in) { $object_to_array[$key_in] = $val_in; if (is_object($val_in)) { $object_to_array_second_level = array(); foreach ($val_in as $k_in => $v_in) { $object_to_array_second_level[$k_in] = $v_in; } $object_to_array[$key_in] = $object_to_array_second_level; } } $widget_data[$key] = $object_to_array; } } } else { if (current_user_can('switch_themes')) { echo '<b>' . str_replace(array('[link]', '[/link]'), array('<a target="_blank" href="' . admin_url('widgets.php') . '">', '</a>'), __('It seems your widget has been deleted from the WordPress\' [link]widgets area[/link].', WYSIJA)) . '</b>'; } exit; } //create a unique identifier for the form (the old way) if (isset($_REQUEST['widgetnumber'])) { $form_identifier = $_REQUEST['widgetnumber']; } else { $form_identifier = rand(5, 1500); } $widget_data['widget_id'] = 'wysija-nl-iframe-' . $form_identifier; } require_once WYSIJA_WIDGETS . 'wysija_nl.php'; $widget_NL = new WYSIJA_NL_Widget(true); $widget_NL->iFrame = true; $subscription_form = $widget_NL->widget($widget_data, $widget_data); echo $subscription_form; exit; }
function wysija_outter() { if (isset($_REQUEST['encodedForm'])) { $encodedForm = json_decode(base64_decode(urldecode($_REQUEST['encodedForm']))); } else { if (isset($_REQUEST['fullWysijaForm'])) { $encodedForm = json_decode(base64_decode(urldecode($_REQUEST['fullWysijaForm']))); } else { if (isset($_REQUEST['widgetnumber'])) { $widgets = get_option('widget_wysija'); if (isset($widgets[$_REQUEST['widgetnumber']])) { $encodedForm = $widgets[$_REQUEST['widgetnumber']]; } } else { $encodedForm = $_REQUEST['formArray']; $encodedForm = stripslashes_deep($encodedForm); } } } $widgetdata = array(); if ($encodedForm) { foreach ($encodedForm as $key => $val) { $widgetdata[$key] = $val; if (is_object($val)) { $valu = array(); foreach ($val as $keyin => $valin) { $valu[$keyin] = $valin; if (is_object($valin)) { $inin = array(); foreach ($valin as $kin => $vin) { $inin[$kin] = $vin; } $valu[$keyin] = $inin; } } $widgetdata[$key] = $valu; } } } else { if (current_user_can('switch_themes')) { echo '<b>' . str_replace(array('[link]', '[/link]'), array('<a target="_blank" href="' . admin_url('widgets.php') . '">', '</a>'), __('It seems your widget has been deleted from the WordPress\' [link]widgets area[/link].', WYSIJA)) . '</b>'; } exit; } if (isset($_REQUEST['widgetnumber'])) { $intrand = $_REQUEST['widgetnumber']; } else { $intrand = rand(5, 1500); } $widgetdata['widget_id'] = 'wysija-nl-iframe-' . $intrand; $widgetNL = new WYSIJA_NL_Widget(1); $widgetNL->iFrame = true; $subscriptionForm = $widgetNL->widget($widgetdata, $widgetdata); echo $subscriptionForm; exit; }
function printFooter() { $path_img = esc_url(get_template_directory_uri()) . '/images/'; ?> </div> <!-- end main content --> <!-- Booking form --> <!-- da decommentare quando ritorna il booking <div id="booking-form" class="black-container"> <div class="col-xs-12 col-md-6"> <h2>Contact for bookings</h2><span class="close-form">X</span> <div class="form-container"> <?php echo do_shortcode('[contact-form-7 id="109" title="booking-form"]'); ?> </div> </div> </div> --> <!-- end Booking form --> <!-- Newsletter --> <div id="newsletter-form" class="black-container"> <div class="col-xs-12 col-md-6"> <h2>Subscribe to the Newsletter</h2><span class="close-form">X</span> <div class="form-container"> <?php $widgetNL = new WYSIJA_NL_Widget(true); echo $widgetNL->widget(array('form' => 2, 'form_type' => 'php')); ?> </div> </div> </div> <!-- end Newsletter --> <footer class="site-footer container-fluid" role="contentinfo"> <div class="row"> <div class="copyright col-xs-12 col-md-3"> <p style="font-size:0.9em"> P. IVA 04275020271<br> B&A - Bed and Art è stato registrato il 7/07/2014 presso il <a style="color:#fff" target="_blank" href="http://www.uibm.gov.it/index.php/marchi">ministero dello Sviluppo Economico</a>.<br> <a href="mailto:info@bedandart.it">info@bedandart.it</a><br> Venezia, San Marco, 30124. <br> Copyright © 2015 All right reserved </p> </div> <div class="field col-xs-12 col-md-3 footer-loghi"> <!-- <h3 class="booking-link">BOOKING NOW</h3> --> <div class="container-loghi"> <a href="http://tv.exibart.com/news/2008_lay_notizia_02.php?id_cat=78&id_news=6929&filter=&page_elenco=1" target="_blank" title="Exibart"> <img src="<?php echo $path_img; ?> bedandart-exibart-logo.png" alt="Exibart"> </a> <a href="https://www.youtube.com/watch?v=-e8VpfYRiR0" target="_blank" title="Oliviero Toscani Studio"> <img src="<?php echo $path_img; ?> bedandart-oliviero-toscani-studio-logo.png" alt="Oliviero Toscani Studio"> </a> <a href="http://insideart.eu/2016/04/18/michele-bubacco-finalista-vaf/" target="_blank" title="InsideArt"> <img src="<?php echo $path_img; ?> bedandart-insideart-logo.png" alt="InsideArt"> </a> </div> </div> <div class="field col-xs-12 col-md-3"> <h3 class="newsletter-link">NEWSLETTER</h3> </div> <div class="field col-xs-12 col-md-3"> <div class="social-links-container"> <ul class="social-link"> <li> <a target="_blank" href="https://www.youtube.com/channel/UCNOwuPM7QAtmUxSdNOro8dA"><img src="<?php echo $path_img; ?> social_youtube.png" alt="youtube" /></a> </li> <li> <a target="_blank" href="https://www.facebook.com/bedandartvenice"><img src="<?php echo $path_img; ?> social_facebook.png" alt="facebook" /></a> </li> <li> <a target="_blank" href="https://www.instagram.com/bedandart/"><img src="<?php echo $path_img; ?> social_instagram.png" alt="instagram"/></a> </li> </ul> <a href="#header-top" class="arrow-up"></a> </div> </div> </div> </footer><!-- .site-footer --> <?php }
if ($wysija && $wysija_embedded) { $modelList = WYSIJA::get("list", "model"); $arrayOfMailingLists = $modelList->get(false, array('is_enabled' => 1)); $nbMailingLists = count($arrayOfMailingLists); foreach ($arrayOfMailingLists as $k => $list) { $lists[] = $list['list_id']; $names[$list['list_id']] = $list['name']; } $widgetdata = array('widget_id' => 'wysija-nl-php-1', 'title' => __('Newsletter', 'iftheme'), 'instruction' => __('Subscribe', 'iftheme'), 'lists' => $lists, 'lists_name' => $names, 'submit' => __('OK', 'iftheme'), 'success' => __('You’ve successfully subscribed. Check your inbox now to confirm your subscription.', 'iftheme'), 'customfields' => array('email' => array('label' => __('Your Email', 'iftheme'))), 'labelswithin' => 'labels_within', 'before_title' => '<h3>', 'after_title' => '</h3>', 'before_widget' => '<aside id="sidebar-newsletter" class="widget-sidebar bxshadow clearfix">', 'after_widget' => '</aside>'); if ($multi && $nbMailingLists > 1) { $widgetdata['autoregister'] = 'auto_register'; //the users can choose the mailing-list they want to subscribe to } $widgetNL = new WYSIJA_NL_Widget(0); //0 > display title; 1 > hide title $subscriptionForm = $widgetNL->widget($widgetdata, $widgetdata); echo $subscriptionForm; } ?> <!-- SOCIAL NETWORKS --> <?php if ($antenna != 'front') { $fb = isset($options['theme_options_setting_facebook']) ? $options['theme_options_setting_facebook'] : $options[(int) $antenna]['theme_options_setting_facebook']; $twit = isset($options['theme_options_setting_twitter']) ? $options['theme_options_setting_twitter'] : $options[(int) $antenna]['theme_options_setting_twitter']; $gg = isset($options['theme_options_setting_googleplus']) ? $options['theme_options_setting_googleplus'] : $options[(int) $antenna]['theme_options_setting_googleplus']; $iftv = isset($options['theme_options_setting_iftv']) ? $options['theme_options_setting_iftv'] : $options[(int) $antenna]['theme_options_setting_iftv']; $youtube = isset($options['theme_options_setting_youtube']) ? $options['theme_options_setting_youtube'] : $options[(int) $antenna]['theme_options_setting_youtube']; $instagram = isset($options['theme_options_setting_instagram']) ? $options['theme_options_setting_instagram'] : $options[(int) $antenna]['theme_options_setting_instagram']; if ($fb || $twit || $gg || $iftv || $youtube || $instagram) { ?> <aside id="sidebar-social" class="widget bxshadow clearfix">