-
Posts
3,713 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Zero-Affect
-
Re: View User Addon - Profile Views right i looked at this and thought why should it see how many times u have viewed someones profile when better option would be to see how many times someones viewed your profile so i did a little edit hope you don't mine, also like to add that i never tested this so if it doesn't work please let me know and ill fix it. V2 QUERY Code: ALTER TABLE `users` ADD `pviews` INT (11) NOT NULL DEFAULT '0'; Add in viewuser.php Code: if($userid == $r['userid']) { } else { $db->query ("UPDATE users SET pviews=pviews+1 WHERE userid={$r['userid']}"); } Then add: Code: Profile Views : {$r['pviews']} And your done!
-
Re: [mccode] Multiple Event Deleter events.php <?php require "globals.php"; if(isset($_GET['deleteall'])) { if($_GET['conf'] == 1) { mysql_query("DELETE FROM events WHERE evUSER=$userid",$c); print "All your events were successfully Deleted! ".mysql_affected_rows($c)." events were deleted in this process! [url='events.php']Back[/url] "; exit; } else { print "Are you 100% sure you want to delete all your events? Once deleted, You cannot retrieve them at all. [url='events.php?deleteall&conf=1']Yes, delete them all now[/url] [url='events.php']No, keep them and Go Back[/url] "; exit; } } $q=mysql_query("SELECT * FROM events WHERE evUSER=$userid ORDER BY evTIME DESC LIMIT 10;",$c); if(mysql_num_rows($q)) { print "<SCRIPT LANGUAGE='JavaScript'> function checkAll(field) { for (i = 0; i < field.length; i++) field[i].checked = true ; blah=document.getElementById('dell'); blah.disabled=false; blaht=document.getElementById('dellt'); blaht.disabled=false; } function uncheckAll(field) { for (i = 0; i < field.length; i++) field[i].checked = false ; blah=document.getElementById('dell'); blah.disabled=true; blaht=document.getElementById('dellt'); blaht.disabled=true; } </script>"; } print "<h3>Events</h3>"; $_GET['delete'] = abs((int) $_GET['delete']); if($_GET['delete']) { mysql_query("DELETE FROM events WHERE evID={$_GET['delete']} AND evUSER=$userid",$c); print "[b]Event Deleted[/b] "; } if(mysql_num_rows($q)) { print "<hr /> [url='events.php?deleteall']Delete All[/url] <hr /><form action='multievents.php' name='myform' method='post'> <input type=submit value='-Delete Selected Events-' id='dell'> <a href=\"javascript:checkAll(document.myform.list);\">Check All</a> <a href=\"javascript:uncheckAll(document.myform.list);\">Uncheck All</a> "; } print "<table width=75% border=2> <tr style='background:gray;'> <th>Time</th> <th>Event</th><th>Links</th> </tr>"; if(mysql_num_rows($q) == 0) { print "<tr><td colspan=3>You currently have no events.</td></tr>"; } while($r=mysql_fetch_array($q)) { print "<tr><td>".date('F j Y, g:i:s a',$r['evTIME']); if (!$r['evREAD']) { print " [b]New![/b]"; } print "</td><td>{$r['evTEXT']}</td><td>[url='events.php?delete={$r[']Delete[/url] <input type=checkbox name='delete{$r['evID']}' id='list' value='$r[evID]'></td></tr>"; } print "</table>"; if(mysql_num_rows($q)) { print " <a href=\"javascript:checkAll(document.myform.list);\">Check All</a> <a href=\"javascript:uncheckAll(document.myform.list);\">Uncheck All</a> <input type=submit value='-Delete Selected Events-' id='dellt'> </form>"; } mysql_query("UPDATE events SET evREAD=1 WHERE evUSER=$userid",$c); $h->endpage(); ?> multievents.php <?php require "globals.php"; print "<h3>Events</h3>"; if(!$_POST) { print "What are you supposed to delete? [url='events.php']Back[/url] "; } else { $deleted=0; $q=mysql_query("SELECT * FROM events WHERE evUSER=$userid ORDER BY evTIME DESC LIMIT 10;",$c); while($r=mysql_fetch_array($q)) { $evv="delete".$r['evID']; if($_POST[$evv]) { $event=$_POST[$evv]; if($r['evID'] == $event) { mysql_query("DELETE FROM events WHERE evID=$event"); $deleted++; } } } print "$deleted Events were deleted! [url='events.php']Back[/url] "; } $h->endpage(); ?> Converted to v2 for you v2 users and tested. works fine, nice mod
-
Re: [mccode] Whore House Mod FREE <?php require "globals.php"; if(!$_GET['spend']) { print "<h2>Brothel</h2> Welcome, we have many fine prostitutes here, both male and female. Prices and payment options are listed below. "; if($ir['gender'] == 'Male') { print " <h3>For The Guys</h3> <table border='1' width='90%' bordercolor='#939393'><tr background='tablehgrad.png'><th>Prostitute</th><th>Age</th><th>Race</th><th>Price</th><th><center>Hire</th></tr><tr> <td><center>Roxy</td><td><center>39</td><td><center>White</td><td><center>$1,000</td><td><center>[url='brothel.php?spend=Roxy']Hire Roxy[/url]</td></tr><tr> <td><center>Kelly</td><td><center>18</td><td><center>White</td><td><center>$1,500</td><td><center>[url='brothel.php?spend=kelly']Hire Kelly[/url]</td></tr><tr> <td><center>Shaniqua</td><td><center>23</td><td><center>Black</td><td><center>$2,000</td><td><center>[url='brothel.php?spend=shan']Hire Shaniqua[/url]</td></tr><tr> <td><center>Rhonda</td><td><center>20</td><td><center>Asian</td><td><center>$2,500</td><td><center>[url='brothel.php?spend=rhonda']Hire Rhonda[/url]</td></tr></table> <h3>For The Homosexuals.</h3> <table border='1' width='90%' bordercolor='#939393'><tr background='tablehgrad.png'><th>Prostitute</th><th>Age</th><th>Race</th><th>Price</th><th><center>Hire</th></tr><tr> <td><center>Bill</td><td><center>18</td><td><center>White</td><td><center>$1,000</td><td><center>[url='brothel.php?spend=bill']Hire Bill[/url]</td></tr><tr> <td><center>Markus</td><td><center>20</td><td><center>Black</td><td><center>$1,500</td><td><center>[url='brothel.php?spend=markus']Hire Markus[/url]</td></tr><tr> <td><center>Greg</td><td><center>24</td><td><center>White</td><td><center>$2,000</td><td><center>[url='brothel.php?spend=greg']Hire Greg[/url]</td></tr><tr> <td><center>Sam</td><td><center>28</td><td><center>Asian</td><td><center>$2,500</td><td><center>[url='brothel.php?spend=sam']Hire Sam[/url]</td></tr></table>"; } if($ir['gender'] == 'Female') { print " <h3>For The Ladies</h3> <table border='1' width='90%' bordercolor='#939393'><tr background='tablehgrad.png'><th>Prostitute</th><th>Age</th><th>Race</th><th>Price</th><th><center>Hire</th></tr><tr> <td><center>Mark</td><td><center>26</td><td><center>Asian</td><td><center>$1,000</td><td><center>[url='brothel.php?spend=mark']Hire Mark[/url]</td></tr><tr> <td><center>Jason</td><td><center>23</td><td><center>White</td><td><center>$1,500</td><td><center>[url='brothel.php?spend=jason']Hire Jason[/url]</td></tr><tr> <td><center>Jaquez</td><td><center>20</td><td><center>Black</td><td><center>$2,000</td><td><center>[url='brothel.php?spend=jaq']Hire Jaquez[/url]</td></tr><tr> <td><center>Ted</td><td><center>18</td><td><center>White</td><td><center>$2,500</td><td><center>[url='brothel.php?spend=ted']Hire Ted[/url]</td></tr></table> <h3>For The Lesbians</h3> <table border='1' width='90%' bordercolor='#939393'><tr background='tablehgrad.png'><th>Prostitute</th><th>Age</th><th>Race</th><th>Price</th><th><center>Hire</th></tr><tr> <td><center>Jenny</td><td><center>19</td><td><center>Asian</td><td><center>$1,000</td><td><center>[url='brothel.php?spend=jenny']Hire Jenny[/url]</td></tr><tr> <td><center>Cindy</td><td><center>23</td><td><center>White</td><td><center>$1,500</td><td><center>[url='brothel.php?spend=cindy']Hire Cindy[/url]</td></tr><tr> <td><center>Mel</td><td><center>24</td><td><center>Black</td><td><center>$2,000</td><td><center>[url='brothel.php?spend=mel']Hire Mel[/url]</td></tr><tr> <td><center>Emma</td><td><center>27</td><td><center>White</td><td><center>$2,500</td><td><center>[url='brothel.php?spend=emma']Hire Emma[/url]</td></tr></table>"; } } else { if($_GET['spend'] == 'bill') { if($ir['money'] <1000) { print "You don't have enough money to hire Bill."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-1000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Bill \$1,000, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'markus') { if($ir['money'] <1500) { print "You don't have enough money to hire Markus."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-1500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Markus \$1,500, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'greg') { if($ir['money'] <2000) { print "You don't have enough money to hire Greg."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-2000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Greg \$2,000, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'sam') { if($ir['money'] <2500) { print "You don't have enough money to hire Sam."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-2500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Sam \$2,500, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'jenny') { if($ir['money'] <1000) { print "You don't have enough money to hire Jenny."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-1000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Jenny \$1,000, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'cindy') { if($ir['money'] <1500) { print "You don't have enough money to hire Cindy."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-1500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Cindy \$1,500, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'mel') { if($ir['money'] <2000) { print "You don't have enough money to hire Mel."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-2000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Mel \$2,000, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'emma') { if($ir['money'] <2500) { print "You don't have enough money to hire Emma."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-2500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Emma \$2,500, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } if($_GET['spend'] == 'Roxy') { if($ir['money'] <1000) { print "You don't have enough money to hire Roxy."; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-1000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Roxy \$1,000, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'kelly') { if($ir['money'] <1500) { print "You don't have enough money to hire a Kelly!"; } else { mysql_query("UPDATE users SET will=will+90,energy=0,money=money-1500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Kelly \$1,500 took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'shan') { if($ir['money'] <2000) { print "You don't have enough money to hire a Shaniqua!"; } else { mysql_query("UPDATE users SET will=will+160,energy=0,money=money-2000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Shaniqua \$2,000, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'rhonda') { if($ir['money'] <2500) { print "You don't have enough money to hire a Rhonda!"; } else { mysql_query("UPDATE users SET will=will+270,energy=0,money=money-2500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Rhonda \$2,500, took her to the back room and had your way with her. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'mark') { if($ir['money'] <1000) { print "You don't have enough money to hire a Mark!"; } else { mysql_query("UPDATE users SET will=will+55,energy=0,money=money-1000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Mark \$1,000, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'jason') { if($ir['money'] <1500) { print "You don't have enough money to hire a Jason!"; } else { mysql_query("UPDATE users SET will=will+90,energy=0,money=money-1500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Jason \$1,500, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'jaq') { if($ir['money'] <2000) { print "You don't have enough money to hire a Jaquez!"; } else { mysql_query("UPDATE users SET will=will+160,energy=0,money=money-2000 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Jaquez \$2,000, took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } else if($_GET['spend'] == 'ted') { if($ir['money'] <2500) { print "You don't have enough money to hire a Ted!"; } else { mysql_query("UPDATE users SET will=will+270,energy=0,money=money-2500 WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=maxwill WHERE will > maxwill",$c); print "<center>You payed Ted \$2,500 took him to the back room and had your way with him. You feel some of your will comming back to you. [url='index.php']>Home[/url]</center>"; } } } $h->endpage(); ?> This version doesn't have the limit but its set so that depending on your sex you see what is available, easy edit i know but looks better i believe and alot more fun. for v2
-
Re: Updated Mailbox [v1] It's actually not a bad modification for mail i hate the actual mc mail.
-
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. [b]Reason: {$ir['mb_reason']}</font>[/b]"); } $_GET['ID'] = abs((float) $_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>> [url='mailbox.php?action=compose'] Compose[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=outbox'] Outbox[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=archive'] Save[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=delall'] Delete All[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=mailhome'] Inbox[/url]</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,$db; print "Below are the Last 10 Messages Sent to You<hr width=90%> <table width=90% cellpadding=3 class='table'> <tr> <th width=30%>From</th> <th width=40%>Subject</th> <th width=15%>Status</th> <th width=15%>Manage</th> </tr> <tr>"; $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)) { $sent = date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($ir['userid'] == 0) { echo 'SYSTEM'; } else { echo '[url="viewuser.php?u='.$r['userid'].'"]'.$r['username'].' ['.$r['userid'].'][/url]'; } $fm = urlencode($r['mail_subject']); if($r['mail_read'] == 0) { $status = "<font color=red>Unread</font>"; } else { $status = "<font color=green>Read</font>"; } if($r['mail_subject'] == '') { $subj="No Subject"; } else { $subj="{$r['mail_subject']}"; } print " </td> <td> [b]Subject:[/b] [url='mailbox.php?action=read&ID={$r[']$subj[/url] [i]Sent at: $sent[/i] </td> <td> <center> $status </center> </td> <td> <center> [[url='mailbox.php?action=delete&ID={$r[']Delete[/url]] [[url='mailbox.php?action=read&ID={$r[']Read[/url]] </center> </td> </tr>"; } echo '</table>'; } function mail_view() { global $ir,$c,$userid,$h,$db; print " <table width=90% cellpadding=3 class='table'>"; mysql_query("UPDATE users SET new_mail=new_mail-1 WHERE userid='$userid' AND new_mail>0") or die(mysql_error()); $id= abs((int) $_GET['ID']); $q=$db->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=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>"; if($r['userid']) { print "[b]Mail From: [/b][url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]"; } else { print "SYSTEM"; } if($r['mail_subject'] == '') { $subj="No Subject"; } else { $subj="{$r['mail_subject']}"; } $fm=urlencode($r['mail_text']); print "<th bgcolor=#AAAAAA width=75%>[b]Subject:[/b] $subj</th></tr><tr><td>Sent at: $sent [url='mailbox.php?action=compose&ID={$r[']Reply[/url] [url='mailbox.php?action=delete&ID={$r[']Delete[/url] [url='preport.php?ID={$r[']Report[/url]</td><td>{$r['mail_text']}</td></tr></table>"; } $db->query("UPDATE mail SET mail_read=1 WHERE mail_id=$id",$c); } function mail_outbox() { global $ir,$c,$userid,$h,$db; 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=$db->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=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$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>"; } if($r['mail_subject'] == '') { $subj="No Subject"; } else { $subj="{$r['mail_subject']}"; } print "</td>\n<td>[b]Subject:[/b] [url='mailbox.php?action=read&ID={$r[']$subj[/url] [i]Sent at: $sent[/i]</td><td><center>[[url='mailbox.php?action=read&ID={$r[']Read[/url]]</td></tr>"; } echo '</table>'; } function mail_compose() { global $ir,$c,$userid,$h,$db; $iduser= (int) $_GET['ID']; print "<form action='mailbox.php?action=send' method='post'> <table width=90% cellpadding=3 class='table'> <tr><td colspan=3>[b] Send a Message[/b]</td></tr><tr> <td>User's ID:</td> <td><input type='text' name='userid' value='$iduser' size='5' maxlength='10' /> [i]<font size=1.9>(E.g. 123456)</font>[/i]</td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' size='50' maxlength='50' value=' ' /> [i]<font size=1.9>(E.g. Hello there)</font>[/i]</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%>> [url='mailbox.php']Back to Messages[/url]<hr width=90%>"; if($_GET['ID']) { print " <table width=90% cellpadding=3 class='maintable'><tr><td colspan=2 bgcolor=#AAAAAA>[b]Your last 5 mails to/from this person:[/b]</td></tr>"; $q=$db->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=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>$sent</td> <td bgcolor=#AAAAAA>[b]{$r['sender']} wrote:[/b] {$r['mail_text']}</td></tr>"; } print "</table>"; } } function mail_send() { global $ir,$c,$userid,$h,$db; $to= (int) $_POST['userid']; if($_POST['userid'] < 0) { die("<font color=red>[b]Coo Off Stop trying to exploit bugs.[/b]</font>"); } mysql_query("UPDATE users SET new_mail=new_mail+1 WHERE userid='{$to}'") or die(mysql_error()); $db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'{$_POST['subject']}','{$_POST['message']}')",$c) or die(mysql_error()); print "Your Message has been Sent. [url='mailbox.php']> Back[/url]"; } function mail_delete() { global $ir,$c,$userid,$h,$db; $m=$db->query("SELECT * FROM mail WHERE mail_to=$userid"); $nm=$db->num_rows($m); $db->query("UPDATE users SET new_mail=new_mail-{$nm} WHERE userid=$userid AND new_mail>0",$c); $db->query("DELETE FROM mail WHERE mail_id={$_GET['ID']} AND mail_to='{$ir['userid']}'",$c); print "Message deleted. [url='mailbox.php']> Back[/url]"; } function mail_delall() { global $ir,$c,$userid,$h,$db; print "This will delete all the messages in your inbox. There is [b]NO[/b] undo, so be sure. [url='mailbox.php?action=delall2']> Yes, delete all messages[/url] [url='mailbox.php']> No, go back[/url]"; } function mail_delall2() { global $ir,$c,$userid,$h,$db; $db->query("DELETE FROM mail WHERE mail_to=$userid",$c); $db->query("UPDATE users SET new_mail=new_mail-".mysql_affected_rows($c)." WHERE userid=$userid AND new_mail>0",$c); print "All ".mysql_affected_rows($c)." mails in your inbox were deleted. [url='mailbox.php']> Back[/url]"; } function mail_archive() { global $ir,$c,$userid,$h; print "This tool will download an archive of all your messages. [url='dlarchive.php?a=inbox']> Download Inbox[/url] [url='dlarchive.php?a=outbox']> Download Outbox[/url]"; } $h->endpage(); ?> Yeah sorry about that mate, with this one if theres no subject it will post the subject has 'No Subject'
-
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. [b]Reason: {$ir['mb_reason']}</font>[/b]"); } $_GET['ID'] = abs((float) $_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>> [url='mailbox.php?action=compose'] Compose[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=outbox'] Outbox[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=archive'] Save[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=delall'] Delete All[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=mailhome'] Inbox[/url]</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,$db; print "Below are the Last 10 Messages Sent to You<hr width=90%> <table width=90% cellpadding=3 class='table'> <tr> <th width=30%>From</th> <th width=40%>Subject</th> <th width=15%>Status</th> <th width=15%>Manage</th> </tr> <tr>"; $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)) { $sent = date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($ir['userid'] == 0) { echo 'SYSTEM'; } else { echo '[url="viewuser.php?u='.$r['userid'].'"]'.$r['username'].' ['.$r['userid'].'][/url]'; } $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> <td> [b]Subject:[/b] [url='mailbox.php?action=read&ID={$r[']{$r['mail_subject']}[/url] [i]Sent at: $sent[/i] </td> <td> <center> $status </center> </td> <td> <center> [[url='mailbox.php?action=delete&ID={$r[']Delete[/url]] [[url='mailbox.php?action=read&ID={$r[']Read[/url]] </center> </td> </tr>"; } echo '</table>'; } function mail_view() { global $ir,$c,$userid,$h,$db; print " <table width=90% cellpadding=3 class='table'>"; mysql_query("UPDATE users SET new_mail=new_mail-1 WHERE userid='$userid' AND new_mail>0") or die(mysql_error()); $id= abs((int) $_GET['ID']); $q=$db->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=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>"; if($r['userid']) { print "[b]Mail From: [/b][url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_text']); print "<th bgcolor=#AAAAAA width=75%>[b]Subject:[/b] {$r['mail_subject']}</th></tr><tr><td>Sent at: $sent [url='mailbox.php?action=compose&ID={$r[']Reply[/url] [url='mailbox.php?action=delete&ID={$r[']Delete[/url] [url='preport.php?ID={$r[']Report[/url]</td><td>{$r['mail_text']}</td></tr></table>"; } $db->query("UPDATE mail SET mail_read=1 WHERE mail_id=$id",$c); } function mail_outbox() { global $ir,$c,$userid,$h,$db; 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=$db->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=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$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>[b]Subject:[/b] [url='mailbox.php?action=read&ID={$r[']{$r['mail_subject']}[/url] [i]Sent at: $sent[/i]</td><td><center>[[url='mailbox.php?action=read&ID={$r[']Read[/url]]</td></tr>"; } echo '</table>'; } function mail_compose() { global $ir,$c,$userid,$h,$db; print "<form action='mailbox.php?action=send' method='post'> <table width=90% cellpadding=3 class='table'> <tr><td colspan=3>[b] Send a Message[/b]</td></tr><tr> <td>User's ID:</td> <td><input type='text' name='userid' value='' size='5' maxlength='10' /> [i]<font size=1.9>(E.g. 123456)</font>[/i]</td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' size='50' maxlength='50' value=' ' /> [i]<font size=1.9>(E.g. Hello there)</font>[/i]</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%>> [url='mailbox.php']Back to Messages[/url]<hr width=90%>"; if($_GET['ID']) { print " <table width=90% cellpadding=3 class='maintable'><tr><td colspan=2 bgcolor=#AAAAAA>[b]Your last 5 mails to/from this person:[/b]</td></tr>"; $q=$db->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=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>$sent</td> <td bgcolor=#AAAAAA>[b]{$r['sender']} wrote:[/b] {$r['mail_text']}</td></tr>"; } print "</table>"; } } function mail_send() { global $ir,$c,$userid,$h,$db; $to= (int) $_POST['userid']; if($_POST['userid'] < 0) { die("<font color=red>[b]Coo Off Stop trying to exploit bugs.[/b]</font>"); } mysql_query("UPDATE users SET new_mail=new_mail+1 WHERE userid='{$to}'") or die(mysql_error()); $db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'{$_POST['subject']}','{$_POST['message']}')",$c) or die(mysql_error()); print "Your Message has been Sent. [url='mailbox.php']> Back[/url]"; } function mail_delete() { global $ir,$c,$userid,$h,$db; $m=$db->query("SELECT * FROM mail WHERE mail_to=$userid"); $nm=$db->num_rows($m); $db->query("UPDATE users SET new_mail=new_mail-{$nm} WHERE userid=$userid AND new_mail>0",$c); $db->query("DELETE FROM mail WHERE mail_id={$_GET['ID']} AND mail_to='{$ir['userid']}'",$c); print "Message deleted. [url='mailbox.php']> Back[/url]"; } function mail_delall() { global $ir,$c,$userid,$h,$db; print "This will delete all the messages in your inbox. There is [b]NO[/b] undo, so be sure. [url='mailbox.php?action=delall2']> Yes, delete all messages[/url] [url='mailbox.php']> No, go back[/url]"; } function mail_delall2() { global $ir,$c,$userid,$h,$db; $db->query("DELETE FROM mail WHERE mail_to=$userid",$c); $db->query("UPDATE users SET new_mail=new_mail-".mysql_affected_rows($c)." WHERE userid=$userid AND new_mail>0",$c); print "All ".mysql_affected_rows($c)." mails in your inbox were deleted. [url='mailbox.php']> Back[/url]"; } function mail_archive() { global $ir,$c,$userid,$h; print "This tool will download an archive of all your messages. [url='dlarchive.php?a=inbox']> Download Inbox[/url] [url='dlarchive.php?a=outbox']> Download Outbox[/url]"; } $h->endpage(); ?> Added a little extra for us v2 users this one works perfectly(does not include smilies) be kind this is my first ever post lol