This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Login System Avatar
#11

Steve, I've got your point.

But I meant something different.

It is okay to use both

PHP Code:
<?php 
$cmtx_box
.= "<img src='http://www.gravatar.com/avatar/" . md5(strtolower(trim($email))) . ".png?s=71" . $gravatar_parameter . "' alt='Gravatar' title='Gravatar'/>";

and

PHP Code:
<?php 
$cmtx_box
.= '<img src="' . MM_UPLOADPATH . 'gravatar.png' . '" alt="Gravatar Picture" />';

Both variants works great.

I meant if user delete his avatar from his profile page then script must show gravatar default image but it shows only path to image folder where images are located.

So there are three variants:

1) When user uploaded his avatar the url looks like this for instance: http://artyhoney.com/img/profile-images/avatar_108.jpg

2)When user delete his avatar the url must look like http://artyhoney.com/img/profile-images/gravatar.png
or
http://www.gravatar.com/avatar/4adcca49b...0&r=g&d=mm

Both variants works as I explained

So instead of showing this URL it shows http://artyhoney.com/img/profile-images/ and that it...


Attached Files Thumbnail(s)
       
Reply
#12

You could check whether $old_picture has a value before trying to use it:

PHP Code:
<?php 
$old_picture
= $row['picture'];

if (!empty(
$old_picture)) {
$cmtx_box .= '<img src="' . MM_UPLOADPATH . $old_picture . '" alt="Profile Picture" />'; // User has a profile picture so display it
} else {
$cmtx_box .= "<img src='http://www.gravatar.com/avatar/" . md5(strtolower(trim($email))) . ".png?s=71" . $gravatar_parameter . "' alt='Gravatar' title='Gravatar'/>"; // User does not have a profile picture so display Gravatar
}

Have you completed the interview?
Reply
#13

Yeah...

This works.

Cheers!
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by drwx
29-Jun-2023, 09:34 AM
Last Post by Carluti
09-Jan-2016, 04:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)