Forum Replies Created

Viewing 15 replies - 46 through 60 (of 155 total)
  • I just pulled this out of my child theme’s functions.php file

    It’s not perfect, but what it does is creates a login/logout menu item on the primary menu and builds in some redirect logic.

    As-Is … no guarantees that it will work in your theme or environment. In fact in mine, the simple modal plugin gives an “ERROR: OK” message on successful logins and after that it will not refresh the page or redirect. I don’t have time to try and fix it so I’m not even going to use this plugin, but I hope this login/logout menu snippet thing works for you.

    <?php
    function sv_get_logout_redirect_url() {
    	$badurls = array('submit-form', 'dashboard', 'profile', 'guidelines');
    	$current_url = get_permalink();
    	$isgood = true;
    	foreach ($badurls as $bad) {
    		$pos = strpos($current_url,$bad);
    		if (! $pos === false) {
    			$isgood = false;
    			break;  // no need to check any more "bads"
    		}
    	}
    	if ($isgood) {
    		return wp_logout_url(get_permalink());
    	} else {
    		return wp_logout_url(home_url());
    	}
    }
    
    add_filter( 'wp_nav_menu_items', 'sv_add_usermenu', 10, 2 );
    
    function sv_add_usermenu( $items, $args ) {
    	global $current_user;
    
    	if (is_user_logged_in() && $args->theme_location == 'primary-menu') {
    		// menu items for logged in user
    		$guidelines_url = site_url() . '/guidelines/';
    		$dashboard_url = site_url() . '/dashboard/' . $current_user->user_nicename;
    		$profile_url = site_url() . '/profile/' . $current_user->user_nicename;	
    
    		//	http://fortawesome.github.com/Font-Awesome/
    		//	some fontawesome names icon-arrow-down, icon-chevron-down, icon-caret-down
    		$items .= "<li class='menu-item'><a href='#'>$current_user->display_name <span class='icon-caret-down'> </span> </a>";
    		//$items .= "<li class='menu-item'><a href='#'>$current_user->display_name</a>";
    		$items .= "<ul>";
    		$items .= "<li class='sub-menu'><a href='$guidelines_url'>Usage Guidelines</a></li>";
    		$items .= "<li class='sub-menu'><a href='$dashboard_url'>My Dashboard</a></li>";
    		$items .= "<li class='sub-menu'><a href='$profile_url'>My Profile</a></li>";
    		$items .= "<li class='sub-menu'><a href='" . sv_get_logout_redirect_url()  . "'>Log Out</a></li>";
    		$items .= "</ul>";
    		$items .= "</li>";
        } elseif (!is_user_logged_in() && $args->theme_location == 'primary-menu') {
    		//menu items for NOT logged in user
    		//$login_url = site_url('/a-page-name/');		// get login url and redirect to a specific page
    		//$login_url = wp_login_url( home_url() );		// get login url and redirect to home page
    		$login_url = wp_login_url( get_permalink() );	// get login url and redirect to current page
    		//the contents of <a href""  must be a url
    		$items .= "<li class='sub-menu'> <a href='$login_url' class='simplemodal-login'>Log In</a></li>";
        }
        return $items;
    }
    ?>

    The second last line of code is the tie in to this plugin where it simply adds that class name to the link for the menu item. The plugin magically takes over from there and replaces the standard wordpress login page with its modal overlay.

    I see now that it does link social profiles by e-mail and the first one registered through creates the username.

    And a nice to have feature (although probably outside the scope of their original design of making it quick and easy for the user), would be what I think 3dolabs is saying, let the user themselves add/change/delete their social login profile.

    FWIW: I’m now leaning the opposite way, since I want user participation within my site. I’m making a frontend self-managed user profile with fields that are relevant to content on my site and making the registration/login process very clear and functional. That’s based on this good read: http://blog.mailchimp.com/social-login-buttons-arent-worth-it/

    Good luck and have fun!

    Ron Strilaeff

    (@ronstrilaeff)

    This is a critical piece of functionality that is not obvious until testing connections to multiple social media accounts.

    So I’m with the OP.. how does this plugin prevent creating multiple wordpress profiles?

    Here’s a simplified scenario to demonstrate:
    – joe has an account on facebook and googleplus
    – joe discovers my site and wants to leave a comment but I require him to be logged in.
    – joe registers and logs in using the facebook link and WSL dutifully creates a user named “joe” and now he can leave his comment.
    – 2 weeks later joe comes back to my site and wants to leave another comment, he vaguely remembers logging in and thinks it might have been with googleplus (but he really does not care or should care), so he presses the googleplus WSL icon.
    – since joe is logged in already to his g+ account, it approves him easily and he leaves his comment on my site and goes away.
    – what just happened is WSL created a user named “joe_1” on my site and there is no way to know it’s the same guy.
    – joe likes my site and decides to upload his avatar, location and a small bio and whatever.
    – later he comes back when in a facebook mood, logs in and goes to look at his profile to update his bio, but it is blank so he cusses and says “that site is broken and I don’t trust it, because it lost all my info”.

    This would happen even if joe had the same username on both facebook and g+.

    How is this situation prevented? Should WSL recognize that “joe” already exists and ask the google joe if he is the same guy who registered as facebook joe? This must be a basic question that has been answered thousands of times. Maybe that is what the big paid services like janrain, gigya, loginradius, oneall, etc do? … somehow keep track of all of joe’s social ids of which my site is just one insignificant player.

    Can it be done using WSL?

    Forum: Fixing WordPress
    In reply to: Footer Missing
    Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Wow… problem solved!

    We changed an amazon ad in the sidebar and neglected to paste in the closing <iframe> tag … Doh!

    Then of course all html below that would be corrupted, including the ajax in the footer (for the photo submit form and admin bar).

    So, call off the cavalry! *whew*

    Ron Strilaeff

    (@ronstrilaeff)

    Piggybacking … when a user logs in using twitter, it get’s stuck on the twitter page “Authorize <site> to use your account?” The big blue “Sign In” button appears to click but nothing happens.

    I have checked the Application Type: “Read and Write” radio button and the “Allow this application to be used to Sign in with Twitter” checkbox.

    What else could it be?

    Ron Strilaeff

    (@ronstrilaeff)

    Yes, a non-admin user can edit and their profile from a normal page on the front end.

    You do not need the pro version for that.

    You would:
    1. define (and configure) your fields the way you want them to look by dragging them into an edit area, then
    2. drag them to a form on a different settings page.
    3. place a shortcode on the page you want the profile form to show like this [ user-meta type=’profile’ form=’yourformname’ ]

    The pro version adds a bunch of fields and tabs to give more capabilities, but the basic stuff does work for free and you can override the css to make it look the way you want.

    Ron Strilaeff

    (@ronstrilaeff)

    Wow, that’s a relief! Thanks for testing this.

    I will install it on another barebones test site and see what may be conflicting. (It maybe the AJAX version, and I’m using the one found by the plugin “Use Google Libraries”.)

    However, I won’t be able to get back to that for a couple of days though so will post my findings then.

    Ron Strilaeff

    (@ronstrilaeff)

    Are we the only ones having this problem? I would like to hear from someone who has this working with out the showstopper “ERROR: OK” bug.

    This happens every time an existing user tries to login, so it is inconceivable that someone is using this plugin on a live site with that fatal flaw. Turning on console.log still does not show a js /ajax error.

    I will try again to get a response from Eric (the author).

    Thread Starter Ron Strilaeff

    (@ronstrilaeff)

    Thanks for this, and I see it is a LOT more complicated than I first thought. So, trying to figure out what you are talking about….

    1. Did you include an entire (display:none;) form in a menu item?
    2. What exactly are you referring to when you say “copy the code from … to your template”. I don’t have a template anywhere for this, but the plugin doc keeps referring to one.
    3. It works perfectly “out of the box” as a sidebar widget, but the whole point of making a menu item was to do the same thing while eliminating that sidebar widget. Do I still need to have the sidebar widget in place to make your technique work?
    4. What is the essential difference between wp_nav_menu (which you use) and wp_nav_menu_items (which I tried to use and works well for other things)?

    It’s OK if you don’t have the time to explain all this… I have no loyalty or commitment to this plugin. All I want is something like (the apparently abandoned) simplemodal-login (but without the show stopper “ERROR: OK” bug) That much simpler plugin does the job simply by including a specific class name in the login link like I tried to do in my original post here.

    Ron Strilaeff

    (@ronstrilaeff)

    The original css is this:

    .qq-upload-button {
        background: none repeat scroll 0 0 #880000;
        border-bottom: 1px solid #DDDDDD;
        color: #FFFFFF;
        display: block;
        padding: 7px 0;
        text-align: center;
        width: 105px;
    }

    and it’s in this file (along with many other things)
    /wp-content/plugins/user-meta/assets/css/jquery/fileuploader.css

    As you probably know, you could override any of those properties you want to change by putting them in your child theme’s style.css.
    for example:

    .qq-upload-button {
        background: none repeat scroll 0 0 #CCDDCC !important;
        color: black !important;
    }

    With a little more finesse, you could also avoid using the brute-force !important statement. Maybe the author will come back and tell us of some built-in way to do that.

    Ron Strilaeff

    (@ronstrilaeff)

    We are kinda working on the same thing, and I’m currently testing the user meta plugin which lets you create and configure custom user meta fields and forms and put them on your own custom page template (or a generic page) with a shortcode like this [user-meta type='profile' form="aformname'] I would not hesitate to pay the $29 for the pro version of this if I run into a “must have” since it seems very well designed and expandable.

    Update: I just want to include this link for some decent third party documentation on the above.

    As far as letting users actually create posts from the frontend, Ninja Forms is pretty solid. It looks like it is for surveys and data gathering but I think it can be adapted to lots of other things. It is also well designed and maintained.

    Good luck and have fun!

    Ron Strilaeff

    (@ronstrilaeff)

    Since you are on the ground floor with this and it sounds like a community type site, maybe get started with buddypress.

    Ron Strilaeff

    (@ronstrilaeff)

    Sorry that was a bit cryptic (and this thread is closed).. starting a new thread.

    Ron Strilaeff

    (@ronstrilaeff)

    So, Marcus,

    Can I make a modal popup from a link in the menu?

    Thanks, Ron

    Ron Strilaeff

    (@ronstrilaeff)

    Andy,

    Where would I put that apply filter if my custom page template does not use the content of the page but is composed entirely of content generated from custom loops within a bunch of html to lay it out … plus get_header() and get_footer()?

    Are you saying I would insert that code to apply filters in my template eventhough that template does not have the statement the_content(); ?

    In that case, what variable or function call would I put as the second parameter? Maybe I’m just having early morning fog, but this should be very simple.

    Thanks, Ron

Viewing 15 replies - 46 through 60 (of 155 total)