WordPress.org

Ready to get started?Download WordPress

Forums

Storing User Info (17 posts)

  1. bk
    Member
    Posted 8 years ago #

    How do you make it so in when people post comments, their name, email address, and website is stored for them so they don't have to type it in again?

  2. Kafkaesqui

    Posted 8 years ago #

    Two possibilities:

    1. If they have cookies turned on in their browser, you shouldn't need to do anything for them. WordPress sets these in its cookie file the first time they comment on your site.

    2. Get them to register and login before commenting, as this info can be passed to the comment form.

  3. bk
    Member
    Posted 8 years ago #

    Sorry, should've explained it better.
    I meant that it stores the information for the people, and it doesn't displays "Welcome Kafkaesqui" and beside it a "Change" link for changing it and just message field/box.

    Do you know what I mean?

  4. bk
    Member
    Posted 8 years ago #

    Anyone?

  5. Joshua Sigar
    Member
    Posted 8 years ago #

    I don't know what you meant. I thought Kafkaesqui's anwer already covered it.

  6. Kafkaesqui

    Posted 8 years ago #

    "[I]t doesn't displays "Welcome Kafkaesqui" and beside it a "Change" link for changing it and just message field/box."

    You can duplicate the functionality found in the default theme's comments.php that would let you set up something like this for users who are logged in; there's some testing that occurs on $user_ID in that template. Beyond this I'm not sure about what you're looking for.

  7. bk
    Member
    Posted 8 years ago #

    Sorry for the late reply. I mean something like this.

    Any ideas?

    Cheers.

  8. moshu
    Member
    Posted 8 years ago #

    What you show on the image is not a WP thing. It seems to be some kind of "chatting" plugin or whatever added.
    First, you should have clarify that in your original post; secondly ask about it at its author's site.

  9. bk
    Member
    Posted 8 years ago #

    Moshu, it's from K2. I didn't ask Michael about this since he said that all WP related questions should go here?

    I'll see if I should mail him.

    Cheers.

  10. moshu
    Member
    Posted 8 years ago #

    K2 is not WP. I think... but I am often wrong :)

  11. bk
    Member
    Posted 8 years ago #

    Can you use ScriptyGoddess Show/Hide plugin for this?

  12. tedfox
    Member
    Posted 8 years ago #

    <?php if ( $user_ID ) : ?>

    Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a>

    That displays

    "Logged in as TedFox. Logout »"

    I'm sure u can change the specifics as needed easily.
    No need for plugins, but only works if person commenting is registered

  13. bk
    Member
    Posted 8 years ago #

    Tedfox, I know that. But I needed something like this. So when people come the next time to post comments, it doesn't show them the name, email, website fields since it's already stored.

    Thanks for the reply though. :)

  14. Kafkaesqui

    Posted 8 years ago #

    bk, that's pretty much what tedfox just showed.

    As I noted above, the default theme's comments.php does what you're asking. Just copy the comment form element from that and modify to suit your needs (such as changing the text to say Welcome back ...).

  15. bk
    Member
    Posted 8 years ago #

    But won't the users have to register, so it says "Logout Name"?

  16. Kafkaesqui

    Posted 8 years ago #

    Yes, they would. It would have helped if you had specified this was not what you were after...

    http://paste.uni.cc/7623

    The above is a mod of the default theme's comments.php template. It does not include the "change" link feature. For that you'd have to set up a php script, or some javascript, that would clear/reset the comment author cookies.

  17. bk
    Member
    Posted 8 years ago #

    Yeah, I found a Javascript but trying to figure out how to use it. Thanks for your help. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.