本文整理汇总了PHP中es_cls_dbquery类的典型用法代码示例。如果您正苦于以下问题:PHP es_cls_dbquery类的具体用法?PHP es_cls_dbquery怎么用?PHP es_cls_dbquery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了es_cls_dbquery类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: es_subscriber_default
public static function es_subscriber_default()
{
$result = es_cls_dbquery::es_view_subscriber_count(0);
if ($result == 0) {
$form["es_email_mail"] = get_option('admin_email');
$form["es_email_name"] = "Admin";
$form["es_email_group"] = "Public";
$form["es_email_status"] = "Confirmed";
es_cls_dbquery::es_view_subscriber_ins($form, "insert");
$form["es_email_mail"] = "a.example@example.com";
$form["es_email_name"] = "Example";
$form["es_email_group"] = "Public";
$form["es_email_status"] = "Confirmed";
es_cls_dbquery::es_view_subscriber_ins($form, "insert");
}
return true;
}
示例2: _e
?>
</p>
<label for="tag-display-status"><?php
_e('Select default group', 'email-subscribers');
?>
</label>
<select name="es_registered_group" id="es_email_group">
<option value=''><?php
_e('Select', 'email-subscribers');
?>
</option>
<?php
$thisselected = "";
$groups = array();
$groups = es_cls_dbquery::es_view_subscriber_group();
if (count($groups) > 0) {
$i = 1;
foreach ($groups as $group) {
if ($group["es_email_group"] == $es_registered_group) {
$thisselected = "selected='selected'";
}
?>
<option value='<?php
echo $group["es_email_group"];
?>
' <?php
echo $thisselected;
?>
><?php
echo $group["es_email_group"];
示例3: array
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('J,K,L')">J,K,L</a>
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('M,N,O')">M,N,O</a>
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('P,Q,R')">P,Q,R</a>
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('S,T,U')">S,T,U</a>
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('V,W,X,Y,Z')">V,W,X,Y,Z</a>
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('0,1,2,3,4,5,6,7,8,9')">0-9</a>
<a class="button add-new-h2" href="javascript:void(0);" onClick="javascript:_es_sendemailsearch('ALL')">ALL</a>
<span>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<?php
$subscribers = array();
$subscribers = es_cls_dbquery::es_view_subscriber_sendmail($es_search_query, $es_email_group);
$i = 1;
$count = 0;
if (count($subscribers) > 0) {
echo "<table border='0' cellspacing='0'><tr>";
$col = 3;
foreach ($subscribers as $subscriber) {
$to = $subscriber['es_email_mail'];
$id = $subscriber['es_email_id'];
//$ToAddress = trim($to) . '<||>' . trim($id);
if ($to != "") {
echo "<td style='padding-top:4px;padding-bottom:4px;padding-right:10px;'>";
?>
<input class="radio" type="checkbox" checked="checked" value='<?php
echo $id;
?>
示例4: array
// Check errors in the query string
if ($form['db'] == '' || $form['email'] == '' || $form['guid'] == '') {
$noerror = false;
} else {
if (!is_numeric($form['db'])) {
$noerror = false;
}
if (!filter_var($form['email'], FILTER_VALIDATE_EMAIL)) {
$noerror = false;
}
}
// Load default message
$data = array();
$data = es_cls_settings::es_setting_select(1);
if ($noerror) {
$result = es_cls_dbquery::es_view_subscriber_job("Unsubscribed", $form['db'], $form['guid'], $form['email']);
if ($result) {
$message = esc_html(stripslashes($data['es_c_unsubhtml']));
$message = str_replace("\r\n", "<br />", $message);
} else {
$message = esc_html(stripslashes($data['es_c_message2']));
}
if ($message == "") {
$message = __('Oops.. We are getting some technical error. Please try again or contact admin.', 'email-subscribers');
}
echo $message;
} else {
$message = esc_html(stripslashes($data['es_c_message2']));
$message = str_replace("\r\n", "<br />", $message);
if ($message == "") {
$message = __('Oops.. We are getting some technical error. Please try again or contact admin.', 'email-subscribers');
示例5: es_view_subscriber_widget
public static function es_view_subscriber_widget($data = array())
{
global $wpdb;
$prefix = $wpdb->prefix;
$arrRes = array();
$currentdate = date('Y-m-d G:i:s');
//$sSql = "SELECT * FROM `".$prefix."es_emaillist` WHERE";
//$sSql = $sSql . " es_email_mail = %s";
//$sSql = $sSql . " es_email_group = %s";
//$sSql = $sSql . " Limit 1";
//$sSql = $wpdb->prepare($sSql, array($data["es_email_mail"], $data["es_email_group"]));
//$arrRes = $wpdb->get_results($sSql, ARRAY_A);
$sSql = "SELECT * FROM `" . $prefix . "es_emaillist` where es_email_mail='" . $data["es_email_mail"] . "' and es_email_group='" . trim($data["es_email_group"]) . "'";
$arrRes = $wpdb->get_results($sSql, ARRAY_A);
if (count($arrRes) > 0) {
if ($arrRes[0]['es_email_status'] == "Confirmed") {
return "ext";
} else {
$action = "";
$form['es_email_name'] = $data["es_email_name"];
$form['es_email_mail'] = $data["es_email_mail"];
$form['es_email_group'] = $data["es_email_group"];
$form['es_email_status'] = $data["es_email_status"];
$form['es_email_id'] = $arrRes[0]["es_email_id"];
$action = es_cls_dbquery::es_view_subscriber_ins($form, $action = "update");
return $action;
}
} else {
$action = es_cls_dbquery::es_view_subscriber_ins($data, $action = "insert");
return $action;
}
}
示例6: es_sync_registereduser
function es_sync_registereduser($user_id)
{
$es_c_emailsubscribers = get_option('es_c_emailsubscribers', 'norecord');
if ($es_c_emailsubscribers == 'norecord' || $es_c_emailsubscribers == "") {
// No action is required
} else {
if ($es_c_emailsubscribers['es_registered'] == "YES" && $user_id != "") {
$es_registered = $es_c_emailsubscribers['es_registered'];
$es_registered_group = $es_c_emailsubscribers['es_registered_group'];
$user_info = get_userdata($user_id);
$user_firstname = $user_info->user_firstname;
if ($user_firstname == "") {
$user_firstname = $user_info->user_login;
}
$user_mail = $user_info->user_email;
$form['es_email_name'] = $user_firstname;
$form['es_email_mail'] = $user_mail;
$form['es_email_group'] = $es_c_emailsubscribers['es_registered_group'];
$form['es_email_status'] = "Confirmed";
$action = es_cls_dbquery::es_view_subscriber_ins($form, "insert");
if ($action == "sus") {
//Inserted successfully. Below 3 line of code will send WELCOME email to subscribers.
$subscribers = array();
$subscribers = es_cls_dbquery::es_view_subscriber_one($user_mail);
es_cls_sendmail::es_sendmail("welcome", $template = 0, $subscribers, "welcome", 0);
}
}
}
}
示例7: array
if ($samedomain !== false && $samedomain < 5) {
$action = "";
global $wpdb;
$form['es_email_name'] = $es_name;
$form['es_email_mail'] = $es_email;
$form['es_email_group'] = $es_group;
$data = es_cls_settings::es_setting_select(1);
if ($data['es_c_optinoption'] == "Double Opt In") {
$form['es_email_status'] = "Unconfirmed";
} else {
$form['es_email_status'] = "Single Opt In";
}
$action = es_cls_dbquery::es_view_subscriber_widget($form);
if ($action == "sus") {
$subscribers = array();
$subscribers = es_cls_dbquery::es_view_subscriber_one($es_email);
if ($data['es_c_optinoption'] == "Double Opt In") {
es_cls_sendmail::es_sendmail("optin", $template = 0, $subscribers, "optin", 0);
echo "subscribed-pending-doubleoptin";
} else {
if ($data['es_c_usermailoption'] == "YES") {
es_cls_sendmail::es_sendmail("welcome", $template = 0, $subscribers, "welcome", 0);
}
echo "subscribed-successfully";
}
} elseif ($action == "ext") {
echo "already-exist";
}
} else {
echo "unexpected-error";
}
示例8: es_prepare_newsletter_manual
public static function es_prepare_newsletter_manual($template, $recipients)
{
$subscribers = array();
$subscribers = es_cls_dbquery::es_view_subscriber_manual($recipients);
es_cls_sendmail::es_sendmail("newsletter", $template, $subscribers, "manual", 0);
}
示例9: form
//.........这里部分代码省略.........
echo $this->get_field_name('es_af_email_mand');
?>
">
<option value="YES" <?php
$this->es_af_selected($es_af_email_mand == 'YES');
?>
>YES</option>
</select>
</p>
<p>
<label for="<?php
echo $this->get_field_id('es_af_group');
?>
"><?php
_e('Display GROUPS options', ES_AF_TDOMAIN);
?>
</label>
<select class="widefat" id="<?php
echo $this->get_field_id('es_af_group');
?>
" name="<?php
echo $this->get_field_name('es_af_group');
?>
">
<option value="YES" <?php
$this->es_af_selected($es_af_group == 'YES');
?>
>YES</option>
<option value="NO" <?php
$this->es_af_selected($es_af_group == 'NO');
?>
>NO</option>
</select>
</p>
<p>
<label for="<?php
echo $this->get_field_id('es_af_group_mand');
?>
"><?php
_e('Do you want to set mandatory option for GROUP box?', ES_AF_TDOMAIN);
?>
</label>
<select class="widefat" id="<?php
echo $this->get_field_id('es_af_group_mand');
?>
" name="<?php
echo $this->get_field_name('es_af_group_mand');
?>
">
<option value="YES" <?php
$this->es_af_selected($es_af_group_mand == 'YES');
?>
>YES</option>
<option value="NO" <?php
$this->es_af_selected($es_af_group_mand == 'NO');
?>
>NO</option>
</select>
</p>
<p>
<label for="<?php
echo $this->get_field_id('es_af_group_list');
?>
"><?php
_e('Enter GROUP name to display (coma separated value)', ES_AF_TDOMAIN);
?>
</label>
<input class="widefat" id="<?php
echo $this->get_field_id('es_af_group_list');
?>
" name="<?php
echo $this->get_field_name('es_af_group_list');
?>
" type="text" value="<?php
echo $es_af_group_list;
?>
" />
<?php
if (is_plugin_active('email-subscribers/email-subscribers.php')) {
$groups = array();
$groups = es_cls_dbquery::es_view_subscriber_group();
if (count($groups) > 0) {
$i = 1;
foreach ($groups as $group) {
if ($i != 1) {
echo ", ";
} else {
echo "<br>Existing Groups : ";
}
echo $group["es_email_group"];
$i = $i + 1;
}
}
}
?>
</p>
<?php
}
示例10: es_prepare_send_cronmail
public static function es_prepare_send_cronmail($cronmailqueue = array(), $crondeliveryqueue = array())
{
$subscriber = array();
$htmlmail = false;
$wpmail = false;
$type = $cronmailqueue[0]['es_sent_source'];
$content = $cronmailqueue[0]['es_sent_preview'];
$subject = $cronmailqueue[0]['es_sent_subject'];
$cacheid = es_cls_common::es_generate_guid(100);
$replacefrom = array("<ul><br />", "</ul><br />", "<li><br />", "</li><br />", "<ol><br />", "</ol><br />", "</h2><br />", "</h1><br />");
$replaceto = array("<ul>", "</ul>", "<li>", "</li>", "<ol>", "</ol>", "</h2>", "</h1>");
$count = 1;
$settings = es_cls_settings::es_setting_select(1);
if (trim($settings['es_c_fromname']) == "" || trim($settings['es_c_fromemail']) == '') {
get_currentuserinfo();
$sender_name = $user_login;
$sender_email = $user_email;
} else {
$sender_name = $settings['es_c_fromname'];
$sender_email = $settings['es_c_fromemail'];
}
if ($settings['es_c_mailtype'] == "WP HTML MAIL" || $settings['es_c_mailtype'] == "PHP HTML MAIL") {
$htmlmail = true;
}
if ($settings['es_c_mailtype'] == "WP HTML MAIL" || $settings['es_c_mailtype'] == "WP PLAINTEXT MAIL") {
$wpmail = true;
}
$headers = "From: \"{$sender_name}\" <{$sender_email}>\n";
$headers .= "Return-Path: <" . $sender_email . ">\n";
$headers .= "Reply-To: \"" . $sender_name . "\" <" . $sender_email . ">\n";
$headers .= "X-Mailer: PHP" . phpversion() . "\n";
if ($htmlmail) {
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: " . get_bloginfo('html_type') . "; charset=\"" . get_bloginfo('charset') . "\"\n";
$headers .= "Content-type: text/html\r\n";
} else {
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/plain; charset=\"" . get_bloginfo('charset') . "\"\n";
}
$url = home_url('/');
$viewstatus = '<img src="' . $url . '?es=viewstatus&delvid=###DELVIID###" width="1" height="1" />';
foreach ($crondeliveryqueue as $crondelivery) {
$es_email_id = $crondelivery['es_deliver_emailid'];
$es_deliver_id = $crondelivery['es_deliver_id'];
$subscriber = es_cls_dbquery::es_view_subscriber_search("", $es_email_id);
if (count($subscriber) > 0) {
$unsublink = $settings['es_c_unsublink'];
$unsublink = str_replace("###DBID###", $subscriber[0]["es_email_id"], $unsublink);
$unsublink = str_replace("###EMAIL###", $subscriber[0]["es_email_mail"], $unsublink);
$unsublink = str_replace("###GUID###", $subscriber[0]["es_email_guid"], $unsublink);
$unsublink = $unsublink . "&cache=" . $cacheid;
$unsubtext = stripslashes($settings['es_c_unsubtext']);
$unsubtext = str_replace("###LINK###", $unsublink, $unsubtext);
if ($settings['es_c_mailtype'] == "WP HTML MAIL" || $settings['es_c_mailtype'] == "PHP HTML MAIL") {
$unsubtext = '<br><br>' . $unsubtext;
} else {
$unsubtext = '\\n\\n' . $unsubtext;
}
$viewstslink = str_replace("###DELVIID###", $es_deliver_id, $viewstatus);
$content_send = str_replace("###EMAIL###", $subscriber[0]["es_email_mail"], $content);
$content_send = str_replace("###NAME###", $subscriber[0]["es_email_name"], $content_send);
if ($settings['es_c_mailtype'] == "WP HTML MAIL" || $settings['es_c_mailtype'] == "PHP HTML MAIL") {
$content_send = nl2br($content_send);
$content_send = str_replace($replacefrom, $replaceto, $content_send);
} else {
$content_send = str_replace("<br />", "\r\n", $content_send);
$content_send = str_replace("<br>", "\r\n", $content_send);
}
if ($wpmail) {
wp_mail($subscriber[0]["es_email_mail"], $subject, $content_send . $unsubtext . $viewstslink, $headers);
} else {
mail($subscriber[0]["es_email_mail"], $subject, $content_send . $unsubtext . $viewstslink, $headers);
}
es_cls_delivery::es_delivery_ups_cron($es_deliver_id);
$count = $count + 1;
}
if ($count % 25 == 0) {
sleep(60);
//sleep 60 seconds for every 25 emails.
}
}
$es_cron_adminmail = get_option('es_cron_adminmail');
if ($es_cron_adminmail != "") {
$adminmail = $settings['es_c_adminemail'];
$crondate = date('Y-m-d G:i:s');
$count = $count - 1;
$es_cron_adminmail = str_replace("###COUNT###", $count, $es_cron_adminmail);
$es_cron_adminmail = str_replace("###DATE###", $crondate, $es_cron_adminmail);
$es_cron_adminmail = str_replace("###SUBJECT###", $subject, $es_cron_adminmail);
if ($htmlmail) {
$es_cron_adminmail = nl2br($es_cron_adminmail);
} else {
$es_cron_adminmail = str_replace("<br />", "\r\n", $es_cron_adminmail);
$es_cron_adminmail = str_replace("<br>", "\r\n", $es_cron_adminmail);
}
if ($wpmail) {
wp_mail($adminmail, "Cron URL has been triggered successfully", $es_cron_adminmail, $headers);
} else {
mail($adminmail, "Cron URL has been triggered successfully", $es_cron_adminmail, $headers);
}
//.........这里部分代码省略.........
示例11: die
//}
if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
die('You are not allowed to call this page directly.');
}
?>
<script language="javaScript" src="<?php
echo ES_URL;
?>
subscribers/view-subscriber.js"></script>
<?php
//$_SESSION['es_exportcsv'] = "YES";
$home_url = home_url('/');
$cnt_subscriber = 0;
$cnt_users = 0;
$cnt_comment_author = 0;
$cnt_subscriber = es_cls_dbquery::es_view_subscriber_count(0);
$cnt_users = $wpdb->get_var("select count(DISTINCT user_email) from " . $wpdb->prefix . "users");
$cnt_comment_author = $wpdb->get_var("SELECT count(DISTINCT comment_author_email) from " . $wpdb->prefix . "comments WHERE comment_author_email <> ''");
?>
<div class="wrap">
<div id="icon-plugins" class="icon32"></div>
<h2><?php
_e(ES_PLUGIN_DISPLAY, ES_TDOMAIN);
?>
</h2>
<div class="tool-box">
<h3 class="title"><?php
_e('Export email address in csv format', ES_TDOMAIN);
?>
</h3>
示例12: es_subscriber_default
public static function es_subscriber_default()
{
$result = es_cls_dbquery::es_view_subscriber_count(0);
if ($result == 0) {
$form["es_email_mail"] = get_option('admin_email');
$form["es_email_name"] = "Admin";
//XTEC ************ MODIFICAT - Changed default group from Public to Portada
//2016.03.29 @sarjona
$form["es_email_group"] = 'Portada';
//************ ORIGINAL
/*
$form["es_email_group"] = "Public";
*/
//************ FI
$form["es_email_status"] = "Confirmed";
es_cls_dbquery::es_view_subscriber_ins($form, "insert");
$form["es_email_mail"] = "a.example@example.com";
$form["es_email_name"] = "Example";
//XTEC ************ MODIFICAT - Changed default group from Public to Portada
//2016.03.29 @sarjona
$form["es_email_group"] = 'Portada';
//************ ORIGINAL
/*
$form["es_email_group"] = "Public";
*/
//************ FI
$form["es_email_status"] = "Confirmed";
es_cls_dbquery::es_view_subscriber_ins($form, "insert");
}
return true;
}
示例13: trim
//$path_parts = pathinfo($fullPath);
//$extension = strtolower($path_parts["extension"]);
$tmpname = $_FILES['es_csv_name']['tmp_name'];
if ($extension === 'csv') {
$csv = es_cls_common::es_readcsv($tmpname);
}
if (count($csv) > 0) {
$inserted = 0;
$duplicate = 0;
$invalid = 0;
for ($i = 1; $i < count($csv) - 1; $i++) {
$form["es_email_mail"] = trim($csv[$i][0]);
$form["es_email_name"] = trim($csv[$i][1]);
$form["es_email_group"] = "Public";
$form["es_email_status"] = "Confirmed";
$action = es_cls_dbquery::es_view_subscriber_ins($form, "insert");
if ($action == "sus") {
$inserted = $inserted + 1;
} elseif ($action == "ext") {
$duplicate = $duplicate + 1;
} elseif ($action == "invalid") {
$invalid = $invalid + 1;
}
// Reset the form fields
$form = array('es_email_name' => '', 'es_email_status' => '', 'es_email_group' => '', 'es_email_mail' => '');
}
?>
<div class="updated fade">
<p><strong><?php
echo $inserted;
?>