PDA

View Full Version : Show Thread Enhancements - Profile Picture in Postbit


ndahiya
12-31-2009, 10:00 PM
This mod shows the user profile picture in the postbit template for all posters.

Ver 1.1 : Fix for profile pics stored in database. Just reimport the product.
Ver 1.0 : Original Release.

--
Installation: Just add the attached product xml file.
Uninstallation: Just remove the product.

Please Note:
If the pictures are stored in the filesystem, this mod checks that an profile picture exists by checking the user table's profilepicrevision field (>0 implies a pic exists (or at least existed)). Sometimes it will result in file not found error (no problem on the rendered page, but still an invalid image pull) if the user deletes their pic, but that can be updated by running this sql query periodically.

update user set profilepicrevision = 0 where user.userid not in (select userid from customprofilepic);




..
ndahiya

elwachiman
01-01-2010, 06:47 PM
Demo Please...tnks

ndahiya
01-01-2010, 06:54 PM
On my site, only logged in members can view the picture/details, so can't really demo it from that. You can install it and see. It does not change anything in your system, so can uninstall it just as easily.

garretbyrne
01-05-2010, 02:34 PM
I don't get it?? I've installed it but nothing has changed.. Where is this meant to show up?

Snug
01-05-2010, 05:06 PM
screenshot?

ndahiya
01-05-2010, 11:35 PM
I don't get it?? I've installed it but nothing has changed.. Where is this meant to show up?

hmm, can you try and change avatar storage type to filesystem and them check (you can revert back thereafter, it will work for sure)? i think i know where the problem might be, but just want to be sure before updating the code.

garretbyrne
01-06-2010, 05:37 AM
hmm, can you try and change avatar storage type to filesystem and them check (you can revert back thereafter, it will work for sure)? i think i know where the problem might be, but just want to be sure before updating the code.

Sorry man but how do i do that...? lol

kersti
01-06-2010, 09:16 AM
Why would I bother when there is custom avatars?

garretbyrne
01-06-2010, 10:49 AM
I think I'll leave this... Thanks anyway but I don't see a need at the moment for my site..

Thanks

ndahiya
01-06-2010, 09:45 PM
hmm, can you try and change avatar storage type to filesystem and them check (you can revert back thereafter, it will work for sure)? i think i know where the problem might be, but just want to be sure before updating the code.

Sorry man but how do i do that...? lol

AdminCP --> Avatars --> User Picture Storage Type to toggle the storage from db to filesystem


Why would I bother when there is custom avatars?

Because some people (like my site) do not use avatars but actual member pictures.

ndahiya
01-17-2010, 06:24 PM
v1.1 should take care of issue for profile pics stored in database....

Tyran1
01-18-2010, 04:35 PM
Who ist that for Version 3.8.4 ??

TNCclubman
01-18-2010, 04:39 PM
screenshot?

ndahiya
01-23-2010, 03:18 PM
screenshot per popular request...

ndahiya
01-23-2010, 03:19 PM
Who ist that for Version 3.8.4 ??

this is primarily for vb4, but should be relatively easy to mod for 3.8.4

oddmud
01-23-2010, 04:00 PM
ok, but isnt there an avatar already in the postbit?

moonclamp
01-23-2010, 09:05 PM
Does this resize the picture or does it just constrain the pixel dimensions?

ndahiya
01-24-2010, 12:26 AM
Does this resize the picture or does it just constrain the pixel dimensions?

it does not constraint pixel dimension any more than the default profile pic limit.

ndahiya
01-24-2010, 12:33 AM
ok, but isnt there an avatar already in the postbit?

if you use avatars, then this is not for you. my site uses profile pics and not avatars.

moonclamp
01-24-2010, 02:43 AM
it does not constraint pixel dimension any more than the default profile pic limit.
So if you have a large profile photo, you also get a large avatar?

What's the point of it then? You could just get rid of the profile photo option and rename 'avatar' in your language pack.

nomoreturn
01-24-2010, 01:00 PM
Thanks for nice mod i have a question can we change pic size because in my site pic's are geting out of posbit i attache a pic plz have a look thanks

ndahiya
01-24-2010, 01:17 PM
So if you have a large profile photo, you also get a large avatar?

What's the point of it then? You could just get rid of the profile photo option and rename 'avatar' in your language pack.

that is a good point... hmmm, i never did think of it. now to figure out how to do it (convery profile pic to avatars)...

ndahiya
01-24-2010, 01:22 PM
Thanks for nice mod i have a question can we change pic size because in my site pic's are geting out of posbit i attache a pic plz have a look thanks

you can edit the xml file to specify the max dimensions in the img tag.... look for this code:

$template_hook['postbit_userinfo_right_after_posts'] .= '<dd> <img src=' . $post[profileurl] . ' ></dd>';

nomoreturn
01-30-2010, 03:46 PM
you can edit the xml file to specify the max dimensions in the img tag.... look for this code:

$template_hook['postbit_userinfo_right_after_posts'] .= '<dd> <img src=' . $post[profileurl] . ' ></dd>';


Thanks solved my problem with this thanks for help
$template_hook['postbit_userinfo_right_after_posts'] .= '<dd> <img height="200" width="170"
src=' . $post[profileurl] . ' ></dd>';

Fusion2
10-19-2010, 08:44 PM
Was easy to install, and looks great!

It would be cool if you could also choose where in Postbit to display the image. The avatar is displayed above user info, but your picture mod displays the image below the user info. Would be awesome if you could have an option to post above or below.

Fusion2
10-22-2010, 06:21 PM
I upgraded to 4.08 and now this add-on doesnt work. Any ideas?

ndahiya
08-07-2011, 01:53 AM
this is still working for me as of 4.1.5

Tyran1
05-08-2013, 02:57 PM
Works fine on 3.8.7 !! Thanks!

M.C.
05-24-2013, 01:43 PM
if you use avatars, then this is not for you. my site uses profile pics and not avatars.

hmmm sorry to hear that... may be we can do condiotion?

IF user has avatar -> show avatar
ELSE -> IF user has profilepicture -> show profilepicture

So here it is my fix.

1. change in plugin Profile Pic in Postbit (AdminCP => Plugin Manager => Profile Pic in Postbit => Edit):
$template_hook['postbit_userinfo_right_after_posts'] .= '<dd> <img src=' . $post[profileurl] . ' ></dd>';
to
$template_hook['postbit_userinfo_avatar'] .= '<dd> <center><img src=' . $post[profileurl] . ' style="max-width:150px;"></center></dd>';

2. in template Postbit_Legacy (or Postbit if you do not use legacy layout) change:
<vb:if condition="$show['avatar']">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
</vb:if>
to:
<vb:if condition="$show['avatar']">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
<vb:else />
{vb:raw template_hook.postbit_userinfo_avatar}
</vb:if>

Done ;)