/    Sign up×
Community /Pin to ProfileBookmark

How can I…

… 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>[/CODE]

It works from this link:

[CODE]http://www.ganjagrocer.com/forums/chat/livesupport.php[/CODE]

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.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@SheldonJun 14.2006 — [url=http://php.net/include]include[/url]
×

Success!

Help @baji26 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...