SimplePortal

Customization => Custom Coding => Topic started by: wiecher on August 31, 2011, 05:27:25 PM

Title: smilies and images automatically reduced
Post by: wiecher on August 31, 2011, 05:27:25 PM
How do I make the smilies and images automatically reduced in the shoutbox?

Thanks in advance

 ;D ;D ;D
Title: Re: smilies and images automatically reduced
Post by: ccbtimewiz on August 31, 2011, 11:14:48 PM
To what size?
Title: Re: smilies and images automatically reduced
Post by: wiecher on September 01, 2011, 03:52:54 AM
To 20x20  :D
Title: Re: smilies and images automatically reduced
Post by: ccbtimewiz on September 01, 2011, 04:04:55 PM
Open ./Themes/default/PortalShoutbox.template.php

Find:
Code: [Select]
<li class="smalltext">', $shout['text'], '</li>
Replace with:
Code: [Select]
<li class="smalltext">', str_replace('<img', '<img width="20" height="20"', $shout['text')], '</li>
Title: Re: smilies and images automatically reduced
Post by: wiecher on September 01, 2011, 04:31:56 PM
Don`t work i am sorry :'(
No shoutbox when i ad that code.
Title: Re: smilies and images automatically reduced
Post by: ccbtimewiz on September 01, 2011, 05:05:41 PM
Oh, I made a mistake, sorry.

Replace it with this:
Code: [Select]
<li class="smalltext">', str_replace('<img', '<img width="20" height="20"', $shout['text']), '</li>
Title: Re: smilies and images automatically reduced
Post by: wiecher on September 01, 2011, 05:21:49 PM
Same problem  :'(
Title: Re: smilies and images automatically reduced
Post by: ccbtimewiz on September 02, 2011, 01:51:54 AM
It works fine for me, what exactly are you doing?
Title: Re: smilies and images automatically reduced
Post by: wiecher on September 02, 2011, 03:59:26 AM
Maybe can you check this please.

Title: Re: smilies and images automatically reduced
Post by: ccbtimewiz on September 02, 2011, 04:21:01 PM
Find:
Code: [Select]
if (!empty($context['SPortal']['shouts_history']))
foreach ($context['SPortal']['shouts_history'] as $shout)
echo '
', !$shout['is_me'] ? '<li class="smalltext"><strong>' . $shout['author']['link'] . ':</strong></li>' : '', '
<li class="smalltext">', $shout['text'], '</li>
<li class="smalltext shoutbox_time">', $shout['delete_link'], $shout['time'], '</li>';

Replace with:
Code: [Select]
if (!empty($context['SPortal']['shouts_history']))
foreach ($context['SPortal']['shouts_history'] as $shout)
echo '
', !$shout['is_me'] ? '<li class="smalltext"><strong>' . $shout['author']['link'] . ':</strong></li>' : '', '
<li class="smalltext">', str_replace('<img', '<img width="20" height="20"', $shout['text']), '</li>
<li class="smalltext shoutbox_time">', $shout['delete_link'], $shout['time'], '</li>';
Title: Re: smilies and images automatically reduced
Post by: wiecher on September 02, 2011, 04:27:49 PM
Sorry won`t work  :'(
Title: Re: smilies and images automatically reduced
Post by: ccbtimewiz on September 03, 2011, 01:06:55 AM
No idea, it works fine for me.
Title: Re: smilies and images automatically reduced
Post by: Sapinho® on September 07, 2011, 12:39:48 AM
clear cache... maybe u see work
Title: Re: smilies and images automatically reduced
Post by: weerforum on June 15, 2012, 05:01:23 AM
Where can i find it in SP 2.3.5 ???
Title: Re: smilies and images automatically reduced
Post by: phantomm on June 15, 2012, 06:57:08 AM
Before making any changes remember to make backup!

In file: ./Themes/default/PortalShoutbox.template.php
Code: (Find) [Select]
echo '
<li class="smalltext">', !$shout['is_me'] ? '<strong>' . $shout['author']['link'] . ':</strong> ' : '', $shout['text'], '<br />', !empty($shout['delete_link_js']) ? '<span class="shoutbox_delete">' . $shout['delete_link_js'] . '</span>' : '' , '<span class="smalltext shoutbox_time">', $shout['time'], '</span></li>';
Code: (Replace with) [Select]
echo '
<li class="smalltext">', !$shout['is_me'] ? '<strong>' . $shout['author']['link'] . ':</strong> ' : '', str_replace('<img', '<img width="20" height="20"', $shout['text']), '<br />', !empty($shout['delete_link_js']) ? '<span class="shoutbox_delete">' . $shout['delete_link_js'] . '</span>' : '' , '<span class="smalltext shoutbox_time">', $shout['time'], '</span></li>';
Title: Re: smilies and images automatically reduced
Post by: weerforum on June 15, 2012, 08:17:47 AM
I mean if I want a picture show in the shoutbox from an external url.
If I post them then they are very large.
SimplePortal 2.3.8 © 2008-2024, SimplePortal