boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

smilies are in but aren't showing up when commenters usethem

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
jackiec



Joined: 27 Jan 2004
Posts: 12
Location: Pennsylvania

PostPosted: Wed Jan 28, 2004 3:00 pm    Post subject: smilies are in but aren't showing up when commenters usethem Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Cyberian75



Joined: 26 Sep 2002
Posts: 1007
Location: Washington

PostPosted: Wed Jan 28, 2004 11:53 pm    Post subject: Reply with quote

Have you enabled the smilie feature from b2config.php file?
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
jackiec



Joined: 27 Jan 2004
Posts: 12
Location: Pennsylvania

PostPosted: Thu Jan 29, 2004 2:22 am    Post subject: Reply with quote

Uh..probably not. How do I do that?
_________________
-Jackie-
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Cyberian75



Joined: 26 Sep 2002
Posts: 1007
Location: Washington

PostPosted: Thu Jan 29, 2004 2:48 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
jackiec



Joined: 27 Jan 2004
Posts: 12
Location: Pennsylvania

PostPosted: Thu Jan 29, 2004 2:52 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group