post Category: tutorial post postSeptember 21, 2008post 299 views

Yesterday i was trying to add smilies to my blog to make it more lively. So i searched Google and some blogs that review how to add smilies in wordpress, and i found that there’s a plugin for it called Custom Smilies. It’s a plugin that allows users to choose more smilies rather than use the default smilies WordPress provides, you can add smilies in your post and comments too :D

Okay here’s some step how to use it :

  1. Download and extract custom-smilies.zip , then upload init.php and custom-smilies.php to the /wp-content/plugins/custom-smilies directory.
    Upload smilies folder to the /wp-includes/images directory.
  2. Go to Plugins to activate your smilies plugin
  3. Put your smilies in smilies folder (wp-includes/images/smilies/)
    Make sure your smilies not in a folder, this way your smilies will have a url of /wordpress/wp-includes/images/smilies/picture.gif instead of /wordpress/wp-includes/images/smilies/mysmilies/picture.gif

  4. Go to your Dashboard & go to Manage > Smilies. Make sure it’s all there.
    I prefer to change the smilies manually in init.php file. You can find the init.php folder in wp-content/plugins/custom-smilies.
  5. Open up the init.php file on your computer using notepad. What you want to do is edit this manually. You can basically figure it out but here’s what the main part of mine looks like:<?php
    $wpsmiliestrans = array(
    ‘:apa:’ => ‘what.png‘,
    ‘:yay:’ => ‘victory.png‘,
    ‘:hiks:’ => ‘unhappy.png‘,
    ‘:gasp:’ => ‘amazing.png

    );

    the first part in the quotes is the text to summon the smiley, the second quotes is the smiley name in your smilies folder that you want to use.

  6. After you finish editing the init.php file, upload it to your server where it originally was. Replace it. Now you’re done :hoho:
  7. Now if you want to add clickable smilies in your comment form, just append these lines to your current theme’s comments.php file, just before the form begins:
    <?php if ( function_exists(cs_print_smilies) ) {cs_print_smilies();} ?>

    If you want to hide the smilies in the comment form like mine, just add javascript expand / collapse codes :

    <SCRIPT LANGUAGE=”JavaScript”>
    <!–
    function showHide(elementid){
    if (document.getElementById(elementid).style.display == ‘none’){
    document.getElementById(elementid).style.display = ”;
    } else {
    document.getElementById(elementid).style.display = ‘none’;
    }
    }
    //–>
    </SCRIPT>

    <A HREF=”javascript:showHide(’div1′)”>Expand/Collapse</A>
    <div id=”div1″ style=”display:none;border:thin solid;”>
    <?php if ( function_exists(cs_print_smilies) ) {cs_print_smilies();} ?>
    </div>

I hope this helps those who were confused with this plugin :uhh: If you have any questions, please leave me a comment okay :D

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Live
  • Furl
  • Technorati
  • blogmarks
  • Blogosphere News
  • Reddit
  • StumbleUpon



RSS feed | Trackback URI

3 Comments »

Comment by realitas
2008-11-09 08:42:40

cuma buat pembetulan penulisan coding nya.. :yay:

Expand/Collapse Smilies

 
Expand/Collapse Smilies
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post

  • Recent Posts

  • Recent Comments

  • Archives