Location: PHPKode > projects > Skrupel User Game Administration > message.php
<?
include ("./include/conf.inc.php");
include ("$basepfath/inc.conf.php");
include ("$usedpfath/include/header.inc.php");
include ("$usedpfath/include/usercheck.inc.php");

if ($HTTP_GET_VARS["fu"]==1)
 {
 $header = new EasyTemplate ("$usedpfath/templates/usedheader.tpl");
 $footer = new EasyTemplate ("$usedpfath/templates/usedfooter.tpl");
 $header -> assign("TITLE","Skrupel - UsedComm Message");
 $header -> assign("URL",$usedurl);
 $header -> easy_print();

 if ($userlogin==1)
  {
  $abfrage = mysql_query("SELECT * FROM skrupel_user WHERE id='$login_userid'");
  if (mysql_num_rows($abfrage) > 1)
      {
      $row = mysql_fetch_object ($abfrage);
      $from_usernick=$row->nick;
      $from_usermail=$row->email;
      }
	  else
	  {
	  if ($skrupel_admin == 1)
       {
       $from_usernick = "Administrator";
       $from_usermail = $absenderemail;
       }
	  }	

  $abfrage = mysql_query("SELECT * FROM skrupel_user WHERE id='$userid'");
  $row = mysql_fetch_object ($abfrage);
  $to_usernick=$row->nick;
  $to_usermail=$row->email;

  ?>
  <body bgcolor="#444444" leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <center>
   <table border="0" width="90%" cellspacing="0" cellpadding="0">
    <tr>
     <td>&nbsp;</td>
    </tr>
    <tr>
     <td class="stil1">Nachricht an einen Mitspieler schicken.</td>
    </tr>
    <tr>
     <td>&nbsp;</td>
    </tr>
   </table>
   <table border="0" width="90%" cellspacing="0" cellpadding="0">
    <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
    </tr>
    <tr>
     <form name="formular" method="POST" action="message.php?fu=2">
     <input type="hidden" name="to_usernick" value="<?echo $to_usernick; ?>">
     <input type="hidden" name="to_usermail" value="<?echo $to_usermail; ?>">
     <input type="hidden" name="from_usernick" value="<?echo $from_usernick; ?>">
     <input type="hidden" name="from_usermail" value="<?echo $from_usermail; ?>">
     <td class="stil1" width="10%">An&nbsp;</td>
     <td class="stil2" width="40%"><? echo $to_usernick; ?></td>
     <td class="stil1" width="10%">EMail&nbsp;</td>
     <td class="stil2" width="40%"><? echo $to_usermail; ?></td>
    </tr>
    <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
    </tr>
    <tr>
     <td class="stil1">Von&nbsp;</td>
     <td class="stil2"><? echo $from_usernick; ?></td>
     <td class="stil1">EMail&nbsp;</td>
     <td class="stil2"><? echo $from_usermail; ?></td>
    </tr>
    <tr>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
    </tr>
   </table>
   <table border="0" width="90%" cellspacing="0" cellpadding="0">
    <tr>
     <td class="stil1">Nachricht</td>
    </tr>
    <tr>
     <td>&nbsp;</td>
    </tr>
    <tr>
     <td class="stil2"><textarea name="nachricht" cols="65" rows="10"></textarea></td>
    </tr>
   </table>
   <table border="0" width="90%" cellspacing="0" cellpadding="0">
    <tr>
     <td>&nbsp;</td>
    </tr>
    <tr>
     <td align="center"><input type="submit" name="bla" value="Nachricht senden" style="width:200px;"></td>
    </tr>
    </form>
   </table>
   </center>
   <?
   }
   else
    {
	?>
    <body text="#ffffff" bgcolor="#444444" leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <center>
     <table width="100%"  border="0">
      <tr>
      <td class="stil1">&nbsp;</td>
       <td class="stil1">Du musst dich einloggen bzw. registrieren, um Nachrichten an andere Mitspieler verschicken zu können.</td>
       <td class="stil1">&nbsp;</td>
      </tr>
      <tr>
       <td class="stil2">&nbsp;</td>
       <td class="stil1"> &nbsp;</td>
       <td class="stil1">&nbsp;</td>
      </tr>
      <tr>
       <form name="anmelden" method="POST" action="#" onClick=window.close()>
       <td class="stil2">&nbsp;</td>
       <td class="stil1"><input type="submit" name="anmelden" value="Fenster schließen" style="width:100px;" onClick="window.close()"></td>
       <td class="stil1">&nbsp;</td>
       </form>
      </tr>
     </table>
     </center>
	 <?
     }

 $footer -> easy_print();
 }

