本文整理汇总了PHP中op_post函数的典型用法代码示例。如果您正苦于以下问题:PHP op_post函数的具体用法?PHP op_post怎么用?PHP op_post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了op_post函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: save_meta_box
function save_meta_box($post_id)
{
if (!op_can_edit_page($post_id) || !isset($_POST['op_comment_meta_box']) || !wp_verify_nonce($_POST['op_comment_meta_box'], 'op_comment_meta_box')) {
return;
}
$fb = $wp = false;
$newcomments = array();
if (($comments = op_post('op', 'comments', 'facebook', 'enabled')) && $comments == 'Y') {
$fb = true;
}
$def = $this->get_option('comments', 'facebook', 'enabled');
if ($def == 'Y' && $fb === false) {
$newcomments['facebook'] = 'N';
} elseif ($def != 'Y' && $fb === true) {
$newcomments['facebook'] = 'Y';
}
if (($comments = op_post('op', 'comments', 'wordpress', 'enabled')) && $comments == 'Y') {
$wp = true;
}
$def = $this->get_option('comments', 'wordpress', 'enabled');
if ($def == 'Y' && $wp === false) {
$newcomments['wordpress'] = 'N';
} elseif ($def != 'Y' && $wp === true) {
$newcomments['wordpress'] = 'Y';
}
if (count($newcomments) > 0) {
//echo 'update1 ==== '.$post_id;
update_post_meta($post_id, 'op_comments', $newcomments);
} else {
//echo 'delete';
delete_post_meta($post_id, 'op_comments');
}
//exit;
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:34,代码来源:comments.php
示例2: op_check_optin_form
function op_check_optin_form()
{
if (isset($_POST['op_optin_form']) && $_POST['op_optin_form'] == 'Y') {
$message = '';
$data = unserialize(base64_decode($_POST['op_optin_form_data']));
foreach ($data['fields'] as $field) {
$val = isset($_POST[$field['name']]) ? $_POST[$field['name']] : '';
$message .= $field['text'] . ': ' . $val . "\n";
}
$message .= "\n";
foreach ($data['extra_fields'] as $name => $text) {
$val = isset($_POST[$name]) ? $_POST[$name] : '';
$message .= $text . ': ' . $val . "\n";
}
$email = op_post('email');
$webinar = op_post('gotowebinar');
/*
* Triggering GoToWebinar
*/
if (false !== $webinar) {
do_action('gotowebinar', $webinar, $email);
}
wp_mail($data['email_to'], 'Optin Form Submission - ' . op_current_url(), $message);
if ($data['redirect_url'] != '') {
wp_redirect($data['redirect_url']);
exit;
} else {
$GLOBALS['op_optin_form_sent'] = true;
}
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:31,代码来源:general.php
示例3: subscribe
public function subscribe($data)
{
if (isset($data['email'])) {
$name = op_post('name');
$params = array('FirstName' => false !== $name ? $name : '', 'Email' => $data['email']);
$contactId = $this->getClient()->addCon($params);
return true;
} else {
wp_die('Mandatory information not present [email address].');
}
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:11,代码来源:Infusionsoft.php
示例4: subscribe
public function subscribe($data)
{
if (isset($data['email'])) {
$name = op_post('name');
$params = array('FirstName' => false !== $name ? $name : '', 'Email' => $data['email']);
try {
$this->getClient()->addCon($params);
} catch (Exception $e) {
error_log('Exception while doing optin: ' . print_r($e->getMessage(), true));
}
return true;
} else {
wp_die('Mandatory information not present [email address].');
}
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:15,代码来源:Infusionsoft.php
示例5: save_page_template
function save_page_template($post_id)
{
if (!op_can_edit_page($post_id) || !isset($_POST['op_page_template']) || !wp_verify_nonce($_POST['op_page_template'], 'op_page_template')) {
return;
}
$remove = true;
$cur_tpl = op_default_attr('column_layout', 'option');
if ($tpl = op_post('op_page_tpl_file')) {
if ($cur_tpl != $tpl) {
update_post_meta($post_id, '_op_page_template', $tpl);
$remove = false;
}
}
if ($remove) {
delete_post_meta($post_id, '_op_page_template');
}
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:17,代码来源:post_page.php
示例6: save_meta_box
function save_meta_box($post_id)
{
// if(!op_can_edit_page($post_id) || !isset($_POST['op_scripts_meta_box']) || !wp_verify_nonce( $_POST['op_scripts_meta_box'], 'op_scripts_meta_box' ) ){
// return;
// }
if ($op = op_post('op', 'scripts')) {
$positions = op_get_var($op, 'position', array());
$scripts = array();
for ($i = 0, $iteml = count($positions); $i < $iteml; $i++) {
$scripts[] = array('position' => $positions[$i], 'script' => stripslashes($op['script'][$i]));
}
if (count($scripts) > 0) {
update_post_meta($post_id, '_' . OP_SN . '_scripts', $scripts);
} else {
delete_post_meta($post_id, '_' . OP_SN . '_scripts');
}
}
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:18,代码来源:scripts.php
示例7: subscribe
public function subscribe($data)
{
$this->logger->info('Subscribing user: ' . print_r($data, true));
if (isset($data['email'])) {
$name = op_post('name');
$params = array('FirstName' => false !== $name ? $name : '', 'Email' => $data['email']);
try {
$status = $this->getClient()->addCon($params);
$this->logger->notice('Subscription status: ' . print_r($status, true));
} catch (Exception $e) {
$this->logger->error('Error ' . $e->getCode() . ': ' . $e->getMessage());
}
return true;
} else {
$this->logger->alert('Mandatory information not present [email address]');
wp_die('Mandatory information not present [email address].');
}
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:18,代码来源:Infusionsoft.php
示例8: content_layout_preview
/**
* We create a dummy (draft) page that is populated for content preview.
*/
function content_layout_preview()
{
global $user_ID;
global $wpdb;
$page = get_page_by_path('op_content_layout_preview_page');
// Page already exists
if (is_object($page)) {
$page_id = $page->ID;
} else {
$page['post_type'] = 'page';
$page['post_content'] = '';
$page['post_parent'] = 0;
$page['post_author'] = $user_ID;
$page['post_status'] = 'op_preview';
$page['post_title'] = 'OptimizePress Content Preview Page';
$page['post_name'] = 'op_content_layout_preview_page';
$page_id = wp_insert_post($page);
/* Add Page Failed */
if ($page_id == 0) {
die('Error creating new page.');
}
}
echo get_permalink($page_id) . '?op-no-admin-bar=true';
define('OP_PAGEBUILDER_ID', $page_id);
$template = $_POST['template'];
/*$result = $wpdb->get_row($wpdb->prepare(
"SELECT `layouts`,`settings`,`guid` FROM `{$wpdb->prefix}optimizepress_predefined_layouts` WHERE `id`=%d ORDER BY name ASC",
$template
));*/
$result = $wpdb->get_row($wpdb->prepare("SELECT `layouts`,`settings` FROM `{$wpdb->prefix}optimizepress_predefined_layouts` WHERE `id`=%d ORDER BY name ASC", $template));
$keep = op_post('keep_options');
if (!is_array($keep)) {
$keep = array();
}
// Set page template ID if it exists - this will be used for stats and analytics
/*if (isset($result->guid) && !empty($result->guid)) {
op_update_page_option('template_id', $result->guid);
}*/
op_update_page_option('pagebuilder', 'Y');
op_page_set_saved_settings($result, $keep);
die;
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:45,代码来源:create_new_page.php
示例9: folder_list
function folder_list()
{
$files = array();
$checks = array('image', 'style', 'checkbox');
foreach ($checks as $chk) {
if (($folders = op_post('folders', $chk)) && is_array($folders)) {
$files[$chk] = $this->_process_files($folders, $chk);
}
}
echo json_encode($files);
exit;
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:12,代码来源:assets.php
示例10: save_membership_settings
/**
*
* Saving of membership pages
* @param array $conf
* @return void
*/
function save_membership_settings($conf)
{
global $wpdb;
$op = op_post('op');
if (empty($op['pageType']['type'])) {
// saving product!
update_post_meta(OP_PAGEBUILDER_ID, 'type', 'product');
op_update_page_option('membership', 'layout', $op['page']['preset_option']);
// change title and slug
$post = array('ID' => OP_PAGEBUILDER_ID, 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']));
wp_update_post($post);
} else {
if ($op['pageType']['type'] == 'category') {
//$page_id = $this->_add_page($op['category']['name'], OP_PAGEBUILDER_ID, 'category');
$page_id = OP_PAGEBUILDER_ID;
wp_update_post(array('ID' => $page_id, 'post_parent' => $op['pageType']['product'], 'post_title' => $op['category']['name'], 'post_name' => sanitize_title($op['category']['name'])));
update_post_meta($page_id, 'type', 'category');
update_post_meta($page_id, '_' . OP_SN . '_pagebuilder', 'Y');
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['category']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
} else {
if ($op['pageType']['type'] == 'subcategory') {
//$page_id = $this->_add_page($op['subcategory']['name'], $op['subcategory']['category'], 'subcategory');
$page_id = OP_PAGEBUILDER_ID;
wp_update_post(array('ID' => $page_id, 'post_parent' => $op['subcategory']['category'], 'post_title' => $op['subcategory']['name'], 'post_name' => sanitize_title($op['subcategory']['name'])));
update_post_meta($page_id, 'type', 'subcategory');
update_post_meta($page_id, '_' . OP_SN . '_pagebuilder', 'Y');
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['subcategory']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
} else {
if ($op['pageType']['type'] == 'content') {
if (!empty($op['content']['subcategory'])) {
$parentId = $op['content']['subcategory'];
} else {
if (!empty($op['content']['category'])) {
$parentId = $op['content']['category'];
} else {
if (!empty($op['pageType']['product'])) {
$parentId = $op['pageType']['product'];
}
}
}
//$page_id = $this->_add_page($op['content']['name'], $parentId, 'content');
$page_id = OP_PAGEBUILDER_ID;
wp_update_post(array('ID' => $page_id, 'post_parent' => $parentId, 'post_title' => $op['content']['name'], 'post_name' => sanitize_title($op['content']['name'])));
update_post_meta($page_id, 'type', 'content');
update_post_meta($page_id, '_' . OP_SN . '_pagebuilder', 'Y');
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['content']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
}
}
}
}
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:66,代码来源:page_builder.php
示例11: restore_page_revision
/**
* Restore page revision
* @author Zvonko Biskup <[email protected]>
* @since 2.1.9
* @return mixed
*/
function restore_page_revision()
{
global $wpdb;
$table = $wpdb->prefix . 'optimizepress_post_layouts';
$postID = op_post('postID');
$revisionID = op_post('revisionID');
if (empty($postID) || empty($revisionID)) {
return 0;
exit;
}
$wpdb->update($table, array('status' => 'revision'), array('post_id' => $postID, 'status' => 'publish'));
$sql = "UPDATE " . $table . " SET status='publish', modified=NOW() WHERE post_id = " . $postID . " AND id=" . $revisionID;
$wpdb->query($sql);
//$wpdb->update($table, array('status' => 'publish'), array('id' => $revisionID));
return 1;
exit;
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:23,代码来源:general.php
示例12: save_membership
/**
* AJAX calls this function to save membership section of Live editor
* @return void
*/
function save_membership()
{
global $wpdb;
$this->check_nonce();
$this->init_page();
$postId = $wpdb->escape($_POST['page_id']);
if (defined("WS_PLUGIN__OPTIMIZEMEMBER_VERSION")) {
c_ws_plugin__optimizemember_meta_box_saves::save_meta_boxes($postId);
}
// saving membership pages options
$op = op_post('op');
$current = op_page_option('membership', 'layout');
// this happens only if we have something to save (it is a membership page!)
if (!empty($op['pageType']['type']) && $op['pageType']['type'] == 'product') {
update_post_meta($op['pageId'], 'type', 'product');
op_update_page_option('membership', 'layout', $op['page']['preset_option']);
// change title and slug
$post = array('ID' => $op['pageId'], 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']), 'post_parent' => '');
wp_update_post($post);
}
if (empty($op['pageType']['type']) && !empty($op) && empty($op['type'])) {
// saving product!
update_post_meta($op['pageId'], 'type', 'product');
op_update_page_option('membership', 'layout', $op['page']['preset_option']);
// change title and slug
$post = array('ID' => $op['pageId'], 'post_title' => $op['product']['name'], 'post_name' => sanitize_title($op['product']['name']), 'post_parent' => '');
wp_update_post($post);
} else {
if ($op['pageType']['type'] == 'category') {
$page_id = $op['pageId'];
$post = array('ID' => $op['pageId'], 'post_title' => $op['category']['name'], 'post_name' => sanitize_title($op['category']['name']), 'post_parent' => $op['pageType']['product']);
wp_update_post($post);
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['category']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
} else {
if ($op['pageType']['type'] == 'subcategory') {
$page_id = $op['pageId'];
$post = array('ID' => $op['pageId'], 'post_title' => $op['subcategory']['name'], 'post_name' => sanitize_title($op['subcategory']['name']), 'post_parent' => $op['subcategory']['category']);
wp_update_post($post);
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['subcategory']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
} else {
if ($op['pageType']['type'] == 'content') {
if (!empty($op['content']['subcategory'])) {
$parentId = $op['content']['subcategory'];
} else {
if (!empty($op['content']['category'])) {
$parentId = $op['content']['category'];
} else {
$parentId = $op['pageType']['product'];
}
}
$page_id = $op['pageId'];
$post = array('ID' => $op['pageId'], 'post_title' => $op['content']['name'], 'post_name' => sanitize_title($op['content']['name']), 'post_parent' => $parentId);
wp_update_post($post);
$value = array('layout' => $op['page']['preset_option'], 'description' => base64_encode($op['content']['description']));
update_post_meta($page_id, '_' . OP_SN . '_membership', maybe_serialize($value));
$value = array('type' => 'membership', 'dir' => $op['theme']);
update_post_meta($page_id, '_' . OP_SN . '_theme', maybe_serialize($value));
}
}
}
if (!empty($op['type'])) {
$post = array('ID' => $op['pageId'], 'post_parent' => '');
if ($op['type'] == 'product') {
wp_update_post($post);
}
update_post_meta($op['pageId'], 'type', $op['type']);
}
}
//error_log(OP_PAGEBUILDER_ID);
if (!empty($op['typeForChange'])) {
$value = array('type' => 'membership', 'dir' => '1');
update_post_meta(OP_PAGEBUILDER_ID, '_' . OP_SN . '_theme', maybe_serialize($value));
update_post_meta(OP_PAGEBUILDER_ID, 'type', $op['typeForChange']);
}
/*
* DAP integration
*/
if (isset($op['membership']['dap_redirect_url'])) {
update_post_meta($postId, 'dap_redirect_url', $op['membership']['dap_redirect_url']);
}
/*
* Fast Member integration
*/
if (isset($op['membership']['fast_member_redirect_url'])) {
update_post_meta($postId, 'fast_member_redirect_url', $op['membership']['fast_member_redirect_url']);
}
/*
* iMember360 integration
*/
if (isset($op['membership']['imember_redirect_url'])) {
//.........这里部分代码省略.........
开发者ID:denis-chmel,项目名称:wordpress,代码行数:101,代码来源:live_editor.php
示例13: processOptinForm
/**
* Processing optin form, subscribing users
* @author Luka Peharda <[email protected]>
* @return void
*/
function processOptinForm()
{
global $wp;
/*
* We are checking for our processing URL slug
*/
if ($wp->request === 'process-optin-form') {
$type = op_post('provider');
/*
* Infusionsoft needs to be redirected with 307 to keep all of its required POST vars
*/
if ($type === 'infusionsoft') {
$list = op_post('list');
$email = op_post('inf_field_Email');
$webinar = op_post('gotowebinar');
/*
* Triggering GoToWebinar
*/
if (false !== $webinar) {
do_action('gotowebinar', $webinar, $email);
}
/*
* Redirecting user with all its POST data (needed for GoToWebinar interception)
*/
wp_redirect(op_post('redirect_url'), 307);
} else {
if (false !== $type) {
require_once OP_MOD . 'email/ProviderFactory.php';
$list = op_post('list');
$email = op_post('email');
$webinar = op_post('gotowebinar');
/*
* Triggering GoToWebinar
*/
if (false !== $webinar) {
do_action('gotowebinar', $webinar, $email);
}
$provider = OptimizePress_Modules_Email_ProviderFactory::getFactory($type, true);
$provider->subscribe(array('list' => $list, 'email' => $email));
header("HTTP/1.1 200 OK");
header("Location: " . op_post('redirect_url'));
} else {
$email = op_post(op_post('email_field'));
$webinar = op_post('gotowebinar');
/*
* Triggering GoToWebinar
*/
if (false !== $webinar) {
do_action('gotowebinar', $webinar, $email);
}
/*
* Redirecting user with all its POST data (needed for GoToWebinar interception)
*/
wp_redirect(op_post('redirect_url'), 307);
}
}
exit;
}
}
开发者ID:denis-chmel,项目名称:wordpress,代码行数:64,代码来源:framework.php
示例14: _op_file_info
function _op_file_info($return = false)
{
$type = op_post('attach_type');
$url = $html = $file = '';
if ($type == 'url') {
$url = op_post('media_url');
$ext = preg_match('/\\.([^.]+)$/', $url, $matches) ? strtolower($matches[1]) : false;
if (in_array($ext, array('jpg', 'jpeg', 'gif', 'png'))) {
$html .= '<a href="' . $url . '" target="_blank" class="preview-image"><img src="' . $url . '" alt="uploaded-image" /></a><a href="#remove" class="remove-file">' . __('Remove Image', OP_SN) . '</a>';
} else {
$html .= '<a href="' . $url . '" target="_blank" class="preview-image">' . __('View File', OP_SN) . '</a><a href="#remove" class="remove-file">' . __('Remove File', OP_SN) . '</a>';
}
} else {
$item_id = op_post('media_item');
$size = op_post('media_size');
$file = get_attached_file($item_id);
if (wp_attachment_is_image($item_id)) {
$url = wp_get_attachment_image_src($item_id, $size);
$html = '<a href="' . $url[0] . '" target="_blank" class="preview-image"><img src="' . $url[0] . '" alt="uploaded-image" /></a><a href="#remove" class="remove-file">' . __('Remove Image', OP_SN) . '</a>';
$url = $url[0];
} else {
$url = wp_get_attachment_url($item_id);
$html = '<a href="' . $url . '" target="_blank" class="preview-image">' . __('View File', OP_SN) . '</a><a href="#remove" class="remove-file">' . __('Remove File', OP_SN) . '</a>';
}
}
echo json_encode(array('url' => $url, 'html' => $html, 'file' => $file));
exit;
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:28,代码来源:admin.php
示例15: prepareMergeVars
/**
* Searches for possible form fields from POST and adds them to the collection
* @return null|array Null if no value/field found
*/
protected function prepareMergeVars()
{
$vars = array();
$allowed = array_keys($this->getCustomFields());
foreach ($allowed as $name) {
if ($name !== 'name' && op_post($name) !== false) {
$vars[$name] = op_post($name);
}
}
if (count($vars) === 0) {
$vars = null;
}
return $vars;
}
开发者ID:shahadat014,项目名称:geleyi,代码行数:18,代码来源:GetResponse.php
示例16: save_launch_suite
function save_launch_suite()
{
global $wpdb;
add_filter(OP_SN . '-script-localize', array($this, 'localize'));
$funnel_dropdown = '';
$current = intval(op_get('funnel_id'));
$found = false;
$funnels = $wpdb->get_results("SELECT id,title FROM `{$wpdb->prefix}optimizepress_launchfunnels` ORDER BY title ASC");
$funnel_count = 0;
if ($funnels) {
$funnel_count = count($funnels);
foreach ($funnels as $funnel) {
if ($current < 1) {
$current = $funnel->id;
$found = true;
} elseif ($current == $funnel->id) {
$found = true;
}
$funnel_dropdown .= '<option value="' . $funnel->id . '"' . ($current == $funnel->id ? ' selected="selected"' : '') . '>' . op_attr($funnel->title) . '</option>';
}
}
$this->funnel_count = $funnel_count;
$this->funnel_dropdown = $funnel_dropdown;
if ($found) {
define('OP_LAUNCH_FUNNEL', $current);
}
$this->data['settings_sections'] = array('gateway_key' => __('Funnel Gateway Key', OP_SN), 'perpetual_launch' => __('Perpetual/Evergreen Launch Mode', OP_SN), 'redirect_all' => __('Redirect All Launch Pages', OP_SN), 'hide_coming_soon' => __('Hide Coming Soon Placeholders', OP_SN));
$this->data['settings_sections'] = apply_filters('op_launch_suite_settings_sections', $this->data['settings_sections']);
if ($found && isset($_POST[OP_SN . '_launch_suite'])) {
if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'op_launch_suite')) {
$op = op_post('op');
foreach ($this->data['settings_sections'] as $name => $section) {
if (is_array($section)) {
if (isset($section['save_action'])) {
call_user_func($section['save_action'], op_get_var($op, $name));
}
} else {
call_user_func(array($this, '_save_' . $name), op_get_var($op, $name));
}
}
$funnel_pages = array('sales' => array(), 'stages' => array());
$used_ids = array();
$page_ids = array('sales' => 0, 'stages' => array());
if (isset($op['funnel_pages'])) {
if (isset($op['funnel_pages']['sales'])) {
$options = array('page_setup' => array('open_sales_cart', 'sales_page', 'hide_cart'), 'page_thumbnails' => array('active_thumbnail', 'inactive_thumbnail'), 'navigation' => array('active_link_text', 'inactive_link_text'));
if (isset($op['funnel_pages']['sales']['page_setup']) && ($page_id = op_get_var($op['funnel_pages']['sales']['page_setup'], 'sales_page', 0)) > 0) {
foreach ($options as $section => $fields) {
$conf = op_get_var($op['funnel_pages']['sales'], $section);
if ($section == 'page_setup') {
$page_ids['sales'] = op_get_var($conf, 'sales_page', 0);
if ($page_ids['sales'] > 0) {
$used_ids[$page_ids['sales']] = true;
$funnel_pages['sales']['sales_page'] = $page_ids['sales'];
op_update_page_id_option($page_ids['sales'], array('launch_suite_info', array('funnel_id' => OP_LAUNCH_FUNNEL, 'funnel_page' => 'sales')));
}
}
$tmp = array();
foreach ($fields as $field) {
$tmp[$field] = op_get_var($conf, $field);
}
$funnel_pages['sales'][$section] = $tmp;
}
}
}
if (empty($funnel_pages['sales'])) {
$funnel_pages['sales'] = $op['funnel_pages']['sales'];
}
if (isset($op['funnel_pages']['stage'])) {
$options = array('page_setup' => array('value_page'), 'page_thumbnails' => array('active_thumbnail', 'inactive_thumbnail'), 'navigation' => array('active_link_text', 'inactive_link_text'), 'publish_stage' => array('publish'));
if ($this->is_key_on) {
array_unshift($options['page_setup'], 'landing_page');
}
if (isset($op['funnel_pages']['stage']) && is_array($op['funnel_pages']['stage'])) {
$count = count(op_get_var($op['funnel_pages']['stage']['page_setup'], 'landing_page', array()));
$configs = array('page_setup' => op_get_var($op['funnel_pages']['stage'], 'page_setup', array()), 'page_thumbnails' => op_get_var($op['funnel_pages']['stage'], 'page_thumbnails', array()), 'navigation' => op_get_var($op['funnel_pages']['stage'], 'navigation', array()), 'publish_stage' => op_get_var($op['funnel_pages']['stage'], 'publish_stage', array()));
for ($i = 0; $i < $count; $i++) {
$stage = array();
$pg_ids = array();
foreach ($options as $section => $fields) {
$stage[$section] = array();
foreach ($fields as $field) {
$stage[$section][$field] = op_get_var(op_get_var($configs[$section], $field, array()), $i);
if ($field == 'active_link_text' && empty($stage[$section]['active_link_text'])) {
$stage[$section]['active_link_text'] = get_the_title(op_get_var($stage, 'value_page'));
} elseif ($field == 'inactive_link_text' && empty($stage[$section]['inactive_link_text'])) {
$stage[$section]['inactive_link_text'] = 'Coming Soon';
}
if ($field == 'landing_page' || $field == 'value_page') {
$pg_ids[$field] = $stage[$section][$field];
$stage[$field] = $pg_ids[$field];
if ($pg_ids[$field] > 0) {
$used_ids[$pg_ids[$field]] = true;
op_update_page_id_option($pg_ids[$field], array('launch_suite_info', array('funnel_id' => OP_LAUNCH_FUNNEL, 'funnel_page' => 'stage', 'stage_idx' => $i, 'type' => $field)));
}
}
}
}
$funnel_pages['stages'][] = $stage;
$page_ids['stages'][] = $pg_ids;
//.........这里部分代码省略.........
开发者ID:denis-chmel,项目名称:wordpress,代码行数:101,代码来源:launch_suite.php
示例17: subscribe
/**
* @see OptimizePress_Modules_Email_ProviderInterface::subscribe()
*/
public function subscribe($data)
{
if (isset($data['list']) && isset($data['email'])) {
$mergeVars = $this->prepareMergeVars();
try {
$contact = $this->getClient()->addContact($data['email'], 'normal', $mergeVars['prefix'], $mergeVars['name'], $mergeVars['last_name'], $mergeVars['sufix'], $mergeVars['street'], $mergeVars['street2'], $mergeVars['city'], $mergeVars['state'], $mergeVars['postal_code'], $mergeVars['phone'], $mergeVars['fax'], $mergeVars['business']);
$this->logger->notice('Adding contact status: ' . print_r($contact, true));
$status = $this->getClient()->subscribeContactToList($contact->contactId, $data['list']);
$this->logger->notice('Subscription status: ' . print_r($status, true));
/*
* API returns empty status if user exists
*/
if (empty($status)) {
if (isset($_POST['already_subscribed_url']) && op_post('already_subscribed_url') !== '') {
$_POST['redirect_url'] = op_post('already_subscribed_url');
} else {
if (isset($_POST['redirect_url'])) {
$action = sprintf(__('<a href="javascript:history.go(-1);">Return to previous page</a> or <a href="%s">continue</a>.', 'optimizepress'), op_post('redirect_url'));
} else {
$action = __('<a href="javascript:history.go(-1);">Return to previous page.</a>', 'optimizepress');
}
op_warning_screen(__('This email is already subscribed...', 'optimizepress'), __('Optin form - Warning', 'optimizepress'), $action);
}
}
return true;
} catch (Exception $e) {
$this->logger->error('Error ' . $e->getCode() . ': ' . $e->getMessage());
return false;
}
} else {
$this->logger->alert('Mandatory information not present [list and/or email address]');
wp_die('Mandatory information not present [list and/or email address].');
return false;
}
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:38,代码来源:Icontact.php
示例18: prepareMergeVars
/**
* Searches for possible form fields from POST and adds them to the collection
* @param string $id
* @return null|array Null if no value/field found
*/
protected function prepareMergeVars($id, $email)
{
$vars = array();
$allowed = array_keys($this->getFormFields($id));
foreach ($allowed as $name) {
if ($name !== 'email' && false !== ($value = op_post($name))) {
if (strrpos($name, "customfield_id_") !== false) {
$customID = str_replace('customfield_id_', '', $name);
$vars['field[' . $customID . ',0]'] = $value;
} else {
$vars[$name] = $value;
}
}
}
$vars['p[' . $id . ']'] = $id;
$vars['email'] = $email;
if (op_post('signup_form_id')) {
$vars['form'] = op_post('signup_form_id');
}
// Triggering instant responders
$vars['instantresponders'] = 1;
return $vars;
}
开发者ID:kyscastellanos,项目名称:arepa,代码行数:28,代码来源:ActiveCampaign.php
示例19: run_install
function run_install()
{
//Get the global wordpress database object
global $wpdb;
//Make sure we are supposed to be running this function
if (isset($_POST[OP_SN . '_install'])) {
//Perform security verification
if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'op_install')) {
//Get the OP order number
$key = op_post('op', 'install', 'order_number');
//Register the key and return key status
$status = op_sl_register($key);
//If the key is invalid, notify user, otherwise continue
if (is_wp_error($status)) {
//Save the API key
op_sl_save_key($key);
//Continue if the product is not already installed
if (op_get_option('installed') != 'Y') {
//CReate the Assets table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_assets` (\n\t\t\t\t\t\t\t `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t `name` varchar(64) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t\t `title` varchar(150) NOT NULL DEFAULT '',\n\t\t\t\t\t\t\t `settings` varchar(1) NOT NULL DEFAULT 'N',\n\t\t\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the launch funnel table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_launchfunnels` (\n\t\t\t\t\t\t\t\t`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t`title` varchar(254) NOT NULL DEFAULT '',\n\t\t\t\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the launch funnel pages table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_launchfunnels_pages` (\n\t\t\t\t\t\t\t\t`funnel_id` bigint(20) unsigned NOT NULL,\n\t\t\t\t\t\t\t\t`page_id` bigint(20) unsigned NOT NULL,\n\t\t\t\t\t\t\t\t`step` int(10) unsigned NOT NULL\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the layout categories table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_layout_categories` (\n\t\t\t\t\t\t\t\t`id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t`name` varchar(255) NOT NULL,\n\t\t\t\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the products table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_pb_products` (\n\t\t\t\t\t\t\t `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t `post_id` bigint(20) unsigned NOT NULL,\n\t\t\t\t\t\t\t `parent_id` bigint(20) unsigned NOT NULL,\n\t\t\t\t\t\t\t `type` varchar(50) NOT NULL DEFAULT '',\n\t\t\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the post layouts table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_post_layouts` (\n\t\t\t\t\t\t\t `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t `post_id` bigint(20) unsigned NOT NULL,\n\t\t\t\t\t\t\t `type` varchar(255) NOT NULL,\n\t\t\t\t\t\t\t `layout` longtext NOT NULL,\n\t\t\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the predefined layouts table
$wpdb->query("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}optimizepress_predefined_layouts` (\n\t\t\t\t\t\t\t `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t `name` varchar(100) NOT NULL DEFAULT '',\n\t\t\t\t\t\t\t `category` int(10) unsigned NOT NULL,\n\t\t\t\t\t\t\t `description` text NOT NULL,\n\t\t\t\t\t\t\t `preview_ext` varchar(4) NOT NULL DEFAULT '',\n\t\t\t\t\t\t\t `layouts` longtext NOT NULL,\n\t\t\t\t\t\t\t `settings` longtext NOT NULL,\n\t\t\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t\t\t) ENGINE=MyISAM;");
//Create the presets tabl
|
请发表评论