本文整理汇总了PHP中new_html_special_chars函数的典型用法代码示例。如果您正苦于以下问题:PHP new_html_special_chars函数的具体用法?PHP new_html_special_chars怎么用?PHP new_html_special_chars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了new_html_special_chars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct() {
parent::__construct();
$this->tablename = '';
$setting = new_html_special_chars(getcache('formguide', 'commons'));
$this->M = $setting[$this->get_siteid()];
$this->db = pc_base::load_model('sitemodel_model');
}
示例2: __construct
function __construct()
{
parent::__construct();
$setting = new_html_special_chars(getcache('poster', 'commons'));
$this->M = $setting[$this->get_siteid()];
$this->db = pc_base::load_model('poster_space_model');
}
示例3: register
/**
* 申请友情链接
*/
public function register() {
$siteid = SITEID;
if(isset($_POST['dosubmit'])){
if($_POST['name']==""){
showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");
}
if($_POST['url']==""){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
}
if(!in_array($_POST['linktype'],array('0','1'))){
$_POST['linktype'] = '0';
}
$link_db = pc_base::load_model(link_model);
$_POST['logo'] =new_html_special_chars($_POST['logo']);
if($_POST['linktype']=='0'){
$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']);
}else{
$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']);
}
$link_db->insert($sql);
showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");
} else {
$setting = getcache('link', 'commons');
$setting = $setting[$siteid];
if($setting['is_post']=='0'){
showmessage(L('suspend_application'), HTTP_REFERER);
}
$this->type = pc_base::load_model('type_model');
$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类
pc_base::load_sys_class('form', '', 0);
$SEO = seo(SITEID, '', L('application_links'), '', '');
include template('link', 'register');
}
}
示例4: new_html_special_chars
/**
* 返回经htmlspecialchars处理过的字符串或数组
* @param $obj 需要处理的字符串或数组
* @return mixed
*/
function new_html_special_chars($string) {
$encoding = 'utf-8';
if(strtolower(CHARSET)=='gbk') $encoding = 'ISO-8859-15';
if(!is_array($string)) return htmlspecialchars($string,ENT_QUOTES,$encoding);
foreach($string as $key => $val) $string[$key] = new_html_special_chars($val);
return $string;
}
示例5: get
function get($data = array())
{
$_groupid = param::get_cookie('_groupid');
$this->data = $data;
if (isset($data['id'])) {
$this->id = $data['id'];
}
$info = array();
$info = array();
if (is_array($this->fields)) {
foreach ($this->fields as $field => $v) {
$func = $v['formtype'];
$value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
if ($func == 'pages' && isset($data['maxcharperpage'])) {
$value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
}
if (!method_exists($this, $func)) {
continue;
}
$form = $this->{$func}($field, $value, $v);
if ($form !== false) {
$star = $v['minlength'] || $v['pattern'] ? 1 : 0;
$info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
}
}
}
return $info;
}
示例6: get
function get($data = array())
{
$_roleid = param::get_cookie('_roleid');
$_groupid = param::get_cookie('_groupid');
$this->data = $data;
if (isset($data['id'])) {
$this->id = $data['id'];
}
$info = array();
foreach ($this->fields as $field => $v) {
if (defined('IN_ADMIN')) {
if ($v['disabled'] || $v['iscore'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
continue;
}
} else {
if ($v['disabled'] || $v['iscore'] || !$v['isadd'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
continue;
}
}
$func = $v['formtype'];
$value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
if ($func == 'pages' && isset($data['maxcharperpage'])) {
$value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
}
if (!method_exists($this, $func)) {
continue;
}
$form = $this->{$func}($field, $value, $v);
if ($form !== false) {
$star = $v['minlength'] || $v['pattern'] ? 1 : 0;
$info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isbase' => $v['isbase'], 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
}
}
return $info;
}
示例7: __construct
function __construct()
{
parent::__construct();
$this->M = new_html_special_chars(getcache('vote', 'commons'));
$this->db = pc_base::load_model('vote_subject_model');
$this->db2 = pc_base::load_model('vote_option_model');
}
示例8: xml_serialize
/**
* serialize
* @param $data 数组
* @return string
*/
public function xml_serialize(&$data, $level = 0, $prior_key = NULL) {
if($level == 0) {
ob_start();
echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\"?>\n<root>","\n";
}
while(list($key, $value) = each($data)) {
if(!strpos($key, ' attr')) {
if(is_array($value) and array_key_exists(0, $value)) {
$this->xml_serialize($value, $level, $key);
} else {
$tag = $prior_key ? $prior_key : (is_numeric($key) ? 'item' : $key);
echo str_repeat("\t", $level),'<',$tag;
if(array_key_exists("$key attr", $data)) {
while(list($attr_name, $attr_value) = each($data["$key attr"])) {
echo ' ',$attr_name,'="',new_html_special_chars($attr_value),'"';
}
reset($data["$key attr"]);
}
if(is_null($value)) {
echo " />\n";
} elseif(!is_array($value)) {
echo '>',new_html_special_chars($value),"</$tag>\n";
} else {
echo ">\n",$this->xml_serialize($value, $level+1),str_repeat("\t", $level),"</$tag>\n";
}
}
}
}
reset($data);
if($level == 0) {
$str = &ob_get_contents();
ob_end_clean();
return $str.'</root>';
}
}
示例9: __construct
public function __construct()
{
$this->urlrules = getcache('urlrules', 'commons');
$this->M = new_html_special_chars(getcache('ask', 'commons'));
self::set_siteid();
$this->categorys = getcache('category_ask_' . $this->siteid, 'commons');
$this->html_root = pc_base::load_config('system', 'html_root');
}
示例10: type_lists
/**
* 首页 友情链接分类 循环 .
* @param $data
*/
public function type_lists($data) {
if (!in_array($data['listorder'], array('desc', 'asc'))) {
$data ['listorder'] = 'desc';
}
$sql = array('module'=>ROUTE_M,'siteid'=>$data['siteid']);
$r = $this->type_db->select($sql, '*', $data['limit'], 'listorder '.$data['listorder']);
return new_html_special_chars($r);
}
示例11: __construct
function __construct()
{
$this->db = pc_base::load_model('sitemodel_model');
$this->m_db = pc_base::load_model('sitemodel_field_model');
$this->M = new_html_special_chars(getcache('formguide', 'commons'));
$this->siteid = intval($_GET[siteid]);
$this->M = $this->M[$this->siteid];
}
示例12: __construct
function __construct()
{
//parent::__construct();
$this->M = new_html_special_chars(getcache('ask', 'commons'));
$this->db = pc_base::load_model('ask_model');
$this->db2 = pc_base::load_model('ask_posts_model');
$this->db3 = pc_base::load_model('category_model');
$this->siteid = get_siteid();
}
示例13: new_html_special_chars
/**
* 返回经htmlspecialchars处理过的字符串或数组
* @param $obj 需要处理的字符串或数组
* @return mixed
*/
function new_html_special_chars($string)
{
if (!is_array($string)) {
return htmlspecialchars($string);
}
foreach ($string as $key => $val) {
$string[$key] = new_html_special_chars($val);
}
return $string;
}
示例14: __construct
function __construct()
{
parent::__construct();
$this->M = new_html_special_chars(getcache('ask', 'commons'));
$this->db = pc_base::load_model('ask_model');
$this->db2 = pc_base::load_model('answer_model');
$this->db3 = pc_base::load_model('category_model');
$this->db_m = pc_base::load_model('member_model');
$this->siteid = $this->get_siteid();
$this->categorys = getcache('category_ask_' . $this->siteid, 'commons');
}
示例15: init
public function init()
{
$allow_visitor = new_html_special_chars($_GET['allow_visitor']);
$auth = sys_auth($allow_visitor, 'DECODE');
if (strpos($auth, '|') === false) {
showmessage(L('illegal_operation'));
}
$auth_str = explode('|', $auth);
$flag = $auth_str[0];
if (!preg_match('/^([0-9]+)|([0-9]+)/', $flag)) {
showmessage(L('illegal_operation'));
}
$readpoint = intval($auth_str[1]);
$paytype = intval($auth_str[2]);
$http_referer = urldecode($_GET['http_referer']);
if (!$readpoint) {
showmessage(L('illegal_operation'));
}
pc_base::load_app_class('spend', 'pay', 0);
$flag_arr = explode('_', $flag);
$catid = $flag_arr[0];
$siteids = getcache('category_content', 'commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_' . $siteid, 'commons');
if (isset($CATEGORYS[$catid])) {
$setting = string2array($CATEGORYS[$catid]['setting']);
$repeatchargedays = intval($setting['repeatchargedays']);
if ($repeatchargedays) {
$fromtime = SYS_TIME - 86400 * $repeatchargedays;
$r = spend::spend_time($this->userid, $fromtime, $flag);
if ($r) {
showmessage(L('have_pay'), $http_referer, 1000);
}
}
}
if ($paytype) {
if (spend::amount($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) {
$msg = spend::get_msg();
$http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay';
} else {
$msg = L('readpoint_pay', array('readpoint' => $readpoint));
}
} else {
if (spend::point($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) {
$msg = spend::get_msg();
$http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay';
} else {
$msg = L('readpoint_pay_point', array('readpoint' => $readpoint));
}
}
showmessage($msg, $http_referer, 3000);
}