Re: How can I limit the amount of emoticons(smilies) that can be posted in

Smartys wrote:
viperjosh wrote:
Smartys wrote:

Can you email me a copy of your parser.php (smartys@gmail.com)

on its way smile

The copy you sent me doesn't have the new function in it wink

Yeah, I took it out after the code wasn't working - remember it was giving the error if you tried to use a registered username

27 (edited by Smartys 2006-06-03 00:37)

Re: How can I limit the amount of emoticons(smilies) that can be posted in

You added the function in the correct place (at the end of parser.php, outside of anything else)?
You added the edits to post.php and edit.php in the right place?

What version of PHP are you using?

Re: How can I limit the amount of emoticons(smilies) that can be posted in

Smartys wrote:

You added the function in the correct place (at the end of parser.php, outside of anything else)?
You added the edits to post.php and edit.php in the right place?

What version of PHP are you using?

Yep, everything added in correct locations.

I'm running 4.4.2

29 (edited by Smartys 2006-06-03 00:53)

Re: How can I limit the amount of emoticons(smilies) that can be posted in

Aha, I realized that what I was doing required >= 5.1.0 big_smile

Edit: OK, new function

function check_smilies($text)
{
    global $smiley_text;

    $text = ' '.$text.' ';

    $num_smilies = count($smiley_text);
        
    $num_message_smilies = 0;

    for ($i = 0; $i < $num_smilies; ++$i)
    {
        $num_message_smilies = $num_message_smilies + substr_count($smiley_text[$i]);
    }
    
    return $num_message_smilies;
}

Re: How can I limit the amount of emoticons(smilies) that can be posted in

Hm. Nope. Same thing.

sad

Re: How can I limit the amount of emoticons(smilies) that can be posted in

Because I'm being stupid tongue

function check_smilies($text)
{
    global $smiley_text;

    $text = ' '.$text.' ';

    $num_smilies = count($smiley_text);
        
    $num_message_smilies = 0;

    for ($i = 0; $i < $num_smilies; ++$i)
    {
        $num_message_smilies = $num_message_smilies + substr_count($text, $smiley_text[$i]);
    }
    
    return $num_message_smilies;
}

Try that

Re: How can I limit the amount of emoticons(smilies) that can be posted in

Awesome! Thank you SO much for taking the time to help me!

smile

33

Re: How can I limit the amount of emoticons(smilies) that can be posted in

Nice work smarty and thank you viper for asking smile

فهد