Plugin Directory

Changeset 2263538


Ignore:
Timestamp:
03/19/2020 01:34:43 AM (6 years ago)
Author:
thangnv27
Message:

Update to new version 0.1.3

  • Add class support for Google Tag Manager
  • Add vertical option
  • Add display screen option
  • Add Zalo, Messenger buttons
  • Change style
Location:
ppo-call-to-actions/trunk
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • ppo-call-to-actions/trunk/call2actions.php

    r1744153 r2263538  
    55  Description: Tiện ích kêu gọi hành động phù hợp cho các website về giới thiệu hoặc sản phẩm, dịch vụ. Phát triển miễn phí bởi PPO Việt Nam.
    66  Author: PPO Việt Nam (ppo.vn)
    7   Version: 0.1.2
    8   Author URI: http://ppo.vn
     7  Version: 0.1.3
     8  Author URI: https://ppo.vn
    99 */
    1010
     
    4646                ),
    4747                array(
     48                    'name' => __('Display screen', 'ppo-cta'),
     49                    'desc' => '',
     50                    'id' => 'ppocta_display_screen',
     51                    'type' => 'radio',
     52                    'std' => 'mobile',
     53                    'options' => array(
     54                        'mobile' => __('Mobile', 'ppo-cta'),
     55                        'desktop' => __('Desktop', 'ppo-cta'),
     56                        'mobile_desktop' => __('Mobile & Desktop', 'ppo-cta'),
     57                    )
     58                ),
     59                array(
     60                    'name' => __('Display type', 'ppo-cta'),
     61                    'desc' => '',
     62                    'id' => 'ppocta_display_type',
     63                    'type' => 'radio',
     64                    'std' => 'horizontal',
     65                    'options' => array(
     66                        'horizontal' => __('Horizontal', 'ppo-cta'),
     67                        'vertical' => __('Vertical', 'ppo-cta'),
     68                    )
     69                ),
     70                array(
    4871                    'name' => __('Call button', 'ppo-cta'),
    4972                    'desc' => '',
     
    5780                ),
    5881                array(
    59                     'name' => __('Register button', 'ppo-cta'),
    60                     'desc' => '',
    61                     'id' => 'ppocta_hide_register',
     82                    'name' => __('Zalo button', 'ppo-cta'),
     83                    'desc' => '',
     84                    'id' => 'ppocta_hide_zalo',
    6285                    'type' => 'radio',
    6386                    'std' => '',
     
    6891                ),
    6992                array(
     93                    'name' => __('Messenger button', 'ppo-cta'),
     94                    'desc' => '',
     95                    'id' => 'ppocta_hide_messenger',
     96                    'type' => 'radio',
     97                    'std' => '',
     98                    'options' => array(
     99                        '0' => __('Show', 'ppo-cta'),
     100                        '1' => __('Hide', 'ppo-cta'),
     101                    )
     102                ),
     103                array(
     104                    'name' => __('Register button', 'ppo-cta'),
     105                    'desc' => '',
     106                    'id' => 'ppocta_hide_register',
     107                    'type' => 'radio',
     108                    'std' => '',
     109                    'options' => array(
     110                        '0' => __('Show', 'ppo-cta'),
     111                        '1' => __('Hide', 'ppo-cta'),
     112                    )
     113                ),
     114                array(
    70115                    'name' => __('Phone number', 'ppo-cta'),
    71116                    'desc' => '',
     
    78123                    'desc' => '',
    79124                    'id' => 'ppocta_calltext',
     125                    'type' => 'text',
     126                    'std' => '',
     127                ),
     128                array(
     129                    'name' => __('Zalo Phone', 'ppo-cta'),
     130                    'desc' => '',
     131                    'id' => 'ppocta_zalo',
     132                    'type' => 'text',
     133                    'std' => '',
     134                ),
     135                array(
     136                    'name' => __('Messenger ID', 'ppo-cta'),
     137                    'desc' => '',
     138                    'id' => 'ppocta_messenger',
    80139                    'type' => 'text',
    81140                    'std' => '',
     
    95154            add_action('save_post', array(&$this, 'ppocta_add_box'));
    96155            add_action('save_post', array(&$this, 'ppocta_save_data'));
     156//        } else if(wp_is_mobile()){
    97157        } else {
    98 //            if(!wp_is_mobile()){
    99                 add_filter('wp_head', array(&$this, 'add_style'), 100);
    100 //            }
     158            add_filter('wp_head', array(&$this, 'add_style'), 100);
    101159            add_filter('wp_footer', array(&$this, 'add_buttons'), 100);
    102160        }
     
    115173       
    116174        if(isset($_GET['page']) and $_GET['page'] == 'PPOCTA'){
    117             if( isset($_POST['do_action']) and $_POST['do_action'] == 'save' and
    118                 isset( $_POST['423XqnC2zFJHmN7ThAfyv5rk'] ) and wp_verify_nonce( $_POST['423XqnC2zFJHmN7ThAfyv5rk'], 'ppocta_settings_page' ) ){
     175            if(isset($_POST['do_action']) and $_POST['do_action'] == 'save'){
    119176                $ppocta_fields = array(
    120                     "ppocta_hide_call", "ppocta_hide_register", "ppocta_phone", "ppocta_reg_url", "ppocta_calltext"
     177                    "ppocta_display_screen", "ppocta_display_type",
     178                    "ppocta_hide_call", "ppocta_hide_zalo", "ppocta_hide_messenger", "ppocta_hide_register",
     179                    "ppocta_phone", "ppocta_zalo", "ppocta_messenger", "ppocta_reg_url", "ppocta_calltext"
    121180                );
    122181                foreach ($ppocta_fields as $field) {
     
    144203                    <tr>
    145204                        <td>
     205                            <label for="ppocta_display_screen"><?php _e('Display screen', 'ppo-cta') ?></label>
     206                        </td>
     207                        <td>
     208                            <input type="radio" name="ppocta_display_screen" id="ppocta_display_screen_mobile" value="mobile"
     209                                <?php echo (get_settings('ppocta_display_screen') != 'desktop' and get_settings('ppocta_display_screen') != 'mobile_desktop') ? "checked" : ""; ?> />
     210                            <label for="ppocta_display_screen_mobile"><?php _e('Mobile', 'ppo-cta') ?></label>&nbsp;
     211                            <input type="radio" name="ppocta_display_screen" id="ppocta_display_screen_desktop" value="desktop"
     212                                <?php echo (get_settings('ppocta_display_screen') == 'desktop') ? "checked" : ""; ?> />
     213                            <label for="ppocta_display_screen_desktop"><?php _e('Desktop', 'ppo-cta') ?></label>
     214                            <input type="radio" name="ppocta_display_screen" id="ppocta_display_screen_mobile_desktop" value="mobile_desktop"
     215                                <?php echo (get_settings('ppocta_display_screen') == 'mobile_desktop') ? "checked" : ""; ?> />
     216                            <label for="ppocta_display_screen_mobile_desktop"><?php _e('Mobile & Desktop', 'ppo-cta') ?></label>
     217                        <td>
     218                    </tr>
     219                    <tr>
     220                        <td>
     221                            <label for="ppocta_display_type"><?php _e('Display type', 'ppo-cta') ?></label>
     222                        </td>
     223                        <td>
     224                            <input type="radio" name="ppocta_display_type" id="ppocta_display_type_horizontal" value="horizontal"
     225                                <?php echo (get_settings('ppocta_display_type') != 'vertical') ? "checked" : ""; ?> />
     226                            <label for="ppocta_display_type_horizontal"><?php _e('Horizontal', 'ppo-cta') ?></label>&nbsp;
     227                            <input type="radio" name="ppocta_display_type" id="ppocta_display_type_vertical" value="vertical"
     228                                <?php echo (get_settings('ppocta_display_type') == 'vertical') ? "checked" : ""; ?> />
     229                            <label for="ppocta_display_type_vertical"><?php _e('Vertical', 'ppo-cta') ?></label>
     230                        <td>
     231                    </tr>
     232                    <tr>
     233                        <td>
    146234                            <label for="ppocta_hide_call"><?php _e('Call button', 'ppo-cta') ?></label>
    147235                        </td>
     
    157245                    <tr>
    158246                        <td>
     247                            <label for="ppocta_hide_zalo"><?php _e('Zalo button', 'ppo-cta') ?></label>
     248                        </td>
     249                        <td>
     250                            <input type="radio" name="ppocta_hide_zalo" id="ppocta_hide_zalo_1" value="1"
     251                                <?php echo (intval(get_settings('ppocta_hide_zalo')) == 1) ? "checked" : ""; ?> />
     252                            <label for="ppocta_hide_zalo_1"><?php _e('Show', 'ppo-cta') ?></label>&nbsp;
     253                            <input type="radio" name="ppocta_hide_zalo" id="ppocta_hide_zalo_0" value="0"
     254                                <?php echo (intval(get_settings('ppocta_hide_zalo')) != 1) ? "checked" : ""; ?> />
     255                            <label for="ppocta_hide_zalo_0"><?php _e('Hide', 'ppo-cta') ?></label>
     256                        <td>
     257                    </tr>
     258                    <tr>
     259                        <td>
     260                            <label for="ppocta_hide_messenger"><?php _e('Messenger button', 'ppo-cta') ?></label>
     261                        </td>
     262                        <td>
     263                            <input type="radio" name="ppocta_hide_messenger" id="ppocta_hide_messenger_1" value="1"
     264                                <?php echo (intval(get_settings('ppocta_hide_messenger')) == 1) ? "checked" : ""; ?> />
     265                            <label for="ppocta_hide_messenger_1"><?php _e('Show', 'ppo-cta') ?></label>&nbsp;
     266                            <input type="radio" name="ppocta_hide_messenger" id="ppocta_hide_messenger_0" value="0"
     267                                <?php echo (intval(get_settings('ppocta_hide_messenger')) != 1) ? "checked" : ""; ?> />
     268                            <label for="ppocta_hide_messenger_0"><?php _e('Hide', 'ppo-cta') ?></label>
     269                        <td>
     270                    </tr>
     271                    <tr>
     272                        <td>
    159273                            <label for="ppocta_hide_register"><?php _e('Register button', 'ppo-cta') ?></label>
    160274                        </td>
     
    177291                    </tr>
    178292                    <tr>
     293                        <td><label><?php _e('Zalo Phone', 'ppo-cta') ?>:</label></td>
     294                        <td><input type="text" name="ppocta_zalo" value="<?php echo get_option('ppocta_zalo'); ?>" class="regular-text" /></td>
     295                    </tr>
     296                    <tr>
     297                        <td><label><?php _e('Messenger ID', 'ppo-cta') ?>:</label></td>
     298                        <td><input type="text" name="ppocta_messenger" value="<?php echo get_option('ppocta_messenger'); ?>" class="regular-text" /></td>
     299                    </tr>
     300                    <tr>
    179301                        <td><label><?php _e('Register URL', 'ppo-cta') ?>:</label></td>
    180302                        <td><input type="text" name="ppocta_reg_url" value="<?php echo get_option('ppocta_reg_url'); ?>" class="regular-text" /></td>
     
    185307                    <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes', 'ppo-cta') ?>" />
    186308                    <input type="hidden" name="do_action" value="save" />
    187                     <?php wp_nonce_field( 'ppocta_settings_page', '423XqnC2zFJHmN7ThAfyv5rk' ); ?>
    188309                </p>
    189310            </form>
     
    203324        $ppocta_active = intval(get_post_meta($post->ID, 'ppocta_active', true));
    204325        $ppocta_using_settings = intval(get_post_meta($post->ID, 'ppocta_using_settings', true));
     326        $ppocta_display_screen = get_post_meta($post->ID, 'ppocta_display_screen', true);
     327        $ppocta_display_type = get_post_meta($post->ID, 'ppocta_display_type', true);
    205328        $ppocta_hide_call = intval(get_post_meta($post->ID, 'ppocta_hide_call', true));
     329        $ppocta_hide_zalo = intval(get_post_meta($post->ID, 'ppocta_hide_zalo', true));
     330        $ppocta_hide_messenger = intval(get_post_meta($post->ID, 'ppocta_hide_messenger', true));
    206331        $ppocta_hide_register = intval(get_post_meta($post->ID, 'ppocta_hide_register', true));
    207332        echo '<input type="hidden" name="ppocta_secure_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
     
    234359        <tr>
    235360            <td>
     361                <label for="ppocta_display_screen"><?php _e('Display screen', 'ppo-cta') ?></label>
     362            </td>
     363            <td>
     364                <input type="radio" name="ppocta_display_screen" id="ppocta_display_screen_mobile" value="mobile"
     365                    <?php echo ($ppocta_display_screen != 'desktop' and $ppocta_display_screen != 'mobile_desktop') ? "checked" : ""; ?> />
     366                <label for="ppocta_display_screen_mobile"><?php _e('Mobile', 'ppo-cta') ?></label>&nbsp;
     367                <input type="radio" name="ppocta_display_screen" id="ppocta_display_screen_desktop" value="desktop"
     368                    <?php echo ($ppocta_display_screen == 'desktop') ? "checked" : ""; ?> />
     369                <label for="ppocta_display_screen_desktop"><?php _e('Desktop', 'ppo-cta') ?></label>
     370                <input type="radio" name="ppocta_display_screen" id="ppocta_display_screen_mobile_desktop" value="mobile_desktop"
     371                    <?php echo ($ppocta_display_screen == 'mobile_desktop') ? "checked" : ""; ?> />
     372                <label for="ppocta_display_screen_mobile_desktop"><?php _e('Mobile & Desktop', 'ppo-cta') ?></label>
     373            <td>
     374        </tr>
     375        <tr>
     376            <td>
     377                <label for="ppocta_display_type"><?php _e('Display type', 'ppo-cta') ?></label>
     378            </td>
     379            <td>
     380                <input type="radio" name="ppocta_display_type" id="ppocta_display_type_horizontal" value="horizontal"
     381                    <?php echo ($ppocta_display_type != 'vertical') ? "checked" : ""; ?> />
     382                <label for="ppocta_display_type_horizontal"><?php _e('Horizontal', 'ppo-cta') ?></label>&nbsp;
     383                <input type="radio" name="ppocta_display_type" id="ppocta_display_type_vertical" value="vertical"
     384                    <?php echo ($ppocta_display_type == 'vertical') ? "checked" : ""; ?> />
     385                <label for="ppocta_display_type_vertical"><?php _e('Vertical', 'ppo-cta') ?></label>
     386            <td>
     387        </tr>
     388        <tr>
     389            <td>
    236390                <label for="ppocta_hide_call"><?php _e('Call button', 'ppo-cta') ?></label>
    237391            </td>
     
    247401        <tr>
    248402            <td>
     403                <label for="ppocta_hide_zalo"><?php _e('Zalo button', 'ppo-cta') ?></label>
     404            </td>
     405            <td>
     406                <input type="radio" name="ppocta_hide_zalo" id="ppocta_hide_zalo_1" value="1"
     407                    <?php echo ($ppocta_hide_zalo==1) ? "checked" : ""; ?> />
     408                <label for="ppocta_hide_zalo_1"><?php _e('Show', 'ppo-cta') ?></label>&nbsp;
     409                <input type="radio" name="ppocta_hide_zalo" id="ppocta_hide_zalo_0" value="0"
     410                    <?php echo ($ppocta_hide_zalo!= 1) ? "checked" : ""; ?> />
     411                <label for="ppocta_hide_zalo_0"><?php _e('Hide', 'ppo-cta') ?></label>
     412            <td>
     413        </tr>
     414        <tr>
     415            <td>
     416                <label for="ppocta_hide_messenger"><?php _e('Messenger button', 'ppo-cta') ?></label>
     417            </td>
     418            <td>
     419                <input type="radio" name="ppocta_hide_messenger" id="ppocta_hide_messenger_1" value="1"
     420                    <?php echo ($ppocta_hide_messenger==1) ? "checked" : ""; ?> />
     421                <label for="ppocta_hide_messenger_1"><?php _e('Show', 'ppo-cta') ?></label>&nbsp;
     422                <input type="radio" name="ppocta_hide_messenger" id="ppocta_hide_messenger_0" value="0"
     423                    <?php echo ($ppocta_hide_messenger!= 1) ? "checked" : ""; ?> />
     424                <label for="ppocta_hide_messenger_0"><?php _e('Hide', 'ppo-cta') ?></label>
     425            <td>
     426        </tr>
     427        <tr>
     428            <td>
    249429                <label for="ppocta_hide_register"><?php _e('Register button', 'ppo-cta') ?></label>
    250430            </td>
     
    265445            <td><label><?php _e('Call Text', 'ppo-cta') ?>:</label></td>
    266446            <td><input type="text" name="ppocta_calltext" value="<?php echo get_post_meta($post->ID, 'ppocta_calltext', true); ?>" class="regular-text" placeholder="<?php _e('Call Now', 'ppo-cta') ?>" /></td>
     447        </tr>
     448        <tr>
     449            <td><label><?php _e('Zalo Phone', 'ppo-cta') ?>:</label></td>
     450            <td><input type="text" name="ppocta_zalo" value="<?php echo get_post_meta($post->ID, 'ppocta_zalo', true); ?>" class="regular-text" /></td>
     451        </tr>
     452        <tr>
     453            <td><label><?php _e('Messenger ID', 'ppo-cta') ?>:</label></td>
     454            <td><input type="text" name="ppocta_messenger" value="<?php echo get_post_meta($post->ID, 'ppocta_messenger', true); ?>" class="regular-text" /></td>
    267455        </tr>
    268456        <tr>
     
    316504    public function add_style() {
    317505        $call_btn = plugins_url("/images/callbutton.png", __FILE__);
     506        $zalo_btn = plugins_url("/images/zalo.png", __FILE__);
     507        $messenger_btn = plugins_url("/images/messenger.png", __FILE__);
    318508        $reg_btn = plugins_url("/images/regbutton.png", __FILE__);
    319         echo <<<HTML
     509        $ppocta_display_screen = get_option('ppocta_display_screen');
     510        $ppocta_display_type = get_option('ppocta_display_type');
     511        $active = true;
     512        if(is_single() or is_page()){
     513            $post_id = get_queried_object_id();
     514            if(get_post_meta($post_id, 'ppocta_active', true) != 1){
     515                if(get_post_meta($post_id, 'ppocta_using_settings', true) == 1){
     516                    $ppocta_display_screen = get_post_meta($post_id, 'ppocta_display_screen', true);
     517                    $ppocta_display_type = get_post_meta($post_id, 'ppocta_display_type', true);
     518                }
     519            } else {
     520                $active = false;
     521            }
     522        }
     523        if($active){
     524            echo <<<HTML
    320525<style type="text/css">
    321     #callNowButton{
     526    .ppocta-ft-fix{
    322527        display:none;
    323528        position: fixed;
    324         left: 2px;
    325         bottom: 2px;
    326         border-radius: 22px;
     529        bottom: 5px;
     530        left: 10px;
     531        min-width: 120px;
     532        text-align: center;
     533        z-index: 9999
     534    }
     535    #callNowButton{
     536        display: inline-block;
     537        position: relative;
     538        border-radius: 50%;
    327539        color: #fff;
    328         height: 40px;
    329         line-height: 40px;
    330         padding: 0 10px 0 0;
    331         background: #009900;
    332         z-index: 9999;
     540        width: 50px;
     541        height: 50px;
     542        line-height: 50px;
     543        box-shadow: 0px 0px 10px -2px rgba(0,0,0,0.7);
    333544    }
    334545    #callNowButton i{
    335         margin-right: 5px;
    336         margin-top: -1px;
    337         margin-left: -1px;
    338         border: 2px solid #fff;
    339546        border-radius: 50%;
    340547        display:inline-block;
    341         width: 40px;
    342         height: 40px;
    343         background: url("{$call_btn}") center center no-repeat #009900;
    344         float: left;
     548        width: 50px;
     549        height: 50px;
     550        background: url("{$call_btn}") center center no-repeat #009900
    345551    }
    346552    #callNowButton a{
     553        display: block;
    347554        text-decoration: none;
    348555        outline: none;
    349556        color: #fff;
    350     }
    351     #callNowButton span{
     557        text-align: center
     558    }
     559    #callNowButton a.txt{
     560        position: absolute;
     561        top: -40px;
     562        left: calc(50% - 60px);
     563        background: #009900;
     564        width: 120px;
     565        max-width: 120px;
     566        line-height: 2;
     567        text-transform: uppercase;
     568        border-radius: 5px;
    352569        font-size: 15px
    353570    }
     571    #callNowButton a.txt:after{
     572        position: absolute;
     573        bottom: -8px;
     574        left: 50px;
     575        content: "";
     576        width: 0;
     577        height: 0;
     578        border-top: 8px solid #009900;
     579        border-left: 10px solid transparent;
     580        border-right: 10px solid transparent
     581    }
     582    #zaloButton{
     583        display: inline-block;
     584        margin-right: 10px;
     585        width: 50px;
     586        height: 50px;
     587        background: #5AC5EF;
     588        border-radius: 50%;
     589        box-shadow: 0px 0px 10px -2px rgba(0,0,0,0.7)
     590    }
     591    #zaloButton>a>i{
     592        background: url("{$zalo_btn}") center center no-repeat;
     593        background-size: 57%;
     594        width: 50px;
     595        height: 50px;
     596        display: inline-block
     597    }
     598    #messengerButton{
     599        display: inline-block;
     600        margin-right: 10px;
     601        width: 50px;
     602        height: 50px;
     603        background: #4267B2;
     604        border-radius: 50%;
     605        box-shadow: 0px 0px 10px -2px rgba(0,0,0,0.7)
     606    }
     607    #messengerButton>a>i{
     608        background: url("{$messenger_btn}") center center no-repeat;
     609        background-size: 57%;
     610        width: 50px;
     611        height: 50px;
     612        display: inline-block
     613    }
    354614    #registerNowButton{
    355         display:none;
     615        display: inline-block;
    356616        color: #fff;
    357617        height: 50px;
    358618        width: 50px;
    359         position: fixed;
    360         right: 8px;
    361         bottom: 8px;
    362619        border-radius: 50%;
     620        margin-right: 10px;
    363621        background: url("{$reg_btn}") center center no-repeat #ff0000;
    364622        box-shadow: 0px 0px 10px -2px rgba(0,0,0,0.7);
    365         text-decoration: none;
    366         z-index: 9999;
    367     }
     623        text-decoration: none
     624    }
     625HTML;
     626    if($ppocta_display_type == 'vertical'){
     627    echo <<<HTML
     628    .ppocta-ft-fix.vertical{min-width:inherit}
     629    .ppocta-ft-fix.vertical #messengerButton, .ppocta-ft-fix.vertical #zaloButton,
     630    .ppocta-ft-fix.vertical #registerNowButton, .ppocta-ft-fix.vertical #callNowButton{
     631        display:block;
     632        margin-right:0;
     633        margin-top:2px
     634    }
     635    .ppocta-ft-fix.vertical #callNowButton a.txt{
     636        top: 9px;
     637        left: 60px;
     638        width: auto;
     639        white-space: nowrap;
     640        padding-left: 8px;
     641        padding-right: 10px;
     642    }
     643    .ppocta-ft-fix.vertical #callNowButton a.txt:after {
     644        bottom: 5px;
     645        left: -10px;
     646        border-top: 10px solid transparent;
     647        border-bottom: 10px solid transparent;
     648        border-left: none;
     649        border-right: 10px solid #090;
     650    }
     651HTML;
     652        }
     653        if($ppocta_display_screen != 'desktop' and $ppocta_display_screen != 'mobile_desktop'){
     654        echo <<<HTML
    368655    @media (max-width: 991px){
    369         #callNowButton, #registerNowButton{display: block}
    370     }
    371 </style>
     656        .ppocta-ft-fix{display: block}
     657    }
    372658HTML;
     659        } else if($ppocta_display_screen == 'desktop'){
     660        echo <<<HTML
     661    @media (min-width: 992px){
     662        .ppocta-ft-fix{display: block}
     663    }
     664HTML;
     665        } else {
     666            echo '.ppocta-ft-fix{display: block}';
     667        }
     668            echo '</style>';
     669        }
    373670    }
    374671   
    375672    public function add_buttons() {
     673        $ppocta_display_type = get_option('ppocta_display_type');
    376674        $show_call = get_option('ppocta_hide_call');
     675        $show_zalo = get_option('ppocta_hide_zalo');
     676        $show_messenger = get_option('ppocta_hide_messenger');
    377677        $show_reg = get_option('ppocta_hide_register');
    378678        $phone = get_option('ppocta_phone');
     679        $zalo = get_option('ppocta_zalo');
     680        $messenger = get_option('ppocta_messenger');
    379681        $callText = get_option('ppocta_calltext');
    380682        $url = get_option('ppocta_reg_url');
     
    384686            if(get_post_meta($post_id, 'ppocta_active', true) != 1){
    385687                if(get_post_meta($post_id, 'ppocta_using_settings', true) == 1){
     688                    $ppocta_display_type = get_post_meta($post_id, 'ppocta_display_type', true);
    386689                    $show_call = intval(get_post_meta($post_id, 'ppocta_hide_call', true));
     690                    $show_zalo = intval(get_post_meta($post_id, 'ppocta_hide_zalo', true));
     691                    $show_messenger = intval(get_post_meta($post_id, 'ppocta_hide_messenger', true));
    387692                    $show_reg = intval(get_post_meta($post_id, 'ppocta_hide_register', true));
    388693                    $phone = get_post_meta($post_id, 'ppocta_phone', true);
     694                    $zalo = get_post_meta($post_id, 'ppocta_zalo', true);
     695                    $messenger = get_post_meta($post_id, 'ppocta_messenger', true);
    389696                    $callText = get_post_meta($post_id, 'ppocta_calltext', true);
    390697                    $url = get_post_meta($post_id, 'ppocta_reg_url', true);
     
    397704            if(empty($phone)) $phone = "";
    398705            if(empty($url)) $url = "";
    399             echo '<div class="ft-fix">';
     706            echo '<div class="ppocta-ft-fix '.$ppocta_display_type.'">';
     707            if(intval($show_messenger) == 1){
     708                echo <<<HTML
     709            <div id="messengerButton">
     710                <a href="http://fb.com/msg/{$messenger}" target="_blank" class="ppocta-btn-messenger-tracking"><i></i></a>
     711            </div>
     712HTML;
     713            }
     714            if(intval($show_zalo) == 1){
     715                echo <<<HTML
     716            <div id="zaloButton">
     717                <a href="http://zalo.me/{$zalo}" target="_blank" class="ppocta-btn-zalo-tracking"><i></i></a>
     718            </div>
     719HTML;
     720            }
     721            if(intval($show_reg) == 1){
     722                echo <<<HTML
     723            <a id="registerNowButton" href="{$url}" class="ppocta-btn-register-tracking"><i></i></a>
     724HTML;
     725            }
    400726            if(intval($show_call) == 1){
     727                if(!empty($callText)){
     728                    $callText = "<a href=\"tel:{$phone}\" class=\"txt\" class=\"ppocta-text-call-tracking\"><span>{$callText}</span></a>";
     729                }
    401730                echo <<<HTML
    402731            <div id="callNowButton">
    403                 <a href="tel:{$phone}"><i></i></a>
    404                 <a href="tel:{$phone}"><span>{$callText}</span></a>
     732                <a href="tel:{$phone}" class="ppocta-btn-call-tracking"><i></i></a>
     733                {$callText}
    405734            </div>
    406 HTML;
    407             }
    408             if(intval($show_reg) == 1){
    409                 echo <<<HTML
    410             <a id="registerNowButton" href="{$url}"><i></i></a>
    411735HTML;
    412736            }
  • ppo-call-to-actions/trunk/readme.txt

    r1744153 r2263538  
    44Tags: CTA,call to actions,register button,call now,call button,zalo button,messenger button,nút zalo,nút messenger,gọi hành động,nút gọi hành động,nút gọi,nút đăng ký
    55Requires at least: 3.5.1
    6 Tested up to: 4.8.2
    7 Stable tag: 0.1.2
     6Tested up to: 5.3.2
     7Stable tag: 0.1.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4242== Changelog ==
    4343
     44= 0.1.3 =
     45* Add class support for Google Tag Manager
     46* Add vertical option
     47* Add display screen option
     48* Add Zalo, Messenger buttons
     49* Change style
     50
    4451= 0.1.2 =
    4552* Setup CTA for posts, pages
Note: See TracChangeset for help on using the changeset viewer.