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


PHP Newsletter::getNewsletterName方法代码示例

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


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

示例1: wpr_replace_tags

function wpr_replace_tags($sid, &$subject, &$body, $additional = array())
{
    global $wpdb;
    $query = "SELECT * FROM " . $wpdb->prefix . "wpr_subscribers WHERE id='{$sid}'";
    $subscriber = $wpdb->get_results($query);
    $subscriber = $subscriber[0];
    $nid = $subscriber->nid;
    $newsletter = new Newsletter($nid);
    $parameters = array();
    //newsletter name
    $newsletterName = $newsletter->getNewsletterName();
    $parameters['newslettername'] = $newsletterName;
    $query = "SELECT * FROM " . $wpdb->prefix . "wpr_custom_fields where nid='{$nid}'";
    $custom_fields = $wpdb->get_results($query);
    //blog name
    $parameters['sitename'] = get_bloginfo("name");
    //blog url
    $parameters['homeurl'] = get_bloginfo("home");
    //subscriber name
    $parameters['name'] = $subscriber->name;
    //the address of the sender (as required by can spam)
    $parameters['address'] = get_option("wpr_admin_address");
    //the email address
    $parameters['email'] = $subscriber->email;
    //admin email
    $parameters['adminemail'] = get_option('admin_email');
    $query = "select * from " . $wpdb->prefix . "wpr_subscribers_{$nid} where id={$id};";
    $subscriber = $wpdb->get_results($query);
    $subscriber = $subscriber[0];
    //custom fields defined by the administrator
    foreach ($custom_fields as $custom_field) {
        $name = $custom_field->name;
        $parameters[$custom_field->name] = $subscriber->{$name};
    }
    $parameters = array_merge($parameters, $additional);
    foreach ($parameters as $name => $value) {
        $subject = str_replace("[!{$name}!]", $value, $subject);
        $body = str_replace("[!{$name}!]", $value, $body);
    }
}
开发者ID:rpiket,项目名称:WP-Autoresponder,代码行数:40,代码来源:global.php

示例2: _wpr_newsletter_delete

function _wpr_newsletter_delete()
{
    global $wpdb;
    $prefix = $wpdb->prefix;
    $nid = $_GET['nid'];
    try {
        $newsletter = new Newsletter($nid);
    } catch (Exception $excp) {
        _wpr_set("_wpr_view", "newsletter_delete_not_found");
        return;
    }
    if (isset($_GET['confirmed']) && $_GET['confirmed'] == 'true') {
        $newsletter->delete();
        $newsletter_home = Routing::newsletterHome();
        wp_redirect($newsletter_home);
    }
    $getEmailsPendingDeliveryQuery = sprintf("SELECT COUNT(*) number FROM %swpr_queue WHERE sid=(SELECT id FROM %swpr_subscribers WHERE nid=%d) AND sent=0;", $prefix, $prefix, $nid);
    $emails_pending_count_result = $wpdb->get_results($getEmailsPendingDeliveryQuery);
    $number_pending = $emails_pending_count_result[0]->number;
    _wpr_set("newsletter_name", $newsletter->getNewsletterName());
    _wpr_set("subscriber_count", $newsletter->getNumberOfActiveSubscribers());
    _wpr_set("_wpr_view", "newsletter_delete");
    _wpr_set("nid", $nid);
    _wpr_set("emailsPendingDelivery", $number_pending);
}
开发者ID:rpiket,项目名称:WP-Autoresponder,代码行数:25,代码来源:newsletters.php


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