Version: 1.00, by TechGuy
Developer Last Online: Aug 2015
Version: 3.0.1
Rating:
Released: 04-07-2004
Last Update: Never
Installs: 20
No support by the author.
What does this do?
Basically, when viewing a thread, if a user has a Profile Picture, it will show a camera icon (or whatever picture you choose) next to his/her online status icon. For example:
Updates!
July 1, 2004: I finally got around to re-writting this a bit so that you don't have a query for every post in every thread. However, after you install this, you'll notice that the first time you view a thread there will be a ton of queries. That will happen until we've essentially cached each user's "haspic" status in the user table... meaning that, in the end, this should be a lot nicer than the last version.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
You can do this without any queries whatsoever. There's another hack somewhere that does the same without a query - just add the variable to an existing query.
I don't know how to do anything with no queries... ? But, I'm no expert. The only way I can think to do this with only one query would be to add a field to the user table, but I didn't want to worry with those who have already uploaded a pic, though it'd certainly be possible. Maybe I'll play around with it a bit.
You can do this without any queries whatsoever. There's another hack somewhere that does the same without a query - just add the variable to an existing query.
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
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 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
Do we need to do this in the posts AND the caheposts queries?