本文整理汇总了PHP中textFilter函数的典型用法代码示例。如果您正苦于以下问题:PHP textFilter函数的具体用法?PHP textFilter怎么用?PHP textFilter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了textFilter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Hacking
Hacking();
}
} else {
Hacking();
}
break;
//################### Сохранение отредактированых ###################//
//################### Сохранение отредактированых ###################//
case "save":
NoAjaxQuery();
if ($user_group[$user_info['user_group']]['addnews']) {
//Подключаем парсер
include ENGINE_DIR . '/classes/parse.php';
$parse = new parse();
$title = ajax_utf8(textFilter($_POST['title'], false, true));
$text = $parse->BBparse(ajax_utf8(textFilter($_POST['text'])));
$id = intval($_POST['id']);
function BBimg($source)
{
return "<img src=\"{$source}\" alt=\"\" />";
}
$text = preg_replace("#\\[img\\](.*?)\\[/img\\]#ies", "\\BBimg('\\1')", $text);
if (isset($title) and !empty($title) and isset($text) and !empty($text)) {
$db->query("UPDATE `" . PREFIX . "_blog` SET title = '{$title}', story = '{$text}' WHERE id = '{$id}'");
}
}
die;
break;
//################### Загрузка фотографии ###################//
//################### Загрузка фотографии ###################//
case "upload":
示例2: intval
}
//Если добавляем
if (isset($_POST['save'])) {
$ban_date = intval($_POST['days']);
$this_time = $ban_date ? $server_time + $ban_date * 60 * 60 * 24 : 0;
if ($this_time) {
$always = 1;
} else {
$always = 0;
}
if (isset($_POST['ip'])) {
$ip = $db->safesql(htmlspecialchars(strip_tags(trim($_POST['ip']))));
} else {
$ip = "";
}
$descr = textFilter($_POST['descr']);
if ($ip) {
$row = $db->super_query("SELECT id FROM `" . PREFIX . "_banned` WHERE ip ='" . $ip . "'");
if ($row) {
msgbox('Ошибка', 'Этот IP уже добавлен под фильтр', '?mod=ban');
} else {
$db->query("INSERT INTO `" . PREFIX . "_banned` SET descr = '" . $descr . "', date = '" . $this_time . "', always = '" . $always . "', ip = '" . $ip . "'");
@unlink(ENGINE_DIR . '/cache/system/banned.php');
header("Location: ?mod=ban");
}
} else {
msgbox('Ошибка', 'Укажите IP который нужно добавить под фильтр', 'javascript:history.go(-1)');
}
} else {
echoheader();
//Разблокировка
示例3: msgbox
} else {
msgbox('Ошибка', 'Сообщество не найдено', '?mod=groups');
}
die;
}
echoheader();
$se_uid = intval($_GET['se_uid']);
if (!$se_uid) {
$se_uid = '';
}
$se_user_id = intval($_GET['se_user_id']);
if (!$se_user_id) {
$se_user_id = '';
}
$sort = intval($_GET['sort']);
$se_name = textFilter($_GET['se_name'], false, true);
if ($se_uid or $sort or $se_name or $se_user_id or $_GET['ban'] or $_GET['delet']) {
if ($se_uid) {
$where_sql .= "AND id = '" . $se_uid . "' ";
}
if ($se_user_id) {
$where_sql .= "AND real_admin = '" . $se_user_id . "' ";
}
$query = strtr($se_name, array(' ' => '%'));
//Замеянем пробелы на проценты чтоб тоиск был точнее
if ($se_name) {
$where_sql .= "AND title LIKE '%" . $query . "%' ";
}
if ($_GET['ban']) {
$where_sql .= "AND ban = 1 ";
$checked_ban = "checked";
示例4: wall
$wall = new wall();
$wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, text, public_id, add_date, fasts_num, attach, likes_num, likes_users, tell_uid, public, tell_date, tell_comm, tb2.title, photo, comments FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_communities` tb2 WHERE tb1.public_id = '{$id}' AND tb1.public_id = tb2.id AND fast_comm_id = 0 ORDER by `add_date` DESC LIMIT 0, {$limit_select}");
$wall->template('groups/record.tpl');
$wall->compile('content');
$wall->select($public_admin, $server_time);
AjaxTpl();
}
die;
break;
//################### Добавление комментария к записи ###################//
//################### Добавление комментария к записи ###################//
case "wall_send_comm":
NoAjaxQuery();
$rec_id = intval($_POST['rec_id']);
$public_id = intval($_POST['public_id']);
$wall_text = ajax_utf8(textFilter($_POST['wall_text']));
//Проверка на админа и проверяем включены ли комменты
$row = $db->super_query("SELECT tb1.fasts_num, tb2.admin, comments FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_communities` tb2 WHERE tb1.public_id = tb2.id AND tb1.id = '{$rec_id}'");
if ($row['comments'] or stripos($row['admin'], "u{$user_id}|") !== false and isset($wall_text) and !empty($wall_text)) {
//Вставляем саму запись в БД
$db->query("INSERT INTO `" . PREFIX . "_communities_wall` SET public_id = '{$user_id}', text = '{$wall_text}', add_date = '{$server_time}', fast_comm_id = '{$rec_id}'");
$db->query("UPDATE `" . PREFIX . "_communities_wall` SET fasts_num = fasts_num+1 WHERE id = '{$rec_id}'");
$row['fasts_num'] = $row['fasts_num'] + 1;
if ($row['fasts_num'] > 3) {
$comments_limit = $row['fasts_num'] - 3;
} else {
$comments_limit = 0;
}
$sql_comments = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, public_id, text, add_date, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.public_id = tb2.user_id AND tb1.fast_comm_id = '{$rec_id}' ORDER by `add_date` ASC LIMIT {$comments_limit}, 3", 1);
//Загружаем кнопку "Показать N запсии"
$tpl->load_template('groups/record.tpl');
示例5: die
/*
Appointment: Личные настройки
File: mysettings.php
*/
if (!defined('MOZG')) {
die('Hacking attempt!');
}
$row = $db->super_query("SELECT user_email, user_name, user_lastname, user_password FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_info['user_id'] . "'");
//Если сохраянем
if (isset($_POST['save'])) {
$old_pass = md5(md5(GetVar($_POST['old_pass'])));
$new_pass = md5(md5(GetVar($_POST['new_pass'])));
$user_name = textFilter($_POST['name'], false, true);
$user_lastname = textFilter($_POST['lastname'], false, true);
$user_email = textFilter($_POST['email'], false, true);
$errors = array();
//Проверка имени
if (isset($user_name)) {
if (strlen($user_name) >= 2) {
if (!preg_match("/^[a-zA-Zа-яА-Я]+\$/", $user_name)) {
$errors[] = 'Введите имя';
}
} else {
$errors[] = 'Введите имя';
}
} else {
$errors[] = 'Введите имя';
}
//Проверка фамилии
if (isset($user_lastname)) {
示例6: intval
$fid = intval($_POST['fid']);
$row = $db->super_query("SELECT fuser_id, public_id FROM `" . PREFIX . "_communities_forum` WHERE fid = '{$fid}'");
$row2 = $db->super_query("SELECT admin, discussion FROM `" . PREFIX . "_communities` WHERE id = '{$row['public_id']}'");
if (stripos($row2['admin'], "u{$user_id}|") !== false) {
$public_admin = true;
} else {
$public_admin = false;
}
if ($user_info['user_group'] == 1 or $public_admin or $row['fuser_id'] == $user_id and $row2['discussion']) {
//Голосование
$vote_title = ajax_utf8(textFilter($_POST['vote_title'], false, true));
$vote_answer_1 = ajax_utf8(textFilter($_POST['vote_answer_1'], false, true));
$ansers_list = array();
if (isset($vote_title) and !empty($vote_title) and isset($vote_answer_1) and !empty($vote_answer_1)) {
for ($vote_i = 1; $vote_i <= 10; $vote_i++) {
$vote_answer = ajax_utf8(textFilter($_POST['vote_answer_' . $vote_i], false, true));
$vote_answer = str_replace('|', '|', $vote_answer);
if ($vote_answer) {
$ansers_list[] = $vote_answer;
}
}
$sql_answers_list = implode('|', $ansers_list);
//Вставляем голосование в БД
$db->query("INSERT INTO `" . PREFIX . "_votes` SET title = '{$vote_title}', answers = '{$sql_answers_list}'");
$db->query("UPDATE `" . PREFIX . "_communities_forum` SET vote = '{$db->insert_id()}' WHERE fid = '{$fid}'");
}
}
exit;
break;
//################### Просмотр темы ###################//
//################### Просмотр темы ###################//
示例7: die
/*
Appointment: Пользователи
File: users.php
*/
if (!defined('MOZG')) {
die('Hacking attempt!');
}
echoheader();
$se_uid = intval($_GET['se_uid']);
if (!$se_uid) {
$se_uid = '';
}
$sort = intval($_GET['sort']);
$se_name = textFilter($_GET['se_name'], false, true);
$se_email = textFilter($_GET['se_email'], false, true);
$ban = $_GET['ban'];
$delet = $_GET['delet'];
if ($se_uid or $sort or $se_name or $se_email or $ban or $delet or $_GET['regdate']) {
$where_sql .= "WHERE user_email != ''";
if ($se_uid) {
$where_sql .= "AND user_id = '" . $se_uid . "' ";
}
if ($se_name) {
$where_sql .= "AND user_search_pref LIKE '%" . $se_name . "%' ";
}
if ($se_email) {
$where_sql .= "AND user_email LIKE '%" . $se_email . "%' ";
}
if ($ban) {
$where_sql .= "AND user_ban = 1 ";
示例8: header
$db->query("DELETE FROM `" . PREFIX . "_static` WHERE id = '" . $id . "'");
header("Location: ?mod=static");
}
//Редактирование
if ($_GET['act'] == 'edit') {
$id = intval($_GET['id']);
$row = $db->super_query("SELECT title, alt_name, text FROM `" . PREFIX . "_static` WHERE id = '" . $id . "'");
if ($row) {
//Сохраняем
if (isset($_POST['save_edit'])) {
//Подключаем парсер
include_once ENGINE_DIR . '/classes/parse.php';
$parse = new parse();
$title = textFilter($_POST['title'], false, true);
$alt_name = totranslit($_POST['alt_name']);
$text = $parse->BBparse(textFilter($_POST['text']));
if (isset($title) and !empty($title) and isset($text) and !empty($text) and isset($alt_name) and !empty($alt_name)) {
$db->query("UPDATE`" . PREFIX . "_static` SET alt_name = '" . $alt_name . "', title = '" . $title . "', text = '" . $text . "' WHERE id = '" . $id . "'");
header("Location: ?mod=static");
} else {
msgbox('Ошибка', 'Все поля обязательны к заполнению', 'javascript:history.go(-1)');
}
die;
}
echoheader();
$row['title'] = stripslashes($row['title']);
//Подключаем парсер
include_once ENGINE_DIR . '/classes/parse.php';
$parse = new parse();
$row['text'] = $parse->BBdecode(myBrRn(stripslashes($row['text'])));
echohtmlstart('Редактирование страницы');
示例9: elseif
if (!$user_usr) {
$user_usr = $l_anonymous;
}
if (trim($_POST['topicTitle']) == '' and trim($_POST['postText']) == '') {
$action = 'vtopic';
return;
} elseif (trim($_POST['topicTitle']) == '') {
$errorMSG = $l_topiccannotempty;
$correctErr = $backErrorLink;
$title .= $l_topiccannotempty;
echo load_header();
echo ParseTpl(makeUp('main_warning'));
return;
} else {
$TT = $_POST['topicTitle'];
$topicTitle = textFilter($_POST['topicTitle'], $topic_max_length, $post_word_maxlength, 0, 1, 0, $user_id);
}
$poster_ip = getIP();
if (db_simpleSelect(0, $Tf, 'forum_id', 'forum_id', '=', $forum)) {
if ($postRange == 0) {
$antiSpam = 0;
} else {
if ($user_id == 0) {
$fields = array('poster_ip', $poster_ip);
} else {
$fields = array('poster_id', $user_id);
}
if ($antiSpam = db_simpleSelect(0, $Tp, 'count(*)', $fields[0], '=', $fields[1], '', '', 'now()-post_time', '<', $postRange)) {
$antiSpam = $antiSpam[0];
} else {
$antiSpam = 1;
示例10: die
*/
if (!defined('MOZG')) {
die('Hacking attempt!');
}
//Проверяем была ли нажата кнопка, если нет, то делаем редирект на главную
if (!$logged) {
NoAjaxQuery();
//Код безопасности
$session_sec_code = $_SESSION['sec_code'];
$sec_code = $_POST['sec_code'];
//Если код введные юзером совпадает, то пропускаем, иначе выводим ошибку
if ($sec_code == $session_sec_code) {
//Входные POST Данные
$user_name = ajax_utf8(textFilter($_POST['name'], false, true));
$user_lastname = ajax_utf8(textFilter($_POST['lastname'], false, true));
$user_email = ajax_utf8(textFilter($_POST['email'], false, true));
$user_name = ucfirst($user_name);
$user_lastname = ucfirst($user_lastname);
$user_sex = intval($_POST['sex']);
if ($user_sex < 0 or $user_sex > 2) {
$user_sex = 0;
}
$user_day = intval($_POST['day']);
if ($user_day < 0 or $user_day > 31) {
$user_day = 0;
}
$user_month = intval($_POST['month']);
if ($user_month < 0 or $user_month > 12) {
$user_month = 0;
}
$user_year = intval($_POST['year']);
示例11: mozg_clear_cache_file
}
if ($public_admin) {
$db->query("INSERT INTO `" . PREFIX . "_communities_audio` SET public_id = '{$pid}', url = '" . $db->safesql($check['url']) . "', artist = '" . $db->safesql($check['artist']) . "', name = '" . $db->safesql($check['name']) . "', adate = '{$server_time}'");
$db->query("UPDATE `" . PREFIX . "_communities` SET audio_num = audio_num+1 WHERE id = '{$pid}'");
mozg_clear_cache_file("groups/audio{$pid}");
}
exit;
break;
//################### Сохранение отредактированых данных ###################//
//################### Сохранение отредактированых данных ###################//
case "editsave":
NoAjaxQuery();
$aid = intval($_POST['aid']);
$pid = intval($_POST['pid']);
$artist = ajax_utf8(textFilter($_POST['artist'], false, true));
$name = ajax_utf8(textFilter($_POST['name'], false, true));
if (isset($artist) and empty($artist)) {
$artist = 'Неизвестный исполнитель';
}
if (isset($name) and empty($name)) {
$name = 'Без названия';
}
$infoGroup = $db->super_query("SELECT admin FROM `" . PREFIX . "_communities` WHERE id = '{$pid}'");
if (stripos($infoGroup['admin'], "u{$user_id}|") !== false) {
$public_admin = true;
} else {
$public_admin = false;
}
if ($public_admin) {
$db->query("UPDATE `" . PREFIX . "_communities_audio` SET artist = '{$artist}', name = '{$name}' WHERE aid = '{$aid}'");
mozg_clear_cache_file("groups/audio{$pid}");
示例12: die
<?php
/*
Appointment: Отправка массовых сообщений
File: mail.php
*/
if (!defined('MOZG')) {
die('Hacking attempt!');
}
$act = $_GET['act'];
switch ($act) {
//################### Начало рассылки ###################//
case "send":
$limit = intval($_POST['limit']);
$lastid = intval($_POST['lastid']);
$title = textFilter(ajax_utf8($_POST['title']), false, true);
$_POST['text'] = ajax_utf8($_POST['text']);
$sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS user_search_pref, user_email FROM `" . PREFIX . "_users` ORDER by `user_id` ASC LIMIT " . $lastid . ", " . $limit, 1);
if ($sql_) {
include_once ENGINE_DIR . '/classes/mail.php';
$mail = new dle_mail($config, true);
foreach ($sql_ as $row) {
$find = array('/data:/i', '/about:/i', '/vbscript:/i', '/onclick/i', '/onload/i', '/onunload/i', '/onabort/i', '/onerror/i', '/onblur/i', '/onchange/i', '/onfocus/i', '/onreset/i', '/onsubmit/i', '/ondblclick/i', '/onkeydown/i', '/onkeypress/i', '/onkeyup/i', '/onmousedown/i', '/onmouseup/i', '/onmouseover/i', '/onmouseout/i', '/onselect/i', '/javascript/i', '/javascript/i');
$replace = array("data:", "about:", "vbscript<b></b>:", "onclick", "onload", "onunload", "onabort", "onerror", "onblur", "onchange", "onfocus", "onreset", "onsubmit", "ondblclick", "onkeydown", "onkeypress", "onkeyup", "onmousedown", "onmouseup", "onmouseover", "onmouseout", "onselect", "javascript");
$message_send = preg_replace($find, $replace, $_POST['text']);
$message_send = preg_replace("#<iframe#i", "<iframe", $message_send);
$message_send = preg_replace("#<script#i", "<script", $message_send);
$message_send = str_replace("<?", "<?", $message_send);
$message_send = str_replace("?>", "?>", $message_send);
$message_send = $db->safesql($message_send);
$message_send = str_replace("{%user-name%}", $row['user_search_pref'], $_POST['text']);
示例13: strtolower
$type = strtolower(end(explode(".", $file_name)));
// формат файла
if ($type == 'mp3' and $config['audio_mod_add'] == 'yes' and $file_size < 10000000) {
$audio_dir = ROOT_DIR . '/uploads/audio/' . $user_id . '/';
if (!is_dir($audio_dir)) {
@mkdir($audio_dir, 0777);
@chmod($audio_dir, 0777);
}
$res_type = '.' . $type;
if (move_uploaded_file($file_tmp, $audio_dir . $file_rename . $res_type)) {
//Узнаем исполнителя и название песни по id3
include ENGINE_DIR . "/classes/id3v2.php";
$id3v2 = new Id3v2();
$res = $id3v2->read(ROOT_DIR . '/uploads/audio/' . $user_id . '/' . $file_rename . $res_type);
$artist = ajax_utf8(textFilter($res['Artist'], false, true));
$name = ajax_utf8(textFilter($res['Title'], false, true));
if (isset($artist) and empty($artist)) {
$artist = 'Неизвестный исполнитель';
}
if (isset($name) and empty($name)) {
$name = 'Без названия';
}
$lnk = $config['home_url'] . 'uploads/audio/' . $user_id . '/' . $file_rename . $res_type;
$db->query("INSERT INTO `" . PREFIX . "_audio` SET auser_id = '" . $user_id . "', url = '" . $lnk . "', artist = '" . $artist . "', name = '" . $name . "', adate = '" . $server_time . "'");
$db->query("UPDATE `" . PREFIX . "_users` SET user_audio = user_audio+1 WHERE user_id = '" . $user_id . "'");
mozg_mass_clear_cache_file('user_' . $user_id . '/audios_profile|user_' . $user_id . '/profile_' . $user_id);
} else {
echo 1;
}
} else {
echo 1;
示例14: elseif
if (strlen($TT) > 0 and strlen($TT) < $post_text_minlength) {
$TT = '';
}
if ($TT == '' and trim($_POST['postText']) == '') {
$action = 'vtopic';
return;
} elseif ($TT == '' or $TT == '#GET#') {
$errorMSG = $l_topiccannotempty;
$correctErr = $backErrorLink;
$title .= $l_topiccannotempty;
echo load_header();
echo ParseTpl(makeUp('main_warning'));
return;
} else {
$TT = str_replace(array(' ', ' '), '', $TT);
$topicTitle = textFilter($TT, $topic_max_length, $post_word_maxlength, 0, 1, 0, $user_id, 255);
}
$poster_ip = getIP();
if (db_simpleSelect(0, $Tf, 'forum_id', 'forum_id', '=', $forum)) {
if ($postRange == 0) {
$antiSpam = 0;
} else {
if ($user_id == 0) {
$fields = array('poster_ip', $poster_ip);
} else {
$fields = array('poster_id', $user_id);
}
if ($asTime = db_simpleSelect(0, $Tp, 'post_time', $fields[0], '=', $fields[1], 'post_id DESC', '1')) {
$asTime = time() - strtotime($asTime[0]);
if ($asTime <= $postRange) {
$antiSpam = 1;
示例15: ajax_only
<?
/*
Author: Andrey Goglev
VK: https://vk.com/ru151
*/
ajax_only();
$logged or die('{"err":"nolog"}');
$act = $_POST['act'];
switch($act){
case 'list':
$q = textFilter($_POST['val']);
$doload = intval($_POST['doload']);
$s_w = $q ? "AND CONCAT(name, ' ', lname) LIKE '%{$q}%'" : '';
$limit = 20;
$page = isset($_POST['page']) ? intval($_POST['page'])*$limit : 0;
$sql_ = mysql_query("SELECT uid, name, lname FROM `users` WHERE uid != '{$uid}' {$s_w} ORDER by uid LIMIT {$page}, {$limit}", 1);
$res = '';
if($sql_){
$friend = new Memcache;
$friend->addServer('localhost', FR1_PORT);
foreach($sql_ as $row){