PDA

View Full Version : PowerPanel Profile add-on to show current DJ-on-air Avatar?



Recursion
16-06-2007, 06:36 AM
Hello,

Is there anyway to grab what DJ is currently on air (from the timetable i should think?) and display the avatar on a page, so I can impliment it onto my site which has a 'Current DJ's Avatar' box.

Thanks
+REP

;;Tom

Drompo
16-06-2007, 08:36 AM
<?php
include("../includes/config.php");
include("../includes/functions.php");

$query = mysql_query("SELECT * FROM users WHERE level != 'banned'") or die('ERROR '.mysql_error());
while($rows = mysql_fetch_array($query)) {
if(preg_match("/". $rows[username] ."/i", $servertitle)) {
$name = "{$rows[username]}";
$check = mysql_query("SELECT * FROM users WHERE username = '$name'");
?>
<img src="<?php
$avatar = $account["avatar"];

if($avatar == "") {
echo("../images/no_ava.gif");
}
elseif($avatar == "images/no_ava.gif") {
echo("../images/no_ava.gif");
}
else {
echo("". $avatar ."");
}
?>" alt="<? echo("". $account["username"] .""); ?>'s avatar" />
<?php
}
}
?>Something like that
That grabs the server title checks if the DJ is registered in the panel and then displays their avatar.

Recursion
16-06-2007, 09:48 AM
Anyway to grab the name thats on the timetable?

Because people will use things like:

DJ Spike | HabboFM.co.uk

etc etc...

(This powerpanel thing isn't for HabboFM, its just an example)

Invent
16-06-2007, 12:53 PM
Because people will use things like:

DJ Spike | HabboFM.co.uk

Don't worry :)

The script basically 'searches' for their username in the stream title.

So if their username was "Simon" and the stream title was "IYA!!1 DJ SIMON IZ ERE BLASTIN YA TUNEZ!!2", then it would still work I believe.

Recursion
16-06-2007, 12:58 PM
I put that PHP code in a file (such as avatar_show.php) in the root directory of powerpanel?

Invent
16-06-2007, 01:01 PM
In /frontend/.

Recursion
16-06-2007, 01:02 PM
Thanks :) Ill give it a try when I reinstall my Panel after that crappy mod >=[

Want to hide these adverts? Register an account for free!