PDA

View Full Version : Private Messages Enhancements - Sender Avatar In Private Message List


.Tim
24 Sep 2006, 08:37
I've seen a few requests for it and wanted it myself, I spent a lot of time on it and then realized I wasted a lot of time and it was actually quite simple. Now this works whether you store your avatars in the filesystem or database.

Upload the plugin. Then:

In your pm_messagelistbit template find:

<if condition="$show['pmicons']"><td class="alt2"><if condition="$show['pmicon']"><img src="$pm[iconpath]" alt="$pm[icontitle]" /><else />&nbsp;</if></td></if>

And replace it with:

<if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if> </if>


You'll be replacing the post icon that shows up between the status icon and the message itself.

If your board allows users to not have an avatar and you're getting red x's on some, do this:
http://www.vbulletin.org/forum/showpost.php?p=1083541&postcount=26

Credit to:
TruthElixirX, Tralala, nevetS and Lionel
For their help. Thanks.

PS This hack is compatible with 3.7

SnickersTK
24 Sep 2006, 09:22
very nice idea! gonna install this!

ForumDog
24 Sep 2006, 10:57
This won't work if you have avatars in the filesystem. :)

MediaHound
24 Sep 2006, 14:13
/clicks subscribe to thread

.Tim
24 Sep 2006, 14:24
This won't work if you have avatars in the filesystem. :)

Oh, well then I'll need to look into that!:confused:

trackpads
24 Sep 2006, 16:15
Excellent work!! Thanks!

giggity giggity

Lionel
24 Sep 2006, 16:44
I really like this idea. I wish it could be used with the filesystem.

kersti
24 Sep 2006, 18:17
Probably a stupid question but... how do we change the avatars from the filesystem...

.Tim
24 Sep 2006, 18:21
Probably a stupid question but... how do we change the avatars from the filesystem...

Admincp > Avatars > User Picture Storage Type

Lionel
24 Sep 2006, 22:57
i managed to use the filesystem

.Tim
24 Sep 2006, 23:04
How did you do that?

Selene
25 Sep 2006, 02:53
yes lionel how did u do that can u please tell us what to modify

Lionel
25 Sep 2006, 03:02
I created a plugin

hook location: private_messagelist_messagebit

I named it: Avatar in PM

plugin content

