Esempio n. 1
0
 function get_options()
 {
     //$content_fields = op_optin_default_fields();
     $fields = array('title' => array('name' => __('Title', 'optimizepress'), 'help' => __('Enter the title to be displayed at the top of the content area', 'optimizepress'), 'default' => __('The perfect way to convert your traffic into sales', 'optimizepress')), 'paragraph' => array('name' => __('Content', 'optimizepress'), 'help' => __('Enter the sub title/message text above your submit button', 'optimizepress'), 'type' => 'wysiwyg', 'default' => __('Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.<br />Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum.', 'optimizepress'), 'disable_font' => true), 'submit_button' => array('name' => __('Submit Button', 'optimizepress'), 'help' => __('Enter the text for the button on your feature area', 'optimizepress'), 'default' => __('Take The Tour...', 'optimizepress'), 'disable_font' => true), 'link_url' => array('name' => __('Button Link URL', 'optimizepress'), 'disable_font' => true));
     $img_fields = array('image' => array('name' => __('Image', 'optimizepress'), 'help' => __('Enter the URL to the image', 'optimizepress'), 'default' => '', 'type' => 'image', 'disable_font' => true));
     $vid_opts = array('values' => array('type' => 'video', 'width' => '580', 'height' => '325'));
     $styles = array(1 => array('content' => array('module' => 'content_fields', 'title' => __('Content', 'optimizepress'), 'mod_options' => array('fields' => $fields), 'template' => array($this, 'content_fields'), 'before' => '<div class="twelve columns">', 'after' => '</div>'), 'image' => array('module' => 'content_fields', 'mod_options' => array('fields' => $img_fields), 'template' => array($this, 'content_fields'), 'before' => '<div class="twelve featured-image columns">', 'after' => '</div>')), 2 => array('content' => array('module' => 'content_fields', 'mod_options' => array('fields' => $fields), 'before' => '<div class="nine columns">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts, 'before' => '<div class="fifteen columns video-panel">', 'after' => '</div>')), 3 => array('optin' => array('module' => 'signup_form', 'before' => '<div class="nine columns">', 'after' => '</div>'), 'image' => array('module' => 'content_fields', 'mod_options' => array('fields' => $img_fields), 'before' => '<div class="twelve columns featured-image offset-by-two">', 'after' => '</div>')), 4 => array('optin' => array('module' => 'signup_form', 'before' => '<div class="nine columns">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts, 'before' => '<div class="fifteen columns video-panel">', 'after' => '</div>')), 5 => array('image' => array('module' => 'content_fields', 'mod_options' => array('fields' => $img_fields), 'before' => '<div class="twelve featured-image columns">', 'after' => '</div>'), 'content' => array('module' => 'content_fields', 'mod_options' => array('fields' => $fields), 'before' => '<div class="twelve columns">', 'after' => '</div>')), 6 => array('video' => array('module' => 'video', 'mod_options' => $vid_opts, 'before' => '<div class="fifteen columns video-panel">', 'after' => '</div>'), 'content' => array('module' => 'content_fields', 'mod_options' => array('fields' => $fields), 'before' => '<div class="nine columns">', 'after' => '</div>')), 7 => array('image' => array('module' => 'content_fields', 'mod_options' => array('fields' => $img_fields), 'before' => '<div class="twelve columns featured-image">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form', 'before' => '<div class="nine columns offset-by-two">', 'after' => '</div>')), 8 => array('video' => array('module' => 'video', 'mod_options' => $vid_opts, 'before' => '<div class="fifteen columns video-panel">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form', 'before' => '<div class="nine columns">', 'after' => '</div>')), 9 => array('content' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('title' => array('name' => __('Title', 'optimizepress'), 'help' => __('Enter the title to be displayed at the top of the content area', 'optimizepress'), 'default' => __('The perfect way to convert your traffic into sales', 'optimizepress')), 'subtitle' => array('name' => __('Sub Title', 'optimizepress'), 'help' => __('Enter the sub title to be displayed at the top of the content area', 'optimizepress'), 'default' => __('The perfect way to convert your traffic into sales', 'optimizepress'))))), 'image' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('image' => array('name' => __('Image', 'optimizepress'), 'help' => __('Enter the URL to the image', 'optimizepress'), 'default' => OP_PAGES_URL . 'global/images/marketing-sites/screenies.png', 'type' => 'image', 'disable_font' => true))))), 10 => array('content' => array('module' => 'content_fields', 'mod_options' => array('fields' => $fields))), 11 => array('content_large' => array('module' => 'live_editor', 'module_type' => 'page')));
     //1,6,2,7,3,8,4,9,5,10
     $this->options = isset($styles[$this->style]) ? $styles[$this->style] : array();
     if ($this->style != 11) {
         $this->options = array_merge(array('liveeditor_above' => array('module' => 'live_editor', 'module_type' => 'page')), $this->options, array('liveeditor_below' => array('module' => 'live_editor', 'module_type' => 'page')));
     }
     foreach ($this->options as $name => $options) {
         op_mod($options['module'], op_get_var($options, 'module_type', 'blog'));
         if (!isset($options['template'])) {
             if ($this->options[$name]['module'] == 'content_fields') {
                 $this->options[$name]['template'] = array($this, 'content_fields');
             } elseif ($this->options[$name]['module'] == 'signup_form') {
                 $this->options[$name]['template'] = array($this, 'optin_box');
                 $this->options[$name]['mod_options'] = array('disable' => 'color_scheme', 'content_fields' => op_optin_default_fields());
                 $this->options[$name]['mod_options']['submit_button_config'] = array('defaults' => array('content' => __('Get Started', 'optimizepress')));
             } elseif ($this->options[$name]['module'] == 'video') {
                 $this->options[$name]['template'] = array($this, 'video_placeholder');
             }
         }
     }
 }
Esempio n. 2
0
    function content_template_fb($fields, $values)
    {
        $fonts = array('title' => array(), 'content' => array());
        if (isset($values[0])) {
            $fonts = $values[1];
            $values = $values[0];
        }
        //op_font_style_str
        $html = '';
        op_mod('comments')->need_js = true;
        $button_1 = op_get_var($values, 'button_1_text');
        $button_2 = op_get_var($values, 'button_2_text');
        $title = op_get_var($values, 'title');
        $font_str = op_font_style_str(op_get_var($fonts, 'title', array()));
        $html .= empty($title) ? '' : '<h2' . (!empty($font_str) ? ' style=\'' . $font_str . '\'' : '') . '>' . nl2br($title) . '</h2>
		';
        $content = wpautop(op_get_var($values, 'content'));
        $font_str = op_font_style_str(op_get_var($fonts, 'content', array()));
        $GLOBALS['OP_LIVEEDITOR_FONT_STR'] = array('elements' => array('p', 'a'), 'style_str' => $font_str);
        $content = op_process_asset_content($content);
        $html .= $content . (empty($button_1) ? '' : '
		<a class="button-style-2 button-style-2-orange" href="' . op_get_var($values, 'button_1_url') . '"><span>' . $button_1 . '</span></a>') . (empty($button_2) ? '' : '
		<a class="button-style-2 button-style-2-orange" href="' . op_get_var($values, 'button_2_url') . '"><span>' . $button_2 . '</span></a>');
        return $html;
    }
Esempio n. 3
0
 function get_options()
 {
     //$content_fields = op_optin_default_fields();
     $vid_opts = array('values' => array('type' => 'video', 'width' => '540', 'height' => '350'));
     op_mod('signup_form');
     $style = array('title_logo' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('title' => array('name' => __('Logo', 'optimizepress'), 'default' => $this->global_imgs . 'logo_default.png', 'element' => 'h1', 'type' => 'image'))), 'template' => array($this, 'content_fields')), 'content' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('title' => array('name' => __('Title', 'optimizepress'), 'default' => __('Discover How You Can Build Pages Just Like This In Seconds...', 'optimizepress')), 'content' => array('name' => __('Content', 'optimizepress'), 'default' => __('Your high impact sub-headline or call to action text would be placed here.  Enter your name and email below for instant access', 'optimizepress'), 'type' => 'wysiwyg', 'disable_font' => true))), 'before' => '<div>', 'after' => '</div>', 'template' => array($this, 'content_fields')), 'optin' => array('module' => 'signup_form', 'mod_options' => array('disable' => array('color_scheme'), 'ignore_fields' => array('title', 'form_header', 'footer_note'), 'content_fields' => op_optin_default_fields(), 'submit_button_config' => array('defaults' => array('content' => __('Get Started', 'optimizepress')))), 'template' => array($this, 'optin_box'), 'before' => '<div>', 'after' => '</div>'), 'footer_note' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('footer_note' => array('name' => __('Footer Note', 'optimizepress'), 'default' => __('We value your privacy. Your information will never be shared or sold.', 'optimizepress'), 'wrap' => '<p class="secure-icon"><img src="' . op_page_img('secure.png', true, 'global') . '" alt="secure" width="16" height="15"> %s</p>'))), 'template' => array($this, 'content_fields')), 'template' => array($this, 'style_template'));
     //1,6,2,7,3,8,4,9,5,10
     $this->options = $style;
 }
 function widget($args, $instance)
 {
     @session_start();
     $theme = isset($_SESSION['theme']) ? $_SESSION['theme'] : 1;
     $grid = op_mod('advertising')->display(array('advertising', 'sidebar', 'grid'), true);
     $rectangular = op_mod('advertising')->display(array('advertising', 'sidebar', 'rectangular'), true);
     if ($grid != '' || $rectangular != '') {
         ?>
     <div class="sidebar-section">
         <?php 
         echo $grid . $rectangular;
         ?>
     </div>
 <?php 
     }
     op_mod('advertising')->display(array('advertising', 'sidebar', 'large_ad1'));
     call_user_func('theme' . $theme . '_generate_sidebar_tabs');
     op_mod('advertising')->display(array('advertising', 'sidebar', 'large_ad2'));
     call_user_func('theme' . $theme . '_generate_sidebar_tabs', 2);
 }
Esempio n. 5
0
 static function video_player($atts, $content = '')
 {
     // Decode encoded chars
     $atts = op_urldecode($atts);
     $default = array('type' => 'embed', 'hide_controls' => 'N', 'auto_play' => 'N', 'auto_buffer' => 'N', 'width' => 511, 'height' => 288, 'margin_top' => 0, 'margin_bottom' => 20, 'border_size' => 0, 'border_color' => '#fff', 'placeholder' => '', 'align' => 'center', 'youtube_url' => '', 'youtube_auto_play' => 'N', 'youtube_hide_controls' => 'N', 'youtube_remove_logo' => 'N', 'youtube_show_title_bar' => 'N', 'youtube_force_hd' => '', 'url1' => '', 'url2' => '', 'new_syntax' => true);
     $vars = shortcode_atts($default, $atts);
     if ($vars['type'] == 'embed') {
         if (preg_match('{alt=\\"(.*?)\\"}si', $content, $match)) {
             $content = base64_decode(html_entity_decode($match[1], ENT_QUOTES, get_option('blog_charset')));
             if (stripos($content, 'id="evp-') !== false) {
                 $content = preg_replace('{<!--\\s+_evpInit}si', "<!--\n_evpInit", $content);
             }
         }
         $vars['embed'] = $content;
     } elseif ($vars['type'] == 'youtube') {
         $content = base64_decode($content);
         if (preg_match('|(https?://[^<"]+)|im', $content, $matches)) {
             $vars['youtube_url'] = $matches[1];
         }
     } else {
         $vars['url'] = '';
         $content = base64_decode($content);
         if (preg_match('|(https?://[^<"]+)|im', $content, $matches)) {
             $vars['url'] = $matches[1];
         }
         /*
          * Video URL 1
          */
         $vars['url1'] = '';
         $url1 = base64_decode($atts['url1']);
         if (preg_match('|(https?://[^<"]+)|im', $url1, $matches)) {
             $vars['url1'] = $matches[1];
         }
         /*
          * Video URL 2
          */
         $vars['url2'] = '';
         $url2 = base64_decode($atts['url2']);
         if (preg_match('|(https?://[^<"]+)|im', $url2, $matches)) {
             $vars['url2'] = $matches[1];
         }
     }
     /**
      * Loading video player script
      */
     op_video_player_script();
     $output = op_mod('video')->output(array(), array(), $vars, true, true);
     if (!is_admin()) {
         return $output['output'];
     }
     if (count($vars) == 0) {
         $vars = array('width' => $default['values']['width'], 'height' => $default['values']['height'], 'border_size' => $default['values']['border_size'], 'border_color' => $default['values']['border_color']);
     }
     if (empty($vars['width']) && isset($default['values']) && isset($default['values']['width'])) {
         $vars['width'] = $default['values']['width'];
     }
     if (empty($vars['height']) && isset($default['values']) && isset($default['values']['height'])) {
         $vars['height'] = $default['values']['height'];
     }
     if (empty($vars['border_size']) && isset($default['values']) && isset($default['values']['border_size'])) {
         $vars['border_size'] = $default['values']['border_size'];
     }
     if (empty($vars['border_color']) && isset($default['values']) && isset($default['values']['border_color'])) {
         $vars['border_color'] = $default['values']['border_color'];
     }
     $align = $vars['align'] == 'center' ? 'margin:0 auto;' : 'float:' . $vars['align'] . ';';
     // This ifelse can be removed for production, it's unnecessary, new syntax will always be present.
     if ($vars['new_syntax']) {
         $video_aspect_ratio = $vars['height'] / $vars['width'];
         $aspect_ratio_string = 'height:0; padding-bottom:' . $video_aspect_ratio * 100 . '%; padding-top:0;';
         $output = '<div class="video-plugin-new-syntax video-plugin-new" style="width:' . $vars['width'] . 'px; max-width:100%;' . $align . (!empty($vars['margin_top']) ? ' margin-top: ' . $vars['margin_top'] . 'px;' : '') . (!empty($vars['margin_bottom']) ? ' margin-bottom: ' . $vars['margin_bottom'] . 'px;' : 'margin-bottom: 20px;') . (' border: ' . $vars['border_size'] . 'px solid ' . $vars['border_color'] . ';') . ' padding-top:0; padding-bottom:0;">' . '<div style="' . $aspect_ratio_string . '"></div>' . '</div>';
     } else {
         $output = '<div class="video-plugin" style="width:' . $vars['width'] . 'px;height:' . $vars['height'] . 'px;' . $align . (!empty($vars['margin_top']) ? ' margin-top: ' . $vars['margin_top'] . 'px;' : '') . (!empty($vars['margin_bottom']) ? ' margin-bottom: ' . $vars['margin_bottom'] . 'px;' : 'margin-bottom: 20px;') . (' border: ' . $vars['border_size'] . 'px solid ' . $vars['border_color'] . ';') . '"></div>';
     }
     return $output;
 }
Esempio n. 6
0
?>
[type]" id="<?php 
echo $fieldid;
?>
type" class="op-type-switcher">
        <?php 
$val = op_page_attr($section_name, 'type');
$opts = array('optin' => __('Opt-in Form', OP_SN), 'html' => __('HTML Content', OP_SN));
foreach ($opts as $name => $title) {
    echo '<option value="' . $name . '"' . ($val == $name ? ' selected="selected"' : '') . '>' . $title . '</option>';
}
?>
        </select><br />
        <div class="op-type op-type-optin"><?php 
op_mod('signup_form')->display_settings(array($section_name, 'optin_form'), array('disable' => 'color_scheme|on_off_switch'));
?>
</div>
        <div class="op-type op-type-html"><br /><?php 
op_mod('content_fields')->display_settings(array($section_name, 'html_content'), array('fields' => array('content' => array('name' => __('HTML Content', OP_SN), 'type' => 'textarea', 'help' => __('Enter HTML content to show in your lightbox.', OP_SN)))));
?>
</div>
    </div>
    <br />
    <div id="popdom-promote-box">
    	<p><?php 
printf(__('For more advanced Popup designs, split testing and many more features, we recommend Popup Domination. <a href="%s" target="_blank">Click here</a>', OP_SN), 'http://gurucb.popdom.hop.clickbank.net/');
?>
</p>
    </div>
    
</div>
Esempio n. 7
0
 function save_settings($section_name, $config = array(), $op, $return = false)
 {
     $settings = array('enabled' => op_get_var($op, 'enabled', 'N'), 'show_on' => op_get_var($op, 'show_on', 'load'), 'type' => op_get_var($op, 'type', 'html'), 'optin_form' => op_mod('signup_form')->save_settings(array($section_name, 'optin_form'), array('disable' => 'color_scheme|on_off_switch'), op_get_var($op, 'optin_form', array()), true), 'html_content' => op_mod('content_fields')->save_settings(array($section_name, 'html_content'), array('fields' => array('content' => array('type' => 'textarea'))), op_get_var($op, 'html_content', array()), true));
     op_update_page_option($section_name, $settings);
 }
Esempio n. 8
0
    ?>
            <?php 
} else {
    ?>
                <h2 class="the-title"><?php 
    _e('Nothing Found', OP_SN);
    ?>
</h2>
                <?php 
    op_mod('advertising')->display(array('advertising', 'pages', 'top'));
    ?>
                <p><?php 
    _e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', OP_SN);
    ?>
</p>
                <?php 
    op_search_form();
    ?>
            <?php 
}
?>
                <?php 
op_mod('advertising')->display(array('advertising', 'pages', 'bottom'));
?>
            </div>
            <?php 
op_sidebar();
?>

<?php 
get_footer();
Esempio n. 9
0
    }
    echo $help_vid;
    ?>
			</div>
		</div>
        <?php 
    if (!$no_content) {
        ?>
			<?php 
        if (!empty($help)) {
            ?>
            <div class="section-help"><?php 
            echo $help;
            ?>
</div>
            <?php 
        }
        if (!empty($cur_action)) {
            call_user_func($cur_action);
        }
        if (!empty($cur_module)) {
            op_mod($cur_module, $module_type)->display_settings($name, $options);
        }
        ?>
        <?php 
    }
    ?>
    </div>
    <?php 
    $i++;
}
Esempio n. 10
0
 function video_player($atts, $content = '')
 {
     $default = array('type' => 'embed', 'hide_controls' => 'N', 'auto_play' => 'N', 'auto_buffer' => 'N', 'width' => 511, 'height' => 288, 'margin_top' => 0, 'margin_bottom' => 20, 'border_size' => 0, 'border_color' => '#fff', 'placeholder' => '', 'align' => 'center', 'youtube_url' => '', 'youtube_auto_play' => 'N', 'youtube_hide_controls' => 'N', 'youtube_remove_logo' => 'N', 'youtube_show_title_bar' => 'N', 'youtube_force_hd' => '');
     $vars = shortcode_atts($default, $atts);
     if ($vars['type'] == 'embed') {
         if (preg_match('{alt=\\"(.*?)\\"}si', $content, $match)) {
             $content = base64_decode(html_entity_decode($match[1], ENT_QUOTES, get_option('blog_charset')));
             if (stripos($content, 'id="evp-') !== false) {
                 $content = preg_replace('{<!--\\s+_evpInit}si', "<!--\n_evpInit", $content);
             }
         }
         $vars['embed'] = $content;
     } elseif ($vars['type'] == 'youtube') {
         $content = base64_decode($content);
         if (preg_match('|(https?://[^<"]+)|im', $content, $matches)) {
             $vars['youtube_url'] = $matches[1];
         }
     } else {
         $vars['url'] = '';
         $content = base64_decode($content);
         if (preg_match('|(https?://[^<"]+)|im', $content, $matches)) {
             $vars['url'] = $matches[1];
         }
     }
     $output = op_mod('video')->output(array(), array(), $vars, true, true);
     if (!is_admin()) {
         return $output['output'];
     }
     if (count($vars) == 0) {
         $vars = array('width' => $default['values']['width'], 'height' => $default['values']['height'], 'border_size' => $default['values']['border_size'], 'border_color' => $default['values']['border_color']);
     }
     if (empty($vars['width']) && isset($default['values']) && isset($default['values']['width'])) {
         $vars['width'] = $default['values']['width'];
     }
     if (empty($vars['height']) && isset($default['values']) && isset($default['values']['height'])) {
         $vars['height'] = $default['values']['height'];
     }
     if (empty($vars['border_size']) && isset($default['values']) && isset($default['values']['border_size'])) {
         $vars['border_size'] = $default['values']['border_size'];
     }
     if (empty($vars['border_color']) && isset($default['values']) && isset($default['values']['border_color'])) {
         $vars['border_color'] = $default['values']['border_color'];
     }
     $align = $vars['align'] == 'center' ? 'margin:0 auto;' : 'float:' . $vars['align'] . ';';
     $output = '<div class="video-plugin" style="width:' . $vars['width'] . 'px;height:' . $vars['height'] . 'px;' . $align . (!empty($vars['margin_top']) ? ' margin-top: ' . $vars['margin_top'] . 'px;' : '') . (!empty($vars['margin_bottom']) ? ' margin-bottom: ' . $vars['margin_bottom'] . 'px;' : 'margin-bottom: 20px;') . (' border: ' . $vars['border_size'] . 'px solid ' . $vars['border_color'] . ';') . '"></div>';
     return $output;
 }
