Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

For those wanting the widget to reflect if a member is logged in…

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › For those wanting the widget to reflect if a member is logged in…

  • This topic has 2 replies, 2 voices, and was last updated 14 years, 9 months ago by jeffw.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 19, 2010 at 2:34 am #1518
    jeffw
    Member

    Hi all,

    I’ve been working with this plugin for about a week now, and I think it’s great. Of course, there is always room for improvement, and I thought one option that would be nice is to have the login widget reflect if a user is logged in or not.

    i.e., if a user is logged in, the widget will be “Welcome jeffw!” As opposed to still retaining the “Member Login.” This method makes more sense, especially since after you login, the widget turns into a mini control panel.

    Here’s the code:

    function show_wp_eMember_login_widget($args){

    global $config;

    extract($args);

    global $current_user;

    get_currentuserinfo();

    $widget_title = $config->getValue(‘wp_eMember_widget_title’);

    if ( is_user_logged_in() ) {

    $widget_title = ‘Welcome ‘ . $current_user->user_login . ‘!’;

    } else if(empty($widget_title)) $widget_title = EMEMBER_MEMBER_LOGIN;

    echo $before_widget;

    echo $before_title . $widget_title . $after_title;

    echo eMember_login_widget();

    echo $after_widget;

    }

    You need to copypaste that code into the wp_eMember1.php file, at the exact function, which is the function show_wp_eMember_login_widget, around line 386.

    Keep in mind, I am using this program with the create identical WP user, and this will only work with that, since it is calling the user_login of the wp user, unless this works some other way.

    Enjoy!

    – Jeff W

    July 19, 2010 at 10:40 am #22564
    amin007
    Participant

    Thanks for the code Jeff. The widget should automatically display the logged in member’s name and a few other details. Wasn’t this happening for you?

    July 20, 2010 at 2:23 am #22565
    jeffw
    Member

    Yes. The membername would be displayed along with the account expiration, etc, once logged in.

    Sorry, I wasn’t exactly clear… That code changes the widget title to be “Welcome (username)!” once logged in, as opposed to keeping the “Member Login” widget title.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