• My site is restricted to registered users who can comment but not post. I want the commenter’s nicknames to link to a profile page that displays their information. I thought that I figured out how to do it, but it didn’t work the way I thought it would.

    <?php comment_author_link(); ?> links the commenter’s nickname to the URL of their website.

    <?php the_author_posts_link(); ?> ?> links the author’s nickname to the author’s profile page (author.php).

    I opened my comments template and replaced <?php comment_author_link(); with <?php the_author_posts_link(); ?> thinking that it would link each commenter’s nickname to their own profile page with their information.

    Instead, it replaces all the commenter’s nicknames with my own nickname and links to my own profile. It looks like I’m the only commenter to my own posts. I’m assuming this is because <?php the_author_posts_link(); ?> works only for authors, not subscribers. I’m the only author on my site, and the rest are just subscribers who can comment.

    My question is, how can I get <?php comment_author_link(); ?> to link to author.php with the commenter’s profile, instead of just linking to the commenter’s URL?

    Or is there maybe an easier way to accomplish this task?

    Any advice would be appreciated. Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • take a look at http://guff.szub.net/wordpress/template-tags

    you’ll need to customize/code around the comment tags instead of the ‘author’ tags (although one of the author tags may return the ID of the comment author since all users are registered on your site, so you could use that instead). I’d probably start with <?php comment_author_rss(); ?> and feed that to a bit of php/html which uses it to build a link to call the author.php page with the name in that format as the “slug”.

    Anonymous User 179266

    (@anonymized-179266)

    You can do this manually but you have to remove some wordpress core code. I mean in user-edit.php and plugable-functions.php you have to remove changing nickname fields πŸ™‚ then open your templates comments.php and find this -> <?php comment_author_link(); ?> replace with this ->

    <a href="<?php bloginfo('wpurl'); ?>/author/<?php comment_author(); ?>"><?php comment_author(); ?></a> thats all πŸ™‚

    hello. i use wordpress 1.5

    Xenuan sorry can you tell me more?

    i edit comments.php , but i don’t understand what i must edit in user-edit.php and plugable-functions.php

    and i find user-edit.php in wp-admin directory but plugable-functions.php where is???

    please can you tell me more info in easy english? thanks

    Anonymous User 179266

    (@anonymized-179266)

    Ok,

    1-Open Wp-Admin/user-edit.php and Wp-Admin/profile.php delete this lines: `<p><label><?php _e(‘Display name publicly as:’) ?>
    <select name=”display_name”>
    <option value=”<?php echo $profileuser->display_name; ?>”><?php echo $profileuser->display_name; ?></option>
    <option value=”<?php echo $profileuser->nickname ?>”><?php echo $profileuser->nickname ?></option>
    <option value=”<?php echo $profileuser->user_login ?>”><?php echo $profileuser->user_login ?></option>
    <?php if ( !empty( $profileuser->first_name ) ) : ?>
    <option value=”<?php echo $profileuser->first_name ?>”><?php echo $profileuser->first_name ?></option>
    <?php endif; ?>
    <?php if ( !empty( $profileuser->last_name ) ) : ?>
    <option value=”<?php echo $profileuser->last_name ?>”><?php echo $profileuser->last_name ?></option>
    <?php endif; ?>
    <?php if ( !empty( $profileuser->first_name ) && !empty( $profileuser->last_name ) ) : ?>
    <option value=”<?php echo $profileuser->first_name.” “.$profileuser->last_name ?>”><?php echo $profileuser->first_name.” “.$profileuser->last_name ?></option>
    <option value=”<?php echo $profileuser->last_name.” “.$profileuser->first_name ?>”><?php echo $profileuser->last_name.” “.$profileuser->first_name ?></option>
    <?php endif; ?>
    </select></label></p>`
    Step 2 open your theme’s comment.php and add this:
    <a href="<?php bloginfo('wpurl'); ?>/?author_name=<?php comment_author(); ?>"><?php comment_author(); ?></a>

    platinum,

    youre not finding those files because you are using an ancient version of wordpress, that arguably shouldn’t even be supported on these forums.

    Rather than worrying about creating profile pages, why dont you upgrade, before someone comes along and hacks your totally insecure blog.

    Well whoami, maybe you tell me how to solve law1018’s problem. I am using 2.2 – honestly. And maybe you know a way by not modifying core files of WP, because I’ll probably have to update WP to the next version (which will delete my file-changes) immediately unless I’ll loose your support – like law1018.

    hello

    thanks whooami for your suggestion.

    Xenuan thanks for info but in Wp-Admin/user-edit.php and Wp-Admin/profile.php
    there are not this lines

    ‘<p><label><?php _e(‘Display name publicly as:’) ?>
    <select name=”display_name”>
    <option value=”<?php echo $profileuser->display_name; ?>”><?php echo $profileuser->display_name; ?></option>
    <option value=”<?php echo $profileuser->nickname ?>”><?php echo $profileuser->nickname ?></option>
    <option value=”<?php echo $profileuser->user_login ?>”><?php echo $profileuser->user_login ?></option>
    <?php if ( !empty( $profileuser->first_name ) ) : ?>
    <option value=”<?php echo $profileuser->first_name ?>”><?php echo $profileuser->first_name ?></option>
    <?php endif; ?>
    <?php if ( !empty( $profileuser->last_name ) ) : ?>
    <option value=”<?php echo $profileuser->last_name ?>”><?php echo $profileuser->last_name ?></option>
    <?php endif; ?>
    <?php if ( !empty( $profileuser->first_name ) && !empty( $profileuser->last_name ) ) : ?>
    <option value=”<?php echo $profileuser->first_name.” “.$profileuser->last_name ?>”><?php echo $profileuser->first_name.” “.$profileuser->last_name ?></option>
    <option value=”<?php echo $profileuser->last_name.” “.$profileuser->first_name ?>”><?php echo $profileuser->last_name.” “.$profileuser->first_name ?></option>
    <?php endif; ?>
    </select></label></p>’

    maybe because i use WP 1.5 (and not 2.0 version).

    there is another solution for WP 1.5?

    Well whoami, maybe you tell me how to solve law1018’s problem. I am using 2.2 – honestly. And maybe you know a way by not modifying core files of WP, because I’ll probably have to update WP to the next version (which will delete my file-changes) immediately unless I’ll loose your support – like law1018.

    snyderjoe,

    when youve explained what you want to do specifically, I’ll be happy to help if I can.

    As for your remarks about losing my support — whether platinum takes my advice or not — it was the very best advice he could recieve on these forums. He’s using a version of WP that is over a year old, and has any number of exploits available for it via a simple Google search.

    I can safely say that profile pages will be the least of his worries, should his blog be hacked. And im not talking about little hacks where a page is changed — Im talking about having the entire database destroyed.

    Secondly, I’m not the only volunteer on these forums — there are surely others that have no trouble or conscious about helping someone to continue to running obsolete, insecure software. I simply wont.

    whooami , i thanks you and you are right, but for me is not easy make upgrade because i made a lot of modifications in my code and now if i make upgrade then i make a lot of modifications… i know that it is better make upgrade πŸ™‚

    Whooami: I understand your concerns and you are absolutely right. But some people just dont have the time to have always the latest version and updating all changes they have made.
    So – as a newbie to WP – I try to avoid changing files that will be overwritten by future versions.
    I thought that there would be a built in possibility to display the user profiles as we are using WP as a collaboration tool too. Or is there any plugin for creating a sort of “my page” or “about me” that can be accesed easily by the users and is a little more structured than a normal post?
    thank you for your patients.

    Hey everybody! I have wordpress 2.1.3 and I took Xenuan’s suggestion and edited both my user-edit.php and profile.php . (I don’t mind getting down and dirty in the wordpress core. That’s what backup copies are for!) It works great… except for the fact that I have a plugin that is dependent on the profiles being called by author ID number instead of by username. This is the profile pics plugin I’m using. Basically this plugin allows for author profile pics. It names the pics with the Author ID number, so when you call the author profile by ID# it works fine, but when you call the author profile by username (as the Xenuan fix suggests) then the author picture doesn’t show up because it needs the ID number.
    I imagine I could go in and edit the plugin to name the images differently and look for the username rather than the ID. (Well I’ve actually tried this and can’t really figure out what I need to do to get it flowing). Because I am such an amateur at this, I have a few questions.
    First: What do I look for / change to edit the plugin?

    Second: Is there nothing that would call the comment author’s ID number? It seems like there should be something super simple to get this working like….

    ‘< a href=”<?php bloginfo(‘wpurl’); ?>/?author=<?php the_author_ID(); ?>”><?php comment_author(); ?>’
    (of course, as it is now it calls the post’s author ID rather than the comment author’s ID)

    If there was something that would let you call the comment author id (like say the_comment_author_id), it would really fix all of this without having to go in and edit the wordpress core. Somehow I have a feeling that it’s not going to be possible….
    Is this possible in 2.2 maybe? It might be worth an overhaul for that!

    Thanks for any help !

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Creating profile pages for registered users’ is closed to new replies.