Esempio n. 11
0
 function output($section_name, $config, $options, $return = false)
 {
     $styles = $this->_get_styles($section_name, $config);
     $type = op_get_var($options, 'type');
     $before = op_get_var($config, 'before');
     $after = op_get_var($config, 'after');
     if (!empty($type) && isset($styles[$type]) && isset($options[$type])) {
         $style = $styles[$type];
         if (isset($style['config'])) {
             extract($style['config']);
         }
         $options = $options[$type];
         $content_done = $button_done = false;
         $content_options = array();
         array_push($section_name, $type);
         $feature_content = array();
         $used_content = $used_button = '';
         foreach ($style['options'] as $option_name => $option) {
             $tmp_content = '';
             if (isset($option['display_action'])) {
                 $tmp_content = call_user_func_array($option['display_action'], array($section_name, $config));
             } elseif (isset($option['module'])) {
                 $mod_config = op_get_var($option, 'mod_options', array());
                 $mod_options = op_get_var($options, $option_name, array());
                 if (isset($option['use_content']) && isset($style['options'][$option['use_content']])) {
                     $used_content = $option['use_content'];
                     $content_config = op_get_var($style['options'][$option['use_content']], 'mod_options', array());
                     $content_opts = op_get_var($options, $option['use_content'], array());
                     $content_options = op_mod('content_fields')->output(array($section_name, $option['use_content']), $content_config, $content_opts, true);
                     $mod_config['content_fields'] = op_get_var($content_config, 'fields', array());
                     if (isset($mod_config['disable'])) {
                         $mod_config['disable'] = str_replace('content', '', $mod_config['disable']);
                     }
                     $content_done = true;
                     $mod_options['content'] = $content_options;
                 }
                 if (isset($option['use_button']) && isset($style['options'][$option['use_button']])) {
                     $used_button = $option['use_button'];
                     $button_opts = op_get_var($options, $used_button, array());
                     $button_done = true;
                     $mod_options['submit_button'] = op_mod('submit_button')->output(array($section_name, $used_button), array(), $button_opts, true);
                 }
                 if (!($option_name == $used_content && $content_done === true) && !($option_name == $used_button && $button_done === true)) {
                     $tmp_content = op_mod($option['module'])->output(array($section_name, $option_name), $mod_config, $mod_options, true);
                     $content = '';
                     if (is_array($tmp_content)) {
                         if (count($tmp_content) > 0) {
                             if ($option['module'] == 'content_fields') {
                                 $tmp_content = array('content' => $tmp_content);
                             }
                             if (isset($option['template'])) {
                                 if (is_array($option['template'])) {
                                     if (is_object($option['template'][0])) {
                                         if (is_callable($option['template'])) {
                                             $content = call_user_func_array($option['template'], array($tmp_content));
                                         }
                                     } else {
                                         $content = op_tpl($option['template'][0], $tmp_content, $option['template'][1]);
                                     }
                                 } else {
                                     if (is_callable($option['template'])) {
                                         $content = call_user_func_array($option['template'], array($tmp_content));
                                     } else {
                                         $content = $this->load_tpl('output/' . $option['template'], $tmp_content);
                                     }
                                 }
                             } else {
                                 $content = $this->load_tpl('output/' . $option['module'], $tmp_content);
                             }
                         }
                     } else {
                         $content = $tmp_content;
                     }
                     $feature_content[] = $content;
                 }
             }
         }
         $out = $before . implode('', $feature_content) . $after;
         if ($return) {
             return $out;
         }
         echo $out;
     }
 }
Esempio n. 12
0

                <?php 
        op_pagination();
        ?>


            </ul>


            <?php 
    }
}
?>
                    <?php 
op_mod('advertising')->display(array('advertising', 'home_page', 'bottom'));
?>
                    </div> <!-- end bloque-list -->
                <?php 
//op_sidebar()
?>



        </div>

        
    </div>

<?php 
get_footer();
Esempio n. 13
0
 function get_options($style)
 {
     //$content_fields = op_optin_default_fields();
     $vid_opts = array(array('values' => array('type' => 'video', 'width' => '540', 'height' => '350')), array('values' => array('type' => 'video', 'width' => '340', 'height' => '200')));
     $big_content = 'YToxOntpOjA7YToyOntzOjk6InJvd19jbGFzcyI7czozODoicm93IG9uZS1jb2wgZml4ZWQtd2lkdGggY2YgdWktc29ydGFibGUiO3M6NzoiY29sdW1ucyI7YToxOntpOjA7YToyOntzOjk6ImNvbF9jbGFzcyI7czo4OiJvbmUgY29scyI7czo4OiJlbGVtZW50cyI7YTo0OntpOjA7czoxMDU6IltoZWFkbGluZSBzdHlsZT1cIjE1XCIgYWxpZ249XCJjZW50ZXJcIl1IZXJlXCdzIGEgU2FtcGxlIEludGVybmV0IE1hcmtldGluZyBTdHlsZSBTcXVlZXplIFBhZ2VbL2hlYWRsaW5lXSI7aToxO3M6MjE4OiJbaGVhZGxpbmUgc3R5bGU9XCIxXCIgZm9udF9zaXplPVwiNDBcIiBmb250X2ZvbnQ9XCJBcmlhbFwiIGZvbnRfc3R5bGU9XCJib2xkXCIgZm9udF9jb2xvcj1cIiNDQjJEMDdcIiBhbGlnbj1cImNlbnRlclwiXUdldCBGcmVlLCBJbnN0YW50IEFjY2VzcyB0byB0aGUgVG9wIEZvdXIgQ2xpZW50LUdldHRpbmcgU3lzdGVtcyBmb3IgUGVyc29uYWwgVHJhaW5lcnPigKZbL2hlYWRsaW5lXSI7aToyO3M6MjE6IltkaXZpZGVyIHN0eWxlPVwiN1wiXSI7aTozO3M6NDU1OiJbdGV4dF9ibG9jayBzdHlsZT1cInN0eWxlXzEucG5nXCIgYWxpZ249XCJsZWZ0XCIgd2lkdGg9XCI1NDBcIl08c3Ryb25nPkdldCB0aGUgIyAxIEZBU1RFU1Qgd2F5IHRvIGdldHRpbmcgYWxsIHRoZSBmaXRuZXNzIGNsaWVudHMgeW91IGNhbiBoYW5kbGUgd2l0aG91dCBzcGVuZGluZyBhIGRpbWUgb24gYWR2ZXJ0aXNpbmcuPC9zdHJvbmc+DQoNCkhpIEknbSBCZWRyb3MgS2V1aWxpYW4sIHRoYXQncyBtZSBpbiB0aGUgcGljdHVyZSwgYW5kIHRoZSB2aWRlbyB5b3UncmUgYWJvdXQgdG8gd2F0Y2ggaXMgZnJvbSBteSAkMSwwMDAgcGVyIHBlcnNvbiBmaXRuZXNzIGJ1c2luZXNzLg0KDQpQbHVzLCBJJ2xsIGVtYWlsIHlvdSBteSB3ZWVrbHkgUFQgUHJvZml0cyBOZXdzbGV0dGVyIHBhY2tlZCB3aXRoIGN1dHRpbmcgZWRnZSBpZGVhcywgdGFjdGljcywgYW5kIHN0cmF0ZWdpZXMuWy90ZXh0X2Jsb2NrXSI7fX19fX0=';
     $default_title = __('Get Free, Instant Access to the Top Four Client-Getting Systems for Personal Trainers&hellip;', OP_SN);
     $default_title2 = __('Get Free, Instant Access to the Top Four Client-Getting Systems for Personal Trainers&hellip;', OP_SN);
     $default_subtitle = __('Get the # 1 FASTEST way to getting all the fitness clients you can handle without spending a dime on advertising.', OP_SN);
     $default_content = __('Hi I\'m Bedros Keuilian, that\'s me in the picture, and the video you\'re about to watch is from my $1,000 per person fitness business. Plus, I\'ll email you my weekly PT Profits Newsletter packed with cutting edge ideas, tactics, and strategies.', OP_SN);
     $default_content_2 = __('Hi I\'m Bedros Keuilian, that\'s me in the picture, and the video you\'re about to watch is from my $1,000 per person fitness business. Plus, I\'ll email you my weekly PT Profits Newsletter packed with cutting edge ideas, tactics, and strategies.', OP_SN);
     $optin_fields = array('title' => array('name' => __('Title', OP_SN), 'help' => __('Enter a title to be displayed above your optin form', OP_SN), 'default' => __('Sell Anything With OptimizePress', OP_SN)), 'subtitle' => array('name' => __('Sub Title', OP_SN), 'help' => __('Enter a sub title to be displayed above your optin form', OP_SN), 'default' => __('Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh.', OP_SN)), 'form_header' => array('name' => __('Form Header', OP_SN), 'help' => __('Enter a call to action for your form - tell the visitor what to do (e.g. Complete the form below&hellip;)', OP_SN), 'default' => __('Get This Report Now Free', OP_SN)), 'footer_note' => array('name' => __('Footer Security Note', OP_SN), 'help' => __('Enter your security or spam notice here to reassure your visitors their details will be safe with you', OP_SN), 'default' => __('Your information is 100% secure with us and will never be shared', OP_SN)), 'name_default' => array('name' => __('Name Default Value', OP_SN), 'help' => __('Enter the default text for the Name input field', OP_SN), 'default' => __('Enter Your Name...', OP_SN)), 'email_default' => array('name' => __('Email Default Value', OP_SN), 'help' => __('Enter the default text for the Email input field', OP_SN), 'default' => __('Enter Your Email...', OP_SN)));
     $content = array('title' => array('fields' => array('title' => array('type' => 'wysiwyg', 'name' => __('Title', OP_SN), 'default' => $default_title, 'unautop' => true))), 'title2' => array('fields' => array('title' => array('name' => __('Title', OP_SN), 'default' => $default_title2, 'element' => 'h1', 'type' => 'wysiwyg', 'unautop' => true))), 'title3' => array('fields' => array('title' => array('name' => __('Title', OP_SN), 'default' => $default_title2, 'element' => 'h2'))), 'subtitle' => array('fields' => array('subtitle' => array('name' => __('Sub Title', OP_SN), 'default' => $default_title2))), 'content' => array('fields' => array('content' => array('name' => __('Content', OP_SN), 'type' => 'wysiwyg', 'default' => $default_content_2, 'disable_font' => true))), 'image' => array('fields' => array('image' => array('type' => 'image', 'name' => __('Image File', OP_SN), 'default' => 'http://placehold.it/300x320', 'disable_font' => true))), 'arrow_text' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('title' => array('name' => __('Title', OP_SN), 'default' => __('Get Free Access Now', OP_SN), 'element' => 'h3'))), 'after_element' => '<img src="' . $this->global_imgs . 'featured-panel/free-access-now-red-arrows.png" alt="" width="209" height="92" />', 'before' => '<div class="get-access-now">', 'after' => '</div>'));
     $styles = array('A' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title'], 'before' => '<div class="twentyfour columns">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts[0], 'before' => '<div class="fifteen columns">', 'after' => '</div>'), 'content' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('subtitle' => array('default' => $default_subtitle, 'name' => __('Title', OP_SN)), 'content' => array('type' => 'wysiwyg', 'default' => $default_content, 'name' => __('Content', OP_SN), 'disable_font' => true))), 'before' => '<div class="nine columns">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form', 'before' => '<div class="twenty columns offset-by-two">', 'after' => '</div>', 'mod_options' => array('disable_name' => true, 'ignore_fields' => array('title', 'form_header', 'name_default')))), 'B' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title'], 'before' => '<div class="twentyfour columns">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts[0], 'before' => '<div class="fourteen columns">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form', 'before' => '<div class="nine columns offset-by-one">', 'after' => '</div>')), 'C' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title'], 'before' => '<div class="twentyfour columns">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts[0], 'before' => '<div class="fifteen columns">', 'after' => '</div>'), 'content' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('subtitle' => array('default' => $default_subtitle, 'name' => __('Title', OP_SN)), 'content' => array('type' => 'wysiwyg', 'default' => $default_content_2, 'name' => __('Content', OP_SN), 'disable_font' => true))), 'before' => '<div class="nine columns">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form', 'mod_options' => array('ignore_fields' => array('title', 'form_header')), 'before' => '<div class="twentyfour columns">', 'after' => '</div>')), 'D' => array('content' => array('module' => 'live_editor', 'module_type' => 'page', 'mod_options' => array('one_col' => true, 'default_layout' => $big_content), 'before' => '<div class="fourteen columns content">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts[1]), 'optin' => array('module' => 'signup_form', 'mod_options' => array('ignore_fields' => array('title'))), 'arrow_text' => $content['arrow_text']), 'E' => array('content' => array('module' => 'live_editor', 'module_type' => 'page', 'mod_options' => array('one_col' => true, 'default_layout' => $big_content), 'before' => '<div class="fourteen columns content">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => $vid_opts[1]), 'optin' => array('module' => 'signup_form', 'mod_options' => array('ignore_fields' => array('title'))), 'arrow_text' => $content['arrow_text']), 'F' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title2']), 'video' => array('module' => 'video', 'mod_options' => $vid_opts[0]), 'optin' => array('module' => 'signup_form')), 'G' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title'], 'before' => '<div class="twentyfour columns">', 'after' => '</div>'), 'image' => array('module' => 'content_fields', 'mod_options' => array('fields' => array('image' => array('type' => 'image', 'name' => __('Image File', OP_SN), 'default' => $this->global_imgs . 'feature-img.jpg', 'disable_font' => true))), 'after_element' => '<img src="' . $this->global_imgs . 'feature-img-arrows.jpg" alt="feature-img" width="204" height="414" />', 'before' => '<div class="thirteen columns">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form')), 'H' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title2'], 'before' => '<div class="fourteen columns">', 'after' => '</div>'), 'image1' => array('module' => 'content_fields', 'mod_options' => $content['image'], 'before' => '<div class="eight columns offset-by-two">', 'after' => '</div>'), 'optin' => array('module' => 'signup_form', 'mod_options' => array('theme' => '1', 'disable_name' => true, 'ignore_fields' => array('title', 'subtitle', 'footer_note', 'name_default'), 'content_fields' => $optin_fields), 'before' => '<div class="twentyfour columns">', 'after' => '</div>'), 'content' => array('module' => 'live_editor', 'module_type' => 'page', 'mod_options' => array('one_col' => true, 'default_layout' => 'YToxOntpOjA7YToyOntzOjk6InJvd19jbGFzcyI7czozODoicm93IG9uZS1jb2wgZml4ZWQtd2lkdGggY2YgdWktc29ydGFibGUiO3M6NzoiY29sdW1ucyI7YToxOntpOjA7YToyOntzOjk6ImNvbF9jbGFzcyI7czo4OiJvbmUgY29scyI7czo4OiJlbGVtZW50cyI7YToyOntpOjA7czoyMTg6IltoZWFkbGluZSBzdHlsZT1cIjFcIiBmb250X3NpemU9XCI0MFwiIGZvbnRfZm9udD1cIkFyaWFsXCIgZm9udF9zdHlsZT1cImJvbGRcIiBmb250X2NvbG9yPVwiI0NCMkQwN1wiIGFsaWduPVwiY2VudGVyXCJdR2V0IEZyZWUsIEluc3RhbnQgQWNjZXNzIHRvIHRoZSBUb3AgRm91ciBDbGllbnQtR2V0dGluZyBTeXN0ZW1zIGZvciBQZXJzb25hbCBUcmFpbmVyc+KAplsvaGVhZGxpbmVdIjtpOjE7czo0NTU6Ilt0ZXh0X2Jsb2NrIHN0eWxlPVwic3R5bGVfMS5wbmdcIiBhbGlnbj1cImxlZnRcIiB3aWR0aD1cIjU0MFwiXTxzdHJvbmc+R2V0IHRoZSAjIDEgRkFTVEVTVCB3YXkgdG8gZ2V0dGluZyBhbGwgdGhlIGZpdG5lc3MgY2xpZW50cyB5b3UgY2FuIGhhbmRsZSB3aXRob3V0IHNwZW5kaW5nIGEgZGltZSBvbiBhZHZlcnRpc2luZy48L3N0cm9uZz4NCg0KSGkgSSdtIEJlZHJvcyBLZXVpbGlhbiwgdGhhdCdzIG1lIGluIHRoZSBwaWN0dXJlLCBhbmQgdGhlIHZpZGVvIHlvdSdyZSBhYm91dCB0byB3YXRjaCBpcyBmcm9tIG15ICQxLDAwMCBwZXIgcGVyc29uIGZpdG5lc3MgYnVzaW5lc3MuDQoNClBsdXMsIEknbGwgZW1haWwgeW91IG15IHdlZWtseSBQVCBQcm9maXRzIE5ld3NsZXR0ZXIgcGFja2VkIHdpdGggY3V0dGluZyBlZGdlIGlkZWFzLCB0YWN0aWNzLCBhbmQgc3RyYXRlZ2llcy5bL3RleHRfYmxvY2tdIjt9fX19fQ=='), 'before' => '<div class="fourteen columns content">', 'after' => '</div>'), 'image2' => array('module' => 'content_fields', 'mod_options' => $content['image']), 'optin2' => array('module' => 'signup_form', 'mod_options' => array('theme' => '2', 'disable_name' => true, 'ignore_fields' => array('title', 'subtitle', 'name_default'), 'content_fields' => $optin_fields))), 'I' => array('title' => array('module' => 'content_fields', 'mod_options' => $content['title2'], 'before' => '<div class="twentyfour columns">', 'after' => '</div>'), 'content' => array('module' => 'content_fields', 'mod_options' => array('fields' => array_merge($content['subtitle']['fields'], $content['content']['fields'])), 'before' => '<div class="fourteen columns content-area">', 'after' => '</div>'), 'video' => array('module' => 'video', 'mod_options' => array('values' => array('type' => 'video', 'width' => '340', 'height' => '200'))), 'optin' => array('module' => 'signup_form', 'mod_options' => array('theme' => '1', 'disable_name' => true, 'ignore_fields' => array('name_default'), 'content_fields' => $optin_fields), 'before' => '<div class="nine columns">', 'after' => '</div>'), 'optin2' => array('module' => 'signup_form', 'mod_options' => array('theme' => '2', 'disable_name' => true, 'ignore_fields' => array('title', 'subtitle', 'name_default'), 'content_fields' => $optin_fields), 'before' => '<div class="twentyfour columns the-long-form">', 'after' => '</div>')), 'J' => array('content_large' => array('module' => 'live_editor', 'module_type' => 'page')));
     //1,6,2,7,3,8,4,9,5,10
     $style = isset($styles[$style]) ? $style : 'A';
     $this->style = $style;
     $this->options = $styles[$style];
     if ($style != 'J') {
         $this->options = array_merge(array('liveeditor_above' => array('module' => 'live_editor', 'module_type' => 'page')), $this->options, array('liveeditor_below' => array('module' => 'live_editor', 'module_type' => 'page')));
     }
     foreach ($this->options as $name => $options) {
         op_mod($options['module'], op_get_var($options, 'module_type', 'blog'));
         if (!isset($options['template'])) {
             if ($this->options[$name]['module'] == 'content_fields') {
                 $this->options[$name]['template'] = array($this, 'content_fields');
             } elseif ($this->options[$name]['module'] == 'signup_form') {
                 $this->options[$name]['template'] = array($this, 'optin_box');
                 $mod_options = op_get_var($options, 'mod_options', array());
                 $mod_options['disable'] = 'color_scheme';
                 if (!isset($mod_options['content_fields'])) {
                     $mod_options['content_fields'] = op_optin_default_fields();
                 }
                 $mod_options['submit_button_config'] = array('defaults' => array('content' => __('Get Started', OP_SN)));
                 $this->options[$name]['mod_options'] = $mod_options;
             } elseif ($this->options[$name]['module'] == 'video') {
                 $this->options[$name]['template'] = array($this, 'video_placeholder');
             }
         }
     }
     $this->options['template'] = array($this, 'style_template');
 }