if ($vbulletin->userinfo['avatarid'])
{
$avatar = $db->query_first("SELECT user.avatarid,avatar.avatarpath as avatarpath
FROM " . TABLE_PREFIX . "user
LEFT JOIN " . TABLE_PREFIX . "avatar as avatar on (user.avatarid=avatar.avatarid)
WHERE userid = '$userid'");
if ($avatar[avatarpath ]!=''){
$pmavatar = "<img width=\"30\" height=\"30\" src=\"" . $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"avatar\" border=\"0\" />";
}else
{
if ($avatar = $db->query_first("SELECT dateline, userid FROM " . TABLE_PREFIX . "customavatar WHERE userid = '$userid'"))
{

$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" . $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" . $vbulletin->userinfo[avatarrevision] . ".gif" : "" . $vbulletin->options[bburl] . "/image.php?u=" . $userid . "&amp;dateline=" . $avatar['dateline'] . "";
$pmavatar = "<img width=\"30\" height=\"30\" src=\"$navbaravatarurl\" alt=\"avatar\" border=\"0\" />";
}
else
{

$pmavatar = "<img width=\"30\" height=\"30\" src=\"$stylevar[imgdir_misc]/noavatar.gif\" alt=\"avatar\" border=\"0\" />";
}
}
}

and I put $pmavatar in template at the location indicated in this hack

Shazz
25 Sep 2006, 03:03
Thats just for file system? Mmmm..
Anyway *clicks install

.Tim
25 Sep 2006, 03:15
I created a plugin

hook location: private_messagelist_messagebit

I named it: Avatar in PM

plugin content

if ($vbulletin->userinfo['avatarid'])
{
$avatar = $db->query_first("SELECT user.avatarid,avatar.avatarpath as avatarpath
FROM " . TABLE_PREFIX . "user
LEFT JOIN " . TABLE_PREFIX . "avatar as avatar on (user.avatarid=avatar.avatarid)
WHERE userid = '$userid'");
if ($avatar[avatarpath ]!=''){
$pmavatar = "<img width=\"30\" height=\"30\" src=\"" . $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"avatar\" border=\"0\" />";
}else
{
if ($avatar = $db->query_first("SELECT dateline, userid FROM " . TABLE_PREFIX . "customavatar WHERE userid = '$userid'"))
{

$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" . $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" . $vbulletin->userinfo[avatarrevision] . ".gif" : "" . $vbulletin->options[bburl] . "/image.php?u=" . $userid . "&amp;dateline=" . $avatar['dateline'] . "";
$pmavatar = "<img width=\"30\" height=\"30\" src=\"$navbaravatarurl\" alt=\"avatar\" border=\"0\" />";
}
else
{

$pmavatar = "<img width=\"30\" height=\"30\" src=\"$stylevar[imgdir_misc]/noavatar.gif\" alt=\"avatar\" border=\"0\" />";
}
}
}

and I put $pmavatar in template at the location indicated in this hack


Weird, that didn't work for me on my test board. Oh well, I'm working on a universal way that works with either method.

nevetS
25 Sep 2006, 09:03
I created a much simpler plugin... Wow Lionel!

$sk_avurl = fetch_avatar_url($userid);

and then in the template:

<img src="$sk_avurl[0]" />

plugin gets attached to private_messagelist_messagebit.

A quick hack, but it seems to work for me.

Paul M
25 Sep 2006, 10:01
You may need to add a require ;

require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($userid);

Selene
25 Sep 2006, 10:50
thanks problem solved

Selene
25 Sep 2006, 10:56
I created a much simpler plugin... Wow Lionel!

$sk_avurl = fetch_avatar_url($userid);

and then in the template:

<img src="$sk_avurl[0]" />

plugin gets attached to private_messagelist_messagebit.

A quick hack, but it seems to work for me.


cool that works, but just one problem. Those who dont have an avator, they get that no image pic with cross which looks ugly. Any way to get rid of that? so that members without avator are left out with no avator in the pm display.

here is what i mean:

http://img174.imageshack.us/img174/9894/pmvj1.gif

Lionel
25 Sep 2006, 11:14
You may need to add a require ;

require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($userid);

definitely more elegant than mine :-)

nevetS
25 Sep 2006, 18:40
functions_user.php is already included in private.php

to resolve the missing image problem... maybe something like...

<if condition="$sk_avatar"></if>

or maybe even make the variable in the plugin the whole tag, so if it's null, nothing gets printed.

.Tim
25 Sep 2006, 23:36
Thanks guys. That code works both ways, with filesystem and database. So I've updated the code. Thanks again for your help. :D

Gripemaster
25 Sep 2006, 23:44
*INSTALLED* Very cool!

Shazz
26 Sep 2006, 00:19
Installed*

Shazz
26 Sep 2006, 00:22
Now i just got the Red X's and i didn't before :(

xman_79
26 Sep 2006, 00:54
My solution is :
Replace in pm_messagelistbit template :
<if condition="$show['pmicons']"><td class="alt2"><if condition="$show['pmicon']"><img src="$pm[iconpath]" alt="$pm[icontitle]" /><else />&nbsp;</if></td></if>

with

<if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="80" /></td><else /><td class="alt2" width="80"><img src="images/no_avatar.jpg" width="80" border="0" /></if></td></if>


Create a image :
Width 80 and height 80
name : no_avatar.jpg
location : vb/images

and result :
https://www.vbulletin.org/forum/external/2007/02/26.jpg

Shazz
26 Sep 2006, 01:18
My solution is :
Replace in pm_messagelistbit template :
<if condition="$show['pmicons']"><td class="alt2"><if condition="$show['pmicon']"><img src="$pm[iconpath]" alt="$pm[icontitle]" /><else />&nbsp;</if></td></if>

with

<if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="80" /></td><else /><td class="alt2" width="80"><img src="images/no_avatar.jpg" width="80" border="0" /></if></td></if>


Create a image :
Width 80 and height 80
name : no_avatar.jpg
location : vb/images

and result :
https://www.vbulletin.org/forum/external/2007/02/26.jpg
Genious!

Trana
26 Sep 2006, 04:04
Nice one.

xman_79
26 Sep 2006, 23:26
Genious!

Thank u and welcome .

Jeordie015
27 Sep 2006, 02:48
It messed up my layout. I'm running vB3.6.0. It looks like it took out a column or something. I'm not sure how to fix it though. See screenshot.

.Tim
27 Sep 2006, 03:45
I need to see a screenshot of a larger area.

apdcanari
27 Sep 2006, 06:47
3.5 please ?

.Tim
27 Sep 2006, 19:25
It should work for 3.5 if not I'll mess around with it later.

.Tim
27 Sep 2006, 23:33
Okay, just tested it and the plugin does NOT work in 3.5, I'll mess around with it and see if I can get something working.

G_Man
21 Oct 2006, 02:51
Works a Treat. Thanks .Tim!

I changed the template edit to limit the height and center the Avatars, since I allow some of my users to have 150px+ avatars.

Love it though. :)

Trana
29 Oct 2006, 22:58
Anybody else getting this error message:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = cc;

MySQL Error : Unknown column 'cc' in 'where clause'

G_Man
30 Oct 2006, 01:02
Anybody else getting this error message:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = cc;

MySQL Error : Unknown column 'cc' in 'where clause'

Yep. I had one user get this. Had to empty her Sent Messages and have not had a problem since. Didn't say anything here as I could not pinpoint the problem.

Shazz
30 Oct 2006, 01:03
Never got it =\

Trana
02 Dec 2006, 18:59
Yep. I had one user get this. Had to empty her Sent Messages and have not had a problem since. Didn't say anything here as I could not pinpoint the problem.

I think I pinned this down. This error seems to appear every time a user goes to the second page of their PM inbox.

I don't know how to fix it at the moment, but it does seem to be repeatable.

G_Man
04 Dec 2006, 02:18
I think I pinned this down. This error seems to appear every time a user goes to the second page of their PM inbox.

I don't know how to fix it at the moment, but it does seem to be repeatable.

Well, I am curious about what you come up with.

I suppose I could just limit everyone to 5 PMs!! LOL :p

Seriously though, I haven't had it happen again, but a fix would be greatly appreciated.

Skedoozy
16 Jan 2007, 21:29
Yeah, I've been getting that same error. I'll ask people to delete their sent folders if they get the error for now, but a fix would be great!

Skedoozy
16 Jan 2007, 21:51
I myself have never encountered this problem. Could it be people getting too close to their limit?

marcsmith73
28 Jan 2007, 18:03
All i get is squares, and res x's in my Pm box

TheBlackPoet
29 Jan 2007, 11:43
good one.. installed...

marcsmith73
01 Feb 2007, 13:30
Anyone? About the red x's in my pm list?

.Tim
01 Feb 2007, 23:32
I have no idea, check and make sure you've done all the steps correctly. I haven't had that problem.

TruthElixirX
04 Feb 2007, 18:50
I seem to be encountering a strange problem. If a user goes to their User CP and sees the private message bit (if the PM is brand new and unread), the avatars don't show up. I'm not sure why.

I tried duplicating the plug-in that is used in private_messagelist_messagebit and put it in usercp_pmbit.

When I do this, and refresh the page that has a private message on it says


Database error in vBulletin 3.6.4:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid =;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6
Error Number : 1064
Date : Sunday, February 4th 2007 @ 10:45:48 AM
Script : http://********/forums/usercp.php
Referrer : http://********/forums/private.php?do=newpm
IP Address : 71.30.147.158
Username : AdminTest
Classname : vb_database



Here is a screenshot of what I mean (ignore the header at the top, it was already fixed.)

marcsmith73
05 Feb 2007, 02:26
Parse error: syntax error, unexpected '<' in /home/salthub/public_html/private.php(1678) : eval()'d code on line 1


I have loaded ...loaded again,...again....I get this in my Pm list. Along with no avatar pics, and red X's Now I know I am not retarded! WTF!

TruthElixirX
06 Feb 2007, 02:18
Parse error: syntax error, unexpected '<' in /home/salthub/public_html/private.php(1678) : eval()'d code on line 1


I have loaded ...loaded again,...again....I get this in my Pm list. Along with no avatar pics, and red X's Now I know I am not retarded! WTF!

I think you stuck an extra "<" in your template edit. Double check.

mamashid
06 Feb 2007, 16:23
I want to put this hack on my board, i tried all you all stated to do and i get the red X's if I dont get a red X then I get my wording up above and then my red X boxes down below the boxes...please help! I so would love to use this hack! what a great idea it was

mamashid
06 Feb 2007, 20:25
My solution is :
Replace in pm_messagelistbit template :
<if condition="$show['pmicons']"><td class="alt2"><if condition="$show['pmicon']"><img src="$pm[iconpath]" alt="$pm[icontitle]" /><else />&nbsp;</if></td></if>

with

<if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="80" /></td><else /><td class="alt2" width="80"><img src="images/no_avatar.jpg" width="80" border="0" /></if></td></if>


Create a image :
Width 80 and height 80
name : no_avatar.jpg
location : vb/images

and result :
http://www.vbulletin.org/forum/attachment.php?attachmentid=53939&stc=1&d=1159228459

Still the X, what else can I do?

Tralala
11 Feb 2007, 23:01
I seem to be encountering a strange problem. If a user goes to their User CP and sees the private message bit (if the PM is brand new and unread), the avatars don't show up. I'm not sure why.

Here is a screenshot of what I mean (ignore the header at the top, it was already fixed.)

Likewise, when I apply the edit offered up here (http://www.vbulletin.org/forum/showpost.php?p=1083556&postcount=27), in order to use the "noavatar.gif" graphic for members that have no avatar, I get that graphic in the private message bit of the UserCP, even if the sender does, in fact, have an avatar:

https://www.vbulletin.org/forum/external/2007/02/16.jpg
This tells me that it should work properly. I just would rather have it show the sender's actual avatar in that spot, not a blank space, or worse, this "noavatar.gif" graphic.

I tried duplicating the plug-in that is used in private_messagelist_messagebit and put it in usercp_pmbit.

I did the same, and now see an avatar... but it's not the correct avatar from the sender. It's the avatar of a completely different forum member. Color me confused (and stumped.)

Tralala
16 Feb 2007, 17:56
https://www.vbulletin.org/forum/external/2007/02/16.jpg
This tells me that it should work properly. I just would rather have it show the sender's actual avatar in that spot, not a blank space, or worse, this "noavatar.gif" graphic.


At the very least I'd like to remove the avatar field from the "new PM" in the UserCP view entirely.

It kinda sucks that enabling it for the Private Messages page also makes it appear here, and that it appears incorrectly to boot. Looks great in the PM box, though. So, any clues on separating these two so it doesn't look so wrong/bad in the UserCP?

Trana
17 Feb 2007, 07:01
Some of my users still receive the following error message when viewing their PMs:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = cc;

MySQL Error : Unknown column 'cc' in 'where clause'

Any ideas?

anywares
18 Feb 2007, 14:53
Does this work on vB 3.6.4?

.Tim
18 Feb 2007, 16:05
Yes.

Tralala
18 Feb 2007, 17:13
Yes.


Tim, any response as to how to fix the issue of a blank, wrong, or broken image showing up as avatar in the private message bit of UserCP, when using this add-on? TruthElixirX and I have been discussing it in the last few posts.

.Tim
18 Feb 2007, 17:33
I honestly have no idea. I haven't experienced those problems on either board I'm using this on. Sorry. I'll post in here if I have a break through and come up with something though.

Tralala
18 Feb 2007, 18:12
Thanks, .Tim, that's about all I can ask. :up:

For the record, I'm experiencing this on a pretty clean install of vBulletin 3.6.4, using the built-in vBulletin skin. If you'd like to investigate by checking out my forum, just let me know and I can PM you a login.

In the meantime I'm going to have to explore turning off the private message bit of UserCP entirely, which obviously is a bummer.

Thanks for the consideration though, and for sharing this otherwise-very-cool hack.

Reeve of shinra
19 Feb 2007, 16:31
nice hack!

TruthElixirX
13 Mar 2007, 01:46
Me and Tralala fixed the problem we were having.

We changed


<td class="alt2"><img src="$sk_avurl[0]" width="80" /></td>


to

<if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if> </if>

Shazz
13 Mar 2007, 01:51
Me and Tralala fixed the problem we were having.

We changed


<td class="alt2"><img src="$sk_avurl[0]" width="80" /></td>


to

<if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if> </if>


What does this fix?

Tralala
13 Mar 2007, 02:38
What does this fix?


Read above... the avatar wasn't showing up properly in the private message bit of the UserCP (where a PM section shows up inside the UserCP page when a PM is brand new and unread.)

It either showed an empty square, or "noavatar.gif" (when the sender did in fact have an avatar,) ...and with an attempt at a plug-in tweak, showed the wrong avatar. We couldn't get it to just show the correct avatar in that spot.

The "fix" above removes the graphic entirely from that private message bit inside the UserCP. So while it's not a perfect fix, at least the bug doesn't stand out with an incorrect graphic.

Good enough for me. :)

Shazz
13 Mar 2007, 02:39
Oh, I had that fixed a long time ago lol.
But nice info to know

Tralala
13 Mar 2007, 05:40
Oh, I had that fixed a long time ago lol.
But nice info to know


Fixed how? To show the accurate avatar? Or to remove it entirely from that bit in the UserCP? Just curious to know how you went about it.

.Tim
15 Mar 2007, 02:03
Me and Tralala fixed the problem we were having.

We changed


<td class="alt2"><img src="$sk_avurl[0]" width="80" /></td>


to

<if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if> </if>

Glad you were able to find a fix, instructions have been updated with the new code. Thanks for your help.:up:

Trana
24 Mar 2007, 00:04
Did anyone ever fix this problem:

Database error in vBulletin 3.6.4:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = cc;

MySQL Error : Unknown column 'cc' in 'where clause'

DiSpy
24 Mar 2007, 22:28
I fixed the problem I was having...

You have to goto "vBulletin Options -> Private Messaging Options" and make sure "Allow Message Icons for Private Messages" is set to "yes".

(DUH!) --;;

.Tim
25 Mar 2007, 02:17
Did anyone ever fix this problem:

Database error in vBulletin 3.6.4:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = cc;

MySQL Error : Unknown column 'cc' in 'where clause'

I wish I could help but mysql is not my strong point.:(

Tralala
25 Mar 2007, 04:30
I fixed the problem I was having...

You have to goto "vBulletin Options -> Private Messaging Options" and make sure "Allow Message Icons for Private Messages" is set to "yes".

(DUH!) --;;

I see this is your first post in the thread.

What is the problem you were having? (Just in case it may help future readers.)

DiSpy
29 Mar 2007, 15:12
The columns were breaking. It turned out to be just a matter of the fact that I didn't have that column turned on in the options.

Trana
07 Sep 2007, 19:13
Did anyone ever fix this problem:

Database error in vBulletin 3.6.4:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid = cc;

MySQL Error : Unknown column 'cc' in 'where clause'

Can anyone help me fix this issue? I think it started when I upgraded to 3.6x and VB included the option to cc people. It happens to random users based on them receiving or sending a message. The only way I can seem to fix it is by clearing all their PMs, which is really a pain!

Please let me know if you can help.

Thanks.

Trana
12 Sep 2007, 00:16
Can anyone confirm that they have this working on 3.6.8 with cc:ed users?

.Tim
12 Sep 2007, 02:48
I have 3.6.8 and am using it and I can't duplicate your problem. Sorry.

JadedSouls
19 Sep 2007, 23:37
Love it!! Great hack :)

yoyoyoyo
30 Oct 2007, 06:35
I can't get this to work - I started at the beginning of the thread and worked my way through and no luck at all

TheMilkCarton
30 Oct 2007, 11:20
1) Add $sk_avurl = fetch_avatar_url($userid); to a plugin at private_messagelist_messagebit. OR just install the XML.

