Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.84 KB | None | 0 0
  1. function mail_compose()
  2.                          {
  3.                           global $pl;
  4.                           echo "<center><table width = '75%' border = '0' cellspacing = '0' class = 'forum'>
  5.                          <tr bgcolor = '#999999'><td colspan=2><center><b>Send a message</b></td></tr>
  6.                          <form name = 'reply' method = 'post' action = 'messages.php?action=send'><tr>
  7.                          <td width = '25%' bgcolor = '#E3E3E3'><b>Users ID:</b></td>
  8.                          <td bgcolor=#E3E3E3><input type = 'text' name = 'to' size = '5' maxlength = '10' value = '{$_GET['XID']}'>
  9.                          <i><font size=2>(Example. 1)</font></i></td>
  10.                          </tr><tr>
  11.                          <td width=25% bgcolor=#E3E3E3><b>Subject:</b></td>
  12.                          <td bgcolor=#E3E3E3><input type = 'text' name = 'subject' size = '50' maxlength = '50' value=''>
  13.                          <i><font size=2>(Example. Hello)</font></i></td>
  14.                          </tr><tr><td bgcolor = '#E3E3E3' colspan = '2' align = 'center'>
  15.                          <a onClick=\"addwithEase(' :) ')\"><img src='images/smilies/smile.gif'></a>
  16.                          <a onClick=\"addwithEase(' :P ')\"><img src='images/smilies/tounge.gif'></a>
  17.                          <a onClick=\"addwithEase(' :( ')\"><img src='images/smilies/sad.gif'></a>
  18.                          <a onClick=\"addwithEase(' :o ')\"><img src='images/smilies/shocked.gif'></a>
  19.                          <a onClick=\"addwithEase(' :@ ')\"><img src='images/smilies/angry.gif'></a>
  20.                          <a onClick=\"addwithEase(' o_O ')\"><img src='images/smilies/sarcy.gif'></a>
  21.                          <a onClick=\"addwithEase(' :s ')\"><img src='images/smilies/confused.gif'></a>
  22.                          <a onClick=\"addwithEase(' ;) ')\"><img src='images/smilies/wink.gif'></a>
  23.                          <a onClick=\"addwithEase(' :* ')\"><img src='images/smilies/cool.gif'></a>
  24.                          <a onClick=\"addwithEase(' :|o ')\"><img src='images/smilies/psyc.gif'></a>
  25.                          <a onClick=\"addwithEase(' :| ')\"><img src='images/smilies/dissapointed.gif'></a>
  26.                          <a onClick=\"addwithEase(' :D ')\"><img src='images/smilies/grin.gif'></a>
  27.                          <a onClick=\"addwithEase(' xD ')\"><img src='images/smilies/histericle.gif'></a>
  28.                          <a onClick=\"addwithEase(' :L ')\"><img src='images/smilies/laughing.gif'></a>
  29.                          <a onClick=\"addwithEase(' xP ')\"><img src='images/smilies/histericletounge.gif'></a>
  30.                          </td></tr>
  31.                          <tr>
  32.                          <td bgcolor = '#E3E3E3'><b>Message:</b></td>
  33.                          <td width = '90%' bgcolor = '#E3E3E3'>
  34.                          <textarea name = 'message' rows = '10' cols = '75%'></textarea></td>
  35.                          </tr><tr bgcolor = '#E3E3E3'>
  36.                          <td colspan = '2'><center><input type = 'submit' value = 'Send'></center></td>
  37.                          </tr></form></table></center><script language=\"JavaScript\" type=\"text/javascript\">
  38.                          function addwithEase(smileToAdd)
  39.                          {
  40.                           document.reply.message.value += smileToAdd;document.reply.message.focus();
  41.                          }
  42.                          </script>
  43.                          <hr width = '75%'/>&gt; <a href='messages.php'>Back</a><hr width = '75%'/>";
  44.                          }
  45.            function mail_send()
  46.                          {
  47.                      global $pl;
  48.                      $q_ry = array();
  49.                      $q_ry = "SELECT `my_mailban`,`mban_reason`
  50.                              FROM `members`
  51.                              WHERE `playerid` = '".($_SESSION['playerid'])."'";
  52.                      $mb = array();
  53.                      $mb = mysql_fetch_array(mysql_query($q_ry));
  54.                      $_POST['message'] = stripslashes($_POST['message']);
  55.                      $_POST['subject'] = stripslashes($_POST['subject']);
  56.                      $_POST['to'] = abs(intval($_POST['to']));
  57.                      if($mb['my_mailban'])
  58.                       {
  59.                        echo "<center><font color = 'red'><b>Error, You have been mail banned for ".$mb['my_mailban']." days(s).
  60.                       <br/>Reason: ". $mb['mban_reason'] . ".</b></font>
  61.                       <hr width = '75%'>&gt;<a href='index.php'>Home</a><hr width = '75%'>";
  62.                        include('./includes/style_bottom.php');
  63.                        exit();
  64.                        }
  65.                      else if(!$_POST['message'])
  66.                       {
  67.                        echo "<center>Error, You must compose a message to send, It cannot be blank.<br>
  68.                          &gt;<a href='messages.php?action=new'>Back</a>";
  69.                        include('./includes/style_bottom.php');
  70.                        exit();
  71.                        }
  72.                      else if($_POST['to'] == $_SESSION['playerid'])
  73.                       {
  74.                        echo "<center>Error, Sending mail to yourself is sad!<br>
  75.                          &gt;<a href='messages.php'>Back</a>";
  76.                        include('./includes/style_bottom.php');
  77.                        exit();
  78.                        }
  79.                      else if(!$_POST['subject'])
  80.                       {
  81.                        echo "<center>Error, invalid subject, It cannot be blank.<br>
  82.                          &gt;<a href='messages.php?action=new'>Back</a>";
  83.                        include('./includes/style_bottom.php');
  84.                        exit();
  85.                        }
  86.                      else if(!$_POST['to'])
  87.                       {
  88.                        echo "<center>Error, invalid user, User cannot be blank.<br>
  89.                          &gt;<a href='messages.php?action=new'>Back</a>";
  90.                        include('./includes/style_bottom.php');
  91.                        exit();
  92.                        }
  93.                         else
  94.                             {
  95.    $codes = array(':)',':P',':(',':o',':@','o_O',':s',';)',':*',':|o',':|',':D','xD',':L','xP');
  96.    $images  = array(
  97.    ' [img]images/smilies/smile.gif[/img] ',
  98.    ' [img]images/smilies/tounge.gif[/img] ',
  99.    ' [img]images/smilies/sad.gif[/img] ',
  100.    ' [img]images/smilies/shocked.gif[/img] ',
  101.    ' [img]images/smilies/angry.gif[/img] ',
  102.    ' [img]images/smilies/sarcy.gif[/img] ',
  103.    ' [img]images/smilies/confused.gif[/img] ',
  104.    ' [img]images/smilies/wink.gif[/img] ',
  105.    ' [img]images/smilies/cool.gif[/img] ',
  106.    ' [img]images/smilies/psyc.gif[/img] ',
  107.    ' [img]images/smilies/dissapointed.gif[/img] ',
  108.    ' [img]images/smilies/grin.gif[/img] ',
  109.    ' [img]images/smilies/histericle.gif[/img] ',
  110.    ' [img]images/smilies/laughing.gif[/img] ',
  111.    ' [img]images/smilies/histericletounge.gif[/img] ');
  112.    $_POST['message'] = str_replace($codes, $images, $_POST['message']);
  113.    $q_ry = array();
  114.    $q_ry = "SELECT `playername`
  115.            FROM `members`
  116.            WHERE `playerid` = '".($_POST['to'])."'";
  117.    $userto = array();
  118.    $userto = mysql_query($q_ry);
  119.    $ut = array();
  120.    $ut = mysql_fetch_array($userto);
  121.    if(!mysql_num_rows($userto))
  122.                       {
  123.                        echo "<center>Error, invalid user, User {$_POST['to']} was not found.<br>
  124.                          &gt;<a href='messages.php'>Back</a>";
  125.                        include('./includes/style_bottom.php');
  126.                        exit();
  127.                        }
  128.                         else
  129.                             {
  130.                             $q_ry = array();
  131.                             $q_ry = "SELECT `i_id`
  132.                                     FROM `ignore_list`
  133.                                     WHERE `i_ignorer` = '".($_POST['to'])."'
  134.                                        && `i_ignored` = '".($_SESSION['playerid'])."' ||
  135.                                           `i_ignorer` = '".($_SESSION['playerid'])."'
  136.                                        && `i_ignored` = '".($_POST['to'])."'";
  137.                             $ignored = array();
  138.                             $ignored = mysql_query($q_ry);
  139.                             if(mysql_num_rows($ignored))
  140.                             {
  141.                        echo "<center>Sorry, Message not sent to ",htmlentities($ut['playername']),"[{$_POST['to']}].<br/>
  142.                             This could be because you have ignored them or they have ignored you.
  143.                             <hr width = '75%'>&gt;<a href='messages.php'>Back</a><hr width = '75%'>";
  144.                        include('./includes/style_bottom.php');
  145.                        exit();
  146.                             }
  147.                             else
  148.                             {
  149.                             $q_ry = array();
  150.                             $q_ry = "INSERT INTO `member_mail`
  151.                                     VALUES ('NULL',
  152.                                             '".($_POST['to'])."',
  153.                                             '".($_SESSION['playerid'])."',
  154.                                             '".($_POST['subject'])."',
  155.                                             '".($_POST['message'])."',
  156.                                             unix_timestamp(),
  157.                                             '0')";
  158.                             mysql_query($q_ry);
  159.                             p_stats_add('mail', 1, $_SESSION['playerid']);
  160.                             if($pl['my_partner'] == $_POST['to'])
  161.                             {
  162.                              p_stats_add('mail_spouse', 1, $_SESSION['playerid']);
  163.                             }
  164.                             $q_ry = array();
  165.                             $q_ry = "SELECT `mf_id`
  166.                                     FROM `members_friends`
  167.                                     WHERE `mf_playerid` = '".($_SESSION['playerid'])."'
  168.                                     AND `mf_friend` = '".($_POST['to'])."'";
  169.                             $friend = array();
  170.                             $friend = mysql_query($q_ry);
  171.                             if(mysql_num_rows($friend))
  172.                             {
  173.                              p_stats_add('mail_friend', 1, $_SESSION['playerid']);
  174.                             }
  175.                             stock_credit(7,1);
  176.                        echo "<center>Success, Message sent to ",htmlentities($ut['playername']),"[{$_POST['to']}].
  177.                             <hr width = '75%'>
  178.                          &gt;<a href='messages.php'>Back</a><hr width = '75%'>";
  179.                        include('./includes/style_bottom.php');
  180.                        exit();
  181.                        }
  182.                      }
  183.                    }
  184.                  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement