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


PHP NewsletterControls::load方法代码示例

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


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

示例1: NewsletterControls

<?php

@(include_once 'commons.php');
$nc = new NewsletterControls();
if (isset($_GET['id'])) {
    $nc->load($wpdb->prefix . 'newsletter_emails', $_GET['id']);
    if (empty($nc->data['id'])) {
        $nc->data['status'] = 'new';
        $nc->data['subject'] = 'Here the email subject';
        $nc->data['message'] = '<p>An empty email to start.</p>';
        $nc->data['theme'] = 'blank';
    }
} else {
    if ($nc->is_action('save') || $nc->is_action('send')) {
        $nc->save($wpdb->prefix . 'newsletter_emails');
    }
    if ($nc->is_action('send')) {
        // Fake value representing the WordPress users as target
        if ($nc->data['list'] == -1) {
            $query = "select count(*) from " . $wpdb->prefix . "users " . $nc->data['query'];
        } else {
            if (!empty($nc->data['query'])) {
                $query = "select count(*) from " . $wpdb->prefix . "newsletter " . $nc->data['query'];
            } else {
                $query = "select count(*) from " . $wpdb->prefix . "newsletter where status='C'";
                if ($nc->data['list'] != 0) {
                    $query .= " and list_" . $nc->data['list'] . "=1";
                }
                if (!empty($nc->data['sex'])) {
                    $query .= " and sex='" . $nc->data['sex'] . "'";
                }
开发者ID:rajveerbeniwal,项目名称:rooms-dhkh,代码行数:31,代码来源:emails-edit.php

示例2: NewsletterControls

<?php

@(include_once 'commons.php');
$nc = new NewsletterControls();
if (isset($_GET['id'])) {
    $nc->load($wpdb->prefix . 'newsletter', $_GET['id']);
    if (empty($nc->data['id'])) {
        $nc->data['status'] = 'C';
        $nc->data['token'] = md5(rand());
    }
} else {
    if ($nc->is_action('save')) {
        for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
            if (!isset($nc->data['list_' . $i])) {
                $nc->data['list_' . $i] = 0;
            }
        }
        $nc->save($wpdb->prefix . 'newsletter');
    }
}
$nc->errors($errors);
$nc->messages($messages);
$options_profile = get_option('newsletter_profile');
?>
<div class="wrap">
    <h2>Newsletter Subscriber Editing</h2>
    <p><a href="admin.php?page=newsletter/users.php">Back to the list</a></p>
    <form method="post" action="admin.php?page=newsletter/users-edit.php">
        <?php 
$nc->init();
?>
开发者ID:rajveerbeniwal,项目名称:rooms-dhkh,代码行数:31,代码来源:users-edit.php


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