コード例 #1
0
	public static function get_instance() {

                if ( null == self::$instance ) {
			self::$instance = new self;
		}

		return self::$instance;
	}        
コード例 #2
0
<?php

global $wpdb;
$wpcb_tracking = WPCB_Tracker::get_instance();
$wpcb_tbl_name = $this->wpcb_boxes_table;
$results = $wpdb->get_results("SELECT id,box_name,box_status,box_type FROM {$wpcb_tbl_name} ORDER BY id");
$result_count = count($results);
if ($result_count != 0) {
    $count = 1;
    ?>
        <table class="wp-list-table widefat fixed posts" style="clear: none;">
            <thead>
                <tr>
                    <th width="30%"><?php 
    _e('WP Conversion Boxes Name', 'wp-conversion-boxes');
    ?>
</th>
                    <th style="text-align: center;"><?php 
    _e('Unique Visitors', 'wp-conversion-boxes');
    ?>
</th>
                    <th style="text-align: center;"><?php 
    _e('Pageviews', 'wp-conversion-boxes');
    ?>
</th>
                    <th style="text-align: center;"><?php 
    _e('Box Views', 'wp-conversion-boxes');
    ?>
</th>
                    <th style="text-align: center;"><?php 
    _e('Conversions', 'wp-conversion-boxes');
コード例 #3
0
ファイル: class.public.php プロジェクト: C4AProjects/drharnet
        public function show_the_box($id,$attributes = null){
            
            $wpcb_tracking = WPCB_Tracker::get_instance();            
            
            global $wpdb;

            $wpcb_tbl_name = $this->get_boxes_table_name();
            $wpcb_the_row = $wpdb->get_row($wpdb->prepare("SELECT * from $wpcb_tbl_name WHERE id = %d", array($id)));

            if (isset($wpcb_the_row)) {
                $box_status = $wpcb_the_row->box_status;
                $box_type = $wpcb_the_row->box_type;
                $box_template = $wpcb_the_row->box_template;
                $box_customizations = $wpcb_the_row->box_customizations;
                $box_settings = $wpcb_the_row->box_settings;
            } else {
                return;
            }
            
            $box_id = $id;
            
            if($box_status != 1){
                ob_start();
                return;
            }
            
            if($box_customizations != null AND $box_customizations != 'defaults'){
                $wpcb_default_fields = unserialize($box_customizations);
                $wpcb_default_fields = $this->sanitise_array($wpcb_default_fields);
                $wpcb_default_fields['defaults'] = 'custom';
            }
            else{
                $wpcb_default_fields['defaults'] = 'defaults';
            }
            
            if(isset($box_settings)){
            
                $wpcb_box_settings = unserialize($box_settings);

                if($wpcb_box_settings['box_fade_in'] == '1'){
                    $wpcb_settings_data['box_fade_in'] = "wpcb_fade_in";
                }
                else{
                    $wpcb_settings_data['box_fade_in'] = "wpcb_nothing";
                }

                $wpcb_settings_data['box_fade_in_time'] = $wpcb_box_settings['box_fade_in_time'];

                if($wpcb_box_settings['box_make_sticky'] == '1'){
                    $wpcb_settings_data['box_make_sticky'] = "box_make_sticky";
                }
                else{
                    $wpcb_settings_data['box_make_sticky'] = "wpcb_nothing";
                }
        
            }
            else{
                $wpcb_settings_data['box_fade_in'] = "wpcb_nothing";
                $wpcb_settings_data['box_fade_in_time'] = "0";
                $wpcb_settings_data['box_make_sticky'] = "wpcb_nothing";
            }
            
            $wpcb_popup_type_radio = (isset($wpcb_box_settings['wpcb_popup_type_radio'])) ? $wpcb_box_settings['wpcb_popup_type_radio'] : 0;
            $wpcb_popup_option_val = (isset($wpcb_box_settings['wpcb_popup_option_val'])) ? $wpcb_box_settings['wpcb_popup_option_val'] : 0;
            $wpcb_popup_frequency = (isset($wpcb_box_settings['wpcb_popup_frequency'])) ? $wpcb_box_settings['wpcb_popup_frequency'] : 10;
            
            ob_start();
            echo '<!--------------------------------------><!-- Conversion Box Made Using : -------><!-- WP Conversion Boxes - -------------><!-- http://wpconversionboxes.com --><!-------------------------------------->';
            echo '<div class="'. $wpcb_settings_data['box_make_sticky'].'_offset"></div>';
            
            switch($box_type){
                case 1 :    include(WPCB_TEMPLATE_DIR_PATH.$this->get_template_directory(1).'/'.$box_template.'/template.php');
                            break;
                case 2 :    include(WPCB_TEMPLATE_DIR_PATH.$this->get_template_directory(2).'/'.$box_template.'/template.php');
                            break;
                case 3 :    include(WPCB_TEMPLATE_DIR_PATH.$this->get_template_directory(3).'/'.$box_template.'/template.php');
                            break;
                case 4 :    include(WPCB_TEMPLATE_DIR_PATH.$this->get_template_directory(4).'/'.$box_template.'/template.php');
                            break;
                case 5 :    if($attributes['style'] != 'image'){
                                $anchor = $attributes['text'];
                                if($attributes['style'] == 'none' || $attributes['style'] == ''){
                                    $attributes['style'] = 'none_none';
                                }
                                $style = explode('_', $attributes['style']);
                            }
                            else{
                                $anchor = '<img src="'.$attributes['image_url'].'" />';
                            }
                            echo '<a id="wpcb_two_step_optin_link_'.$box_id.'" class="wpcb_button_'.$style[1].' wpcb_two_step_optin_link_'.$style[0].'">'.$anchor.'</a>';
                            echo '<style>div.wpcb_template_main.wpcb_template_main_'.$box_id.'{display: none;}</style>';
                            include(WPCB_TEMPLATE_DIR_PATH.$this->get_template_directory(5).'/'.$box_template.'/template.php');
                            break;
                case 6 :    echo '<div class="wpcb_popup_data" id="wpcb_popup_data_'.$box_id.'" data-popup-type="'.$wpcb_popup_type_radio.'" data-popup-val="'.$wpcb_popup_option_val.'" data-popup-frequency="'.$wpcb_popup_frequency.'"></div>';
                            echo '<style>div.wpcb_template_main.wpcb_template_main_'.$box_id.'{display: none;}</style>';
                            include(WPCB_TEMPLATE_DIR_PATH.$this->get_template_directory(5).'/'.$box_template.'/template.php');
                            break;
            }
            
            if(get_option('wpcb_enable_credit_link') == 1){
                echo "<span class='wpcb_credit_link'>". __("Made using <a target='_blank' href='http://wpconversionboxes.com'>WP Conversion Boxes</a>",'wp-conversion-boxes') ."</span>";
            }
            
            echo  '<!------------------------------><!-- Conversion Box Ends Here --><!------------------------------>';
            
            if (isset($wpcb_the_row)) {
                $wpcb_tracking->log_new_visit($box_id);
            }

        }