1 (edited by KeyDog 2009-01-01 21:16)

Topic: [Extension] Different Set Of Smilies 2.0 and 2.1

ADDED 01-01-2009   Custom_Smilies  2.1
Download the Custom Smilies Extension 2.1
This set will now work with pun_bbcode   ( and  also without  bbcode running)

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

give me feedback on smilies you'd like added or alternative sets!


________________________________________________________________

ADDED 29-12-2008:
Download the Custom Smilies Extension 2.0

This release will make all the smilies in the post appear at 20x20 instead of 15x15.
[you can easily change your preference in the manifest.xml by modifying those values...]
Make sure you have the latest include/parser.php installed (I've attached it in .rar in case)

If you're using PUN_BBCODE you can change size , by replacing this in pun_bbcode/bar.php

<?php

// Display the smiley set
foreach (array_unique($smilies) as $smile_text => $smile_file)
    echo '<a href="javascript:insert_text(\''.$smile_text.'\', \'\');" tabindex="'.($tabindex--).'"><img src="'.$base_url.'/img/smilies/'.$smile_file.'" width="20" height="20" alt="'.$smile_text.'" /></a>'."\n";

?>    

and if you want help.php to show them in 20x20

<?php

    // Display the smiley set
    if (!defined('FORUM_PARSER_LOADED'))
        require FORUM_ROOT.'include/parser.php';

    $smiley_groups = array();

    foreach ($smilies as $smiley_text => $smiley_img)
        $smiley_groups[$smiley_img][] = $smiley_text;

    foreach ($smiley_groups as $smiley_img => $smiley_texts)
        echo "\t\t\t\t".'<p>'.implode(' '.$lang_common['and'].' ', $smiley_texts).' <span>'.$lang_help['produces'].'</span> <img src="'.$base_url.'/img/smilies/'.$smiley_img.'" width="20" height="20" alt="'.$smiley_texts[0].'" /></p>'."\n";

?>

----------------------------------------------------------------------------------------------------
OLD:
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)

What It Does:
replaces all smilies with this set
Screenshot:
http://www.dumpt.com/img/files/rowziqvbqbarvawjusgu_thumb.gif

see in proper size here

'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png', '=|' => 'neutral.png', ':(' => 'sad.png', '=(' => 'sad.png', ':D' => 'laughing.png', ';)' => 'wink.png', ':/' => 'blink.png', ':P' => 'tongue.png', ':p' => 'tongue.png', ':cool:' => 'cool.png', ':whistling:' => 'whistling.png', ':wassat:' => 'wassat.png', ':unsure:' => 'unsure.png', ':tongue:' => 'tongue.png', ':sick:' => 'sick.png', ':silly:' => 'silly.png', ':sideways:' => 'sideways.png', ':pinch:' => 'pinch.png', ':kissing:' => 'kissing.png', ':angry:' => 'angry.png', ':blush:' => 'blush.png', ':cheerful:' => 'cheerful.png', ':devil:' => 'devil.png', ':dizzy:' => 'dizzy.png', ':ermm:' => 'ermm.png', ':icon_exclaim:' => 'icon_exclaim.gif', ':icon_arrow:' => 'icon_arrow.gif', ':icon_idea:' => 'icon_idea.gif'

Designed for:
1.3.2
changes:
fixed smilie.png to sick.png as was missing.

2

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

smilie.png is missing (and not changed to "sick") in the version you uploaded

nice set otherwise

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

8k84 wrote:

smilie.png is missing (and not changed to "sick") in the version you uploaded

i'v fix it up for mine... also added more smiles.. can download from here-
http://trivuz.com/downloads/custom_smilies.rar


okay, @KeyDog
How its too small in my forum.. how can i show its proper size in forum?

check it out- http://booksuread.com/idforums/viewtopic.php?pid=2533

Never explain yourself to anyone. Because the person who likes you doesn’t need it, and the person who dislikes you won’t believe it.

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

<img src="'.$base_url.'/img/smilies/'.$smiley_img.'" width="15" height="15"

okay.. i got it... anyway, thanks KeyDog, for a nice ext..

Never explain yourself to anyone. Because the person who likes you doesn’t need it, and the person who dislikes you won’t believe it.

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

good point about the size. will change that my end aswell. noticed it aswell couple of days ago.

thx for feedback big_smile

6 (edited by User33 2008-12-25 21:01)

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

I don't know how your extension works, but I got an idea of how I think it would be a really good extension:

You know how the style folder works, right? Each style has its own unique ID (i.e. 'style/Oxygen/') and a ID.php (i.e. 'style/Oxygen/Oxygen.php'). You could use the same idea for the smilies folder (which will have to be placed inside the cache folder because of write restrictions).

So, when the user installs your extension, it automatically gets the contents of 'img/smilies/' and copies them to 'cache/smilies/default/' and then creates 'cache/smilies/default/default.php' which will contain something like:

$smilies = array(':)' => $base_url.'cache/smilies/'.$forum_config['o_smilies_set'].'smile.png', ... (and so on)

Then, on 'parser.php' you will have to use some hooks to change how some functions parse the smilies, so it works with the schema.

Also, you can have a drop-down set with all the sets inside 'cache/smilies/' in the Settings so the admin can select the default set for the forum. You could also allow users to select their own set, which will only apply to the posts they make.

If you get all of the above working, it will be really easy for users to create their own sets.

Another cool thing to do would be to allow admins to create sets through the forum, like this:
http://i247.photobucket.com/albums/gg135/garcia-t/idea.png

I'm giving you this idea because you started the whole smilies set stuff, but if you don't plan doing this, let me know, because I'd love to make it myself.

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

go ahead garciat! best if things are developped in parallel and to cover all needs....
my priority at mo is to get that rating stuff working!
but i think it's a good idea you have!

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

Ok, then smile Good luck with the rating stuff!

9 (edited by KeyDog 2008-12-25 21:23)

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

PS: in include/parser.php

//
// Convert a series of smilies to images
//
function do_smilies($text)
{
    global $forum_config, $base_url, $smilies;

    $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="18" height="18" alt="'.substr($smiley_img, 0, strrpos($smiley_img, '.')).'" />', $text);
    }

    return substr($text, 1, -1);
}

is there a way to include this (18 instead of 15 height and width) in the extension?
i don't se a hook there that i can use?

10

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

Get the latest include/parser.php from the SVN, I added some hooks.

11

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

ok thx.

12

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

added new release 2.0 - see first post.

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

Hello,

I've been looking for a long time for some smileys in PNG format, because my website has dark background. And these are great! I'd like to use them on my (social) community website, which is actually in development state. Are there any restrictions on using this icons or are there license informations?

Regards

14

Re: [Extension] Different Set Of Smilies 2.0 and 2.1

I believe they're in the public domain so you needn't worry about it.
Cheers.