Page 18 of 40

Posted: Sun Jan 26, 2003 5:55 pm
by testebr
I installed this mod and I funcinou PERFECTLY!

Now I need to make a private room, as I I make this?

Posted: Sun Jan 26, 2003 6:19 pm
by Nathan_Anderson
Hmm,

Both of your setting look correct: Can you both verify that the following code is located in your "include/page_header.php" around line 260.

Code: Select all

if( $userdata['session_logged_in'] ) {
   // Do Cleanup on Users in Chat mode.
   if (!defined("C_USR_DEL")) define("C_USR_DEL", '4');
   $sql = "DELETE FROM ".$table_prefix."c_users WHERE u_time < ".(time() - C_USR_DEL * 60)." OR (status = 'k' AND u_time <  ".(time() - 20).")";
   $status = $db->sql_query($sql);

   $sql = "SELECT DISTINCT username FROM ".$table_prefix."c_users";
   $status = $db->sql_query($sql);
   if ($status) {
     $l_chatting_users = $db->sql_numrows();
   } else {
     $l_chatting_users = 0;
   }
}
Pay specific attention to the line:

Code: Select all

   $sql = "SELECT DISTINCT username FROM ".$table_prefix."c_users";
verify that there is not a ';' in the "c_users;";. I had a bug in the earlier instructions and it worked on some systems and not on others with the ";"

Nathan.

Posted: Sun Jan 26, 2003 6:20 pm
by Nathan_Anderson
testebr wrote: I installed this mod and I funcinou PERFECTLY!

Now I need to make a private room, as I I make this?


Look in the /lib/config.lib.php file; it has a array for "private" rooms. Then when you log into chat; the person would type /join my_private_Room

nathan.

Posted: Sun Jan 26, 2003 6:36 pm
by Tobi
Hi,
Nathan_Anderson wrote: verify that there is not a ';' in the "c_users;";. I had a bug in the earlier instructions and it worked on some systems and not on others with the ";"


I do not think, that this is the problem. The fonts in chatlink.php looks very large, like it has problems to get the css file. Maybe there are problems with some variables...

Tobi

Posted: Sun Jan 26, 2003 7:22 pm
by Nathan_Anderson
If that SQL statement doesn't run you will get what you are talking about (0 users alway). If the rest of the chatting works fine; then more than likely the problem is located in that bit of code that I posted.

Nathan.
P.S. I'm assuming the chat is located in the /forum/chat directory correct?

Posted: Sun Jan 26, 2003 11:57 pm
by Balint
Hi!

I've installed the MOD under 2.0.3. After upgrading to 2.0.4 I'm experiencing problems. On all pages except the index.php the number of users in the chat is not shown. I checked the code in page_header.php and overall_header.tpl, they are correct.

EDIT: Removed due to session problems...

Before upgrading to 2.0.4 everything worked fine... :(

Regards,
Bálint

Posted: Mon Jan 27, 2003 12:14 am
by Nathan_Anderson
All,

Is everybody that is having problems running 2.04?

Nathan.
P.S. I downloaded 2.04 but haven't spent the time to re-mod it yet. :)

Posted: Mon Jan 27, 2003 2:31 am
by uehlein
My code is

Code: Select all

 $sql = "SELECT DISTINCT username FROM ".$table_prefix."c_users";
I even tried changing that to the hard code the table prefix... no luck...

Posted: Mon Jan 27, 2003 2:54 am
by uehlein
I am on .04

Posted: Mon Jan 27, 2003 5:46 pm
by Tobi
Hi,
Nathan_Anderson wrote: Is everybody that is having problems running 2.04?


yep, I am running 2,04 ;)

Tobi

Posted: Mon Jan 27, 2003 7:00 pm
by Nathan_Anderson
Interesting, I just upgraded my board to v2.04 and it is working. However after looking at my instructions -- I'm pretty sure I know why you all are having problems. In the page_header.php

v2.04 added a new if statement that envelopes the code that shows how many people are online. The closeing bracket "}" is:

Code: Select all

$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
}
^- Right here.
If you follow the instructions; you will be putting the chat count code on the wrong side of the "}" :-)

Code: Select all

$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);

[this is where you probably put the chat code]
}

You need to put the chat code after the closing brace; so it will be run always not only on the main page.

Code: Select all

$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);

}
[this is where you need to put the chat code]

Nathan.

Posted: Mon Jan 27, 2003 7:07 pm
by uehlein
I told you that you were the GREAT Nathan! This has fixed the problem! You are da Man! Thanks! Great Mod! Can I add more "!s" :)

Oh... forgot something... mine was a new isntall... would this have made a difference?

Posted: Mon Jan 27, 2003 7:34 pm
by Nathan_Anderson
uehlein wrote: Oh... forgot something... mine was a new isntall... would this have made a difference?


Nope; wouldn't have made a difference. The instructions said to put it after those lines; but in 2.03 and prior the "}" didn't exist. So If you followed the instructions properly in 2.04 it wouldn't work. :)

Nathan.

Posted: Mon Jan 27, 2003 7:46 pm
by uehlein
Well... at least I did it right ;) Thanks again!

Posted: Mon Jan 27, 2003 10:54 pm
by Tobi
Hi,

great, it is also working for me! Thanks!

Tobi