PDA

View Full Version : Request: PHP in admin's signature


Phillip Chapman
03-20-2005, 03:23 PM
I have a hack request that I was hoping that someone could kindly assist with.

I am admin of my forum and I would like to call an outside PHP script in my signature. All of the other members would use standard signatures (with vB code, no HTML and a 125 character limit).

If someone could help with this it would be a big help. There has got to be a way to do it.

Here is the PHP I'd like to include in my sig...

<?php
$username = "muppetcentral";

if(isset($_GET["afl"])) {
$afl = 1;
$url = "http://www.live365.com/pls/front?handler=playlist&cmd=view&handle=afl%3A" . $username;
} else {
$std = 1;
$url = "http://www.live365.com/pls/front?handler=playlist&cmd=view&handle=" . $username;
}

$fp = fopen($url, "r");
while($line = fgets($fp, 255)) {
if(ereg( "artist:\"([^\"]*)\"", $line, $regs)) {
$artist[] = $regs[1];
} else if(ereg( "title:\"([^\"]*)\"", $line, $regs)) {
$title[] = $regs[1];
} else if(ereg( "album:\"([^\"]*)\"", $line, $regs)) {
$album[] = $regs[1];
}
}
fclose($fp);

for($i=0; $i<=2; $i++) {
if($artist[$i] != "") {
$_artist = $artist[$i];
$_title = $title[$i];
$_album = $album[$i];
break;
}
}

$_album_disp = ereg_replace(":", "-", $_album);
$_album_disp = ereg_replace("/", "-", $_album_disp);
$_album_disp = ereg_replace("?", "-", $_album_disp);
$_artist_disp = ereg_replace(":", "-", $_artist);
$_artist_disp = ereg_replace("/", "-", $_artist_disp);

?>

<p><strong>Now Playing:</strong>
<?= $_title ?>
-
<?= $_artist ?>

Phillip Chapman
04-17-2005, 12:30 AM
Just wanted to bump this hack request in case anyone can help. Thanks in advance for your consideration.