Casio
17-01-2011, 10:31 PM
<?php
function getscdata($server, $port) {
$open = fsockopen($server, $port);
if($open) {
fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n");
$read = fread($open,1000);
$text = explode("content-type:text/html",$read);
}
return $text[1];
}
$count = getscdata("SERVER IP HERE", "PORT HERE");
$datacount = explode(",", $count);
$count = $datacount[4];
$viewerCount = '<font color="black"><center><b>Listeners:</b> <i>'.$count.'</i><br /><b>Song:</b> <i>'.$datacount[6].'</i></center></font>';
if($_GET['ajaxsync'] == "counter") {
echo $viewerCount;
die();
}
?>
<html>
<script>
function createRequestObject() {
var ro;
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer") {
ro = new ActiveXObject("Microsoft.XMLHTTP");
} else {
ro = new XMLHttpRequest();
}
return ro;
}
var xmlHttp = createRequestObject();
var lastapidata = null;
function runapipull() {
xmlHttp.open('get', '<?php echo $_SERVER['PHP_SELF'];?>?ajaxsync=counter&ms='+ new Date().getTime());
xmlHttp.onreadystatechange = readapidata;
xmlHttp.send(null);
}
function readapidata() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.responseText != lastapidata) {
lastapidata = xmlHttp.responseText;
if (document.getElementById("livecount")) {
document.getElementById("livecount").innerHTML = xmlHttp.responseText;
}
}
setTimeout("runapipull()", 15000);
}
}
runapipull();
</script>
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<title> MY SITE TITLE HERE</title>
<background="/images/background.png">
<body>
<div id="livecount"><?php echo $viewerCount; ?></div>
<center><script type="text/javascript" src="http://player.wavestreamer.com/cgi-bin/swf.js?id=EKG9W7S2LFZUEVY3"></script><script type="text/javascript" src="http://player.wavestreaming.com/?id=EKG9W7S2LFZUEVY3"></script></center></div>
</p></div>
</body>
</html>
Ok, so I have this coding, as I have a background code in there but when i load the page the background doesnt actually show, any help please +REP
function getscdata($server, $port) {
$open = fsockopen($server, $port);
if($open) {
fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n");
$read = fread($open,1000);
$text = explode("content-type:text/html",$read);
}
return $text[1];
}
$count = getscdata("SERVER IP HERE", "PORT HERE");
$datacount = explode(",", $count);
$count = $datacount[4];
$viewerCount = '<font color="black"><center><b>Listeners:</b> <i>'.$count.'</i><br /><b>Song:</b> <i>'.$datacount[6].'</i></center></font>';
if($_GET['ajaxsync'] == "counter") {
echo $viewerCount;
die();
}
?>
<html>
<script>
function createRequestObject() {
var ro;
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer") {
ro = new ActiveXObject("Microsoft.XMLHTTP");
} else {
ro = new XMLHttpRequest();
}
return ro;
}
var xmlHttp = createRequestObject();
var lastapidata = null;
function runapipull() {
xmlHttp.open('get', '<?php echo $_SERVER['PHP_SELF'];?>?ajaxsync=counter&ms='+ new Date().getTime());
xmlHttp.onreadystatechange = readapidata;
xmlHttp.send(null);
}
function readapidata() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.responseText != lastapidata) {
lastapidata = xmlHttp.responseText;
if (document.getElementById("livecount")) {
document.getElementById("livecount").innerHTML = xmlHttp.responseText;
}
}
setTimeout("runapipull()", 15000);
}
}
runapipull();
</script>
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<title> MY SITE TITLE HERE</title>
<background="/images/background.png">
<body>
<div id="livecount"><?php echo $viewerCount; ?></div>
<center><script type="text/javascript" src="http://player.wavestreamer.com/cgi-bin/swf.js?id=EKG9W7S2LFZUEVY3"></script><script type="text/javascript" src="http://player.wavestreaming.com/?id=EKG9W7S2LFZUEVY3"></script></center></div>
</p></div>
</body>
</html>
Ok, so I have this coding, as I have a background code in there but when i load the page the background doesnt actually show, any help please +REP