Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Posts
    79
    Tokens
    0

    Default Needing Help With ALERT Site (DJ PANEL)

    Hello Me And My Friends Are Doing a Panel Called Epanel 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 By IP & The Feture Were u can ALERT Every One On The Site - Any Help Ill Give Rep For Coding & Help

  2. #2
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    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

    Last edited by Invent; 28-04-2007 at 12:52 PM.

  3. #3
    Join Date
    Apr 2007
    Posts
    79
    Tokens
    0

    Lightbulb

    Ok We'll Try (If i fail please send mah code )


    This is what i got sent to me by one of My friends Making Epanel
    Send Alert.php:
    HTML Code:
    <?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:
    HTML Code:
    <?php $_F=__FILE__;$_X='Pz48P3BocCByNXEzNHI1KCdjaDVjay5waHAnKTs/Pg0KPCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9Xb0MvL0RURCBIVE1MIHUuMDYgVHIxbnM0dDQybjFsLy9FTiI+DQoNCjxodG1sPg0KPGg1MWQ+DQo8dDR0bDU+UjFkNDIgREogUDFuNWwgdm88L3Q0dGw1Pg0KPG01dDEgaHR0cC01cTM0dj0iYzJudDVudC10eXA1IiBjMm50NW50PSJjaDFyczV0PVVURi04Ij4NCjxsNG5rIHI1bD0iU3R5bDVTaDU1dCIgaHI1Zj0ic3R5bDUuY3NzIiB0eXA1PSJ0NXh0L2NzcyIgLz4NCjxsNG5rIHI1bD0iMWx0NXJuMXQ1IHN0eWw1c2g1NXQiIHR5cDU9InQ1eHQvY3NzIiBtNWQ0MT0ic2NyNTVuIiB0NHRsNT0iZDU1cCIgaHI1Zj0ic3R5bDVfZDU1cC5jc3MiIC8+DQo8c2NyNHB0IHR5cDU9InQ1eHQvajF2MXNjcjRwdCIgc3JjPSJjaDVja2IyeC5qcyI+PC9zY3I0cHQ+IA0KPHNjcjRwdCB0eXA1PSJ0NXh0L2oxdjFzY3I0cHQiIHNyYz0ic3R5bDVzdzR0Y2g1ci5qcyI+PC9zY3I0cHQ+IA0KPC9oNTFkPg0KPGIyZHk+DQo8P3BocCByNXEzNHI1KCdjMm5uNWN0LnBocCcpOz8+DQo8P3BocCByNXEzNHI1KCdmM25jdDQybnMucGhwJyk7Pz4NCg0KPGQ0diA0ZD0iYzVudDVyIj4NCjxkNHYgNGQ9Img1MWQ1ciI+Jm5ic3A7PC9kNHY+DQo8ZDR2IDRkPSIxbTVzczFnNSI+DQo8bTFycTM1NT48P3BocCByNXEzNHI1KCcxbTVzczFnNV9zdHlsNS5waHAnKTs/PjwvbTFycTM1NT4NCjwvZDR2Pg0KPGQ0diA0ZD0iYzJudDVudCI+DQo8ZDR2IDRkPSJtNW4zIj48ZDR2IDRkPSJtNW4zYzJudDVudHMiPg0KPD9waHAgcjVxMzRyNSgnbjF2NGcxdDQybl9zdHlsNS5waHAnKTs/Pg0KPC9kNHY+DQo8ZDR2IDRkPSJtMTRuIj4=';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?>
    is it right Invent Or Ouda Ppl ;D
    Last edited by Epanel; 28-04-2007 at 01:11 PM.

  4. #4
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    90

    Latest Awards:


  5. #5
    Join Date
    Apr 2007
    Posts
    79
    Tokens
    0

    Default

    Ok I Wont Put it on Ty For That


    +Rep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •