• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Working out the wrinkles/bugs in a phpbb-3.0.8/pfc-1.3 integ

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

Post a reply
7 posts • Page 1 of 1

Postby phreadom » Mon Dec 13, 2010 10:43 pm

I'd just like to mention that I've gotten my own copy of it up and running ( http://nnb.me/chat/ ), including avatars and working profile links (which open in a separate tab) in the whois popup... along with the ip and useragent (encoded to avoid XSS vulnerabilities) only visible to admins... time offset calculated from the users time zone setting, language based on the phpbb language setting... (using dyn_params) and so forth.

But... I have a few questions about dyn_params though, and about a few other glitches I seem to be seeing (and a bug).

But first, the formalities...

Support Template
PFC Version: PFC 1.3 on both dev and live site (same code on both).
PHP Version: Apache/2.2.17 (Win32) PHP/5.3.3 on my local development server, and nginx/0.8.52 PHP/5.3.2-1ubuntu4.5 on the live version I've linked here.

Shared or Dedicated Hosting: Live site is hosted on a Linode virtual host.
Link to your website: http://nnb.me/chat/

Are you able to reproduce the issue on the official demo (http://www.phpfreechat.net/demo)? -- Not really applicable to the issues I'm dealing with. :)

Have you set any parameters?
If so, please include your entire code, using the [code ] and[/code ] tags (without the space). -- Yes, but see explanation below. I'll include the code if necessary. :)

What is the issue you are experiencing in detail? -- See below.

Are you seeing any error messages, such as javascript errors? -- Only the one minor CSS error about an undefined background-color.

With that out of the way... :)

First, for the dyn_params, I'm pulling the language settings from the phpbb profile, so I included that... and if I'm understanding things correctly, any variables that are user specific should be included in dyn_params as well? So would that include "language","nick","nickmeta","ip","useragent","isadmin","time_offset" etc? I don't get the impression that it's supposed to, but I'm not grasping why.

Second (and rather less important), I have a persistent warning in the developer console about
Code: Select all
15:21:36.752: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://(localdevserver)/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser

I've dug around for it, but can't seem to find what's causing it. :(

Third, I also see on many of my refreshes (I think only after a rehash) that initially the chat path variables don't get set and everything looks for the files without prepending the data paths... a second refresh generally fixes everything. Again, not a very important problem, but a minor irritation I'd like to fix if possible. :)

Fourth, and lastly... in the "/chat/i18n/ja_JP/main.php" file, on lines 294-299 (shown below) it appears that one of the SVN revisions didn't apply correctly.

Code: Select all
// line 83 in chat.js.tpl.php
<<<<<<< .mine
$GLOBALS["i18n"]["Choosen nickname is allready used"] = "選択したニックネームは既に試用されています";
=======
$GLOBALS["i18n"]["Chosen nickname is already used"] = "選択したニックネームは既に試用されています";
>>>>>>> .r1249

simply changing it to the following fixes that problem...

Code: Select all
// line 83 in chat.js.tpl.php
$GLOBALS["i18n"]["Chosen nickname is already used"] = "選択したニックネームは既に試用されています";

Also, on line 344 (and a few others)...

Code: Select all
$GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = "%1$s により %1$s から追い出されました - 理由: %3$s";

first I got an error because of using an uninitialized variable, the $s. Simply adding
Code: Select all
$s = '';

at the top of the file fixed this...

second, I believe the correct code for that line should be

Code: Select all
$GLOBALS["i18n"]["kicked from %s by %s - reason: %s"] = "%2$s により %1$s から追い出されました - 理由: %3$s";

changing the first translated variable from %1$s to %2$s.


This my first time really setting this up (I looked at PFC 1.1 awhile back, but passed on it at the time, but am a bit more experienced and liking PFC 1.3 a lot more this time around), so I've made a few rookie mistakes so far, such as not keeping the PFC sources in a separate directory for ease of upgrade. ;) oops. I might try to redo my work so far to use the recommended filesystem layout.

I also had some trouble getting my own custom theme to work... it seemed to insist on using the variables from the default theme even when I wasn't using it, so I ended up just modifying the default theme... again, probably something I overlooked? :( (perhaps I needed to manually flush the cache?)

