The Live Chat link at the top just had a ? in the number of people in the room. Any idea why?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The Chat Room was working 'cause I clicked on it to see what a ? was. Well it was working immediately after I logged on I should say.Nigel said:Glad to know the function was working even if the chat room probably wasn't - your question was answered here. Basically it means that the bit of code that shows the number of users couldn't connect to the chat server to find out the number of users.
I know you were dying to ask but...BeeJay said:Ah it's the code that you wrote Nigel. I see the problem now.
//---------------------------------------------
// Find out how many chat users & show them
// $chatusers has number or ? if failed to connect
//---------------------------------------------
$chatusers = "";
$error_status = error_reporting();
error_reporting(E_ERROR);
$fp = fsockopen("localhost", 11100, &$errno, &$errstr, 1);
error_reporting($error_status);
if(!$fp) {
$chatusers = "";
} else {
fputs($fp,"GET /?api.UserCount HTTP/1.0\n\n");
$header = true;
$stream_read = array("timed_out" => 0);
while(!feof($fp) and !$stream_read["timed_out"]) {
$start = time();
socket_set_timeout($fp, 0,500000);
$line = fgets($fp,128);
$stream_read = (stream_get_meta_data($fp));
if ( $header == false ) $chatusers .= $line;
if ( trim($line) == "" ) $header = false;
}
fclose($fp);
}
if ($chatusers == "") {
$chatusers = "?";
}
$chatusers = trim($chatusers);
$ibforums->skin['template'] = str_replace( "<!--CHATUSERS-->" , $chatusers , $ibforums->skin['template']);
Join our vibrant online community dedicated to all things canine. Whether you're a seasoned owner or new to the world of dogs, our forum is your go-to hub for sharing stories, seeking advice, and connecting with fellow dog lovers. From training tips to health concerns, we cover it all. Register now and unleash the full potential of your dog-loving experience!
Login or Register