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!


Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default Need good coder like eric30 ;)

    i have

    PHP Code:
    <?
    ob_start
    ();
    //the above line needs to be above ALL HTML and PHP (except for <?).
    include("config.php");
    //gets the config page, which connects to the database and gets the user's information
    if ($logged[username])
    {
    //checks to see if they are logged in
    switch($_GET[page])
    {
    //this allows us to use one page for the entire thing
    default:
    echo (
    "- <a href=\"messages.php?page=inbox\">Inbox</a><br />
    - <a href=\"messages.php?page=write\">New Message</a>"
    );
    break;
    case 
    'write':
    if (!
    $_POST[send])
    {
    //the form hasnt been submitted yet....
    echo ("<form method=\"POST\" style=\"margin: 0px;\">
        <dl style=\"margin: 0px;\">
                <dt>recipient</dt>
                <dd>
                <select name=\"to\">
    "
    );
    $getusers mysql_query("SELECT * FROM users ORDER BY 'username' ASC");
                while (
    $users MySQL_Fetch_Array($getusers)) {
        echo (
    "<option value=\"$users[username]\">$users[username]</option>");
    }
    //the above line gets all the members names and puts them in a drop down box
    echo ("
    </select>
    </dd>
    <dt>Message Subject</dt>
    <dd><input type=\"text\" name=\"subject\" size=\"20\"></dd>
    <dt>Message</dt>
    <dd><textarea rows=\"7\" name=\"message\" cols=\"35\"></textarea>
    </dd><dt> </dt>
    <dd><input type=\"submit\" value=\"Submit\" name=\"send\"></dd>
    </dl>
    </form>
    "
    );
    }
    if (
    $_POST[to])
    {
    //the form has been submitted.  Now we have to make it secure and insert it into the database
    $subject htmlspecialchars(addslashes("$_POST[subject]"));
    $message htmlspecialchars(addslashes("$_POST[message]"));
    $to htmlspecialchars(addslashes("$_POST[to]"));
    //the above lines remove html and add \ before all "
    $send mysql_query("INSERT INTO `pmessages` ( `title` , `message` , 
    `touser` , `from` , `unread` , 
    `date` ) VALUES ('
    $subject', '$message', '$to', 
    '
    $logged[username]', 'unread', NOW())");
    echo (
    "Your message has been sent.");
    }
    break;
    case 
    'delete':
    if (!
    $_GET[msgid])
    {
    echo (
    "Sorry, but this is an invalid message!");
    }
    else
    {
    $getmsg mysql_query("SELECT * from pmessages where id = '$_GET[msgid]'");
    $msg mysql_fetch_array($getmsg);
    //hmm..someones trying to delete someone elses messages!  This keeps them from doing it
    if ($msg[touser] != $logged[username])
    {
    echo (
    "This message was not sent to you!");
     
    }
    else
    {
    $delete  mysql_query("delete from pmessages where id = '$_GET[msgid]'");
    echo (
    "Message Deleted");
    }
    }
    break;
    case 
    'inbox':
    $get mysql_query("SELECT * from pmessages where touser = '$logged[username]' order by id desc");
    echo(
    "
    <table bgcolor=\"#dddddd\" border=\"0\" width=\"100%\" cellspacing=\"0\">
    <tr>
    <td align=\"center\">Subject</td>
    <td align=\"center\" width=\"125\">From</td>
    <td align=\"center\" width=\"97\">Date</td>
    <td width=\"25\">Delete</td>
    </tr>
    </table>
    "
    );
    $nummessages mysql_num_rows($get);
    if (
    $nummessages == 0)
    {
    echo (
    "You have 0 messages!");
    }
    else
    {
    echo(
    "<table border=\"0\" width=\"100%\" cellspacing=\"1\">");
    while (
    $messages mysql_fetch_array($get))
    {
    //the above lines gets all the messages sent to you, and displays them with the newest ones on top
    echo ("
    <tr>
    <td><a href=\"messages.php?page=view&msgid=
    $messages[id]\">");
    if (
    $messages[reply] == yes)
    {
    echo (
    "Reply to: ");
    }
    echo (
    "$messages[title]</a></td>
    <td width=\"125\">
    $messages[from]</td>
    <td width=\"97\">
    $messages[date]</td>
    <td width=\"25\"><a href=\"messages.php?page=delete&msgid=
    $messages[id]\">Delete</a></td>
    </tr>"
    );
    }
    echo (
    "</table>");
    }
    break;
    case 
    'view':
    //the url now should look like ?page=view&msgid=#
    if (!$_GET[msgid])
    {
    //there isnt a &msgid=# in the url
    echo ("Invalid message!");
    }
    else
    {
    //the url is fine..so we continue...
    $getmsgmysql_query("SELECT * from pmessages where id = '$_GET[msgid]'");
    $msg mysql_fetch_array($getmsg);
    //the above lines get the message, and put the details into an array.
    if ($msg[touser] == $logged[username])
    {
    //makes sure that this message was sent to the logged in member
    if (!$_POST[message])
    {
    //the form has not been submitted, so we display the message and the form
    $markread mysql_query("Update pmessages set unread = 'read' where id = '$_GET[msgid]'");
    //this line marks the message as read.
    $msg[message] = nl2br(stripslashes("$msg[message]"));
    //removes slashes and converts new lines into line breaks.
    echo ("
    <form method=\"POST\" style=\"margin: 0px;\">
    <dl style=\"margin: 0px;\">
    <dt><b>
    $msg[title] -- From $msg[from]</b></dt>
    <dd>
    $msg[message]</dd>
    <dt><b>Reply</b></dt>
    <dd><textarea rows=\"6\" name=\"message\" cols=\"45\"></textarea></dd>
    <dt> </dt>
    <dd><input type=\"submit\" value=\"Submit\" name=\"send\"></dd>
    </dl></form>"
    );
    }
    if (
    $_POST[message])
    {
    //the form HAS been submitted, now we insert it into the database
    $message htmlspecialchars(addslashes("$_POST[message]"));
    $do mysql_query("INSERT INTO `pmessages` ( `title` , `message` , `touser` , `from` , `unread` , 
    `date`, `reply`) VALUES
    ('
    $msg[title]', '$message', '$msg[from]', '$logged[username]',
     'unread', NOW(), 'yes')"
    );
    echo (
    "Your message has been sent");
    }
    }
    else
    {
    //hmm..this message was NOT sent to the logged in user...so we won't display it.
    echo("<b>Error</b><br />");
    echo (
    "This message was not sent to you!");
    }}
    break;
    }
    echo(
    "<br /><br /><div align=\"center\"><b><a href=\"?page=inbox\">Inbox</a> · <a href=\"?page=write\">New Message</a></b>");
    }
    ?>
    I want the messages to display like this

    Message from {NameOfSender} - {Subject}
    Message from {NameOfSender} - {Subject}
    Message from {NameOfSender} - {Subject}
    Message from {NameOfSender} - {Subject}
    Message from {NameOfSender} - {Subject}

    Etc etc.

    Thanks

    Edited by ---MAD--- (forum moderator): Thread closed as it has gone way off topic, thanks .
    Last edited by ---MAD---; 25-08-2006 at 09:19 AM.

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    and which part of your code do you want to do that since youve got a number of forms and outputs in the script, try being a little more specific, unless u want it to happen in an error message "/

  3. #3
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    well the part where it displays the message ;s

  4. #4
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Well, is this a PM system? if you want it to display like that you would need something like this where it has the message

    Message from $user - $subject

  5. #5
    Join Date
    Feb 2006
    Location
    Coventry
    Posts
    2,096
    Tokens
    0

    Latest Awards:

    Default

    Everyone's helping you like ALOT then your oging to sell it and claim it as yours -.-' Ok the ODD help is ok but then to sell it and give no credit.

    Edited by ---MAD--- (forum moderator): Please stay on topic, thanks .
    Last edited by ---MAD---; 25-08-2006 at 09:10 AM.

  6. #6
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by Sygon. View Post
    Everyone's helping you like ALOT then your oging to sell it and claim it as yours -.-' Ok the ODD help is ok but then to sell it and give no credit.
    Help is giveing people a hand, and thats fine without credit, But this is more getting people to do it all for him.
    Which unlike being helped with someone is makeing other people do the work... which causes the no credit problems "/

  7. #7
    Join Date
    Aug 2006
    Posts
    218
    Tokens
    0

    Default

    well, he scammed me 2T... so check www.pixelresourcesforum.co.uk... and then see if you still fancy helping him.

    i also have a chat log and another link


    Wayne. (Super Moderator) Please don't name scammers.
    Last edited by Wayne; 24-08-2006 at 08:30 PM.
    needing a .com domain with full control i can only pay in habbo furni
    I'll be leaving Habbo to take full care of my site/ forum/ radio, once it's done. I'm not leaving the forum so don't get too excited :rolleyes:
    i'll probably only pop on a few times a week/month etc... as it'll be a full time task running my new site


  8. #8
    Join Date
    Dec 2005
    Location
    England | Brighton
    Posts
    1,378
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Allan_banvict0m View Post
    well, he scammed me 2T... so check www.pixelresourcesforum.co.uk... and then see if you still fancy helping him.

    i also have a chat log and another link

    :eusa_clap :eusa_clap :eusa_clap :eusa_clap To be honest i dont think this site will be good, he asks for help all the time and for little things that if you knew PHP you could do in like 10 secs.

    Edit: Does he have a fake vbulletin ?

    Edited by ---MAD--- (forum moderator): Please stay on topic, thanks .
    Last edited by ---MAD---; 25-08-2006 at 09:11 AM.

  9. #9
    Join Date
    Aug 2006
    Location
    Northamptonshire
    Posts
    250
    Tokens
    0

    Default

    actually adam you noob mine is real i bought it from vbulletin.com, allan said he would buy the files and thats what he got..

    theres alot more to this than just that and allan knows what im talking about..

    and even if my site does turn out crap i aint bothered.. i do know quite a bit of php just because i dont know as much as some of you..

    Edited by ---MAD--- (forum moderator): Please stay on topic, thanks .
    Last edited by ---MAD---; 25-08-2006 at 09:12 AM.

  10. #10
    Join Date
    Aug 2006
    Posts
    461
    Tokens
    0

    Default

    Mate he scammed me 1 t if he's that perfetic to do it just forget about it and laugh at him for being a noob
    Quote Originally Posted by Allan_banvict0m View Post
    well, he scammed me 2T... so check www.pixelresourcesforum.co.uk... and then see if you still fancy helping him.

    i also have a chat log and another link
    Wayne. (Super Moderator) Please don't name scammers.
    Last edited by Wayne; 24-08-2006 at 08:30 PM.

Page 1 of 3 123 LastLast

Posting Permissions

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