NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 07-07-2009 18:59:02

avch
Guest

More than default Smilies?

Hi, I was playing around with the smilies hack in hack.php, and I was wondering if I could add more than what's on the smilies list? I tried, but it does not show up at all. =\

#2 07-07-2009 22:45:52

avch
Guest

Re: More than default Smilies?

D'OH! Never mind, I figured t out, sorry about that. Although, I have another question, how do I add the smilies on a separate page within Wacintaki? You know, with a link to the smilies at the top?

#3 07-08-2009 04:44:12

Waccoon
Administrator

Re: More than default Smilies?

That has to be coded into the board.  You can copy/paste the smilies rendering code from "comment.php".  Just search for "print smilies" to find it.

Offline

#4 07-08-2009 14:41:04

avch
Guest

Re: More than default Smilies?

Ah, thank you so much! One thing, where should the code end in the "print smilies" code? I was guessing this

Code:

<?
// Print smilies
$q = count ($smilies_group);
if (defined('MAX_SMILIES') && MAX_SMILIES < $q) {
    $q = MAX_SMILIES;
}

if ($cfg['smilies'] == 'yes' && $q > 0) {
    reset ($smilies_group);
    for ($i=0; $i < $q; $i++) {
        list ($s_code, $s_img) = each ($smilies_group);
?>

#5 07-09-2009 01:17:38

Waccoon
Administrator

Re: More than default Smilies?

Nope, that is missing a curly bracket.  Here is the full code, with some more comments:

Code:

<?
// Print smilies
// Make sure we don't print too many
$q = count ($smilies_group);
if (defined('MAX_SMILIES') && MAX_SMILIES < $q) {
    $q = MAX_SMILIES;
}

// If smilies are enabled
if ($cfg['smilies'] == 'yes' && $q > 0) {

    // Start at the beginning of the array ("each" requires this)
    reset ($smilies_group);

    // For each smiley
    for ($i=0; $i < $q; $i++) {
        list ($s_code, $s_img) = each ($smilies_group);

                    // Print the HTML code for one smiley
?>
                    <img onclick="insertText('comment', ' <?=$s_code?> ');" onmouseover="if (style.cursor) style.cursor='hand';" src="./smilies/<?=$s_img?>" alt="<?=$s_code?>" />
<?
        // Wrap smilies so they don't form uneven lines across the screen
        if ($breakpoint > 0) {
            if (($i % $breakpoint) == $breakpoint - 1) {
                // End the line, and start a new line
                echo "<br />\n";
            }
        }
    }
?>
                    <br />
<? } ?>

Offline

#6 07-09-2009 13:55:31

avch
Guest

Re: More than default Smilies?

Thank you for the code! But, now when I put the code it in it's own page, I get this error when I click the link

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

#7 07-10-2009 03:50:54

Waccoon
Administrator

Re: More than default Smilies?

Hmm... the code works fine for me.  That error usually means a quote or double quote got messed up.  Here, I put it in a file, so it'll be easier to copy/paste into the page you're making:  (code)

Offline

#8 07-10-2009 13:20:14

avch
Guest

Re: More than default Smilies?

Thank you so much! It works perfectly now!

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB