Howdy, Stranger!

It looks like you're new here. If you want to take part in the discussions, click one of these buttons!

Sign In Apply for Membership

In this Discussion

Wordpress PluginsMember List display and link

  • 0 points-+

    Hi! I've managed to cobble together a bit of what I want, but I think I've reached a wall.

    I found that the author links generated by the plug-in weren't working - instead of the ?author=3 type link, my author template only kicked in with a link to /index.php/author/authorname/

    Well - it took some doing (I'm certainly no php programmer) but I managed to adjust the plug-in code to provide that link, and apply it to the gravitar/photo in the directory listing - step one, accomplished!

    Next, I used the admin area to configure the mark-up and get the first_name and last_name to display on the same line, instead of one under the other - step two accomplished!

    THEN - I wanted to apply the adjusted link to the author's name... BUT, since the author's name is really made up of two distinct %value% entries just placed next to each other, rather than a single unit, I can't get the a href to work - something like:

    a href="../index.php/author/%value%

    that's opened on the first_name only includes the value for first_name in the link, even if I don't close the in the next, last_name, item.

    What I've tentatively done is add the nice_name variable and applied the link to that, but now, of course, I have the user's login name displayed over their "user friendly" first/last name.

    Example here: http://clinical-mindfulness.org/member-directory/

    So, ideally... I'd like the author link on the author's name... possible?

  • 0 points-+

    Can you send me a screenshot of your mark-up editing page with everything the way you wan it?

    matthew@ternstyle.us

  • 0 points-+

    Well, I think that's the problem, isn't it? If I could get the editing page the way I wanted it, I wouldn't have any problems, right?

    I can tell you how I'd *like* the code t be laid out, if that helps.

  • 0 points-+

    post contained mark-up that got stripped out...

  • 0 points-+

    crud - it strips out mark-up...

  • 0 points-+
  • 0 points-+

    James, Put this before the %value% in the first name field: <a href="%author_url%">

    And before the </div> in the last name field put this: </a>

  • 0 points-+

    That doesn't work - it gives me a link like: /author/1 - remember, I mentioned in the first post that the author links generated by the plugin don't work. Even though I have an author.php template set up, only links in the format /author/name actually work.

  • 0 points-+

    If you head over to the page: http://clinical-mindfulness.org/member-directory/

    And hover over the thumbnail, you get this link: http://clinical-mindfulness.org/index.php/index.php/author/Richard%20Sears

    That link works.

    If you click on the username, in the first instance, richard-sears, you get this link: http://clinical-mindfulness.org/index.php/author/richard-sears

    That link works.

    If you click on the properly formatted name, Richard Sears, using the code you suggested, you get this link:

    http://clinical-mindfulness.org/index.php/index.php/author/3

    That link does NOT work.

    So what I'm trying to figure out is how to get one of the working links around the properly formatted name.

  • 0 points-+

    I'm sorry James. I was having trouble understanding you. I get the author url issue now. Currently there is no good solution without editing the plugin itself.

    change line 877 of tern_wp_members.php from this: $s .= "\n ".str_replace('%author_url%',get_bloginfo('url').'/?author='.$u->ID,str_replace('%value%',$u->$v['name'],$v['markup']));

    to this: $s .= "\n ".str_replace('%author_url%',get_bloginfo('wpurl').'/?author='.$u->user_nicename,str_replace('%value%',$u->$v['name'],$v['markup']));

    Let me know if that works.

  • 0 points-+

    It didn't work at first, but I changed the '/?author=' to 'index.php/author/' instead, and it works perfectly now - thanks!

  • 0 points-+

    You're welcome. That's great!

Want to take part in this discussion? Click one of these: Sign In Apply for Membership
Site designed by, well, me.