本文整理汇总了PHP中encode_output函数的典型用法代码示例。如果您正苦于以下问题:PHP encode_output函数的具体用法?PHP encode_output怎么用?PHP encode_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encode_output函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($cat_goods['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
//$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>";
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']));
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'category.php?c_id=' . $c_id, 'page');
$smarty->assign('pagebar', $pagebar);
}
$pcat_array = get_parent_cats($c_id);
if (!empty($pcat_array[1]['cat_name'])) {
$pcat_array[1]['cat_name'] = encode_output($pcat_array[1]['cat_name']);
$smarty->assign('pcat_array', $pcat_array[1]);
}
$smarty->assign('footer', get_footer());
$smarty->display('category.wml');
示例2: get_wap_pager
/**
* wap分页函数
*
* @access public
* @param int $num 总记录数
* @param int $perpage 每页记录数
* @param int $curr_page 当前页数
* @param string $mpurl 传入的连接地址
* @param string $pvar 分页变量
*/
function get_wap_pager($num, $perpage, $curr_page, $mpurl, $pvar)
{
$multipage = '';
if ($num > $perpage) {
$page = 2;
$offset = 1;
$pages = ceil($num / $perpage);
$all_pages = $pages;
$tmp_page = $curr_page;
$setp = strpos($mpurl, '?') === false ? "?" : '&';
if ($curr_page > 1) {
$multipage .= "<a href=\"{$mpurl}{$setp}{$pvar}=" . ($curr_page - 1) . "\">上一页</a>";
}
$multipage .= $curr_page . "/" . $pages;
if ($curr_page++ < $pages) {
$multipage .= "<a href=\"{$mpurl}{$setp}{$pvar}=" . $curr_page++ . "\">下一页</a><br/>";
}
//$multipage .= $pages > $page ? " ... <a href=\"$mpurl&$pvar=$pages\"> [$pages] >></a>" : " 页/".$all_pages."页";
$url_array = explode("?", $mpurl);
$field_str = "";
if (isset($url_array[1])) {
$filed_array = explode("&", $url_array[1]);
if (count($filed_array) > 0) {
foreach ($filed_array as $data) {
$value_array = explode("=", $data);
$field_str .= "<postfield name='" . $value_array[0] . "' value='" . encode_output($value_array[1]) . "'/>\n";
}
}
}
$multipage .= "跳转到第<input type='text' name='pageno' format='*N' size='4' value='' maxlength='2' emptyok='true' />页<anchor>[GO]<go href='{$url_array[0]}' method='get'>{$field_str}<postfield name='" . $pvar . "' value='\$(pageno)'/></go></anchor>";
//<postfield name='snid' value='".session_id()."'/>
}
return $multipage;
}
示例3: show_user_center
/**
* 用户中心显示
*/
function show_user_center()
{
$best_goods = get_recommend_goods('best');
if (count($best_goods) > 0) {
foreach ($best_goods as $key => $best_data) {
$best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']);
$best_goods[$key]['name'] = encode_output($best_data['name']);
}
}
$GLOBALS['smarty']->assign('best_goods', $best_goods);
$GLOBALS['smarty']->display('user.wml');
}
示例4: intval
$num = $comment['pager']['record_count'];
if ($num > 0) {
$page_num = '5';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($comment['comments'] as $key => $data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$re_content = !empty($data['re_content']) ? encode_output($data['re_content']) : '';
$re_username = !empty($data['re_username']) ? encode_output($data['re_username']) : '';
$re_add_time = !empty($data['re_add_time']) ? substr($data['re_add_time'], 5, 14) : '';
$comment_data[] = array('i' => $i, 'content' => encode_output($data['content']), 'username' => encode_output($data['username']), 'add_time' => substr($data['add_time'], 5, 14), 're_content' => $re_content, 're_username' => $re_username, 're_add_time' => $re_add_time, 'comment_rank' => $data['rank'] / 5 * 100);
}
$i++;
}
$smarty->assign('comment_data', $comment_data);
$pagebar = get_wap_pager($num, $page_num, $page, 'comment.php?g_id=' . $goods_id, 'page');
$smarty->assign('pagebar', $pagebar);
}
$smarty->assign('footer', get_footer());
$smarty->display('comment.dwt');
}
示例5: intval
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($article_num / $page_num);
if ($page <= 0)
{
$page = 1;
}
if ($pages == 0)
{
$pages = 1;
}
if ($page > $pages)
{
$page = $pages;
}
$pagebar = get_wap_pager($article_num, $page_num, $page, 'article.php', 'page');
$smarty->assign('pagebar', $pagebar);
include_once(ROOT_PATH . '/includes/lib_article.php');
$article_array = get_cat_articles(-1, $page, $page_num);
$i = 1;
foreach ($article_array as $key => $article_data)
{
$article_array[$key]['i'] = $i;
$article_array[$key]['title'] = encode_output($article_data['title']);
$i++;
}
$smarty->assign('article_array', $article_array);
}
$smarty->display('article_list.html');
}
?>
示例6: ceil
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($sort_array as $goods_key) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods[$goods_key]['promote_price_org']) ? $goods[$goods_key]['shop_price'] : $goods[$goods_key]['promote_price'];
//$wml_data .= "<a href='goods.php?id={}'>".encode_output($goods[$goods_key]['name'])."</a>[".encode_output($price)."]<br/>";
$goods_data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods[$goods_key]['id'], 'name' => encode_output($goods[$goods_key]['name']));
}
$i++;
}
$smarty->assign('goods_data', $goods_data);
$pagebar = get_wap_pager($num, $page_num, $page, 'goods_list.php?type=' . $type . '&order_price=' . (empty($order_price) ? 0 : $order_price), 'page');
$smarty->assign('pagebar', $pagebar);
}
$smarty->assign('footer', get_footer());
$smarty->display('goods_list.html');
/**
* 获得推荐商品
*
* @access public
* @param string $type 推荐类型,可以是 best, new, hot
* @param string $order_rule 指定商品排序规则
示例7: define
<?php
/**
* ECSHOP 分类聚合页
* ============================================================================
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。
* ============================================================================
* $Author: liuhui $
* $Id: index.php 15013 2010-03-25 09:31:42Z liuhui $
*/
define('IN_ECS', true);
define('ECS_ADMIN', true);
require dirname(__FILE__) . '/includes/init.php';
$pcat_array = get_categories_tree();
foreach ($pcat_array as $key => $pcat_data) {
$pcat_array[$key]['name'] = encode_output($pcat_data['name']);
if ($pcat_data['cat_id']) {
foreach ($pcat_data['cat_id'] as $k => $v) {
$pcat_array[$key]['cat_id'][$k]['name'] = encode_output($v['name']);
}
}
}
$smarty->assign('pcat_array', $pcat_array);
$smarty->assign('wap_logo', $_CFG['wap_logo']);
$smarty->assign('footer', get_footer());
$smarty->display("cat_all.html");
示例8: encode_output
if ($act == 'view_img') {
$smarty->display('goods_img.html');
exit;
}
/* 检查是否有商品品牌 */
if (!empty($goods_info['brand_id'])) {
$brand_name = $db->getOne("SELECT brand_name FROM " . $ecs->table('brand') . " WHERE brand_id={$goods_info['brand_id']}");
$smarty->assign('brand_name', encode_output($brand_name));
}
/* 显示分类名称 */
$cat_array = get_parent_cats($goods_info['cat_id']);
krsort($cat_array);
$cat_str = '';
foreach ($cat_array as $key => $cat_data) {
$cat_array[$key]['cat_name'] = encode_output($cat_data['cat_name']);
$cat_str .= "<a href='category.php?c_id={$cat_data['cat_id']}'>" . encode_output($cat_data['cat_name']) . "</a>->";
}
$smarty->assign('cat_array', $cat_array);
$properties = get_goods_properties($goods_id);
// 获得商品的规格和属性
$smarty->assign('specification', $properties['spe']);
// 商品规格
$comment = assign_comment($goods_id, 0);
$smarty->assign('comment', $comment);
$smarty->display('goods.html');
/**
* 获得指定商品的各会员等级对应的价格
*
* @access public
* @param integer $goods_id
* @return array
示例9: foreach
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($brands_array['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']), 'thumb' => $goods_data['thumb'], 'goods_img' => $goods_data['goods_img']);
// 10:34 2013-7-27
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'brands.php?b_id=' . $b_id . '&sort=' . (empty($get_sort) ? 0 : $get_sort) . '&order=' . (empty($get_order) ? 0 : $get_order), 'page');
$smarty->assign('pagebar', $pagebar);
}
}
$brands_array = get_brands();
if (count($brands_array) > 1) {
foreach ($brands_array as $key => $brands_data) {
$brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']);
}
$smarty->assign('brand_id', $b_id);
$smarty->assign('other_brands', $brands_array);
}
$smarty->assign('sort', $get_sort);
$smarty->assign('order', $get_order);
$smarty->assign('footer', get_footer());
$smarty->display('brands.dwt');
示例10: ceil
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($sort_array as $goods_key) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = !empty($goods[$goods_key]['promote_price']) ? $goods[$goods_key]['promote_price'] : $goods[$goods_key]['shop_price'];
//$wml_data .= "<a href='goods.php?id={}'>".encode_output($goods[$goods_key]['name'])."</a>[".encode_output($price)."]<br/>";
$goods_data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods[$goods_key]['id'], 'name' => encode_output($goods[$goods_key]['name']), 'thumb' => $goods[$goods_key]['thumb'], 'goods_img' => $goods[$goods_key]['goods_img']);
//16:43 2013-07-16
}
$i++;
}
$smarty->assign('goods_data', $goods_data);
$pagebar = get_wap_pager($num, $page_num, $page, 'goods_list.php?type=' . $type . '&sort=' . (empty($get_sort) ? 0 : $get_sort) . '&order=' . (empty($get_order) ? 0 : $get_order), 'page');
$smarty->assign('pagebar', $pagebar);
}
$smarty->assign('sort', $get_sort);
$smarty->assign('order', $get_order);
$smarty->assign('footer', get_footer());
$smarty->display('goods_list.dwt');
/**
* 获得推荐商品
*
示例11: show_user_center
/**
* 用户中心显示
*/
function show_user_center()
{
include_once ROOT_PATH . 'includes/lib_clips.php';
$best_goods = get_recommend_goods('best');
if (count($best_goods) > 0) {
foreach ($best_goods as $key => $best_data) {
$best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']);
$best_goods[$key]['name'] = encode_output($best_data['name']);
}
}
//22:18 2013-7-16
$rank_name = $GLOBALS['db']->getOne('SELECT rank_name FROM ' . $GLOBALS['ecs']->table('user_rank') . ' WHERE rank_id = ' . $_SESSION['user_rank']);
$GLOBALS['smarty']->assign('info', get_user_default($_SESSION['user_id']));
$GLOBALS['smarty']->assign('rank_name', $rank_name);
$GLOBALS['smarty']->assign('user_info', get_user_info());
$GLOBALS['smarty']->assign('best_goods', $best_goods);
$GLOBALS['smarty']->assign('footer', get_footer());
$GLOBALS['smarty']->display('user.dwt');
}
示例12: define
* $Author: liubo $
* $Id: article.php 16455 2009-07-13 09:57:19Z liubo $
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
$act = !empty($_GET['act']) ? $_GET['act'] : '';
if (!function_exists("htmlspecialchars_decode")) {
function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT)
{
return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
}
}
/* 文章详细 */
if ($act == 'detail') {
$a_id = !empty($_GET['a_id']) ? intval($_GET['a_id']) : '';
if ($a_id > 0) {
$article_row = $db->getRow('SELECT title, content FROM ' . $ecs->table('article') . ' WHERE article_id = ' . $a_id . ' AND cat_id <0 AND is_open = 1');
if (!empty($article_row)) {
$article_row['title'] = encode_output($article_row['title']);
$replace_tag = array('<br />', '<br/>', '<br>', '</p>');
$article_row['content'] = htmlspecialchars_decode(encode_output($article_row['content']));
$smarty->assign('article_row', $article_row);
}
}
$smarty->display('agreement.html');
}
/**手机注册提示成功**/
if ($act == 'tips') {
$article_row['title'] = "注册成功";
$smarty->display('tips.html');
}
示例13: ecs_header
if (!empty($Loaction)) {
ecs_header("Location: {$Loaction}\n");
exit;
}
}
$smarty->assign('page_title', $_CFG['shop_title']);
// 页面标题
$sql = 'SELECT * FROM ' . $ecs->table('mobile_ad');
$result = $db->getAll($sql);
$smarty->assign('playerdb', $result);
mobile_common();
/* 热门商品 */
$hot_goods = get_recommend_goods('hot');
$hot_num = count($hot_goods);
$smarty->assign('hot_num', $hot_num);
if ($hot_num > 0) {
$i = 0;
foreach ($hot_goods as $key => $hot_data) {
$hot_goods[$key]['shop_price'] = encode_output($hot_data['shop_price']);
$hot_goods[$key]['name'] = encode_output($hot_data['name']);
/*if ($i > 2)
{
break;
}*/
++$i;
}
$smarty->assign('hot_goods', $hot_goods);
}
$smarty->assign('wap_logo', $_CFG['wap_logo']);
$smarty->assign('footer', get_footer());
$smarty->display('index.dwt');
示例14: order_list
function order_list()
{
include_once ROOT_PATH . 'includes/lib_transaction.php';
$record_count = $GLOBALS['db']->getOne('SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = {$_SESSION['user_id']}");
if ($record_count > 0) {
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($record_count / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$pagebar = get_wap_pager($record_count, $page_num, $page, 'user.php', 'page');
$GLOBALS['smarty']->assign('pagebar', $pagebar);
/* 订单状态 */
$_LANG['os'][OS_UNCONFIRMED] = '未确认';
$_LANG['os'][OS_CONFIRMED] = '已确认';
$_LANG['os'][OS_SPLITED] = '已确认';
$_LANG['os'][OS_SPLITING_PART] = '已确认';
$_LANG['os'][OS_CANCELED] = '已取消';
$_LANG['os'][OS_INVALID] = '无效';
$_LANG['os'][OS_RETURNED] = '退货';
$_LANG['ss'][SS_UNSHIPPED] = '未发货';
$_LANG['ss'][SS_PREPARING] = '配货中';
$_LANG['ss'][SS_SHIPPED] = '已发货';
$_LANG['ss'][SS_RECEIVED] = '收货确认';
$_LANG['ss'][SS_SHIPPED_PART] = '已发货(部分商品)';
$_LANG['ss'][SS_SHIPPED_ING] = '配货中';
// 已分单
$_LANG['ps'][PS_UNPAYED] = '未付款';
$_LANG['ps'][PS_PAYING] = '付款中';
$_LANG['ps'][PS_PAYED] = '已付款';
$_LANG['cancel'] = '取消订单';
$_LANG['pay_money'] = '付款';
$_LANG['view_order'] = '查看订单';
$_LANG['received'] = '确认收货';
$_LANG['ss_received'] = '已完成';
$_LANG['confirm_received'] = '你确认已经收到货物了吗?';
$_LANG['confirm_cancel'] = '您确认要取消该订单吗?取消后此订单将视为无效订单';
$orders = get_user_orders($_SESSION['user_id'], $page_num, $page_num * ($page - 1));
//var_dump($orders);
if (!empty($orders)) {
foreach ($orders as $key => $val) {
$orders[$key]['total_fee'] = encode_output($val['total_fee']);
}
}
//$merge = get_user_merge($_SESSION['user_id']);
$GLOBALS['smarty']->assign('orders', $orders);
}
}