$title
$description $field "; $bg = ""; $i++; } function makemcDropDown($options, $name, $selected) { $output = " "; $entries_showed ++; if($i >= $chat_per_page + $start_from){ break; } } $query_count = "SELECT COUNT(*) as count from " . PREFIX . "_chat"; $result_count = $db->super_query($query_count); $all_count = $result_count['count']; echo << JSCRIPT; echo<<
{$entries} HTML; $npp_nav =""; if($start_from > 0) { $previous = $start_from - $chat_per_page; $npp_nav .= "<< $lang[edit_prev]"; } if($all_count > $chat_per_page){ $npp_nav .= " [ "; $enpages_count = @ceil($all_count/$chat_per_page); $enpages_start_from = 0; $enpages = ""; for($j=1;$j<=$enpages_count;$j++){ if($enpages_start_from != $start_from){ $enpages .= "$j "; } else{ $enpages .= " $j "; } $enpages_start_from += $chat_per_page; } $npp_nav .= $enpages; $npp_nav .= " ] "; } if($all_count > $i) { $how_next = $all_count - $i; if($how_next > $chat_per_page){ $how_next = $chat_per_page; } $npp_nav .= "$lang[edit_next] $how_next >>"; } if($entries_showed != 0){ echo<< HTML; } echo<<
  Сообщение {$lang['edit_autor']}
$npp_nav
HTML; echo <<
{$lang_mc['mc_mess_page']}
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 <<
{$lang_mc['mc_trun']}
 
HTML; echofooter(); } ///--- Чистка чата end ---/// elseif($action == "mess_del"){ echoheader("chat", $lang_mc['chatc']); echo <<
{$lang_mc['mass_confirm']} HTML; echo "(".count($selected_mess).") сообщения

  "; foreach($selected_mess as $id){ echo "\n"; } 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; include(SYSTEM_DIR.'/inc/include/inserttag.php'); echo << HTML; echo <<
{$bb_code}


HTML; echofooter(); }elseif($action == "color"){ echoheader("chat", $lang_mc['chatc']); chatmenu (); echo <<
HTML; showmcRow('1:', $lang_mc['mc_color1'], "", ""); showmcRow('2:', $lang_mc['mc_color2'], "", ""); showmcRow('3:', $lang_mc['mc_color3'], "", ""); 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]"); } ?>