Clickable Smilies in comments.
-
Place the following after “your email” line in the b2commentspopup.php:
<label for=”url”>Your URL:</label>
<input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url; ?>” size=”28″ tabindex=”3″ />
Click on a smilie to add it to your comment!
<script language=”JavaScript” type=”text/javascript”>
function emoticon(theSmilie) {
theSmilie = ‘ ‘ + theSmilie + ‘ ‘;
if (document.form.comment.createTextRange && document.form.comment.caretPos) {
var caretPos = document.form.comment.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length – 1) == ‘ ‘ ? theSmilie + ‘ ‘ : theSmilie;
} else {
document.form.comment.value += theSmilie;
}
document.form.comment.focus();
theSmilie = ”;
}
</script>
<?php
$newrow = 0;
$prev_val=””;
asort($b2smiliestrans);
while (list ($key, $val) = each ($b2smiliestrans)) {
if($prev_val and $val==$prev_val) { }
else if(!$prev_val or ($prev_val and $val!=$prev_val)){
?>
<img src=”<?php echo “$smilies_directory/$val”; ?>” alt=”<?php echo $key; ?>” border=”0″ onclick=”emoticon(‘<?php echo $key; ?>’)” onmouseover=”style.cursor=’hand'” />
<?php
$newrow++;
if($newrow == 14) { //new row after specified number of smilies
echo ‘
‘;
$newrow = 0;
}
}
$prev_val = $val;
}
?>
<label for=”comment”>Your Comment:</label>
<textarea name=”comment” id=”comment” cols=”40″ rows=”10″ tabindex=”4″>
End before: <?php } else { // comments are closed ?>
Sorry, comments are closed at this time.
<?php }
} // end password check
?>
- The topic ‘Clickable Smilies in comments.’ is closed to new replies.