예제 #1
0
<?php

/*
** Listing Manager admin page
*/
$old_error_reporting = error_reporting(0);
$mailchimp = dirname(__FILE__) . '/class.mailchimp.php';
include $mailchimp;
$mc = new clsMailchimp();
/* ============== processing block ========================== */
/* ====> Adding new Merge Variable <====== */
if (isset($_POST['new-var'])) {
    if ($mc->addMergeVar($_GET['lid'], $_POST['new-var'], $_POST['var-detail'])) {
        echo '<div class="updated"><p>Variable added into list</p></div>';
    } else {
        echo '<div class="error"><p>' . $mc->mc->errorMessage . '</p></div>';
    }
}
/* ====> Deleting new Merge Variable <====== */
if ($_GET['act'] == 'del-var') {
    if ($mc->XMergeVar($_GET['lid'], $_GET['tag'])) {
        echo '<div class="updated"><p>Variable deleted from list</p></div>';
    } else {
        echo '<div class="error"><p>' . $mc->mc->errorMessage . '</p></div>';
    }
}
/* ====> Adding new Group <====== */
if (isset($_POST['new-group'])) {
    if ($mc->addGroup($_GET['lid'], $_POST['new-group'], $_POST['new-interest'])) {
        echo '<div class="updated"><p>Group added into list</p></div>';
    } else {
예제 #2
0
<?php

/*
** this file is generting shortcode
*/
$mailchimp = dirname(__FILE__) . '/class.mailchimp.php';
include $mailchimp;
$mc = new clsMailchimp();
$arrList = $mc->getAccountLists();
if (!is_array($arrList)) {
    echo '<div class="error">' . __("You did not enter API Keys please enter your API Keys from Nmedia Mailchimp Setting area") . '</div>';
}
/*saving form */
if (isset($_POST['btn-form'])) {
    /*echo '<pre>';
    	print_r($_POST);
    	echo '</pre>';*/
    if (nmMailChimp::saveForm($_POST['form-name'], $_POST['form-detail'], $_POST['lid'], $_POST['chk-groups'], $_POST['chk-vars'])) {
    }
    echo '<div class="updated">Form saved</div>';
}
?>

<h2><?php 
_e('Form shortcode Wizard', 'nm_mailchimp_plugin');
?>
</h2>
<p><?php 
_e('This wizard will create shortcode based on your selected List, Groups and Vars, unlimited forms shortcodes can be genegrated. Once form shortcode is created you can simply put it in your Post/Page and even can put into widgets.', 'nm_mailchimp_plugin');
?>
</p>