PDA

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


.Tim
09-23-2006, 10:00 PM
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:
https://vborg.vbsupport.ru/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
09-24-2006, 07:22 AM
very nice idea! gonna install this!

ForumDog
09-24-2006, 08:57 AM
This won't work if you have avatars in the filesystem. :)

MediaHound
09-24-2006, 12:13 PM
/clicks subscribe to thread

.Tim
09-24-2006, 12:24 PM
This won't work if you have avatars in the filesystem. :)

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

trackpads
09-24-2006, 02:15 PM
Excellent work!! Thanks!

giggity giggity

Lionel
09-24-2006, 02:44 PM
I really like this idea. I wish it could be used with the filesystem.

kersti
09-24-2006, 04:17 PM
Probably a stupid question but... how do we change the avatars from the filesystem...

.Tim
09-24-2006, 04:21 PM
Probably a stupid question but... how do we change the avatars from the filesystem...

Admincp > Avatars > User Picture Storage Type

Lionel
09-24-2006, 08:57 PM
i managed to use the filesystem

.Tim
09-24-2006, 09:04 PM
How did you do that?

Selene
09-25-2006, 12:53 AM
yes lionel how did u do that can u please tell us what to modify

Lionel
09-25-2006, 01:02 AM
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
09-25-2006, 01:03 AM
Thats just for file system? Mmmm..
Anyway *clicks install

.Tim
09-25-2006, 01:15 AM
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
09-25-2006, 07:03 AM
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
09-25-2006, 08:01 AM
You may need to add a require ;

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

Selene
09-25-2006, 08:50 AM
thanks problem solved

Selene
09-25-2006, 08:56 AM
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
09-25-2006, 09:14 AM
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
09-25-2006, 04:40 PM
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
09-25-2006, 09:36 PM
Thanks guys. That code works both ways, with filesystem and database. So I've updated the code. Thanks again for your help. :D

Gripemaster
09-25-2006, 09:44 PM
*INSTALLED* Very cool!

Shazz
09-25-2006, 10:19 PM
Installed*

Shazz
09-25-2006, 10:22 PM
Now i just got the Red X's and i didn't before :(

xman_79
09-25-2006, 10:54 PM
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://vborg.vbsupport.ru/external/2007/02/26.jpg

Shazz
09-25-2006, 11:18 PM
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://vborg.vbsupport.ru/external/2007/02/26.jpg
Genious!

Trana
09-26-2006, 02:04 AM
Nice one.

xman_79
09-26-2006, 09:26 PM
Genious!

Thank u and welcome .

Jeordie015
09-27-2006, 12:48 AM
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
09-27-2006, 01:45 AM
I need to see a screenshot of a larger area.

apdcanari
09-27-2006, 04:47 AM
3.5 please ?

.Tim
09-27-2006, 05:25 PM
It should work for 3.5 if not I'll mess around with it later.

.Tim
09-27-2006, 09:33 PM
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
10-21-2006, 12:51 AM
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
10-29-2006, 08:58 PM
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
10-29-2006, 11:02 PM
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
10-29-2006, 11:03 PM
Never got it =\

Trana
12-02-2006, 04:59 PM
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
12-04-2006, 12:18 AM
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
01-16-2007, 07:29 PM
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
01-16-2007, 07:51 PM
I myself have never encountered this problem. Could it be people getting too close to their limit?

marcsmith73
01-28-2007, 04:03 PM
All i get is squares, and res x's in my Pm box

TheBlackPoet
01-29-2007, 09:43 AM
good one.. installed...

marcsmith73
02-01-2007, 11:30 AM
Anyone? About the red x's in my pm list?

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

TruthElixirX
02-04-2007, 04:50 PM
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
02-05-2007, 12:26 AM
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
02-06-2007, 12:18 AM
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
02-06-2007, 02:23 PM
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
02-06-2007, 06:25 PM
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://vborg.vbsupport.ru/attachment.php?attachmentid=53939&stc=1&d=1159228459

Still the X, what else can I do?

Tralala
02-11-2007, 09:01 PM
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 (https://vborg.vbsupport.ru/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://vborg.vbsupport.ru/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
02-16-2007, 03:56 PM
https://vborg.vbsupport.ru/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
02-17-2007, 05:01 AM
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
02-18-2007, 12:53 PM
Does this work on vB 3.6.4?

.Tim
02-18-2007, 02:05 PM
Yes.

Tralala
02-18-2007, 03:13 PM
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
02-18-2007, 03:33 PM
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
02-18-2007, 04:12 PM
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
02-19-2007, 02:31 PM
nice hack!

TruthElixirX
03-12-2007, 11:46 PM
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
03-12-2007, 11:51 PM
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
03-13-2007, 12:38 AM
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
03-13-2007, 12:39 AM
Oh, I had that fixed a long time ago lol.
But nice info to know

Tralala
03-13-2007, 03:40 AM
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
03-15-2007, 12:03 AM
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
03-23-2007, 10:04 PM
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
03-24-2007, 08:28 PM
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
03-25-2007, 12:17 AM
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
03-25-2007, 01:30 AM
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
03-29-2007, 01:12 PM
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
09-07-2007, 05:13 PM
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
09-11-2007, 10:16 PM
Can anyone confirm that they have this working on 3.6.8 with cc:ed users?

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

JadedSouls
09-19-2007, 09:37 PM
Love it!! Great hack :)

yoyoyoyo
10-30-2007, 04:35 AM
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
10-30-2007, 09:20 AM
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
11-01-2007, 03:40 AM
I did that - not working - maybe I have a conflicting mod??? :confused:

TheMilkCarton
11-01-2007, 04:09 PM
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
11-01-2007, 04:48 PM
My avatar limits are 250 by 250. Does this mean, this is how big they will be in the private message list?

TheMilkCarton
11-01-2007, 05:41 PM
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
11-12-2007, 10:33 PM
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
11-21-2007, 03:02 PM
I did that - not working - maybe I have a conflicting mod??? :confused:
same here, not working for me either...
any ideas??

.Tim
11-24-2007, 11:41 PM
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
12-25-2007, 10:32 PM
This hack is compatible with 3.7 Beta 3.

TCE Killa
12-25-2007, 11:41 PM
^Tim great hack I love it.

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

.Tim
12-25-2007, 11:55 PM
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
01-02-2008, 08:12 PM
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
01-10-2008, 08:01 PM
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
01-10-2008, 09:17 PM
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
01-10-2008, 09:26 PM
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
01-11-2008, 12:07 AM
When the avatar shows up in the inbox of your PM's, is it shruck to fit or the same usual size?

.Tim
01-11-2008, 04:22 AM
In the PM list it is resized to a smaller size but in the actual PM itself it is the normal size.

aranthorn
01-17-2008, 08:25 PM
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
03-07-2008, 07:12 AM
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
03-19-2008, 02:47 AM
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
03-19-2008, 05:20 AM
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
03-30-2008, 09:37 PM
Installed! Nice one!

alfaowner
07-12-2008, 09:19 PM
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
07-22-2008, 03:59 AM
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
07-22-2008, 04:24 AM
asome AWjunkies look really sweat

.Tim
07-22-2008, 10:20 PM
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
08-02-2010, 06:59 PM
*INSTALLED* Very cool!

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

sami989
08-18-2010, 02:50 PM
thank you very much it is useful hak

Kimberley
10-18-2010, 04:27 PM
installed works great thank you