Esempio n. 14
0
 function save_step()
 {
     //Get the primary OP object
     $op = $_POST['op'];
     //Get sections
     $sections_op = op_get_var($op, 'sections', array());
     //Loop through sections
     foreach ($this->sections as $name => $section) {
         //Get current sections
         $sections = $section['object']->sections();
         //Loop through sub sections
         foreach ($sections as $section_name => $section_section) {
             if (is_array($section_section)) {
                 if (isset($section_section['save_action'])) {
                     call_user_func_array($section_section['save_action'], array($sections_op));
                 }
                 if (isset($section_section['module'])) {
                     $mod_ops = op_get_var($op, $section_name, array());
                     $opts = op_get_var($section_section, 'options', array());
                     op_mod($section_section['module'])->save_settings($section_name, $opts, $mod_ops);
                 }
             }
         }
     }
     if (op_has_error()) {
         $this->error = __('There was a problem processing the form, please review the errors below', 'optimizepress');
     } else {
         $this->notification = __('Your settings have been updated.', 'optimizepress');
     }
 }
Esempio n. 15
0
        </style>
        <?php 
    }
    ?>
    <nav id="nav-bottom" class="navigation">
        <div class="content-width cf">
            <ul id="navigation-below"><?php 
    wp_nav_menu(array('theme_location' => 'primary', 'items_wrap' => '%3$s', 'container' => false, 'walker' => new Op_Arrow_Walker_Nav_Menu()));
    ?>
</ul>
        </div>
    </nav>
    <?php 
}
if (is_home()) {
    op_mod('feature_area')->display('home_feature');
}
$class = op_default_attr('column_layout', 'option');
$add_sidebar = true;
if (defined('OP_SIDEBAR')) {
    if (OP_SIDEBAR === false) {
        $class = 'no-sidebar';
        $add_sidebar = false;
    } else {
        $class = OP_SIDEBAR;
    }
}
?>


    <!-- <div class="main-content content-width cf <?php 
Esempio n. 16
0
    the_title();
    ?>
</h1>
                    <div class="single-post-content cf">
						<?php 
    the_content();
    ?>
                        <?php 
    wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', OP_SN) . '</span>', 'after' => '</div>'));
    ?>
                    </div>
				</div> <!-- end .latest-post -->

				<?php 
    op_mod('advertising')->display(array('advertising', 'post_page', 'bottom'));
    ?>

                <?php 
    op_mod('related_posts')->display('related_posts', array('before' => '<div class="related-posts cf"><h3 class="section-header"><span>' . __('RELATED POSTS', OP_SN) . '</span></h3>', 'after' => '</div>', 'ulclass' => 'cf'));
    ?>
				<?php 
    comments_template('', true);
    ?>
            </div>
           	<?php 
}
op_sidebar();
?>

<?php 
get_footer();
Esempio n. 17
0
 function save_step($redirect = true)
 {
     $op = $_POST['op'];
     $sections_op = op_get_var($op, 'sections', array());
     $sections = $this->sections->sections();
     foreach ($sections as $name => $section) {
         if (is_array($section)) {
             if (isset($section['save_action'])) {
                 call_user_func_array($section['save_action'], array($sections_op));
             }
             if (isset($section['module'])) {
                 $mod_ops = op_get_var($op, $name, array());
                 $opts = op_get_var($section, 'options', array());
                 op_mod($section['module'])->save_settings($name, $opts, $mod_ops);
             }
         }
     }
     if (!op_has_error() && $redirect) {
         wp_redirect(menu_page_url(OP_SN . '-setup-wizard', false) . '&step=' . ++$this->cur_step);
     }
 }
