本文整理汇总了PHP中html_out函数的典型用法代码示例。如果您正苦于以下问题:PHP html_out函数的具体用法?PHP html_out怎么用?PHP html_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_out函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:siimanager,项目名称:sii,代码行数:26,代码来源:IndexController.class.php
示例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);
}
开发者ID:JamesKid,项目名称:teach,代码行数:35,代码来源:editorMod.class.php
示例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;
}
开发者ID:noikiy,项目名称:shop-3,代码行数:36,代码来源:bd.class.php
示例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();
}
开发者ID:noikiy,项目名称:shop-3,代码行数:36,代码来源:FavourableController.class.php
示例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');
}
开发者ID:noikiy,项目名称:shop-3,代码行数:55,代码来源:LanguagesController.class.php
示例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']);
}
开发者ID:JamesKid,项目名称:teach,代码行数:47,代码来源:pagesMod.class.php
示例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();
}
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:24,代码来源:ArticleController.class.php
示例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;
}
开发者ID:JamesKid,项目名称:teach,代码行数:23,代码来源:jumpMod.class.php
示例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;
}
开发者ID:pf5512,项目名称:ViciEctouch,代码行数:46,代码来源:ArticleBaseModel.class.php
示例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'));
}
开发者ID:sayi21cn,项目名称:ecshopAndEctouch,代码行数:38,代码来源:BrandController.class.php
示例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';
开发者ID:WanTeDy,项目名称:true_story,代码行数:31,代码来源:index.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>
开发者ID:WanTeDy,项目名称:true_story,代码行数:30,代码来源:chat.select.php
示例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 ";
//.........这里部分代码省略.........
开发者ID:JamesKid,项目名称:teach,代码行数:101,代码来源:expand_modelModel.class.php
示例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>
开发者ID:WanTeDy,项目名称:true_story,代码行数:31,代码来源:login.html.php
示例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>
开发者ID:WanTeDy,项目名称:true_story,代码行数:31,代码来源:reg.html.php
示例16: index
public function index()
{
$aid = intval($_GET['aid']);
if (empty($aid)) {
$this->error404();
}
$info = model('content')->info($aid);
if (!is_array($info) || $info['status'] == 0) {
$this->error404();
}
//判断跳转
if (!empty($info['url'])) {
$link = $this->display(html_out($info['url']), true, false);
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $link . "");
exit;
}
//查询栏目的信息
$this->category = model('category')->info($info['cid']);
//模块自动纠正
model('content')->model_jump($this->category['mid'], 'content');
$model_info = model('category')->model_info($this->category['mid']);
//位置导航
$this->nav = array_reverse(model('category')->nav($this->category['cid']));
//查询上级栏目信息
$this->parent_category = model('category')->info($this->category['pid']);
if (!$this->parent_category) {
$this->parent_category = array("cid" => "0", "pid" => "0", "mid" => "0", "name" => "无上级栏目");
}
//获取顶级栏目信息
$this->top_category = model('category')->info($this->nav[0]['cid']);
//读取完整内容信息
$info = model('content')->model_content($info['aid'], $this->category['expand']);
//更新访问计数
model('content')->views_content($info['aid'], $info['views']);
//读取内容信息
$info_content = model('content')->info_content($info['aid']);
if (empty($info_content['content'])) {
$info_content['content'] = '暂无内容';
}
$content = $info_content['content'];
//读取内容替换
if (!empty($content)) {
$content = model('content')->format_content($content);
}
//自动增加TAG链接
if (!empty($content) && $info['taglink']) {
$content = model('content')->tag_link($content, $info['aid']);
}
//MEDIA信息
$this->common = model('pageinfo')->media($info['title'] . ' - ' . $this->category['name'], $info['keywords'], $info['description']);
//内容分页
$url = model('content')->url_format($model_info['url_content_page'], $aid, $this->category['urlname'], $info);
$page = new Page();
$content = $page->contentPage(html_out($content), "<hr class=\"ke-pagebreak\" />", $url, 10, 4);
//文章分页
$info['content'] = $content['content'];
$this->page = $content['page'];
/*hook*/
$this->plus_hook('content', 'index', $this->info);
$this->info = $this->plus_hook_replace('content', 'index_replace', $this->info);
/*hook end*/
$this->info = $info;
//上下篇
$prev = model('content')->prev_content($aid, $this->category['cid'], $this->category['expand']);
$this->assign('prev', $prev);
//下一篇
$next = model('content')->next_content($aid, $this->category['cid'], $this->category['expand']);
$this->assign('next', $next);
if (empty($info['tpl'])) {
$this->display($this->category['content_tpl']);
} else {
$this->display($info['tpl']);
}
}
开发者ID:JamesKid,项目名称:teach,代码行数:75,代码来源:contentMod.class.php
示例17: del
/**
* 删除专题
*/
public function del()
{
$id = I('id');
if (!$id) {
$this->redirect(url('index'));
}
/* 删除该品牌的图标 */
$topic = $this->model->table('touch_topic')->field('*')->where('topic_id = ' . $id)->find();
$topic_img = $topic['topic_img'];
$title_pic = $topic['title_pic'];
$intro = html_out($topic['intro']);
//删除编辑器中的附件
$match = array();
preg_match_all("/(src|href)\\=\"\\/(.*?)\"/i", $intro, $match);
if (is_array($match[2])) {
foreach ($match[2] as $vo) {
$index = strpos($vo, 'data/');
@unlink(ROOT_PATH . substr($vo, $index));
}
}
//删除logo
if (!empty($topic_img)) {
$index = strpos($topic_img, 'data/');
@unlink(ROOT_PATH . substr($topic_img, $index));
}
//删除分类图标
if (!empty($title_pic)) {
$index = strpos($title_pic, 'data/');
@unlink(ROOT_PATH . substr($title_pic, $index));
}
//删除品牌
$this->model->table('touch_topic')->where(array('topic_id' => $id))->delete();
clear_all_files();
$this->message(L('succed'), url('index'));
}
开发者ID:noikiy,项目名称:shop-3,代码行数:38,代码来源:TopicController.class.php
示例18: view_list
//.........这里部分代码省略.........
$links = "";
$input['orderby'] = isset($input['orderby']) ? $input['orderby'] : '';
//$cond = ''; //experiment
$who = isset($input['who']) ? (int) $input['who'] : 0;
$user = isset($input['user']) ? $input['user'] : 0;
$first = isset($input['page']) ? intval($input['page']) : 0;
$cond = $who ? "r.whoadded=" . sqlesc($who) : '';
$start = isset($input['startstamp']) ? intval($input['startstamp']) : mktime(0, 0, 0, $input['start']['month'], $input['start']['day'], $input['start']['year']) + $time_offset;
$end = isset($input['endstamp']) ? intval($input['endstamp']) : mktime(0, 0, 0, $input['end']['month'], $input['end']['day'] + 1, $input['end']['year']) + $time_offset;
if (!$start) {
$start = time() - 3600 * 24 * 30;
}
if (!$end) {
$end = time();
}
if ($start >= $end) {
stderr('Time', 'Start date is after the end date.');
}
if (!empty($input['leftby'])) {
$left_b = @mysql_query("SELECT id FROM users WHERE username = " . sqlesc($input['leftby']));
if (!mysql_num_rows($left_b)) {
stderr('DB ERROR', 'Could not find user ' . htmlentities($input['leftby'], ENT_QUOTES));
}
$leftby = mysql_fetch_assoc($left_b);
$who = $leftby['id'];
$cond = "r.whoadded=" . $who;
}
if (!empty($input['leftfor'])) {
$left_f = @mysql_query("SELECT id FROM users WHERE username = " . sqlesc($input['leftfor']));
if (!mysql_num_rows($left_f)) {
stderr('DB ERROR', 'Could not find user ' . htmlentities($input['leftfor'], ENT_QUOTES));
}
$leftfor = mysql_fetch_assoc($left_f);
$user = $leftfor['id'];
$cond .= ($cond ? " AND" : "") . " r.userid=" . $user;
}
if ($start) {
$cond .= ($cond ? " AND" : "") . " r.dateadd >= {$start}";
}
if ($end) {
$cond .= ($cond ? " AND" : "") . " r.dateadd <= {$end}";
}
switch ($input['orderby']) {
case 'leftbyuser':
$order = 'leftby.username';
$orderby = 'leftbyuser';
break;
case 'leftforuser':
$order = 'leftfor.username';
$orderby = 'leftforuser';
break;
default:
$order = 'r.dateadd';
$orderby = 'dateadd';
}
$css = "style='font-weight: bold;color: #ffffff;background-color: #0055A4;padding: 5px;'";
$html = "<h2>Reputation Comments</h2>";
$table_header = "<table width='80%' cellpadding='5' border='1'><tr {$css}>";
$table_header .= "<td width='5%'>ID</td>";
$table_header .= "<td width='20%><a href='reputation_ad.php?mode=list&dolist=1&who=" . intval($who) . "&user=" . intval($user) . "&orderby=leftbyuser&startstamp={$start}&endstamp={$end}&page={$first}'>Left By</a></td>";
$table_header .= "<td width='20%'><a href='reputation_ad.php?mode=list&dolist=1&who=" . intval($who) . "&user=" . intval($user) . "&orderby=leftforuser&startstamp={$start}&endstamp={$end}&page={$first}'>Left For</a></td>";
$table_header .= "<td width='17%'><a href='reputation_ad.php?mode=list&dolist=1&who=" . intval($who) . "&user=" . intval($user) . "&orderby=date&startstamp={$start}&endstamp={$end}&page={$first}'>Date</a></td>";
$table_header .= "<td width='5%'>Point</td>";
$table_header .= "<td width='23%'>Reason</td>";
$table_header .= "<td width='10%'>Controls</td></tr>";
$html .= $table_header;
// do the count for pager etc
$query = mysql_query("SELECT COUNT(*) AS cnt FROM reputation r WHERE {$cond}");
//print_r($input); exit;
$total = mysql_fetch_assoc($query);
if (!$total['cnt']) {
$html .= "<tr><td colspan='7' align='center'>No Matches Found!</td></tr>";
}
// do the pager thang!
$deflimit = 10;
$links = "<span style=\"background: #F0F5FA; border: 1px solid #072A66;padding: 1px 3px 1px 3px;\">{$total['cnt']} Records</span>";
if ($total['cnt'] > $deflimit) {
require_once "include/pager_alternative.php";
$links = pager(array('TOTAL_POSS' => $total['cnt'], 'PER_PAGE' => $deflimit, 'CUR_ST_VAL' => $first, 'L_SINGLE' => "", 'BASE_URL' => "reputation_ad.php?mode=list&dolist=1&who=" . intval($who) . "&user=" . intval($user) . "&orderby={$orderby}&startstamp={$start}&endstamp={$end}"));
}
// mofo query!
$query = mysql_query("SELECT r.*, p.topicid, leftfor.id as leftfor_id, \r\n\t\t\t\t\t\t\t\t\tleftfor.username as leftfor_name, leftby.id as leftby_id, \r\n\t\t\t\t\t\t\t\t\tleftby.username as leftby_name \r\n\t\t\t\t\t\t\t\t\tFROM reputation r \r\n\t\t\t\t\t\t\t\t\tleft join posts p on p.id=r.postid \r\n\t\t\t\t\t\t\t\t\tleft join users leftfor on leftfor.id=r.userid \r\n\t\t\t\t\t\t\t\t\tleft join users leftby on leftby.id=r.whoadded \r\n\t\t\t\t\t\t\t\t\tWHERE {$cond} ORDER BY {$order} LIMIT {$first},{$deflimit}");
if (!mysql_num_rows($query)) {
stderr('DB ERROR', 'Nothing here');
}
while ($r = mysql_fetch_assoc($query)) {
$r['dateadd'] = date("M j, Y, g:i a", $r['dateadd']);
$html .= "<tr><td>#{$r['reputationid']}</td>";
$html .= "<td><a href='userdetails.php?id={$r['leftby_id']}' target='_blank'>{$r['leftby_name']}</a></td>";
$html .= "<td><a href='userdetails.php?id={$r['leftfor_id']}' target='_blank'>{$r['leftfor_name']}</a></td>";
$html .= "<td>{$r['dateadd']}</td>";
$html .= "<td align='right'>{$r['reputation']}</td>";
$html .= "<td><a href='forums.php?action=viewtopic&topicid={$r['topicid']}&page=p{$r['postid']}#{$r['postid']}' target='_blank'>{$r['reason']}</a></td>";
$html .= "<td><span class='btn'><a href='reputation_ad.php?mode=editrep&reputationid={$r['reputationid']}'>Edit</a></span> <span class='btn'><a href='reputation_ad.php?mode=dodelrep&reputationid={$r['reputationid']}'>Dele
|
请发表评论