I am having trouble with the privmsg parameter it seems to only connect when there is one element in the array I want to have a friends list that automatically connects a private chat to any friends that are online I am very new to this script so I may be doing something stupid help would be greatly appreciated
$friendname1 = $row['friend1']; $friendname2 = $row['friend2']; require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat $params["title"] = "Vent 24-7 Chat Room"; $params["nick"] = "$id"; // setup the intitial nickname $params["frozen_nick"] = true; // do not allow to change the nickname $params["shownotice"] = 0; // 0 = nothing, 1 = just nickname changes, 2 = connect/quit, 3 = nick + connect/quit $params["max_nick_len"] = 20; // nickname length could not be longer than 10 caracteres $params["max_text_len"] = 300; // a message cannot be longer than 50 caracteres $params["max_channels"] = 3; // limit the number of joined channels tab to 3 $params["max_privmsg"] = 2; // limit the number of private message tab to 1 $params["privmsg"] = array($friendname1, $friendname2); $params["refresh_delay"] = 1000; // chat refresh speed is 10 secondes (10000ms) $params["max_msg"] = 15; // max message in the history is 15 (message seen when reloading the chat) $params["height"] = "400px"; // height of chat area is 230px $params["debug"] = false; // activate debug console $params["connect_at_startup"] = true; $params["start_minimized"] = false; $params["nickmarker"] = false; $params["clock"] = false;
if I just put $friendname1 in the array for privmsg it works perfectly but if I add another user it crashes the chat room
What you mean it crash the chat?, the users must be connected in order for it to work if you have some others nicks in the array it will fail because their are undefined or not present in the chat at the moment of connection, supposedly then the parameter will not take them in account, but wouldn't crash.... what you PFC version?
it works perfectly when there is only 1 name in the array. if the other user is not online it simply ignores that request however if I add a second name it will not work and loads the chat into a room that does not exist and you are no longer able to post to the main chat room and i have to rerun the /init command to fix the issue
<img src='http://www.vent24-7.com/error.PNG'>
the image above shows how the chat will load when there are 2 users in the array