I'd include my code here straight off, but I had to include 2 functions from PHPBB to modify them slightly to be able to use their output in PFC (for the avatar and profile stuff... again, probably due to my own lack of programming ability), and I have other code included for a quiz above the chat etc... so the code is quite a bit larger than usual. But I'd be glad to provide the relevant parts if needed. :) (I've also changed some of the other theme files obviously... chat.js.tpl.php, chat.html.tpl.php, customize.js.php, and style.css.php)

I'm just getting up to speed on this, so please go gently on me. ;) But I'd love to iron out the wrinkles with my setup, which is on my small personal site at the moment, so that I can launch a similar setup on my work site, which has several thousand users. :o I really want to make sure I have things buttoned up tightly, the code cleaner, and more efficient etc. :)

(I've read all the required guides and FAQs as noted in the Announcement thread linked up top.)

Thanks in advance!
phreadom
Support Team
 
Posts: 13
Joined: Fri Apr 04, 2008 8:03 pm
Top

Postby OldWolf » Tue Dec 14, 2010 1:28 am

1. It's hit or miss. Some of those variables are stored as cache parameters, some are already dynamic. I know it seems odd, the design is just meant to save on calculations, given that those variables are called on every single refresh (2-3 seconds per, for each user).
2-3 We'll likely need to see the code for these.
4. Thanks for the report, I would suggest reposting as a bug report in a separate thread so it has a higher likelihood of getting added in. :)

Thanks for taking the time to read the resources we provide and add extra detail in your thread, it really makes it much easier to respond to your questions!
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby phreadom » Tue Dec 14, 2010 2:43 am

Thanks OldWolf! :)

Well, I warned you, but here it is... my main chat file from "/chat/index.php" ;)

Will I need to include my chat.js.tpl.php, chat.html.tpl.php, customize.js.php, and style.css.php files as well? (and possibly my common.inc, and thus main.css as well?) I would hope not. :(

The CSS background-color error only shows up on the chat page... none of the other pages on the site that share the same (main site) includes.

Also, it was there before I added the quiz to the page and its associated javascript as well, so I doubt that's the problem.

Please let me know what I should try, or what else I might need to include here. :)

Thank you again!

Code: Select all
<?php
include($_SERVER["DOCUMENT_ROOT"] . "/includes/common.inc");

require_once dirname(__FILE__)."/src/phpfreechat.class.php";

// Initialize $params array (must do this BEFORE you set all the stuff or you wipe it all. OOPS!)
$params = array();

get_username_string ;
$oog = $user->data[username];
$phpbb_root_path = "../forum/";

