Results 1 to 4 of 4

Thread: Problem with dynamic welcome widget

  1. #1
    Thread Starter
    mouse's Avatar
    Join Date
    Oct 2012
    Location
    United States
    Posts
    67
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Problem with dynamic welcome widget

    Just went live with our Classipress site and already have excellent response.

    On the home page (www.nantucket.net/classifieds) on the sidebar, the login/password fields just redirect to the login page.

    I would like to either eliminate those fields and just send people to the login page with the 'Already a Member?' button
    OR have the login fields work.

    This is what I have in my child theme functions.php where I assume the problem exists:
    ------------------
    function cp_dynamic_welcome_widget($optionString) {
    global $user_ID, $user_identity, $user_level;
    if(!isset($optionString)) $optionString = 'cp_ads_welcome_msg';
    if ( $user_ID ) {
    $smHomepageSidebar = '<h2>User Options</h2>';
    $smHomepageSidebar .= '<div>';
    $smHomepageSidebar .= '<ul>';
    $smHomepageSidebar .= '<li><a href="' . CP_DASHBOARD_URL . '">' . __('My Dashboard','cp') . '</a></li>' ;
    $smHomepageSidebar .= '<li><a href="' . CP_PROFILE_URL . '">' . __('Edit Profile','cp') . '</a></li>';
    $smHomepageSidebar .= '<li><a href="' . CP_PROFILE_URL . 'change_password/">' . __('Change Password','cp') . '</a></li>';
    if (current_user_can('manage_options'))
    $smHomepageSidebar .= '<li><a href="' . get_option('home') . '/wp-admin/">' . __('WordPress Admin','cp') . '</a></li>';
    $smHomepageSidebar .= '<li><a href="' . wp_logout_url() . '">' . __('Log Out','cp') . '</a></li>';
    $smHomepageSidebar .= '</ul>';
    $smHomepageSidebar .= '</div><!-- /recordfromblog -->';
    }
    else { //if the user has no user ID then they are not logged in
    $smHomepageSidebar = '<div style="padding-bottom:10px;">';
    $smHomepageSidebar .= get_option($optionString); //cp_ads_welcome_msg
    $smHomepageSidebar .= '<div style="float: right; text-align: center;">';
    $smHomepageSidebar .= '<a href="' . get_option('home') . '/wp-login.php" class="mbtn btn_orange">' . __("Already a Member?", 'cp') . '</a><br />';
    $smHomepageSidebar .= '</div>';
    if (get_option('users_can_register') || get_blog_option($blog_id, 'users_can_register', 0))
    $smHomepageSidebar .= '<a href="' . get_option('home') . '/wp-login.php?action=register" class="mbtn btn_orange">' . __("Join Now!", 'cp') . '</a>';
    $smHomepageSidebar .= '<br />';
    $smHomepageSidebar .= '</div><!-- /dotted -->';

    //Create the Login Form
    $smHomepageSidebar .= '<div style="margin-top: 10px;">';
    $smHomepageSidebar .= '<form action="' . get_bloginfo('url') . '/wp-login.php" method="post">';
    $smHomepageSidebar .= '<label style="font-size: 11px; margin-left: 1px;" for="log">Username: <input type="text" name="log" id="log" value="' . wp_specialchars(stripslashes($user_login), 1) . '" size="11" style="height: 10px; font-size: 10px;" /></label>';

    $smHomepageSidebar .= '<label style="font-size: 11px; margin-left: 1px;" for="pwd">Password: <input type="password" name="pwd" id="pwd" size="11" style="height: 10px; font-size: 10px;" /></label>';
    $smHomepageSidebar .= '<input style="font-size: 11px; margin-left: 1px;" type="submit" name="submit" value="Login" /><br />';
    $smHomepageSidebar .= '<label style="font-size: 11px; margin-left: 1px; vertical-align:baseline; line-height: 2.1em;" for="rememberme"><input style="margin: 0; position: relative; top: 3px;" name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me </label> | ';
    $smHomepageSidebar .= '<a style="font-size: 11px; margin-left: 1px;" href="' . get_bloginfo('url') . '/wp-login.php?action=lostpassword">Recover password</a>';
    $smHomepageSidebar .= '<input type="hidden" name="redirect_to" value="' . $_SERVER['REQUEST_URI'] . '"/>';
    $smHomepageSidebar .= '</form>';
    $smHomepageSidebar .= '</div>';
    }
    return $smHomepageSidebar;
    }
    -----------------
    Thanks for any help
    mouse

  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  3. #3
    rabih's Avatar
    Join Date
    Jun 2012
    Location
    India
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Expired Customer bringhopes's Avatar
    Join Date
    Jan 2015
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Listings Pages Ad Widget Problem
    By tbase in forum Report Vantage Bugs (Legacy)
    Replies: 3
    Last Post: August 26th, 2012, 09:55 AM
  2. Sidebar Widget problem
    By paulbrett in forum ClassiPress General Discussion
    Replies: 3
    Last Post: April 12th, 2012, 11:28 AM
  3. Widget saving problem
    By wighty in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: April 17th, 2011, 05:54 PM
  4. Admin stats widget problem !
    By pinocchio in forum Report ClassiPress Bugs
    Replies: 6
    Last Post: January 27th, 2011, 12:37 PM
  5. [SOLVED] Widget menu problem
    By panks7077 in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: November 23rd, 2010, 02:32 PM