1 (edited by KeyDog 2008-12-18 06:56)

Topic: How to change smilies set with this extension

Be my guineapig;

Download the Custom Smilies Extension Beta

Question: How do you think I should handle rows where smilies take up 3/4 of width (at the moment it right aligns them;
a. should I left align it aswell under B I U etc   or
b. work on a Tab that only shows them if you hover over it ( smile will need help with that)





edited above
original post below


******************************************************************

I'm working on an extension which overrides the default smilies with a completely new set;

based on include/parser.php line 19
($hook = get_hook('ps_start')) ? eval($hook) : null;


What needs changing here [in addition to location (in colors)] being changed?

        <hook id="ps_start"><![CDATA[
       
        //this adds the custom set of smilies
       
            $smilies = array(':)' => 'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png');
           
            <img src="'.$ext_info['path'].'/img/smile.png"/>
   
        ]]></hook>

How do I include the img src location in green above so that normal location red doesn't show?

Thanks for any pointers

Re: How to change smilies set with this extension

You can't really change the smilies' URLs that way. You need a hook inside the do_smilies() function.

Re: How to change smilies set with this extension

//
// Convert a series of smilies to images
//
function do_smilies($text)

on line 758 in parser.php ?

Re: How to change smilies set with this extension

Yes.

Re: How to change smilies set with this extension

<hook id="ps_start"><![CDATA[
       
        //this adds the custom set of smilies
       
            $smilies = array(':)' => $ext_info['url']/extensions_name/img/smilie.png,  ':|' => $ext_info['url']/extensions_name/img/neutral.png);

        ]]></hook>

would that work?
or how do I make the  smiley path in the array relative to the forum root

6 (edited by User33 2008-12-18 00:23)

Re: How to change smilies set with this extension

I told you you need a hook inside the do_smilies function because that's where the actual smiley URL is created.

Edit: I think this could work:

foreach($smilies as $k=>$v) $smilies[$k] = '../../extensions/{extension_id}/img/'.$v;

Of course, replace {extension_id} with your extension's ID (or folder name... whatever).

Re: How to change smilies set with this extension

thanks a lot , will try !

Re: How to change smilies set with this extension

<hooks>
            <hook id="ps_start"><![CDATA[
       
        //this adds the custom set of smilies
   
            foreach($smilies as $k=>$v) $smilies[$k] = '../../extensions/custom_smilies/img/'.$v;
           
        ]]></hook>
           
    </hooks> 

works!

thanks !

Re: How to change smilies set with this extension

I'll give it a whirl. Feedback coming later smile