Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Way to call member profile image with php?

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › Way to call member profile image with php?

  • This topic has 1 reply, 1 voice, and was last updated 14 years, 11 months ago by jeffw.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 18, 2010 at 9:29 pm #1516
    jeffw
    Member

    Hi… as the title suggests, I’m trying to use each member’s profile image in the comments_template.php.

    So far, I have this… for some reason, the file_exists wasn’t working, and I’m currently at this ghetto solution:

    $user_info = get_userdata($comment->user_id);

    $em = $comment->user_id + 4;

    if($comment->user_id<50000000) {

    echo ‘<img class=”emem_profile_image” src=”http://www.mmocheatsplus.com/wp-content/uploads/emember/&#8217; . $em . ‘.jpeg” width=64 height=64 />’;

    }

    else {

    echo ‘<img class=”emem_profile_image” src=”http://www.mmocheatsplus.com/wp-content/plugins/wp-eMember/images/default_image.gif&#8221; width=64 height=64 />’;

    }

    But as you could have guessed, the else is never firing because everyones user id is less then that huge number… I just had to put some sort of conditional to keep this same idea of code, even though I know it’s not necessary.

    Like I said above, for some reason the file_exists isn’t checking properly, and I couldn’t find a solution on the internet. I must have tried this 5+ times, all making sure there weren’t any typos. I even did absolute paths, and it wasn’t finding a file that was for sure there.

    The original code I got from the emember_misc_functions.php file where it uses code to check for existance of the actual emember user id and if it has a .gif, .jpg, etc, then use that url for the image to display in the profile.

    Like I said, mine is a makeshift version of that, and I even used a simple +4 addition to the commenters WordPress user ID, since through testing, my user IDs and WP ids are off by 4.

    Anyways… is there a simple way to properly call the profile image, and if the user hasn’t uploaded one, display the default?

    Thanks.

    July 18, 2010 at 11:02 pm #22560
    jeffw
    Member

    Nevermind… I found a solution that uses the old code and all is well in the world again.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