SimplePortal

Support => English Support => Topic started by: PokemonS on March 13, 2013, 12:14:12 PM

Title: Add avatar and disable smileys in shoutbox
Post by: PokemonS on March 13, 2013, 12:14:12 PM
SimplePortal 2.3.5

Hi,
Last time I asked those two questions in SMF.

So, how to add avatar and disable smileys in shoutbox?

Thx.
Title: Re: Add avatar and disable smileys in shoutbox
Post by: phantomm on March 13, 2013, 02:42:17 PM
I almost got it working, but when someone sends new shout it looks like this:
(http://img705.imageshack.us/img705/281/myboard.png)

Can't figure it out.. :|

edit:

Try this edits (BUT BEFORE MAKE BACKUPS):
PortalShoutbox.template.php:
Code: (Find) [Select]
<li class="smalltext">', !$shout['is_me']
Code: (Replace with) [Select]
<li class="smalltext">'.$shout['author']['avatar'].' ', !$shout['is_me']

Code: (Find) [Select]
<id>', $shout['id'], '</id>
Code: (Replace with) [Select]
<id>', $shout['id'], '</id>
<avatar>' , $avatarSB , '</avatar>

Code: (Find) [Select]
foreach ($context['SPortal']['shouts'] as $shout)
echo '
Code: (Replace with) [Select]
foreach ($context['SPortal']['shouts'] as $shout)
{
loadMemberData($shout['author']['id']);
loadMemberContext($shout['author']['id']);
if (empty($memberContext[$shout['author']['id']]['avatar']['href']))
$avatarSB =  $settings['default_images_url'].'/sp/user.png';
else
$avatarSB = $memberContext[$shout['author']['id']]['avatar']['href'];

echo '

Code: (Find) [Select]
</shout>';
Code: (Replace with) [Select]
</shout>';
}

Code: (Find) [Select]
global $context, $txt;
Code: (Replace with) [Select]
global $context, $txt, $memberContext, $settings;


portal.js:
Code: (Find) [Select]
var shoutbox_id
Code: (Replace with) [Select]
var avatar, shoutbox_id

Code: (Find) [Select]
id = shout.getElementsByTagName("id")[0].childNodes[0].nodeValue;
Code: (Replace with) [Select]
id = shout.getElementsByTagName("id")[0].childNodes[0].nodeValue;
avatar = shout.getElementsByTagName("avatar")[0].childNodes[0].nodeValue;

Code: (Find) [Select]
new_body += '<li class="smalltext">' +
Code: (Replace with) [Select]
new_body += '<li class="smalltext"><img src="' + avatar +'" width="20px" height="20px" />' +

Subs-Portal.php
Code: (Find) [Select]
'color' => $online_color,
Code: (Replace with) [Select]
'color' => $online_color,
'avatar' => '<img src="' . $avatarSB . '" width="20px" height="20px" />',

Code: (Find) [Select]
// Disable the aeva mod for the shoutbox.
Code: (Replace with) [Select]
loadMemberData($row['id_member']);
loadMemberContext($row['id_member']);
if (empty($memberContext[$row['id_member']]['avatar']['href']))
$avatarSB =  $settings['default_images_url'].'/sp/user.png';
else
$avatarSB = $memberContext[$row['id_member']]['avatar']['href'];

// Disable the aeva mod for the shoutbox.

Code: (Find) [Select]
$shoutbox = !empty($shoutbox) ? (int) $shoutbox : 0;
Code: (Replace with) [Select]
global $memberContext, $settings;

$shoutbox = !empty($shoutbox) ? (int) $shoutbox : 0;

Users have to clear browser cache, and you have to clear  forum cache.
Title: Re: Add avatar and disable smileys in shoutbox
Post by: weerforum on March 20, 2013, 08:46:24 AM
Can you make a mod for it please ?
Title: Re: Add avatar and disable smileys in shoutbox
Post by: phantomm on March 20, 2013, 09:34:05 AM
package attached
Title: Re: Add avatar and disable smileys in shoutbox
Post by: weerforum on March 20, 2013, 09:44:39 AM
Yes thnx that works great.
And disable smileys in shoutbox ?
Title: Re: Add avatar and disable smileys in shoutbox
Post by: FrizzleFried on March 20, 2013, 05:33:10 PM
package attached

This works great for me... until I type something in the shoutbox then ALL shoutbox avatars go away.
Title: Re: Add avatar and disable smileys in shoutbox
Post by: phantomm on March 20, 2013, 05:35:50 PM
Clear forum and browser cache

Users have to clear browser cache, and you have to clear  forum cache.
Title: Re: Add avatar and disable smileys in shoutbox
Post by: Devil jimmy on March 20, 2013, 06:03:41 PM
thank you phantomm
avatars in shout
nice nice  >:-D
Title: Re: Add avatar and disable smileys in shoutbox
Post by: weerforum on March 25, 2013, 05:53:23 PM
disable smileys in shoutbox ?
Don`t work
Title: Re: Add avatar and disable smileys in shoutbox
Post by: PokemonS on April 01, 2013, 12:50:47 PM
Thanks for fast reply, it really works well!

(http://puu.sh/2rV41)
Title: Re: Add avatar and disable smileys in shoutbox
Post by: FrizzleFried on April 18, 2013, 10:49:58 AM
The AVATAR mod is working great aside from one issue I am having.

Upon loading of the screen,  the avatars look great....proper spacing between them and the name of the user.  Once you add to the shoutbox however,  I lose the space between the avatar and the name of the person next to it.

I am assuming I have some CSS borked somewhere?  Where should I look?

Thanks!

Works great otherwise!
Title: Re: Add avatar and disable smileys in shoutbox
Post by: phantomm on April 18, 2013, 12:40:50 PM
I think that there is some typo in portal.js. When shouts are loaded (after refresh) HTML is generated by JavaScript, if you could attach portal.js or give url to your site I can check it.
Title: Re: Add avatar and disable smileys in shoutbox
Post by: FrizzleFried on April 18, 2013, 04:02:08 PM
My site is a private site... but I could set someone up with a login/password if necessary...

Here is the js file though...
Title: Re: Add avatar and disable smileys in shoutbox
Post by: phantomm on April 18, 2013, 04:31:59 PM
try this in portal.js:
Code: (Find) [Select]
height="20px" />'
Code: (Replace with) [Select]
height="20px" /> '
Title: Re: Add avatar and disable smileys in shoutbox
Post by: FrizzleFried on April 18, 2013, 07:54:03 PM
...that did it.

Thank you.

Title: Re: Add avatar and disable smileys in shoutbox
Post by: TrickyRicky on November 29, 2013, 11:44:43 PM
Fantastic works great.
Title: Re: Add avatar and disable smileys in shoutbox
Post by: joeseppy on March 27, 2014, 04:45:14 PM
Hi guys. Thanks so much for this mod. just wondering - it seems to be slowing the chat down slightly - is there any way i can get around that? No worries if not. Thanks!
Title: Re: Add avatar and disable smileys in shoutbox
Post by: Burke Knight on December 16, 2014, 09:45:47 AM
Seems that in 2.3.6 whenever add to posts in shoutbox, the avatars go missing. And when try to get info on the image, get this:

http://www.yourdomain.com/sp/user.png

Somehow, it's calling an image from an non-existent directory, instead of the avatar.
SimplePortal 2.3.8 © 2008-2024, SimplePortal