• I have added a author template in the hopes of allowing all registered users regardless of role a profile page on the site. Here is the profile page of one of the admin level users: http://www.kixandthecity.com/author/maze

    FYI, here is the code that I have used to do this (in author.php template):

    <?php
    if(get_query_var('author_name')) :
    $curauth = get_userdatabylogin(get_query_var('author_name'));
    else : $curauth = get_userdata(get_query_var('author'));
    endif;
    ?>
    <h3><?php echo $curauth->nickname; ?></h3>
    <h4>Website:</h4>
    <p><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></p>
    <h4>About <?php echo $curauth->nickname; ?></h4>
    <p><?php echo $curauth->user_description; ?></p>
    <h4>Other Users:</h4>
    <ul>
    <?php wp_list_authors('hide_empty=0&exclude_admin=0'); ?>
    </ul>

    I added the wp_list_authors just for testing, this will be removed once (if?) I can get this to work properly.
    As you can see from the list of users, only 2 (both admin level) have links to their profiles. I have tried substituting the username in the url but it just comes up with a 404 page.

    Is there any way that I can override WordPress’ restriction limiting profile pages to those of author level or above?

    And a couple of side questions:
    Why does WordPress allow subscribers to fill out the profile at all (as well as see dashboard, etc.) if their profile can never be seen?

    Is the only benefit of registering that you don’t have to fill out comment fields (which is also done with cookies for those who aren’t registered so its not that much of a benefit)?

    Thanks for your help.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Registration seems to give admin some control over spammers. See “Users must be registered and logged in to comment” option.

    I’m largely unfamiliar with the newer 2.x+ versions, so can’t really help with other questions. Roles came with 2.0, if I recall correctly.

    Thread Starter tommyill

    (@tommyill)

    I’m pretty sure the “Users must be registered and logged in to comment” has no effect on whether profile pages are active or not. I also believe the behavior I have described (no profile output page for lower access levels, but ability to edit profile, see limited areas of admin) was also present before the 2.0 additions of roles and capabilites.

    Thread Starter tommyill

    (@tommyill)

    klklaser – I shouldn’t have posted so fast, I understand what you are saying, with that setting, registering offers the benefit of being able to post. Good point.

    About Current Author

    “It is important to know that $curauth is not a WordPress variable, but a variable generated by PHP code and sent via a link as a query. Therefore, the author.php file must be requested via a link to the author page, which specifies an author. If you request the author.php page directly, you’ll end up with no data.

    Maybe there are ideas here, or here.

    I have no idea whether that can adapt to your use or not.

    andrewkuo

    (@andrewkuo)

    Anyone have an update on this? (For being able to display subscriber profiles with the author.php page)

    Same issue here. I can get a nice list of authors and contributors:

    <h2>List of authors:</h2>
    <ul>
    <?php wp_list_authors('hide_empty=0'); ?>
    </ul>

    …however the only ones that are linked to actual profile pages are the ones who have written a post. It doesn’t matter if they are authors or contributors….it just matters if they have posted or not…no posts, no profile. Does anyone know a way around this?

    To get around this problem, you’ll have to modify wp-include/class.php function handle_404().

    Find this line:
    if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER[‘QUERY_STRING’]) && (false === strpos($_SERVER[‘REQUEST_URI’], ‘?’))) ) ) {

    and include negative qualifier for author pages:

    if ( (0 == count($wp_query->posts)) && !is_404() && !is_author() && !is_search() && ( $this->did_permalink || (!empty($_SERVER[‘QUERY_STRING’]) && (false === strpos($_SERVER[‘REQUEST_URI’], ‘?’))) ) ) {

    That should do it for you. Hope that helps.

    [sig moderated]

    This was very helpful. Thank you!

    Now all I need to do is figure out how to produce the profile links.

    Anonymous User 179266

    (@anonymized-179266)

    Thanks codersteve. Thanks thanks thanks thanks 🙂

    This is great. I’ve started to edit the default Archive page, but what I’d like to do is to include “subscribers” who have posted comments, but I can’t figure out how to do that. Anyone feeling clever?

    Thanks

    Oh, and Edit: codersteve, when using that code to get around the 404, my post url’s, comments and what nots gets a 404 instead.

    OK, never mind that edit, I think I was just sitting up working too late, not realizing my head went to bed hours earlier…

    But in addition to including Subscribers to these author pages, I would like to see this author thing move up a level, to the main “Root Blog” if you will.

    Right now, I have installed my blog under /wpmu. I have one blog as /wpmu/blog1 and another as /wpmu/blog2. So, if admin1 posts an entry under say blog1, you can only access his profile page under /wpmu/blog1 at URL /wpmu/blog1/author/admin1.

    I would love to get his profile page accessible under /wpmu/author/admin1, meaning at “root level”. I don’t know if this could be achieved by mod_rewrite or something, but I have no idea how.

    Further more, since these author pages are blog dependent as far as posts go, if you visit /wpmu/blog2/author/admin1 there will be no content, since he never posted on blog2. But he, and any subscribers I tested with, have access to post comments on both (I guess ALL) blogs, by signing up.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘subscriber profile’ is closed to new replies.