本文整理汇总了PHP中AZLib::cleanHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::cleanHtml方法的具体用法?PHP AZLib::cleanHtml怎么用?PHP AZLib::cleanHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::cleanHtml方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
Form::Form('NewsDetailForm');
$id = Url::get('news_id', 0);
if ($id) {
if (!CGlobal::$news_details) {
CGlobal::$news_details = DB::select("news", "id={$id}");
}
if (CGlobal::$news_details && (CGlobal::$news_details['status'] == 1 || CGlobal::$news_details['status'] == 0 && User::have_permit(ADMIN_NEWS))) {
$this->news = CGlobal::$news_details;
}
}
if (!$this->news) {
Url::redirect('news_list', array('news_catid', 'azname'));
} else {
DB::query("UPDATE news SET view_num=view_num+1 WHERE id =" . $this->news['id']);
}
$news_title = $this->news['title'];
$catid = $this->news['news_catid'];
$str_keywords = '';
$str_catSub = '';
$meta_keywords = '';
$meta_desc = '';
if (isset(CGlobal::$allNewsCategories[$catid])) {
$news_title .= " - " . CGlobal::$allNewsCategories[$catid]['name'];
$curMainCat = CGlobal::$allNewsCategories[$catid];
$str_catSub = $curMainCat['name'];
if ($curMainCat['keywords']) {
$meta_keywords .= ($meta_keywords ? ', ' : '') . $curMainCat['keywords'];
}
if ($curMainCat['description']) {
$meta_desc .= ($meta_desc ? ', ' : '') . $curMainCat['description'];
}
}
if ($this->news['brief']) {
CGlobal::$meta_desc = AZLib::cleanHtml($this->news['brief']);
} elseif ($meta_desc != '') {
CGlobal::$meta_desc = $meta_desc;
}
if ($meta_keywords != '') {
CGlobal::$keywords = $meta_keywords;
} elseif ($str_catSub != '') {
CGlobal::$keywords = $str_catSub;
}
CGlobal::$website_title = stripslashes($news_title) . ' - Tin tức';
//CGlobal::$website_title = AznetLib::subString($news_title,0,100,true);
// $this->link_css('style/aznet/jquery.lightbox.css');
// $this->link_js('javascript/jquery/lightbox/jquery.lightbox.js');
}
示例2: send_pm
function send_pm()
{
if (User::is_login()) {
$user_id = (int) Url::get('user_id');
$title_pm = AZLib::getParam('title_pm');
$content_pm = AZLib::cleanHtml(AZLib::getParam('content_pm'));
if (!$user_id) {
echo "false_send";
exit;
}
if (AZLib::isBlackList(User::id(), $user_id)) {
echo "blacklist";
exit;
}
if (User::id() == $user_id) {
echo "no_send_yourself";
exit;
}
if ($title_pm == '' || $title_pm == 'Tiêu đề') {
echo "no_title";
exit;
} elseif ($content_pm == '') {
echo "no_content";
exit;
}
$receiver_user = User::getUser($user_id);
$id_mess = AZLib::Send_pm(User::id(), User::user_name(), $receiver_user, $title_pm, $content_pm);
if ($id_mess) {
echo "success";
exit;
} else {
echo "false_send";
exit;
}
} else {
echo "not_login";
exit;
}
}
示例3:
echo CGlobal::$js_ver;
?>
"></script>
<script type="text/javascript" src="<?php
echo STATIC_URL;
?>
javascript/enbac/header.js?v=<?php
echo CGlobal::$js_ver;
?>
"></script>
<script type="text/javascript" src="<?php
echo STATIC_URL;
?>
javascript/mudim.packed.js?v=0.8-r142"></script>
<?php
if (Url::get('keywords') && AZLib::trimSpace(AZLib::cleanHtml(Url::get('keywords')))) {
echo '<script type="text/javascript" src="' . STATIC_URL . 'javascript/jquery/packed/jquery.highlight-2.js"></script>';
}
?>
<script type="text/javascript" src="<?php
echo STATIC_URL;
?>
javascript/tooltip.js"></script>
<script>$eb = jQuery.noConflict();
</script>
<?php
echo AZNet::$extraHeader;
echo AZNet::$extraHeaderJS;
if (!DEBUG) {
?>
示例4: gallery_update
function gallery_update()
{
//Cập nhật ảnh cho thư viện
if (User::have_permit(ADMIN_IMAGE) && (int) Url::get('user_id', 0) && (int) Url::get('user_id', 0) != User::id()) {
$user_id = (int) Url::get('user_id', 0);
} else {
$user_id = User::id();
}
$image_id = (int) $_GET['image_id'];
$json['error'] = 'not_updated';
//not_uploaded
$json['url_error'] = '';
$json['img_url'] = '';
if (User::is_login()) {
if (User::is_az_team() || User::level() > 0) {
if ($image_id) {
$des = substr(AZLib::trimSpace(AZLib::cleanHtml($_POST['des_update'])), 0, 50);
$image = DB::select('item_image', 'id=' . $image_id . ' AND root_id=0 AND user_id=' . $user_id);
if ($image) {
$upload_path = AZLib::folderUpload($user_id);
if (AZLib::ftp_check_dir($upload_path, true, IMAGE_SERVER_NO)) {
//Check dir for upload
if (isset($_FILES['img_upload_update']) && !$_FILES['img_upload_update']['error'] && $_FILES['img_upload_update']['name']) {
if (getimagesize($_FILES['img_upload_update']['tmp_name']) && $_FILES['img_upload_update']['size'] <= Item::MAX_UPLOAD_SIZE) {
$file_name = $_FILES['img_upload_update']['name'];
$sourceName = $_FILES['img_upload_update']['tmp_name'];
$file_ext = AZLib::getExtension($file_name);
if (in_array($file_ext, array('.jpg', '.jpeg', '.gif', '.png'))) {
$img_url = $upload_path . date("YmdHis", TIME_NOW) . '_' . substr(AZLib::make_safe_name(basename(strtolower($file_name), $file_ext)), 0, 36) . $file_ext;
if (AZLib::ftp_image_put_file($img_url, $sourceName, IMAGE_SERVER_NO)) {
if (DB::update('item_image', array('des' => $des, 'img_server' => IMAGE_SERVER_NO, 'img_url' => $img_url), 'id=' . $image_id . ' OR root_id=' . $image_id)) {
if ($image['img_url']) {
AZLib::ftp_image_delete_file($image['img_url'], $image['img_server']);
if (MEMCACHE_ON) {
$sql = "SELECT * FROM item\tWHERE img_url='{$image['img_url']}' AND status IN(1,2) AND user_id=" . $user_id;
$re = DB::query($sql);
while ($item_memcache = mysql_fetch_assoc($re)) {
$item_memcache['img_server'] = IMAGE_SERVER_NO;
$item_memcache['img_url'] = $img_url;
AZMemcache::do_put("item:" . $item_memcache['id'], $item_memcache);
}
}
DB::query("UPDATE item SET img_server = " . (int) IMAGE_SERVER_NO . ", img_url='{$img_url}' WHERE img_url='{$image['img_url']}' AND status IN(1,2) AND user_id=" . $user_id);
}
$json['img_server'] = IMAGE_SERVER_NO;
$json['img_url'] = $img_url;
$json['error'] = 'success';
} else {
$json['error'] = 'not_updated';
}
}
} else {
$json['error'] = 'ext_invalid';
//Sai định dạng file
}
} else {
$json['error'] = 'over_max_size';
//Sai định dạng file hoặc upload dung lượng quá lớn
}
} elseif ($_POST['url_update']) {
$url = $_POST['url_update'];
$tem_cache_dir = DIR_CACHE . 'user_images/';
AZLib::CheckDir($tem_cache_dir);
$tem_cache_file = User::user_name() . md5($url) . '.gif';
$image_content = disguise_curl($url);
if ($image_content) {
if (@file_put_contents($tem_cache_dir . $tem_cache_file, $image_content)) {
if (getimagesize($tem_cache_dir . $tem_cache_file) && filesize($tem_cache_dir . $tem_cache_file) <= Item::MAX_UPLOAD_SIZE) {
$sourceName = $tem_cache_dir . $tem_cache_file;
$img_url = $upload_path . TIME_NOW . '_' . $tem_cache_file;
if (AZLib::ftp_image_put_file($img_url, $sourceName, IMAGE_SERVER_NO)) {
if (DB::update('item_image', array('des' => $des, 'img_server' => IMAGE_SERVER_NO, 'img_url' => $img_url), 'id=' . $image_id . ' OR root_id=' . $image_id)) {
if ($image['img_url']) {
AZLib::ftp_image_delete_file($image['img_url'], $image['imng_server']);
if (MEMCACHE_ON) {
$sql = "SELECT * FROM item\tWHERE img_url='{$image['img_url']}' AND status IN(1,2) AND user_id=" . $user_id;
$re = DB::query($sql);
while ($item_memcache = mysql_fetch_assoc($re)) {
$item_memcache['img_server'] = IMAGE_SERVER_NO;
$item_memcache['img_url'] = $img_url;
AZMemcache::do_put("item:" . $item_memcache['id'], $item_memcache);
}
}
DB::query("UPDATE item SET img_url='{$img_url}' WHERE img_url='{$image['img_url']}' AND status IN(1,2) AND user_id=" . $user_id);
}
$json['url_error'] = 'success';
$json['img_server'] = IMAGE_SERVER_NO;
$json['img_url'] = $img_url;
} else {
$json['url_error'] = 'not_updated';
}
} else {
$json['url_error'] = 'not_uploaded';
}
} else {
$json['url_error'] = 'over_max_size';
}
@unlink($tem_cache_dir . $tem_cache_file);
} else {
$json['url_error'] = 'not_cache_file';
//.........这里部分代码省略.........
示例5: draw
//.........这里部分代码省略.........
} else {
$num_mess = User::$current->data['total_pm'] > 0 ? User::$current->data['total_pm'] : 0;
}
if (User::id()) {
$display->add('user_id', User::id());
$user_name = User::$current->data['user_name'];
$display->add('user_name', $user_name);
}
$referer_login_url = '';
$yahoo_open_id_href = '';
$google_open_id_href = '';
if (isset($_SESSION['openid_url']) && $_SESSION['user_id'] != 0) {
$display->add('show_openid', FALSE);
} elseif (!User::is_az_team()) {
AZLib::check_uri();
$referer_login_url = base64_encode(CGlobal::$query_string);
$yahoo_open_id_href = OID_URL . 'index.html?openid_identifier=http://me.yahoo.com/&long_redirect=' . base64_encode(CGlobal::$query_string);
$google_open_id_href = OID_URL . 'index.html?openid_identifier=https://www.google.com/users/o8/id&long_redirect=' . base64_encode(CGlobal::$query_string);
$display->add('show_openid', TRUE);
}
$display->add('OID_URL', $yahoo_open_id_href);
$display->add('OID_URL_GOG', $google_open_id_href);
$display->add('referer_login_url', $referer_login_url);
$display->add('google_open_id_href', $google_open_id_href);
$display->add('yahoo_open_id_href', $yahoo_open_id_href);
$display->add('openid_on', OPENID_ON);
$display->add('num_mess', $num_mess);
$display->add('is_login', (int) User::is_login());
$display->add('is_admin', (int) User::is_az_team());
$display->add('is_admin_item', (int) User::have_permit(ADMIN_ITEM));
$display->add('is_root', User::is_root());
//End Top menu
$display->add('category_id', CGlobal::$curCategory);
$display->add('keywords', AZLib::cleanHtml(Url::get('keywords', '')));
$display->add('not_error_page', (int) (AZNet::$page['name'] != 'error'));
$display->add('is_load_page_first', $_SESSION['is_load_page_first']);
// Tỷ giá
AZLib::get_config();
//$exchange = CGlobal::$configs['exchange']['conf_val'];
//$display->add('exchange', number_format($exchange, 0, ',', '.'));
// End Tỷ giá
if ($_SESSION['is_load_page_first'] == 1) {
$_SESSION['is_load_page_first'] = 0;
}
//End of top menu
$curMainCat = CGlobal::$curMainCat;
$curLevel2Cat = CGlobal::$curLevel2Cat;
//Cat menu
$sub_menu = FALSE;
$sub_menu = $curMainCat && isset(CGlobal::$allCategories[$curMainCat['id']]) && isset(CGlobal::$subCategories[$curMainCat['id']]);
$display->add('CURENT_TOP_CATID', (int) @$curMainCat['id']);
$display->add('CURENT_LEVEL2_CATID', (int) @$curLevel2Cat['id']);
$display->add('CURENT_CITY_ID', CGlobal::$curCity);
$display->add('cur_page', Url::get('page'));
$display->add('sub_menu', $sub_menu);
$display->add('block_id', Module::$block_id);
// System::debug($display->get_template_vars());
//End Cat menu
if (User::is_root()) {
$display->add("DEBUG", DEBUG);
$display->add("show_bug_url", AZRewrite::formatUrl(Url::build_all(array(), "ebug=" . (int) (!DEBUG))));
}
################################################################################################################
#Event config
$event_on = @CGlobal::$configs['event_on']['conf_val'];
$submit = Url::get('submit', '');
示例6: edit_user_info
function edit_user_info()
{
$user_id = (int) Url::get('user_id', 0);
$info = AZLib::getParam('id');
$value = AZLib::getParam('value');
$input = array();
$output = '';
if ($user_id && (User::have_permit(ADMIN_USER) || User::id() == $user_id && !User::is_block())) {
if ($info == 'up_item') {
if (User::is_admin()) {
$user = DB::select('user', "id={$user_id}");
if (User::is_root()) {
$value = (int) $value;
$input = array('up_item' => $value > 0 ? $value : 0);
$output = '<b>' . $value . '</b>';
echo $output;
$admin = User::$current->data;
if ($user) {
$up_count = $value - $user['up_item'];
if ($up_count != 0) {
//type: 0:Tiền mặt; 1:thu tại nhà; 2:chuyển khoản; 3:Free, KM; 8:Online
$up_log_sql = "INSERT INTO up_log (`user_id`,\t`user_name`,\t\t\t`admin_id`,\t\t`admin_name`,\t\t\t`time`,\t `up_count`,`up_before`,\t\t`up_after`,\t`price`,\t`type`,\t\t`note`)\r\n\t VALUES ({$user['id']},\t'{$user['user_name']}',{$admin['id']},\t'{$admin['user_name']}'," . TIME_NOW . ",{$up_count},'{$user['up_item']}',{$value},\t\t0,\t\t\t3,\t\t\t'')";
DB::query($up_log_sql);
if ($up_count > 0) {
$update = DB::query('UPDATE user SET up_item=up_item + ' . $up_count . ' WHERE id=' . $user_id);
} else {
$update = DB::query('UPDATE user SET up_item=up_item - ' . abs($up_count) . ' WHERE id=' . $user_id);
}
//DB::Update('user',$input,"id=$user_id");
User::getUser($user_id, 0, 1);
}
}
} else {
$output = "<b>" . (int) $user['up_item'] . "</b>";
echo $output;
}
exit;
} else {
$output = '<b>' . $value . '</b>';
echo $output;
exit;
}
} elseif (!AZLib::checkBadWord($value) || User::have_permit(ADMIN_USER)) {
$output = 'Chức năng này đang được bổ sung. Ấn F5 để tải lại trang.';
if ($info == 'blast') {
$input = array('blast' => $value);
$userblast = ' ' . AZLib::BBCode(AZLib::cleanHtml($value));
if (strpos($userblast, 'http://')) {
$user_blast = $userblast;
while (strpos($user_blast, 'http://')) {
$tmp = substr($user_blast, strpos($user_blast, 'http://'));
if (strpos($tmp, ' ') || strpos($tmp, '<')) {
if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
$blast_url = substr($tmp, 0, strpos($tmp, '<'));
} else {
$blast_url = substr($tmp, 0, strpos($tmp, ' '));
}
} else {
$blast_url = $tmp;
}
$user_blast = str_replace($blast_url, '', $user_blast);
}
$new_blast_url = ' <a href="' . $blast_url . '" target="_blank">Click here</a>';
$userblast = substr($user_blast . $new_blast_url, 1);
}
$user = User::getUser($user_id);
if ($value) {
//blast không trống
if ($value != $user['blast']) {
//Thay đổi blast
DB::delete("feed", "user_id={$user_id} AND type = 8");
//thêm vào feed cho các thành viên theo đuôi
DB::query("INSERT INTO \tfeed \t(type, \tuser_id, act_user_id, time)\r\n VALUES\t(8,\t\t{$user_id}, {$user_id}, " . TIME_NOW . ")");
}
} else {
//Xoá blast
DB::delete("feed", "user_id={$user_id} AND type = 8");
}
$output = $userblast . ' <img src="style/images/icon/icon_edit.gif" title="Click để sửa..." alt="Click để sửa..." class="hand_point" rel="blast" align="absmiddle">';
} elseif ($info == 'address') {
$input = array('address' => trim($value));
$output = AZLib::word_limit($value, 12, '');
} elseif ($info == 'mobile_phone') {
$value = preg_replace("/[^0-9]/", "", $value);
if (!AZLib::is_mobile($value)) {
$value = '';
}
$input = array('mobile_phone' => trim($value));
$output = AZLib::word_limit($value, 10, '');
} elseif ($info == 'home_phone') {
if (User::have_permit(ADMIN_USER) || User::$current->data['phone_verify'] == 0) {
$value = preg_replace("/[^0-9]/", "", $value);
if (AZLib::is_mobile($value) || substr($value, 0, 1) != "0") {
$value = '';
}
$input = array('home_phone' => trim($value));
$output = AZLib::word_limit($value, 10, '');
}
} elseif ($info == 'yahoo_id') {
$input = array('yahoo_id' => trim($value));
//.........这里部分代码省略.........
示例7: highlight_searchword
function highlight_searchword()
{
global $display;
$keywords = AZLib::cleanHtml(Url::get('keywords', ''));
$highlight = '';
if ($keywords) {
$highlight = $str_search = str_replace(array('+', '/', '|', '-', '*'), "", $keywords);
$highlight = AZLib::trimSpace($highlight);
$highlight = str_replace("'", '', $highlight);
$highlight = str_replace("'", '', $highlight);
$highlight = str_replace(""", '', $highlight);
}
if ($highlight) {
$arr = explode(' ', $highlight);
if ($arr) {
$highlight = "";
foreach ($arr as $word) {
$highlight = ($highlight ? $highlight . ', ' : '') . "'{$word}'";
}
}
}
$display->add('highlight', $highlight);
}