PDA

View Full Version : Use raw PHP as custom BBCode


TheGreatTK
08-25-2008, 04:03 AM
I've got the following tiny PHP script to grab some information from an Icecast server's information page. After some mucking around, i've found that you can't just paste PHP code into the custom bbcode "replacement" box and expect it to work.

I'd like anybody on the forum to be able to use this, inserting real time info into their posts (especially our DJ's) about the current status of our radio station.

Is it possible to accomplish this, or is there another way that I should be going?


<?php+
//+IceCast+Stream+Name+and+Song+Name+Grabber
//+Created+by+BattleHymnZ
//+http://digiclipse.org
$cheese+=+file_get_contents("http://digiclipse.org:8000");
$ding+=+explode("<td>Current+Song /td><td+class=\"streamdata\">",+$cheese);
$sping+=+explode("<td>Stream+Title /td><td+class=\"streamdata\">",+$ding[0]);
$title+=+explode("</td></tr><tr>",+$sping[1]);
$song+=+explode("</td></tr></table>",+$ding[1]);
echo+$title[0];
echo+"<br>";
echo+$song[0];
?>

nexialys
08-25-2008, 04:06 AM
you could ask these guys: https://vborg.vbsupport.ru/showthread.php?t=150761 ... their stuff work with just a url, so a feed can be read and activate a addon like that...

TheGreatTK
12-20-2008, 03:56 PM
Bumping.. the idea above doesn't work.. we just want text information such as listeners and song. There's a really cool addon already out there that does exactly what we want, but unfortunately it only works with the (much more limited) shoutcast.

Digital Jedi
12-20-2008, 04:08 PM
What information are you needing to pull? Is it just the info from this page.(http://digiclipse.org:8000) It's possible I could make an AME definition for this.

Dismounted
12-21-2008, 02:42 AM
Have a look at class_bbcode.php - look at the lone function at the end. ;)