• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP NewsletterUsers类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: instance

 /**
  * @return NewsletterUsers
  */
 static function instance()
 {
     if (self::$instance == null) {
         self::$instance = new NewsletterUsers();
     }
     return self::$instance;
 }
开发者ID:ilke-zilci,项目名称:newcomers-wp,代码行数:10,代码来源:users.php


示例2: get_option

$options_main = get_option('newsletter_main');
$lists = array('' => 'Any');
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
    if (empty($options_lists['list_' . $i])) {
        continue;
    }
    $lists['' . $i] = '(' . $i . ') ' . $options_lists['list_' . $i];
}
if ($controls->is_action('resend')) {
    $user = NewsletterUsers::instance()->get_user($controls->button_data);
    $opts = get_option('newsletter');
    $newsletter->mail($user->email, $newsletter->replace($opts['confirmation_subject'], $user), $newsletter->replace($opts['confirmation_message'], $user));
    $controls->messages = 'Activation email resent to ' . $user->email;
}
if ($controls->is_action('resend_welcome')) {
    $user = NewsletterUsers::instance()->get_user($controls->button_data);
    $opts = get_option('newsletter');
    $newsletter->mail($user->email, $newsletter->replace($opts['confirmed_subject'], $user), $newsletter->replace($opts['confirmed_message'], $user));
    $controls->messages = 'Welcome email resent.';
}
if ($controls->is_action('remove')) {
    $wpdb->query($wpdb->prepare("delete from " . $wpdb->prefix . "newsletter where id=%d", $controls->button_data));
    unset($controls->data['subscriber_id']);
}
if ($action == 'status') {
    newsletter_set_status($controls->data['subscriber_id'], $controls->data['subscriber_status']);
}
if ($controls->is_action('search')) {
    if (empty($controls->data['search_order'])) {
        $order = 'email';
    }
开发者ID:taeche,项目名称:SoDoEx,代码行数:31,代码来源:index-old.php


示例3: NewsletterControls

<?php

require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterUsers::instance();
if ($controls->is_action('save')) {
    $controls->data['status'] = 'C';
    $controls->data['sex'] = 'n';
    $user = $module->save_user($controls->data);
    if ($user === false) {
        $controls->errors = 'This email already exists.';
    } else {
        $controls->js_redirect($module->get_admin_page_url('edit') . '&id=' . $user->id);
        return;
    }
}
?>
<div class="wrap">
    <?php 
$help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module';
?>
    <?php 
include NEWSLETTER_DIR . '/header-new.php';
?>
    <div id="newsletter-title">
    <?php 
include NEWSLETTER_DIR . '/users/menu.inc.php';
?>

    <h2>New subscriber</h2>
</div>
开发者ID:chicosilva,项目名称:olharambiental,代码行数:31,代码来源:new.php


示例4: newsletter_activate

function newsletter_activate()
{
    Newsletter::instance()->upgrade();
    NewsletterUsers::instance()->upgrade();
    NewsletterEmails::instance()->upgrade();
    NewsletterSubscription::instance()->upgrade();
    NewsletterStatistics::instance()->upgrade();
}
开发者ID:blocher,项目名称:oneholyname,代码行数:8,代码来源:plugin.php


示例5: foreach

                for ($i = 1; $i < NEWSLETTER_LIST_MAX; $i++) {
                    $subscriber['list_' . $i] = 0;
                }
                foreach ($controls->data['preferences'] as $i) {
                    $subscriber['list_' . $i] = 1;
                }
            }
            if ($mode == 'update') {
                $subscriber['name'] = $newsletter->normalize_name($data[1]);
                $subscriber['surname'] = $newsletter->normalize_name($data[2]);
                $subscriber['status'] = $controls->data['import_as'];
                foreach ($controls->data['preferences'] as $i) {
                    $subscriber['list_' . $i] = 1;
                }
            }
            NewsletterUsers::instance()->save_user($subscriber);
            $results .= '[UPDATED] ' . $line . "\n";
            $updated_count++;
        }
    }
    if ($error_count) {
        $controls->errors = "Import completed but with errors.";
    }
    $controls->messages = "Import completed: {$error_count} errors, {$added_count} added, {$updated_count} updated, {$skipped_count} skipped.";
}
?>

<div class="wrap">
    <?php 
$help_url = 'http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module';
?>
开发者ID:lenguyenitc,项目名称:donations,代码行数:31,代码来源:import.php


