Jump to content

Can anybody help ...V2


Alienware

Recommended Posts

At the moment when a player sends a message.. even to an admin they get a message telling them that the message has been sent to the user...

 

Now... I have created a new row in each players profile in the MySQL database and called it "Autoreply".

Autoreply uses Enum ('0','1')...

 

Im wanting to make it so if that is set to 0 then the normal sent message update comes on...

 

But if 1 is selected then i want a different message to be displayed saying this- "Thankyou for messaging us, Due to the large number of messages we get daily we will respond to your message at the next available time. In the meantime please feel free to contact the Helpdesk with any game related non serious questions you may have.

thankyou.

NYM Staff"

 

The current code for the send message is-

 

<?php

require("connections/db.php");
require("connections/require.php");
require("commBan.php.inc");


$qry = mysql_query("SELECT * FROM `players` WHERE `playername` = '$player' LIMIT 1")or die(mysql_error());
$arr = mysql_fetch_array($qry);

$from = $_GET['to'];
$rep = $_GET['rep'];

if ($rep){
$que = mysql_query("SELECT * FROM `inbox` WHERE `id` = '$rep' LIMIT 1")or die(mysql_error());
$ary = mysql_fetch_array($que);

$from = $ary['from'];
$tit = $ary['title'];
$on = $ary['date'];
$mssg = $ary['message'];
}

$submit = strip_tags($_POST['submit']);
$user = strip_tags($_POST['user']);
$title = addslashes($_POST['title']);
$msg = addslashes(strip_tags($_POST['msg']));

if ($submit){

if (!$user){
$error = "Please specify which player you wist to send a message to.";
error($error);
}elseif ($user){

if (!$title){
$title = "None";
}

if (!$msg){
$error = "Please enter a message to send.";
error($error);
}elseif ($msg){

if (ereg("[^A-Za-z0-9]", $user)){
$error = "Playername can only contain alphanumeric characters.";
error($error);
}elseif (!ereg("[^A-Za-z0-9]", $user)){

$chk = mysql_query("SELECT `id` FROM `players` WHERE `playername` = '$user' LIMIT 1")or die(mysql_error());
$exist = mysql_numrows($chk);

if ($exist == 0){
$error = "That player does not exist.";
error($error);
}elseif ($exist == 1){

mysql_query("INSERT INTO `inbox` ( `id` , `playername` , `from` , `title` , `message` , `read` , `date` , `protected` )
VALUES
( '' , '$user' , '$player' , '$title' , '$msg' , '0' , '$date' , '0' )")or die(mysql_error());

$upd = "Message sent to <a href=\"profile.php?player=".$user."\" target=\"main\">".$user.".";
upd($upd);

}}}}}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="connections/style.css" />
</head>
<body>
<form action="" method="post">
<table width="50%" align="center" class="tbl">
<tr><td align="center" class="hdr" colspan="2">
.::Send Message::.
</td></tr>
<tr>
<td align="center" class="tbl">To</td>
<td align="center" class="tbl">
<input type="text" name="user" class="submit" size="20" maxlength="20" value="<? echo $from; ?>">
</td>
</tr>
<tr>
<td align="center" class="tbl">Title</td>
<td align="center" class="tbl">
<input type="text" name="title" class="submit" size="20" maxlength="20" value="<? echo $tit; ?>">
</td>
</tr>
<tr><td align="center" class="sub" colspan="2">Message</td></tr>
<tr><td align="center" class="tbl" colspan="2">
<textarea name="msg" class="submit" cols="35" rows="5">

<?php
if ($rep){
print ("

[b]On: ".$on." ".$from." Wrote:[/b]

".$mssg."");
}
?>
</textarea>
</tr></tr>
<tr><td align="center" colspan="4"><? sub(submit,Send); ?></td></tr>
</table>
</form>
</body>
</html>

 

I really hope somebody can help

Link to comment
https://forums.phpfreaks.com/topic/144161-can-anybody-help-v2/
Share on other sites

More advice on how to do this.

 

i have attempted it several times but the code just gets thrown back in my face by errors.. and when i posted my attempted code earlier on it just confused the hell outa people.

 

I have honestly no idea how to do it lol, i tried and failed.

Link to comment
https://forums.phpfreaks.com/topic/144161-can-anybody-help-v2/#findComment-756495
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.