Esempio n. 18
0
 function output($section_name, $config, $op, $return = false)
 {
     $disable = $this->_get_disabled($config);
     if (is_array($section_name[0]) && count($section_name) > 1) {
         $tmp = $section_name;
         $section_name = $section_name[0];
         for ($i = 1, $sl = count($tmp); $i < $sl; $i++) {
             array_push($section_name, $tmp[$i]);
         }
     }
     $data = $used_fields = array();
     if (isset($op['form_html'])) {
         $order = array();
         $fh = $op['form_html'];
         $data['before_form'] = op_get_var($config, 'before_form');
         $data['after_form'] = op_get_var($config, 'after_form');
         $data['extra_fields'] = array();
         $form_class = '';
         $disable_name = op_get_var($fh, 'disable_name', 'N') == 'Y';
         $js_defaults = array();
         $fields = array('email');
         $order[op_get_var($fh, 'email_order', 0)][] = 'email_input';
         if (!$disable_name) {
             array_unshift($fields, 'name');
             $order[op_get_var($fh, 'name_order', 0)][] = 'name_input';
         }
         $required = 'required="required"';
         switch (op_get_var($fh, 'integration_type')) {
             case 'email':
                 $email_address = op_get_var($fh, 'email_address');
                 $redirect_url = op_get_var($fh, 'redirect_url');
                 if (!isset($disable['content']) && isset($op['content'])) {
                     foreach ($fields as $field) {
                         if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                             $js_defaults[$field] = $op['content'][$field . '_default'];
                         }
                     }
                     if (count($js_defaults) > 0) {
                         $count = count($this->output_defaults);
                         $this->output_defaults[++$count] = $js_defaults;
                         $form_class = 'op-signup-form-' . $count;
                     }
                 }
                 $new_fields = array();
                 foreach ($fields as $field) {
                     if ($field == 'email') {
                         $data[$field . '_input'] = '<input type="email" required="required" name="' . $field . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     } else {
                         $requiredField = '';
                         if (!isset($fh['name_required']) || op_get_var($fh, 'name_required') == 'Y') {
                             $requiredField = $required;
                         }
                         $data[$field . '_input'] = '<input type="text" ' . $requiredField . ' name="' . $field . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     }
                     $new_fields[$field] = array('name' => $field, 'text' => op_get_var($js_defaults, $field));
                 }
                 $extra_fields = op_get_var($fh, 'email_extra_fields', array());
                 $extra_fields_order = op_get_var($fh, 'email_extra_fields_order', array());
                 $extra_fields_required = op_get_var($fh, 'email_extra_fields_required', array());
                 $new_extra = array();
                 if (is_array($extra_fields)) {
                     $counter = 1;
                     foreach ($extra_fields as $field) {
                         $new_extra['op_extra_' . $counter] = $field;
                         $requiredField = '';
                         if (isset($extra_fields_required[$counter - 1]) && $extra_fields_required[$counter - 1] == 'Y') {
                             $requiredField = $required;
                         }
                         $data['extra_fields']['op_extra_' . $counter] = '<input type="text" ' . $requiredField . ' name="op_extra_' . $counter . '" placeholder="' . op_attr($field) . '" />';
                         $field_order = $order[op_get_var($extra_fields_order, $counter - 1, 0)][] = 'op_extra_' . $counter;
                         $counter++;
                     }
                 }
                 $data['form_open'] = '<form action="' . op_current_url() . '" method="post" class="op-optin-validation ' . $form_class . '">';
                 $data['form_close'] = '</form>';
                 $hidden = array('email_to' => $email_address, 'redirect_url' => $redirect_url, 'extra_fields' => $new_extra, 'fields' => $new_fields);
                 $data['hidden_elems'] = '<input type="hidden" name="op_optin_form_data" value="' . op_attr(base64_encode(serialize($hidden))) . '" /><input type="hidden" name="op_optin_form" value="Y" />';
                 break;
             case 'custom':
             case 'oneshoppingcart':
                 if ('Y' === op_get_var($fh, 'gotowebinar_enabled', 'N')) {
                     $action = get_bloginfo('url') . '/process-optin-form/';
                 } else {
                     $action = op_get_var($fh, 'action');
                 }
                 if ($action != '') {
                     if (!isset($disable['content']) && isset($op['content'])) {
                         foreach ($fields as $field) {
                             if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                                 $js_defaults[$field] = $op['content'][$field . '_default'];
                             }
                         }
                         if (count($js_defaults) > 0) {
                             $count = count($this->output_defaults);
                             $this->output_defaults[++$count] = $js_defaults;
                             $form_class = 'op-signup-form-' . $count;
                         }
                     }
                     $data['form_open'] = '<form action="' . $action . '" method="' . op_get_var($fh, 'method', 'post') . '" class="op-optin-validation ' . $form_class . '">';
                     $data['form_close'] = '</form>';
                     foreach ($fields as $field) {
                         $fieldname = '';
                         if (isset($fh[$field . '_box']) && !empty($fh[$field . '_box'])) {
                             $used_fields[$fh[$field . '_box']] = true;
                             $fieldname = $fh[$field . '_box'];
                         }
                         if ('email' == $field) {
                             $data[$field . '_input'] = '<input type="email" required="required" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                         } else {
                             $requiredField = '';
                             if (!isset($fh['name_required']) || op_get_var($fh, 'name_required') == 'Y') {
                                 $requiredField = $required;
                             }
                             $data[$field . '_input'] = '<input type="text" ' . $requiredField . ' name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                         }
                     }
                     $extra_fields = op_get_var($fh, 'extra_fields', array());
                     $field_names = op_get_var($extra_fields, 'field_name', array());
                     $field_titles = op_get_var($extra_fields, 'title', array());
                     $field_text = op_get_var($extra_fields, 'text', array());
                     $field_order = op_get_var($extra_fields, 'order', array());
                     $field_required = op_get_var($extra_fields, 'required', array());
                     $field_hidden = op_get_var($extra_fields, 'hidden', array());
                     for ($i = 0, $il = count($field_names); $i < $il; $i++) {
                         $fieldname = $field_names[$i];
                         if ($field_names[$i] == '' || $field_names[$i] == 'op_add_new_field') {
                             $fieldname = $field_titles[$i];
                         }
                         if (isset($field_hidden[$i]) && $field_hidden[$i] == 'Y') {
                             $data['extra_fields'][$fieldname] = '<input type="hidden" name="' . op_attr($fieldname) . '" value="' . do_shortcode(stripslashes($field_text[$i])) . '" />';
                         } else {
                             $requiredField = '';
                             if (isset($field_required[$i]) && $field_required[$i] == 'Y') {
                                 $requiredField = $required;
                             }
                             $data['extra_fields'][$fieldname] = '<input type="text" ' . $requiredField . ' name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr($field_text[$i]) . '" />';
                         }
                         $order[op_get_var($field_order, $i, 0)][] = $fieldname;
                         $used_fields[$fieldname] = true;
                     }
                     $hidden_elems = '';
                     if (isset($fh['fields']) && isset($fh['fields']['field_name']) && isset($fh['fields']['field_vals'])) {
                         $field_names = $fh['fields']['field_name'];
                         $field_vals = $fh['fields']['field_vals'];
                         $field_count = count($field_names);
                         if (is_array($field_names) && is_array($field_vals) && $field_count == count($field_vals)) {
                             for ($i = 0; $i < $field_count; $i++) {
                                 if (!isset($used_fields[$field_names[$i]])) {
                                     $hidden_elems .= '<input type="hidden" name="' . op_attr($field_names[$i]) . '" value="' . op_attr($field_vals[$i]) . '" />';
                                 }
                             }
                         }
                     }
                     $data['hidden_elems'] = $hidden_elems;
                     $data['hidden_elems'] .= '<input type="hidden" name="redirect_url" value="' . op_get_var($fh, 'action') . '" />';
                 }
                 break;
             case 'infusionsoft':
                 if (op_get_var($fh, 'gotowebinar')) {
                     $action = get_bloginfo('url') . '/process-optin-form/';
                 } else {
                     $action = op_get_var($fh, 'action_page');
                 }
                 if (!isset($disable['content']) && isset($op['content'])) {
                     foreach ($fields as $field) {
                         if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                             $js_defaults[$field] = $op['content'][$field . '_default'];
                         }
                     }
                     if (count($js_defaults) > 0) {
                         $count = count($this->output_defaults);
                         $this->output_defaults[++$count] = $js_defaults;
                         $form_class = 'op-signup-form-' . $count;
                     }
                 }
                 $data['form_open'] = '<form action="' . esc_url($action) . '" method="POST" class="op-optin-validation ' . $form_class . '">';
                 $data['form_close'] = '</form>';
                 /*
                  * Hardcoding the email field name
                  */
                 $fh['email_box'] = 'inf_field_Email';
                 foreach ($fields as $field) {
                     $fieldname = '';
                     if (isset($fh[$field . '_box']) && !empty($fh[$field . '_box'])) {
                         $used_fields[$fh[$field . '_box']] = true;
                         $fieldname = $fh[$field . '_box'];
                     }
                     if ('email' == $field) {
                         $data[$field . '_input'] = '<input type="email" required="required" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     } else {
                         $requiredField = '';
                         if (!isset($fh['name_required']) || op_get_var($fh, 'name_required') == 'Y') {
                             $requiredField = $required;
                         }
                         $data[$field . '_input'] = '<input type="text" ' . $requiredField . ' name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     }
                 }
                 $extra_fields = op_get_var($fh, 'extra_fields', array());
                 $field_names = op_get_var($extra_fields, 'field_name', array());
                 $field_titles = op_get_var($extra_fields, 'title', array());
                 $field_text = op_get_var($extra_fields, 'text', array());
                 $field_order = op_get_var($extra_fields, 'order', array());
                 $field_required = op_get_var($extra_fields, 'required', array());
                 $field_hidden = op_get_var($extra_fields, 'hidden', array());
                 for ($i = 0, $il = count($field_names); $i < $il; $i++) {
                     $fieldname = $field_names[$i];
                     if ($field_names[$i] == '' || $field_names[$i] == 'op_add_new_field') {
                         $fieldname = $field_titles[$i];
                     }
                     if (isset($field_hidden[$i]) && $field_hidden[$i] == 'Y') {
                         $data['extra_fields'][$fieldname] = '<input type="hidden" name="' . op_attr($fieldname) . '" value="' . do_shortcode(stripslashes($field_text[$i])) . '" />';
                     } else {
                         $requiredField = '';
                         if (isset($field_required[$i]) && $field_required[$i] == 'Y') {
                             $requiredField = $required;
                         }
                         $data['extra_fields'][$fieldname] = '<input type="text" ' . $requiredField . ' name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr($field_text[$i]) . '" />';
                     }
                     $order[op_get_var($field_order, $i, 0)][] = $fieldname;
                     $used_fields[$fieldname] = true;
                 }
                 $hidden_elems = '';
                 $infusionSoftHiddenFields = op_assets_provider_item_fields('infusionsoft', op_get_var($fh, 'list'));
                 foreach ($infusionSoftHiddenFields['hidden'] as $infusionFieldName => $infusionFieldValue) {
                     $hidden_elems .= '<input type="hidden" name="' . $infusionFieldName . '" value="' . $infusionFieldValue . '" />';
                 }
                 $thankYouPage = op_get_var($fh, 'thank_you_page');
                 $thankYouPage = empty($thankYouPage) ? op_current_url() : $thankYouPage;
                 $alreadySubscribed = op_get_var($fh, 'already_subscribed_url');
                 $data['hidden_elems'] = $hidden_elems;
                 $data['hidden_elems'] .= '<input type="hidden" name="provider" value="' . op_get_var($fh, 'integration_type') . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="redirect_url" value="' . $thankYouPage . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="already_subscribed_url" value="' . $alreadySubscribed . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="list" value="' . op_get_var($fh, 'list') . '" />';
                 break;
             case 'arpreach':
             case 'aweber':
             case 'mailchimp':
             case 'mailpoet':
             case 'icontact':
             case 'getresponse':
             case 'campaignmonitor':
             case 'constantcontact':
             case 'convertkit':
             case 'activecampaign':
             case 'officeautopilot':
             case 'ontraport':
             case 'emma':
             case 'egoi':
             case 'maropost':
                 $action = get_bloginfo('url') . '/process-optin-form/';
                 if (!isset($disable['content']) && isset($op['content'])) {
                     foreach ($fields as $field) {
                         if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                             $js_defaults[$field] = $op['content'][$field . '_default'];
                         }
                     }
                     if (count($js_defaults) > 0) {
                         $count = count($this->output_defaults);
                         $this->output_defaults[++$count] = $js_defaults;
                         $form_class = 'op-signup-form-' . $count;
                     }
                 }
                 $data['form_open'] = '<form action="' . esc_url($action) . '" method="POST" class="op-optin-validation ' . $form_class . '">';
                 $data['form_close'] = '</form>';
                 /*
                  * Hardcoding the email field name
                  */
                 $fh['email_box'] = 'email';
                 foreach ($fields as $field) {
                     $fieldname = '';
                     if (isset($fh[$field . '_box']) && !empty($fh[$field . '_box'])) {
                         $used_fields[$fh[$field . '_box']] = true;
                         $fieldname = $fh[$field . '_box'];
                     }
                     if ('email' == $field) {
                         $data[$field . '_input'] = '<input type="email" required="required" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     } else {
                         $requiredField = '';
                         if (!isset($fh['name_required']) || op_get_var($fh, 'name_required') == 'Y') {
                             $requiredField = $required;
                         }
                         $data[$field . '_input'] = '<input type="text" ' . $requiredField . ' name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     }
                 }
                 $extra_fields = op_get_var($fh, 'extra_fields', array());
                 $field_names = op_get_var($extra_fields, 'field_name', array());
                 $field_titles = op_get_var($extra_fields, 'title', array());
                 $field_text = op_get_var($extra_fields, 'text', array());
                 $field_order = op_get_var($extra_fields, 'order', array());
                 $field_required = op_get_var($extra_fields, 'required', array());
                 $field_hidden = op_get_var($extra_fields, 'hidden', array());
                 for ($i = 0, $il = count($field_names); $i < $il; $i++) {
                     $fieldname = $field_names[$i];
                     if ($field_names[$i] == '' || $field_names[$i] == 'op_add_new_field') {
                         $fieldname = $field_titles[$i];
                     }
                     if (isset($field_hidden[$i]) && $field_hidden[$i] == 'Y') {
                         $data['extra_fields'][$fieldname] = '<input type="hidden" name="' . op_attr($fieldname) . '" value="' . do_shortcode(stripslashes($field_text[$i])) . '" />';
                     } else {
                         $requiredField = '';
                         if (isset($field_required[$i]) && $field_required[$i] == 'Y') {
                             $requiredField = $required;
                         }
                         $data['extra_fields'][$fieldname] = '<input type="text" ' . $requiredField . ' name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr($field_text[$i]) . '" />';
                     }
                     $order[op_get_var($field_order, $i, 0)][] = $fieldname;
                     $used_fields[$fieldname] = true;
                 }
                 $thankYouPage = op_get_var($fh, 'thank_you_page');
                 $thankYouPage = empty($thankYouPage) ? op_current_url() : $thankYouPage;
                 $alreadySubscribed = op_get_var($fh, 'already_subscribed_url');
                 $list = op_get_var($fh, 'list');
                 $data['hidden_elems'] = '<input type="hidden" name="provider" value="' . op_get_var($fh, 'integration_type') . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="redirect_url" value="' . $thankYouPage . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="already_subscribed_url" value="' . $alreadySubscribed . '" />';
                 if (op_get_var($fh, 'integration_type') === 'mailchimp') {
                     $data['hidden_elems'] .= '<input type="hidden" name="double_optin" value="' . op_get_var($fh, 'double_optin') . '" />';
                     $data['hidden_elems'] .= '<input type="hidden" name="welcome_email" value="' . op_get_var($fh, 'welcome_email') . '" />';
                 }
                 if (op_get_var($fh, 'integration_type') === 'emma') {
                     $data['hidden_elems'] .= '<input type="hidden" name="signup_form_id" value="' . op_get_var($fh, 'signup_form_id') . '" />';
                 }
                 /*
                  * In case that user selected arpReach as EMS we need to substitute list param with its "autoresponder_name" param
                  */
                 if (op_get_var($fh, 'integration_type') === 'arpreach') {
                     $list = op_get_var($fh, 'autoresponder_name');
                 }
                 $data['hidden_elems'] .= '<input type="hidden" name="list" value="' . $list . '" />';
                 break;
         }
         if (op_get_var($fh, 'gotowebinar') && 'Y' === op_get_var($fh, 'gotowebinar_enabled')) {
             $data['hidden_elems'] .= '<input type="hidden" name="gotowebinar" value="' . op_get_var($fh, 'gotowebinar') . '" />';
         }
         if (op_get_var($fh, 'opm_level') && 'Y' === op_get_var($fh, 'opm_integration')) {
             $data['hidden_elems'] .= '<input type="hidden" name="opm_level" value="' . op_get_var($fh, 'opm_level') . '" />';
         }
         if (op_get_var($fh, 'opm_packages') && 'Y' === op_get_var($fh, 'opm_integration')) {
             $data['hidden_elems'] .= '<input type="hidden" name="opm_packages" value="' . implode(',', op_get_var($fh, 'opm_packages')) . '" />';
         }
         $data['order'] = flatten_multidim_array($order, true);
     }
     $tpl = '';
     $out = '';
     $data['content'] = array();
     if (!isset($disable['content'])) {
         $fields = $this->_get_fields($config);
         $data['content'] = op_mod('content_fields')->output(array($section_name, 'content'), array('fields' => $fields), op_get_var($op, 'content', array()));
     }
     $btnconf = op_get_var($config, 'submit_button_config', array());
     if (isset($op['submit_button'])) {
         $btnop = $op['submit_button'];
     } else {
         $btnop = array();
         if (!isset($btnconf['type'])) {
             $btnop['type'] = 0;
         }
         if (isset($btnconf['defaults']) && isset($btnconf['defaults']['content'])) {
             $btnop['content'] = $btnconf['defaults']['content'];
         }
     }
     if (is_array($btnop)) {
         $data['submit_button'] = op_mod('submit_button')->save_settings(array($section_name, 'submit_button'), $btnconf, $btnop, true);
     } else {
         $data['submit_button'] = $btnop;
     }
     if (!isset($disable['color_scheme'])) {
         $styles = $this->_get_color_schemes($section_name, $config);
         if (count($styles) > 0) {
             $tpl = 'output';
             $style = op_get_current_item($styles, op_get_var($op, 'color_scheme'));
             if (isset($styles[$style]['output'])) {
                 $tpl = $styles[$style]['output'];
             }
             $data['color_scheme'] = $style;
         }
     }
     if (isset($config['template'])) {
         $tpl = $config['template'];
     }
     if (!empty($tpl)) {
         $out = $this->load_tpl('output/' . $tpl, $data);
     }
     /*
      * Loading validation script
      */
     op_validation_script();
     if (!empty($out)) {
         if ($return) {
             return $out;
         }
         echo $out;
         return true;
     } else {
         return $data;
     }
 }
