Adding Smilies Option

Just Adding Smilies Option on Comment at uniblog.stie-mce.ac.id
just doit simple! paste this code to the file comments.php above <textarea> … </texarea>

<!-- smilies -->
<script type="text/javascript">function grin(tag) {
var myField;
if (document.getElementById('content') && document.getElementById('content').type == 'textarea') {
myField = document.getElementById('content');
}
else if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {
myField = document.getElementById('comment');
}
else {
return false;
}
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = tag;
myField.focus();
}
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
var cursorPos = endPos;
myField.value = myField.value.substring(0, startPos)
+ tag
+ myField.value.substring(endPos, myField.value.length);
cursorPos += tag.length;
myField.focus();
myField.selectionStart = cursorPos;
myField.selectionEnd = cursorPos;
}
else {
myField.value += tag;
myField.focus();
}
}

</script>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_mrgreen.gif" alt=":mrgreen:" onclick="grin(':mrgreen:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_neutral.gif" alt=":neutral:" onclick="grin(':neutral:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_twisted.gif" alt=":twisted:" onclick="grin(':twisted:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_eek.gif" alt=":shock:" onclick="grin(':shock:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_smile.gif" alt=":smile:" onclick="grin(':smile:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_confused.gif" alt=":???:" onclick="grin(':???:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_cool.gif" alt=":cool:" onclick="grin(':cool:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_evil.gif" alt=":evil:" onclick="grin(':evil:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_biggrin.gif" alt=":grin:" onclick="grin(':grin:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_redface.gif" alt=":oops:" onclick="grin(':oops:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_razz.gif" alt=":razz:" onclick="grin(':razz:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_rolleyes.gif" alt=":roll:" onclick="grin(':roll:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_wink.gif" alt=":wink:" onclick="grin(':wink:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_cry.gif" alt=":cry:" onclick="grin(':cry:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_surprised.gif" alt=":eek:" onclick="grin(':eek:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_lol.gif" alt=":lol:" onclick="grin(':lol:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_mad.gif" alt=":mad:" onclick="grin(':mad:');"/>
<img xsrc="http://blog.compactbyte.com/wp-images/smilies/icon_sad.gif" alt=":sad:" onclick="grin(':sad:');"/>
<br />
<!-- -->

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s