本文整理汇总了PHP中SendPress_Data::get_list_details方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::get_list_details方法的具体用法?PHP SendPress_Data::get_list_details怎么用?PHP SendPress_Data::get_list_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SendPress_Data
的用法示例。
在下文中一共展示了SendPress_Data::get_list_details方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: html
function html()
{
global $post_ID, $post;
$list = '';
$emailID = SPNL()->validate->_int('emailID');
if ($emailID > 0) {
$post = get_post($emailID);
$post_ID = $post->ID;
}
?>
<form method="POST" name="post" id="post">
<?php
$info = SendPress_Option::get('current_send_' . $post->ID);
$subject = SendPress_Option::get('current_send_subject_' . $post->ID, true);
?>
<div id="styler-menu">
<div style="float:right;" class="btn-group">
<a class="btn btn-primary btn-large " id="confirm-send" href="#"><i class="icon-white icon-thumbs-up"></i> <?php
_e('Confirm Send', 'sendpress');
?>
</a>
</div>
</div>
<div id="sp-cancel-btn" style="float:right; ">
<a class="btn btn-default" href="<?php
echo '?page=' . SPNL()->validate->page() . '&view=send&emailID=' . $emailID;
?>
"><?php
_e('Cancel Send', 'sendpress');
?>
</a>
</div>
<h2><?php
_e('Confirm Send', 'sendpress');
?>
</h2>
<br>
<input type="hidden" id="user-id" name="user_ID" value="<?php
//echo $current_user->ID;
?>
" />
<input type="hidden" id="post_ID" name="post_ID" value="<?php
echo $post->ID;
?>
" />
<div class="boxer">
<div class="boxer-inner">
<?php
$this->panel_start('<span class="glyphicon glyphicon-inbox"></span> ' . __('Subject', 'sendpress'));
?>
<input type="text" class="form-control" value="<?php
echo stripslashes(esc_attr(htmlspecialchars($subject)));
?>
" disabled />
<?php
$this->panel_end();
?>
<div class="leftcol">
<?php
$this->panel_start('<span class="glyphicon glyphicon-calendar"></span> ' . __('Date & Time', 'sendpress'));
if ($info['send_at'] == '0000-00-00 00:00:00') {
echo "Your email will start sending right away!";
} else {
echo "Your email will start sending on " . date('Y/m/d', strtotime($info['send_at'])) . " at " . date('h:i A', strtotime($info['send_at']));
}
$this->panel_end();
$this->panel_start('<span class="glyphicon glyphicon-list"></span> ' . __('Lists', 'sendpress'));
?>
<?php
if (!empty($info['listIDS'])) {
foreach ($info['listIDS'] as $list_id) {
$list = SendPress_Data::get_list_details($list_id);
echo $list->post_title . " <small>(" . SendPress_Data::get_count_subscribers($list_id) . ")</small><br>";
}
} else {
_e('No Lists Selected', 'sendpress');
echo "<br>";
}
$this->panel_end();
$this->panel_start('<span class="glyphicon glyphicon-tag"></span> ' . __('Mark as Test', 'sendpress'));
$sel = '';
if (get_post_meta($post_ID, 'istest', true) == true) {
$sel = 'checked';
}
echo "<input {$sel} name='test_report' type='checkbox' id='test_report' value='1' disabled> Test<br>";
echo "<small class='text-muted'>" . __('This puts the report into the Test tab on the Reports screen', 'sendpress') . ".</small>";
$this->panel_end();
?>
</div>
<div style="margin-left: 250px;">
<div class="widerightcol">
<?php
$link = get_permalink($post->ID);
$sep = strstr($link, '?') ? '&' : '?';
$link = $link . $sep . 'inline=true';
//.........这里部分代码省略.........