示例6: array

    $email['status'] = 'paused';
}
if ($controls->is_action('continue')) {
    $wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
    $email['status'] = 'sending';
}
if ($controls->is_action('abort')) {
    $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set last_id=0, total=0, sent=0, status='new' where id=" . $email_id);
    $email['status'] = 'new';
    $email['total'] = 0;
    $email['sent'] = 0;
    $email['last_id'] = 0;
    $controls->messages = "Sending aborted.";
}
if ($controls->is_action('test')) {
    $users = NewsletterUsers::instance()->get_test_users();
    if (count($users) == 0) {
        $controls->errors = 'There are no test subscribers. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
    } else {
        Newsletter::instance()->send(Newsletter::instance()->get_email($email_id), $users);
        $controls->messages .= 'Test emails sent to ' . count($users) . ' test subscribers. Read more about test subscribers <a href="http://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank">here</a>.';
    }
    $controls->messages .= '<br>If diagnostic emails are delivered but test emails are not, try to change the encoding to "base 64" on main configuration panel';
}
if ($email['editor'] == 0) {
    $x = strpos($controls->data['message'], '<body');
    // Some time the message in $nc->data is already cleaned up, it depends on action called
    if ($x !== false) {
        $x = strpos($controls->data['message'], '>', $x);
        $y = strpos($controls->data['message'], '</body>');
        $controls->data['message'] = substr($controls->data['message'], $x + 1, $y - $x - 1);
开发者ID:taeche,项目名称:SoDoEx,代码行数:31,代码来源:edit.php


示例7: get_test_subscribers

 /**
  * @deprecated
  */
 function get_test_subscribers()
 {
     return NewsletterUsers::instance()->get_test_users();
 }
开发者ID:lenguyenitc,项目名称:donations,代码行数:7,代码来源:controls.php


示例8:

            $results .= '[INVALID] ' . $email . "\n";
            $error++;
            continue;
        }
        $user = NewsletterUsers::instance()->get_user($email);
        if ($user == null) {
            $results .= '[NOT FOUND] ' . $email . "\n";
            $not_found++;
            continue;
        }
        if ($user->status == 'B') {
            $results .= '[ALREADY BOUNCED] ' . $email . "\n";
            $already_bounced++;
            continue;
        }
        $r = NewsletterUsers::instance()->set_user_status($email, 'B');
        if ($r === 0) {
            $results .= '[BOUNCED] ' . $email . "\n";
            $marked++;
            continue;
        }
    }
    $controls->messages .= 'Total: ' . $total . '<br>';
    $controls->messages .= 'Bounce: ' . $marked . '<br>';
    $controls->messages .= 'Errors: ' . $error . '<br>';
    $controls->messages .= 'Not found: ' . $not_found . '<br>';
    $controls->messages .= 'Already bounced: ' . $already_bounced . '<br>';
}
?>

<div class="wrap" id="tnp-wrap">
开发者ID:radikalportal,项目名称:radikalportal,代码行数:31,代码来源:massive.php


示例9: update_option

    update_option('newsletter_dismissed', array());
    $controls->messages = 'Notices restored.';
}
if ($controls->is_action('trigger_followup')) {
    NewsletterFollowup::instance()->send();
    $controls->messages = 'Follow up delivery engine triggered.';
}
if ($controls->is_action('engine_on')) {
    wp_clear_scheduled_hook('newsletter');
    wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
    $controls->messages = 'Delivery engine reactivated.';
}
if ($controls->is_action('upgrade')) {
    // TODO: Compact them in a call to Newsletter which should be able to manage the installed modules
    Newsletter::instance()->upgrade();
    NewsletterUsers::instance()->upgrade();
    NewsletterSubscription::instance()->upgrade();
    NewsletterEmails::instance()->upgrade();
    NewsletterStatistics::instance()->upgrade();
    if (method_exists('NewsletterFollowup', 'upgrade')) {
        NewsletterFollowup::instance()->upgrade();
    }
    $controls->messages = 'Upgrade forced!';
}
if ($controls->is_action('upgrade_old')) {
    $row = $wpdb->get_row("select * from " . NEWSLETTER_USERS_TABLE . " limit 1");
    if (!isset($row->id)) {
        $row = $wpdb->query("alter table " . NEWSLETTER_USERS_TABLE . " drop primary key");
        $row = $wpdb->query("alter table " . NEWSLETTER_USERS_TABLE . " add column id int not null auto_increment primary key");
        $row = $wpdb->query("alter table " . NEWSLETTER_USERS_TABLE . " add unique email (email)");
    }
开发者ID:ilke-zilci,项目名称:newcomers-wp,代码行数:31,代码来源:diagnostic.php


示例10: NewsletterControls

<?php

require_once '../../../../wordpress/wp-load.php';
$newsletter = Newsletter::instance();
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
// TODO: Check the user capabilities
if (current_user_can('manage_options') || $newsletter->options['editor'] == 1 && current_user_can('manage_categories')) {
    $controls = new NewsletterControls();
    if ($controls->is_action('export')) {
        NewsletterUsers::instance()->export($controls->data);
    }
} else {
    die('Not allowed.');
}
开发者ID:imeuro,项目名称:escapelifestyle,代码行数:14,代码来源:csv.php


示例11: NewsletterControls

<?php

global $newsletter;
require_once '../../../../wp-load.php';
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
// TODO: Check the user capabilities
if (current_user_can('manage_options') || $newsletter->options['editor'] == 1 && current_user_can('manage_categories')) {
    $controls = new NewsletterControls();
    if ($controls->is_action('export')) {
        NewsletterUsers::instance()->export();
    }
} else {
    die('Not allowed.');
}
开发者ID:manhhung86it,项目名称:builder-site,代码行数:14,代码来源:csv.php


示例12: die

            die('Invalid sex value');
        }
        NewsletterUsers::instance()->set_user_field($user->id, 'sex', $value);
        break;
        // Should be managed by Feed by Mail
    // Should be managed by Feed by Mail
    case 'feed':
        if (isset($value) && ($value === '0' || $value === '1')) {
            NewsletterUsers::instance()->set_user_field($user->id, 'feed', $value);
        } else {
            die('Invalid feed value');
        }
        break;
}
if (strpos($field, 'preference_') === 0) {
    $idx = (int) substr($field, 11);
    $options_profile = get_option('newsletter_profile');
    if ($options_profile['list_' . $idx . '_status'] == 0) {
        die('Not allowed field.');
    }
    if (isset($value) && ($value === '0' || $value === '1')) {
        NewsletterUsers::instance()->set_user_field($user->id, 'list_' . $idx, $value);
    } else {
        die('Invalid preference value');
    }
}
if (isset($url)) {
    header("Location: {$url}");
} else {
    NewsletterSubscription::instance()->show_message('profile', $user, NewsletterSubscription::instance()->options['profile_saved']);
}
开发者ID:ilke-zilci,项目名称:newcomers-wp,代码行数:31,代码来源:change.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP NextendCss类代码示例发布时间:2022-05-23
下一篇:
PHP NewsletterSubscription类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap