本文整理汇总了PHP中html_out函数的典型用法代码示例。如果您正苦于以下问题:PHP html_out函数的具体用法?PHP html_out怎么用?PHP html_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_out函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
//得到最新的经营方针
$list = M("policy")->field("text")->limit(1)->order("date desc")->select();
//得到最新信息
$infolist = M("infopublish")->field("id,title")->limit(5)->order("startdt desc")->select();
//得到Menu
//select a.id,if(b.coun>0,'true','false') cc from sii_menu a
//left join (select pid ,count(1) coun from sii_menu group by pid) b
//on a.id=b.pid
if (!session('uid')) {
$menulist = M("menu")->table("__MENU__ a")->join("(select pid ,count(1) coun from __MENU__ group by pid) b on(a.id=b.pid)")->field("a.*,if(b.coun>0,'true','false') cc")->select();
} else {
$menulist = M("menu")->table("__MENU__ a")->join("(select pid ,count(1) coun from __MENU__ group by pid) b on(a.id=b.pid)")->field("a.*,if(b.coun>0,'true','false') cc")->select();
}
//$menubta = new BuildTreeArray($menulist,'id','pid',0);
//$menudata = $menubta->getTreeArray();
//$menupids=array_column($menulist,'pid');
//var_dump($menupids);
//die();
//$this->assign('menupidlist',$menupids);
$this->assign('menulist', $menulist);
$this->assign('infolist', $infolist);
$this->assign('Policy', html_out($list[0]["text"]));
$this->display();
}
示例2: get_remote_image
public function get_remote_image()
{
$content = $_POST['content'];
if (empty($content)) {
$this->msg('没有获取到内容!', 0);
}
//文件路径
$file_path = __ROOTDIR__ . '/upload/' . date('Y-m') . '/' . date('d') . '/';
//文件URL路径
$file_url = __ROOTURL__ . '/upload/' . date('Y-m') . '/' . date('d') . '/';
$body = html_out($content);
$img_array = array();
preg_match_all("/(src|SRC)=[\"|'| ]{0,}(http:\\/\\/(.*)\\.(gif|jpg|jpeg|bmp|png))/isU", $body, $img_array);
$img_array = array_unique($img_array[2]);
set_time_limit(0);
$milliSecond = date("dHis") . '_';
if (!is_dir($file_path)) {
@mkdir($file_path, 0777, true);
}
foreach ($img_array as $key => $value) {
$value = trim($value);
$ext = explode('.', $value);
$ext = end($ext);
$get_file = @Http::doGet($value, 5);
$rndFileName = $file_path . $milliSecond . $key . '.' . $ext;
$fileurl = $file_url . $milliSecond . $key . '.' . $ext;
if ($get_file) {
$status = @file_put_contents($rndFileName, $get_file);
if ($status) {
$body = str_replace($value, $fileurl, $body);
}
}
}
$this->msg($body, 1);
}
示例3: show
/**
* 获取数据
*
* @see PluginWechatController::show()
*/
public function show($fromusername, $info)
{
$articles = array('type' => 'text', 'content' => '暂时不能绑定');
$media = array();
$config = unserialize($info['config']);
// 素材
if (!empty($config['media_id'])) {
$media = model('Base')->model->table('wechat_media')->field('id, title, file, file_name, type, content, add_time, article_id, link')->where('id = ' . $config['media_id'])->find();
// 单图文
if (empty($media['article_id'])) {
$media['content'] = strip_tags(html_out($media['content']));
}
}
if (!empty($media)) {
$articles = array();
// 数据
$articles['type'] = 'news';
$articles['content'][0]['Title'] = $media['title'];
$articles['content'][0]['Description'] = $media['content'];
// 不是远程图片
if (!preg_match('/(http:|https:)/is', $media['file'])) {
$articles['content'][0]['PicUrl'] = __URL__ . '/' . $media['file'];
} else {
$articles['content'][0]['PicUrl'] = $media['file'];
}
$articles['content'][0]['Url'] = html_out($media['link']);
// 积分赠送
$this->give_point($fromusername, $info);
}
return $articles;
}
示例4: edit
/**
* 编辑活动
*/
public function edit()
{
$id = I('id');
if (IS_POST) {
$data = I('data');
if ($_FILES['act_banner']['name']) {
$result = $this->ectouchUpload('act_banner', 'banner_image');
if ($result['error'] > 0) {
$this->message($result['message'], NULL, 'error');
}
/* 生成banner链接 */
$data2['act_banner'] = substr($result['message']['act_banner']['savepath'], 2) . $result['message']['act_banner']['savename'];
$this->model->table('touch_activity')->data($data2)->where('act_id=' . $id)->update();
}
$this->message(L('edit_favourable_ok'), url('index'));
}
/* 查询附表信息 */
$touch_result = $this->model->table('touch_activity')->where('act_id=' . $id)->find();
$favourable = model('GoodsBase')->favourable_info($id);
/* 附表信息不存在则生成 */
if (empty($touch_result)) {
$data['act_id'] = $id;
$this->model->table('touch_activity')->data($data)->insert();
} else {
$favourable['act_banner'] = $touch_result['act_banner'];
$favourable['act_content'] = html_out($touch_result['act_content']);
}
/* 模板赋值 */
$this->assign('favourable', $favourable);
$this->assign('ur_here', L('edit_favourable'));
$this->assign('action_link', array('text' => L('06_goods_brand_list'), 'href' => url('index')));
$this->display();
}
示例5: index
public function index()
{
//从languages目录下获取语言项文件 - 默认是前台模板语言包
$lang_arr = array();
$lang_path = APP_PATH . 'default/language/' . C('lang');
$lang_dir = @opendir($lang_path);
while ($file = @readdir($lang_dir)) {
if (substr($file, -3) == "php") {
$filename = substr($file, 0, -4);
$language_files = L('language_files');
$lang_arr[$filename] = $file . ' - ' . @$language_files[$filename];
}
}
ksort($lang_arr);
@closedir($lang_dir);
// print_r($lang_arr);
/* 获得需要操作的语言包文件 */
$lang_file = isset($_POST['lang_file']) ? trim($_POST['lang_file']) : '';
if ($lang_file == 'common') {
$file_path = $lang_path . '/common.php';
} else {
$file_path = $lang_path . '/user.php';
}
$file_attr = '';
if (file_mode_info($file_path) < 7) {
$file_attr = $lang_file . '.php:' . L('file_attribute');
}
/* 搜索的关键字 */
$keyword = !empty($_POST['keyword']) ? trim(stripslashes($_POST['keyword'])) : '';
/* 调用函数 */
$language_arr = $this->get_language_item_list($file_path, $keyword);
foreach ($language_arr as $key => $value) {
$language_arr[$key]['item_content'] = html_out($language_arr[$key]['item_content']);
}
// echo '<pre>';
// print_r($language_arr);
// echo '</pre>';
/* 模板赋值 */
$this->assign('ur_here', L('edit_languages'));
$this->assign('keyword', $keyword);
//关键字
$this->assign('action_link', array());
$this->assign('file_attr', $file_attr);
//文件权限
$this->assign('lang_arr', $lang_arr);
//语言文件列表
$this->assign('file_path', $file_path);
//语言文件
$this->assign('lang_file', $lang_file);
//语言文件
$this->assign('language_arr', $language_arr);
//需要编辑的语言项列表
// assign_query_info();
$this->display('language_list');
}
示例6: index
public function index()
{
$cid = intval($_GET['cid']);
if (empty($cid)) {
$this->error404();
}
//读取栏目信息
$info = model('category')->info($cid);
if (!is_array($info)) {
$this->error404();
}
//模块自动纠正
model('category')->model_jump($info['mid'], 'pages');
/*hook*/
$this->plus_hook('category', 'index', $info);
$this->info = $this->plus_hook_replace('category', 'index_replace', $this->info);
/*hook end*/
//位置导航
$this->nav = array_reverse(model('category')->nav($info['cid']));
//查询单页内容
$content = model('pages')->content($info['cid']);
if (empty($content['content'])) {
$content['content'] = '暂无内容';
}
$info['content'] = html_out($content['content']);
//读取内容替换
$content = model('content')->format_content($info['content']);
//URL路径
$model_info = model('category')->model_info($info['mid']);
$url = model('category')->url_format($model_info['url_category_page'], $cid, $info['urlname']);
$page = new Page();
$content = $page->contentPage(html_out($content), "<hr class=\"ke-pagebreak\" />", $url, 10, 4);
//文章分页
$info['content'] = $content['content'];
$this->page = $content['page'];
$this->info = $info;
//查询上级栏目信息
$this->parent_category = model('category')->info($this->info['pid']);
if (empty($this->parent_category)) {
$this->parent_category = array("cid" => "0", "pid" => "0", "mid" => "0", "name" => "无上级栏目");
}
//MEDIA信息
$this->common = model('pageinfo')->media($this->info['name'], $this->info['keywords'], $this->info['description']);
//获取顶级栏目信息
$this->top_category = model('category')->info($this->nav[0]['cid']);
$this->display($info['class_tpl']);
}
示例7: edit
/**
* 编辑文章
*/
public function edit() {
$id = I('id');
if (IS_POST) {
$data = I('data');
$data['content'] = I('post.content');
//更新数据库
$touch_result = $this->model->table('touch_article')->where('article_id=' . $id)->find();
if (!empty($touch_result)) {
$this->model->table('touch_article')->data($data)->where('article_id=' . $id)->update();
}
clear_all_files();
$this->message(L('articleedit_succeed'), url('index'));
}
$article = $this->model->table('touch_article')->field('*')->where(array('article_id' => $id))->find();
$article['content'] = html_out($article['content']);
/* 模板赋值 */
$this->assign('cat_select', model('ArticleBase')->article_cat_list(0, $article['cat_id']));
$this->assign('article', $article);
$this->assign('ur_here', L('articlecat_edit'));
$this->display();
}
示例8: index
public function index()
{
$cid = intval($_GET['cid']);
if (empty($cid)) {
$this->error404();
}
//读取栏目信息
$info = model('category')->info($cid);
if (empty($info)) {
$this->error404();
}
//模块自动纠正
model('category')->model_jump($info['mid'], 'jump');
/*hook*/
$this->plus_hook('jump', 'index', $info);
/*hook end*/
//读取附加表
$jump = model('jump')->info($cid);
$link = $this->return_tpl(html_out($jump['url']));
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $link . "");
exit;
}
示例9: get_cat_articles
/**
* 获得文章分类下的文章列表
*
* @access public
* @param integer $cat_id
* @param integer $page
* @param integer $size
* @return array
*/
public function get_cat_articles($cat_id, $page = 1, $size = 20, $requirement = '')
{
// 取出所有非0的文章
if ($cat_id == '-1') {
$cat_str = 'cat_id > 0';
} else {
$cat_str = get_article_children($cat_id);
}
$condition = 'is_open = 1 AND ' . $cat_str;
// 增加搜索条件,如果有搜索内容就进行搜索
if ($requirement != '') {
$condition .= ' AND title like \'%' . $requirement . '%\'';
}
$limit = ($page - 1) * $size . ',' . $size;
//liugu--添加content
$list = $this->select($condition, 'article_id, title, author, add_time,cat_id, content,file_url, open_type', ' article_id DESC', $limit);
$i = 1;
$arr = array();
if (is_array($list)) {
foreach ($list as $vo) {
$article_id = $vo['article_id'];
$arr[$article_id]['id'] = $article_id;
$arr[$article_id]['index'] = $i;
$arr[$article_id]['title'] = $vo['title'];
$arr[$article_id]['short_title'] = C('article_title_length') > 0 ? sub_str($vo['title'], C('article_title_length')) : $vo['title'];
$arr[$article_id]['author'] = empty($vo['author']) || $vo['author'] == '_SHOPHELP' ? C('shop_name') : $vo['author'];
$arr[$article_id]['url'] = $vo['open_type'] != 1 ? build_uri('article/info', array('aid' => $article_id)) : trim($vo['file_url']);
$arr[$article_id]['add_time'] = date(C('date_format'), $vo['add_time']);
$arr[$article_id]['cat_id'] = $vo['cat_id'];
//liugu--添加content
$arr[$article_id]['content'] = html_out($vo['content']);
//liugu--添加content
$i++;
}
}
return $arr;
}
示例10: del
/**
* 删除品牌
*/
public function del() {
$id = I('id');
/* 删除该品牌的图标 */
$sql = "SELECT a.brand_logo,b.brand_banner,b.brand_content FROM " . $this->model->pre . "brand as a left join " . $this->model->pre . "touch_brand as b on a.brand_id = b.brand_id WHERE a.brand_id = '$id'";
$result = $this->model->query($sql);
$brand_logo = $result[0]['brand_logo'];
$brand_banner = $result[0]['brand_banner'];
$brand_content = html_out($result[0]['brand_content']);
//删除编辑器中的附件
preg_match_all("/(src|href)\=\"\/(.*?)\"/i", $brand_content, $match);
if (is_array($match[2])) {
foreach ($match[2] as $vo) {
$index = strpos($vo, 'data/');
@unlink(ROOT_PATH . substr($vo, $index));
}
}
//删除logo
if (!empty($brand_logo)) {
$index = strpos($brand_logo, 'data/');
@unlink(ROOT_PATH . substr($brand_logo, $index));
}
//删除广告位
if (!empty($brand_banner)) {
$index = strpos($brand_banner, 'data/');
@unlink(ROOT_PATH . substr($brand_banner, $index));
}
//更新商品的品牌编号
$this->model->table('goods')->data('brand_id=0')->where('brand_id=' . $id)->update();
//删除品牌
$condition['brand_id'] = $id;
$this->model->table('brand')->where($condition)->delete();
$this->model->table('touch_brand')->where($condition)->delete();
clear_all_files();
$this->message(L('drop_succeed'), url('index'));
}
示例11: html_out
<input type="submit" class="btn btn-warning" value="Покинуть комнату">
</form>
</div>
<br><br><br>
</div>
<div class="row text-center">
<form id="mes_form" class="form-group text-center">
<div>
<table>
<tr>
<td>
<input type="text" id="input_mes" size="70" maxlength="250" placeholder="Введите сообщение" class="form-control">
</td>
<td>
<label style="font-size: large; font-weight: bold" for id="send"> <?php
html_out($_SESSION['name']);
?>
</label>
<input type="submit" class="btn btn-primary" id="send" value="Отправить сообщение">
</td>
</tr>
</table>
</div>
</form>
</div>
<?php
} else {
?>
<div class="col-lg-4 text-right">
<p><?php
include $_SERVER['DOCUMENT_ROOT'] . '/reg_log/logout.inc.html.php';
示例12: session_start
<?php
session_start();
?>
<select class="form-control" id="users_on" form="add_form" name="users[]" multiple required size='2'>
<?php
foreach ($res_user_select as $row) {
?>
<?php
if ($_SESSION['name'] == $row['user']) {
?>
<option class="form-control" disabled><?php
html_out($row['user']);
?>
</option>
<?php
} else {
?>
<option class="form-control" value="<?php
html_out($row['user']);
?>
"><?php
html_out($row['user']);
?>
</option>
<?php
}
}
?>
</select>
示例13: get_field_html
public function get_field_html($info, $data = null)
{
$info['default'] = html_out($info['default']);
if (!empty($data)) {
$info['default'] = $data;
}
$html = '';
switch ($info['type']) {
case '1':
$html .= '
<tr>
<td align="right">' . $info['name'] . '</td>
<td>
<input name="' . $info['field'] . '" type="text" class="text_value" id="' . $info['field'] . '" value="' . $info['default'] . '"
';
if (!empty($info['must'])) {
$html .= ' reg="\\S" msg="' . $info['name'] . '不能为空!" ';
}
$html .= '/>
</td>
<td>' . $info['tip'] . '</td>
</tr>
';
break;
case '2':
$html .= '
<tr>
<td align="right">' . $info['name'] . '</td>
<td><textarea name="' . $info['field'] . '" class="text_textarea" id="' . $info['field'] . '" >' . $info['default'] . '</textarea>
</td>
<td>' . $info['tip'] . '</td>
</tr>
';
break;
case '3':
$html .= '
<tr>
<td align="right">' . $info['name'] . '</td>
<td colspan="2"><textarea name="' . $info['field'] . '" style="width:100%; height:350px;" id="' . $info['field'] . '">' . $info['default'] . '</textarea>
' . module('editor')->get_editor_upload($info['field'] . '_upload', 'editor_' . $info['field']) . '
<input type="button" id="' . $info['field'] . '_upload" class="button_small" style="margin-top:10px;" value="上传图片和文件到编辑器" />
</td>
</tr>
';
$html .= module('editor')->get_editor($info['field'], true);
break;
case '4':
$html .= '
<tr>
<td align="right">' . $info['name'] . '</td>
<td>
<input name="' . $info['field'] . '" type="text" class="text_value" style="width:200px; float:left" id="' . $info['field'] . '" value="' . $info['default'] . '"
';
if (!empty($info['must'])) {
$html .= ' reg="\\S" msg="' . $info['name'] . '不能为空!" ';
}
$html .= '/>
<input type="button" id="' . $info['field'] . '_botton" class="button_small" value="选择文件" />
</td>
<td>' . $info['tip'] . '</td>
</tr>
';
$html .= module('editor')->get_file_upload($info['field'] . '_botton', $info['field'], true);
break;
case '10':
$html .= '
<tr>
<td align="right">' . $info['name'] . '</td>
<td>
<input name="' . $info['field'] . '" type="text" class="text_value" style="width:200px; float:left" id="' . $info['field'] . '" value="' . $info['default'] . '"
';
if (!empty($info['must'])) {
$html .= ' reg="\\S" msg="' . $info['name'] . '不能为空!" ';
}
$html .= '/>
<input type="button" id="' . $info['field'] . '_botton" class="button_small" value="选择图片" />
</td>
<td>' . $info['tip'] . '</td>
</tr>
';
$html .= module('editor')->get_image_upload($info['field'] . '_botton', $info['field'], true);
break;
case '5':
$html .= '
<tr>
<td align="right">' . $info['name'] . '</td>
<td colspan="2">
<input type="button" id="' . $info['field'] . '_button" class="button_small" value="上传多图" />
<div class="fn_clear"></div>
<div class="images">
<ul id="' . $info['field'] . '_list" class="images_list">';
if (!empty($data)) {
$info['default'] = unserialize($info['default']);
if (!empty($info['default'])) {
foreach ($info['default'] as $value) {
$html .= "<li>\r\n <div class='pic' id='images_button'>\r\n <img src='" . $value['url'] . "' width='125' height='105' />\r\n <input id='" . $info['field'] . "[]' name='" . $info['field'] . "[]' type='hidden' value='" . $value['url'] . "' />\r\n <input id='" . $info['field'] . "_original[]' name='" . $info['field'] . "_original[]' type='hidden' value='" . $value['original'] . "' />\r\n </div>\r\n <div class='title'>标题: <input name='" . $info['field'] . "_title[]' type='text' id='" . $info['field'] . "_title[]' value='" . $value['title'] . "' /></div>\r\n <div class='title'>排序: <input id='" . $info['field'] . "_order[]' name='" . $info['field'] . "_order[]' value='" . $value['order'] . "' type='text' style='width:50px;' /> <a href='javascript:void(0);' onclick='\$(this).parent().parent().remove()'>删除</a></div>\r\n </li>";
}
}
}
$html .= "</ul>\r\n <div style='clear:both'></div>\r\n </div>\r\n </td>\r\n </tr>\r\n ";
//.........这里部分代码省略.........
示例14: html_out
background-color: lightskyblue;
}
</style>
</head>
<body>
<div class="container">
<div class="row text-center">
<img src="/img/logo.png">
</div>
<div class="row">
<h1 class="h1 text-center">Общайтесь прямо сейчас!</h1>
<?php
if (isset($loginError) && $loginError != '') {
?>
<p class="h3 text-center"><?php
html_out($loginError);
?>
</p>
<?php
}
?>
<div class="col-lg-4 text-center"></div>
<div class="col-lg-4 text-center">
<form role="form" class="form-group" action="" method="post">
<h3 class="panel-heading">Пожалуйста авторизируйтесь, чтобы войти в чат.</h3>
<div>
<label for="name">Введите Ваше имя: </label>
<input class="form-control" placeholder="Введите имя" type="text" name="name" id="name" required >
</div>
<div>
<label for="password">Введите пароль: </label>
示例15: html_out
</head>
<body>
<div class="container">
<div class="row text-center">
<img src="/img/logo.png">
</div>
<div class="row">
<h1 class="h1 text-center">Общайтесь прямо сейчас!</h1>
<div class="col-lg-4 text-center"></div>
<div class="col-lg-4 text-center">
<p class="h4">Введите корректные данные для регистрации в чате!</p>
<?php
if (isset($regError)) {
?>
<br/><p class="h3 has-error text-center"><?php
html_out($regError);
?>
</p><br/>
<?php
}
?>
<form role="form" class="form-group" action="?" method="post">
<div>
<label for="name">Введите Ваше имя: </label>
<input class="form-control" placeholder="Введите желаемое имя" type="text" name="name" id="name" required>
</div>
<div>
<label for="password">Введите пароль: </label>
<input class="form-control" type="password" placeholder="Введите пароль" name="password" id="password" required >
</div>
<div>