Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mail_compose()
- {
- global $pl;
- echo "<center><table width = '75%' border = '0' cellspacing = '0' class = 'forum'>
- <tr bgcolor = '#999999'><td colspan=2><center><b>Send a message</b></td></tr>
- <form name = 'reply' method = 'post' action = 'messages.php?action=send'><tr>
- <td width = '25%' bgcolor = '#E3E3E3'><b>Users ID:</b></td>
- <td bgcolor=#E3E3E3><input type = 'text' name = 'to' size = '5' maxlength = '10' value = '{$_GET['XID']}'>
- <i><font size=2>(Example. 1)</font></i></td>
- </tr><tr>
- <td width=25% bgcolor=#E3E3E3><b>Subject:</b></td>
- <td bgcolor=#E3E3E3><input type = 'text' name = 'subject' size = '50' maxlength = '50' value=''>
- <i><font size=2>(Example. Hello)</font></i></td>
- </tr><tr><td bgcolor = '#E3E3E3' colspan = '2' align = 'center'>
- <a onClick=\"addwithEase(' :) ')\"><img src='images/smilies/smile.gif'></a>
- <a onClick=\"addwithEase(' :P ')\"><img src='images/smilies/tounge.gif'></a>
- <a onClick=\"addwithEase(' :( ')\"><img src='images/smilies/sad.gif'></a>
- <a onClick=\"addwithEase(' :o ')\"><img src='images/smilies/shocked.gif'></a>
- <a onClick=\"addwithEase(' :@ ')\"><img src='images/smilies/angry.gif'></a>
- <a onClick=\"addwithEase(' o_O ')\"><img src='images/smilies/sarcy.gif'></a>
- <a onClick=\"addwithEase(' :s ')\"><img src='images/smilies/confused.gif'></a>
- <a onClick=\"addwithEase(' ;) ')\"><img src='images/smilies/wink.gif'></a>
- <a onClick=\"addwithEase(' :* ')\"><img src='images/smilies/cool.gif'></a>
- <a onClick=\"addwithEase(' :|o ')\"><img src='images/smilies/psyc.gif'></a>
- <a onClick=\"addwithEase(' :| ')\"><img src='images/smilies/dissapointed.gif'></a>
- <a onClick=\"addwithEase(' :D ')\"><img src='images/smilies/grin.gif'></a>
- <a onClick=\"addwithEase(' xD ')\"><img src='images/smilies/histericle.gif'></a>
- <a onClick=\"addwithEase(' :L ')\"><img src='images/smilies/laughing.gif'></a>
- <a onClick=\"addwithEase(' xP ')\"><img src='images/smilies/histericletounge.gif'></a>
- </td></tr>
- <tr>
- <td bgcolor = '#E3E3E3'><b>Message:</b></td>
- <td width = '90%' bgcolor = '#E3E3E3'>
- <textarea name = 'message' rows = '10' cols = '75%'></textarea></td>
- </tr><tr bgcolor = '#E3E3E3'>
- <td colspan = '2'><center><input type = 'submit' value = 'Send'></center></td>
- </tr></form></table></center><script language=\"JavaScript\" type=\"text/javascript\">
- function addwithEase(smileToAdd)
- {
- document.reply.message.value += smileToAdd;document.reply.message.focus();
- }
- </script>
- <hr width = '75%'/>> <a href='messages.php'>Back</a><hr width = '75%'/>";
- }
- function mail_send()
- {
- global $pl;
- $q_ry = array();
- $q_ry = "SELECT `my_mailban`,`mban_reason`
- FROM `members`
- WHERE `playerid` = '".($_SESSION['playerid'])."'";
- $mb = array();
- $mb = mysql_fetch_array(mysql_query($q_ry));
- $_POST['message'] = stripslashes($_POST['message']);
- $_POST['subject'] = stripslashes($_POST['subject']);
- $_POST['to'] = abs(intval($_POST['to']));
- if($mb['my_mailban'])
- {
- echo "<center><font color = 'red'><b>Error, You have been mail banned for ".$mb['my_mailban']." days(s).
- <br/>Reason: ". $mb['mban_reason'] . ".</b></font>
- <hr width = '75%'>><a href='index.php'>Home</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else if(!$_POST['message'])
- {
- echo "<center>Error, You must compose a message to send, It cannot be blank.<br>
- ><a href='messages.php?action=new'>Back</a>";
- include('./includes/style_bottom.php');
- exit();
- }
- else if($_POST['to'] == $_SESSION['playerid'])
- {
- echo "<center>Error, Sending mail to yourself is sad!<br>
- ><a href='messages.php'>Back</a>";
- include('./includes/style_bottom.php');
- exit();
- }
- else if(!$_POST['subject'])
- {
- echo "<center>Error, invalid subject, It cannot be blank.<br>
- ><a href='messages.php?action=new'>Back</a>";
- include('./includes/style_bottom.php');
- exit();
- }
- else if(!$_POST['to'])
- {
- echo "<center>Error, invalid user, User cannot be blank.<br>
- ><a href='messages.php?action=new'>Back</a>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $codes = array(':)',':P',':(',':o',':@','o_O',':s',';)',':*',':|o',':|',':D','xD',':L','xP');
- $images = array(
- ' [img]images/smilies/smile.gif[/img] ',
- ' [img]images/smilies/tounge.gif[/img] ',
- ' [img]images/smilies/sad.gif[/img] ',
- ' [img]images/smilies/shocked.gif[/img] ',
- ' [img]images/smilies/angry.gif[/img] ',
- ' [img]images/smilies/sarcy.gif[/img] ',
- ' [img]images/smilies/confused.gif[/img] ',
- ' [img]images/smilies/wink.gif[/img] ',
- ' [img]images/smilies/cool.gif[/img] ',
- ' [img]images/smilies/psyc.gif[/img] ',
- ' [img]images/smilies/dissapointed.gif[/img] ',
- ' [img]images/smilies/grin.gif[/img] ',
- ' [img]images/smilies/histericle.gif[/img] ',
- ' [img]images/smilies/laughing.gif[/img] ',
- ' [img]images/smilies/histericletounge.gif[/img] ');
- $_POST['message'] = str_replace($codes, $images, $_POST['message']);
- $q_ry = array();
- $q_ry = "SELECT `playername`
- FROM `members`
- WHERE `playerid` = '".($_POST['to'])."'";
- $userto = array();
- $userto = mysql_query($q_ry);
- $ut = array();
- $ut = mysql_fetch_array($userto);
- if(!mysql_num_rows($userto))
- {
- echo "<center>Error, invalid user, User {$_POST['to']} was not found.<br>
- ><a href='messages.php'>Back</a>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $q_ry = array();
- $q_ry = "SELECT `i_id`
- FROM `ignore_list`
- WHERE `i_ignorer` = '".($_POST['to'])."'
- && `i_ignored` = '".($_SESSION['playerid'])."' ||
- `i_ignorer` = '".($_SESSION['playerid'])."'
- && `i_ignored` = '".($_POST['to'])."'";
- $ignored = array();
- $ignored = mysql_query($q_ry);
- if(mysql_num_rows($ignored))
- {
- echo "<center>Sorry, Message not sent to ",htmlentities($ut['playername']),"[{$_POST['to']}].<br/>
- This could be because you have ignored them or they have ignored you.
- <hr width = '75%'>><a href='messages.php'>Back</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- else
- {
- $q_ry = array();
- $q_ry = "INSERT INTO `member_mail`
- VALUES ('NULL',
- '".($_POST['to'])."',
- '".($_SESSION['playerid'])."',
- '".($_POST['subject'])."',
- '".($_POST['message'])."',
- unix_timestamp(),
- '0')";
- mysql_query($q_ry);
- p_stats_add('mail', 1, $_SESSION['playerid']);
- if($pl['my_partner'] == $_POST['to'])
- {
- p_stats_add('mail_spouse', 1, $_SESSION['playerid']);
- }
- $q_ry = array();
- $q_ry = "SELECT `mf_id`
- FROM `members_friends`
- WHERE `mf_playerid` = '".($_SESSION['playerid'])."'
- AND `mf_friend` = '".($_POST['to'])."'";
- $friend = array();
- $friend = mysql_query($q_ry);
- if(mysql_num_rows($friend))
- {
- p_stats_add('mail_friend', 1, $_SESSION['playerid']);
- }
- stock_credit(7,1);
- echo "<center>Success, Message sent to ",htmlentities($ut['playername']),"[{$_POST['to']}].
- <hr width = '75%'>
- ><a href='messages.php'>Back</a><hr width = '75%'>";
- include('./includes/style_bottom.php');
- exit();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement