I tried your code and the main problem was in the
if part:
if (empty(userphoto($curauth)))...
First, your
userphoto function SHOULD not print/echo value, but only return path to user image.
Second, you need to
assign return value from userphoto($curauth) function call into variable!
Third, you are
missing semicolons after
echo and
userphoto function calls.
Check my updated code:
<?php
function userphoto($_) {
return null;
}
$photo = userphoto($curauth);
if (empty($photo))
{
$photo = 'http://localhost/wordpress/wp-content/uploads/2013/01/NoImage.png';
}
echo "<img src='{$photo}' />";
?>