Posts Tagged ‘Wordpress’

Javascript Comment Smilies

Sunday, June 7th, 2009

As you can see in the bottom of this page, smilies can be inserted easyly using Javascript into my comment’s textarea. This only a simple Javascript feature using simple function. Before we start, i recommend you to use these plugins: Smilies Themer. Download and install the plugin.

I consider you already done that. So we go to the next step. Go to your admin panel, and open the Appearance Editor to edit your page. Open/click Comments (comments.php) to edit comment php file. Find this tag:

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

Put a name of the form so the function will work, it look like this:

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" name="chat">

Skip it for a while, open notepad or any text aditor the copy this codes:

<div id="smilies" width="90%">
<a href="javascript:DoSmilie(' smilies_code1 ')"><img src="smilies_url1"></a>
<a href="javascript:DoSmilie(' smilies_code2 ')"><img src="smilies_url2"></a>
<a href="javascript:DoSmilie(' smilies_code3 ')"><img src="smilies_url3"></a>
</div>

Legend:

  • red = codes that used for smilies to appear. (ex: ‘ :D ‘ ) This symbol will becomesĀ  when you post a comment.
  • blue = visitor/poster can select the smilies based on the preview.

How to find two of them? Remember you already installing the recomended plugins? Open it from your setting. You’ll see something like this:

smilies_option

Select one of available smilies and click Update Options. Click on the Preview link to preview the selected smilies. You’ll see the popup windows like this:

smilies_preview1

Copy the symbol and insert into the red, then right click at the image preview and copy the image location and paste into the blue. Repeat this step for more smilies.

When you are done in notepad, copy the wole codes, open the comment.php file we skipped before, paste before <textarea> tag.

For the final step, add some javascript to make it work, copy this javascript codes and insert on the bottom or comment.php file.

<script type="text/javascript">
function x(){
return;
}
function DoSmilie(addSmilie, messageDef){
var addSmilie, messageDef, revisedMessage;
var currentMessage = document.chat.comment.value;

if(currentMessage==messageDef){currentMessage='';}
revisedMessage = currentMessage+addSmilie;
document.chat.comment.value=revisedMessage;
document.chat.comment.focus();
return;
}
</script>

What are you waiting for?? Save it quickly and see the live preview.. ;)

Cherry Truffle – Free Premium WordPress Theme

Monday, June 1st, 2009

Now im going to share a premium wordpress theme from Elegant WPT. This template’s price was about $19.95 but you can get it for free in here. Just download the package and upload into your wordpress directory. You can edit the header because i think you won’t like it..lol.

I have not test the theme yet, but mine (theme that i am using right now) comes from a same site. And it work fine for me. So why dont you try this one? Here is the preview page: Cherry Truffle

1. Content of package:

  • Theme Files (php, css, javascript)
  • Limit Post Plugin
  • Page Navigation Plugin
  • Psd Files (logo photoshop image)

2. Download Link:

 My 4Shared

3. Instructions:

Extract the package using winzip or winrar, open the “readme.URL” file and follow the installation instructions.

Enjoy the premium wordpress template only $0 in price. By the way, please DO NOT REDISTRIBUTE this template or article in any site. Thanks ;)