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


PHP SendPress_Data::get_subscriber方法代码示例

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


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

示例1: send_manage_subscription

 static function send_manage_subscription($subscriberID, $listids, $lists)
 {
     $subscriber = SendPress_Data::get_subscriber($subscriberID);
     SendPress_Email_Cache::build_cache_for_system_email($optin);
 }
开发者ID:pedro-mendonca,项目名称:sendpress,代码行数:5,代码来源:class-sendpress-manager.php

示例2: html


//.........这里部分代码省略.........
                ?>
  </div>
</div>
<?php 
                $this->panel_end();
            }
            ?>




<div class="sp-row">
<div class="sp-33 sp-first">
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title"><?php 
            _e('Recent Subscribers', 'sendpress');
            ?>
</h3>
  </div>
  <div class="panel-body">
  	<table class="table table-striped table-condensed">
    <tr>
    <th>Date</th>
    <th>List</th>
    <th><div style="text-align:right;">Email</div></th>
    </tr>
  	<?php 
            $recent = SendPress_Data::get_recent_subscribers();
            foreach ($recent as $item) {
                echo "<tr>";
                echo "<td>";
                if (property_exists($item, 'subscriberID')) {
                    $d = SendPress_Data::get_subscriber($item->subscriberID);
                    if (property_exists($item, 'updated')) {
                        echo date_i18n("m.d.y", strtotime($item->updated));
                    }
                    echo "</td>";
                    echo "<td >";
                    if (property_exists($item, 'listID')) {
                        echo get_the_title($item->listID);
                    }
                    echo "</td>";
                    echo "<td align='right'>";
                    if (is_object($d)) {
                        echo $d->email . "<br>";
                    }
                    echo "</td>";
                    echo "</tr>";
                }
            }
            ?>
  </table>
  </div>
</div>
</div>
<div class="sp-33">
	<div class="panel panel-default">
	  <div class="panel-heading">
	    <h3 class="panel-title"><?php 
            _e('Most Active Subscribers', 'sendpress');
            ?>
</h3>
	  </div>
	  <div class="panel-body">
	  	<ul>
开发者ID:richardsweeney,项目名称:sendpress,代码行数:67,代码来源:class-sendpress-view-overview.php

示例3: html

    function html($sp)
    {
        ?>
	<div id="taskbar" class="lists-dashboard rounded group">
		<form id="subscriber-edit" method="post">
	<div style="float:right;" >
	<input type="submit" class="btn btn-primary btn-large " id="subscriber-save" value="<?php 
        _e('Save', 'sendpress');
        ?>
"/>
</div> 
		
	<h2><?php 
        _e('Edit Subscriber', 'sendpress');
        ?>
</h2>
	</div>
<?php 
        $sub = SendPress_Data::get_subscriber($_GET['subscriberID']);
        ?>
<div class="boxer">
	<div class="boxer-inner">
		<div class="spmedia">
			<div class="media-image">
		<?php 
        echo get_avatar($sub->email, $size = '96');
        ?>
		</div>
		<div class="media-body">
	
		<input type="hidden" name="listID" value="<?php 
        echo SPNL()->validate->int($_GET['listID']);
        ?>
" />
	    <input type="hidden" name="subscriberID" value="<?php 
        echo SPNL()->validate->int($_GET['subscriberID']);
        ?>
" />
	    <strong><?php 
        _e('Email', 'sendpress');
        ?>
</strong>: <input type="text" name="email" class="regular-text sp-text" value="<?php 
        echo $sub->email;
        ?>
" /><br><br>
	    <strong><?php 
        _e('Firstname', 'sendpress');
        ?>
</strong>: <input type="text" class="regular-text sp-text" name="firstname" value="<?php 
        echo $sub->firstname;
        ?>
" /><br><br>
	    <strong><?php 
        _e('Lastname', 'sendpress');
        ?>
</strong>: <input type="text" class="regular-text sp-text" name="lastname" value="<?php 
        echo $sub->lastname;
        ?>
" /><br>
	    <br>
<input type="checkbox" id="delete-this-user" name="delete-this-user" value="yes"/> Checking this box will remove this subscriber and all related data from the system.<br><br>

	  
	   <?php 
        wp_nonce_field($sp->_nonce_value);
        ?>

	
	</div></div>
	<?php 
        ?>

	<h3>Subscriptions</h3>
	<div class="well">
		<table class=" table table-bordered table-striped">
			<tr>
				<th>List Name</th>
				<th>Status</th>
			</tr>
			<?php 
        global $post;
        $args = array('post_type' => 'sendpress_list', 'post_status' => array('publish', 'draft'), 'posts_per_page' => 100, 'order' => 'ASC', 'orderby' => 'title');
        $postslist = get_posts($args);
        foreach ($postslist as $post) {
            setup_postdata($post);
            ?>
 
			
				<tr>
					<td><?php 
            the_title();
            ?>
</td>
					<td><?php 
            $info = SendPress_Data::get_subscriber_list_status($post->ID, $_GET['subscriberID']);
            if (isset($info) && $info !== false) {
                $cls = '';
                if ($info->statusid == 1) {
                    $cls = 'badge-warning';
                }
//.........这里部分代码省略.........
开发者ID:pmatheus,项目名称:participacao-sitebase,代码行数:101,代码来源:class-sendpress-view-subscribers-subscriber.php

示例4: send_manage_subscription

 static function send_manage_subscription($subscriberID, $listids, $lists)
 {
     $subscriber = SendPress_Data::get_subscriber($subscriberID);
     $l = '';
     foreach ($lists as $list) {
         if (in_array($list->ID, $listids)) {
             $l .= $list->post_title . " <br>";
         }
     }
     //	add_filter( 'the_content', array( $this, 'the_content') );
     $optin = SendPress_Data::get_template_id_by_slug('double-optin');
     $user = SendPress_Data::get_template_id_by_slug('user-style');
     SendPress_Posts::copy_meta_info($optin, $user);
     $message = new SendPress_Email();
     $message->id($optin);
     $message->subscriber_id($subscriberID);
     $message->remove_links(true);
     $message->purge(true);
     $html = $message->html();
     $message->purge(false);
     $text = $message->text();
     $code = array("id" => $subscriberID, "listids" => implode(',', $listids), "view" => "confirm");
     $code = SendPress_Data::encrypt($code);
     if (SendPress_Option::get('old_permalink') || !get_option('permalink_structure')) {
         $link = home_url() . "?sendpress=" . $code;
     } else {
         $link = home_url() . "/sendpress/" . $code;
     }
     $href = $link;
     $html_href = "<a href='" . $link . "'>" . $link . "</a>";
     $html = str_replace("*|SP:CONFIRMLINK|*", $html_href, $html);
     $text = str_replace("*|SP:CONFIRMLINK|*", $href, $text);
     $text = nl2br($text);
     $sub = $message->subject();
     SendPress_Data::register_event('confirm_sent', $subscriberID);
     SendPress_Manager::send($subscriber->email, $sub, $html, $text, false);
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:37,代码来源:class-sendpress-manager.php

示例5: subject

 function subject()
 {
     // Get any existing copy of our transient data
     //if ( false === ( $email_subject = get_transient( 'sendpress_report_subject_'. $this->id() ) ) || ($this->purge() == true) ) {
     // It wasn't there, so regenerate the data and save the transient
     if (!$this->post_info) {
         $this->post_info = get_post($this->id());
     }
     if ($this->post_info->post_type == 'sp_newsletters' || $this->post_info->post_type == 'sp_report') {
         $email_subject = get_post_meta($this->id(), '_sendpress_subject', true);
     } else {
         $email_subject = $this->post_info->post_title;
     }
     $email_subject = SendPress_Template::tag_replace($email_subject);
     //	set_transient( 'sendpress_report_subject_'. $this->id(), $email_subject , 60*60*2);
     // Get any existing copy of our transient data
     //}
     $subscriber = SendPress_Data::get_subscriber($this->subscriber_id());
     if (!is_null($subscriber)) {
         $email_subject = str_replace("*|FNAME|*", $subscriber->firstname, $email_subject);
         $email_subject = str_replace("*|LNAME|*", $subscriber->lastname, $email_subject);
         $email_subject = str_replace("*|EMAIL|*", $subscriber->email, $email_subject);
         $email_subject = str_replace("*|ID|*", $subscriber->subscriberID, $email_subject);
     }
     return $email_subject;
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:26,代码来源:class-sendpress-email.php

示例6: build_unsibscribed_notification

 static function build_unsibscribed_notification($data)
 {
     $unsubscribe_body = '';
     $options = SendPress_Option::get('notification_options');
     switch ($options['unsubscribed']) {
         case 0:
             if ($data && $data['type'] === 'unsubscribed') {
                 $list = SendPress_Data::get_list_details($data['listID']);
                 $sub = SendPress_Data::get_subscriber($data['subscriberID']);
                 $unsubscribe_body = $sub->email . ' has unsubscribed from your list "' . $list->post_title . '".';
             }
             break;
         case 1:
             //$count = SendPress_Data::get_subscriber_event_count_day(date('Y-m-d'),'unsubscribed');
             $count = SendPress_Data::get_subscriber_count(date('Y-m-d H:i:s', strtotime('-1 day')), date('Y-m-d H:i:s'), 3);
             $unsubscribe_body = 'You had ' . $count . ' users unsubscribe today.';
             break;
         case 2:
             if (false === ($sendpress_weekly_check = get_transient('sendpress_weekly_unsubscribed_check'))) {
                 // It wasn't there, so regenerate the data and save the transient
                 if (date('w') === get_option('start_of_week', 0)) {
                     $count = SendPress_Data::get_subscriber_count(date('Y-m-d H:i:s', strtotime('-1 week')), date('Y-m-d H:i:s'), 3);
                     //$count = SendPress_Data::get_subscriber_event_count_week(date('Y-m-d', strtotime(date('Y-m-d')." -1 week")),date('Y-m-d'),'unsubscribed');
                     $unsubscribe_body = 'You had ' . $count . ' people unsubscribe last week.';
                     set_transient('sendpress_weekly_unsubscribed_check', true, WEEK_IN_SECONDS);
                 }
             }
             break;
         case 3:
             if (false === ($sendpress_monthly_check = get_transient('sendpress_monthly_unsubscribed_check'))) {
                 if (intval(date('j')) === 1) {
                     //get subscribers for for the last month
                     $count = SendPress_Data::get_subscriber_count(date('Y-m-d H:i:s', strtotime('-1 month')), date('Y-m-d H:i:s'), 3);
                     //$count = SendPress_Data::get_subscriber_event_count_month(date('j', strtotime(date('j')." -1 month")),'unsubscribed');
                     $unsubscribe_body = 'You had ' . $count . ' people unsubscribe last month.<br><br>';
                     set_transient('sendpress_monthly_unsubscribed_check', true, MONTH_IN_SECONDS);
                 }
             }
             break;
     }
     return $unsubscribe_body;
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:42,代码来源:class-sendpress-notifications-manager.php

示例7: manage_subscription

    private static function manage_subscription($options)
    {
        //debug
        // $link_data = array(
        // 	"id"=>23,
        // 	"report"=>0,
        // 	"urlID"=> '0',
        // 	"view"=>"manage",
        // 	"listID"=>"0",
        // 	"action"=>""
        // );
        // $code = SendPress_Data::encrypt( $link_data );
        // $link =  SendPress_Manager::public_url($code);
        // print_r($link);
        $_nonce_value = 'sendpress-is-awesome';
        $info = self::data();
        //SendPress_Error::log($info->id);
        //print_r($info);
        if (!isset($info->id)) {
            $info = new stdClass();
            $info->id = '';
        }
        $s = $info->id;
        //SendPress_Error::log($s);
        extract($options);
        if (is_numeric($s)) {
            $sub = SendPress_Data::get_subscriber($s);
            if ($sub == false) {
                $sub = new stdClass();
                $sub->email = 'example@sendpress.com';
                $sub->join_date = date("F j, Y, g:i a");
            }
            // print_r($sub);
            ?>
			<link rel="stylesheet" type="text/css" href="<?php 
            echo SENDPRESS_URL;
            ?>
/css/manage-front-end.css">
			<div class="sendpress-content">
				<h4>Manage Subscriptions</h4>
				<div class="subscriber-info">
					<b><?php 
            _e('Email', 'sendpress');
            ?>
</b>
					<?php 
            echo $sub->email;
            ?>
<br>
					<b><?php 
            _e('Signup Date', 'sendpress');
            ?>
</b>
					<?php 
            echo $sub->join_date;
            ?>
				</div>
				<?php 
            if (self::handle_unsubscribes()) {
                ?>
					<div class="alert alert-block alert-info">
		 				<h4 class="alert-heading"><?php 
                _e('Saved', 'sendpress');
                ?>
!</h4>
		 				<?php 
                _e('Your subscriptions have been updated. Thanks.', 'sendpress');
                ?>
					</div>
					<?php 
            }
            ?>
				
				<p><?php 
            _e('You are subscribed to the following lists:', 'sendpress');
            ?>
</p>
				<?php 
            $info->action = "update";
            $key = SendPress_Data::encrypt($info);
            $query_var = '';
            if (get_query_var('spms')) {
                $query_var = "?spms=" . $key;
            } elseif (get_query_var('sendpress')) {
                $query_var = "?sendpress=" . $key;
            }
            ?>
				<form action="<?php 
            echo $query_var;
            ?>
" method="post">
				<?php 
            wp_nonce_field(SendPress_Data::nonce());
            ?>
				<input type="hidden" name="subscriberid" id="subscriberid" value="<?php 
            echo $s;
            ?>
" />

				<table cellpadding="0" cellspacing="0" class="table table-condensed table-striped table-bordered">
//.........这里部分代码省略.........
开发者ID:richardsweeney,项目名称:sendpress,代码行数:101,代码来源:class-sendpress-sc-forms.php

示例8: getSubscriber

 function getSubscriber($subscriberID, $listID = false)
 {
     _deprecated_function(__FUNCTION__, '0.8.7', 'SendPress_Data::get_subscriber($subscriberID, $listID)');
     return SendPress_Data::get_subscriber($subscriberID, $listID);
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:5,代码来源:sendpress.php

示例9: html


//.........这里部分代码省略.........
                ?>
  </div>
</div>
<?php 
                $this->panel_end();
            }
            ?>




<div class="sp-row">
<div class="sp-33 sp-first">
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title"><?php 
            _e('Recent Subscribers', 'sendpress');
            ?>
</h3>
  </div>
  <div class="panel-body">
  	<table class="table table-striped table-condensed">
    <tr>
    <th>Date</th>
    <th>List</th>
    <th><div style="text-align:right;">Email</div></th>
    </tr>
  	<?php 
            $recent = SendPress_Data::get_subscribed_events();
            foreach ($recent as $item) {
                echo "<tr>";
                echo "<td>";
                if (property_exists($item, 'subscriberID')) {
                    $d = SendPress_Data::get_subscriber($item->subscriberID);
                    if (property_exists($item, 'eventdate')) {
                        echo date_i18n("m.d.y", strtotime($item->eventdate));
                    }
                    echo "</td>";
                    echo "<td >";
                    if (property_exists($item, 'listID')) {
                        echo get_the_title($item->listID);
                    }
                    echo "</td>";
                    echo "<td align='right'>";
                    if (is_object($d)) {
                        echo $d->email . "<br>";
                    }
                    echo "</td>";
                    echo "</tr>";
                }
            }
            ?>
  </table>
  </div>
</div>
</div>
<div class="sp-33">
	<div class="panel panel-default">
	  <div class="panel-heading">
	    <h3 class="panel-title"><?php 
            _e('Most Active Subscribers', 'sendpress');
            ?>
</h3>
	  </div>
	  <div class="panel-body">
	  	<ul>
开发者ID:radscheit,项目名称:unicorn,代码行数:67,代码来源:class-sendpress-view-overview.php


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