if ($oog == "Anonymous"){
  $chatloginredirect = '/forum/ucp.'. $phpEx .'?mode=login&redirect='. $user->page['script_path'] . $user->page['page_name'];
  header("Location: " . append_sid($chatloginredirect));
} else {
// since we're running utf-8 already, we don't need this next line.
// if you're not running utf-8, you need this line.
/*  $params["nick"] = iconv("ISO-8859-1", "UTF-8", $oog); */
  $params["nick"] = $oog;

  if ($user->data['is_registered'] == true){
    include($phpbb_root_path . './includes/functions_display.' . $phpEx);
    $sql = "SELECT u.user_id, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.username, u.user_rank, u.user_colour
    FROM " . USERS_TABLE . ' AS u
    WHERE u.user_id = ' . $user->data['user_id'];

    $result = $db->sql_query($sql,300);
    $row = $db->sql_fetchrow($result);

    function get_user_avatar_nickmeta($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
    {
       global $user, $config, $phpbb_root_path, $phpEx, $params;

       if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
       {
          return '';
       }

       $avatar_img = '';

       switch ($avatar_type)
       {
          case AVATAR_UPLOAD:
             if (!$config['allow_avatar_upload'] && !$ignore_config)
             {
                return '';
             }
             $avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
          break;

          case AVATAR_GALLERY:
             if (!$config['allow_avatar_local'] && !$ignore_config)
             {
                return '';
             }
             $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
          break;

          case AVATAR_REMOTE:
             if (!$config['allow_avatar_remote'] && !$ignore_config)
             {
                return '';
             }
          break;
       }

       $avatar_img .= $avatar;

      $params["nickmeta"] = array(
        'avatar' => (str_replace(' ', '%20', $avatar_img)),
        'avatar_width' => $avatar_width,
        'avatar_height' => $avatar_height,
        'avatar_alt' => ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt),
      );
    }

    /* use custom "get_user_avatar" function to set correct nickmeta avatar vars */
    get_user_avatar_nickmeta($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height'], '',true);   




    function get_username_string_nickmeta($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
    {
       static $_profile_cache;

       // We cache some common variables we need within this function
       if (empty($_profile_cache))
       {
          global $phpbb_root_path, $phpEx;

          $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}');
          $_profile_cache['tpl_noprofile'] = '{USERNAME}';
          $_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};font-weight:bold;" class="username-coloured">{USERNAME}</span>';
          $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}"  style="font-weight:bold;" onclick="window.open(this.href,'_blank');return false;">{USERNAME}</a>';
          $_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};font-weight:bold;" class="username-coloured" onclick="window.open(this.href,'_blank');return false;">{USERNAME}</a>';
       }

       global $user, $auth;

       // This switch makes sure we only run code required for the mode
       switch ($mode)
       {
          case 'full':
          case 'no_profile':
          case 'colour':

             // Build correct username colour
             $username_colour = ($username_colour) ? '#' . $username_colour : '';

             // Return colour
             if ($mode == 'colour')
             {
                return $username_colour;
             }

          // no break;

          case 'username':

             // Build correct username
             if ($guest_username === false)
             {
                $username = ($username) ? $username : $user->lang['GUEST'];
             }
             else
             {
                $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
             }

             // Return username
             if ($mode == 'username')
             {
                return $username;
             }

          // no break;

          case 'profile':

             // Build correct profile url - only show if not anonymous and permission to view profile if registered user
             // For anonymous the link leads to a login page.
             if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile')))
             {
                $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
             }
             else
             {
                $profile_url = '';
             }

             // Return profile
             if ($mode == 'profile')
             {
                return $profile_url;
             }

          // no break;
       }

       if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
       {
          return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
       }

       return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
    }


    $username_trim = (strlen($row['username']) > 20) ? substr($row['username'],0,20) . ".." : $row['username'];

    // use custom "get_username_string" function to set correct nickmeta profile links to
    // make them open in a new tab (could probably be done MUCH more efficiently) ;)
    $u_profile    = get_username_string_nickmeta('full', $row['user_id'], $username_trim, $row['user_colour']);

    $userAgent = (isset($_SERVER['HTTP_USER_AGENT']) ? htmlentities($_SERVER['HTTP_USER_AGENT']) : '');
    $params["nickmeta"]["useragent"] = $userAgent;
    $params["nickmeta"]["profile"] = $u_profile;

    $db->sql_freeresult($result);
  }


  // Check group_id matchs the "Administrators" group into phpbb_groups table
  if ($user->data['group_id'] == 5){
    $params["isadmin"] = true;
  } else {
    $params["isadmin"] = false;
  }
}

$params['admins'] = array('admin' => 'notmyrealpassword',);
$params["max_msg"] = 24;
$params["max_displayed_lines"] = 300;
$params["frozen_nick"] = true;
$params["channels"] = array("The Lounge","The Game Room",);
$params["max_channels"] = 6;
$params["max_nick_len"] = 20;
$params["timeout"] = 60000;
$params["skip_proxies"] = array("censor");
$params["time_offset"] = (($user->data[user_timezone] * 60) * 60);
$params["nickmeta_private"] = array('ip','useragent',);
$params["title"] = 'Welcome to the webchat. Webchatへようこそ!';
$params["height"] = "420px";
$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;

// get the proper locale setting from phpbb and make sure it
// matches one of the available ones here. if so, use that instead.
if ($user->data['user_lang'] == "ja"){
  $params["language"] = "ja_JP";
} else {
  $params["language"] = "en_US";
}

$params["dyn_params"] = array("language");
$params["theme_path"] = dirname(__FILE__)."/themes";

$chat = new phpFreeChat( $params );

