Plugin Directory

Changeset 1611096


Ignore:
Timestamp:
03/09/2017 08:20:35 AM (9 years ago)
Author:
Voltroid
Message:

update 1.0.1

Location:
optinpoint-lite
Files:
217 added
9 edited

Legend:

Unmodified
Added
Removed
  • optinpoint-lite/trunk/README.txt

    r1606367 r1611096  
    1 === OptinPoint Lite - Advanced Popup Plugin ===
     1=== OptinPoint Lite - All in One Subscription Plugin ===
    22Contributors: Voltroid
    33Author URI: http://voltroid.com/
    44Plugin URL: http://voltroid.com/optinpoint
    55Donate link: http://voltroid.com/optinpoint#donate
    6 Tags:  newsletter, newsletter signup, checkbox, newsletter, optin, opt-in, registration form, shortcode, sign-up form, subscribe, subscriptions, widget,  analytics, automatic, collect email, double optin, email, exit popup, exit-intent, growth, hellobar, lightbox, links, mail, newsletters, optin forms, popover, popup, pop-up, popup domination, popupdomination, posts, subscribe, subscribers, subscription, referrer, search engine, social sharing, cookie, customizable, responsive, aweber, getresponse, icontact, campaign monitor, constant contact, vertical response, active campaign, mad mimi, campaign, form, wordpress
     6Tags:  plugin, newsletter, newsletter signup, checkbox, newsletter, optin, opt-in, registration form, shortcode, sign-up form, subscribe, subscriptions, widget,  analytics, automatic, collect email, double optin, email, exit popup, exit-intent, growth, hellobar, lightbox, links, mail, newsletters, optin forms, popover, popup, pop-up, popup domination, popupdomination, post, posts, subscribe, subscribers, subscription, referrer, search engine, social sharing, cookie, customizable, responsive, aweber, getresponse, icontact, campaign monitor, constant contact, vertical response, active campaign, mad mimi, campaign, form, wordpress, sendgrid, hubspot, benchmark email, woocommerce
    77Requires at least: 3.8
    88Tested up to: 4.7
    9 Stable tag: 1.0.0
     9Stable tag: 1.0.1
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030* Active Campaign
    3131* Mad Mimi
     32* SendGrid
     33* HubSpot
     34* Benchmark Email
    3235
    3336= OptinPoint Lite Features =
     
    6871> * Depart Intent Tecnology
    6972> * Open on Click
     73> * WooCommerce Integration
     74> * Hidden Predefined Fields
    7075> * Cookie Based Lightbox day Customization
    7176> * Scroll Toggle % Custamization
     
    7580> * Targeting URL Shorteners
    7681> * Targeting Specific URLs
     82> * Scrollable Lightbox for long forms
    7783> * Custom CSS editor
    7884> * Premium Support 24x7
     
    121127
    122128= 1.0.0 =
     129* Added Support for SendGrid
     130* Added Support for HubSpot
     131* Added Support for Benchmark Email
     132* Fixed Minor bugs
     133* Excluded AMP Pages
     134
     135= 1.0.0 =
    123136* Initial release
    124137
  • optinpoint-lite/trunk/admin/assets/js/admin.js

    r1606342 r1611096  
    209209                            }
    210210                            $scope.remote.lock();
    211                             $http.post(optinpint_script.ajaxurl+'?action=optinpoint_lite_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     211                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
    212212                                .then(function (a) {
    213213                                    if(a.status == 200 && typeof a.data != "string"){
     
    226226                        }
    227227                    ],
    228                     ltype:0
     228                    ltype:0,
     229                    extfill:1
    229230                },
    230231                cc: {name:'Constant Contact',
     
    242243                            var interval = window.setInterval(function() {
    243244                                try {
     245                                    console.log(popup);
    244246                                     if (popup == null || popup.closed) {
    245247                                        window.clearInterval(interval);
     
    273275                        }
    274276                    ],
    275                     ltype:1
     277                    ltype:1,
     278                    extfill:1
    276279                },
    277280                vr: {name:'Vertical Response',
     
    325328                        }
    326329                    ],
    327                     ltype:1
     330                    ltype:1,
     331                    extfill:1
    328332                },
    329333                cm:{name:'CampaignMonitor',
     
    336340                            }
    337341                            $scope.remote.lock();
    338                             $http.post(optinpint_script.ajaxurl+'?action=optinpoint_lite_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     342                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
    339343                                .then(function (a) {
    340344                                    if(a.status == 200 && a.data.http_status_code == 200){
     
    362366                        }
    363367                    ],
    364                     ltype:0
     368                    ltype:0,
     369                    extfill:0
    365370                },
    366371                gr: {name:'GetResponse',
     
    373378                            }
    374379                            $scope.remote.lock();
    375                             $http.post(optinpint_script.ajaxurl+'?action=optinpoint_lite_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     380                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
    376381                                .then(function (a) {
    377382                                    if(a.status == 200 && !(isset(a.data.code))){
     
    391396                        }
    392397                    ],
    393                     ltype:1
     398                    ltype:1,
     399                    extfill:0
     400                },
     401                sg: {name:'SendGrid',
     402                    func:[
     403                        function(){
     404                            if($scope.remote.chk())return;
     405                            if(!isset($scope.mailserv.config.key) || !isset($scope.mailserv.config.key[0]) || $scope.mailserv.config.key[0].length == 0){
     406                                $scope.addErr('Enter API Key');
     407                                return;
     408                            }
     409                            $scope.remote.lock();
     410                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     411                                .then(function (a) {
     412                                    if(a.status == 200 && !(isset(a.data.errors))){
     413                                        $scope.mailserv.isConfig = 3;
     414                                        $scope.remote.unlock(2);
     415                                    }
     416                                    else{
     417                                        $scope.addErr('Incorrect API Key');
     418                                        $scope.remote.unlock(3);
     419                                    }
     420                                },function (a) {
     421                                    $scope.remote.unlock(3);
     422                                    $scope.addErr('Error');
     423                            });
     424                        }
     425                    ],
     426                    ltype:1,
     427                    extfill:1
     428                },
     429                hs: {name:'Hubspot',
     430                    func:[
     431                        function(){
     432                            if($scope.remote.chk())return;
     433                            if(!isset($scope.mailserv.config.key) || !isset($scope.mailserv.config.key[0]) || $scope.mailserv.config.key[0].length == 0){
     434                                $scope.addErr('Enter API Key');
     435                                return;
     436                            }
     437                            $scope.remote.lock();
     438                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     439                                .then(function (a) {
     440                                    if(a.status == 200 && a.data.status == 200){
     441                                        $scope.mailserv.isConfig = 3;
     442                                        $scope.remote.unlock(2);
     443                                    }
     444                                    else{
     445                                        $scope.addErr('Incorrect API Key');
     446                                        $scope.remote.unlock(3);
     447                                    }
     448                                },function (a) {
     449                                    $scope.remote.unlock(3);
     450                                    $scope.addErr('Error');
     451                            });
     452                        }
     453                    ],
     454                    ltype:1,
     455                    extfill:0
     456                },
     457                be: {name:'Benchmark Email',
     458                    func:[
     459                        function(){
     460                            if($scope.remote.chk())return;
     461                            if(!isset($scope.mailserv.config.key) || !isset($scope.mailserv.config.key[0]) || $scope.mailserv.config.key[0].length == 0){
     462                                $scope.addErr('Enter API Key');
     463                                return;
     464                            }
     465                            $scope.remote.lock();
     466                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     467                                .then(function (a) {
     468                                    if(a.status == 200 && !isset(a.data.faultCode)){
     469                                        $scope.mailserv.isConfig = 3;
     470                                        $scope.remote.unlock(2);
     471                                    }
     472                                    else{
     473                                        $scope.addErr('Incorrect API Key');
     474                                        $scope.remote.unlock(3);
     475                                    }
     476                                },function (a) {
     477                                    $scope.remote.unlock(3);
     478                                    $scope.addErr('Error');
     479                            });
     480                        }
     481                    ],
     482                    ltype:1,
     483                    extfill:0
    394484                },
    395485                ac: {name:'Active Campaign',
     
    419509                        }
    420510                    ],
    421                     ltype:1
     511                    ltype:1,
     512                    extfill:0
    422513                },
    423514                ic: {name:'iContact',
     
    430521                            }
    431522                            $scope.remote.lock();
    432                             $http.post(optinpint_script.ajaxurl+'?action=optinpoint_lite_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
     523                            $http.post(optinpint_script.ajaxurl+'?action=optinpoint_mailserv_connect&step=0&optinpont_lite_service=1',$scope.mailserv.config)
    433524                                .then(function (a) {
    434525                                    if(a.status == 200 && !(isset(a.data.errors))){
     
    460551                        }
    461552                    ],
    462                     ltype:1
     553                    ltype:1,
     554                    extfill:1
    463555                },
    464556                mm: {name:'Mad Mimi',
     
    487579                        }
    488580                    ],
    489                     ltype:1
     581                    ltype:1,
     582                    extfill:1
    490583                }
    491584            },
     
    687780            },
    688781            extra:{
     782                fill:function(){
     783                    return ($scope.mailserv.list[$scope.data.mailserv.id].extfill);
     784                },
    689785                add:function(i){
    690786                    if(!isset($scope.form.tform.fields[i].extras))$scope.form.tform.fields[i].extras = [];
  • optinpoint-lite/trunk/admin/views/admin_advanced.php

    r1606342 r1611096  
    204204            </div>
    205205            <div class="fl_row">
     206                <div class="feat">WooCommerce Integration</div>
     207                <div class="featbox pro grey"></div>
     208                <div class="featbox avail blue"></div>
     209            </div>
     210            <div class="fl_row">
    206211                <div class="feat">A/B Testing</div>
    207212                <div class="featbox pro grey"></div>
     
    230235            <div class="fl_row">
    231236                <div class="feat">Advanced Addon Behaviour Customizations</div>
     237                <div class="featbox pro grey"></div>
     238                <div class="featbox avail blue"></div>
     239            </div>
     240            <div class="fl_row">
     241                <div class="feat">Hidden Predefined Fields</div>
     242                <div class="featbox pro grey"></div>
     243                <div class="featbox avail blue"></div>
     244            </div>
     245            <div class="fl_row">
     246                <div class="feat">Scrollable Lightbox</div>
    232247                <div class="featbox pro grey"></div>
    233248                <div class="featbox avail blue"></div>
  • optinpoint-lite/trunk/admin/views/admin_general.php

    r1606342 r1611096  
    3636                    </div>
    3737                    <div ng-switch-when="gr">
     38                        <div ng-switch="mailserv.step">
     39                            <div ng-switch-when="0">
     40                                <opttext ng-model="mailserv.config.key[0]" optlab="API Key"></opttext>
     41                            </div>
     42                        </div>
     43                    </div>
     44                    <div ng-switch-when="sg">
     45                        <div ng-switch="mailserv.step">
     46                            <div ng-switch-when="0">
     47                                <opttext ng-model="mailserv.config.key[0]" optlab="API Key"></opttext>
     48                            </div>
     49                        </div>
     50                    </div>
     51                    <div ng-switch-when="hs">
     52                        <div ng-switch="mailserv.step">
     53                            <div ng-switch-when="0">
     54                                <opttext ng-model="mailserv.config.key[0]" optlab="API Key"></opttext>
     55                            </div>
     56                        </div>
     57                    </div>
     58                    <div ng-switch-when="be">
    3859                        <div ng-switch="mailserv.step">
    3960                            <div ng-switch-when="0">
     
    275296                                                </div>
    276297                                            </div>
    277                                             <div class="optpoint_tablefed_row" ng-if="['aw','ic','cc','vr'].indexOf(data.mailserv.id) >= 0 && ['checkbox','radio','select','multiselect'].indexOf(cfield.type) >= 0">
     298                                            <div class="optpoint_tablefed_row" ng-if="field.extra.fill() && ['checkbox','radio','select','multiselect'].indexOf(cfield.type) >= 0">
    278299                                                <label>Options</label>
    279300                                                <div class="optpoint_tablefed_col">
    280301                                                    <div class="optpoint_tablefed_opt" ng-repeat="(k,v) in cfield.extras track by k">
    281                                                         <input type="text" class="optpoint_tabtext" required ng-model="cfield.extras[k].name">
    282                                                         <div class="bar"></div>
    283                                                         <div class="fed_ico mul_del" ng-click="field.extra.del($parent.$index, $index)"></div> 
     302                                                        <div ng-if="field.extra.fill()">
     303                                                            <input type="text" class="optpoint_tabtext" required ng-model="cfield.extras[k].label" ng-if="cfield.extras[k].label">
     304                                                            <input type="text" class="optpoint_tabtext" required ng-model="cfield.extras[k].name" ng-if="!cfield.extras[k].label">
     305                                                            <div class="bar"></div>
     306                                                            <div class="fed_ico mul_del" ng-click="field.extra.del($parent.$index, $index)"></div>
     307                                                        </div>
     308                                                        <div ng-if="!field.extra.fill()">
     309                                                        {{cfield.extras[k].label || cfield.extras[k].name}}
     310                                                        </div>
    284311                                                    </div>
    285                                                     <div class="optpoint_tablefed_optadd" ng-click="field.extra.add($parent.$index)"></div>
     312                                                    <div class="optpoint_tablefed_optadd" ng-click="field.extra.add($parent.$index)" ng-if="field.extra.fill()"></div>
    286313                                                    <div ng-if="!cfield.extras || cfield.extras.length == 0" class="optpoint_tablefed_optemp">Empty</div>
    287314                                                </div>
  • optinpoint-lite/trunk/optinpoint.php

    r1606342 r1611096  
    1111 * Plugin Name:       OptinPoint Lite - Advanced Subscription Hub For Wordpress
    1212 * Plugin URI:        http://voltroid.com/optinpoint
    13  * Description:       Easy to Use Optin Plugin
    14  * Version:           1.0.0
     13 * Description:       All-in-one Subscription Plugin
     14 * Version:           1.0.1
    1515 * Author:            Voltroid
    1616 * Author URI:        http://voltroid.com
     
    2727
    2828require_once( plugin_dir_path( __FILE__ ) . 'public/class-optinpoint.php' );
    29 require_once( plugin_dir_path( __FILE__ ) . 'service/optinpoint-service.php' );
     29
     30if(isset($_GET['optinpont_lite_service']))
     31    require_once( plugin_dir_path( __FILE__ ) . 'service/optinpoint-service.php' );
     32
    3033
    3134register_activation_hook( __FILE__, array( 'OptinPoint_Lite_Assistant', 'activate' ) );
    32 if(isset($_GET['optinpont_lite_service']))
    33     register_deactivation_hook( __FILE__, array( 'OptinPoint_Lite_Assistant', 'deactivate' ) );
     35register_deactivation_hook( __FILE__, array( 'OptinPoint_Lite_Assistant', 'deactivate' ) );
    3436
    3537
  • optinpoint-lite/trunk/public/assets/js/public.js

    r1606342 r1611096  
    596596        case 'date':a=new RegExp(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}?$/gm),e=a.test(w);
    597597            break;
     598        default:e=true;
     599            break;
    598600    }
    599601    return e?!0:!1;
  • optinpoint-lite/trunk/public/class-optinpoint.php

    r1606342 r1611096  
    2121     * @var      string
    2222     */
    23     const VERSION = '1.0.0';
     23    const VERSION = '1.0.1';
    2424
    2525    /**
     
    9090    }
    9191    public function loader(){
    92         global $post;
    93         $values = get_post_custom( $post->ID );
    94         $cmeta = isset( $values['optinpoint_meta'] ) ? json_decode($values['optinpoint_meta'][0],true) : array();
    95         $this->cmeta = $cmeta;
    96         $cat = get_the_category();
    97         $option_name = 'optinpoint_meta_cat_' . (isset($cat[0])?$cat[0]->term_id:'');
    98         $option_name_r = get_option( $option_name );
    99         $cmeta_cat = ($option_name_r ? json_decode($option_name_r,true) : array());
    100         $this->cmeta_cat = $cmeta_cat;
    101         $this->isload = array();
    102         if(((isset($cmeta['Lightbox']['status']) && $cmeta['Lightbox']['status'] == '1') || (!isset($cmeta['Lightbox']['status']) && isset($cmeta_cat['Lightbox']['status']) && $cmeta_cat['Lightbox']['status'] == '1') || ( !isset($cmeta_cat['Lightbox']['status']) && !isset($cmeta['Lightbox']['status']) && isset($this->settings["litebox"]))) && $this->user_status() && $this->referral() && $this->pagetype('l'))
     92        if(!is_single() && !is_page() && !is_404()){
     93            $cmeta = array();
     94            $cmeta_cat = array();
     95        }
     96        else{
     97            global $post;
     98            $values = get_post_custom( $post->ID );
     99            $cmeta = isset( $values['optinpoint_meta'] ) ? json_decode($values['optinpoint_meta'][0],true) : array();
     100            $cat = get_the_category();
     101            $option_name = 'optinpoint_meta_cat_' . (isset($cat[0])?$cat[0]->term_id:'');
     102            $option_name_r = get_option( $option_name );
     103            $cmeta_cat = ($option_name_r ? json_decode($option_name_r,true) : array());
     104        }
     105        $this->cmeta = $cmeta;
     106        $this->cmeta_cat = $cmeta_cat;
     107        $this->isload = array();
     108
     109        if(((isset($cmeta['Lightbox']['status'])&& $cmeta['Lightbox']['status'] == '1' ) || (!isset($cmeta['Lightbox']['status']) && isset($cmeta_cat['Lightbox']['status']) && $cmeta_cat['Lightbox']['status'] == '1') || ( !isset($cmeta_cat['Lightbox']['status']) && !isset($cmeta['Lightbox']['status']) && isset($this->settings["litebox"])&& $this->pagetype('l'))) && $this->user_status() && $this->referral() )
    103110            $this->isload['l']=true;
    104         if(((isset($cmeta['Slider']['status']) && $cmeta['Slider']['status'] == '1') || (!isset($cmeta['Slider']['status']) && isset($cmeta_cat['Slider']['status']) && $cmeta_cat['Slider']['status'] == '1') || ( !isset($cmeta_cat['Slider']['status']) && !isset($cmeta['Slider']['status']) && isset($this->settings["slider"]))) && $this->pagetype('s') && $this->user_status() && $this->referral())
     111        if(((isset($cmeta['Slider']['status'])&& $cmeta['Slider']['status'] == '1' ) || (!isset($cmeta['Slider']['status']) && isset($cmeta_cat['Slider']['status']) && $cmeta_cat['Slider']['status'] == '1') || ( !isset($cmeta_cat['Slider']['status']) && !isset($cmeta['Slider']['status']) && isset($this->settings["slider"])&& $this->pagetype('s'))) && $this->user_status() && $this->referral() )
    105112            $this->isload['s']=true;
    106         if(((isset($cmeta['Addon']['status']) && $cmeta['Addon']['status'] == '1') || (!isset($cmeta['Addon']['status']) && isset($cmeta_cat['Addon']['status']) && $cmeta_cat['Addon']['status'] == '1') || ( !isset($cmeta_cat['Addon']['status']) && !isset($cmeta['Addon']['status']) && isset($this->settings["addon"]))) && $this->user_status() && $this->referral() && $this->pagetype('a'))
     113        if(((isset($cmeta['Addon']['status'])&& $cmeta['Addon']['status'] == '1') || (!isset($cmeta['Addon']['status']) && isset($cmeta_cat['Addon']['status']) && $cmeta_cat['Addon']['status'] == '1') || ( !isset($cmeta_cat['Addon']['status']) && !isset($cmeta['Addon']['status']) && isset($this->settings["addon"])&& $this->pagetype('a'))) && $this->user_status() && $this->referral() )
    107114            $this->isload['a']=true;
    108         if(((isset($cmeta['Flipbox']['status']) && $cmeta['Flipbox']['status'] == '1') || (!isset($cmeta['Flipbox']['status']) && isset($cmeta_cat['Flipbox']['status']) && $cmeta_cat['Flipbox']['status'] == '1') || ( !isset($cmeta_cat['Flipbox']['status']) && !isset($cmeta['Flipbox']['status']) && isset($this->settings["flipbox"]))) && $this->pagetype('f'))
     115        if(((isset($cmeta['Flipbox']['status'])&& $cmeta['Flipbox']['status'] == '1') || (!isset($cmeta['Flipbox']['status']) && isset($cmeta_cat['Flipbox']['status']) && $cmeta_cat['Flipbox']['status'] == '1') || ( !isset($cmeta_cat['Flipbox']['status']) && !isset($cmeta['Flipbox']['status']) && isset($this->settings["flipbox"])&& $this->pagetype('f'))) && $this->user_status() && $this->referral() )
    109116            $this->isload['f']=true;
    110         if(((isset($cmeta['Topbar']['status']) && $cmeta['Topbar']['status'] == '1') || (!isset($cmeta['Topbar']['status']) && isset($cmeta_cat['Topbar']['status']) && $cmeta_cat['Topbar']['status'] == '1') || ( !isset($cmeta_cat['Topbar']['status']) && !isset($cmeta['Topbar']['status']) && isset($this->settings["topbar"]))) && $this->pagetype('t'))
     117        if(((isset($cmeta['Topbar']['status'])&& $cmeta['Topbar']['status'] == '1') || (!isset($cmeta['Topbar']['status']) && isset($cmeta_cat['Topbar']['status']) && $cmeta_cat['Topbar']['status'] == '1') || ( !isset($cmeta_cat['Topbar']['status']) && !isset($cmeta['Topbar']['status']) && isset($this->settings["topbar"])&& $this->pagetype('t'))) && $this->user_status() && $this->referral() )
    111118            $this->isload['t']=true;
    112         if(((isset($cmeta['Widget']['status']) && $cmeta['Widget']['status'] == '1') || (!isset($cmeta['Widget']['status']) && isset($cmeta_cat['Widget']['status']) && $cmeta_cat['Widget']['status'] == '1') || ( !isset($cmeta_cat['Widget']['status']) && !isset($cmeta['Widget']['status']) && isset($this->settings["widget"]))))
     119        if((isset($cmeta['Widget']['status'])&& $cmeta['Widget']['status'] == '1')  || (!isset($cmeta['Widget']['status']) && isset($cmeta_cat['Widget']['status']) && $cmeta_cat['Widget']['status'] == '1') || ( !isset($cmeta_cat['Widget']['status']) && !isset($cmeta['Widget']['status']) && isset($this->settings["widget"])))
    113120            $this->isload['w']=true;
    114121        global $oppo_font;
     
    235242                    .' opporeq="'.(((isset($f['req']) && $f['req']) || (isset($f['foreq']) && $f['foreq']))?'true':'false').'"'
    236243                    .'>'
    237                     .'<span>'.$v['name'].'</span>'
     244                    .'<span>'.(isset($v['label'])?$v['label']:$v['name']).'</span>'
    238245                .'</label>';
    239246            }
     
    255262                    .' opporeq="'.(((isset($f['req']) && $f['req']) || (isset($f['foreq']) && $f['foreq']))?'true':'false').'"'
    256263                    .'>'
    257                     .'<span>'.$v['name'].'</span>'
     264                    .'<span>'.(isset($v['label'])?$v['label']:$v['name']).'</span>'
    258265                .'</label>';
    259266            }
     
    269276            $t = '<option value="">'.$f['label'].'</option>';
    270277            foreach ($f['extras'] as $v) {
    271                 $t.= '<option value="'.$v['name'].'">'.$v['name'].'</option>';
     278                $t.= '<option value="'.$v['name'].'">'.(isset($v['label'])?$v['label']:$v['name']).'</option>';
    272279            }
    273280
     
    284291            $t = '<option value="" disabled>'.$f['label'].'</option>';
    285292            foreach ($f['extras'] as $v) {
    286                 $t.= '<option value="'.$v['name'].'">'.$v['name'].'</option>';
     293                $t.= '<option value="'.$v['name'].'">'.(isset($v['label'])?$v['label']:$v['name']).'</option>';
    287294            }
    288295
     
    965972     */
    966973    public function addon_adder($content){
     974        if(function_exists(is_amp_endpoint))
     975            if(is_amp_endpoint())
     976                return $content;
    967977
    968978        if(isset($this->isload['a'])){
     
    10211031     */
    10221032function addon_scode($atts, $content = null) {
     1033        if(function_exists(is_amp_endpoint))
     1034            if(is_amp_endpoint())
     1035                return $content;
    10231036    $this->loadscripts();
    10241037    ob_start();
  • optinpoint-lite/trunk/public/includes/litebox8.php

    r1606342 r1611096  
    529529#optinpoint-main .optinpoint-social{
    530530display: inline-block;
    531 margin: 12px auto 0;
     531margin: 0 auto;
    532532height: 90px;
    533533width: 100%;
     
    656656#optinpoint-main.wosoc .optinpoint-social {
    657657display: none;
     658}
     659#optinpoint-main.wosoc .optinpoint {
     660height: 100%;
    658661}
    659662
     
    699702            </div>
    700703
     704            </form>
     705          <div class="optinpoint-feedback" oppoerr="gen"></div>
     706      </div>
    701707            <div class="optinpoint-social">
    702708                <div class="optinpoint-soc optinpoint-fb"></div>
     
    705711            </div>
    706712           
    707             </form>
    708           <div class="optinpoint-feedback" oppoerr="gen"></div>
    709       </div>
    710713    </div>
    711714        <div class="optinpoint-close-button"></div>
  • optinpoint-lite/trunk/service/optinpoint-service.php

    r1606342 r1611096  
    2626require_once('vr/VerticalResponse.class.php');
    2727require_once('ac/ActiveCampaign.class.php');
     28require_once('sg/SendGrid.php');
     29require_once('hs/Hubspot.php');
     30require_once('be/BenchmarkEmail.php');
    2831class OptinPoint_Lite_Service {
    2932
     
    4952                $this->wrap = new GetResponse($key[0]);
    5053                break;
     54            case 'sg':
     55                $this->wrap = new SendGrid($key[0]);
     56                break;
     57            case 'hs':
     58                $this->wrap = new Hubspot($key[0]);
     59                break;
     60            case 'be':
     61                $this->wrap = new benchmarkemail_api($key[0]);
     62                break;
    5163            case 'ic':
    5264                iContactApi::getInstance()->setConfig(array(
     
    90102                        echo json_encode($this->wrap->accounts());
    91103                        break;
     104                    case 'sg':
     105                        echo json_encode($this->wrap->test());
     106                        break;
     107                    case 'hs':
     108                        echo json_encode($this->wrap->test());
     109                        break;
     110                    case 'be':
     111                        echo json_encode($this->wrap->lists());
     112                        break;
    92113                    case 'ic':
    93114                        echo json_encode($this->wrap->getCampaigns());
     
    180201                echo json_encode($l);
    181202                break;
     203            case 'sg':
     204                $t = $this->wrap->getLists()['lists'];
     205                $l = array();
     206                if(count($t) > 0){
     207                    foreach ($t as $v) {
     208                        array_push($l, array(
     209                            'id' => $v['id'],
     210                            'name' => $v['name']
     211                        ));
     212                    }
     213                }
     214                echo json_encode($l);
     215                break;
     216            case 'hs':
     217                $t = $this->wrap->getLists()['data']['lists'];
     218                $l = array();
     219                if(count($t) > 0){
     220                    foreach ($t as $v) {
     221                        if($v['dynamic'])continue;
     222                        array_push($l, array(
     223                            'id' => $v['listId'],
     224                            'name' => $v['name']
     225                        ));
     226                    }
     227                }
     228                echo json_encode($l);
     229                break;
     230            case 'be':
     231                $t = $this->wrap->lists();
     232                $l = array();
     233                if(count($t) > 0){
     234                    foreach ($t as $v) {
     235                        array_push($l, array(
     236                            'id' => $v['id'],
     237                            'name' => $v['listname']
     238                        ));
     239                    }
     240                }
     241                echo json_encode($l);
     242                break;
    182243            case 'cc':
    183244                $t = (array) $this->wrap->getLists()->data;
     
    206267                echo json_encode($l);
    207268                break;
    208                 case 'mm':
     269            case 'mm':
    209270                $t = (array) $this->wrap->getLists()->data;
    210271                $l = array();
     
    351412                echo json_encode($l);
    352413                break;
     414            case 'sg':
     415                $t = $this->wrap->getCustomFields()['custom_fields'];
     416                $l = array(
     417                    array(
     418                        'id'=>'email',
     419                        'name'=>'email',
     420                        'label'=>'Email Address',
     421                        'type'=>'text',
     422                        'format'=>'email',
     423                        'req'=>1,
     424                        'icon'=>'idef'
     425                    ),
     426                    array(
     427                        'id'=>'fname',
     428                        'name'=>'first name',
     429                        'label'=>'First Name',
     430                        'type'=>'text',
     431                        'format'=>'text',
     432                        'icon'=>'idef'
     433                    ),
     434                    array(
     435                        'id'=>'lname',
     436                        'name'=>'last name',
     437                        'label'=>'Last Name',
     438                        'type'=>'text',
     439                        'format'=>'text',
     440                        'icon'=>'idef'
     441                    )
     442                );
     443                if(!empty($t)){
     444                    foreach ($t as $v) {
     445                        array_push($l, array(
     446                            'id' => $v['id'],
     447                            'name' => $v['name'],
     448                            'label' => $v['name'],
     449                            'type' => 'text',
     450                            'typesel'=>'single',
     451                            'format' => $v['type'],
     452                            'icon'=>'idef',
     453                            'nof'=>1
     454                        ));
     455                    }
     456                }
     457                echo json_encode($l);
     458                break;
     459            case 'hs':
     460                $t = $this->wrap->getCustomFields();
     461                $l = array(
     462                    array(
     463                        'id'=>'email',
     464                        'name'=>'email',
     465                        'label'=>'Email Address',
     466                        'type'=>'text',
     467                        'format'=>'email',
     468                        'req'=>1,
     469                        'icon'=>'idef'
     470                    ),
     471                    array(
     472                        'id'=>'fname',
     473                        'name'=>'first name',
     474                        'label'=>'First Name',
     475                        'type'=>'text',
     476                        'format'=>'text',
     477                        'icon'=>'idef'
     478                    ),
     479                    array(
     480                        'id'=>'lname',
     481                        'name'=>'last name',
     482                        'label'=>'Last Name',
     483                        'type'=>'text',
     484                        'format'=>'text',
     485                        'icon'=>'idef'
     486                    )
     487                );
     488                if(!empty($t['data'])){
     489                    foreach ($t['data'] as $v) {
     490                        if(!$v['formField'] || in_array($v['name'], array('email','firstname','lastname')))continue;
     491                        array_push($l, array(
     492                            'id' => $v['name'],
     493                            'name' => $v['label'],
     494                            'label' => $v['label'],
     495                            'type' => $v['fieldType'],
     496                            'format' => $this->formatsel('hs',$v['type']),
     497                            'extras' => $this->extsel('hs',$v['options']),
     498                            'icon'=>'idef',
     499                            'nof'=>1,
     500                        ));
     501                    }
     502                }
     503                echo json_encode($l);
     504                break;
    353505            case 'ic':
    354506                $t = $this->wrap->getFields();
     
    768920                        'typesel'=>'single',
    769921                        'noid'=>1,
     922                        'nof'=>1
     923                    )
     924                );
     925                echo json_encode($l);
     926                break;
     927            case 'be':
     928                $l = array(
     929                    array(
     930                        'id'=>'email',
     931                        'name'=>'email',
     932                        'label'=>'Email Address',
     933                        'type'=>'text',
     934                        'format'=>'email',
     935                        'req'=>1,
     936                        'icon'=>'idef'
     937                    ),
     938                    array(
     939                        'id'=>'fname',
     940                        'name'=>'first name',
     941                        'label'=>'First Name',
     942                        'type'=>'text',
     943                        'format'=>'text',
     944                        'icon'=>'idef'
     945                    ),
     946                    array(
     947                        'id'=>'lname',
     948                        'name'=>'last name',
     949                        'label'=>'Last Name',
     950                        'type'=>'text',
     951                        'format'=>'text',
     952                        'icon'=>'idef'
     953                    ),
     954                    array(
     955                        'id'=>'middlename',
     956                        'name'=>'middle name',
     957                        'label'=>'Middle Name',
     958                        'type'=>'text',
     959                        'format'=>'text',
     960                        'icon'=>'idef'
     961                    ),
     962                    array(
     963                        'id'=>'field1',
     964                        'name'=>'address',
     965                        'label'=>'Address',
     966                        'type'=>'text',
     967                        'format'=>'text',
     968                        'icon'=>'idef',
     969                        'typesel'=>'single',
     970                        'nof'=>1
     971                    ),
     972                    array(
     973                        'id'=>'field2',
     974                        'name'=>'city',
     975                        'label'=>'City',
     976                        'type'=>'text',
     977                        'format'=>'text',
     978                        'icon'=>'idef',
     979                        'typesel'=>'single',
     980                        'nof'=>1
     981                    ),
     982                    array(
     983                        'id'=>'field3',
     984                        'name'=>'state',
     985                        'label'=>'State',
     986                        'type'=>'text',
     987                        'format'=>'text',
     988                        'icon'=>'idef',
     989                        'typesel'=>'single',
     990                        'nof'=>1
     991                    ),
     992                    array(
     993                        'id'=>'field4',
     994                        'name'=>'zip',
     995                        'label'=>'Zip',
     996                        'type'=>'text',
     997                        'format'=>'text',
     998                        'icon'=>'idef',
     999                        'typesel'=>'single',
     1000                        'nof'=>1
     1001                    ),
     1002                    array(
     1003                        'id'=>'field5',
     1004                        'name'=>'country',
     1005                        'label'=>'Country',
     1006                        'type'=>'text',
     1007                        'format'=>'text',
     1008                        'icon'=>'idef',
     1009                        'typesel'=>'single',
     1010                        'nof'=>1
     1011                    ),
     1012                    array(
     1013                        'id'=>'field6',
     1014                        'name'=>'phone',
     1015                        'label'=>'Phone',
     1016                        'type'=>'text',
     1017                        'format'=>'text',
     1018                        'icon'=>'idef',
     1019                        'typesel'=>'single',
     1020                        'nof'=>1
     1021                    ),
     1022                    array(
     1023                        'id'=>'field7',
     1024                        'name'=>'fax',
     1025                        'label'=>'Fax',
     1026                        'type'=>'text',
     1027                        'format'=>'text',
     1028                        'icon'=>'idef',
     1029                        'typesel'=>'single',
     1030                        'nof'=>1
     1031                    ),
     1032                    array(
     1033                        'id'=>'field8',
     1034                        'name'=>'cell phone',
     1035                        'label'=>'Cell Phone',
     1036                        'type'=>'text',
     1037                        'format'=>'text',
     1038                        'icon'=>'idef',
     1039                        'typesel'=>'single',
     1040                        'nof'=>1
     1041                    ),
     1042                    array(
     1043                        'id'=>'field9',
     1044                        'name'=>'company name',
     1045                        'label'=>'Company Name',
     1046                        'type'=>'text',
     1047                        'format'=>'text',
     1048                        'icon'=>'idef',
     1049                        'typesel'=>'single',
     1050                        'nof'=>1
     1051                    ),
     1052                    array(
     1053                        'id'=>'field10',
     1054                        'name'=>'job title',
     1055                        'label'=>'Job Title',
     1056                        'type'=>'text',
     1057                        'format'=>'text',
     1058                        'icon'=>'idef',
     1059                        'typesel'=>'single',
     1060                        'nof'=>1
     1061                    ),
     1062                    array(
     1063                        'id'=>'field11',
     1064                        'name'=>'business phone',
     1065                        'label'=>'Business Phone',
     1066                        'type'=>'text',
     1067                        'format'=>'text',
     1068                        'icon'=>'idef',
     1069                        'typesel'=>'single',
     1070                        'nof'=>1
     1071                    ),
     1072                    array(
     1073                        'id'=>'field12',
     1074                        'name'=>'business fax',
     1075                        'label'=>'Business Fax',
     1076                        'type'=>'text',
     1077                        'format'=>'text',
     1078                        'icon'=>'idef',
     1079                        'typesel'=>'single',
     1080                        'nof'=>1
     1081                    ),
     1082                    array(
     1083                        'id'=>'field13',
     1084                        'name'=>'business address',
     1085                        'label'=>'Business Address',
     1086                        'type'=>'text',
     1087                        'format'=>'text',
     1088                        'icon'=>'idef',
     1089                        'typesel'=>'single',
     1090                        'nof'=>1
     1091                    ),
     1092                    array(
     1093                        'id'=>'field14',
     1094                        'name'=>'business city',
     1095                        'label'=>'Business City',
     1096                        'type'=>'text',
     1097                        'format'=>'text',
     1098                        'icon'=>'idef',
     1099                        'typesel'=>'single',
     1100                        'nof'=>1
     1101                    ),
     1102                    array(
     1103                        'id'=>'field15',
     1104                        'name'=>'business state',
     1105                        'label'=>'Business State',
     1106                        'type'=>'text',
     1107                        'format'=>'text',
     1108                        'icon'=>'idef',
     1109                        'typesel'=>'single',
     1110                        'nof'=>1
     1111                    ),
     1112                    array(
     1113                        'id'=>'field16',
     1114                        'name'=>'business zip',
     1115                        'label'=>'Business Zip',
     1116                        'type'=>'text',
     1117                        'format'=>'text',
     1118                        'icon'=>'idef',
     1119                        'typesel'=>'single',
     1120                        'nof'=>1
     1121                    ),
     1122                    array(
     1123                        'id'=>'field17',
     1124                        'name'=>'business country',
     1125                        'label'=>'Business Country',
     1126                        'type'=>'text',
     1127                        'format'=>'text',
     1128                        'icon'=>'idef',
     1129                        'typesel'=>'single',
     1130                        'nof'=>1
     1131                    ),
     1132                    array(
     1133                        'id'=>'field18',
     1134                        'name'=>'notes',
     1135                        'label'=>'Notes',
     1136                        'type'=>'text',
     1137                        'format'=>'text',
     1138                        'icon'=>'idef',
     1139                        'typesel'=>'single',
     1140                        'nof'=>1
     1141                    ),
     1142                    array(
     1143                        'id'=>'field19',
     1144                        'name'=>'date 1',
     1145                        'label'=>'Date 1',
     1146                        'type'=>'text',
     1147                        'format'=>'text',
     1148                        'icon'=>'idef',
     1149                        'typesel'=>'single',
     1150                        'nof'=>1
     1151                    ),
     1152                    array(
     1153                        'id'=>'field20',
     1154                        'name'=>'date 2',
     1155                        'label'=>'Date 2',
     1156                        'type'=>'text',
     1157                        'format'=>'text',
     1158                        'icon'=>'idef',
     1159                        'typesel'=>'single',
     1160                        'nof'=>1
     1161                    ),
     1162                    array(
     1163                        'id'=>'field21',
     1164                        'name'=>'extra 3',
     1165                        'label'=>'Extra 3',
     1166                        'type'=>'text',
     1167                        'format'=>'text',
     1168                        'icon'=>'idef',
     1169                        'typesel'=>'single',
     1170                        'nof'=>1
     1171                    ),
     1172                    array(
     1173                        'id'=>'field22',
     1174                        'name'=>'extra 4',
     1175                        'label'=>'Extra 4',
     1176                        'type'=>'text',
     1177                        'format'=>'text',
     1178                        'icon'=>'idef',
     1179                        'typesel'=>'single',
     1180                        'nof'=>1
     1181                    ),
     1182                    array(
     1183                        'id'=>'field23',
     1184                        'name'=>'extra 5',
     1185                        'label'=>'Extra 5',
     1186                        'type'=>'text',
     1187                        'format'=>'text',
     1188                        'icon'=>'idef',
     1189                        'typesel'=>'single',
     1190                        'nof'=>1
     1191                    ),
     1192                    array(
     1193                        'id'=>'field24',
     1194                        'name'=>'extra 6',
     1195                        'label'=>'Extra 6',
     1196                        'type'=>'text',
     1197                        'format'=>'text',
     1198                        'icon'=>'idef',
     1199                        'typesel'=>'single',
    7701200                        'nof'=>1
    7711201                    )
     
    9041334                }
    9051335                break;
     1336            case 'hs':
     1337                switch ($t) {
     1338                    case 'enumeration':return 'text';
     1339                        break;
     1340                    default:return $t;
     1341                        break;
     1342                }
     1343                break;
    9061344            default:
    9071345                break;
     
    9221360                    }
    9231361                break;
     1362            case 'hs':
     1363                    foreach ($t as $k => $v) {
     1364                        array_push($a, array('name' => $v['value'],'label' =>  $v['label']));
     1365                    }
     1366                break;
    9241367        }
    9251368        return $a;
    9261369    }
    9271370    function subscribe($form,$data){
     1371        foreach ($form['fields'] as $v) {
     1372            if(isset($v['hidden']) && $v['hidden']){
     1373                switch ($v['type']) {
     1374                    case 'radio':
     1375                    case 'checkbox':
     1376                    case 'select':
     1377                    case 'multiselect':
     1378                        $a=array();
     1379                        foreach ($v['extras'] as $g) {
     1380                            if(isset($g['hid']) && $g['hid'])
     1381                                array_push($a, $g['name']);
     1382                        }
     1383                        break;
     1384                    case 'text':
     1385                    case 'textarea':
     1386                        $a=(isset($v['value'])? $v['value']: '');
     1387                        break;
     1388                    default:
     1389                        # code...
     1390                        break;
     1391                }
     1392                $data[$v['id']] = $a;
     1393            }
     1394        }
    9281395        switch ($this->config['id']) {
    9291396            case 'aw':
     
    10241491                        return '1';//subscribed
    10251492                }
     1493                break;
     1494            case 'sg':
     1495                $user = $data;
     1496                if(isset($user['fname'])){
     1497                    $user['first_name'] = $user['fname'];
     1498                    unset($user['fname']);
     1499                }
     1500                if(isset($user['lname'])){
     1501                    $user['last_name'] = $user['lname'];
     1502                    unset($user['lname']);
     1503                }
     1504                $e = $this->wrap->addContact(array($user));
     1505                if($e['error_count'])
     1506                    return '0';//error
     1507                $t = $this->wrap->addToList($e['persisted_recipients'][0],$form['list']['id']);
     1508                if($e['new_count'])
     1509                    return '1';//subscribed
     1510                return '2';//already
     1511                break;
     1512            case 'be':
     1513                $user = $data;
     1514                if(isset($user['fname'])){
     1515                    $user['firstname'] = $user['fname'];
     1516                    unset($user['fname']);
     1517                }
     1518                if(isset($user['lname'])){
     1519                    $user['lastname'] = $user['lname'];
     1520                    unset($user['lname']);
     1521                }
     1522                $t = $this->wrap->find($user['email'],$form['list']['id']);
     1523                if(!empty($t))return '2';//already
     1524                $e = $this->wrap->addContact($user,$form['list']['id']);
     1525                if($e == '1')return '1';//subscribed
     1526                return '0';//error
     1527                break;
     1528            case 'hs':
     1529                if(isset($data['fname'])){
     1530                    $data['firstname'] = $data['fname'];
     1531                    unset($data['fname']);
     1532                }
     1533                if(isset($data['lname'])){
     1534                    $data['lastname'] = $data['lname'];
     1535                    unset($data['lname']);
     1536                }
     1537                $user = array();
     1538                foreach ($data as $key => $value) {
     1539                    array_push($user, array(
     1540                        "property" => $key,
     1541                        "value" => $value
     1542                    ));
     1543                }
     1544                $e = $this->wrap->addContact(array( "properties" => $user));
     1545                if($e['status']==400)
     1546                    return '0';//error
     1547                $atl = array("emails" => array($data['email']));
     1548                $t = $this->wrap->addToList($atl,$form['list']['id']);
     1549                if($e['status']==409)
     1550                    return '2';//already
     1551                if($e['status']==200)
     1552                    return '1';//subscribed
    10261553                break;
    10271554            case 'cc':
     
    11621689                }
    11631690                else
    1164                     return '0';//error
     1691                    return 0;//error
    11651692                break;
    11661693            case 'gr':
     
    11961723                return 0;
    11971724                break;
     1725            case 'sg':
     1726                $user = base64_encode($data['email']);
     1727                $e = $this->wrap->getContact($user);
     1728                if(isset($e['email']))return 1;
     1729                return 0;
     1730                break;
     1731            case 'hs':
     1732                $user = $data['email'];
     1733                $e = $this->wrap->getContact($user);
     1734                if($e['status']==200)return 1;
     1735                return 0;
     1736                break;
     1737            case 'be':
     1738                $user = $data['email'];
     1739                $t = $this->wrap->find($user,$form['list']['id']);
     1740                if(!empty($t))return 1;
     1741                return 0;
     1742                break;
    11981743            case 'vr':
    11991744                $user = array(
     
    12151760                break;
    12161761            case 'ac':
    1217                 $e = $this->wrap->api("contact/view?email=[email protected]");
     1762                $e = $this->wrap->api("contact/view?email=".$data['email']);
    12181763                if($e->result_code)
    12191764                    return 1;
Note: See TracChangeset for help on using the changeset viewer.