Phillip Chapman
02-17-2006, 03:33 AM
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). I've tried signature hacks that allow HTML but the PHP call doesn't seem to work properly.
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 ?>
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). I've tried signature hacks that allow HTML but the PHP call doesn't seem to work properly.
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 ?>