The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How do i add this to our forum??
We now have a radio station for our site and i'm wondering which code to add and where.
If i add it to the main page. im concerned it will increase load time. Thought it best to create an article or a separate page. What would you suggest and where and which code do i add. I've tried it using forum blocks but that means every page refresh stops the music and starts again when loaded Javascript/HTML scripts Song title (JS) Code:
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk30-free:16392"> You appear to have javascript turned off. </script> Code:
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/listeners/uk30-free:16392">You appear to have javascript turned off. Code:
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk30-free:16392">You appear to have javascript turned off. Code:
<img src="http://shoutcast.mixstream.net/status/uk30-free:16392.gif" alt="Stream status" width="17" height="17" align="absmiddle"> Code:
<script> // MixStream Flash Player, http://mixstreamflashplayer.net/ var flashvars = {};flashvars.serverHost = "s30.myradiostream.com:16392/;";flashvars.getStats = "1";flashvars.autoStart = "1";flashvars.textColour = "";flashvars.buttonColour = "";var params = {};params.bgcolor= "";params.wmode="transparent"; </script> <script type="text/javascript" src="http://mixstreamflashplayer.net/v1.3.js"></script> PHP scripts are generally the most reliable and quickest way to get stats from your server. If these don't work then it's probably because either your webhost doesn't support PHP or they have a firewall blocking all outgoing connections, in which case you can either contact them or use the javascripts above. Song title Code:
<?php $ip = "s30.myradiostream.com"; $port = "16392"; $fp = @fsockopen($ip,$port,$errno,$errstr,1); if (!$fp) { $title = "Connection timed out or the server is offline "; } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $info = str_replace('</body></html>', "", $info); $split = explode(',', $info); if (empty($split[6])) { $title = "The current song is not available "; } else { $count = count($split); $i = "6"; while($i<=$count) { if ($i > 6) { $title .= ", " . $split[$i]; } else { $title .= $split[$i]; } $i++; } } } $title = substr($title, 0, -2); print $title; ?> Code:
<?php $ip = "s30.myradiostream.com"; $port = "16392"; $fp = @fsockopen($ip,$port,$errno,$errstr,1); if (!$fp) { $listeners = "0;"; } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $split = explode(',', $info); if ($split[1] == "0") { $listeners = "0"; } else { $listeners = $split[0]; } } print $listeners; ?> Code:
<?php // Change these to your online/offline messages // $online = "Online"; // Displays when stream is online $offline = "Offline"; // Displays when stream is offline // don't edit below // $ip = "s30.myradiostream.com"; $port = "16392"; $fp = @fsockopen($ip,$port,$errno,$errstr,1); if (!$fp) { $status = $offline; } else { fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); while (!feof($fp)) { $info = fgets($fp); } $split = explode(',', $info); if ($split[1] == "0") { $status = $offline; } else { $status = $online; } } print $status; ?> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|