PDA

View Full Version : re-coded request line for crazy habbo



beer
22-12-2006, 08:59 AM
I made it so u cant submit a request when theres no dj on air

Name this request.php:


<? session_start();
include 'dbConfig.php';
$ip = $_SERVER['REMOTE_ADDR']; //get the ip of the current user
?>
<?php
include("request_stats.php");
if($streamstatus == 0)
{
die("<link href=\"KristallPanel/css.css\" type=\"text/css\" rel=\"stylesheet\">
<font face=verdana size=1 color=#FF0000><b>Clubbing Habbos request line</b></font><br/><br/><font face=verdana size=1 color=#FF0000>Hi there. Sorry but you cannot submit a request at the minute<br/>This is because nobody is DJing<br/>Please check back later when there is a DJ on</font>");
}
?>
<font face="Verdana" size="1" color=#FF0000>
<?
if($_GET["action"] == "send") {
if($dj_name == "Choose One...") { echo "<b><font face=Verdana color=#FF0000 size=2>You Must Select a Dj!<br>"; exit; }
$dj_name = $_POST["dj_name"];
$request = stripslashes($_POST["request"]);
$type = $_POST["type"];
$ip = getenv("REMOTE_ADDR");
$username = $_POST['username'];
$query = mysql_query("INSERT INTO `requests` (`habboname`, `type`, `dj_name`, `message`, `ip`, `date`) VALUES('$username', '$type', '$dj_name', '$request', '$ip', NOW() )");
echo " Request sent!";} else {
echo "
<form method='post' action='$PHP_SELF?action=send'>

<table border='0'>
<tr>

<b>Habbo Name:</b> <input name=\"username\" type=\"text\" id=\"username\">

<td valign='top' align='left'><font face='Verdana' size='1' color='#FF0000'><b>Type:</b><br>
<font size='1' face='Verdana'><select name='type' size='1'>
<option value='DJ Request'>Request</option>
<option value='DJ Shoutout'>Shoutout</option>
<option value='DJ Joke'>Joke</option>
<option value='DJ Other'>Other</option>";}
echo "</select></font></td>
</tr><tr>
<td valign='top' align='left'><font face='Verdana' size='1' color='#FF0000'><b>Dj Name:</b><br>
<select size='1' name='dj_name'><option selected>Choose One...</option>
";
$result = mysql_query("SELECT * FROM `staff`");
while($worked = mysql_fetch_array($result)) {
$rusername = $worked["username"];
echo "<option value=$rusername>DJ $rusername</option>
";
}
mysql_close();
echo "</select></td>
</tr><tr>
<td valign='top' align='left'><font face='Verdana' size='1' color='#FF0000'><b>Message:</b><br>
<textarea rows='5' cols='23' type='text' name='request' class='button'></textarea></font></td>
</tr>
<tr>
<td valign='top' align='left'><font face='Verdana' size='1' color='#183139'><input type='submit' name='submit' value='Send'></font></td>
</tr>
</table>
</form>";
?>
<br>


<body text="#FF0000" <body bgcolor="#FFFFFF">
</font></font></font>
<script type=text/javasctipy>
<!--
windows.location= "http://louis.wrighthost.sharpehosting.com/request1.php
//-->
</script>Name this request_stats.php:


<?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// &#169;2004-2005 Daniel Brown http://www.gmtt.co.uk

include('config_radio.php');

$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' is Offline';
}
if($scsuccs!=1){
fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}
################################################## ################################################## ##################
/////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define xml elements
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE");
$y=0;
while($loop[$y]!=''){
$pageed = ereg_replace(".*<$loop[$y]>", "", $page);
$scphp = strtolower($loop[$y]);
$$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)
$$scphp = urldecode($$scphp);

// uncomment the next line to see all variables
//echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
################################################## ################################################## ##################
################################################## ################################################## ##################
/////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$r=1;
while($songatime[$r]!=""){
$t=$r-1;
$playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
$playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
$song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
$song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
$song[$t] = urldecode($song[$t]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
//end song info
fclose($scfp);
}
?>

Enjoy!

Oh and make sure you have a config_radio.php in same folder otherwise it wont work.

beer
22-12-2006, 09:47 AM
oh sorry title is meant to say "for crazy habbo dj panel" lol. Cant edit :P

Tekn
22-12-2006, 09:47 AM
just another reason for a bump.

-rep ;)

omgDAN!
22-12-2006, 10:15 AM
just another reason for a bump.

-rep ;)

Just another reason to be an idiot.

-rep ;)

Kymux
22-12-2006, 10:26 AM
thats kl.

MrChaz
22-12-2006, 11:02 AM
just another reason for a bump.

-rep ;)

Your a disturbed child, cant trust noone can you?

Edited by micky.blue.eyes (Super Moderator): Please don't be rude towards other members.

Tekn
22-12-2006, 11:04 AM
Can't trust no-one/

Man, what the hell are you talking about.

...disturbed wth?

Invent
22-12-2006, 11:06 AM
Sorry misread. +rep

Tekn
22-12-2006, 11:07 AM
Why would you want to send a request when there is no DJ?...I dont get it...
He's edited the code, so that when there's no DJ online - when you send a request it doesn't go through to stop people from doing just that.

beer
22-12-2006, 11:07 AM
some ppl do. called spamming. I made it so request line is disabled when theres no DJ on air :P

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