Esempio n. 19
0
 function one_time_offer_counter()
 {
     if (defined('OP_LIVEEDITOR')) {
         return '<div class="one-time-offer-placeholder">&nbsp;</div>';
     }
     $time_left = op_mod('one_time_offer', 'page')->get_time_left();
     if (is_array($time_left)) {
         if ($time_left[0] === 0) {
             header('Location: ' . $time_left[1]);
             exit;
         } else {
             if (isset(self::$temp_vars['one_time_offer'])) {
                 self::$temp_vars['one_time_offer']++;
             } else {
                 self::$temp_vars['one_time_offer'] = 1;
             }
             self::$temp_vars['one_time_offer_url'] = $time_left[1];
             self::$temp_vars['one_time_offer_time'] = $time_left[0];
             self::$temp_vars['one_time_offer_format'] = $time_left[2];
             return '<div id="one-time-offer-counter-' . self::$temp_vars['one_time_offer'] . '" class="onetime-offer-counter" style="width:' . $time_left[3] . 'px"></div>';
         }
     }
 }
Esempio n. 20
0
function op_page_footer()
{
    $op_fonts = new OptimizePress_Fonts();
    if (($footer = op_page_option('footer_area')) !== false && op_get_var($footer, 'enabled') == 'Y') {
        ?>
		<div class="full-width footer small-footer-text">
        	<?php 
        if (!(op_page_config('disable', 'layout', 'footer_area', 'large_footer') === true)) {
            if (isset($footer['large_footer']) && isset($footer['large_footer']['enabled']) && $footer['large_footer']['enabled'] == 'Y') {
                echo $GLOBALS['op_footer_layout'];
            }
        }
        ?>
			<div class="row">
				<div class="fixed-width">
				<?php 
        //Init the style variables
        $font_family_style = '';
        $font_weight_style = '';
        $font_size_style = '';
        $font_style = '';
        //If not empty, set the font family style and add font to system
        if (!empty($footer['font_family'])) {
            $op_fonts->add_font($footer['font_family']);
            $font_family_style .= 'font-family: "' . $footer['font_family'] . '", sans-serif;';
        }
        //If not empty, set the font style
        if (!empty($footer['font_weight'])) {
            if (strstr(strtolower($footer['font_weight']), '300')) {
                $font_weight_style .= 'font-weight: 300;';
            }
            if (strstr(strtolower($footer['font_weight']), 'bold')) {
                $font_weight_style .= 'font-weight: bold;';
            }
            if (strstr(strtolower($footer['font_weight']), 'italic')) {
                $font_weight_style .= 'font-style: italic;';
            }
        }
        //If not empty, set the font size
        if (!empty($footer['font_size'])) {
            $font_size_style .= 'font-size: ' . $footer['font_size'] . 'px;';
        }
        //If not empty, set the font shadow
        if (!empty($footer['font_shadow'])) {
            $textShadow = '';
            switch (strtolower(str_replace(' ', '', $footer['font_shadow']))) {
                case 'textshadow':
                case 'none':
                    $textShadow = 'none';
                    break;
                case 'light':
                    $textShadow = '1px 1px 0px rgba(255,255,255,0.5)';
                    break;
                case 'dark':
                default:
                    $textShadow = '0 1px 1px #000000, 0 1px 1px rgba(0, 0, 0, 0.5)';
            }
            $font_style .= 'text-shadow: ' . $textShadow . ';';
        }
        //Output the styles to the page
        echo '
						<style>
							.footer-navigation ul li a,
							.footer-navigation ul li a:hover{
								' . $font_family_style . $font_size_style . $font_style . $font_weight_style . '
							}

							.footer,
							.footer p,
							.op-promote a,
							.footer .footer-copyright,
							.footer .footer-disclaimer{
								' . $font_family_style . $font_style . $font_weight_style . '
							}

							.footer p{ ' . $font_size_style . ' }
						</style>
					';
        //Get the disclaimer text ready
        $disclaimer = op_get_var($footer, 'footer_disclaimer', array());
        $site_footer = op_default_option('site_footer');
        $disc = !empty($disclaimer['message']) ? $disclaimer['message'] : $site_footer['disclaimer'];
        //Print out the disclaimer if it's not empty
        echo !empty($disc) && $disclaimer['enabled'] == 'Y' ? '<small class="footer-disclaimer">' . stripslashes($disc) . '</small>' : '';
        //Echo out the nav if it's set
        echo !empty($footer['nav']) ? '
						<nav class="footer-navigation">
							<ul id="nav-footer" class="inline-nav">
								' . wp_nav_menu(array('menu' => $footer['nav'], 'items_wrap' => '%3$s', 'container' => false, 'depth' => 1, 'echo' => false)) . '
							</ul>
						</nav>
					' : '';
        //Print out the copyright notice
        //$copy = op_default_option('copyright_notice');
        echo !empty($site_footer['copyright']) ? '<p class="footer-copyright">' . $site_footer['copyright'] . '</p>' : '';
        //Display any additional information
        op_mod('promotion')->display();
        ?>
				</div>
			</div>
		</div>
        <?php 
    }
}
Esempio n. 21
0
    ?>
            </div>
		</div>
        <?php 
}
?>
	<div class="footer">
		<div class="content-width">
			<div class="footer-content cf">
				<div class="footer-left">
					<?php 
$copy = op_default_option('copyright_notice');
if (!empty($copy)) {
    echo '<p>' . $copy . '<br /></p>';
}
op_mod('promotion')->display();
?>
				</div>
				<?php 
has_nav_menu('footer') && wp_nav_menu(array('theme_location' => 'footer', 'depth' => 1));
?>
			</div>
		</div>
	</div>
</div>
<?php 
op_footer();
?>
	<script src="<?php 
echo home_url();
?>
Esempio n. 22
0
    ?>
		<?php 
    op_get_var_e($content, 'form_header', '', '<p>%1$s</p>');
    ?>
		<?php 
    echo $form_open;
    ?>
		<div>
			<?php 
    echo $hidden_elems . (isset($name_input) ? $name_input : '') . $email_input;
    if (isset($extra_fields)) {
        echo implode('', $extra_fields);
    }
    ?>
				<?php 
    op_mod('submit_button')->output(array('submit_button'), array(), $submit_button);
    ?>
		</div>
		<?php 
    echo $form_close;
    ?>
		<?php 
    op_get_var_e($content, 'footer_note', '', '<p class="secure-icon">%1$s</p>');
    ?>
	<?php 
} elseif ($color_scheme >= 0 && $color_scheme < 9) {
    ?>
		<?php 
    op_get_var_e($content, 'headline', '', '<h2>%1$s</h2>');
    ?>
		<div class="optin-box-content">
Esempio n. 23
0
 /**
  * AJAX calls this function to save colours section of Live editor
  * @return void
  */
 function save_colours()
 {
     $this->check_nonce();
     $this->init_page();
     $this->_sections(true);
     $op = $_POST['op'];
     foreach ($this->sections as $name => $section) {
         $sections = $section['object'];
         foreach ($sections as $section_name => $section_section) {
             if (is_array($section_section)) {
                 if (isset($section_section['save_action'])) {
                     call_user_func_array($section_section['save_action'], array(op_get_var($op, $section_name, array())));
                 }
                 if (isset($section_section['module'])) {
                     $mod_ops = op_get_var($op, $section_name, array());
                     $opts = op_get_var($section_section, 'options', array());
                     op_mod($section_section['module'], op_get_var($section_section, 'module_type', 'blog'))->save_settings($section_name, $opts, $mod_ops);
                 }
             }
         }
     }
     echo json_encode(array('done' => true));
     exit;
 }
Esempio n. 24
0
function op_init_page_theme($load_modules = true)
{
    require_once OP_FUNC . 'page.php';
    op_page_file('functions');
    op_page_file('functions', array(), OP_PAGES . 'global/');
    $tpl_type = op_page_option('theme', 'type');
    $tpl_dir = op_page_option('theme', 'dir');
    if ($tpl_dir) {
        define('OP_PAGE_DIR', OP_PAGES . $tpl_type . '/' . $tpl_dir . '/');
        define('OP_PAGE_DIR_REL', '/pages/' . $tpl_type . '/' . $tpl_dir . '/');
        define('OP_PAGE_URL', OP_URL . 'pages/' . $tpl_type . '/' . $tpl_dir . '/');
        require_once OP_FUNC . 'feature_area.php';
        $class = 'OptimizePress_Page_Feature_Area';
        if (file_exists(OP_PAGE_DIR . 'feature_area.php')) {
            require_once OP_PAGE_DIR . 'feature_area.php';
        } elseif (file_exists(OP_PAGES . 'global/feature_areas/' . $tpl_type . '.php')) {
            require_once OP_PAGES . 'global/feature_areas/' . $tpl_type . '.php';
        } else {
            $class = 'OptimizePress_Page_Feature_Area_Base';
        }
        $GLOBALS['op_feature_area'] = new $class();
    }
    if ($load_modules) {
        if (!(op_page_config('disable', 'functionality') === true)) {
            require_once OP_LIB . 'sections/page/functionality.php';
            $object = new OptimizePress_Sections_Functionality();
            $GLOBALS['functionality_sections'] = $object->sections();
            foreach ($GLOBALS['functionality_sections'] as $name => $section) {
                if (isset($section['module'])) {
                    op_mod($section['module'], op_get_var($section, 'module_type', 'blog'), array('section' => $name));
                }
            }
        }
        do_action('op_page_module_init');
    }
}
Esempio n. 25
0
 function content_template_fb($fields, $values)
 {
     op_mod('comments')->need_js = true;
     return $this->content_fields($fields, $values);
 }
Esempio n. 26
0
 function save_step_4()
 {
     $op_fonts = new OptimizePress_Fonts();
     $op = $_POST['op'];
     foreach ($this->sections as $name => $section) {
         $sections = $section['object']->sections();
         foreach ($sections as $section_name => $section_section) {
             if (is_array($section_section)) {
                 if (isset($section_section['save_action'])) {
                     call_user_func_array($section_section['save_action'], array(op_get_var($op, $section_name, array())));
                 }
                 if (isset($section_section['module'])) {
                     $mod_ops = op_get_var($op, $section_name, array());
                     $opts = op_get_var($section_section, 'options', array());
                     op_mod($section_section['module'], op_get_var($section_section, 'module_type', 'blog'))->save_settings($section_name, $opts, $mod_ops);
                 }
             }
         }
     }
     //Set this page's typography settings to be that of the defaults
     $default_typography = op_default_option('default_typography');
     if (!empty($default_typography) && isset($default_typography['font_elements'])) {
         foreach ($default_typography['font_elements'] as $typography) {
             $op_fonts->add_font($typography['font']);
         }
         op_update_page_option('typography', $default_typography);
     }
     if (op_has_error()) {
         $this->error = __('There was a problem processing the form, please review the errors below', OP_SN);
     }
     /* else {
     			$this->notification = __('Your page settings have been updated.',OP_SN);
     		}*/
     $this->_redirect();
 }
Esempio n. 27
0
 function save_features()
 {
     //opLog('POST: ' . print_r($_POST, true));
     //opLog('OPTIONS :' . print_r($this->options, true));
     $font_options = op_page_option('feature_area', 'settings', 'font_options');
     if (!is_array($font_options)) {
         $font_options = array();
     }
     if ($this->enabled && count($this->options) > 0) {
         foreach ($this->options as $name => $options) {
             if ($name == 'template') {
                 continue;
             }
             $op = op_post('feature_area', $name);
             $mod_options = op_get_var($options, 'mod_options', array());
             $module = op_mod($options['module'], op_get_var($options, 'module_type', 'blog'))->save_settings(array('feature_area', $name), $mod_options, $op, true, true);
             if ($options['module'] == 'content_fields') {
                 if (isset($module[0])) {
                     $font_options[$name] = $module[1];
                     $module = $module[0];
                 }
             }
             op_update_page_option('feature_area', 'settings', $name, $module);
         }
     }
     op_update_page_option('feature_area', 'settings', 'font_options', $font_options);
 }
 function widget($args, $instance)
 {
     op_mod('signup_form')->display(array('sidebar_optin'), false, array('before_form' => '<div class="sidebar-section sidebar-form">', 'after_form' => '</div>'));
 }
Esempio n. 29
0
 function output($section_name, $config, $op, $return = false)
 {
     $disable = $this->_get_disabled($config);
     if (is_array($section_name[0]) && count($section_name) > 1) {
         $tmp = $section_name;
         $section_name = $section_name[0];
         for ($i = 1, $sl = count($tmp); $i < $sl; $i++) {
             array_push($section_name, $tmp[$i]);
         }
     }
     $data = $used_fields = array();
     if (isset($op['form_html'])) {
         $fh = $op['form_html'];
         $data['before_form'] = op_get_var($config, 'before_form');
         $data['after_form'] = op_get_var($config, 'after_form');
         $data['extra_fields'] = array();
         $form_class = '';
         $disable_name = op_get_var($fh, 'disable_name', 'N') == 'Y';
         $js_defaults = array();
         $fields = array('email');
         if (!$disable_name) {
             array_unshift($fields, 'name');
         }
         switch (op_get_var($fh, 'integration_type')) {
             case 'email':
                 $email_address = op_get_var($fh, 'email_address');
                 $redirect_url = op_get_var($fh, 'redirect_url');
                 if (!isset($disable['content']) && isset($op['content'])) {
                     foreach ($fields as $field) {
                         if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                             $js_defaults[$field] = $op['content'][$field . '_default'];
                         }
                     }
                     if (count($js_defaults) > 0) {
                         $count = count($this->output_defaults);
                         $this->output_defaults[++$count] = $js_defaults;
                         $form_class = 'op-signup-form-' . $count;
                     }
                 }
                 $new_fields = array();
                 foreach ($fields as $field) {
                     $data[$field . '_input'] = '<input type="text" name="' . $field . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     $new_fields[$field] = array('name' => $field, 'text' => op_get_var($js_defaults, $field));
                 }
                 $extra_fields = op_get_var($fh, 'email_extra_fields', array());
                 $new_extra = array();
                 if (is_array($extra_fields)) {
                     $counter = 1;
                     foreach ($extra_fields as $field) {
                         $new_extra['op_extra_' . $counter] = $field;
                         $data['extra_fields'][] = '<input type="text" name="op_extra_' . $counter . '" placeholder="' . op_attr($field) . '" />';
                         $counter++;
                     }
                 }
                 $data['form_open'] = '<form action="' . op_current_url() . '" method="post"' . ($form_class == '' ? '' : ' class="' . $form_class . '"') . '>';
                 $data['form_close'] = '</form>';
                 $hidden = array('email_to' => $email_address, 'redirect_url' => $redirect_url, 'extra_fields' => $new_extra, 'fields' => $new_fields);
                 $data['hidden_elems'] = '<input type="hidden" name="op_optin_form_data" value="' . op_attr(base64_encode(serialize($hidden))) . '" /><input type="hidden" name="op_optin_form" value="Y" />';
                 break;
             case 'custom':
             case 'oneshoppingcart':
                 $action = site_url('/process-optin-form/');
                 if ($action != '') {
                     if (!isset($disable['content']) && isset($op['content'])) {
                         foreach ($fields as $field) {
                             if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                                 $js_defaults[$field] = $op['content'][$field . '_default'];
                             }
                         }
                         if (count($js_defaults) > 0) {
                             $count = count($this->output_defaults);
                             $this->output_defaults[++$count] = $js_defaults;
                             $form_class = 'op-signup-form-' . $count;
                         }
                     }
                     $data['form_open'] = '<form action="' . esc_url($action) . '" method="' . op_get_var($fh, 'method', 'post') . '"' . ($form_class == '' ? '' : ' class="' . $form_class . '"') . (op_get_var($fh, 'new_window', 'N') == 'Y' ? ' target="_blank"' : '') . '>';
                     $data['form_close'] = '</form>';
                     foreach ($fields as $field) {
                         $fieldname = '';
                         if (isset($fh[$field . '_box']) && !empty($fh[$field . '_box'])) {
                             $used_fields[$fh[$field . '_box']] = true;
                             $fieldname = $fh[$field . '_box'];
                         }
                         $data[$field . '_input'] = '<input type="text" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                     }
                     $extra_fields = op_get_var($fh, 'extra_fields', array());
                     $field_names = op_get_var($extra_fields, 'field_name', array());
                     $field_titles = op_get_var($extra_fields, 'title', array());
                     $field_text = op_get_var($extra_fields, 'text', array());
                     for ($i = 0, $il = count($field_names); $i < $il; $i++) {
                         $fieldname = $field_names[$i];
                         if ($field_names[$i] == '' || $field_names[$i] == 'op_add_new_field') {
                             $fieldname = $field_titles[$i];
                         }
                         $data['extra_fields'][] = '<input type="text" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr($field_text[$i]) . '" />';
                         $used_fields[$fieldname] = true;
                     }
                     $hidden_elems = '';
                     if (isset($fh['fields']) && isset($fh['fields']['field_name']) && isset($fh['fields']['field_vals'])) {
                         $field_names = $fh['fields']['field_name'];
                         $field_vals = $fh['fields']['field_vals'];
                         $field_count = count($field_names);
                         if (is_array($field_names) && is_array($field_vals) && $field_count == count($field_vals)) {
                             for ($i = 0; $i < $field_count; $i++) {
                                 if (!isset($used_fields[$field_names[$i]])) {
                                     $hidden_elems .= '<input type="hidden" name="' . op_attr($field_names[$i]) . '" value="' . op_attr($field_vals[$i]) . '" />';
                                 }
                             }
                         }
                     }
                     $data['hidden_elems'] = $hidden_elems;
                     $data['hidden_elems'] .= '<input type="hidden" name="redirect_url" value="' . op_get_var($fh, 'action') . '" />';
                 }
                 break;
             case 'infusionsoft':
                 $action = op_get_var($fh, 'action_page');
                 if (!isset($disable['content']) && isset($op['content'])) {
                     foreach ($fields as $field) {
                         if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                             $js_defaults[$field] = $op['content'][$field . '_default'];
                         }
                     }
                     if (count($js_defaults) > 0) {
                         $count = count($this->output_defaults);
                         $this->output_defaults[++$count] = $js_defaults;
                         $form_class = 'op-signup-form-' . $count;
                     }
                 }
                 $data['form_open'] = '<form action="' . esc_url($action) . '" method="POST"' . ($form_class == '' ? '' : ' class="' . $form_class . '"') . '>';
                 $data['form_close'] = '</form>';
                 /*
                  * Hardcoding the email field name
                  */
                 $fh['email_box'] = 'inf_field_Email';
                 foreach ($fields as $field) {
                     $fieldname = '';
                     if (isset($fh[$field . '_box']) && !empty($fh[$field . '_box'])) {
                         $used_fields[$fh[$field . '_box']] = true;
                         $fieldname = $fh[$field . '_box'];
                     }
                     $data[$field . '_input'] = '<input type="text" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                 }
                 $extra_fields = op_get_var($fh, 'extra_fields', array());
                 $field_names = op_get_var($extra_fields, 'field_name', array());
                 $field_titles = op_get_var($extra_fields, 'title', array());
                 $field_text = op_get_var($extra_fields, 'text', array());
                 for ($i = 0, $il = count($field_names); $i < $il; $i++) {
                     $fieldname = $field_names[$i];
                     if ($field_names[$i] == '' || $field_names[$i] == 'op_add_new_field') {
                         $fieldname = $field_titles[$i];
                     }
                     $data['extra_fields'][] = '<input type="text" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr($field_text[$i]) . '" />';
                     $used_fields[$fieldname] = true;
                 }
                 $hidden_elems = '';
                 if (isset($fh['fields']) && isset($fh['fields']['field_name']) && isset($fh['fields']['field_vals'])) {
                     $field_names = $fh['fields']['field_name'];
                     $field_vals = $fh['fields']['field_vals'];
                     $field_count = count($field_names);
                     if (is_array($field_names) && is_array($field_vals) && $field_count == count($field_vals)) {
                         for ($i = 0; $i < $field_count; $i++) {
                             if (!isset($used_fields[$field_names[$i]])) {
                                 $hidden_elems .= '<input type="hidden" name="' . op_attr($field_names[$i]) . '" value="' . op_attr($field_vals[$i]) . '" />';
                             }
                         }
                     }
                 }
                 $data['hidden_elems'] = $hidden_elems;
                 $data['hidden_elems'] .= '<input type="hidden" name="provider" value="' . op_get_var($fh, 'integration_type') . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="redirect_url" value="' . op_get_var($fh, 'thank_you_page', op_current_url()) . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="list" value="' . op_get_var($fh, 'list') . '" />';
                 break;
             case 'aweber':
             case 'mailchimp':
             case 'icontact':
             case 'getresponse':
             case 'campaignmonitor':
             case 'officeautopilot':
                 $action = site_url('/process-optin-form/');
                 if (!isset($disable['content']) && isset($op['content'])) {
                     foreach ($fields as $field) {
                         if (isset($op['content'][$field . '_default']) && !empty($op['content'][$field . '_default'])) {
                             $js_defaults[$field] = $op['content'][$field . '_default'];
                         }
                     }
                     if (count($js_defaults) > 0) {
                         $count = count($this->output_defaults);
                         $this->output_defaults[++$count] = $js_defaults;
                         $form_class = 'op-signup-form-' . $count;
                     }
                 }
                 $data['form_open'] = '<form action="' . esc_url($action) . '" method="POST"' . ($form_class == '' ? '' : ' class="' . $form_class . '"') . '>';
                 $data['form_close'] = '</form>';
                 /*
                  * Hardcoding the email field name
                  */
                 $fh['email_box'] = 'email';
                 foreach ($fields as $field) {
                     $fieldname = '';
                     if (isset($fh[$field . '_box']) && !empty($fh[$field . '_box'])) {
                         $used_fields[$fh[$field . '_box']] = true;
                         $fieldname = $fh[$field . '_box'];
                     }
                     $data[$field . '_input'] = '<input type="text" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr(op_get_var($js_defaults, $field)) . '" class="' . $field . '" />';
                 }
                 $extra_fields = op_get_var($fh, 'extra_fields', array());
                 $field_names = op_get_var($extra_fields, 'field_name', array());
                 $field_titles = op_get_var($extra_fields, 'title', array());
                 $field_text = op_get_var($extra_fields, 'text', array());
                 for ($i = 0, $il = count($field_names); $i < $il; $i++) {
                     $fieldname = $field_names[$i];
                     if ($field_names[$i] == '' || $field_names[$i] == 'op_add_new_field') {
                         $fieldname = $field_titles[$i];
                     }
                     $data['extra_fields'][] = '<input type="text" name="' . op_attr($fieldname) . '" value="' . getOptinUrlValue($fieldname) . '" placeholder="' . op_attr($field_text[$i]) . '" />';
                     $used_fields[$fieldname] = true;
                 }
                 $data['hidden_elems'] = $hidden_elems;
                 $data['hidden_elems'] = '<input type="hidden" name="provider" value="' . op_get_var($fh, 'integration_type') . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="redirect_url" value="' . op_get_var($fh, 'thank_you_page', op_current_url()) . '" />';
                 $data['hidden_elems'] .= '<input type="hidden" name="list" value="' . op_get_var($fh, 'list') . '" />';
                 break;
         }
         if (op_get_var($fh, 'gotowebinar')) {
             $data['hidden_elems'] .= '<input type="hidden" name="gotowebinar" value="' . op_get_var($fh, 'gotowebinar') . '" />';
         }
     }
     $tpl = '';
     $out = '';
     $data['content'] = array();
     if (!isset($disable['content'])) {
         $fields = $this->_get_fields($config);
         $data['content'] = op_mod('content_fields')->output(array($section_name, 'content'), array('fields' => $fields), op_get_var($op, 'content', array()));
     }
     $btnconf = op_get_var($config, 'submit_button_config', array());
     if (isset($op['submit_button'])) {
         $btnop = $op['submit_button'];
     } else {
         $btnop = array();
         if (!isset($btnconf['type'])) {
             $btnop['type'] = 0;
         }
         if (isset($btnconf['defaults']) && isset($btnconf['defaults']['content'])) {
             $btnop['content'] = $btnconf['defaults']['content'];
         }
     }
     if (is_array($btnop)) {
         $data['submit_button'] = op_mod('submit_button')->save_settings(array($section_name, 'submit_button'), $btnconf, $btnop, true);
     } else {
         $data['submit_button'] = $btnop;
     }
     if (!isset($disable['color_scheme'])) {
         $styles = $this->_get_color_schemes($section_name, $config);
         if (count($styles) > 0) {
             $tpl = 'output';
             $style = op_get_current_item($styles, op_get_var($op, 'color_scheme'));
             if (isset($styles[$style]['output'])) {
                 $tpl = $styles[$style]['output'];
             }
             $data['color_scheme'] = $style;
         }
     }
     if (isset($config['template'])) {
         $tpl = $config['template'];
     }
     if (!empty($tpl)) {
         $out = $this->load_tpl('output/' . $tpl, $data);
     }
     if (!empty($out)) {
         if ($return) {
             return $out;
         }
         echo $out;
         return true;
     } else {
         return $data;
     }
 }
Esempio n. 30
0
<?php

if (!op_mod('comments')->enabled('wordpress')) {
    return;
}
?>
				<div id="comments">
				<?php 
if (have_comments() && post_password_required()) {
    ?>
                    <p class="nopassword"><?php 
    _e('This post is password protected. Enter the password to view any comments.', OP_SN);
    ?>
</p>
                </div><!-- #comments -->
                <?php 
    return;
}
if (have_comments()) {
    ?>
                	<div class="comments-container">
                        <h3>
                            <?php 
    printf(_n('1 Comment', '%1$s Comments', get_comments_number(), OP_SN), number_format_i18n(get_comments_number()));
    ?>
                        </h3>
                
                        <?php 
    if (get_comment_pages_count() > 1 && get_option('page_comments')) {
        ?>
                        <div id="comment-navigation-above">