dblink,"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
if(isset($_GET['del'])){
mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."users SET ok = 0");
}
if (@$_POST['submit'] == "Send")
{
unset ($_SESSION['m_message']);
$_SESSION['m_message'] = $_POST['message'];
$NextStep = true;
}
if (@isset($_POST['confirm']))
{
if ($_POST['confirm'] == 'No' ) $Interupt = true;
if ($_POST['confirm'] == 'Yes'){
if(file_exists("Templates/text.tpl")) {
$myFile = "Templates/text.tpl";
$fh = fopen($myFile, 'w') or die("
Can't open file: templates/text.tpl");
$text = file_get_contents("Templates/text_format.tpl");
$text = preg_replace("'%TEKST%'",str_replace('"', '\\"', $_SESSION['m_message']) ,$text);
// the following is not really needed and results in fhe file starting with BOM which gets displayed when the message is shown
// ... also, this very much depends on the underlying system and utf8_encode() is only good if the system is defaulted to ISO-8859-1
// $text = utf8_encode($text);
fwrite($fh, $text);
mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."users SET ok = 1");
$done = true;
} else { die("
wrong"); }
}}
?>