+44 (0)1223 659363 contact@acep.org.uk

emailer

[content_band style=”color: #333;” bg_color=”#ffddea” border=”all” inner_container=”true”] [custom_headline style=”margin-top: 0;” level=”h3″ looks_like=”h3″]Control Panel[/custom_headline]

[/content_band]

[insert_php]
global $wpdb;
$current_user = wp_get_current_user();
$formid=$current_user->ID;
$meta = get_user_meta($formid);
$plus = $meta[‘googleplus’][0];
$moreplus = (string)$plus;
echo “Page view status:”.$moreplus.PHP_EOL;
if ($moreplus==”lock”){echo “Email sending has been locked”.PHP_EOL;} else {
echo ““;
echo ““;
echo ““;}
[/insert_php]

Emailer log

[insert_php]

//$lastposts = new WP_Query(‘post_type=postman_sent_mail’);

$data = array ();
$args = array (
‘posts_per_page’ => 1000,
‘offset’ => 0,
‘category’ => ”,
‘category_name’ => ”,
‘orderby’ => ‘date’,
‘order’ => ‘DESC’,
‘include’ => ”,
‘exclude’ => ”,
‘meta_key’ => ”,
‘meta_value’ => ”,
‘post_type’ => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG,
‘post_mime_type’ => ”,
‘post_parent’ => ”,
‘post_status’ => ‘private’,
‘suppress_filters’ => true
);
$posts = get_posts ( $args );
foreach ( $posts as $post ) {
$date = $post->post_date;
//echo $date;
$humanTime = human_time_diff ( strtotime ( $post->post_date_gmt ) );
// if this PHP system support humanTime, than use it
if (! empty ( $humanTime )) {
/* Translators: where %s indicates the relative time from now */
$date = sprintf ( _x ( ‘%s ago’, ‘A relative time as in “five days ago”‘, ‘postman-smtp’ ), $humanTime );
}
$flattenedPost = array (
// the post title must be escaped as they are displayed in the HTML output
‘title’ => esc_html ( $post->post_title ),
// the post status must be escaped as they are displayed in the HTML output
‘status’ => ($post->post_excerpt != null ? esc_html ( $post->post_excerpt ) : __ ( ‘Sent’, ‘postman-smtp’ )),
‘date’ => $date,
‘ID’ => $post->ID
);
array_push ( $data, $flattenedPost );
}

//print_r($data);
echo “

“;
foreach($data as $item) {
echo “

“;

}
echo “

“;
echo $item[‘title’];
echo “

“;
echo $item[‘date’];
echo “

“;
echo $item[‘status’];
echo “

“;

[/insert_php]