• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

messages don\'t refresh

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
4 posts • Page 1 of 1

Postby vionic » Mon Jul 24, 2006 3:58 pm

I've modified the chat, but i didn't modify anything with the xajax refresh.
If I type a message, the textfield clears, but the new message is not displayed.
even with firefox 1.5.0.4 either with IE 5.0.
The chat is @ ratgeberzentrale.de/chat

thx.
Mathias@vionic.info
vionic
New member
 
Posts: 3
Joined: Mon Jul 24, 2006 3:54 pm
Top

Postby phpfreechat » Mon Jul 24, 2006 8:52 pm

Could you try with the lastest stable release ? 0.9.3 ?
Could you explain what you modified in the chat ?
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby vionic » Tue Jul 25, 2006 7:13 am

I modified the postfilter (included a bad word - filter),
Code: Select all
function PostFilterMsg($msg)
  {
    //$c =& phpFreeChatConfig::Instance();
    //    $msg = preg_replace('/('.preg_quote($c->nick,'/').')/i', "<strong>$1</strong>", $msg );
    $msg = preg_replace('/n/i', "", $msg );
   
   
    /**
   *Wortfilter using ../wortfilter.txt
   */
     $badwords = file($_SERVER['DOCUMENT_ROOT'].'/chat/wortfilter.txt');
     foreach($badwords as $badwrd)
      {
    $msg = preg_replace('/('.trim($badwrd).')/i','[Bad Word]',$msg);
    }
   
    return $msg;
  }

included a spam-filter in the pfccommand_send.class.php
Code: Select all
// check the nick is not allready known
    $nick = phpFreeChat::FilterSpecialChar($c->nick);
    $text = phpFreeChat::PreFilterMsg($msg);
    $errors = array();
   
    if(!$_SESSION['spamtime'])
      {
         $_SESSION['spamtime'] = time();
         $_SESSION['count'] = 1;
      }
      elseif ($_SESSION['count'] < 2)
      {
         if($_SESSION['spamtime']+10 < time())
         {$_SESSION['spamtime'] = time();}
         else
         {$_SESSION['count']++;}
      }
      else
      {
         if($_SESSION['spamtime']+10 < time())
         {$_SESSION['spamtime'] = time(); $_SESSION['count']--;}
         else
         {$errors[$c->prefix.'spam'] = _pfc("You are only allowed to post 2 times in 10 seconds!");}
         
      }
         
   
    if ($text == "") $errors[$c->prefix."words"] = _pfc("Text cannot be empty");
    if ($nick == "") $errors[$c->prefix."handle"] = _pfc("Please enter your nickname");
    if (count($errors) == 0)
    {
     
      $container =& $c->getContainerInstance();
      $container->writeMsg($nick, $text);
      if ($c->debug) pxlog("Cmd_send[".$c->sessionid."]: a user just sent a message -> nick=".$c->nick." m=".$text, "chat", $c->getId());

If I refresh the whole page, everythig works.
Do you have an idea?
Last edited by vionic on Tue Jul 25, 2006 7:15 am, edited 1 time in total.
vionic
New member
 
Posts: 3
Joined: Mon Jul 24, 2006 3:54 pm
Top

Postby vionic » Tue Jul 25, 2006 1:09 pm

I've tested sth. new, I've placed the pfc.updateChat() script command in the _send.calss.php.
Now it works but I don't understand why.
vionic
New member
 
Posts: 3
Joined: Mon Jul 24, 2006 3:54 pm
Top


Post a reply
4 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 17 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub