本文整理汇总了PHP中WYSIJA::wp_get_userdata方法的典型用法代码示例。如果您正苦于以下问题:PHP WYSIJA::wp_get_userdata方法的具体用法?PHP WYSIJA::wp_get_userdata怎么用?PHP WYSIJA::wp_get_userdata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WYSIJA
的用法示例。
在下文中一共展示了WYSIJA::wp_get_userdata方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert
function insert($subid, $action, $data = array(), $mailid = 0)
{
$current_user = WYSIJA::wp_get_userdata();
/*dbg($current_user,0);
$current_user=wp_get_current_user();*/
if (!empty($current_user->ID)) {
$data[] = 'EXECUTED_BY::' . $current_user->ID . ' ( ' . $current_user->user_login . ' )';
}
$history = null;
$history['user_id'] = intval($subid);
$history['type'] = strip_tags($action);
$history['details'] = implode("\n", $data);
$history['executed_at'] = time();
$history['email_id'] = $mailid;
$userHelper =& WYSIJA::get("user", "helper");
$history['executed_by'] = $userHelper->getIP();
if (!empty($_SERVER)) {
$source = array();
$vars = array('HTTP_REFERER', 'HTTP_USER_AGENT', 'HTTP_HOST', 'SERVER_ADDR', 'REMOTE_ADDR', 'REQUEST_URI', 'QUERY_STRING');
foreach ($vars as $oneVar) {
if (!empty($_SERVER[$oneVar])) {
$source[] = $oneVar . '::' . strip_tags($_SERVER[$oneVar]);
}
}
$history['source'] = implode("\n", $source);
}
return parent::insert($history);
}
示例2: send_test_mail
function send_test_mail($values, $send_method = false)
{
$content_email = __("Yup, it works. You can start blasting away emails to the moon.", WYSIJA);
if (!$send_method) {
switch ($values["sending_method"]) {
case "site":
if ($values["sending_emails_site_method"] == "phpmail") {
$send_method = "PHP Mail";
} else {
$send_method = "Sendmail";
}
if ($values["sending_emails_site_method"] == "phpmail") {
$send_method = "PHP Mail";
} else {
$sendmail_path = $_POST['data']['wysija[config][sendmail_path]'];
$send_method = "Sendmail";
}
break;
case "smtp":
$smtp = array();
$send_method = "SMTP";
break;
case "gmail":
$send_method = "Gmail";
$values['smtp_host'] = 'smtp.gmail.com';
$values['smtp_port'] = '465';
$values['smtp_secure'] = 'ssl';
$values['smtp_auth'] = true;
$content_email = __("You're all setup! You've successfully sent with Gmail.", WYSIJA) . "<br/><br/>";
$content_email .= str_replace(array('[link]', '[/link]'), array('<a href="http://support.wysija.com/knowledgebase/send-with-smtp-when-using-a-professional-sending-provider/" target="_blank" title="SendGrid partnership">', '</a>'), __("Looking for a faster method to send? [link]Read more[/link] on sending with a professional SMTP.", WYSIJA));
break;
}
}
$mailer =& WYSIJA::get("mailer", "helper");
$mailer->WYSIJA_help_mailer("", $values);
$current_user = WYSIJA::wp_get_userdata();
$mailer->testemail = true;
$mailer->wp_user =& $current_user->data;
$res = $mailer->sendSimple($current_user->data->user_email, str_replace("[send_method]", $send_method, __("[send_method] works with Wysija", WYSIJA)), $content_email);
if ($res) {
$this->notice(sprintf(__("Test email successfully sent to <b><i>%s</i></b>", WYSIJA), $current_user->data->user_email));
return true;
} else {
$config =& WYSIJA::get("config", "model");
$bounce = $config->getValue('bounce_email');
if (in_array($config->getValue('sending_method'), array('smtp', 'gmail')) && $config->getValue('smtp_secure') == 'ssl' && !function_exists('openssl_sign')) {
$this->error(__('The PHP Extension openssl is not enabled on your server. Ask your host to enable it if you want to use an SSL connection.', WYSIJA));
} elseif (!empty($bounce) and !in_array($config->getValue('sending_method'), array('smtp_com', 'elasticemail'))) {
$this->error(sprintf(__('The bounce email address "%1$s" might actually cause the problem. Leave the field empty and try again.', WYSIJA), $bounce));
} elseif (in_array($config->getValue('sending_method'), array('smtp', 'gmail')) and !$config->getValue('smtp_auth') and strlen($config->getValue('smtp_password')) > 1) {
$this->error(__("You specified an SMTP password but you don't require an authentification, you might want to turn the SMTP authentification ON.", WYSIJA));
} elseif ((strpos(WYSIJA_URL, 'localhost') || strpos(WYSIJA_URL, '127.0.0.1')) && in_array($config->getValue('sending_method'), array('sendmail', 'qmail', 'mail'))) {
$this->error(__('Your localhost may not have a mail server. To verify, please log out and click on the "Lost your password?" link on the login page. Do you receive the reset password email from your WordPress?', WYSIJA));
}
$this->error($mailer->reportMessage);
return false;
}
}
示例3: WYSIJA_control_back
function WYSIJA_control_back(){
parent::WYSIJA_control();
global $wysija_msg,$wysija_queries,$wysija_queries_errors;
$wysija_msgTemp=get_option('wysija_msg');
if(is_array($wysija_msgTemp) && count($wysija_msgTemp)>0){
$wysija_msg=$wysija_msgTemp;
}
$wysija_qryTemp=get_option('wysija_queries');
$wysija_qryErrors=get_option('wysija_queries_errors');
if(is_array($wysija_qryTemp) && count($wysija_qryTemp)>0){
$wysija_queries=$wysija_qryTemp;
}
if(is_array($wysija_qryErrors) && count($wysija_qryErrors)>0){
$wysija_queries_errors=$wysija_qryErrors;
}
WYSIJA::update_option('wysija_queries','');
WYSIJA::update_option('wysija_queries_errors','');
WYSIJA::update_option('wysija_msg','');
global $wysija_installing;
if($wysija_installing===true) return;
$this->pref=get_user_meta(WYSIJA::wp_get_userdata('ID'),'wysija_pref',true);
$prefupdate=false;
if($this->pref) {
$prefupdate=true;
$this->pref=unserialize(base64_decode($this->pref));
}else{
$this->pref=array();
}
if(!isset($_GET['action'])) $action='default';
else $action=$_GET['action'];
if(isset($_REQUEST['limit_pp'])){
$this->pref[$_REQUEST['page']][$action]['limit_pp']=$_REQUEST['limit_pp'];
}
if($this->pref && isset($_REQUEST['page']) && $_REQUEST['page'] && isset($this->pref[$_REQUEST['page']][$action]['limit_pp'])){
$this->viewObj->limit_pp=$this->pref[$_REQUEST['page']][$action]['limit_pp'];
$this->modelObj->limit_pp=$this->pref[$_REQUEST['page']][$action]['limit_pp'];
}
if($prefupdate){
update_user_meta(WYSIJA::wp_get_userdata('ID'),'wysija_pref',base64_encode(serialize($this->pref)));
}else{
add_user_meta(WYSIJA::wp_get_userdata('ID'),'wysija_pref',base64_encode(serialize($this->pref)));
}
add_action('wysija_various_check',array($this,'variousCheck'));
do_action('wysija_various_check');
// check if the plugin has an update available
$updateH=WYSIJA::get('update','helper');
$updateH->checkForNewVersion();
$this->target_action_form = $this->data['target_action_form'] = $this->_getTargetActionForm(); // set default value of any form action
}
示例4: WYSIJA_control_back
function WYSIJA_control_back()
{
parent::WYSIJA_control();
global $wysija_msg, $wysija_queries, $wysija_queries_errors;
$wysija_msgTemp = get_option("wysija_msg");
if (is_array($wysija_msgTemp) && count($wysija_msgTemp) > 0) {
$wysija_msg = $wysija_msgTemp;
}
$modelEmail =& WYSIJA::get('email', 'model');
$campaign = $modelEmail->getOne('params', array('email_id' => 12));
$wysija_qryTemp = get_option("wysija_queries");
$wysija_qryErrors = get_option("wysija_queries_errors");
if (is_array($wysija_qryTemp) && count($wysija_qryTemp) > 0) {
$wysija_queries = $wysija_qryTemp;
}
if (is_array($wysija_qryErrors) && count($wysija_qryErrors) > 0) {
$wysija_queries_errors = $wysija_qryErrors;
}
WYSIJA::update_option("wysija_queries", "");
WYSIJA::update_option("wysija_queries_errors", "");
WYSIJA::update_option("wysija_msg", "");
$this->pref = get_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', true);
$prefupdate = false;
if ($this->pref) {
$prefupdate = true;
$this->pref = unserialize(base64_decode($this->pref));
} else {
$this->pref = array();
}
if (!isset($_GET['action'])) {
$action = "default";
} else {
$action = $_GET['action'];
}
if (isset($_REQUEST['limit_pp'])) {
$this->pref[$_REQUEST['page']][$action]['limit_pp'] = $_REQUEST['limit_pp'];
}
if ($this->pref && isset($_REQUEST['page']) && $_REQUEST['page'] && isset($this->pref[$_REQUEST['page']][$action]['limit_pp'])) {
$this->viewObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
$this->modelObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
}
if ($prefupdate) {
update_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
} else {
add_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
}
add_action('wysija_various_check', array($this, 'variousCheck'));
do_action('wysija_various_check');
/*check if the plugin has an update available */
$updateH =& WYSIJA::get('update', 'helper');
$updateH->checkForNewVersion();
}
示例5: getCurrentSubscriber
function getCurrentSubscriber()
{
$this->getFormat = OBJECT;
$objUser = $this->getOne(false, array('wpuser_id' => WYSIJA::wp_get_userdata('ID')));
if (!$objUser) {
$this->getFormat = OBJECT;
$objUser = $this->getOne(false, array('email' => WYSIJA::wp_get_userdata('user_email')));
$this->update(array('wpuser_id' => WYSIJA::wp_get_userdata('ID')), array('email' => WYSIJA::wp_get_userdata('user_email')));
}
//the subscriber doesn't exist
if (!$objUser) {
$data = get_userdata(WYSIJA::wp_get_userdata('ID'));
$firstname = $data->first_name;
$lastname = $data->last_name;
if (!$data->first_name && !$data->last_name) {
$firstname = $data->display_name;
}
$this->noCheck = true;
$this->insert(array('wpuser_id' => $data->ID, 'email' => $data->user_email, 'firstname' => $firstname, 'lastname' => $lastname));
$this->getFormat = OBJECT;
$objUser = $this->getOne(false, array('wpuser_id' => WYSIJA::wp_get_userdata('ID')));
}
return $objUser;
}
示例6: defaultSettings
function defaultSettings(&$values)
{
$current_user = WYSIJA::wp_get_userdata();
$values['replyto_name'] = $values['from_name'] = $current_user->user_login;
$values['emails_notified'] = $values['replyto_email'] = $values['from_email'] = $current_user->user_email;
}
示例7: WYSIJA_control_back
function WYSIJA_control_back()
{
parent::WYSIJA_control();
global $wysija_msg, $wysija_queries;
$wysija_msgTemp = get_option("wysija_msg");
if (is_array($wysija_msgTemp) && count($wysija_msgTemp) > 0) {
$wysija_msg = $wysija_msgTemp;
}
$modelEmail =& WYSIJA::get('email', 'model');
$campaign = $modelEmail->getOne('params', array('email_id' => 12));
$wysija_qryTemp = get_option("wysija_queries");
if (is_array($wysija_qryTemp) && count($wysija_qryTemp) > 0) {
$wysija_queries = $wysija_qryTemp;
}
WYSIJA::update_option("wysija_queries", "");
WYSIJA::update_option("wysija_msg", "");
$this->pref = get_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', true);
$prefupdate = false;
if ($this->pref) {
$prefupdate = true;
$this->pref = unserialize(base64_decode($this->pref));
} else {
$this->pref = array();
}
if (!isset($_GET['action'])) {
$action = "default";
} else {
$action = $_GET['action'];
}
if (isset($_REQUEST['limit_pp'])) {
$this->pref[$_REQUEST['page']][$action]['limit_pp'] = $_REQUEST['limit_pp'];
}
if ($this->pref && isset($_REQUEST['page']) && $_REQUEST['page'] && isset($this->pref[$_REQUEST['page']][$action]['limit_pp'])) {
$this->viewObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
$this->modelObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
}
if ($prefupdate) {
update_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
} else {
add_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
}
/* check the licence if we have a premium user once in a while like every 24hrs*/
$modelC =& WYSIJA::get('config', 'model');
if (get_option('wysicheck') || isset($_REQUEST['action']) && $_REQUEST['action'] != 'licok' && $modelC->getValue('premium_key')) {
//$this->notice('licence check');
$onedaysec = 7 * 24 * 3600;
if (get_option('wysicheck') || (!$modelC->getValue('premium_val') || time() > (int) $modelC->getValue('premium_val') + $onedaysec)) {
$helpLic =& WYSIJA::get('licence', 'helper');
$res = $helpLic->check(true);
if ($res['nocontact']) {
/* redirect instantly to a page with a javascript file where we check the domain is ok */
$data = get_option('wysijey');
/* remotely connect to host */
wp_enqueue_script('wysija-verif-licence', 'http://www.wysija.com/?wysijap=checkout&wysijashop-page=1&controller=customer&action=checkDomain&js=1&data=' . $data, array('jquery'), time());
}
}
}
if (get_option('dkim_autosetup')) {
$helpLic =& WYSIJA::get('licence', 'helper');
$data = $helpLic->getDomainInfo();
wp_enqueue_script('wysija-setup-dkim', 'http://www.wysija.com/?wysijap=checkout&wysijashop-page=1&controller=customer&action=checkDkim&js=1&data=' . $data, array('jquery'), time());
}
/*check if the plugin has an update available */
$updateH =& WYSIJA::get('update', 'helper');
$updateH->checkForNewVersion();
}
示例8: WYSIJA_control_back
function WYSIJA_control_back()
{
parent::WYSIJA_control();
global $wysija_msg, $wysija_queries, $wysija_queries_errors;
$wysija_msgTemp = get_option('wysija_msg');
if (is_array($wysija_msgTemp) && count($wysija_msgTemp) > 0) {
$wysija_msg = $wysija_msgTemp;
}
$wysija_qryTemp = get_option('wysija_queries');
$wysija_qryErrors = get_option('wysija_queries_errors');
if (is_array($wysija_qryTemp) && count($wysija_qryTemp) > 0) {
$wysija_queries = $wysija_qryTemp;
}
if (is_array($wysija_qryErrors) && count($wysija_qryErrors) > 0) {
$wysija_queries_errors = $wysija_qryErrors;
}
WYSIJA::update_option('wysija_queries', '');
WYSIJA::update_option('wysija_queries_errors', '');
WYSIJA::update_option('wysija_msg', '');
global $wysija_installing;
if ($wysija_installing === true) {
return;
}
$this->pref = get_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', true);
$prefupdate = false;
if ($this->pref) {
$prefupdate = true;
$this->pref = unserialize(base64_decode($this->pref));
} else {
$this->pref = array();
}
if (!isset($_GET['action'])) {
$action = 'default';
} else {
$action = $_GET['action'];
}
if (isset($_REQUEST['limit_pp'])) {
$this->pref[$_REQUEST['page']][$action]['limit_pp'] = $_REQUEST['limit_pp'];
}
if (!empty($_REQUEST['orderby'])) {
$_REQUEST['orderby'] = preg_replace('|[^a-z0-9#_.-]|i', '', $_REQUEST['orderby']);
}
if (!empty($_REQUEST['ordert']) && !in_array(strtoupper($_REQUEST['ordert']), array('DESC', 'ASC'))) {
$_REQUEST['ordert'] = 'DESC';
}
if (!empty($_REQUEST['id'])) {
$_REQUEST['id'] = (int) $_REQUEST['id'];
}
if (!empty($_REQUEST['search'])) {
$_REQUEST['search'] = esc_attr($_REQUEST['search']);
}
if ($this->pref && isset($_REQUEST['page']) && $_REQUEST['page'] && isset($this->pref[$_REQUEST['page']][$action]['limit_pp'])) {
$this->viewObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
$this->modelObj->limit_pp = $this->pref[$_REQUEST['page']][$action]['limit_pp'];
}
if ($prefupdate) {
update_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
} else {
add_user_meta(WYSIJA::wp_get_userdata('ID'), 'wysija_pref', base64_encode(serialize($this->pref)));
}
add_action('wysija_various_check', array($this, 'variousCheck'));
do_action('wysija_various_check');
}
示例9: getCurrentSubscriber
/**
* return the subscriber object for the currently logged in WordPress user
* @return object user
*/
function getCurrentSubscriber()
{
static $result_user;
if (!empty($result_user)) {
return $result_user;
}
$this->getFormat = OBJECT;
$wp_user_id = (int) WYSIJA::wp_get_userdata('ID');
if (!($wp_user_id > 0)) {
return $result_user;
}
$result_user = $this->getOne(false, array('wpuser_id' => $wp_user_id));
if (!$result_user) {
$this->getFormat = OBJECT;
$result_user = $this->getOne(false, array('email' => WYSIJA::wp_get_userdata('user_email')));
$this->update(array('wpuser_id' => $wp_user_id), array('email' => WYSIJA::wp_get_userdata('user_email')));
}
//the subscriber doesn't seem to exist let's insert it in the DB
if (!$result_user) {
$data = get_userdata($wp_user_id);
$firstname = $data->first_name;
$lastname = $data->last_name;
if (!$data->first_name && !$data->last_name) {
$firstname = $data->display_name;
}
$this->noCheck = true;
$this->insert(array('wpuser_id' => $data->ID, 'email' => $data->user_email, 'firstname' => $firstname, 'lastname' => $lastname));
$this->getFormat = OBJECT;
$result_user = $this->getOne(false, array('wpuser_id' => $wp_user_id));
}
return $result_user;
}
示例10: render_web_body
protected function render_web_body()
{
$helper_render_engine = WYSIJA::get('render_engine', 'helper');
$helper_render_engine->setTemplatePath(WYSIJA_EDITOR_TOOLS);
$blocks = $this->get_data('body');
if (empty($blocks)) {
return '';
}
$body = '';
foreach ($blocks as $key => $block) {
// special case for list widget
if ($block['field'] === 'list') {
$block = $this->set_lists_names($block);
}
// special case for email widget
if ($block['field'] === 'email') {
$user_email = WYSIJA::wp_get_userdata('user_email');
if ($user_email && is_string($user_email) && is_user_logged_in() && !current_user_can('switch_themes') && !is_admin()) {
$block['value'] = $user_email;
}
}
// generate block template
$data = array_merge($block, array('preview' => $this->get_mode() === 'preview', 'i18n' => $this->get_translations(), 'validation' => $this->get_validation_class($block)));
$body .= $helper_render_engine->render($data, 'templates/form/web/widgets/template.html');
}
return $body;
}
示例11: emailFooterLinks
/**
*
* @param type $editor
*/
function emailFooterLinks($editor = false)
{
$unsubscribe = array();
$unsubscribetxt = $editsubscriptiontxt = '';
if (!isset($this->values['unsubscribe_linkname'])) {
$unsubscribetxt = __('Unsubscribe', WYSIJA);
} else {
$unsubscribetxt = $this->getValue('unsubscribe_linkname');
}
if (!isset($this->values['manage_subscriptions_linkname'])) {
$editsubscriptiontxt = __('Edit your subscription', WYSIJA);
} else {
$editsubscriptiontxt = $this->getValue('manage_subscriptions_linkname');
}
$unsubscribe[0] = array('link' => '[unsubscribe_link]', 'label' => $unsubscribetxt);
if ($this->getValue('manage_subscriptions')) {
$unsubscribe[1] = array('link' => '[subscriptions_link]', 'label' => $editsubscriptiontxt);
}
if ($editor) {
$modelU =& WYSIJA::get('user', 'model', false, 'wysija-newsletters', false);
$modelU->getFormat = OBJECT;
$objUser = $modelU->getOne(false, array('wpuser_id' => WYSIJA::wp_get_userdata('ID')));
$unsubscribe[0]['link'] = $modelU->getConfirmLink($objUser, 'unsubscribe', false, true) . '&demo=1';
if ($this->getValue('manage_subscriptions')) {
$unsubscribe[1]['link'] = $modelU->getConfirmLink($objUser, 'subscriptions', false, true);
}
}
return $unsubscribe;
}
示例12: customFields
function customFields($params, $formidreal, $submitbutton)
{
$html = '';
$validationsCF = array('email' => array('req' => true, 'type' => 'email', 'defaultLabel' => __('Email', WYSIJA)), 'firstname' => array('req' => true, 'defaultLabel' => __('First name', WYSIJA)), 'lastname' => array('req' => true, 'defaultLabel' => __('Last name', WYSIJA)));
$wp_user_values = array();
if (is_user_logged_in() && !is_admin() && !current_user_can('switch_themes')) {
$data_user_wp = WYSIJA::wp_get_userdata();
if (isset($data_user_wp->user_email)) {
$wp_user_values['email'] = $data_user_wp->user_email;
}
if (isset($data_user_wp->user_firstname)) {
$wp_user_values['firstname'] = $data_user_wp->user_firstname;
}
if (isset($data_user_wp->user_lastname)) {
$wp_user_values['lastname'] = $data_user_wp->user_lastname;
}
}
if (isset($params['customfields']) && $params['customfields']) {
foreach ($params['customfields'] as $fieldKey => $field) {
//autofill logged in user data
$value_attribute = '';
if (isset($wp_user_values[$fieldKey])) {
$value_attribute = $wp_user_values[$fieldKey];
}
$classField = 'wysija-' . $fieldKey;
$classValidate = $classField . " " . $this->getClassValidate($validationsCF[$fieldKey], true);
if (!isset($field['label']) || !$field['label']) {
$field['label'] = $validationsCF[$fieldKey]['defaultLabel'];
}
if ($fieldKey == 'email') {
$fieldid = $formidreal . '-wysija-to';
} else {
$fieldid = $formidreal . '-' . $fieldKey;
}
if (isset($params['form_type']) && $params['form_type'] == 'html') {
$titleplaceholder = 'placeholder="' . $field['label'] . '" title="' . $field['label'] . '"';
} else {
$titleplaceholder = 'title="' . $field['label'] . '"';
}
$value_attribute = ' value="' . $value_attribute . '" ';
if (count($params['customfields']) > 1) {
if (isset($params['labelswithin'])) {
if ($params['labelswithin'] == 'labels_within') {
$fieldstring = '<input type="text" id="' . $fieldid . '" ' . $titleplaceholder . ' class="defaultlabels ' . $classValidate . '" name="wysija[user][' . $fieldKey . ']" ' . $value_attribute . '/>';
} else {
$fieldstring = '<label for="' . $fieldid . '">' . $field['label'] . '</label><input type="text" id="' . $fieldid . '" class="' . $classValidate . '" name="wysija[user][' . $fieldKey . ']" />';
}
} else {
$fieldstring = '<label for="' . $fieldid . '">' . $field['label'] . '</label><input type="text" id="' . $fieldid . '" class="' . $classValidate . '" name="wysija[user][' . $fieldKey . ']" />';
}
} else {
if (isset($params['labelswithin'])) {
if ($params['labelswithin'] == 'labels_within') {
$fieldstring = '<input type="text" id="' . $fieldid . '" ' . $titleplaceholder . ' class="defaultlabels ' . $classValidate . '" name="wysija[user][' . $fieldKey . ']" ' . $value_attribute . '/>';
} else {
$fieldstring = '<input type="text" id="' . $fieldid . '" class="' . $classValidate . '" name="wysija[user][' . $fieldKey . ']" ' . $value_attribute . '/>';
}
} else {
$fieldstring = '<input type="text" id="' . $fieldid . '" class="' . $classValidate . '" name="wysija[user][' . $fieldKey . ']" ' . $value_attribute . '/>';
}
}
$html .= '<p class="wysija-p-' . $fieldKey . '">' . $fieldstring . '</p>';
}
$html .= $this->honey($params, $formidreal);
if ($html) {
$html .= $submitbutton;
}
}
return $html;
}
示例13: emailFooterLinks
/**
*
* @param type $editor
*/
function emailFooterLinks($editor = false)
{
$unsubscribe = array();
$unsubscribe[0] = array('link' => '[unsubscribe_link]', 'label' => $this->getValue('unsubscribe_linkname'));
if ($this->getValue('manage_subscriptions')) {
$unsubscribe[1] = array('link' => '[subscriptions_link]', 'label' => $this->getValue('manage_subscriptions_linkname'));
}
if ($editor) {
$modelU =& WYSIJA::get("user", "model");
$modelU->getFormat = OBJECT;
$objUser = $modelU->getOne(false, array('wpuser_id' => WYSIJA::wp_get_userdata('ID')));
$unsubscribe[0]['link'] = $modelU->getConfirmLink($objUser, "unsubscribe", false, true) . '&demo=1';
if ($this->getValue('manage_subscriptions')) {
$unsubscribe[1]['link'] = $modelU->getConfirmLink($objUser, "subscriptions", false, true);
}
}
return $unsubscribe;
}
示例14: rules
function rules()
{
$helpRules =& WYSIJA::get("rules", "helper");
$rules = $helpRules->getRules(false, true);
$modelList =& WYSIJA::get("list", "model");
/* get lists which have users and are enabled */
$query = "SELECT * FROM [wysija]list WHERE is_enabled>0";
$arrayList = $modelList->query("get_res", $query);
$step2 = array();
$valuesDDP = array("" => __("Do nothing", WYSIJA), "delete" => __("Delete the user", WYSIJA), "unsub" => __("Unsubscribe the user", WYSIJA));
foreach ($arrayList as $list) {
$valuesDDP["unsub_" . $list['list_id']] = sprintf(__('Unsubscribe the user and add him to the list "%1$s" ', WYSIJA), $list['name']);
}
foreach ($rules as $rule) {
if (isset($rule['behave'])) {
continue;
}
$label = $rule['title'];
if (isset($rule['action_user_min']) && $rule['action_user_min'] > 0) {
$label .= ' ' . sprintf(_n('after %1$s try', 'after %1$s tries', $rule['action_user_min'], WYSIJA), $rule['action_user_min']);
}
$step2['bounce_rule_' . $rule['key']] = array('type' => 'dropdown', 'values' => $valuesDDP, 'label' => $label);
if (isset($rule['action_user'])) {
$step2['bounce_rule_' . $rule['key']]['default'] = $rule['action_user'];
}
if (isset($rule['forward'])) {
$step2['bounce_rule_' . $rule['key']]['forward'] = $rule['forward'];
}
}
$formFields = "<ol>";
$i = 0;
$formHelp =& WYSIJA::get("forms", "helper");
foreach ($step2 as $row => $colparams) {
$formFields .= '<li>';
$value = $this->model->getValue($row);
if (!$value && isset($colparams['default'])) {
$value = $colparams['default'];
}
if (isset($colparams['label'])) {
$label = $colparams['label'];
} else {
$label = ucfirst($row);
}
$desc = '';
if (isset($colparams['desc'])) {
$desc = '<p class="description">' . $colparams['desc'] . '</p>';
}
$formFields .= '<label for="' . $row . '">' . $label . $desc . ' </label>';
if (isset($colparams['forward'])) {
$valueforward = $this->model->getValue($row . "_forwardto");
if ($valueforward === false) {
$modelU =& WYSIJA::get("user", "model");
$modelU->getFormat = OBJECT;
$datauser = $modelU->getOne(false, array('wpuser_id' => WYSIJA::wp_get_userdata('ID')));
$valueforward = $datauser->email;
}
$formFields .= '<input id="' . $row . '" size="30" type="text" class="bounce-forward-email" name="wysija[config][' . $row . "_forwardto" . ']" value="' . $valueforward . '" />';
} else {
$formFields .= $formHelp->dropdown(array('id' => $row, 'name' => 'wysija[config][' . $row . ']'), $colparams['values'], $value, '');
}
$i++;
$formFields .= '</li>';
}
$formFields .= "</ol>";
echo $formFields;
}
示例15: defaultSettings
function defaultSettings(&$values){
/* get the user data for the admin */
//$datauser=wp_get_current_user();
$current_user=WYSIJA::wp_get_userdata();
$values['replyto_name']=$values['from_name']=$current_user->user_login;
$values['emails_notified']=$values['replyto_email']=$values['from_email']=$current_user->user_email;
}