• Ithink that Mailpress (maybe at first is difficult to understand it) is one of the best plugin of wordpress.
    First sorry if the post doesn’t go here.

    I have bern working (1 hour and 30 min aproximately xd! searching more than working jeje) in two interested and useful tips for mailpress.

    Here goes the post that i published in the Google group of Mailpress:

    The first tip: Get the total number of subscription tu put in the
    widget or wherever you want:

    I think that this it’s a pretty featured that could be added to the
    widget…and i want to share it here and give my congratulation to the
    owner off this mod.

    OK here we go:

    Put this CODE in your functions.php (the file is inside of your theme
    folder, if not exists create it)

    function get_mailpress_count() {
       global $wpdb;
           $mailpress_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(id) -1
    FROM wp_mailpress_users WHERE status = 'active';"));
    echo '<p>We already are ' . $mailpress_count . ' subscribers!!</p>';
    }

    Ok, then you can put this code <?php get_mailpress_count ?> wherever
    you want to show the number of subscription, but if we want to put it
    inside the widget we do this:

    Go to –> mailpress folder –> mp-includes –> class –>
    MP_Widget.class

    Find this:

    </form>
                   </div>

    And after the code add this:

    <?php get_mailpress_count ?>

    The SECOND tip: This i think is more useful than the last, with this
    tip you can catch the “confkey” or “key” of a LOGIN user (del=?????)
    to construct a link to Manage Subscription. This of course can be
    place wherever you want, for example in a top menu. Like my web.

    OK, we start.
    Go to the function.php in our theme folder, there you have to put this
    code IF YOU USE THE DEFAULT MANAGE PAGE:

    function get_mailpress_mlink() {
      global $wpdb, $current_user;
         get_currentuserinfo();
       $user_name = $current_user->user_login;
           $mailpress_user_key = $wpdb->get_var($wpdb->prepare("SELECT confkey
    FROM wp_mailpress_users WHERE name = '$user_name';"));
    echo '<a href="https://www.MYWEB.com/wp-content/plugins/mailpress/mp-
    includes/action.php?action=mail_link&del=' . $mailpress_user_key .
    '">Manage Subscriptions</a>';
    }

    IF YOU USE THE PAGE TEMPLATE:

    function get_mailpress_mlink() {
      global $wpdb, $current_user;
         get_currentuserinfo();
       $user_name = $current_user->user_login;
           $mailpress_user_key = $wpdb->get_var($wpdb->prepare("SELECT confkey
    FROM wp_mailpress_users WHERE name = '$user_name';"));
    echo '<a href="https://www.MYWEB.com/MYPAGE/action.php?
    action=mail_link&del=' . $mailpress_user_key . '">Manage
    Subscriptions</a>';
    }

    Be sure that youu edit in the code MYWEB and if is necesary MYPAGE.

    Then you can put this code wherever you want:

    <?php if ( is_user_logged_in() ) { ?>
    <?php get_mailpress_mlink() ?>
    <?php } ?>

    And a link to “Manage your subscription” will appear. It’s important
    that you can put this code in all your template and you don’t have to
    use the widget to see this link now.

    This only will appear if the user is register. I recommend use the
    Sync WordPress User add-on for wordpress.

    Ok i thin tthat this is very very useful, and sorry for my bad englush
    i’m spanish.

    Bye

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Some very useful tips for Mailpress’ is closed to new replies.