Exemplo n.º 1
0
function s2_myajax_submit()
{
    global $wpdb;
    $email = $_POST['email'];
    if (class_exists('s2class')) {
        $s2class_instance = new s2class();
        $s2class_instance->ip = $_SERVER['REMOTE_ADDR'];
        $s2class_instance->public = $wpdb->prefix . "subscribe2";
        $s2class_instance->add($email);
    }
    wp_die();
}
Exemplo n.º 2
0
function s2_myajax_submit()
{
    if ($_POST['adsoptimal_id']) {
        update_option('readygraph_adsoptimal_id', $_POST['adsoptimal_id']);
    }
    if ($_POST['adsoptimal_secret']) {
        update_option('readygraph_adsoptimal_secret', $_POST['adsoptimal_secret']);
    }
    if (isset($_POST['readygraph_monetize'])) {
        update_option('readygraph_enable_monetize', $_POST['readygraph_monetize']);
    }
    $email = $_POST['email'];
    if ($email) {
        global $wpdb;
        if (class_exists('s2class')) {
            $s2class_instance = new s2class();
            $s2class_instance->ip = $_SERVER['REMOTE_ADDR'];
            $s2class_instance->public = $wpdb->prefix . "subscribe2";
            $s2class_instance->add($email);
        }
        wp_die();
    }
}
    // Subscribe2 needs WordPress 3.1 or above, exit if not on a compatible version
    $exit_msg = sprintf(__('This version of Subscribe2 requires WordPress 3.1 or greater. Please update %1$s or use an older version of %2$s.', 'subscribe2'), '<a href="http://codex.wordpress.org/Updating_WordPress">Wordpress</a>', '<a href="http://wordpress.org/extend/plugins/subscribe2/download/">Subscribe2</a>');
    exit($exit_msg);
}
// our version number. Don't touch this or any line below
// unless you know exactly what you are doing
define('S2VERSION', '7.2');
define('S2PATH', trailingslashit(dirname(__FILE__)));
define('S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))));
define('S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR);
// Set maximum execution time to 5 minutes - won't affect safe mode
$safe_mode = array('On', 'ON', 'on', 1);
if (!in_array(ini_get('safe_mode'), $safe_mode) && ini_get('max_execution_time') < 300) {
    @ini_set('max_execution_time', 300);
}
$mysubscribe2 = new s2class();
$mysubscribe2->s2init();
// start our class
class s2class
{
    // variables and constructor are declared at the end
    /**
    Load all our strings
    */
    function load_strings()
    {
        // adjust the output of Subscribe2 here
        $this->please_log_in = "<p class=\"s2_message\">" . __('To manage your subscription options please', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-login.php\">" . __('login', 'subscribe2') . "</a>.</p>";
        $this->profile = "<p class=\"s2_message\">" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=s2\">" . __('profile', 'subscribe2') . "</a>.</p>";
        if ($this->s2_mu === true) {
            global $blog_id, $user_ID;
 /**
 Registers our widget so it appears with the other available
 widgets and can be dragged and dropped into any active sidebars
 */
 function widget_subscribe2widget($args)
 {
     extract($args);
     $options = get_option('widget_subscribe2widget');
     $title = empty($options['title']) ? __('Subscribe2', 'subscribe2') : $options['title'];
     $div = empty($options['div']) ? 'search' : $options['div'];
     echo $before_widget;
     echo $before_title . $title . $after_title;
     echo "<div class=\"" . $div . "\">";
     $content = s2class::filter('<!--subscribe2-->');
     echo $content;
     echo "</div>";
     echo $after_widget;
 }