|
HTML;
echo <<
HTML;
echofooter();
///--- Настройка скрипта ---///
}elseif ($action == "configs"){
echoheader("chat", $lang_mc['mc_conf']);
chatmenu ();
echo <<
|
|
|
|
HTML;
showmcRow($lang_mc['mc_guest'], $lang_mc['mc_guestc'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[guest]", "{$chatconfig['guest']}"));
showmcRow($lang_mc['mc_showdate'], $lang_mc['mc_showdatec'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[show_date]", "{$chatconfig['show_date']}"));
showmcRow($lang_mc['mc_limitb'], $lang_mc['mc_limitbc'], "");
showmcRow($lang_mc['mc_limit'], $lang_mc['mc_limitc'], "");
showmcRow($lang_mc['mc_sc'], $lang_mc['mc_sc'], "");
showmcRow($lang_mc['mc_timestamp'], "$lang[opt_sys_and]", "");
showmcRow($lang_mc['mc_timestampa'], "$lang[opt_sys_and]", "");
showmcRow($lang_mc['mc_smail'], $lang_mc['mc_smailb'], "");
showmcRow($lang_mc['mc_refresh'], $lang_mc['mc_refreshc'], "");
showmcRow($lang['opt_sys_aw'], $lang['opt_sys_awd'], "");
showmcRow($lang_mc['mc_colornik'], $lang_mc['mc_colornikc'], makemcDropDown(array("yes"=>$lang['opt_sys_yes'],"no"=>$lang['opt_sys_no']), "save_con[color_nik]", "{$chatconfig['color_nik']}"));
echo <<
|
|
|
|
|
|
HTML;
echofooter();
///--- Настройка скрипта end ---///
///--- Чистка чата ---///
}elseif ($action == "trun"){
echoheader("chat", $lang_mc['mc_trunс']);
chatmenu ();
echo <<
HTML;
echofooter();
}
///--- Чистка чата end ---///
elseif($action == "mess_del"){
echoheader("chat", $lang_mc['chatc']);
echo <<
HTML;
echofooter();
exit;
///--- Add Message end ---///
}elseif($action == "messedit"){
echoheader("chat", $lang_mc['chatc']);
chatmenu ();
$row = $db->super_query("SELECT * FROM " . PREFIX . "_chat WHERE id = '$id'");
$messtext = $parse->decodeBBCodes($row['message']);
echo <<
HTML;
echofooter();
}elseif($action == "color"){
echoheader("chat", $lang_mc['chatc']);
chatmenu ();
echo <<
HTML;
echofooter();
}elseif($action == "do_mess_edit"){
$aeditmess = $db->safesql($parse->BB_Parse(parse_mcsmiles($parse->process($_POST['aeditmess']))));
$result = $db->query("UPDATE " . PREFIX . "_chat SET message='$aeditmess' WHERE id='$id'");
@header("Location: $PHP_SELF?mod=chat");
}elseif($action == "do_mess_del"){
$deleted_message = 0;
foreach ($selected_mess as $id){
$id = intval($id);
$db->query("DELETE FROM " . PREFIX . "_chat WHERE id='$id'");
$deleted_message ++;
$db->free(); }
if(count($selected_mess) == $deleted_message){ msg("info", $lang['word_ldel'], $lang_mc['mc_mess_delok'], "$PHP_SELF?mod=chat"); }
else{ msg("error", $lang_mc['mc_mess_notok'], "$deleted_message $lang[mass_i] ".count($selected_mess)." $lang[mass_notok_1]", "$PHP_SELF?mod=chat"); }
}elseif($action == "doaddmess") {
$amess = $db->safesql($parse->BB_Parse(parse_mcsmiles($parse->process($_POST['amess']))));
$name = "Admin";
$ip = $db->safesql($_SERVER['REMOTE_ADDR']);
$date = date ("Y-m-d H:i:s", time()+($config['date_adjust']*60));
if ($amess == "") msg("error",$lang['static_err'],$lang['static_err_1'], "javascript:history.go(-1)");
$db->query("INSERT INTO ".PREFIX."_chat (name, message, date, ip, `mgroup`, user_id) VALUES ('$name', '$amess', '$date', '$ip', '', '')");
header("Location: $PHP_SELF?mod=chat&action=doaddmessok");
}elseif($action == "doaddmessok"){
msg("info", $lang_mc['mc_addmssok'], "$lang[mc_addmssok]
$lang[db_prev]");
}elseif($action == "dotrun") {
$db->query("TRUNCATE " . PREFIX . "_chat");
header("Location: $PHP_SELF?mod=chat");
}elseif($action == "dosaveconfigs")
{
$find[] = "'\r'";
$replace[] = "";
$find[] = "'\n'";
$replace[] = "";
$save_con = $save_con + $chatconfig;
if($member_id['user_group'] != 1){ msg("error", $lang_p['opt_denied'], $lang_p['opt_denied']); }
$handler = fopen(SYSTEM_DIR.'/data/chat.config.php', "w");
fwrite($handler, " $value)
{
$value=trim(stripslashes ($value));
$value=htmlspecialchars ($value, ENT_QUOTES);
$value = preg_replace($find,$replace,$value);
fwrite($handler, "'{$name}' => \"{$value}\",\n\n");
}
fwrite($handler, ");\n\n?>");
fclose($handler);
$cache->clear();
msg("info", $lang['opt_sysok'], "$lang[opt_sysok_1]
$lang[db_prev]");
}
?>
|