Nice one, but let me suggest an optimization (this is how I did it some weeks ago):
In showthread.php FIND
PHP Code:
post_parsed.pagetext_html, post_parsed.hasimages,
BELOW that ADD
PHP Code:
NOT ISNULL(customprofilepic.userid) AS haspic,
Further down in showthread.php FIND
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid = post.postid)
BELOW that ADD
PHP Code:
LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON(customprofilepic.userid=post.userid)
And use this template modification:
In template postbit FIND
PHP Code:
$post[onlinestatus]
BELOW that ADD
PHP Code:
<if condition="$post['haspic']"><img src="/photo.gif" border=0 alt="Photo in Profile!"></if>
That's it. This way you don't have to alter table user, file profile.php and functions_showthread.php.
You also might want to extend this for single post display and PM