… get this in a webpage:
[CODE]<?php
require_once(‘inc/common.php’);
$id = ‘flashchat’;
$params = array();
$open = false;
if($GLOBALS[‘fc_config’][‘liveSupportMode’]) {
$stmt = new Statement(“SELECT * FROM {$GLOBALS[‘fc_config’][‘db’][‘pref’]}connections WHERE userid IS NOT NULL”);
if($rs = $stmt->process()) {
while($rec = $rs->next()) {
if(ChatServer::userInRole($rec[‘userid’], ROLE_ADMIN)) {
$open = true;
break;
}
}
}
}
?>
<html>
<head>
<title>Live Support Sample</title>
<script type=”text/javascript” src=”js.php”></script>
</head>
<body marginwidth=”0″ marginheight=”0″ leftmargin=”0″ topmargin=”0″ rightmargin=”0″ bottommargin=”0″ scroll=”no” <?php if($open) { ?>onLoad=”setFocus()” onUnload=”doLogout()”<?php } ?>>
<?php if($open) { ?>
<center><a href=”http://www.ganjagrocer.com/forums/chat/flashchat.php”><img src=”/forums/chat/online.gif”></center>
<?php } else { ?>
<center><img src=”/forums/chat/offline.gif”></center>
<?php } ?>
</body>
It works from this link:
[CODE]http://www.ganjagrocer.com/forums/chat/livesupport.php
But I want it in a web page. Thanks!
When a staff member is online the status button changes from offline to online and vise-versa.
Hope I got this in the right area.