2) Add <if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if> </if>Where the directions tell you to.

Not very hard at all.....

You must be doing something very very wrong. :)

yoyoyoyo
01 Nov 2007, 05:40
I did that - not working - maybe I have a conflicting mod??? :confused:

TheMilkCarton
01 Nov 2007, 18:09
Just highlight the HTML in the PM list and View Selection Source (if you use FF). Look for the HTML that you added, maybe it's not grabbing the avatar's location correctly.

Borden
01 Nov 2007, 18:48
My avatar limits are 250 by 250. Does this mean, this is how big they will be in the private message list?

TheMilkCarton
01 Nov 2007, 19:41
My avatar limits are 250 by 250. Does this mean, this is how big they will be in the private message list?

Just tweak the html to add:
style="max-width:75; max-height:75;"
in the <img> code.

Don't think this works in IE6, though.. but you could create a class for this in the CSS instead, and use a few of the IE6 tricks.

Edit:
It is already coded in the html for a width of 60, anyway. Although I didn't use that since my PM page is heavily customized.

Trana
13 Nov 2007, 00:33
This mod worked fine for me for a long time. After upgrading to 3.6.4 a while back (or whatever version enabled cc:ing), random users would report problems when they received a message. Basically it was a SQL message stating:

Invalid SQL:

