WordPress.org

Ready to get started?Download WordPress

Forums

Get Authors Profile Page (42 posts)

  1. JoeyE
    Member
    Posted 8 years ago #

    Well, I have managed to "activate" the MSN & ICQ and even added a field for an AVATAR URL. And it works fine however, I fudged somewhere or I am not understanding something:

    I now can't delete entirely a profile field. For example, if I have something in my YIM field then decide to delete it completely and leave a blank field and then update my profile it will still be there. HOWEVER, I CAN modify the entry and type in 'n/a' or whatever and it will update it that way. It just won't allow an empty field... odd.

    Soooo, at least I got it to this point. Now to figure out the empty field bit.

    As for the memb last visit thing, I would favor to say that it would probably be best if that were in a plugin. I can try to include that in my hack but the way my profile code is turning out-- it's looking pretty damn ugly. :) But it its working... kinda. ;)

  2. Can
    Member
    Posted 8 years ago #

    Oh, that's great, Joey. I do hope you'll be able to fix that problem. I'll be looking forward to that member's last visit field added somewhere in the author profile page. Good luck!

    Anyway, I'll still keep looking for this plugin. I really want to have a members list where the last visit can be found.

  3. CounterDax
    Member
    Posted 8 years ago #

    @JoeE: the thing where you're unable to remove the data seems to be a WP bug... I tested it myself but I was unable to remove these fields to. Let me check whether this is already posted in the bug-list.

    Anyway, how did you activate MSN and ICQ? You added the fields to the DB or something?

  4. JoeyE
    Member
    Posted 8 years ago #

    Like I mentioned before, this is kinda of an band-aid ugly fix. I'm sure some of these WP gurus would probably tell me that this is way wrong. However, it did work for me.

    Make BACKUP FILES!!!
    /wp-admin/profile.php
    Locate:

    <label><?php _e('Jabber / Google Talk:') ?>
    <input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" />
    </label>

    Post after:

    <label><?php _e('MSN:') ?>
    <input type="text" name="msn" value="<?php echo $profileuser->msn ?>" />
    </label>


    <label><?php _e('ICQ:') ?>
    <input type="text" name="icq" value="<?php echo $profileuser->icq ?>" />
    </label>

    /wp-admin/admin-functions.php
    Locate:

    if (isset ($_POST['yim']))
    $user->yim = wp_specialchars(trim($_POST['yim']));

    Post after:

    if (isset ($_POST['icq']))
    $user->icq = wp_specialchars(trim($_POST['icq']));
    if (isset ($_POST['msn']))
    $user->msn = wp_specialchars(trim($_POST['msn']));

    /wp-includes/registration-functions.php
    Locate:

    update_usermeta( $user_id, 'yim', $yim );

    Post after:

    update_usermeta( $user_id, 'msn', $msn );
    update_usermeta( $user_id, 'icq', $icq );

    /wp-content/themes/myTheme/author.php
    I just put this in my author page to display the msn. Just change the value for icq, etc.

    <?php echo $curauth->msn; ?>

    Nothing was adjusted on my Db. I believe that things like the icq, msn, etc. are stored through metadata keys. Like I said before... it just worked for me this way. I didn't say I totally understood what I did.. heheh.

    I wish they could just make an admin option to have those messenger fields active/deactive and add a way for custom profile fields that would dynamically add template tags. (wishful thinking)

    Anyway, I don't think I messed with anything else. Hopefully it will work for you too.

  5. CounterDax
    Member
    Posted 8 years ago #

    @ JoeyE:
    Thanks! I will try this when I've got time.
    Anyway, I found many user profile page bug tickets, but not one refering to this problem we both encountered (the removal of contact info), so I added a new ticket to the ticket DB on trax.wordpress.org. Someone will pick up on this in the end (unfortunately, I'm not good enough in PHP to help them out: I'm a nitwit when it comes to PHP, except for some simple elements)

    FOR THE REST OF THE READERS:
    Just to make sure people do not break the layout, you should not forget the p tags:

    And for people who only want to show something if there's actually info stored in the contact info (in your template file):

    <?php if(!empty($curauth->msn) {
    echo $curauth->msn;
    } ?>

    To cover for the inability to delete the contact information, I've added the following code for each of the options:

    <?php if (!empty($curauth->user_url) && $curauth->user_url != 'x') {
    echo $curauth->user_url;
    } ?>

    So, if I add an 'x' in the input field, the template will consider the field to be empty.

  6. JoeyE
    Member
    Posted 8 years ago #

    Cool addition, Dax!! Thanks for adding that.

  7. JoeyE
    Member
    Posted 8 years ago #

    Wow, ask and you just may recieve:

    I just saw this new plugin: http://wordpress.org/support/topic/45124?replies=9 it may be exactly what I need/want. I'm going to d/l it and test it.

  8. JoeyE
    Member
    Posted 8 years ago #

    Hmm... apparently it is not fully compatible with WP2.0 quite yet. I tried to use it but it gave me errors.

  9. Can
    Member
    Posted 8 years ago #

    Oh, that's just too bad, Joey. I just posted on that thread. Still can't find that plugin I've been looking everywhere for. Do you think you can add the date of a member's last visit to this profile page?

  10. CounterDax
    Member
    Posted 8 years ago #

    By the way, Joey, your mod of the code works like a charm! Thanks for that!

  11. JoeyE
    Member
    Posted 8 years ago #

    whew! that's good to know; thanks for testing that. now all i gotta do is understand what i did! hahah

  12. blazin6543
    Member
    Posted 7 years ago #

    i just edited the pages, seems to be ok. except you didnt mention to edit "wp-admin/user-edit.php" (so the user or admin can edit the fields) unless i missed it somewhere

Topic Closed

This topic has been closed to new replies.

About this Topic