本文整理汇总了PHP中AZLib::clean_value方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::clean_value方法的具体用法?PHP AZLib::clean_value怎么用?PHP AZLib::clean_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::clean_value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: on_submit
function on_submit()
{
$footerContent = Url::get('content');
if (get_magic_quotes_gpc()) {
$footerContent = stripslashes($footerContent);
}
require_once ROOT_PATH . 'includes/htmLawed.php';
$config = array('safe' => 1, 'elements' => '*', 'deny_attribute' => 'class, id');
$spec = 'a = title, href;';
// The 'a' element can have only these attributes
$footerContent = htmLawed($footerContent, $config, $spec);
$footerContent = AZLib::clean_value($footerContent);
$this->checkFormInput('Nội dung', 'content', $footerContent, 'str', true);
if (!$this->errNum) {
if (isset(CGlobal::$configs['footer_content'])) {
DB::update('configs', array("conf_val" => $footerContent), "conf_key='footer_content'");
} else {
DB::insert('configs', array("conf_key" => 'footer_content', "conf_val" => $footerContent));
}
AZLib::get_config(0, 1);
AZLib::refreshParent();
}
}
示例2: on_submit
function on_submit()
{
AZLib::getCats();
$sku = AZLib::trimSpace(str_replace("\n", " ", Url::get('sku')));
###############################################################################################
$name = AZLib::trimSpace(str_replace("\n", " ", Url::get('name')));
mb_internal_encoding("UTF-8");
$name = mb_strtoupper(mb_substr($name, 0, 1)) . mb_substr($name, 1);
###############################################################################################
###############################################################################################
$offer = AZLib::trimSpace(str_replace("\n", " ", Url::get('offer')));
mb_internal_encoding("UTF-8");
$offer = mb_strtoupper(mb_substr($offer, 0, 1)) . mb_substr($offer, 1);
###############################################################################################
###############################################################################################
$list_brief = AZLib::trimSpace(str_replace("\n", " ", Url::get('list_brief')));
mb_internal_encoding("UTF-8");
$list_brief = mb_strtoupper(mb_substr($list_brief, 0, 1)) . mb_substr($list_brief, 1);
###############################################################################################
###############################################################################################
//$item_description = AZLib::getParam('item_description');
$item_description = Url::get('item_description');
$brief = Url::get('brief');
if (get_magic_quotes_gpc()) {
$item_description = stripslashes($item_description);
$brief = stripslashes($brief);
}
require_once ROOT_PATH . 'includes/htmLawed.php';
$config = array('safe' => 1, 'elements' => '*', 'deny_attribute' => 'class, id');
$spec = 'a = title, href;';
// The 'a' element can have only these attributes
$item_description = htmLawed($item_description, $config, $spec);
$item_description = AZLib::clean_value($item_description);
$brief = htmLawed($brief, $config, $spec);
$brief = AZLib::clean_value($brief);
###############################################################################################
$category_id = 0;
$level_1_catid = 0;
$first_combo = (int) Url::get('first_combo');
$second_combo = (int) Url::get('second_combo');
$price = Url::cdouble(Url::get('price', 0));
$price_out = Url::cdouble(Url::get('price_out', 0));
$currency_id = (int) Url::get('currency_id', 1);
$quantity = Url::cdouble(Url::get('quantity', 0));
if ($quantity < 0) {
$quantity = 0;
}
$item_order = (int) Url::get('item_order');
$made_in = Url::get('made_in');
$warranty = Url::get('warranty');
if (!isset(CGlobal::$currency[$currency_id])) {
$currency_id = 1;
}
$item_category = false;
if ($first_combo && $second_combo) {
//Nếu chọn danh mục cấp 2
$category_id = $second_combo;
$level_1_catid = $first_combo;
$level_2_catid = $second_combo;
if (isset(CGlobal::$allCategories[$category_id])) {
//Kiểm tra sự tồn tai của danh mục
$item_category = CGlobal::$allCategories[$category_id];
//Nếu danh mục của sản phẩm là danh mục cấp 1 và có danh mục con => chọn lại
if (isset(CGlobal::$subCategories[$category_id]) && CGlobal::$subCategories[$category_id] && $item_category['parent_id'] == 0 || $item_category['parent_id'] != $first_combo) {
$this->setFormError('category_id', 'Hãy chọn lại <b>Chủng loại</b> cho sản phẩm!');
}
}
} elseif ($first_combo) {
//Nếu chọn danh mục cấp 1
$category_id = $first_combo;
$level_1_catid = $first_combo;
$level_2_catid = $first_combo;
if (isset(CGlobal::$allCategories[$category_id])) {
//Kiểm tra sự tồn tai của danh mục
$item_category = CGlobal::$allCategories[$category_id];
if (isset(CGlobal::$subCategories[$category_id]) && CGlobal::$subCategories[$category_id] && $item_category['parent_id'] == 0) {
//Nếu danh mục có danh mục con => Chọn lại!
$this->setFormError('category_id', 'Hãy chọn lại <b>Chủng loại</b> cho sản phẩm!');
} elseif ($item_category['parent_id'] != 0) {
//Nếu không fải là danh mục cấp 1
$this->setFormError('category_id', 'Hãy chọn lại <b>Chủng loại</b> cho sản phẩm!');
}
}
}
if (!$item_category) {
$this->setFormError('category_id', 'Bạn chưa chọn <b>Danh mục</b> cho sản phẩm!');
}
$this->checkFormInput('Tên sản phẩm', 'name', $name, 'str', true, '', 5, 255);
$this->checkFormInput('Mô tả vắn tắt', 'brief', $brief, 'str', false, '', 15, 500000);
$this->checkFormInput('Mô tả sản phẩm', 'item_description', $item_description, 'str', true, '', 15, 500000);
//Check kiểm duyệt
$status = 1;
//Cho hiển thị
$have_image_up = false;
$form_img_server = Url::get('avatar_img_server', 0);
$this->img_url = Url::get('avatar_img_url', '');
foreach ($this->item_images as $page => $page_images) {
//trang
foreach ($page_images as $image) {
if ($image['img_new_id']) {
//.........这里部分代码省略.........
示例3: on_submit
function on_submit()
{
AZLib::getCats();
$sku = AZLib::trimSpace(str_replace("\n", " ", Url::get('sku')));
###############################################################################################
$name = AZLib::trimSpace(str_replace("\n", " ", Url::get('name')));
mb_internal_encoding("UTF-8");
$name = mb_strtoupper(mb_substr($name, 0, 1)) . mb_substr($name, 1);
###############################################################################################
###############################################################################################
$offer = AZLib::trimSpace(str_replace("\n", " ", Url::get('offer')));
mb_internal_encoding("UTF-8");
$offer = mb_strtoupper(mb_substr($offer, 0, 1)) . mb_substr($offer, 1);
###############################################################################################
###############################################################################################
$list_brief = AZLib::trimSpace(str_replace("\n", " ", Url::get('list_brief')));
mb_internal_encoding("UTF-8");
$list_brief = mb_strtoupper(mb_substr($list_brief, 0, 1)) . mb_substr($list_brief, 1);
###############################################################################################
###############################################################################################
//$item_description = AZLib::getParam('item_description');
$item_description = Url::get('item_description');
$brief = Url::get('brief');
if (get_magic_quotes_gpc()) {
$item_description = stripslashes($item_description);
$brief = stripslashes($brief);
}
require_once ROOT_PATH . 'includes/htmLawed.php';
$config = array('safe' => 1, 'elements' => '*', 'deny_attribute' => 'class, id');
$spec = 'a = title, href;';
// The 'a' element can have only these attributes
$item_description = htmLawed($item_description, $config, $spec);
$item_description = AZLib::clean_value($item_description);
$brief = htmLawed($brief, $config, $spec);
$brief = AZLib::clean_value($brief);
###############################################################################################
$category_id = 0;
$level_1_catid = 0;
$first_combo = (int) Url::get('first_combo');
$second_combo = (int) Url::get('second_combo');
$price = Url::cdouble(Url::get('price'));
$price_out = Url::cdouble(Url::get('price_out'));
$currency_id = (int) Url::get('currency_id', 1);
$quantity = Url::cdouble(Url::get('quantity', 0));
if ($quantity < 0) {
$quantity = 0;
}
$item_order = (int) Url::get('item_order');
$made_in = Url::get('made_in');
$warranty = Url::get('warranty');
if (!isset(CGlobal::$currency[$currency_id])) {
$currency_id = 1;
}
$item_category = false;
if ($first_combo && $second_combo) {
$category_id = $second_combo;
$level_1_catid = $first_combo;
$level_2_catid = $second_combo;
if (isset(CGlobal::$allCategories[$category_id])) {
//Kiểm tra sự tồn tai của danh mục
$item_category = CGlobal::$allCategories[$category_id];
if (isset(CGlobal::$subCategories[$category_id]) && CGlobal::$subCategories[$category_id] && $item_category['parent_id'] == 0 || $item_category['parent_id'] != $first_combo) {
//Nếu danh mục của sản phẩm là danh mục cấp 1 và có danh mục con => chọn lại
$this->setFormError('category_id', 'Hãy chọn lại <b>Chủng loại</b> cho sản phẩm!');
}
}
} elseif ($first_combo) {
//Nếu chọn danh mục cấp 1
$category_id = $first_combo;
$level_1_catid = $first_combo;
$level_2_catid = $first_combo;
if (isset(CGlobal::$allCategories[$category_id])) {
//Kiểm tra sự tồn tai của danh mục
$item_category = CGlobal::$allCategories[$category_id];
if (isset(CGlobal::$subCategories[$category_id]) && CGlobal::$subCategories[$category_id] && $item_category['parent_id'] == 0) {
//Nếu danh mục có danh mục con => Chọn lại!
$this->setFormError('category_id', 'Hãy chọn lại <b>Chủng loại</b> cho sản phẩm!');
} elseif ($item_category['parent_id'] != 0) {
//Nếu không fải là danh mục cấp 1
$this->setFormError('category_id', 'Hãy chọn lại <b>Chủng loại</b> cho sản phẩm!');
}
}
}
if (!$item_category) {
$this->setFormError('category_id', 'Bạn chưa chọn <b>Danh mục</b> cho sản phẩm!');
}
/*if($price<=0)
{
$this->setFormError('price','Với tin rao bán bạn phải nhập <b>Giá</b>');
}
else*/
if ($price > 0) {
if ($currency_id == 1) {
$this->checkFormInput("Giá bán", 'price', $price, 'double', false, '', 1, 50000000000);
} else {
$this->checkFormInput("Giá bán", 'price', $price, 'double', false, '', 1, 1000000);
}
}
if ($price_out != '' && $price_out != '0') {
if ($currency_id == 1) {
//.........这里部分代码省略.........