The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Show avatar in PM, I wrote the plugin but there is error !
Hi dears,
I want to write a plugin to show the user avatars in PM list (inbox/outbox....etc) I added this plugin: Code:
require_once('./includes/functions_user.php'); if (THIS_SCRIPT == 'private') { $pm[avatarurl] = fetch_avatar_url($pm['fromuserid']); if (!$pm[avatarurl]) { $pm[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif'; } else { $pm[avatarurl] = $vbulletin->options['bburl'] . '/' . $pm[avatarurl][0]; } } Then I added this to template(pm_messagelistbit) Code:
<img src="{vb:raw pm.avatarurl}" /> It is working and the avatar shows but only in first row ! I mean there is avatar only in FIRST pm (one avatar in each page). Any help? |
#2
|
|||
|
|||
Which hook did you use for your plugin?
|
#3
|
|||
|
|||
private_messagelist_messagebit |
#4
|
||||
|
||||
It works just fine for me (although the avatars are huge - you probably want the thumbnail size ones).
|
#5
|
|||
|
|||
Quote:
https://vborg.vbsupport.ru/showthread.php?t=277502 I will contact with Joe Thanks Lynne. Thanks Kevin |
#6
|
|||
|
|||
I faced another issue
In inbox it is working perfect but in (send folder / outbox) it shows the avatar for sender (my avatar) I want to show the avatar for the user who will receive the message. This is the Inbox (OK) This is the send folder (All shows my avatar only!) |
#7
|
|||
|
|||
Maybe you could do something like:
Code:
$avid = $pm['fromuserid']; if ($avid == $vbulletin->userinfo['userid']) { $avid = $pm['touserid'] } |
#8
|
|||
|
|||
Quote:
Sorry Kevin but could you please explain this more? Should I add the previous code to the same plugin? Thanks very much |
#9
|
||||
|
||||
You would add it above this line:
$pm[avatarurl] = fetch_avatar_url($pm['fromuserid']); But also change that line to: $pm[avatarurl] = fetch_avatar_url($avid); |
#10
|
|||
|
|||
Quote:
I did but it is not working, all avatars is broken and I got this error above the page Code:
Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 Parse error: syntax error, unexpected '}' in /home/userhere/public_html/forum/private.php(2274) : eval()'d code on line 8 This is the plugin after modified Code:
require_once('./includes/functions_user.php'); if (THIS_SCRIPT == 'private') { $avid = $pm['fromuserid']; if ($avid == $vbulletin->userinfo['userid']) { $avid = $pm['touserid'] } $pm[avatarurl] = fetch_avatar_url($avid); if (!$pm[avatarurl]) { $pm[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif'; } else { $pm[avatarurl] = $vbulletin->options['bburl'] . '/' . $pm[avatarurl][0]; } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|