PDA

View Full Version : Needing Help With ALERT Site (DJ PANEL)



Epanel
28-04-2007, 04:35 AM
Hello Me And My Friends Are Doing a Panel Called Epanel :D Its Not Out Yet It wont be the BEST Panel PowerPanel Would Prob Be Better, But I need Help With Setting Up a Alert Site/DJ :D By IP & The Feture Were u can ALERT Every One On The Site - Any Help Ill Give Rep For Coding & Help :D

http://www.habboxforum.com/images/misc/progress.gif

Invent
28-04-2007, 12:47 PM
Rightio, here's some help.

For the alert the site feature create a MySQL database with columns like "djname", "message".

Then on the send the alert page just insert their account name and message into the database. Once they have sent the alert make them wait 15 seconds and then direct them to a page which deletes the alert so that the alert does not get sent into a loop.

Then just make a file on the frontend of your site which checks the mysql db every say 15 seconds for an alert using say a Meta refresh code. Then if it detects a row in the table just make it give a javascript alert with the DJ's name and their message.

---

For an IP alert you just do the same thing but add another column into the mysql db called "ip".

With this alert you don't have to make the user wait 15 seconds whilst sending the alert as when the person with the IP the DJ specified gets the alert, it can be deleted then to ensure they get it.

Then on the file in your frontend you just check the user's ip over the ip's in the mysql db. If there is a row in the db with their IP then the alert is displayed.

---

This probably made no sense as I have a bad headache after a party last night, rofl.

Anyways, hope I was some help and good luck with your panel!

-Simon

Epanel
28-04-2007, 01:07 PM
Ok We'll Try (If i fail please send mah code :D )


This is what i got sent to me by one of My friends Making Epanel :D
Send Alert.php:


<?php require('head.php');?>
<center>

<b><u>Alert User By IP</b></u><p>
<?php
if ($_POST['alert']){
if($_POST['toip'] == ""|$_POST['message'] == ""){
echo "<h1>You Have Forgotten Somthink :D</h1>";
}else{
if($_POST['toip'] == "ALL"){
$message = $_POST['message'];
$toip = $_POST['toip'];
$fromdj = $_SESSION['rp_djname'];
$expire = date("G.i.s") + ("0.01");
$query = "INSERT INTO rp_alerts (toip, message, fromdj, expire) VALUES('$toip','$message','$fromdj','$expire')";
mysql_query($query) or die(mysql_error());
echo "<p><h1>Alert Sent!</h1>";
}else{
$message = $_POST['message'];
$toip = $_POST['toip'];
$fromdj = $_SESSION['rp_djname'];
$expire = date("G.i.s") + ("9.99");
$query = "INSERT INTO rp_alerts (toip, message, fromdj, expire) VALUES('$toip','$message','$fromdj','$expire')";
mysql_query($query) or die(mysql_error());
echo "<p><h1>Alert Sent!</h1>";
}
}
}
?>
<?php
if($_SESSION['rp_rank'] == 'Junior DJ'|$_SESSION['rp_rank'] == 'Senior DJ'|$_SESSION['rp_rank'] == 'Head DJ'|$_SESSION['rp_rank'] == 'Administrator'){
echo '
<form method="POST" action="sendalert.php"><p>
<b>Message:</b><br>
<input type="text" size="45" maxlength="400" name="message"><p>
<b>Ip Address:</b><br />
<input type="text" size="20" maxlength="400" name="toip"><p>
<input type="submit" name="alert" value="Send">
</form><p><br><p><hr width="50%">
<h1>-How To Send An Alert To All Listeners-</h1>Type in "ALL" in the IP Address box, this will show the message to every visitor for the next 1 minute. After 1 minute is up the next visitor will automatically delete the alert.<p><hr width="50%"><h1>-Current Active Alerts-</h1>';
echo '<div align="center"><table width="450" border="0">
<tr>
<td width="150px" align="center"><b>Sent By</b></td>
<td width="150px" align="center"><b>Message</b></td>
<td width="150px" align="center"><b>Expire</b></td>
</tr>';
$result = mysql_query("SELECT id, toip, message, fromdj, expire FROM rp_alerts ORDER BY expire DESC");
while($row = mysql_fetch_assoc($result)){
echo '<tr><td width="150px" align="center">'.$row['fromdj'].'</td>
<td width="150px" align="center">'.$row['message'].'</td>
<td width="150px" align="center">'.$row['expire'].'</td>
</tr>';
}
}
echo '</table></div>';
echo "<p><form method='POST' action='sendalert.php'><input type='submit' name='empty' value='Clear Alerts'></form></center><p>";
if ($_POST['empty']) {
$result = mysql_query("TRUNCATE rp_alerts");
echo "<center><h1>Alerts Cleared!<br><a href='sendalert.php'>Refresh</a><h1></center>";
}
?>
<?php
$result = mysql_query("SELECT id, toip, message, fromdj, expire FROM rp_alerts") or die(mysql_error());
while($row = @mysql_fetch_array($result)){
if($row['expire'] <= date("G.i")){
$result = mysql_query("DELETE FROM rp_alerts WHERE id = '$row[id]'") or die(mysql_error());
}
}
?>
<?php
if($_SESSION['rp_rank'] == 'Trialist DJ'){
echo 'Sorry, trialists are not allowed to send ip alerts.';
}
?>

</center>
Head.php:

<?php $_F=__FILE__;$_X='Pz48P3BocCByNXEzNHI1KCdjaDVjay5w aHAnKTs/Pg0KPCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9Xb0MvL0RURC BIVE1MIHUuMDYgVHIxbnM0dDQybjFsLy9FTiI+DQoNCjxodG1s Pg0KPGg1MWQ+DQo8dDR0bDU+UjFkNDIgREogUDFuNWwgdm88L3 Q0dGw1Pg0KPG01dDEgaHR0cC01cTM0dj0iYzJudDVudC10eXA1 IiBjMm50NW50PSJjaDFyczV0PVVURi04Ij4NCjxsNG5rIHI1bD 0iU3R5bDVTaDU1dCIgaHI1Zj0ic3R5bDUuY3NzIiB0eXA1PSJ0 NXh0L2NzcyIgLz4NCjxsNG5rIHI1bD0iMWx0NXJuMXQ1IHN0eW w1c2g1NXQiIHR5cDU9InQ1eHQvY3NzIiBtNWQ0MT0ic2NyNTVu IiB0NHRsNT0iZDU1cCIgaHI1Zj0ic3R5bDVfZDU1cC5jc3MiIC 8+DQo8c2NyNHB0IHR5cDU9InQ1eHQvajF2MXNjcjRwdCIgc3Jj PSJjaDVja2IyeC5qcyI+PC9zY3I0cHQ+IA0KPHNjcjRwdCB0eX A1PSJ0NXh0L2oxdjFzY3I0cHQiIHNyYz0ic3R5bDVzdzR0Y2g1 ci5qcyI+PC9zY3I0cHQ+IA0KPC9oNTFkPg0KPGIyZHk+DQo8P3 BocCByNXEzNHI1KCdjMm5uNWN0LnBocCcpOz8+DQo8P3BocCBy NXEzNHI1KCdmM25jdDQybnMucGhwJyk7Pz4NCg0KPGQ0diA0ZD 0iYzVudDVyIj4NCjxkNHYgNGQ9Img1MWQ1ciI+Jm5ic3A7PC9k NHY+DQo8ZDR2IDRkPSIxbTVzczFnNSI+DQo8bTFycTM1NT48P3 BocCByNXEzNHI1KCcxbTVzczFnNV9zdHlsNS5waHAnKTs/PjwvbTFycTM1NT4NCjwvZDR2Pg0KPGQ0diA0ZD0iYzJudDVudC I+DQo8ZDR2IDRkPSJtNW4zIj48ZDR2IDRkPSJtNW4zYzJudDVu dHMiPg0KPD9waHAgcjVxMzRyNSgnbjF2NGcxdDQybl9zdHlsNS 5waHAnKTs/Pg0KPC9kNHY+DQo8ZDR2IDRkPSJtMTRuIj4=';eval(base64_ decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydH IoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9S PWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLC RfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?>

is it right Invent Or Ouda Ppl ;D

Robbie
28-04-2007, 03:44 PM
Thats ripped

Epanel
28-04-2007, 03:46 PM
Ok I Wont Put it on Ty For That :D


+Rep :D

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