function chatheaders(){
  global $chat;

  $headers .=  $chat->printJavascript();
  $headers .=  $chat->printStyle();

$zorobotheaders = <<<END
  <script type='text/javascript' src='./zorobot.js'></script>
  <script>
    var questionList;
    var listOne = [
              ["akai",["red"]],
              ["shimaru",["to close","to be closed"]],
              ["mainichi",["every day"]]
             ];
    var listOneDesc = "This is Quiz number One.";

    var listTwo = [
              ["midori",["green"]],
              ["kiiroi",["yellow"]],
              ["tsuzuku",["to continue","keep on"]],
              ["yorokobu",["to be happy","pleased"]]
             ];
    var listTwoDesc = "This is Quiz number Two. This has a really long description to make sure that everything works correctly. This should wrap multiple lines and so forth so that we can rest assured that the containing box will increase in size.";

    questionList = listOne;

    var listener = new ZorobotListener();
    var zorobot = new Zorobot(questionList, listener);
    var questionText, answerText;

    listener.onNewQuestion = function() {
      var q = zorobot.getCurrentQuestion();
      questionText.innerHTML = q.no + ". " + q.question + " " + zorobot.getLevelString();
    }

    listener.onQuestionHit = function() {
      questionText.innerHTML = "Correct!";
    }

    listener.onQuestionMiss = function() {
      questionText.innerHTML = "Time's Up! Answer: " + zorobot.getCurrentAnswerString();
    }

    listener.onGameStop = function() {
      questionText.innerHTML = "Game Completed!";
    }

    function setList(list){
      listval = document.getElementById("choosequizselect")[list].getAttribute("value");
      if (listval == 'one'){
        questionList = listOne;
        zorobot = new Zorobot(questionList, listener);
        document.getElementById("quizDesc").innerHTML = listOneDesc;
      } else if (listval == 'two'){
        questionList = listTwo;
        zorobot = new Zorobot(questionList, listener);
        document.getElementById("quizDesc").innerHTML = listTwoDesc;
      } else {
        questionList = listOne;
        zorobot = new Zorobot(questionList, listener);
        document.getElementById("quizDesc").innerHTML = "This is Quiz number One by default.";
      }
    }

    function initzoro() {
      questionText = document.getElementById("questionText");
      answerText = document.getElementById("answerText");
      answerText.onkeydown = function keydown(e) {
        var c = Util.getKeyCode(e);
        if (c == 13) { // enter key
            zorobot.answer(answerText.value);
            answerText.value = "";
        }
      }
      answerText.focus();
      zorobot.start();
    }
  </script>

END;
$headers .= $zorobotheaders;
return $headers;
}

$additionalheaders = chatheaders();

pageheader('日本語の勉強 - Nihongo no Benkyou : チャーット 「Chat」','',$additionalheaders);

?>

<div id="logobox">

<?php logomenu('chat','Chat'); ?>

</div>


<div id="container">

  <?php navbar('chat'); ?>

  <!-- begin main body -->

  <div style="text-align:left;border:1px solid #ffdd77;padding:8px 10px 10px;color:#888888;background-color:#ffffff;margin:10px 5px;clear:both;">
    <div id="questionText" style="width:600px;padding:0px 0px 10px;font-size:14px;"><span style="font-size:13px;">☆</span> Please select a quiz from the list and hit the "Start Quiz!" button when ready.</div>
    <div id="leftquizbox" style="border:0px solid #cc0000;width:230px;float:left;">
      <input id="answerText" type="text" style="width: 210px;margin-bottom:8px;" /><br />
      <input id="zorobotstart" type="button" value="Start Quiz!" style="background-color:#eafee6;color:#555555;font-weight:bold;" onclick="initzoro();" />
      <input id="zorobotskip" type="button" value="Skip question" style="background-color:#ffffeb;" onclick="zorobot.skip();" />
      <input id="zorobotstop" type="button" value="End Quiz" style="background-color:#ffefef;" onclick="zorobot.start();" />
    </div>
    <div id="rightquizbox" style="border:0px solid #0000cc;width:390px;margin-left:230px;min-height:55px;">
      <form id="choosequiz">
        <select id="choosequizselect" onchange="setList(this.selectedIndex);" style="">
          <option value="one">List One (easy)</option>
          <option value="two">List Two (easy)</option>
        </select>
      </form>
      <div id="quizDesc" style="padding:5px 0px 0px;font-size:12px;">This is Quiz number One. This is just a basic grammar testing quiz to use while bug testing. ;)</div>
    </div>
  </div>

  <?php $chat->printChat(); ?>

</div>


<?php
pagefooter();
?>
phreadom
Support Team
 
Posts: 13
Joined: Fri Apr 04, 2008 8:03 pm
Top

Postby phreadom » Tue Dec 14, 2010 3:51 am

Maybe I can just do a diff patch or something on the other theme files to show the differences. :) That should cut down the amount quite considerably.

