• 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
    ?>

Viewing 15 replies - 16 through 30 (of 67 total)
  • I don’t think it has anything to do with my zone alarm and I don’t use the pop-up comments either. I use the one that loads in the main window too.

    Anonymous: Are you getting the Error: ‘document.form.comment’ even without using the hack we are discussing here? Even so, humor us and try disabling your Zonealarm to test the comments. Without knowing much about your situation or your problem makes us shoot in the blind. A link to your blog/comment area might help us get a better picture.

    a.k.a. anonymous – had a little time to register today πŸ™‚ Please, note I don’t use the popup comments and I only get the error when I try to add the clickable smilies. Otherwise, everything works fine.
    1. Error: ‘document.form.comment’ is null or not an object
    2. I turned off my Zone Alarm and I still got the same error.
    3. I tried out the other smiley tutorial from the fplanque and that worked beautifully.
    URL: http://meowie.net/log/

    Ok Shae, I see your problem now, much more clear. I can replicate the problem on my blog as well. I am swamped at this moment but as soon as I have some time, I will look at it. πŸ™‚
    Peace

    The selection.createRange() code that inserts at the cursor position only works in IE. You should steal the insertion code from the wp-quicklinks.js to make it cross-browser compatible.

    Thank You πŸ™‚ I really appreciate it!

    It works {{HUGS}} Thanks Mark!

    πŸ˜› you are very welcome! Spread the word about WP is all I ask in return!

    Sorry, but I forgot to ask you one last question about the smilies clickable hack πŸ™‚ heh
    Is their a way of controlling how many smilies show up and how can I edit the :code for smilies:? I know I had an old tagboard and I was able to change the smilies and codes via some smile.db file, but I don’t know how to change it on this one. Do you know? If not, I’ll just play around with it.
    Thanks again!

    Smilie code is translated according to the code (do a search for $b2smiliestrans) in b2vars.php inside your b2-include folder. If your smilie is an image in your simlies folder and the name corresponds inside your b2vars.php, it gets translated and shows up on your comments page.

    Okay. Thank You!

    Thread Starter southerngal

    (@southerngal)

    You are welcome, glad I could help! πŸ™‚

    I’ve installed WordPress and it works wondrefully!
    Well, almost. The only thing that does not work are the smilies. I can’t even get them to show up in the regular blog postings. If I put in πŸ˜‰ then I get πŸ˜‰ on the blog page.
    I went into the admin settings page and put smilies to ‘yes’. Any other stuggestions?
    This is a default install, no hacks.
    Thanks,
    Roger

    Thread Starter southerngal

    (@southerngal)

    Do you have your default path to the smilies correct? You can find that under options/general blog settings. Make sure you have that path correct or they will not show up. πŸ™‚

    I have checked out your suggestion and I do have the path correct:
    http://www.domainname.com/blog/b2-img/smilies
    I have double checked this on the server and in the code. It is correct.
    Any other suggestions are much appreciated.
    Thanks,
    Anon

Viewing 15 replies - 16 through 30 (of 67 total)
  • The topic ‘Clickable Smilies in comments.’ is closed to new replies.