SELECT user.avatarid, user.avatarrevision, avatarpath, NOT ISNULL(customavatar.userid) AS hascustom, customavatar.dateline,
customavatar.width, customavatar.height
FROM user AS user
LEFT JOIN avatar AS avatar ON avatar.avatarid = user.avatarid
LEFT JOIN customavatar AS customavatar ON customavatar.userid = user.userid
WHERE user.userid =;


In order to resolve the issue, I deleted all of the PMs in their folders. That is not a good solution, so I checked all my plugins to see what was going off in the PM area. When I disabled THIS plugin, the errors disappeared.

I REALLY like this mod, but there must be some sort of issue with the new way VB stores the to: user arrays.

Has anyone else experienced this problem?

Thanks.

anwar.abdullakh
21 Nov 2007, 17:02
I did that - not working - maybe I have a conflicting mod??? :confused:
same here, not working for me either...
any ideas??

.Tim
25 Nov 2007, 01:41
I'm running 3.6.8 and it is working perfectly. I'm sorry to those that are having problems. Only thing I can suggest is reverting your templates (back them up first), removing any PM related plugins/products, then making sure your problem doesn't exist with the default templates. Then apply any modifications you have to the PM templates one by one and testing after each addition.

.Tim
26 Dec 2007, 00:32
This hack is compatible with 3.7 Beta 3.

