PDA

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


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 ?>

Gizmo999
02-17-2006, 01:37 PM
I'd be interested in a similar feature to allow selected users to use php displaying info from itunes ( I already have a program generating the track info and code)

Phillip Chapman
02-18-2006, 02:34 PM
Great! I'm sure such a hack would be of interest to many users. Hopefully, somek kind soul will assist with getting this implemented.

derekivey
02-18-2006, 02:48 PM
I'll see if I can make this.

Derek

EDIT: Nevermind, I don't know how to make it, maybe another code will be able to.

Phillip Chapman
02-18-2006, 07:48 PM
Thank you Derek for taking the time to try this. What do you think the difficulty is in performing this hack? Maybe the info can help someone else overcome it.

derekivey
02-19-2006, 03:10 AM
I'm not sure how hard it would be to do. I have never made any bbcode before so I thought I'd try it but it looks way too hard for me :(.

Phillip Chapman
02-24-2006, 03:09 PM
Thanks for giving it a try Dereck. Hopefully some other kind soul will assist with this request.

Phillip Chapman
05-08-2006, 01:27 AM
Just wanted to bump this request up to see if anyone was willing to help make this happen...

Farjad
05-08-2006, 01:36 AM
anyone :blink:

Phillip Chapman
05-23-2006, 07:23 PM
Here's another bump for this hack request. Seems like we have several folks who would be interested in such a hack if anyone would kindly be willing to devote their talents to the cause.

Zachery
05-23-2006, 07:56 PM
Why can't you export that to an image? Or possibly set it all as a varible, pop it in the plugin system and assign it to yourself with a template edit to the postbit.

Phillip Chapman
05-23-2006, 08:02 PM
Or possibly set it all as a varible, pop it in the plugin system and assign it to yourself with a template edit to the postbit.

Thanks for the feedback. I'm willing to try this, but I'll need explicit step-by-step instructions as I'm not familiar with the process. If you can provide some more detail it would be most appreciated.