1 (edited by Mako 2005-01-15 08:48)

Topic: Odd Problem With Smilies in Help.php

http://img18.exs.cx/img18/8457/untitled6la.jpg
I am entering in a bunch of smilies (250 roughly) for my forum (using my Easy Smilies mod) and ran into this odd parse erorr in "help.php". Line 144's area is:

// Display the smiley set
require PUN_ROOT.'include/parser.php';

$num_smilies = count($smiley_text);
for ($i = 0; $i < $num_smilies; ++$i)
{
    // Is there a smiley at the current index?
    if (!isset($smiley_text[$i]))
        continue;

    echo "\t\t".'    '.$smiley_text[$i];

    // Save the current text and image
    $cur_img = $smiley_img[$i];
    $cur_text = $smiley_text[$i];

    // Loop through the rest of the array and see if there are any duplicate images
    // (more than one text representation for one image)
    for ($next = $i + 1; $next < $num_smilies; ++$next)
    {
        // Did we find a dupe?
        if ($smiley_img[$i] == $smiley_img[$next])
        {
            echo ' '.$lang_common['and'].' '.$smiley_text[$next];

            // Remove the dupe so we won't display it twice
            unset($smiley_text[$next]);
            unset($smiley_img[$next]);
        }
    }

    echo ' '.$lang_help['produces'].' <img src="img/smilies/'.$cur_img.'" alt="'.$cur_text.'" /><br />'."\n";
}

Line 144 is:

if ($smiley_img[$i] == $smiley_img[$next])

Any idea as to what is cuasing this and why it 1) continues to display the smilies and 2) does not display 3dwhitesmile.gif when it is there in /img/smilies. Even the text is correct for it.

Any idea?

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer

2

Re: Odd Problem With Smilies in Help.php

in my forum there are no problems

Yours, Benny.

Re: Odd Problem With Smilies in Help.php

Benny wrote:

in my forum there are no problems

you don't have any extra smilies so i assume you don't use the mod

Re: Odd Problem With Smilies in Help.php

Does this help?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Odd Problem With Smilies in Help.php

Yeah it does actually. Took me a few minutes to figure out that I had to replace that line with the one below it. Trac looks pretty cool.

Thanks Rickard.

"You start coding. I'll go find out what they want." - Computer Analyst to Programmer