ФункцииЗадачиОписание
|
|
|
Регистрация
|
Создание новой
учётной записи
|
Пользователь
заполняет поля формы регистрации. Если не все поля заполнены, то регистрация
не будет завершена.
|
Вход
|
Авторизация
учётной записи
|
Пользователь
вводит свои данные в форму и нажатием на кнопку "Войти"
осуществляется авторизация.
|
Выход
|
Выход из
учётной записи
|
Пользователь
нажимает на кнопку "Выйти" и происходит выход из учётной записи.
|
Чат
|
Отправка
мгновенных сообщений
|
Пользователь
вводит свой никнейм в чате, затем набирает сообщение и отправляет его.
|
Поиск
|
Нахождение
необходимой информации
|
Пользователь
вводит запрос в строку поиска. Нажатием на кнопку "Поиск" запрос
будет обработан и выдана соответствующая информация при её наличии на
web-сайте.
|
Интерактивная
карта
|
Отображение
местоположения
|
На карте
пользователь может увидеть расположение предприятия и проложить к нему
маршрут.
|
Статьи
|
Написание
статей
|
Статьи может
писать только админ
|
ПриложениеД
Листингфайла quick-chat. php
<? php
/*Name: Quick ChatURI: http://www.techytalk.
info/wordpress-plugins/quick-chat/: Self hosted WordPress chat plugin
supporting private chat, chat rooms, avatars, user list, words filtering,
smilies, caching plugins and more.: Marko Martinovic: 4.13URI:
http://www.techytalk. info: GPL22011. Marko Martinovic (email: marko AT
techytalk. info)program is free software; you can redistribute it and/or
modifyunder the terms of the GNU General Public License, version 2, asby the
Free Software Foundation.program is distributed in the hope that it will be
useful,WITHOUT ANY WARRANTY; without even the implied warranty ofor FITNESS FOR
A PARTICULAR PURPOSE. See theGeneral Public License for more details.should
have received a copy of the GNU General Public Licensewith this program; if
not, write to the Free Software, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
*/Quick_Chat {version = '4.13';default_db_version
= '26';default_badwords_list = '4r5e, 5h1t, 5hit, a55, anal, anus, ar5e, arrse,
arse, ass, ass-fucker, asses, assfucker, assfukka, asshole, assholes, asswhole,
a_s_s, b! tch, b00bs, b17ch, b1tch, ballbag, balls, ballsack, bastard,
beastial, beastiality, bellend, bestial, bestiality, bi+ch, biatch, bitch,
bitcher, bitchers, bitches, bitchin, bitching, bloody, blow job, blowjob,
blowjobs, boiolas, bollock, bollok, boner, boob, boobs, booobs, boooobs,
booooobs, booooooobs, breasts, buceta, bugger, bum, bunny fucker, butt,
butthole, buttmuch, buttplug, c0ck, c0cksucker, carpet muncher, cawk, chink,
cipa, cl1t, clit, clitoris, clits, cnut, cock, cock-sucker, cockface, cockhead,
cockmunch, cockmuncher, cocks, cocksuck, cocksucked, cocksucker, cocksucking,
cocksucks, cocksuka, cocksukka, cok, cokmuncher, coksucka, coon, cox, crap,
cum, cummer, cumming, cums, cumshot, cunilingus, cunillingus, cunnilingus,
cunt, cuntlick, cuntlicker, cuntlicking, cunts, cyalis, cyberfuc, cyberfuck,
cyberfucked, cyberfucker, cyberfuckers, cyberfucking, d1ck, damn, dick,
dickhead, dildo, dildos, dink, dinks, dirsa, dlck, dog-fucker, doggin, dogging,
donkeyribber, doosh, duche, dyke, ejaculate, ejaculated, ejaculates, ejaculating,
ejaculatings, ejaculation, ejakulate, f u c k, f u c k e r, f4nny, fag,
fagging, faggitt, faggot, faggs, fagot, fagots, fags, fanny, fannyflaps,
fannyfucker, fanyy, fatass, fcuk, fcuker, fcuking, feck, fecker, felching,
fellate, fellatio, fingerfuck, fingerfucked, fingerfucker, fingerfuckers,
fingerfucking, fingerfucks, fistfuck, fistfucked, fistfucker, fistfuckers,
fistfucking, fistfuckings, fistfucks, flange, fook, fooker, fuck, fucka,
fucked, fucker, fuckers, fuckhead, fuckheads, fuckin, fucking, fuckings,
fuckingshitmotherfucker, fuckme, fucks, fuckwhit, fuckwit, fudge packer,
fudgepacker, fuk, fuker, fukker, fukkin, fuks, fukwhit, fukwit, fux, fux0r,
f_u_c_k, gangbang, gangbanged, gangbangs, gaylord, gaysex, goatse, God,
god-dam, god-damned, goddamn, goddamned, hardcoresex, hell, heshe, hoar, hoare,
hoer, homo, hore, horniest, horny, hotsex, jack-off, jackoff, jap, jerk-off,
jism, jiz, jizm, jizz, kawk, knob, knobead, knobed, knobend, knobhead,
knobjocky, knobjokey, kock, kondum, kondums, kum, kummer, kumming, kums,
kunilingus, l3i+ch, l3itch, labia, lmfao, lust, lusting, m0f0, m0fo,
m45terbate, ma5terb8, ma5terbate, masochist, master-bate, masterb8, masterbat*,
masterbat3, masterbate, masterbation, masterbations, masturbate, mo-fo, mof0,
mofo, mothafuck, mothafucka, mothafuckas, mothafuckaz, mothafucked,
mothafucker, mothafuckers, mothafuckin, mothafucking, mothafuckings,
mothafucks, mother fucker, motherfuck, motherfucked, motherfucker,
motherfuckers, motherfuckin, motherfucking, motherfuckings, motherfuckka,
motherfucks, muff, mutha, muthafecker, muthafuckker, muther, mutherfucker,
n1gga, n1gger, nazi, nigg3r, nigg4h, nigga, niggah, niggas, niggaz, nigger,
niggers, nob, nob jokey, nobhead, nobjocky, nobjokey, numbnuts, nutsack,
orgasim, orgasims, orgasm, orgasms, p0rn, pawn, pecker, penis, penisfucker,
phonesex, phuck, phuk, phuked, phuking, phukked, phukking, phuks, phuq,
pigfucker, pimpis, piss, pissed, pisser, pissers, pisses, pissflaps, pissin,
pissing, pissoff, poop, porn, porno, pornography, pornos, prick, pricks, pron,
pube, pusse, pussi, pussies, pussy, pussys, rectum, retard, rimjaw, rimming, s
hit, s. o. b., sadist, schlong, screwing, scroat, scrote, scrotum, semen, sex,
sh! +, sh! t, sh1t, shag, shagger, shaggin, shagging, shemale, shi+, shit,
shitdick, shite, shited, shitey, shitfuck, shitfull, shithead, shiting,
shitings, shits, shitted, shitter, shitters, shitting, shittings, shitty,
skank, slut, sluts, smegma, smut, snatch, son-of-a-bitch, spac, spunk, s_h_i_t,
t1tt1e5, t1tties, teets, teez, testical, testicle, tit, titfuck, tits, titt,
tittie5, tittiefucker, titties, tittyfuck, tittywank, titwank, tosser, turd,
tw4t, twat, twathead, twatty, twunt, twunter, v14gra, v1gra, vagina, viagra,
vulva, w00se, wang, wank, wanker, wanky, whoar, whore, willies, willy, xrated,
xxx';default_disallow_usernames_list = 'admin,
moderator';default_guest_num_digits = '3';default_timeout_refresh_users =
'30';default_timeout_refresh_messages = '2';default_manual_gmt_offset =
'0';default_message_maximum_number_chars = '400';default_avatar_size =
'32';default_ip_blocklist = '';default_adsense_content =
'';default_clean_target = '300';default_inactivity_timeout =
'1800';quick_flag_version_minimum = '2.00';quick_flag_link =
'http://www.techytalk. info/wordpress/quick-flag/';link =
'http://www.techytalk. info/wordpress/quick-chat/';donate_link = 'https: //
www.paypal.com/cgi-bin/webscr?
cmd=_s-xclick&hosted_button_id=CZQW2VZNHMGGN';support_link =
'http://www.techytalk. info/wordpress/quick-chat/';faq_link = 'http://wordpress.org/extend/plugins/quick-chat/faq/';changelog_link
=
'http://wordpress.org/extend/plugins/quick-chat/changelog/';$default_name;$date_format;$time_format;$gmt_offset;$user_ip;$user_id;$user_status;$user_name;$no_participation;$ip_blocked;$must_login;$options;$basename;$log_file;$db_version;$url;$path;$embedded_rooms
= array ();$smilies = array (
':) ' => 'smile',
': (' => 'sad',
';) ' => 'wink',
': P' =>'razz',
': D' =>'grin',
': |' => 'plain',
': O' => 'surprise',
':? ' => 'confused',
'8) ' => 'glasses',
'8o' => 'eek',
'B) ' => 'cool',
': - ) ' => 'smile-big',
': - (' => 'crying',
': - *' => 'kiss',
'O: - D' => 'angel',
'>: - D' => 'devilish',
': o) ' => 'monkey',
': idea: ' =>'idea',
': important: ' => 'important',
': help: ' => 'help',
': error: ' => 'error',
': warning: ' => 'warning',
': favorite: ' => 'favorite'
);function __construct () {
$this->url = plugin_dir_url (__FILE__);
$this->path = plugin_dir_path (__FILE__);
$this->basename = plugin_basename (__FILE__);
$this->log_file = $this->path. 'quick-chat.
log';
$this->options = get_option
('quick_chat_options');
$this->db_version = get_option
('quick_chat_db_version');
$this->default_name = __ ('Guest_',
'quick-chat');
$this->user_ip = (isset ($_SERVER ['HTTP_X_FORWARD_FOR']))?
$_SERVER ['HTTP_X_FORWARD_FOR']: $_SERVER ['REMOTE_ADDR'];
$this->date_format = get_option
('date_format');
$this->time_format = get_option
('time_format');
$this->gmt_offset = ($this->options
['manual_gmt_offset'] + get_option ('gmt_offset')) *3600;_action ('init', array
($this, 'init'));_action ('plugins_loaded', array ($this,
'update_db_check'));_action ('wp_print_styles', array ($this, 'style'));_action
('admin_print_styles', array ($this, 'style'));_action ('wp_enqueue_scripts',
array ($this, 'js'));_action ('admin_enqueue_scripts', array ($this,
'js'));_action ('admin_enqueue_scripts', array ($this, 'admin_js'));_action
('admin_init', array ($this, 'settings_init'));_action ('admin_menu', array
($this, 'add_options_page'));_action ('admin_notices', array ($this,
'quick_flag_version_notice'));_action ('admin_init', array ($this,
'quick_flag_version_notice_dismiss'));_action ('wp_dashboard_setup', array
($this, 'add_dashboard_widgets'));_shortcode ('quick-chat', array ($this,
'shortcode'));_filter ('plugin_row_meta', array ($this, 'plugin_meta'),
10,2);_action ('widgets_init', array ($this, 'load_widgets'));_action
('wp_ajax_nopriv_quick-chat-ajax-init', array ($this,
'init_ajax_handler'));_action ('wp_ajax_quick-chat-ajax-init', array ($this,
'init_ajax_handler'));_action ('wp_ajax_nopriv_quick-chat-ajax-update-users',
array ($this, 'update_users_ajax_handler'));_action
('wp_ajax_quick-chat-ajax-update-users', array ($this,
'update_users_ajax_handler'));_action ('wp_ajax_nopriv_quick-chat-ajax-update-messages',
array ($this, 'update_messages_ajax_handler'));_action
('wp_ajax_quick-chat-ajax-update-messages', array ($this,
'update_messages_ajax_handler'));_action
('wp_ajax_nopriv_quick-chat-ajax-new-message', array ($this, 'new_message_ajax_handler'));_action
('wp_ajax_quick-chat-ajax-new-message', array ($this,
'new_message_ajax_handler'));_action
('wp_ajax_nopriv_quick-chat-ajax-transcript', array ($this,
'transcript_ajax_handler'));_action ('wp_ajax_quick-chat-ajax-transcript',
array ($this, 'transcript_ajax_handler'));_action
('wp_ajax_nopriv_quick-chat-ajax-ban', array ($this,
'ban_ajax_handler'));_action ('wp_ajax_quick-chat-ajax-ban', array ($this,
'ban_ajax_handler'));_action ('wp_ajax_nopriv_quick-chat-ajax-clean-private',
array ($this, 'clean_private_ajax_handler'));_action
('wp_ajax_quick-chat-ajax-clean-private', array ($this,
'clean_private_ajax_handler'));_action ('wp_ajax_nopriv_quick-chat-ajax-clean',
array ($this, 'clean_ajax_handler'));_action ('wp_ajax_quick-chat-ajax-clean',
array ($this, 'clean_ajax_handler'));_action
('wp_ajax_nopriv_quick-chat-ajax-delete', array ($this,
'delete_ajax_handler'));_action ('wp_ajax_quick-chat-ajax-delete', array
($this, 'delete_ajax_handler'));_action
('wp_ajax_nopriv_quick-chat-ajax-username-check', array ($this,
'username_check_ajax_handler'));_action
('wp_ajax_quick-chat-ajax-username-check', array ($this,
'username_check_ajax_handler'));_activation_hook (__FILE__, array ($this,
'clear_cache'));_deactivation_hook (__FILE__, array ($this, 'clear_cache'));(!
(defined ('DOING_AJAX') && DOING_AJAX)) {(isset ($this->options
['clean_target_auto'])) {_action ('quick_chat_target_clean_update', array
($this, 'clean_rooms_to_target'));_deactivation_hook (__FILE__, array ($this,
'deschedule_target_clean_update'));
$this->schedule_target_clean_update ();
}else{
$this->deschedule_target_clean_update ();
}(isset ($this->options
['clean_private_auto'])) {_action ('quick_chat_private_clean_update', array
($this, 'clean_private_ajax_handler'));_deactivation_hook (__FILE__, array
($this, 'deschedule_private_clean_update'));
$this->schedule_private_clean_update ();
}else{
$this->deschedule_private_clean_update ();
}
}
}function schedule_target_clean_update () {(!
wp_next_scheduled ('quick_chat_target_clean_update')) {_schedule_event (time
(), 'daily', 'quick_chat_target_clean_update');
$this->log ('Target clean auto scheduled');
}
}function deschedule_target_clean_update ()
{(wp_next_scheduled ('quick_chat_target_clean_update')) {_clear_scheduled_hook
('quick_chat_target_clean_update');
$this->log ('Target clean auto descheduled');
}
}function schedule_private_clean_update () {(!
wp_next_scheduled ('quick_chat_private_clean_update')) {_schedule_event (time
(), 'daily', 'quick_chat_private_clean_update');
$this->log ('Private clean auto scheduled');
}
}function deschedule_private_clean_update ()
{(wp_next_scheduled ('quick_chat_private_clean_update')) {_clear_scheduled_hook
('quick_chat_private_clean_update');
$this->log ('Private clean auto descheduled');
}
}function init () {_plugin_textdomain
('quick-chat', false, dirname ($this->basename). '/languages/');
$this->gmt_offset += $this->options
['manual_gmt_offset'];(is_user_logged_in ()) {(current_user_can
('manage_options') || current_user_can ('moderate_quick_chat')) {
$this->user_status = 0;
}else{
$this->user_status = 1;
}$current_user;_currentuserinfo ();(isset
($_COOKIE ['quick_chat_alias_'. $current_user->ID])) {
$this->user_name = stripslashes ($_COOKIE
['quick_chat_alias_'. $current_user->ID]);
} else{('quick_chat_alias_'.
$current_user->ID, $current_user->user_login, 0, COOKIEPATH,
COOKIE_DOMAIN);
$this->user_name =
$current_user->user_login;
}
$this->user_id = $current_user->ID;
} else{
$this->user_status = 2;(isset ($_COOKIE
['quick_chat_alias'])) {
$this->user_name = stripslashes ($_COOKIE
['quick_chat_alias']);
} else{
$maxNumWidthNumDigits = '';
$numDigits = $this->options
['guest_num_digits'];($i=0; $i<$numDigits; $i++) {
$maxNumWidthNumDigits. = '9';
}
$this->user_name = $this->options
['default_name']. mt_rand (0, $maxNumWidthNumDigits);('quick_chat_alias',
$this->user_name, 0, COOKIEPATH, COOKIE_DOMAIN);
}
$this->user_id = 0;
}
$this->no_participation = 0;
$this->ip_blocked = 0;(isset
($this->options ['ip_blocklist'])
&&
$this->user_status! = 0
&&($this->options ['ip_blocklist'],
$this->user_ip)! == false) {
$this->ip_blocked = 1;
$this->no_participation = 1;
}($this->ip_blocked == 0) {
$this->must_login = 0;(isset
($this->options ['only_logged_in_users'])
&&
$this->user_status == 2) {
$this->must_login = 1;
$this->no_participation = 1;
}
}
}function style () {$wp_styles;
$my_style_url = $this->url. 'css/quick-chat.
css';
$my_style_file = $this->path. 'css/quick-chat.
css';
$stupid_ie_style_url = $this->url.
'css/quick-chat-ie. css';
$stupid_ie_style_file = $this->path.
'css/quick-chat-ie. css';
$theme_style_url = get_stylesheet_directory_uri
(). '/quick-chat. css';
$theme_style_file = get_stylesheet_directory ().
'/quick-chat. css';(file_exists ($my_style_file)) {_enqueue_style
('quick_chat_style_sheet', $my_style_url);
}(file_exists ($stupid_ie_style_file))
{_enqueue_style ('quick_chat_ie_style_sheet', $stupid_ie_style_url, array
('quick_chat_style_sheet'));
$wp_styles->add_data
('quick_chat_ie_style_sheet', 'conditional', 'lt IE 8');
}(file_exists ($theme_style_file))
{_enqueue_style ('quick_chat_theme_style_sheet', $theme_style_url, array
('quick_chat_style_sheet', 'quick_chat_ie_style_sheet'));
}
}function js () {_enqueue_script
('jquery');(isset ($this->options ['debug_mode']) || (defined ('SCRIPT_DEBUG')
&& SCRIPT_DEBUG)) {
$script_suffix = '. dev';
$debug_mode = 1;
}else{
$script_suffix = '';
$debug_mode = 0;
}_enqueue_script ('quick-chat-c00kie',
($this->url. 'js/jquery. c00kie'. $script_suffix. '. js'), array ('jquery'),
self:: version, true);_enqueue_script ('quick-chat-load', ($this->url.
'js/quick-chat-load'. $script_suffix. '. js'), array ('jquery',
'quick-chat-c00kie'), self:: version, true);_localize_script ('quick-chat-load',
'quick_chat',(
'url' => $this->url,
'ajaxurl' => admin_url ('admin-ajax. php',
(is_ssl ()? 'https': 'http')),
'user_id' => $this->user_id,
'version' => self:: version,
'debug_mode' => $debug_mode
)
);
}function admin_js ($hook) {($hook ==
'settings_page_quick-chat/quick-chat') {
$script_suffix = (isset ($this->options
['debug_mode']) || (defined ('SCRIPT_DEBUG') && SCRIPT_DEBUG))? '.
dev': '';_enqueue_script ('quick-chat-admin', ($this->url.
'js/quick-chat-admin'. $script_suffix. '. js'), array ('jquery'), self::
version, true);_localize_script ('quick-chat-admin', 'quick_chat_admin',(
'ajaxurl' => admin_url ('admin-ajax. php',
(is_ssl ()? 'https': 'http')),
'i18n' =>(
'clean_private_confirm' => __ ('You\'re about
to permanently delete all messages from all private chat rooms as well as old
private chat invitations. Are you sure? ','quick-chat'),
'clean_private_done' => __
('Done','quick-chat')
),
)
);
}
}function username_check_ajax_handler ()
{$wpdb;($this->no_participation == 0) {
$quick_chat_users_table_name = $wpdb->prefix.
'quick_chat_users';
$username_invalid = 0;
$username_bad_words = 0;
$username_exists = 0;
$username_blocked = 0;($_POST ['username_check']!
= $this->user_name) {$current_user;_currentuserinfo ();
$_POST ['username_check'] = trim (stripslashes
($_POST ['username_check']));(
($_POST ['username_check'] == '')
||
($_POST ['username_check'] == 'quick_chat')
||
(isset ($this->options
['disallow_special_usernames']) &&! validate_username ($_POST ['username_check']))
)
$username_invalid = 1;($username_invalid == 0
&&
($this->filter ($_POST ['username_check'],
true)! = $_POST ['username_check'])
)
$username_bad_words =
1;$wp_version;(version_compare ($wp_version, '3.1', '<')) {_once (ABSPATH.
WPINC. '/registration. php');
}($username_bad_words == 0 && (!
is_user_logged_in () || (is_user_logged_in () && strcasecmp ($_POST
['username_check'], $current_user->user_login)! = 0))) {($username_exists ==
0) {
$sql = 'SELECT COUNT (*) FROM '.
$quick_chat_users_table_name. ' WHERE alias like "%'. like_escape ($_POST
['username_check']). '"; ';
$users = $wpdb->get_var ($sql);($users! = 0) {
$username_exists = 1;
}
}($username_exists == 0 &&
$this->user_status! = 0 && isset ($this->options
['disallow_logged_in_usernames'])) {(username_exists ($_POST
['username_check'])! = null) {
$username_exists = 1;
}
}($username_exists == 0 &&
$this->user_status! = 0 && isset ($this->options
['disallow_usernames_list']) && ($this->options
['disallow_usernames_list']! = '')) {
$blocked_usernames = explode (',',
$this->options ['disallow_usernames_list']);($blocked_usernames as
$blocked_username) {(strcasecmp ($_POST ['username_check'], trim
($blocked_username)) == 0) {
$username_blocked = 1;;
}
}
}
}($username_exists == 0 && $username_blocked
== 0 && $username_invalid == 0 && $username_bad_words == 0)
{($this->user_status == 2) {('quick_chat_alias', $_POST ['username_check'],
0, COOKIEPATH, COOKIE_DOMAIN);
}else{('quick_chat_alias_'. $current_user->ID,
$_POST ['username_check'], 0, COOKIEPATH, COOKIE_DOMAIN);
}
}
}
$response = json_encode (array
('no_participation' => 0, 'username' => $_POST ['username_check'],
'username_exists'=> $username_exists, 'username_blocked'=>
$username_blocked, 'username_invalid'=> $username_invalid,
'username_bad_words'=> $username_bad_words));
}else{
$response = json_encode (array
('no_participation' => 1));
}("Content-Type:
application/json");$response;;
}function delete_ajax_handler () {$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';
$ids = implode (', ', esc_sql ( (array) $_POST
['to_delete_ids']));
$rows_affected = $wpdb->query ('DELETE FROM '.
$quick_chat_messages_table_name. ' WHERE id IN ('. $ids. '); ');
$response = json_encode (array ('rows_affected'
=> $rows_affected));("Content-Type: application/json");$response;;
}function clean_ajax_handler () {
$rows_affected = $this->clean_room_to_target
($_POST ['to_clean_room_name'], $this->options ['clean_target']);
$response = json_encode (array ('rows_affected'
=> $rows_affected));("Content-Type: application/json");$response;;
}function clean_private_ajax_handler () {
$this->log ('Private clean initiated');$wpdb;
$quick_chat_messages_table_name = $wpdb->prefix.
'quick_chat_messages';
$rows_affected = $wpdb->query ('DELETE FROM '.
$quick_chat_messages_table_name. ' WHERE room LIKE "quick\_chat\_%"
OR alias = "quick_chat"');
$response = json_encode (array ('rows_affected'
=> $rows_affected));
$this->log ('Private clean
finished');("Content-Type: application/json");$response;;
}function ban_ajax_handler () {($this->options
['ip_blocklist']! = '') {
$ip_blocklist = array_map ('trim',explode
(",", $this->options ['ip_blocklist']));
} else{
$ip_blocklist = array ();
}($_POST ['to_ban_ips'] as $ban_ip) {
$ip_blocklist [] = $ban_ip;
}
$this->options ['ip_blocklist'] = implode
(",", array_unique ($ip_blocklist));_option ('quick_chat_options',
$this->options);
$response = json_encode (array ());("Content-Type:
application/json");$response;;
}function transcript_ajax_handler () {$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';
$transcript_datetime = date_i18n ('d-m-Y_H-i-s',
time () +$this->gmt_offset);
$transcript_file = $this->path.
'transcripts/'. $_POST ['room_name']. '_'. $transcript_datetime. '. txt';
$transcript_url = $this->url. 'transcripts/'.
$_POST ['room_name']. '_'. $transcript_datetime. '. txt';
$transcript_handle = fopen ($transcript_file,
'w');
$sql = $wpdb->prepare ('SELECT alias,
UNIX_TIMESTAMP (timestamp) as unix_timestamp, message FROM '.
$quick_chat_messages_table_name. ' WHERE room = %s AND alias! =
"quick_chat" ORDER BY unix_timestamp ASC', $_POST ['room_name']);
$messages = $wpdb->get_results ($sql);
$transcript = '';($messages as $v) {
$v->timestring = date_i18n
($this->date_format. ' - '. $this->time_format,
$v->unix_timestamp+$this->gmt_offset);
$transcript. = $v->alias. ' ['.
$v->timestring. ']: '. $v->message. "\n";
}($transcript_handle, $transcript);($transcript_handle);
$response = json_encode (array ('transcript_url'
=> $transcript_url));("Content-Type:
application/json");$response;;
}function new_message_ajax_handler () {$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';($this->user_status! = 0)
$_POST ['message'] = wp_kses (trim (stripslashes
(substr ($_POST ['message'], 0, $this->options
['message_maximum_number_chars']))),'');
$_POST ['message'] = wp_kses (trim (stripslashes
($_POST ['message'])),'');($this->no_participation == 0 && $_POST
['message']! = '') {($this->user_status! = 0) {
$_POST ['message'] = $this->filter ($_POST
['message'], (isset ($this->options ['replace_inside_bad_words'])? true:
false));
}(isset ($this->options ['hyperlinks'])) {
$_POST ['message'] = links_add_target
(make_clickable ($_POST ['message']));
}
$wpdb->query ('INSERT INTO '.
$quick_chat_messages_table_name. ' (wpid, room, timestamp, alias, status, ip,
message) VALUES ("'. $this->user_id. '", "'. esc_sql ($_POST
['room']). '", NOW (), "'. ( ($_POST ['sys_mes'] == 'true')?
'quick_chat': esc_sql ($this->user_name)). '", '.
$this->user_status. ', "'. $this->user_ip. '", "'. esc_sql
($_POST ['message']). '"); ');
}
$response = json_encode (array
('no_participation' => $this->no_participation));("Content-Type:
application/json");$response;;
}function update_messages_ajax_handler () {$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';_start ();("Content-Type:
application/json");("Cache-Control: no-cache,
must-revalidate");("Expires: Sat, 26 Jul 1997 05: 00: 00 GMT");
$rooms = implode ('", "', esc_sql (
(array) $_POST ['rooms']));
$startTime = time ();( (time () - $startTime)
<=20) {
$sql = 'SELECT id, wpid, room, timestamp,
UNIX_TIMESTAMP (timestamp) AS unix_timestamp, alias, status, message FROM '
. $quick_chat_messages_table_name. ' WHERE room
IN ("'. $rooms. '") '
. ' AND timestamp > FROM_UNIXTIME ('. esc_sql
($_POST ['last_timestamp']). ') '
. ' ORDER BY unix_timestamp ASC';
$messages = $wpdb->get_results
($sql);($messages) {($messages as $v) {
$v->timestring = date_i18n
($this->date_format. ' - '. $this->time_format,
$v->unix_timestamp+$this->gmt_offset);(function_exists
('get_simple_local_avatar')) {
$v->avatar = get_simple_local_avatar
($v->wpid, $this->options ['avatar_size'], '', $v->alias);
} else {
$v->avatar = get_avatar ($v->wpid,
$this->options ['avatar_size'], '', $v->alias);
}
}
$response = json_encode (array
('no_participation' => $this->no_participation, 'success'=>
1,'messages'=>$messages));$response;_flush (); flush ();;
}else{($this->options
['timeout_refresh_messages']);
}
}
$response = json_encode (array
('no_participation' => $this->no_participation, 'success'=>
0));$response;_flush (); flush ();;
$quick_chat_users_table_name = $wpdb->prefix.
'quick_chat_users';
$wpdb->query ('DELETE FROM '.
$quick_chat_users_table_name. ' WHERE timestamp_polled < TIMESTAMPADD
(SECOND,-'. ($this->options ['timeout_refresh_users'] *2). ',NOW ()); ');
$rooms = esc_sql ( (array) $_POST ['rooms']);
$last_room = end ($rooms);
$quick_chat_users_table_name = $wpdb->prefix.
'quick_chat_users';
$sql_update = 'INSERT INTO '.
$quick_chat_users_table_name. ' (status, room, timestamp_polled,
timestamp_joined, alias, ip, ccode, cname) VALUES';
$sql_update_country_code = 'NULL';
$sql_update_country_name = 'NULL';
$sql_fetch_country = 'NULL as c, NULL as
m';($this->quick_flag_capable ()) {
$sql_fetch_country = 'ccode as c, cname as m';(
($country_info = $this->country_info ($this->user_ip))! = false) {
$sql_update_country_code = '"'. esc_sql
($country_info->code). '"';
$sql_update_country_name = '"'. esc_sql
($country_info->name). '"';
}
}($this->user_status == 0)
$sql_fetch = 'SELECT status, alias, room, id, ip,
'. $sql_fetch_country. ' FROM '. $quick_chat_users_table_name. ' WHERE (';
$sql_fetch = 'SELECT status, alias, room, '.
$sql_fetch_country. ' FROM '. $quick_chat_users_table_name. ' WHERE (';($rooms
as $room) {
$sql_fetch. = 'room = "'. $room. '"';
$sql_update. = ' ('. $this->user_status. ',
"'. $room. '", NOW (), NOW (), "'. $this->user_name. '",
"'. $this->user_ip. '", '. $sql_update_country_code. ', '.
$sql_update_country_name. ') ';($room! = $last_room) {
$sql_fetch. = ' OR ';
$sql_update. = ', ';
}
}
$sql_update. = ' ON DUPLICATE KEY UPDATE
timestamp_polled = NOW (), ccode='. $sql_update_country_code. ', cname='.
$sql_update_country_name. '; ';
$sql_fetch. = ') ORDER BY timestamp_joined
ASC';($this->no_participation == 0)
$wpdb->query ($sql_update);
$users = $wpdb->get_results ($sql_fetch);
$response = json_encode (array
('no_participation' => $this->no_participation, 'users' =>
$users));("Content-Type: application/json");$response;;
}function init_ajax_handler () {
$js_vars = array (
'cookiepath' => COOKIEPATH,
'cookie_domain' => COOKIE_DOMAIN,
'smilies' => $this->smilies,
'user_status' => $this->user_status,
'user_ip' => $this->user_ip,
'user_name' => $this->user_name,
'ip_blocked' => $this->ip_blocked,
'must_login' => $this->must_login,
'no_participation' =>
$this->no_participation,
'timeout_refresh_users' => $this->options
['timeout_refresh_users'],
'clean_target' => $this->options ['clean_target'],
'message_maximum_number_chars' =>
$this->options ['message_maximum_number_chars'],
'clean_target' => $this->options
['clean_target'],
'adsense_content' => $this->options
['adsense_content'],
'inactivity_timeout' => $this->options
['inactivity_timeout'],
'audio_enable' => (isset ($this->options
['message_sound_default_on']))? 1: 0,'loggedin_initiate_private' => (isset
($this->options ['loggedin_initiate_private']))? 1:
0,'guests_initiate_private' => (isset ($this->options ['guests_initiate_private']))?
1: 0,'allow_change_username' => (isset ($this->options
['allow_change_username']))? 1: 0,'i18n' => array (
'not_allowed_to_initiate_s' => __
('Unfortunately you do not have the authority to initiate private
chat','quick-chat'),
'delete_what_s' => __ ('You must select at
least one message','quick-chat'),
'delete_confirm_s' => __ ('Are you sure you
want to permanently delete selected messages? ','quick-chat'),
'clean_confirm_s' => __ ('Are you sure you
want to permanently delete all except the latest %s messages? ','quick-chat'),
'ban_who_s' => __ ('You must select at least
one user','quick-chat'),
'ban_confirm_s' => __ ('Are you sure you want
to add selected users to your Quick Chat admin options IP blocklist?
','quick-chat'),
'reply_to_s' => __ ('Reply to
%s','quick-chat'),
'username_exists_s' => __ ('Already taken!
','quick-chat'),
'username_blocked_s' => __ ('Not allowed!
','quick-chat'),
'username_invalid_s' => __ ('Illegal
characters! ','quick-chat'),
'username_bad_words_s' => __ ('Profanity! ','quick-chat'),
'invitation_received_s' => __ ('%s invites you
to private chat. To start private chat you can click his user name on the user
list. ','quick-chat'),
'invitation_sent_s' => __ ('Your private chat
invitation has been sent to %s. ','quick-chat'),
'private_title_s' => __ ('Private
chat','quick-chat'),
'notice_s' => __ ('Notice','quick-chat'),
'private_with_s' => __ ('Start private chat
with %s','quick-chat'),
'private_close_s' => __ ('Close this private
chat','quick-chat'),
'private_minimize_s' => __ ('Minimize this
private chat','quick-chat'),
'private_restore_s' => __ ('Restore this
private chat','quick-chat'),
'private_invite_confirm_s' => __ ('You\'re
about to send private chat invitation to %s. Are you sure? ','quick-chat'),
'private_accept_confirm_s' => __ ('You\'re
about to accept private chat invitation from %s. Are you sure? ','quick-chat'),
'dropped_inactivity_s' => __ ('You\'ve been
dropped out of chat due to long period of inactivity. To continue with chat
please refresh this page. ','quick-chat'),
'username_check_wait_s' => __ ('Checking.
','quick-chat'),
'add_blocklist_s' => __ ('Add this user\'s IP
address to your IP block list','quick-chat'),
'ban_s' => __ ('Ban','quick-chat'),
'fetch_transcript_s' => __ ('Fetch this chat
room transcript','quick-chat'),
'transcript_s' => __
('Transcript','quick-chat'),
'all_toggle_s' => __ ('Select/deselect all
messages toggle','quick-chat'),
'toggle_s' => __ ('Toggle','quick-chat'),
'delete_selected_s' => __ ('Delete selected messages','quick-chat'),
'delete_s' => __ ('Delete','quick-chat'),
'clean_all_except_s' => __ ('Clean all except
the latest %s messages','quick-chat'),
'clean_s' => __ ('Clean','quick-chat'),
'scroll_toggle_s' => __ ('Enable/disable auto
scroll when new message arrives','quick-chat'),
'scroll_s' => __ ('Scroll','quick-chat'),
'sound_toggle_s' => __ ('Enable/disable sound
notification when new message arrives','quick-chat'),
'sound_s' => __ ('Sound','quick-chat'),
'ip_banned_s' => __ ('You\'re banned from chat.
','quick-chat'),
'must_login_s' => __ ('You must login if you
want to participate in chat. ','quick-chat'),
'send_s' => __ ('Send','quick-chat')
)
);($this->quick_flag_capable ()! = false)
{$quick_flag;
$js_vars ['quick_flag_url'] =
$quick_flag->flag_url;
}
$response = json_encode (array ('js_vars' =>
$js_vars));("Content-Type: application/json");$response;;
}function clean_rooms_to_target () {
$this->log ('Target clean initiated');$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';
$rooms = $wpdb->get_col ('SELECT room FROM '.
$quick_chat_messages_table_name. ' GROUP BY room; ');($rooms) {($rooms as
$room) {
$this->clean_room_to_target ($room,
$this->options ['clean_target']);
}
}
$this->log ('Target clean finished');
}function clear_cache () {(function_exists
('wp_cache_clear_cache')) {
$GLOBALS ["super_cache_enabled"]
=1;_cache_clear_cache ();
}else if (function_exists ('simple_cache_clear'))
{_cache_clear ();
}else{(function_exists
('w3tc_pgcache_flush'))tc_pgcache_flush ();(function_exists
('w3tc_dbcache_flush'))tc_dbcache_flush ();(function_exists
('w3tc_minify_flush'))tc_minify_flush ();(function_exists
('w3tc_objectcache_flush'))tc_objectcache_flush ();(function_exists ('wp_cache_clear_cache'))_cache_clear_cache
();
}
}function country_info ($ip) {(isset ($_COOKIE
['quick_flag_info'])) {
$info = unserialize (stripslashes ($_COOKIE
['quick_flag_info']));($info == FALSE || $info->ip == $ip)$info;
}$quick_flag;
$info = $quick_flag->get_info
($ip);('quick_flag_info', serialize ($info), 0, COOKIEPATH, COOKIE_DOMAIN,
false, true);$info;
}function plugin_meta ($links, $file) {($file ==
$this->basename) {array_merge (
$links,('<a href="'. self:: donate_link.
'">'. __ ('Donate', 'quick-chat'). '</a>')
);
}$links;
}function action_links ($links, $file) {($file ==
$this->basename) {
$settings_link = '<a href="'.
get_admin_url (null, 'admin. php? page='. $this->basename). '">'. __
('Settings', 'quick-count'). '</a>';
$links [] = $settings_link;
}$links;
}function add_options_page () {_options_page
('Quick Chat '. __ ('options page','quick-chat'), 'Quick Chat',
'manage_options', __FILE__, array ($this, 'options_page'));_filter
('plugin_action_links', array ($this, 'action_links'), 10,2);
}function options_page () {
? >
<div>
<div>
<h2>Quick Chat</h2>
<form action="options. php"
method="post">
<? php settings_fields
('quick_chat_options');? >
<? php do_settings_sections (__FILE__);? >
<p>
<input name="Submit"
type="submit">
</p>
</form>
</div>
<? php
}function options_validate ($input) {$wp_version;
$validation_errors = array ();
$roles = $this->get_editable_roles ();($roles
as $key => $value) {
$role = get_role ($key);(isset ($input
['moderator_roles_'. $key]) &&! isset ($this->options
['moderator_roles_'. $key])) {
$role->add_cap ('moderate_quick_chat');
} else if (! isset ($input ['moderator_roles_'.
$key]) && isset ($this->options ['moderator_roles_'. $key])) {
$role->remove_cap ('moderate_quick_chat');
}
}(! is_numeric ($input ['timeout_refresh_users'])
|| $input ['timeout_refresh_users'] < 1) {
$input ['timeout_refresh_users'] = self::
default_timeout_refresh_users;
$validation_errors [] =('setting' =>
'quick_chat_timeout_refresh_users',
'code' =>
'quick_chat_timeout_refresh_users_error',
'title' => __ ('Interval for refreshing list
of online users (seconds): ','quick-chat'),
'message' => __ ('Must be positive integer.
','quick-chat'));
} else{
$input ['timeout_refresh_users'] = floor ($input
['timeout_refresh_users']);
}(! is_numeric ($input
['timeout_refresh_messages']) || $input ['timeout_refresh_messages'] < 1) {
$input ['timeout_refresh_messages'] = self::
default_timeout_refresh_messages;
$validation_errors [] =('setting' =>
'quick_chat_timeout_refresh_messages',
'code' => 'quick_chat_timeout_refresh_messages_error',
'title' => __ ('Interval for refreshing list
of messages (seconds): ','quick-chat'),
'message' => __ ('Must be positive integer.
','quick-chat'));
} else{
$input ['timeout_refresh_messages'] = floor
($input ['timeout_refresh_messages']);
}
$input ['badwords_list'] = wp_filter_nohtml_kses
(trim ($input ['badwords_list']));
$input ['ip_blocklist'] = wp_filter_nohtml_kses
(trim ($input ['ip_blocklist']));
$input ['disallow_usernames_list'] =
wp_filter_nohtml_kses (trim ($input ['disallow_usernames_list']));(! is_numeric
($input ['guest_num_digits']) || $input ['guest_num_digits'] < 1 || $input
['guest_num_digits'] > 10) {
$input ['guest_num_digits'] = self::
default_guest_num_digits;
$validation_errors [] =('setting' => 'quick_chat_guest_num_digits',
'code' => 'quick_chat_guest_num_digits_error',
'title' => __ ('Maximum number of digits for
random guests chat user name suffix: ','quick-chat'),
'message' => sprintf (__ ('Must be positive
integer less than %d. ','quick-chat'),
));
}(! is_numeric ($input ['manual_gmt_offset']) ||
$input ['manual_gmt_offset'] < - 12 || $input ['manual_gmt_offset'] > 12)
{
$input ['manual_gmt_offset'] = self::
default_manual_gmt_offset;
$validation_errors [] =('setting' =>
'quick_chat_manual_gmt_offset',
'code' =>
'quick_chat_manual_gmt_offset_error',
'title' => __ ('Manual timestamp offset when
displaying messages (+/ - hours): ','quick-chat'),
'message' => sprintf (__ ('Must be integer
with value between %d and %d. ','quick-chat'), - 12,12));
} else{
$input ['manual_gmt_offset'] = floor ($input
['manual_gmt_offset']);
}(! is_numeric ($input
['message_maximum_number_chars']) || $input ['message_maximum_number_chars']
< 1 || $input ['message_maximum_number_chars'] < 50) {
$input ['message_maximum_number_chars'] = self::
default_message_maximum_number_chars;
$validation_errors [] =('setting' =>
'quick_chat_message_maximum_number_chars',
'code' =>
'quick_chat_message_maximum_number_chars_error',
'title' => __ ('Maximum number of characters
for each message: ','quick-chat'),
'message' => sprintf (__ ('Must be positive
integer with value %d or greater. ','quick-chat'), 50));
} else{
$input ['message_maximum_number_chars'] = floor
($input ['message_maximum_number_chars']);
}(! is_numeric ($input ['avatar_size']) || $input
['avatar_size'] < 16 || $input ['avatar_size'] > 512) {
$input ['avatar_size'] = self::
default_avatar_size;
$validation_errors [] =('setting' =>
'quick_chat_avatar_size',
'code' => 'quick_chat_avatar_size_error',
'title' => __ ('User avatar size (pixels):
','quick-chat'),
'message' => sprintf (__ ('Must be integer
with value between %d and %d. ','quick-chat'), 16, 512));
} else{
$input ['avatar_size'] = floor ($input
['avatar_size']);
}(! is_numeric ($input ['clean_target']) ||
$input ['clean_target'] < 1) {
$input ['clean_target'] = self::
default_clean_target;
$validation_errors [] =('setting' =>
'quick_chat_clean_target',
'code' => 'quick_chat_clean_target_error',
'title' => __ ('Clean button will delete
messages older than following number of messages per chat room:
','quick-chat'),
'message' => __ ('Must be positive integer.
','quick-chat'));
} else{
$input ['clean_target'] = floor ($input
['clean_target']);
}(! is_numeric ($input ['inactivity_timeout']) ||
$input ['inactivity_timeout'] < 1 || $input ['inactivity_timeout'] < 2 *
$input ['timeout_refresh_users']) {
$input ['inactivity_timeout'] = self::
default_inactivity_timeout;
$validation_errors [] =('setting' =>
'quick_chat_inactivity_timeout',
'code' =>
'quick_chat_inactivity_timeout_error',
'title' => __ ('Timeout for disabling updates
to inactive user (seconds): ','quick-chat'),
'message' => sprintf (__ ('Must be positive
integer with value %d or greater. ','quick-chat'), 2 * $input
['timeout_refresh_users']));
} else {
$input ['inactivity_timeout'] = floor ($input
['inactivity_timeout']);
}(! empty ($validation_errors) &&
version_compare ($wp_version, '3.0', '>=')) {($validation_errors as $error)
{_settings_error ($error ['setting'], $error ['code'], $error ['title']. ' '.
$error ['message']);
}
}
$this->clear_cache ();$input;
}function settings_init () {_setting
('quick_chat_options', 'quick_chat_options', array ($this,
'options_validate'));_settings_section ('donate_section', __ ('Donating or
getting help','quick-chat'), array ($this, 'settings_section_donate'),
__FILE__);_settings_section ('general_section', __ ('General
options','quick-chat'), array ($this, 'settings_section_general'),
__FILE__);_settings_section ('private_section', __ ('Private chat
options','quick-chat'), array ($this,'settings_section_private'),
__FILE__);_settings_section ('filter_section', __ ('Filter
options','quick-chat'), array ($this, 'settings_section_filter'),
__FILE__);_settings_section ('security_section', __ ('Security
options','quick-chat'), array ($this, 'settings_section_security'),
__FILE__);_settings_section ('appearance_section', __ ('Appearance
options','quick-chat'), array ($this, 'settings_section_appearance'), __FILE__);_settings_field
('quick_chat_debug_mode', __ ('Debug mode (enable only when debugging):
','quick-chat'), array ($this, 'settings_field_debug_mode'), __FILE__,
'general_section');_settings_field ('quick_chat_message_sound_default_on', __
('Incoming message sound notification on by default: ','quick-chat'), array
($this, 'settings_field_message_sound_default_on'), __FILE__,
'general_section');_settings_field ('quick_chat_clean_target_auto', __ ('Do
automatic daily cleanup to delete messages older than target number of
messages: ','quick-chat'), array ($this, 'settings_field_clean_target_auto'),
__FILE__, 'general_section');_settings_field ('quick_chat_def_name', __ ('Chat
name prefix for guest users: ','quick-chat'), array ($this,
'settings_field_defname'), __FILE__, 'general_section');_settings_field
('quick_chat_guest_num_digits', __ ('Maximum number of digits for random guests
chat user name suffix: ','quick-chat'), array ($this,
'settings_field_guest_num_digits'), __FILE__, 'general_section');_settings_field
('quick_chat_timeout_refresh_users', __ ('Interval for refreshing list of
online users (seconds): ','quick-chat'), array ($this,
'settings_field_timeout_refresh_users'), __FILE__,
'general_section');_settings_field ('quick_chat_timeout_refresh_messages', __
('Interval for refreshing list of messages (seconds): ','quick-chat'), array
($this, 'settings_field_timeout_refresh_messages'), __FILE__,
'general_section');_settings_field ('quick_chat_clean_target', __ ('Target
number of messages for automatic daily cleanup and chat interface
"Clean" button: ','quick-chat'), array ($this,
'settings_field_clean_target'), __FILE__, 'general_section');_settings_field
('quick_chat_hyperlinks', __ ('Convert URLs to hyperlinks: ','quick-chat'),
array ($this, 'settings_field_hyperlinks'), __FILE__,
'filter_section');_settings_field ('quick_chat_disallow_special_usernames', __
('Disallow using special characters inside chat user names (including special
locale characters): ','quick-chat'), array ($this, 'settings_field_disallow_special_usernames'),
__FILE__, 'filter_section');_settings_field
('quick_chat_replace_inside_bad_words', __ ('Filter bad words contained inside
other words: ','quick-chat'), array ($this,
'settings_field_replace_inside_bad_words'), __FILE__, 'filter_section');_settings_field
('quick_chat_bad_words', __ ('Bad words list (comma separated):
','quick-chat'), array ($this, 'settings_field_badwords'), __FILE__,
'filter_section');_settings_field ('quick_chat_loggedin_initiate_private', __
('Logged in users can initiate private chat: ','quick-chat'), array ($this,
'settings_field_loggedin_initiate_private'), __FILE__,
'private_section');_settings_field ('quick_chat_guests_initiate_private', __
('Guest users can initiate private chat: ','quick-chat'), array ($this,
'settings_field_guests_initiate_private'), __FILE__,
'private_section');_settings_field ('quick_chat_clean_private_auto', __
('Automatically delete all messages from all private chat rooms as well as old
private chat invitations daily: ','quick-chat'), array ($this,
'settings_field_clean_private_auto'), __FILE__,
'private_section');_settings_field ('quick_chat_clean_private', __ ('Delete all
messages from all private chat rooms as well as old private chat invitations
now: ','quick-chat'), array ($this, 'settings_field_clean_private'), __FILE__,
'private_section');_settings_field ('quick_chat_moderator_roles', __
('WordPress user roles allowed to access moderation tools: ','quick-chat'),
array ($this, 'settings_field_moderator_roles'), __FILE__, 'security_section');_settings_field
('quick_chat_only_logged_in_users', __ ('Only logged in users can participate
in chat: ','quick-chat'), array ($this, 'settings_field_only_logged_in_users'),
__FILE__, 'security_section');_settings_field ('quick_chat_disallow_logged_in_usernames',
__ ('Protect registered users user names from being used by other users:
','quick-chat'), array ($this, 'settings_field_disallow_logged_in_usernames'),
__FILE__, 'security_section');_settings_field ('quick_chat_allow_change_username',
__ ('Allow users to change their chat user name: ','quick-chat'), array ($this,
'settings_field_allow_change_username'), __FILE__,
'security_section');_settings_field ('quick_chat_inactivity_timeout', __
('Timeout for disabling updates to inactive user (seconds): ','quick-chat'),
array ($this, 'settings_field_inactivity_timeout'), __FILE__,
'security_section');_settings_field ('quick_chat_message_maximum_number_chars',
__ ('Maximum number of characters for each message: ','quick-chat'), array
($this, 'settings_field_message_maximum_number_chars'), __FILE__,
'security_section');_settings_field ('quick_chat_disallow_usernames_list', __
('Restricted chat user names list (comma separated): ','quick-chat'), array
($this, 'settings_field_disallow_usernames_list'), __FILE__,
'security_section');_settings_field ('quick_chat_ip_blocklist', __ ('Deny chat
access to the following IP addresses (comma separated): ','quick-chat'), array
($this, 'settings_field_ip_blocklist'), __FILE__,
'security_section');_settings_field ('quick_chat_disable_quick_flag', sprintf
(__ ('Disable %s integration (to hide country flags on user list):
','quick-chat'), '<a href="'. self:: quick_flag_link. '"
target="_blank">Quick Flag</a>'), array ($this, 'settings_field_disable_quick_flag'),
__FILE__, 'appearance_section');_settings_field
('quick_chat_hide_widget_if_embedded', __ ('Hide Quick Chat sidebar widget on
pages where same chat room is embedded using shortcode: ','quick-chat'), array
($this, 'settings_field_hide_widget_if_embedded'), __FILE__,
'appearance_section');_settings_field ('quick_chat_hide_linkhome', __ ('Hide
"Powered by Quick Chat" link (big thanks for not hiding it):
','quick-chat'), array ($this, 'settings_field_hide_linkhome'), __FILE__,
'appearance_section');_settings_field ('quick_chat_manual_gmt_offset', __
('Manual timestamp offset when displaying messages (+/ - hours):
','quick-chat'), array ($this, 'settings_field_manual_gmt_offset'), __FILE__,
'appearance_section');_settings_field ('quick_chat_avatar size', __ ('User avatar
size (pixels): ','quick-chat'), array ($this, 'settings_field_avatar_size'),
__FILE__, 'appearance_section');_settings_field ('quick_chat_adsense_code', __
('Advertisement code for your AdSense or other ads placed between chat user
name input box and message text input box: ','quick-chat'), array ($this,
'settings_field_adsense_content'), __FILE__,
'appearance_section');_settings_field ('quick_chat_paypal', __ ('Donate using
PayPal (sincere thank you for your help): ','quick-chat'), array ($this, 'settings_field_paypal'),
__FILE__, 'donate_section');_settings_field ('quick_chat_version', __ ('Quick
Chat version: ','quick-chat'), array ($this, 'settings_field_version'),
__FILE__, 'donate_section');_settings_field ('quick_chat_faq', __ ('Quick Chat
FAQ: ','quick-chat'), array ($this, 'settings_field_faq'), __FILE__,
'donate_section');_settings_field ('quick_chat_changelog', __ ('Quick Chat
changelog: ','quick-chat'), array ($this, 'settings_field_changelog'),
__FILE__, 'donate_section');_settings_field ('quick_chat_support_page', __
('Quick Chat support page: ','quick-chat'), array ($this,
'settings_field_support_page'), __FILE__, 'donate_section');
}function settings_section_donate ()
{'<p>';__ ('If you find Quick Chat useful you can donate to help it\'s development.
Also you can get help with Quick Chat: ','quick-chat');'</p>';
}function settings_section_general ()
{'<p>';__ ('Here you can control all general options:
','quick-chat');'</p>';
}function settings_section_private ()
{'<p>';__ ('Here you can control all private chat options:
','quick-chat');'</p>';
}function settings_section_filter ()
{'<p>';__ ('Here you can control Quick Chat message and chat user names
filter: ','quick-chat');'</p>';
}function settings_section_security ()
{'<p>';__ ('In this section you can control security options:
','quick-chat');'</p>';
}function settings_section_appearance ()
{'<p>';__ ('Here are the Quick Chat appearance options:
','quick-chat');'</p>';
}function settings_field_timeout_refresh_users ()
{'<input id="quick_chat_timeout_refresh_users"
name="quick_chat_options [timeout_refresh_users] "
size="10" type="text" value="'. $this->options
['timeout_refresh_users']. '" />';
}function settings_field_timeout_refresh_messages
() {'<input id="quick_chat_timeout_refresh_messages"
name="quick_chat_options [timeout_refresh_messages] "
size="10" type="text" value="'. $this->options
['timeout_refresh_messages']. '" />';
}function settings_field_faq () {'<a
href="'. self:: faq_link. '" target="_blank">'. __
('FAQ','quick-chat'). '</a>';
}function settings_field_version () {self::
version;
}function settings_field_changelog () {'<a
href="'. self:: changelog_link. '" target="_blank">'. __
('Changelog','quick-chat'). '</a>';
}function settings_field_support_page () {'<a
href="'. self:: support_link. '" target="_blank">'. __
('Quick Chat at TechyTalk. info','quick-chat'). '</a>';
}function settings_field_paypal () {'<a
href="'. self:: donate_link. '" target="_blank"><img
src="'. $this->url. 'img/paypal. gif" /></a>';
}function settings_field_defname () {'<input
id="quick_chat_def_name" name="quick_chat_options [default_name]
" size="10" type="text" value="'. __
($this->options ['default_name'],'quick-chat'). '" />';
}function settings_field_guest_num_digits ()
{'<input id="quick_chat_guest_num_digits"
name="quick_chat_options [guest_num_digits] " size="10"
type="text" value="'. $this->options ['guest_num_digits'].
'" />';
}function settings_field_badwords () {'<a>
}function
settings_field_disallow_special_usernames () {'<input
id="quick_chat_disallow_special_usernames"
name="quick_chat_options [disallow_special_usernames] "
type="checkbox" value="1" ';(isset ($this->options
['disallow_special_usernames'])) echo 'checked="checked"';'/>';
}function settings_field_replace_inside_bad_words
() {'<input id="quick_chat_replace_inside_bad_words"
name="quick_chat_options [replace_inside_bad_words] "
type="checkbox" value="1" ';(isset ($this->options
['replace_inside_bad_words'])) echo 'checked="checked"';'/>';
}function settings_field_hyperlinks ()
{'<input id="quick_chat_hyperlinks" name="quick_chat_options
[hyperlinks] " type="checkbox" value="1" ';(isset
($this->options ['hyperlinks'])) echo 'checked="checked"';'/>';
}function settings_field_disable_quick_flag ()
{'<input id="quick_chat_disable_quick_flag"
name="quick_chat_options [disable_quick_flag] "
type="checkbox" value="1" ';(isset ($this->options
['disable_quick_flag'])) echo 'checked="checked"';'/>';
}function settings_field_hide_widget_if_embedded
() {'<input id="quick_chat_hide_widget_if_embedded"
name="quick_chat_options [hide_widget_if_embedded] "
type="checkbox" value="1" ';(isset ($this->options
['hide_widget_if_embedded'])) echo 'checked="checked"';'/>';
}function settings_field_hide_linkhome ()
{'<input id="quick_chat_hide_linkhome"
name="quick_chat_options [hide_linkhome] " type="checkbox"
value="1" ';(isset ($this->options ['hide_linkhome'])) echo
'checked="checked"';'/>';
}function settings_field_debug_mode ()
{'<input id="quick_chat_debug_mode" name="quick_chat_options
[debug_mode] " type="checkbox" value="1" ';(isset
($this->options ['debug_mode'])) echo 'checked="checked"';'/>';
}function settings_field_only_logged_in_users ()
{'<input id="quick_chat_only_logged_in_users"
name="quick_chat_options [only_logged_in_users] "
type="checkbox" value="1" ';(isset ($this->options
['only_logged_in_users'])) echo 'checked="checked"';'/>';
}function settings_field_message_sound_default_on
() {'<input id="quick_chat_message_sound_default_on"
name="quick_chat_options [message_sound_default_on] "
type="checkbox" value="1" ';(isset ($this->options
['message_sound_default_on'])) echo 'checked="checked"';'/>';
}function
settings_field_disallow_logged_in_usernames () {'<input
id="quick_chat_disallow_logged_in_usernames" name="quick_chat_options
[disallow_logged_in_usernames] " type="checkbox"
value="1" ';(isset ($this->options
['disallow_logged_in_usernames'])) echo 'checked="checked"';'/>';
}function settings_field_disallow_usernames_list
() {'<a>
}function settings_field_ip_blocklist () {'<a>
}function settings_field_adsense_content ()
{'<a>
}function settings_field_manual_gmt_offset ()
{'<input id="quick_chat_manual_gmt_offset"
name="quick_chat_options [manual_gmt_offset] " size="10"
type="text" value="'. $this->options ['manual_gmt_offset'].
'" />';
}function
settings_field_loggedin_initiate_private () {'<input
id="quick_chat_loggedin_initiate_private"
name="quick_chat_options [loggedin_initiate_private] "
type="checkbox" value="1" ';(isset ($this->options
['loggedin_initiate_private'])) echo 'checked="checked"';'/>';
}function settings_field_guests_initiate_private
() {'<input id="quick_chat_guests_initiate_private"
name="quick_chat_options [guests_initiate_private] " type="checkbox"
value="1" ';(isset ($this->options ['guests_initiate_private']))
echo 'checked="checked"';'/>';
}function
settings_field_message_maximum_number_chars () {'<input
id="quick_chat_message_maximum_number_chars"
name="quick_chat_options [message_maximum_number_chars] "
size="10" type="text" value="'. $this->options
['message_maximum_number_chars']. '" />';
}function settings_field_avatar_size ()
{'<input id="quick_chat_avatar_size" name="quick_chat_options
[avatar_size] " size="10" type="text" value="'.
$this->options ['avatar_size']. '" />';
}function settings_field_clean_target ()
{'<input id="quick_chat_clean_target"
name="quick_chat_options [clean_target] " size="10"
type="text" value="'. $this->options ['clean_target'].
'" />';
}function settings_field_clean_target_auto ()
{'<input id="quick_chat_clean_target_auto"
name="quick_chat_options [clean_target_auto] "
type="checkbox" value="1" ';(isset ($this->options
['clean_target_auto'])) echo 'checked="checked"';'/>';
}function settings_field_clean_private () {'<a
id="quick_chat_clean_private" href="">'. __ ('Delete').
'</a>';
}function settings_field_clean_private_auto ()
{'<input id="quick_chat_clean_private_auto"
name="quick_chat_options [clean_private_auto] "
type="checkbox" value="1" ';(isset ($this->options
['clean_private_auto'])) echo 'checked="checked"';'/>';
}function settings_field_allow_change_username ()
{'<input id="quick_chat_allow_change_username"
name="quick_chat_options [allow_change_username] "
type="checkbox" value="1" ';(isset ($this->options
['allow_change_username'])) echo 'checked="checked"';'/>';
}function settings_field_inactivity_timeout () {'<input
id="quick_chat_inactivity_timeout" name="quick_chat_options
[inactivity_timeout] " size="10" type="text"
value="'. $this->options ['inactivity_timeout']. '" />';
}function settings_field_moderator_roles () {
$roles = $this->get_editable_roles ();($roles
as $key => $value) {'<input id="quick_chat_moderator_roles_'. $key.
'" name="quick_chat_options [moderator_roles_'. $key. '] "
type="checkbox" value="1" ';(isset ($this->options
['moderator_roles_'. $key])) echo 'checked="checked"';'/><label
for="quick_chat_options [moderator_roles_'. $key. '] ">'.
translate_user_role ($value ['name']). '</label>';'<br/>';
}
}function get_editable_roles () {$wp_roles;(!
isset ($wp_roles))
$wp_roles = new WP_Roles ();
$all_roles = $wp_roles->roles;
$editable_roles = apply_filters
('editable_roles', $all_roles);_shift ($editable_roles);$editable_roles;
}function quick_flag_version_notice ()
{$current_screen;($this->quick_flag_capable () == false &&_user_can
('manage_options') &&
($current_screen->base == 'settings_page_quick-chat/quick-chat'))
{$current_user;
$user_id = $current_user->ID;(! get_user_meta
($user_id, 'quick_chat_quick_flag_notice_dismiss')) {'<div>
'Quick Chat',
'Quick Flag',:: quick_flag_version_minimum,
'Quick Flag',
'Quick Chat',
'<a href="'. self:: quick_flag_link.
'" target="_blank">'. __ ('More', 'quick-chat').
'</a>',
'<a href="'. esc_url (add_query_arg
('quick_chat_quick_flag_notice_dismiss', '0', $this->current_admin_url ())).
'">'. __ ('Dismiss', 'quick-chat').
'</a>');"</p></div>";
}
}
}function quick_flag_version_notice_dismiss ()
{(current_user_can ('manage_options')) {$current_user;
$user_id = $current_user->ID;(isset ($_GET
['quick_chat_quick_flag_notice_dismiss']) && '0' == $_GET
['quick_chat_quick_flag_notice_dismiss']) {_user_meta ($user_id,
'quick_chat_quick_flag_notice_dismiss', 'true', true);
}
}
}function quick_flag_capable () {$quick_flag;(!
isset ($quick_flag) ||! is_object ($quick_flag) || (Quick_Flag:: version <
self:: quick_flag_version_minimum) || isset ($this->options
['disable_quick_flag']))false;true;
}function dashboard_widget ()
{$this->quick_chat (400, 'admin_room_'. substr (md5 (AUTH_SALT),0,5), 1,
'left', 0, 0, 1, 1, 1);
}function add_dashboard_widgets ()
{($this->user_status == 0)_add_dashboard_widget
('quick_chat_dashboard_widget', __ ('Quick Chat Admin\'s Lounge','quick-chat'),
array ($this, 'dashboard_widget'));
}function quick_chat ($height = 400, $room =
'default', $userlist = 1, $userlist_position = 'left', $smilies = 1,
$send_button = 0, $loggedin_visible = 1, $guests_visible = 1, $avatars = 1,
$counter = 1) {
$content = '';_start ();'<div>
}
$content = ob_get_contents ();_end_clean
();$content;
}function shortcode ($atts, $content=null,
$code="") {(shortcode_atts (array ('height' => 400,'room' =>
'default',
'userlist' => 1,'userlist_position' =>
'left',
'avatars' => 1,'smilies' => 1,'send_button'
=> 0,'loggedin_visible' => 1,'guests_visible' => 1,'counter' => 1),
$atts));
$this->embedded_rooms [$room] =
1;$this->quick_chat ($height, $room, $userlist, $userlist_position,
$smilies, $send_button, $loggedin_visible, $guests_visible, $avatars,
$counter);
}function load_widgets () {_widget
('Quick_Chat_Widget');
}function install () {$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';
$quick_chat_users_table_name = $wpdb->prefix.
'quick_chat_users';($this->db_version < 12) {
// Quick Chat cannot be upgraded from 1. x to 2.
x
$quick_chat_messages_uninstall_table_name =
$wpdb->prefix. 'quick_chat';
$this->options = get_option
('quick_chat_options');
$query = $wpdb->query ('DROP TABLE IF EXISTS
'. $quick_chat_messages_uninstall_table_name. '; ');
}($this->db_version < 15) {
// This is upgrade from v14 database to v15
database, added id auto increment to users table, impossible to do alter, nuke
it (QC v2.30)
$query = $wpdb->query ('DROP TABLE IF EXISTS
'. $quick_chat_users_table_name. '; ');
}
$messages_table_exists = ($wpdb->get_var
('SHOW TABLES LIKE \''. $quick_chat_messages_table_name. '\'; ') ==
$quick_chat_messages_table_name)? 1: 0;
$users_table_exists = ($wpdb->get_var ('SHOW
TABLES LIKE \''. $quick_chat_users_table_name. '\'; ') ==
$quick_chat_users_table_name)? 1: 0;($messages_table_exists == 0) {
$sql_messages = 'CREATE TABLE '.
$quick_chat_messages_table_name. ' (BIGINT (20) UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY,BIGINT (20) UNSIGNED NOT NULL DEFAULT
"0",VARCHAR (50) NOT NULL DEFAULT "default",TIMESTAMP NOT
NULL,VARCHAR (100) NOT NULL DEFAULT "",TINYINT (1) NOT NULL DEFAULT
2,ip VARCHAR (39) NOT NULL,TEXT NOT NULL,(timestamp ASC),(room ASC))
ENGINE=MyISAM DEFAULT CHARACTER SET utf8, COLLATE utf8_general_ci; ';_once
(ABSPATH. 'wp-admin/includes/upgrade. php');($sql_messages);
} else{($this->db_version < 14) {
// This is upgrade from v13 database to v14
database, we need to alter table (QC v2.20)
$query = $wpdb->query ('ALTER TABLE '.
$quick_chat_messages_table_name. ' ADD COLUMN md5email CHAR (32) NOT NULL
DEFAULT "" AFTER alias; ');
}($this->db_version < 18) {
// This is upgrade from v16 database to v18
database, we need to alter table (QC v2.40)
$query = $wpdb->query ('ALTER TABLE '.
$quick_chat_messages_table_name. ' CHANGE COLUMN alias alias VARCHAR (255) NOT
NULL DEFAULT ""; ');
}($this->db_version < 19) {
// This is upgrade from v18 database to v19
database, we need to alter table (QC v2.40)
$query = $wpdb->query ('ALTER TABLE '.
$quick_chat_messages_table_name. ' ADD COLUMN wpid BIGINT (20) UNSIGNED NOT
NULL DEFAULT "0" AFTER id; ');
$query = $wpdb->query ('ALTER TABLE '.
$quick_chat_messages_table_name. ' DROP md5email; ');
}
}($users_table_exists == 0) {
$sql_users = 'CREATE TABLE '.
$quick_chat_users_table_name. ' (BIGINT (20) UNSIGNED NOT NULL AUTO_INCREMENT
PRIMARY KEY,TINYINT (1) NOT NULL DEFAULT 2,room VARCHAR (50) NOT NULL DEFAULT
"default",_polled TIMESTAMP NOT NULL,_joined TIMESTAMP NOT
NULL,VARCHAR (255) NOT NULL default "",VARCHAR (39) NOT NULL DEFAULT
"",CHAR (2) NULL,VARCHAR (150) NULL,(timestamp_polled ASC,
timestamp_joined ASC),KEY roomalias (room, alias)) ENGINE=MyISAM DEFAULT
CHARACTER SET utf8, COLLATE utf8_general_ci; ';_once (ABSPATH.
'wp-admin/includes/upgrade. php');($sql_users);
} else{($this->db_version < 23) {
$wpdb->query ('ALTER TABLE '.
$quick_chat_users_table_name. ' ADD COLUMN ccode CHAR (2) NULL AFTER ip; ');
$wpdb->query ('ALTER TABLE '.
$quick_chat_users_table_name. ' ADD COLUMN cname VARCHAR (150) NULL AFTER
ccode; ');
}
}($this->db_version < 12) {
// Quick Chat cannot be upgraded from 1. x to 2.
x(get_option ('quick_chat_options')) delete_option
('quick_chat_options');(get_option ('quick_chat_db_version')) delete_option
('quick_chat_db_version');(get_option ('widget_quick-chat-widget'))
delete_option ('widget_quick-chat-widget');
}($this->db_version < 13) {(! isset
($this->options ['adsense_content'])) {
$this->options ['adsense_content'] = self::
default_adsense_content;
}
}($this->db_version < 14) {
$widget_options = get_option
('widget_quick-chat-widget');(isset ($widget_options) && is_array
($widget_options)) {($widget_options as &$option) {(is_array ($option)
&&! empty ($option)) {
$option ['gravatars'] = 1;
$option ['gravatars_size'] = 32;
}
}_option ('widget_quick-chat-widget',
$widget_options);
}
}($this->db_version < 15) {(! isset
($this->options ['timeout_refresh_messages'])) {
$this->options ['timeout_refresh_messages'] =
self:: default_timeout_refresh_messages;
}(isset ($this->options
['timeout_consider_offline'])) {($this->options
['timeout_consider_offline']);
}
}($this->db_version < 16) {
$widget_options = get_option
('widget_quick-chat-widget');(isset ($widget_options) && is_array
($widget_options)) {($widget_options as &$option) {(is_array ($option)
&&! empty ($option)) {
$option ['loggedin_visible'] = 1;
$option ['guests_visible'] = 1;
}
}_option ('widget_quick-chat-widget',
$widget_options);
}
}($this->db_version < 18) {(! isset
($this->options ['manual_gmt_offset'])) {
$this->options ['manual_gmt_offset'] = self::
default_manual_gmt_offset;
}
// Remove few options to simplify code (server
performance)(isset ($this->options ['keep_first_last'])) {($this->options
['keep_first_last']);
}(isset ($this->options
['allow_guests_choice'])) {($this->options ['allow_guests_choice']);
}(isset ($this->options
['allow_logged_in_choice'])) {($this->options ['allow_logged_in_choice']);
}
// Increase users and messages refresh times
(server performance)(isset ($this->options ['timeout_refresh_users'])) {
$this->options ['timeout_refresh_users'] =
self:: default_timeout_refresh_users;
}(isset ($this->options
['timeout_refresh_messages'])) {
$this->options ['timeout_refresh_messages'] =
self:: default_timeout_refresh_messages;
}
}(! isset ($this->options
['message_maximum_number_chars'])) {
$this->options
['message_maximum_number_chars'] = self:: default_message_maximum_number_chars;
}(! isset ($this->options ['avatar_size'])) {
$this->options ['avatar_size'] = self::
default_avatar_size;
}
$widget_options = get_option
('widget_quick-chat-widget');(isset ($widget_options) && is_array
($widget_options)) {($widget_options as &$option) {(is_array ($option)
&&! empty ($option)) {
$option ['height'] = $option ['widgetheight'];
}
}_option ('widget_quick-chat-widget',
$widget_options);
}
}($this->db_version < 20) {
$widget_options = get_option ('widget_quick-chat-widget');(isset
($widget_options) && is_array ($widget_options)) {($widget_options as
&$option) {(is_array ($option) &&! empty ($option)) {
$option ['avatars'] = 1;
$option ['smilies'] = 1;
}
}_option ('widget_quick-chat-widget',
$widget_options);
}
}($this->db_version < 21) {(! isset
($this->options ['clean_target'])) {
$this->options ['clean_target'] = self::
default_clean_target;
}(! isset ($this->options
['allow_change_username'])) {
$this->options ['allow_change_username'] = 1;
}
}($this->db_version < 24) {(! isset
($this->options ['inactivity_timeout'])) {
$this->options ['inactivity_timeout'] = self::
default_inactivity_timeout;
}
}($this->db_version < 25) {
$widget_options = get_option
('widget_quick-chat-widget');(isset ($widget_options) && is_array
($widget_options)) {($widget_options as &$option) {(is_array ($option)
&&! empty ($option)) {
$option ['counter'] = 1;
}
}_option ('widget_quick-chat-widget',
$widget_options);
}
}($this->db_version < 26) {(! isset
($this->options ['clean_target_auto'])) {
$this->options ['clean_target_auto'] = '1';
}(! isset ($this->options
['clean_private_auto'])) {
$this->options ['clean_private_auto'] = '1';
}
}(! isset ($this->options ['hyperlinks'])) {
$this->options ['hyperlinks'] = '1';
}(! isset ($this->options
['disallow_logged_in_usernames'])) {
$this->options
['disallow_logged_in_usernames'] = '1';
}(! isset ($this->options
['timeout_refresh_users'])) {
$this->options ['timeout_refresh_users'] =
self:: default_timeout_refresh_users;
}(! isset ($this->options ['default_name'])) {
$this->options ['default_name'] =
$this->default_name;
}(! isset ($this->options ['badwords_list']))
{
$this->options ['badwords_list'] = self::
default_badwords_list;
}(! isset ($this->options
['guest_num_digits'])) {
$this->options ['guest_num_digits'] = self::
default_guest_num_digits;
}(! isset ($this->options ['ip_blocklist'])) {
$this->options ['ip_blocklist'] = self::
default_ip_blocklist;
}(! isset ($this->options
['disallow_usernames_list'])) {
$this->options ['disallow_usernames_list'] =
self:: default_disallow_usernames_list;
}_option ('quick_chat_db_version', self::
default_db_version);_option ('quick_chat_options', $this->options);
$this->clear_cache ();
}function update_db_check ()
{($this->db_version! = self:: default_db_version) {
$this->install ();
}
}function current_admin_url () {
$url = get_admin_url (). basename ($_SERVER
['SCRIPT_FILENAME']);(! empty ($_SERVER ['QUERY_STRING'])) {
$url. = '? '. $_SERVER ['QUERY_STRING'];
}$url;
}function clean_room_to_target ($room, $target)
{$wpdb;
$quick_chat_messages_table_name =
$wpdb->prefix. 'quick_chat_messages';
$sql = $wpdb->prepare (
'DELETE FROM '. $quick_chat_messages_table_name.
'id <= (id(id'. $quick_chat_messages_table_name. 'room = %s AND alias! =
"quick_chat"BY id DESC1 OFFSET %d
) foo
) ', $room, $target);
$rows_affected = $wpdb->query
($sql);$rows_affected;
}function filter ($text, $replace_inside_words)
{(isset ($this->options ['badwords_list']) && ($this->options
['badwords_list']! = '')) {
$strings = explode (',', $this->options
['badwords_list']);($strings as $word) {
$word = trim ($word);
$replacement = str_repeat ('*', strlen
($word));($replace_inside_words) {
$text = str_ireplace ($word, $replacement,
$text);
}{
$text = preg_replace ('/\b'. $word. '\b/i',
$replacement, $text);
}
}
}$text;
}function log ($title, $code = null, $message =
null) {