(I'm curious if anyone else sees this same error? I only see this in the FF4.0b8pre builds in the "Web Developer" -> "Web Console" (CTRL-Shift-K))

(nnb.phreadom.com is just my local dev server name... it's not available outside my LAN. But the exact same errors show up in the same way on the live site...)

Here's a copy of the log:

Code: Select all
21:33:19.975: Network: POST http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab [HTTP/1.1 200 OK 99ms]
21:33:20.947: Network: GET http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab [HTTP/1.1 200 OK 75ms]
21:33:21.088: Network: GET http://nnb.phreadom.com/css/main.css [HTTP/1.1 304 Not Modified 0ms]
21:33:21.100: Network: GET http://nnb.phreadom.com/chat/zorobot.js [HTTP/1.1 304 Not Modified 1ms]
21:33:21.107: Network: GET http://nnb.phreadom.com/chat/data/public/js/compat.js [HTTP/1.1 304 Not Modified 1ms]
21:33:21.113: Network: GET http://nnb.phreadom.com/chat/data/public/js/md5.js [HTTP/1.1 304 Not Modified 1ms]
21:33:21.119: Network: GET http://nnb.phreadom.com/chat/data/public/js/cookie.js [HTTP/1.1 304 Not Modified 2ms]
21:33:21.125: Network: GET http://nnb.phreadom.com/chat/data/public/js/image_preloader.js [HTTP/1.1 304 Not Modified 2ms]
21:33:21.131: Network: GET http://nnb.phreadom.com/chat/data/public/js/myprototype.js [HTTP/1.1 304 Not Modified 1ms]
21:33:21.138: Network: GET http://nnb.phreadom.com/chat/data/public/js/prototype.js [HTTP/1.1 304 Not Modified 2ms]
21:33:21.144: Network: GET http://nnb.phreadom.com/chat/data/public/js/regex.js [HTTP/1.1 304 Not Modified 2ms]
21:33:21.150: Network: GET http://nnb.phreadom.com/chat/data/public/js/utf8.js [HTTP/1.1 304 Not Modified 2ms]
21:33:21.157: Network: GET http://nnb.phreadom.com/chat/data/public/js/sprintf2.js [HTTP/1.1 304 Not Modified 3ms]
21:33:21.174: Network: GET http://nnb.phreadom.com/chat/data/public/js/activity.js [HTTP/1.1 304 Not Modified 3ms]
21:33:21.181: Network: GET http://nnb.phreadom.com/chat/data/public/js/mousepos.js [HTTP/1.1 304 Not Modified 3ms]
21:33:21.188: Network: GET http://nnb.phreadom.com/chat/data/public/js/createstylerule.js [HTTP/1.1 304 Not Modified 3ms]
21:33:21.195: Network: GET http://nnb.phreadom.com/chat/data/public/js/pfcclient.js [HTTP/1.1 304 Not Modified 3ms]
21:33:21.202: Network: GET http://nnb.phreadom.com/chat/data/public/js/pfcgui.js [HTTP/1.1 304 Not Modified 3ms]
21:33:21.222: Network: GET http://nnb.phreadom.com/chat/data/public/js/pfcresource.js [HTTP/1.1 304 Not Modified 2ms]
21:33:21.415: Network: GET http://nnb.phreadom.com/chat/data/public/js/pfcprompt.js [HTTP/1.1 304 Not Modified 0ms]
21:33:21.549: Network: GET http://nnb.phreadom.com/img/email3.png [HTTP/1.1 304 Not Modified 1ms]
21:33:21.556: Network: GET http://www.google-analytics.com/ga.js [HTTP/1.1 304 Not Modified 61ms]
21:33:21.564: Network: GET http://nnb.phreadom.com/img/bak1.jpg [HTTP/1.1 304 Not Modified 1ms]
21:33:21.572: Network: GET http://nnb.phreadom.com/img/mainbox-top3.png [HTTP/1.1 304 Not Modified 1ms]
21:33:21.580: Network: GET http://nnb.phreadom.com/img/mainbox-mid3.png [HTTP/1.1 304 Not Modified 2ms]
21:33:21.587: Network: GET http://nnb.phreadom.com/img/chat-logo.png [HTTP/1.1 304 Not Modified 1ms]
21:33:21.594: Network: GET http://nnb.phreadom.com/forum/styles/nnb/theme/images/corners_left.png [HTTP/1.1 304 Not Modified 2ms]
21:33:21.615: Network: GET http://nnb.phreadom.com/forum/styles/nnb/theme/images/corners_right.png [HTTP/1.1 304 Not Modified 2ms]
21:33:21.624: Network: GET http://nnb.phreadom.com/forum/styles/nnb/theme/images/icon_ucp.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:21.632: Network: GET http://nnb.phreadom.com/forum/styles/nnb/theme/images/icon_logout.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:21.640: Network: GET http://nnb.phreadom.com/img/inputs-bg2.png [HTTP/1.1 304 Not Modified 1ms]
21:33:21.648: Network: GET http://nnb.phreadom.com/img/mainbox-bottom3.png [HTTP/1.1 304 Not Modified 1ms]
21:33:21.847: Network: GET http://www.google-analytics.com/__utm.gif?utmwv=4.8.6&utmn=1467437699&utmhn=nnb.phreadom.com&utmcs=UTF-8&utmsr=1600x1200&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=10.1%20r102&utmdt=%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E5%8B%89%E5%BC%B7%20-%20Nihongo%20no%20Benkyou%20%3A%20%E3%83%81%E3%83%A3%E3%83%BC%E3%83%83%E3%83%88%20%E3%80%8CChat%E3%80%8D&utmhid=1213541222&utmr=0&utmp=%2Fchat%2Findex.php%3Fsid%3D6363f9bf76ceaffe1337a33c591e1cab&utmac=UA-12479791-1&utmcc=__utma%3D85439430.1822237806.1289744629.1292271406.1292290563.99%3B%2B__utmz%3D85439430.1289744629.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=D [HTTP/1.1 200 OK 26ms]
21:33:21.914: Network: GET http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab&pfc_ajax=1&f=loadChat [HTTP/1.1 200 OK 197ms]
21:33:22.225: Network: POST http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab [HTTP/1.1 200 OK 114ms]
21:33:22.235: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/minimize.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:22.243: Network: GET http://www.phpfreechat.net/pub/logo2_80x15.png [HTTP/1.1 304 Not Modified 290ms]
21:33:22.251: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/logout.gif [HTTP/1.1 304 Not Modified 0ms]
21:33:22.260: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/color-on.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:22.277: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/clock-on.gif [HTTP/1.1 304 Not Modified 2ms]
21:33:22.293: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/sound-on.gif [HTTP/1.1 304 Not Modified 0ms]
21:33:22.333: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/smiley-on.gif [HTTP/1.1 304 Not Modified 2ms]
21:33:22.371: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/online-on.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:22.411: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/bt_strong.gif [HTTP/1.1 304 Not Modified 0ms]
21:33:22.475: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/bt_em.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:22.491: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/bt_ins.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:22.505: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/bt_del.gif [HTTP/1.1 304 Not Modified 2ms]
21:33:22.570: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/bt_color.gif [HTTP/1.1 304 Not Modified 0ms]
21:33:22.688: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_smile.png [HTTP/1.1 304 Not Modified 0ms]
21:33:22.703: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_evilgrin.png [HTTP/1.1 304 Not Modified 0ms]
21:33:22.718: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_surprised.png [HTTP/1.1 304 Not Modified 1ms]
21:33:22.732: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_grin.png [HTTP/1.1 304 Not Modified 2ms]
21:33:22.747: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_unhappy.png [HTTP/1.1 304 Not Modified 6ms]
21:33:22.784: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_happy.png [HTTP/1.1 304 Not Modified 1ms]
21:33:22.799: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_waii.png [HTTP/1.1 304 Not Modified 1ms]
21:33:22.815: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_wink.png [HTTP/1.1 304 Not Modified 2ms]
21:33:22.830: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/emoticon_tongue.png [HTTP/1.1 304 Not Modified 2ms]
21:33:22.845: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/weather_rain.png [HTTP/1.1 304 Not Modified 3ms]
21:33:22.859: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/weather_snow.png [HTTP/1.1 304 Not Modified 3ms]
21:33:22.875: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/weather_sun.png [HTTP/1.1 304 Not Modified 3ms]
21:33:22.890: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/weather_clouds.png [HTTP/1.1 304 Not Modified 3ms]
21:33:22.956: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/weather_cloudy.png [HTTP/1.1 304 Not Modified 4ms]
21:33:22.971: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/weather_lightning.png [HTTP/1.1 304 Not Modified 3ms]
21:33:22.985: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/arrow_right.png [HTTP/1.1 304 Not Modified 4ms]
21:33:22.999: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/arrow_left.png [HTTP/1.1 304 Not Modified 3ms]
21:33:23.038: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/exclamation.png [HTTP/1.1 304 Not Modified 3ms]
21:33:23.053: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/smileys/lightbulb.png [HTTP/1.1 304 Not Modified 5ms]
21:33:23.091: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/color_transparent.gif [HTTP/1.1 304 Not Modified 4ms]
21:33:23.130: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/login.gif [HTTP/1.1 304 Not Modified 0ms]
21:33:23.695: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser
21:33:23.713: Network: POST http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab [HTTP/1.1 200 OK 112ms]
21:33:23.731: Network: POST http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab [HTTP/1.1 200 OK 131ms]
21:33:23.749: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/ch.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:23.765: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/tab_remove.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:23.868: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/user.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:23.930: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/oldmsg.gif [HTTP/1.1 304 Not Modified 1ms]
21:33:24.050: Network: GET http://nnb.phreadom.com/chat/data/public/themes/default/images/user-admin.gif [HTTP/1.1 304 Not Modified 0ms]
21:33:25.612: Network: POST http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab [HTTP/1.1 200 OK 99ms]

the last line just repeats (the keepalive).

I noticed that the error is repeated for every keystroke I make in the "input#pfc_words", but not for the other text input on the same page...

Code: Select all
21:41:48.166: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser
21:41:48.236: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser
21:41:48.284: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser
21:41:48.727: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser
21:41:48.908: Warning: Expected color but found 'undefined'.  Error in parsing value for 'background-color'.  Declaration dropped. Source File: http://nnb.phreadom.com/chat/index.php?sid=6363f9bf76ceaffe1337a33c591e1cab Line: 0, Column: 9 Category: CSS Parser

But I'm getting too sleepy to continue debugging it tonight. Maybe tomorrow with fresh eyes.
Last edited by phreadom on Tue Dec 14, 2010 3:52 am, edited 1 time in total.
phreadom
Support Team
 
Posts: 13
Joined: Fri Apr 04, 2008 8:03 pm
Top

Postby OldWolf » Wed Dec 15, 2010 1:30 am

I gave it a quick look through and nothing stood out... I think this is going to require a much deeper study and debug. Can anyone give a hand?
If not, I will try to take a look again this weekend.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby phreadom » Wed Dec 15, 2010 2:22 am

I was trying to walk through the keypress event, since it seems to fire on every keypress specifically, so that might be the best route to track it down... no luck yet (deciphering javascript is a bit like Greek to me still), but at least I got to fix the nick tab completion while I was at it (based on the fix available on the sf.net bug tracker). :)

I'll update if I figure anything out.
phreadom
Support Team
 
Posts: 13
Joined: Fri Apr 04, 2008 8:03 pm
Top

Postby phreadom » Sun Jan 09, 2011 1:41 am

On a side note, I just added in support for case insensitive nick completion, along with ": " at the end of the nick once it's completed.

Since we use case insensitive nicks on the site this will be going on... you can set case on your username, but there can't be a "Bob" and "bob" at the same time. So it makes it a lot easier not to have to perfectly match case when using tab completion on nicks.

I want to add in a check to see if the nick is being completed at the start of the message, or in a sentence, and only include the ": " if it's at the beginning... but that may have to wait.

Next I need to look at why nick completion doesn't work when a username has Japanese characters in it... (since we allow more than just the basic latin charset)

In pfcclient.js, around line 665;

Code: Select all
      for (var i = 0; i < n_list.length; i++)
      {
        var nick_tmp = n_list[i];

//my change
        nick_src_lc = nick_src.toLowerCase();

        // replace spaces in nicks with  
        nick_tmp = nick_tmp.replace(/ /g, '240');

//my change
        nick_tmp_lc = nick_tmp.toLowerCase();


//orig       if (nick_tmp.indexOf(nick_src) == 0)
        if (nick_tmp_lc.indexOf(nick_src_lc) == 0)
        {
          if (! nick_match)
          {
            nick_match = true;
//use the original line if you don't want the ": " at the end when you tab complete
//orig           nick_replace = nick_tmp;
            nick_replace = nick_tmp + ': ';
          }
          else
Last edited by phreadom on Sun Jan 09, 2011 1:42 am, edited 1 time in total.
phreadom
Support Team
 
Posts: 13
Joined: Fri Apr 04, 2008 8:03 pm
Top


Post a reply
7 posts • Page 1 of 1

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

Users browsing this forum: No registered users and 8 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