View previous topic :: View next topic |
Author |
Message |
jackiec
Joined: 27 Jan 2004 Posts: 12 Location: Pennsylvania
|
Posted: Wed Jan 28, 2004 3:00 pm Post subject: smilies are in but aren't showing up when commenters usethem |
|
|
click here to see my popup comments
as you can see, the smilies are in, and they're ones that I edited. When you click on them, the code for them appears in the comment box. All good. But then, once you hit Submit, the smilie image doesn't actually appear in the comment. Did I do something wrong?
1.) I modified the smilies code in b2config.php
2.) I added this to my b2comments.php and b2commentspopup.php:
Code: | <form action="b2comments.post.php" method="post" name="form"> |
3.) I added this to the bottom of b2commentspop.php (where I wanted the smilies to appear) :
Code: | <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 == 8) { //new row after specified number of smilies
echo '<br />';
$newrow = 0;
}
}
$prev_val = $val;
}
?> |
so...does anyone know why it didn't work? _________________ -Jackie- |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1007 Location: Washington
|
Posted: Wed Jan 28, 2004 11:53 pm Post subject: |
|
|
Have you enabled the smilie feature from b2config.php file? _________________ Michael P. |
|
Back to top |
|
 |
jackiec
Joined: 27 Jan 2004 Posts: 12 Location: Pennsylvania
|
Posted: Thu Jan 29, 2004 2:22 am Post subject: |
|
|
Uh..probably not. How do I do that? _________________ -Jackie- |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1007 Location: Washington
|
Posted: Thu Jan 29, 2004 2:48 am Post subject: |
|
|
In b2config.php file...
Quote: |
# set this to 1 to enable smiley conversion in posts
# (note: this makes smiley conversion in ALL posts)
$use_smilies = 1;
|
_________________ Michael P. |
|
Back to top |
|
 |
jackiec
Joined: 27 Jan 2004 Posts: 12 Location: Pennsylvania
|
Posted: Thu Jan 29, 2004 2:52 am Post subject: |
|
|
thanks...well..I put it up, but the other problem is still there. hopefully it will just disappear on it's own cause i don't even understand what the problem is lol. _________________ -Jackie- |
|
Back to top |
|
 |
|