1 (edited by KeyDog 2008-12-30 20:54)

Topic: smilies size across help.php, parser.php and pun_bbcode/bar.php

It would be good if added smilies would show in actual size in help.php and parser.php and not fixed to 15x15.

I've found that lots of smilies that are out there have strange sizes like 24x18 etc etc - and I don't want all smilies at that silly size obviously.

Is there some way to auto insert the actual size of the smiley instead of using the fixed 15x15 all over the place?

thanks!

Re: smilies size across help.php, parser.php and pun_bbcode/bar.php

KeyDog wrote:

Is there some way to auto insert the actual size of the smiley instead of using the fixed 15x15 all over the place?

I addressed that in my other posts on the subject, in the extensions forum.  My extension & related modifications fixed that for bar.php and parser.php, the same steps would fix help.php

3 (edited by User33 2009-01-01 19:02)

Re: smilies size across help.php, parser.php and pun_bbcode/bar.php

What extension? Also, help.php has no hooks anywhere near the smilies section.

Edit: Nvm, there is a way:

<hook id="he_new_section">
if ($section == 'smilies')
{
    $temp = forum_trim(ob_get_contents());
    ob_end_clean();
    echo str_replace('width="15" height="15" ', '', $temp);
}
</hook>

4 (edited by KeyDog 2009-01-01 21:18)

Re: smilies size across help.php, parser.php and pun_bbcode/bar.php

Fantastic. Great input.
Added the above garciat code to the set...

http://rapidshare.com/files/178820939/c … lies_2.rar

This set will now work with pun_bbcode   ( and  also without  bbcode running)

showing  20x20 without any manual modification of any other files.
I tested it on trunk r1002
(important that you have latest include/parser.php )

THANKS!

EDIT: shows help correctly aswell

5 (edited by KeyDog 2009-01-03 16:26)

Re: smilies size across help.php, parser.php and pun_bbcode/bar.php

@garciat how do i need to change this part


       

<hook id="ps_do_smilies_start"><![CDATA[
        
        //this makes the smilies 20 instead of 15 in width and height
    
        $text = ' '.$text.' ';

        foreach ($smilies as $smiley_text => $smiley_img)
        {
            if (strpos($text, $smiley_text) !== false)
                $text = preg_replace("#(?<=[>\s])".preg_quote($smiley_text, '#')."(?=\W)#m", '<img src="'.$base_url.'/img/smilies/'.$smiley_img.'" width="20" height="20" alt="'.substr($smiley_img, 0, strrpos($smiley_img, '.')).'" />', $text);
        }

           ]]></hook>

with your code

<hook id="he_new_section">
if ($section == 'smilies')
{
    $temp = forum_trim(ob_get_contents());
    ob_end_clean();
    echo str_replace('width="15" height="15" ', '', $temp);
}
</hook>

   

help shows the smilies at there real size.... but not in posts or in pun_bbcode

do I need to do that echo str_replace anywhere else? or what could be problem... ?

i have one that is 18x31  and it just gets squashed big_smile (except in help where it shows correctly)

Re: smilies size across help.php, parser.php and pun_bbcode/bar.php

        <hook id="ps_do_smilies_end">
            <![CDATA[
$text = str_replace('width="15" height="15"', '', $text);
            ]]>
        </hook>

Re: smilies size across help.php, parser.php and pun_bbcode/bar.php

great thx. works!

only place left now - which might not be a bad thing - where they show in fixed size is in pun_bbcode .... quick reply..