📄 crew-messageadd.php
字号:
<?php /* ------------------------- */
$banner = "no";
$UPDATE_DB = 1;
$OMNILOG = 1;
include ("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
/* ------------------------- */ ?>
<html>
<head>
<title>[( Elite Avengers )]</title>
<link rel="stylesheet" href="css-v1.css" type="text/css">
<SCRIPT language=JavaScript>
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
</SCRIPT>
</head>
<body>
<center>
<center><table border=1 cellspacing=0 cellpadding=2 width=95% bordercolor=black>
<?
$dbres = mysql_query("SELECT * FROM `[clans]` WHERE `name`='{$data->clan}'");
$clan = mysql_fetch_object($dbres);
if($_GET['c'] != $clan->id && $data->level <= 50) {
echo "* You want to see the secrets of other crews ha?!<br> Well only the admins can do this:D!";
exit;
} else {
if ($_GET['x'] == "post"){
if (isset($_POST['newtopic'])){
if (trim($_POST['title']) && trim($_POST['message'])){
$_POST['title'] = htmlspecialchars($_POST['title']);
$title = preg_replace('/\</','<',substr($_POST['title'],0,30));
$_POST['message'] = htmlspecialchars($_POST['message']);
$message = preg_replace('/\</','<',substr($_POST['message'],0,2500));
$forum = $_GET['c'];
$dbres = mysql_query("SELECT * FROM `[clans]` WHERE `name`='{$data->clan}'");
$clan = mysql_fetch_object($dbres);
mysql_query("INSERT INTO `crewtopics` (datum,titel,text,poster,forum,last,type) values(NOW(),'$title','$message','$data->login','$forum',NOW(),'1')");
mysql_query("UPDATE `[users]` SET `posts`=`posts`+'1' WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `postdate`=NOW() WHERE `login`='{$data->login}'");
echo "<SCRIPT type=text/javascript>
setTimeout(\"parent.vieuw.location = 'crew-messages.php?id={$clan->open}&c={$_GET['c']}'\", 1);
setTimeout(\"parent.topics.location = 'crew-topics.php?c={$_GET['c']}'\", 0);
</SCRIPT>";
} else
echo "Enter a title and message!";
}
print <<<ENDHTML
<tr>
<td class=subTitle align=center colspan=2>New Topic</td>
</tr>
<form name="form" method="POST">
<tr>
<td width=100 class=mainTxt>Title:</td>
<td width="275" class="mainTxt"><input type="text" name="title" value="{$_POSt['title']}"></td>
</tr>
<tr>
<td width=100 valign="top" class=mainTxt>Message:</td>
<td class="mainTxt"><center><TEXTAREA onkeydown="textCounter(this.form.message,this.form.remLen,250000);" onkeyup="textCounter(this.form.message,this.form.remLen,250000);" name="message" rows="10" cols="30">{$_POSt['message']}</TEXTAREA><br>
<INPUT readOnly maxLength="4" size="3" value="250000" name="remLen"> Signs left</center></td>
</tr>
<tr>
<td colspan="2" class="mainTxt"><input type="submit" name="newtopic" style="width: 50px;" value="Post!"></td>
</tr>
ENDHTML;
}
elseif ($_GET['x'] == "reply"){
$dbres = mysql_query("SELECT `id` FROM `crewtopics` WHERE `id`='{$_GET['id']}' AND `forum`='{$_GET['c']}' AND `locked`='1'");
$lock = mysql_num_rows($dbres);
if($lock <= 0 OR $data->level >= 50) {
print <<<ENDHTML
<tr>
<td class=subTitle align=center colspan=2>Add reply:</td>
</tr>
<form name="form" method="POST">
<tr>
<td width=100 valign="top" class=mainTxt>Message:</td>
<td class=mainTxt><center><textarea onkeydown="textCounter(this.form.message,this.form.remLen,100000);" onkeyup="textCounter(this.form.message,this.form.remLen,100000);" name="message" cols="40" rows="10">{$_POST['message']}</textarea><br>
<INPUT readOnly maxLength="4" size="3" value="100000" name="remLen"> Signs left</center></td>
</tr>
<tr>
<td class=mainTxt colspan=2><input type="submit" name="submit" value="Post!"></td>
</tr>
</table></center>
ENDHTML;
if (isset($_POST['message'])){
if (trim($_POST['message'])){
$_POST['message'] = htmlspecialchars($_POST['message']);
$message = preg_replace('/\</','<',substr($_POST['message'],0,100000));
$message = $_POST['message'];
$id = mysql_insert_id();
$dbres5 = mysql_query("SELECT * FROM `forummess`");
$idn1 = mysql_num_rows($dbres5) + 1;
$forum = $_GET['c'];
$messid = $_GET['id'];
mysql_query("INSERT INTO `crewreplys`(datum,titel,text,schrijver,forum) values(NOW(),'$messid','$message','$data->login','$forum')");
mysql_query("UPDATE `[users]` SET `posts`=`posts`+'1' WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `postdate`=NOW() WHERE `login`='{$data->login}'");
mysql_query("UPDATE `crewtopics` SET `last`=NOW() WHERE `id`='{$messid}' AND `forum`='{$_GET['c']}'");
print "<br><br><font color=white>Message added</font></a><SCRIPT type=text/javascript>
setTimeout(\"parent.topics.location = 'crew-topics.php?c={$_GET['c']}'\", 0);
setTimeout(\"parent.vieuw.location = 'crew-messages.php?id={$_GET['id']}&c={$_GET['c']}'\", 0);
</SCRIPT>";
} else
echo "<font color=red><b>* Enter a message!</b></font>";
}
} else
echo "<font color=red><b>* This topic is closed!</b></font>";
}
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -