Richard Posted March 16, 2008 Share Posted March 16, 2008 This took me two hours to finish editing, It should work perfectly... Replace your mailbox.php with this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I hope you enjoy! :) Quote Link to comment Share on other sites More sharing options...
Halo Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] Great mod m8, i'm adding it to my game NOW! Quote Link to comment Share on other sites More sharing options...
Klikoka Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] Here It Is For V2: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Richard Posted March 16, 2008 Author Share Posted March 16, 2008 Re: Updated Mailbox [v1] Thank you for Converting Klikoka :) Quote Link to comment Share on other sites More sharing options...
Klikoka Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] No Problem Quote Link to comment Share on other sites More sharing options...
Miniman Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] Fatal error: Call to a member function query() on a non-object in /home/******/public_html/mailbox.php on line 69 $q=$db->query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_to=$userid ORDER BY mail_time DESC LIMIT 10",$c); while($r=$db->fetch_row($q)) ;) Quote Link to comment Share on other sites More sharing options...
gurpreet Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] Fatal error: Call to a member function query() on a non-object in /home/*&*&*&***&/public_html/mailbox.php on line 69 Same here, any idea how to fix it? Quote Link to comment Share on other sites More sharing options...
Richard Posted March 16, 2008 Author Share Posted March 16, 2008 Re: Updated Mailbox [v1] Im sorry, Im not sure...It works fine for me in v1 Quote Link to comment Share on other sites More sharing options...
Miniman Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] :) Just change Line 66 to this global $ir,$c,$userid,$h,$db; You need to add the $db for v2. Oh, Very good btw Quote Link to comment Share on other sites More sharing options...
gurpreet Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] I see. Thanks Miniman and Richard. This is awesome :) Quote Link to comment Share on other sites More sharing options...
Miniman Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] There is the same problem on line 101, Just find line 97 and change global $ir,$c,$userid,$h; to global $ir,$c,$userid,$h,$db; Quote Link to comment Share on other sites More sharing options...
Cyanide Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] Can someone post some screen shots? Quote Link to comment Share on other sites More sharing options...
Richard Posted March 16, 2008 Author Share Posted March 16, 2008 Re: Updated Mailbox [v1] Quote Link to comment Share on other sites More sharing options...
ronhouston2 Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] <?php include "globals.php"; if($ir['mailban']) { die("<center><font color=red><font size='4' face='Arial, Helvetica, sans-serif'>Error</font> You have been mail banned for {$ir['mailban']} days. Reason: {$ir['mb_reason']}</font>"); } $_GET['ID'] = abs((int) $_GET['ID']); print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Mail Box</font><hr width=90%><table width=90% border=0><tr> <td width=20% align=center>> Compose</td> <td width=20% align=center>> Outbox</td> <td width=20% align=center>> Save</td> <td width=20% align=center>> Delete All</td> <td width=20% align=center>> Inbox</td> </tr></table><hr width=90%>"; switch($_GET['action']) { case 'inbox': mail_inbox(); break; case 'outbox': mail_outbox(); break; case 'compose': mail_compose(); break; case 'delete': mail_delete(); break; case 'send': mail_send(); break; case 'delall': mail_delall(); break; case 'delall2': mail_delall2(); break; case 'archive': mail_archive(); break; case 'read': mail_view(); break; case 'mailhome': mail_home(); break; default: mail_home(); break; } function mail_home() { global $ir,$c,$userid,$h; print "Below are the Last 10 Messages Sent to You<hr width=90%> <table width=90% cellpadding=3 class=maintable><tr bgcolor=AAAAAA><th width=30%>From</th><th width=40%>Subject</th><th width=15%>Status</th><th width=15%>Manage</th></tr>"; $q=mysql_query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_to=$userid ORDER BY mail_time DESC LIMIT 10",$c); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "{$r['username']} [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_subject']); if($r['mail_read'] == 0) { $status="<font color=red>Unread</font>"; } else { $status="<font color=green>Read</font>"; } print "</td>\n<td>Subject: {$r['mail_subject']} Sent at: $sent</td><td><center> $status</td><td><center>[Delete] [Read]</td></tr>"; } } function mail_view() { global $ir,$c,$userid,$h; print " <table width=90% cellpadding=3 class=maintable>"; $id= abs((int) $_GET['ID']); $q=mysql_query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_id=$id LIMIT 1"); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>"; if($r['userid']) { print "Mail From: {$r['username']} [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_text']); print "<th bgcolor=#AAAAAA width=75%>Subject: {$r['mail_subject']}</th></tr><tr><td>Sent at: $sent Reply Delete Report</td><td>{$r['mail_text']}</td></tr></table> <form action='mailbox.php?action=send' method='post'> <table width=90% cellpadding=3 class='maintable'><th colspan=2 bgcolor=#AAAAAA>Reply To This Message</th> <tr> <td>User's ID:</td> <td><input type='text' name='userid' value='{$r['userid']}' size='5' maxlength='10' /> <font size=1.9>(E.g. 123456)</font></td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' size='50' maxlength='50' value=' ' /> <font size=1.9>(E.g. Hello there)</font></td></tr><tr> <td>Message:</td> <td><textarea rows='10' cols='75%' name='message'></textarea></td></tr><tr> <td colspan=2><center><input type='submit' value='Send' /></td></tr></form>"; } mysql_query("UPDATE mail SET mail_read=1 WHERE mail_id=$id",$c); } function mail_outbox() { global $ir,$c,$userid,$h; print "Below are the Last 10 Messages You have Sent<hr width=90%> <table width=90% cellpadding=3 class=maintable><tr bgcolor=AAAAAA><th width=35%>From</th><th width=50%>Subject</th><th width=15%>Manage</th></tr>"; $q=mysql_query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_to=u.userid WHERE m.mail_from=$userid ORDER BY mail_time DESC LIMIT 10",$c); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "{$r['username']} [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_subject']); if($r['mail_read'] == 0) { $status="<font color=red>Unread</font>"; } else { $status="<font color=green>Read</font>"; } print "</td>\n<td>Subject: {$r['mail_subject']} Sent at: $sent</td><td><center>[Read]</td></tr>"; } } function mail_compose() { global $ir,$c,$userid,$h; print "<form action='mailbox.php?action=send' method='post'> <table width=90% cellpadding=3 class='maintable'> <tr><td colspan=3 bgcolor=#AAAAAA> Send a Message</td></tr><tr> <td>User's ID:</td> <td><input type='text' name='userid' value='' size='5' maxlength='10' /> <font size=1.9>(E.g. 123456)</font></td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' size='50' maxlength='50' value=' ' /> <font size=1.9>(E.g. Hello there)</font></td></tr><tr> <td>Message:</td> <td><textarea rows='10' cols='75%' name='message'></textarea></td></tr><tr> <td colspan=2><center><input type='submit' value='Send' /></td></tr></table></form><hr width=90%>> Back to Messages<hr width=90%>"; if($_GET['ID']) { print " <table width=90% cellpadding=3 class='maintable'><tr><td colspan=2 bgcolor=#AAAAAA>Your last 5 mails to/from this person:</td></tr>"; $q=mysql_query("SELECT m.*,u1.username as sender from mail m left join users u1 on m.mail_from=u1.userid WHERE (m.mail_from=$userid AND m.mail_to={$_GET['ID']}) OR (m.mail_to=$userid AND m.mail_from={$_GET['ID']}) ORDER BY m.mail_time DESC LIMIT 5",$c); while($r=mysql_fetch_array($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>$sent</td> <td bgcolor=#AAAAAA>{$r['sender']} wrote: {$r['mail_text']}</td></tr>"; } print "</table>"; } } function mail_send() { global $ir,$c,$userid,$h; $subj=str_replace(array("\n"),array(" "),strip_tags($_POST['subject'])); $msg=str_replace(array("\n"),array(" "),strip_tags($_POST['message'])); $codes = array( ':]', ':D', ':oo:', 'O.o', ':/', ':angry:', ':?:', ':lol:', ':-:', ':O', ':(', 'O.O', ':roll:', ':zzz:', ':)', ':P', ':S', ':nut:', ';)', ':heart:', 'XD', ); $images = array( '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ); $newmsg = str_replace($codes, $images, $msg); $to= (int) $_POST['userid']; mysql_query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$newmsg')",$c) or die(mysql_error()); print "Your Message has been Sent. > Back"; } function mail_delete() { global $ir,$c,$userid,$h; mysql_query("DELETE FROM mail WHERE mail_id={$_GET['ID']} AND mail_to=$userid",$c); print "Message deleted. > Back"; } function mail_delall() { global $ir,$c,$userid,$h; print "This will delete all the messages in your inbox. There is NO undo, so be sure. > Yes, delete all messages > No, go back"; } function mail_delall2() { global $ir,$c,$userid,$h; mysql_query("DELETE FROM mail WHERE mail_to=$userid",$c); print "All ".mysql_affected_rows($c)." mails in your inbox were deleted. > Back"; } function mail_archive() { global $ir,$c,$userid,$h; print "This tool will download an archive of all your messages. > Download Inbox > Download Outbox"; } $h->endpage(); ?> This is the right one for V2 the other one had an Error on it so i fixed it :D :D Quote Link to comment Share on other sites More sharing options...
ronhouston2 Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] Sorry about the Smilys in the last post i added a attach file for the V2 8-) 8-) 8-) Quote Link to comment Share on other sites More sharing options...
GrimR Posted March 16, 2008 Share Posted March 16, 2008 Re: Updated Mailbox [v1] i used ronhouston2's version and for some reason i keep getting a Mailbox(1) even though its been read and i don't know why its doing it :? Quote Link to comment Share on other sites More sharing options...
redsnake420 Posted March 17, 2008 Share Posted March 17, 2008 Re: Updated Mailbox [v1] whats a good place to get smileys Quote Link to comment Share on other sites More sharing options...
Akash Posted March 17, 2008 Share Posted March 17, 2008 Re: Updated Mailbox [v1] Great mod and I'm using that. Your game looks very similar to Torn City, even the energy bars and icons at the top. :mrgreen: Quote Link to comment Share on other sites More sharing options...
Halo Posted March 17, 2008 Share Posted March 17, 2008 Re: Updated Mailbox [v1] Great mod and I'm using that. Your game looks very similar to Torn City, even the energy bars and icons at the top. :mrgreen: Well Richard's codes are great and his game looks great anyway. c0der aka JJ Quote Link to comment Share on other sites More sharing options...
redsnake420 Posted March 18, 2008 Share Posted March 18, 2008 Re: Updated Mailbox [v1] how come the smilies don't show up when trying to compose a msg i have made the folder named smilies and uploaded smilies and changed the names to what was on the mod and still nothing showed up i really like this mod but i need my smilies lol someone help ps. Richard great mod upgrade :-) :mrgreen: Quote Link to comment Share on other sites More sharing options...
Richard Posted March 18, 2008 Author Share Posted March 18, 2008 Re: Updated Mailbox [v1] http://rapidshare.de/files/38860186/Smi ... 8.zip.html These are the smilies I have on my mailbox right now. Quote Link to comment Share on other sites More sharing options...
ronhouston2 Posted March 18, 2008 Share Posted March 18, 2008 Re: Updated Mailbox [v1] i notice that the mail box link is not working right as well but its ok just have to keep checking it thats all Quote Link to comment Share on other sites More sharing options...
Richard Posted March 18, 2008 Author Share Posted March 18, 2008 Re: Updated Mailbox [v1] What do you mean about the mail box link? :? Quote Link to comment Share on other sites More sharing options...
blackrobe Posted March 18, 2008 Share Posted March 18, 2008 Re: Updated Mailbox [v1] great mod a+ for it Quote Link to comment Share on other sites More sharing options...
ronhouston2 Posted March 18, 2008 Share Posted March 18, 2008 Re: Updated Mailbox [v1] I Notice that it dont show how many messages we have next to the link Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.