if ($HTTP_GET_VARS["fu"]==2)
 {
 $header = new EasyTemplate ("$usedpfath/templates/usedheader.tpl");
 $footer = new EasyTemplate ("$usedpfath/templates/usedfooter.tpl");
 $header -> assign("TITLE","Skrupel - UsedComm Message");
 $header -> assign("URL",$usedurl);
 $header -> easy_print();

 $to_usernick=$HTTP_POST_VARS["to_usernick"];
 $to_usermail=$HTTP_POST_VARS["to_usermail"];
 $from_usernick=$HTTP_POST_VARS["from_usernick"];
 $from_usermail=$HTTP_POST_VARS["from_usermail"];
 $nachricht=$HTTP_POST_VARS["nachricht"];

   if ($userlogin==1)
	  {
      @mail($to_usermail, "Hallo $to_usernick, dies ist eine Nachricht von einem Mitspieler bei $servername", $nachricht,"From: $from_usermail\r\n"."Reply-To: $from_usermail\r\n"."X-Mailer: PHP/" . phpversion());
      ?>
      <body text="#ffffff" bgcolor="#444444" leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
      <center>
       <table width="100%"  border="0">
        <tr>
         <td width="5%" class="stil1">&nbsp;</td>
         <td width="90%" class="stil1">&nbsp;</td>
         <td width="5%" class="stil1">&nbsp;</td>
        </tr>
        <tr>
         <td class="stil1">&nbsp;</td>
         <td class="stil1">Deine Nachricht wurde erfolgreich an <? echo $to_usernick; ?> geschickt.</td>
         <td class="stil1">&nbsp;</td>
        </tr>
        <tr>
         <td class="stil2">&nbsp;</td>
         <td class="stil1"> &nbsp;</td>
         <td class="stil1">&nbsp;</td>
        </tr>
        <tr>
        <form name="senden" method="POST" action="#">
         <td class="stil2">&nbsp;</td>
         <td align="center" class="stil1"><input type="submit" name="senden" value="Fenster schließen" style="width:100px;" onClick="window.close()"></td>
         <td class="stil1">&nbsp;</td>
        </form>
        </tr>
       </table>
      </center><?
	  }
      else{?>
          <body text="#ffffff" bgcolor="#444444" leftmargin="0" rightmargin="0" topmargin="0" marginwidth="0" marginheight="0">
          <center>
           <table width="100%"  border="0">
            <tr>
             <td class="stil1">&nbsp;</td>
             <td class="stil1">Du musst dich einloggen bzw. registrieren, um Nachrichten an Mitspieler schicken zu können</td>
             <td class="stil1">&nbsp;</td>
            </tr>
            <tr>
             <td class="stil2">&nbsp;</td>
             <td class="stil1"> &nbsp;</td>
             <td class="stil1">&nbsp;</td>
            </tr>
            <tr>
            <form name="fehler" method="POST" action="#">
             <td class="stil2">&nbsp;</td>
             <td class="stil1"><input type="submit" name="fehler" value="Fenster schließen" style="width:100px;" onClick="window.close()"></td>
             <td class="stil1">&nbsp;</td>
            </form>
            </tr>
           </table>
          </center><?
		  }
 $footer -> easy_print();
 }
Return current item: Skrupel User Game Administration