TCE Killa
26 Dec 2007, 01:41
^Tim great hack I love it.

Do you do hacks requested by other people? If so I have a request. Thanks.

.Tim
26 Dec 2007, 01:55
I usually only do hack requests if I think it's something I can use on my board(s) or it's easy. But PM me and I'll take a look at your request.

alfaowner
02 Jan 2008, 22:12
This mod worked fine for me for a long time. After upgrading to 3.6.4 a while back (or whatever version enabled cc:ing), random users would report problems when they received a message. Basically it was a SQL message stating:



In order to resolve the issue, I deleted all of the PMs in their folders. That is not a good solution, so I checked all my plugins to see what was going off in the PM area. When I disabled THIS plugin, the errors disappeared.

I REALLY like this mod, but there must be some sort of issue with the new way VB stores the to: user arrays.

Has anyone else experienced this problem?

Thanks.

I am also getting the error when a user is trying to access sent items, I have a questrion for you Tarana, could it be possible you lowered your limit of PM storage and some members have more than they are suppossed to have?

Let me know.

AWJunkies
10 Jan 2008, 22:01
I am also getting the error when a user is trying to access sent items, I have a questrion for you Tarana, could it be possible you lowered your limit of PM storage and some members have more than they are suppossed to have?

Let me know.

I have this same issue and about to uninstall. I love this idea and have used it for a while but couldn't figure out the culprit on what was happening. Now I have. Will remove for now.

Trana
10 Jan 2008, 23:17
I am also getting the error when a user is trying to access sent items, I have a questrion for you Tarana, could it be possible you lowered your limit of PM storage and some members have more than they are suppossed to have?


No, I have not lowered my limits.

Can you post a list of your other hacks/mods? Maybe we can figure out what is common between our two sites.

AWJunkies
10 Jan 2008, 23:26
what php version you running? People need to start letting people know this is for php5+ or whatever cause I just upgraded to 5+ from 4.4.4 and now I have all sorts of errors from mods. Also fixed tons of errors from mods. Not to say this is the case with your mod will find out in bit while I test.

Arrogant-One
11 Jan 2008, 02:07
When the avatar shows up in the inbox of your PM's, is it shruck to fit or the same usual size?

.Tim
11 Jan 2008, 06:22
In the PM list it is resized to a smaller size but in the actual PM itself it is the normal size.

aranthorn
17 Jan 2008, 22:25
I like the hack, but didn't want to replace the post icon with the avatar, so I put the post icon and the status icon on top of each other. Here's my pm_messagelistbit template:
<tr>
<td class="alt1"><img src="$stylevar[imgdir_statusicon]/pm_$pm[statusicon].gif" alt="" border="0" />&nbsp;<img src="$pm[iconpath]" alt="$pm[icontitle]" /></td>
<if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if>
<td class="alt1Active" id="m$pm[pmid]" width="100%">
<div>
<span style="float:$stylevar[right]" class="smallfont">$pm[senddate]</span>
<a href="private.php?$session[sessionurl]do=showpm&amp;pmid=$pm[pmid]"><if condition="$show['unread']"><strong>$pm[title]</strong><else />$pm[title]</if></a>
</div>
<div class="smallfont">
<span style="float:$stylevar[right]" class="time">$pm[sendtime]</span>
<if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if>
</div>
</td>
<if condition="$show['pmcheckbox']"><td class="alt2" align="center" style="padding:0px"><input type="checkbox" name="pm[$pmid]" value="$groupid" /></td></if>
</tr>
Thanks for the hack, I like it a lot!

Arrogant-One
07 Mar 2008, 09:12
Just tweak the html to add:
style="max-width:75; max-height:75;"
in the <img> code.

Don't think this works in IE6, though.. but you could create a class for this in the CSS instead, and use a few of the IE6 tricks.

Edit:
It is already coded in the html for a width of 60, anyway. Although I didn't use that since my PM page is heavily customized.
For those of us who aren't programmers, how do I do this?

ie.

Admin CP > User Options > etc.

Thanks,

AO

Trana
19 Mar 2008, 04:47
I have this same issue and about to uninstall. I love this idea and have used it for a while but couldn't figure out the culprit on what was happening. Now I have. Will remove for now.

For everyone that is having this problem (where members get a db error when viewing their PM boxes), can you tell me what hacks you have installed? Are you running VBSEO?

I narrowed it down a little bit. I found that the affected members have records in pmtest with no related records in pm. Something is inserting PMs incorrectly and it causes this mod to blow up. Perhaps the author could code in a function to check and see if the userid is blank, and if so, to use the noavatar.gif instead. I know this is a workaround, but it will fix this for everyone that is having problems until the offending culprit is found.

Thanks!

Boofo
19 Mar 2008, 07:20
Tim, this adds a query for every unique avatar on the page, so if you have 22 users sending you PMs and they are all listed on this page, it will add 22 queries for the page on top of the vb default and whatever else they having running in there.

SativaGlow
30 Mar 2008, 23:37
Installed! Nice one!

alfaowner
12 Jul 2008, 23:19
For everyone that is having this problem (where members get a db error when viewing their PM boxes), can you tell me what hacks you have installed? Are you running VBSEO?

I narrowed it down a little bit. I found that the affected members have records in pmtest with no related records in pm. Something is inserting PMs incorrectly and it causes this mod to blow up. Perhaps the author could code in a function to check and see if the userid is blank, and if so, to use the noavatar.gif instead. I know this is a workaround, but it will fix this for everyone that is having problems until the offending culprit is found.

Thanks!

Trana,

I stumbled on this today, if you still need the fix it is:

Got to the plugin manager, find the plug in 'PM Avatars' and edit
$sk_avurl = fetch_avatar_url($userid);

to:
if($userid != 'cc'){ $sk_avurl = fetch_avatar_url($userid); }

That would stop the errors for you, it basically checks if the $userid = 'cc' and then only runs the hook if it isn't. It's expecting the $userid to equal something like '67453' but something makes it 'cc'... my code just ignores it if it is!

Let me know how you get on, it will fix it! :)

AO :cool:

AWJunkies
22 Jul 2008, 05:59
Finished adding this with 0 queries added yes 0. Will give to mod owner or will just release it. I also integrated it with opacity avatar MOD.

WarLion
22 Jul 2008, 06:24
asome AWjunkies look really sweat

.Tim
23 Jul 2008, 00:20
Finished adding this with 0 queries added yes 0. Will give to mod owner or will just release it. I also integrated it with opacity avatar MOD.

You can release it yourself if you want. Wouldn't bother me none.

Arrogant-One
02 Aug 2010, 20:59
*INSTALLED* Very cool!

Might be a cool mod, but the jury is still out.

sami989
18 Aug 2010, 16:50
thank you very much it is useful hak

Kimberley
18 Oct 2010, 18:27
installed works great thank you