当前位置: 首页>>代码示例>>PHP>>正文


PHP SendPress_Data::devicetypes方法代码示例

本文整理汇总了PHP中SendPress_Data::devicetypes方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::devicetypes方法的具体用法?PHP SendPress_Data::devicetypes怎么用?PHP SendPress_Data::devicetypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SendPress_Data的用法示例。


在下文中一共展示了SendPress_Data::devicetypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: html

 function html()
 {
     //$ip = $_SERVER['REMOTE_ADDR'];
     $info = $this->data();
     //$hash = wp_hash( $info->url , 'sendpress' );
     $db_url = SPNL()->db->url;
     $url_in_db = $db_url->get($info->url);
     //= SendPress_Data::get_url_by_hash( $hash );
     if ($url_in_db == false) {
         $id = $db_url->add($info->url);
     } else {
         $id = $url_in_db;
     }
     $dk = SendPress_Data::devicetypes($this->_device_type);
     $url = $info->url;
     switch ($info->url) {
         case '{sp-browser-url}':
             $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Browser_Url::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false);
             break;
         case '{sp-unsubscribe-url}':
             $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Unsubscribe::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false);
             break;
         case '{sp-manage-subscription-url}':
             $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Manage_Subscriptions::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false);
             break;
     }
     SPNL()->db->subscribers_url->add_update(array('subscriber_id' => $info->id, 'email_id' => $info->report, 'url_id' => $id));
     SPNL()->db->subscribers_tracker->open($info->report, $info->id, 2);
     if (strrpos($url, "mailto") !== false) {
         header("Location: " . esc_url_raw($url));
     } else {
         if (defined("SENDPRESS_PRO_VERSION")) {
             $url = add_query_arg('utm_medium', 'email', $url);
             $url = add_query_arg('utm_source', 'sendpress', $url);
             $sub = get_post_meta($info->report, '_sendpress_subject', true);
             $alt = get_post_meta($info->report, 'google-campaign-name', true);
             if ($alt !== false) {
                 $sub = $alt;
             }
             $url = add_query_arg('utm_campaign', $sub, $url);
         }
         wp_redirect(esc_url_raw($url));
     }
     exit;
     //
     //$link = SendPress_Data::get_url_by_id( $info->urlID );
     //SendPress_Data::track_click( $info->id , $info->report, $info->urlID , $ip , $this->_device_type, $this->_device );
     //header("Location: " . $link->url);
     //wp_redirect( $link->url );
     //exit;
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:51,代码来源:class-sendpress-public-view-tracker.php

示例2: html

 function html()
 {
     //$ip = $_SERVER['REMOTE_ADDR'];
     $info = $this->data();
     //$hash = wp_hash( $info->url , 'sendpress' );
     $dk = SendPress_Data::devicetypes($this->_device_type);
     $url = $info->url;
     switch ($info->url) {
         case '{sp-browser-url}':
             $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Browser_Url::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false);
             break;
         case '{sp-unsubscribe-url}':
             $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Unsubscribe::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false);
             break;
         case '{sp-manage-subscription-url}':
             $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Manage_Subscriptions::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false);
             break;
     }
     $args = array('timeout' => 0.1, 'blocking' => false, 'headers' => array(), 'sslverify' => false);
     $request = home_url('/spnl-api/tracker');
     // Parameters as separate arguments
     $request = add_query_arg(array('email' => $info->report, 'url' => urlencode($info->url), 'id' => $info->id), $request);
     wp_remote_get($request, $args);
     if (strrpos($url, "mailto") !== false) {
         header("Location: " . esc_url_raw($url));
     } else {
         if (defined("SENDPRESS_PRO_VERSION")) {
             $url = add_query_arg('utm_medium', 'email', $url);
             $url = add_query_arg('utm_source', 'sendpress', $url);
             $sub = get_post_meta($info->report, '_sendpress_subject', true);
             $alt = get_post_meta($info->report, 'google-campaign-name', true);
             if ($alt !== false) {
                 $sub = $alt;
             }
             $url = add_query_arg('utm_campaign', $sub, $url);
         }
         wp_redirect(esc_url_raw($url));
     }
     exit;
     //
     //$link = SendPress_Data::get_url_by_id( $info->urlID );
     //SendPress_Data::track_click( $info->id , $info->report, $info->urlID , $ip , $this->_device_type, $this->_device );
     //header("Location: " . $link->url);
     //wp_redirect( $link->url );
     //exit;
 }
开发者ID:pmatheus,项目名称:participacao-sitebase,代码行数:46,代码来源:class-sendpress-public-view-tracker.php


注:本文中的SendPress_Data::devicetypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。