本文整理汇总了PHP中str_cut函数的典型用法代码示例。如果您正苦于以下问题:PHP str_cut函数的具体用法?PHP str_cut怎么用?PHP str_cut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了str_cut函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: text2html
public static function text2html($string, $cutlen = false)
{
if (intval($cutlen) > 0) {
$string = str_cut($string, $cutlen);
}
return nl2br(str_replace(' ', ' ', self::new_htmlspecialchars($string)));
}
开发者ID:houhaitao,项目名称:hthoularavel,代码行数:7,代码来源:GlobalTools.php
示例2: addart
function addart($catid, $title, $content)
{
$info = array();
$info['catid'] = 3;
$info['title'] = "api push";
$info['content'] = "absolutelu api push";
$db_config = pc_base::load_config('database');
pc_base::load_sys_class('mysql', '', 0);
pc_base::load_sys_class('param', '', 0);
$db = pc_base::load_model('content_model');
$categorys = getcache('category_content_1', 'commons');
$category = $categorys[3];
//var_dump($categorys);
$modelid = $category['modelid'];
//var_dump($modelid);
//die;
$db->set_model($modelid);
$setting = string2array($category['setting']);
$workflowid = $setting['workflowid'];
$info['status'] = 99;
$info['keywords'] = "";
$info['description'] = str_cut(str_replace(array("\r\n", "\t", '[page]', '[/page]', '“', '”', ' '), '', strip_tags($info['content'])), 200);
$info['username'] = "sumuya";
$info['inputtime'] = '';
echo "1";
if ($db->add_content($info)) {
return true;
}
return false;
}
开发者ID:baowzh,项目名称:fulianweb,代码行数:30,代码来源:testpush.php
示例3: post_query
function post_query($col)
{
include 'conn.php';
// Get the number of row of a table
$sql = "SELECT count(id) FROM blog";
$query = mysqli_query($conn, $sql);
$row = mysqli_fetch_row($query);
// Catch the session variable from another page
$n = $_SESSION['var'];
for ($i = 1; $i <= $row[0]; $i++) {
$sql = "SELECT * FROM blog where id = {$n} order by time asc";
// For query
$query = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($query);
if ($col == 'post_detail') {
str_cut($row['post_detail']);
break;
} elseif ($col == 'author') {
echo $row['author'];
break;
} elseif ($col == 'time') {
echo $row['time'];
break;
} elseif ($col == 'post_heading') {
echo $row['post_heading'];
break;
} elseif ($col == 'image') {
echo $row['image'];
break;
} elseif ($col == 'id') {
echo $row['id'];
break;
}
}
}
开发者ID:Amely228,项目名称:Portfolio,代码行数:35,代码来源:functions.php
示例4: addart
function addart($catid, $title, $content)
{
$info = array();
$info['catid'] = $catid;
$info['title'] = $title;
$info['content'] = $content;
$db_config = pc_base::load_config('database');
pc_base::load_sys_class('mysql', '', 0);
pc_base::load_sys_class('param', '', 0);
$db = pc_base::load_model('content_model');
$category = $categorys[3];
$modelid = $category['modelid'];
$db->set_model($modelid);
$setting = string2array($category['setting']);
$workflowid = $setting['workflowid'];
$info['status'] = 99;
$info['keywords'] = get_keywords($info['title'], 3);
$info['description'] = str_cut(str_replace(array("\r\n", "\t", '[page]', '[/page]', '“', '”', ' '), '', strip_tags($info['content'])), 200);
$info['username'] = "admin";
$info['inputtime'] = '';
if ($db->add_content($info)) {
return true;
}
return false;
}
开发者ID:baowzh,项目名称:fulianweb,代码行数:25,代码来源:xpush.php
示例5: search
public function search()
{
$title = safe_replace($_GET['title']);
if (CHARSET == 'gbk') {
$title = iconv('utf-8', 'gbk', $title);
}
$where = '`status`=21';
if ($title) {
$where .= ' AND `title` LIKE \'%' . $title . '%\'';
}
$userupload = intval($_GET['userupload']);
if ($userupload) {
$where .= ' AND `userupload`=1';
}
$page = $_GET['page'];
$pagesize = 6;
$infos = $this->db->listinfo($where, 'videoid DESC', $page, $pagesize);
$number = $this->db->number;
$pages = $this->pages($number, $page, $pagesize, 4, 'get_videoes');
if (is_array($infos) && !empty($infos)) {
$html = '';
foreach ($infos as $info) {
$html .= '<li><div class="w9"><a href="javascript:void(0);" onclick="a_click(this);" title="' . $info['title'] . '" data-vid="' . $info['vid'] . '" ><span></span><img src="' . $info['picpath'] . '" width="90" height="51" /></a><p>' . str_cut($info['title'], 18) . '</p></div></li>';
}
}
$data['pages'] = $pages;
$data['html'] = $html;
if (CHARSET == 'gbk') {
$data = array_iconv($data, 'gbk', 'utf-8');
}
exit(json_encode($data));
}
开发者ID:shenhua4286,项目名称:gxw,代码行数:32,代码来源:video_for_ck.php
示例6: get
function get($data, $isimport = 0)
{
$this->data = $data = trim_script($data);
$info = array();
foreach ($data as $field => $value) {
if (!isset($this->fields[$field]) && !check_in($field, 'paytype,paginationtype,maxcharperpage,id')) {
continue;
}
$name = $this->fields[$field]['name'];
$minlength = $this->fields[$field]['minlength'];
$maxlength = $this->fields[$field]['maxlength'];
$pattern = $this->fields[$field]['pattern'];
$errortips = $this->fields[$field]['errortips'];
if (empty($errortips)) {
$errortips = $name . ' 不符合要求';
}
$length = empty($value) ? 0 : (is_string($value) ? strlen($value) : count($value));
if ($minlength && $length < $minlength) {
if ($isimport) {
return false;
} else {
showmessage($name . ' 不得少于 ' . $minlength . ' 字符');
}
}
if ($maxlength && $length > $maxlength) {
if ($isimport) {
$value = str_cut($value, $maxlength, '');
} else {
showmessage($name . ' 不得多于 ' . $maxlength . ' 字符');
}
} elseif ($maxlength) {
$value = str_cut($value, $maxlength, '');
}
if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
showmessage($errortips);
}
// 唯一性判断,和附加函数验证
/*$MODEL = getcache('model', 'commons');
$this->db->table_name = $this->fields[$field]['issystem'] ? $this->db_pre.$MODEL[$this->modelid]['tablename'] : $this->db_pre.$MODEL[$this->modelid]['tablename'].'_data';
if($this->fields[$field]['isunique'] && $this->db->get_one(array($field=>$value),$field) && ROUTE_A != 'edit') showmessage($name.L('the_value_must_not_repeat'));*/
$func = $this->fields[$field]['formtype'];
if (method_exists($this, $func)) {
$value = $this->{$func}($field, $value);
}
// var_dump($this->fields);
if ($this->fields[$field]['issystem']) {
$info['system'][$field] = $value;
} else {
$info['model'][$field] = $value;
}
}
//颜色选择为隐藏域 在这里进行取值
$info['system']['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : '';
if ($_POST['style_font_weight']) {
$info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
}
return $info;
}
开发者ID:RocherKong,项目名称:518ESHOP,代码行数:58,代码来源:content_input.class.php
示例7: get
function get($data, $isimport = 0)
{
$this->data = $data = trim_script($data);
$info = array();
foreach ($data as $field => $value) {
//if(!isset($this->fields[$field]) || check_in($_roleid, $this->fields[$field]['unsetroleids']) || check_in($_groupid, $this->fields[$field]['unsetgroupids'])) continue;
$name = $this->fields[$field]['name'];
$minlength = $this->fields[$field]['minlength'];
$maxlength = $this->fields[$field]['maxlength'];
$pattern = $this->fields[$field]['pattern'];
$errortips = $this->fields[$field]['errortips'];
if (empty($errortips)) {
$errortips = $name . ' ' . L('not_meet_the_conditions');
}
$length = empty($value) ? 0 : strlen($value);
if ($minlength && $length < $minlength) {
if ($isimport) {
return false;
} else {
showmessage($name . ' ' . L('not_less_than') . ' ' . $minlength . L('characters'));
}
}
if ($maxlength && $length > $maxlength) {
if ($isimport) {
$value = str_cut($value, $maxlength, '');
} else {
showmessage($name . ' ' . L('not_more_than') . ' ' . $maxlength . L('characters'));
}
} elseif ($maxlength) {
$value = str_cut($value, $maxlength, '');
}
if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
showmessage($errortips);
}
$MODEL = getcache('model', 'commons');
$this->db->table_name = $this->fields[$field]['issystem'] ? $this->db_pre . $MODEL[$this->modelid]['tablename'] : $this->db_pre . $MODEL[$this->modelid]['tablename'] . '_data';
if ($this->fields[$field]['isunique'] && $this->db->get_one(array($field => $value), $field) && ROUTE_A != 'edit') {
showmessage($name . L('the_value_must_not_repeat'));
}
$func = $this->fields[$field]['formtype'];
if (method_exists($this, $func)) {
$value = $this->{$func}($field, $value);
}
if ($this->fields[$field]['issystem']) {
$info['system'][$field] = $value;
} else {
$info['model'][$field] = $value;
}
//颜色选择为隐藏域 在这里进行取值
$info['system']['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : '';
if ($_POST['style_font_weight']) {
$info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
}
}
return $info;
}
开发者ID:baowzh,项目名称:fulianweb,代码行数:56,代码来源:content_input.class.php
示例8: get
public function get($data, $isimport = 0)
{
$this->data = $data;
$info = array();
foreach ($data as $field => $value) {
$name = $this->fields[$field]['name'];
$minlength = $this->fields[$field]['minlength'];
$maxlength = $this->fields[$field]['maxlength'];
$pattern = $this->fields[$field]['pattern'];
$errortips = $this->fields[$field]['errortips'];
if (empty($errortips)) {
$errortips = $name . ' ' . L('not_meet_the_conditions');
}
$length = strlen($value);
if ($minlength && $length < $minlength) {
if ($isimport) {
return false;
} else {
showmessage($name . ' ' . L('not_less_than') . ' ' . $minlength . L('characters'));
}
}
if ($maxlength && $length > $maxlength) {
if ($isimport) {
$value = str_cut($value, $maxlength, '');
} else {
showmessage($name . ' ' . L('not_more_than') . ' ' . $maxlength . L('characters'));
}
} elseif ($maxlength) {
$value = str_cut($value, $maxlength, '');
}
if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
showmessage($errortips);
}
$MODEL = S('common/model');
$this->db->table_name = $this->fields[$field]['issystem'] ? $this->db_pre . $MODEL[$this->modelid]['tablename'] : $this->db_pre . $MODEL[$this->modelid]['tablename'] . '_data';
if ($this->fields[$field]['isunique'] && $this->db->where(array($field => $value))->field($field)->find() && ACTION != 'edit') {
showmessage($name . L('the_value_must_not_repeat'));
}
$func = $this->fields[$field]['formtype'];
if (method_exists($this, $func)) {
$value = $this->{$func}($field, $value);
}
if ($this->fields[$field]['issystem']) {
$info['system'][$field] = $value;
} else {
$info['model'][$field] = $value;
}
// 颜色选择为隐藏域 在这里进行取值
$info['system']['style'] = isset($_POST['style_color']) ? strip_tags($_POST['style_color']) : '';
if (isset($_POST['style_font_weight'])) {
$info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
}
}
return $info;
}
开发者ID:hubs,项目名称:yuncms,代码行数:55,代码来源:content_input.php
示例9: get
function get($data, $isimport = 0)
{
$this->data = $data = trim_script($data);
$info = array();
foreach ($this->fields as $field) {
//if(!isset($this->fields[$field]) || check_in($_roleid, $this->fields[$field]['unsetroleids']) || check_in($_groupid, $this->fields[$field]['unsetgroupids'])) continue;
$name = $field['name'];
$minlength = $field['minlength'];
$maxlength = $field['maxlength'];
$pattern = $field['pattern'];
$errortips = $field['errortips'];
$value = $data[$field['field']];
//if(empty($errortips)) $errortips = $name.' '.L('not_meet_the_conditions');
if (empty($errortips)) {
$errortips = "请输入正确的{$name}";
}
$length = is_array($value) ? empty($value) ? 0 : 1 : strlen($value);
if ($minlength && $length < $minlength) {
if ($isimport) {
return false;
} else {
showmessage($name . ' ' . L('not_less_than') . ' ' . $minlength . L('characters'));
}
}
if ($maxlength && $length > $maxlength) {
if ($isimport) {
$value = str_cut($value, $maxlength, '');
} else {
showmessage($name . ' ' . L('not_more_than') . ' ' . $maxlength . L('characters'));
}
} elseif ($maxlength) {
$value = str_cut($value, $maxlength, '');
}
if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
showmessage($errortips);
}
$func = $field['formtype'];
if (method_exists($this, $func)) {
$value = $this->{$func}($field['field'], $value);
}
$info[$field['field']] = $value;
//颜色选择为隐藏域 在这里进行取值
if ($_POST['style_color']) {
$info['style'] = $_POST['style_color'];
}
if ($_POST['style_font_weight']) {
$info['style'] = $info['style'] . ';' . strip_tags($_POST['style_font_weight']);
}
}
return $info;
}
开发者ID:shenhua4286,项目名称:gxw,代码行数:51,代码来源:formguide_input.class.php
示例10: get
function get($data, $isimport = 0)
{
$this->data = $data = trim_script($data);
$info = array();
foreach ($data as $field => $value) {
if (!isset($this->fields[$field]) && !check_in($field, 'paytype,paginationtype,maxcharperpage,id')) {
continue;
}
$name = $this->fields[$field]['name'];
$minlength = $this->fields[$field]['minlength'];
$maxlength = $this->fields[$field]['maxlength'];
$pattern = $this->fields[$field]['pattern'];
$errortips = $this->fields[$field]['errortips'];
if (empty($errortips)) {
$errortips = $name . ' 不符合要求';
}
$length = empty($value) ? 0 : (is_string($value) ? strlen($value) : count($value));
if ($minlength && $length < $minlength) {
if ($isimport) {
return false;
} else {
showmessage($name . ' 不得少于 ' . $minlength . ' 字符');
}
}
if ($maxlength && $length > $maxlength) {
if ($isimport) {
$value = str_cut($value, $maxlength, '');
} else {
showmessage($name . ' 不得多于 ' . $maxlength . ' 字符');
}
} elseif ($maxlength) {
$value = str_cut($value, $maxlength, '');
}
if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
showmessage($errortips);
}
// 附加函数验证
$func = $this->fields[$field]['formtype'];
if (method_exists($this, $func)) {
$value = $this->{$func}($field, $value);
}
$info['system'][$field] = $value;
}
//颜色选择为隐藏域 在这里进行取值
$info['system']['style'] = $_POST['style_color'] ? strip_tags($_POST['style_color']) : '';
if ($_POST['style_font_weight']) {
$info['system']['style'] = $info['system']['style'] . ';' . strip_tags($_POST['style_font_weight']);
}
return $info;
}
开发者ID:WALES7CH,项目名称:TP-Admin,代码行数:50,代码来源:content_input.class.php
示例11: get
function get($data)
{
$this->data = $data = trim_script($data);
$model_cache = getcache('member_model', 'commons');
$this->db->table_name = $this->db_pre . $model_cache[$this->modelid]['tablename'];
$info = array();
$debar_filed = array('catid', 'title', 'style', 'thumb', 'status', 'islink', 'description');
if (is_array($data)) {
foreach ($data as $field => $value) {
if ($data['islink'] == 1 && !in_array($field, $debar_filed)) {
continue;
}
$field = safe_replace($field);
$name = $this->fields[$field]['name'];
$minlength = $this->fields[$field]['minlength'];
$maxlength = $this->fields[$field]['maxlength'];
$pattern = $this->fields[$field]['pattern'];
$errortips = $this->fields[$field]['errortips'];
if (empty($errortips)) {
$errortips = "{$name} 不符合要求!";
}
$length = empty($value) ? 0 : strlen($value);
if ($minlength && $length < $minlength && !$isimport) {
showmessage("{$name} 不得少于 {$minlength} 个字符!");
}
if (!array_key_exists($field, $this->fields)) {
showmessage('模型中不存在' . $field . '字段');
}
if ($maxlength && $length > $maxlength && !$isimport) {
showmessage("{$name} 不得超过 {$maxlength} 个字符!");
} else {
str_cut($value, $maxlength);
}
if ($pattern && $length && !preg_match($pattern, $value) && !$isimport) {
showmessage($errortips);
}
if ($this->fields[$field]['isunique'] && $this->db->get_one(array($field => $value), $field) && ROUTE_A != 'edit') {
showmessage("{$name} 的值不得重复!");
}
$func = $this->fields[$field]['formtype'];
if (method_exists($this, $func)) {
$value = $this->{$func}($field, $value);
}
$info[$field] = $value;
}
}
return $info;
}
开发者ID:pondyond,项目名称:phpcmsv9,代码行数:48,代码来源:member_input.class.php
示例12: index
public function index()
{
$model = M('Article');
$data['status'] = 1;
$count = $model->where($data)->count();
$page_size = $_REQUEST['page_size'] ? $_REQUEST['page_size'] : C('default_page_size');
$page_count = ceil($count / $page_size);
$pageno = 1;
$offset = ($pageno - 1) * $page_size;
$voList = $model->field('id,title,content,litpic,create_time')->where($data)->limit($offset . ',' . $page_size)->select();
foreach ($voList as $key => $val) {
$voList[$key]['content'] = str_cut(htmlspecialchars_decode($val['content']), 45);
}
$list['count'] = $count;
$list['page_count'] = $page_count;
$list['data'] = $voList;
echo json_encode($list);
exit;
}
开发者ID:8yong8,项目名称:vshop,代码行数:19,代码来源:ArticleAction.class.php
示例13: joy
function joy($id)
{
$session_id = "joy_src" . $id;
$src = $_SESSION[$session_id];
if (empty($src)) {
//注意msxv5v2可能是个验证值,以后可能会变更,将导致无法获取
$url = "http://msx.app.joy.cn/service.php?action=msxv5v2&playertype=joyplayer&videoid=" . $id;
$str = get_data($url);
if ($str) {
$s1 = str_cut($str, "<HostPath", "/HostPath>");
$s11 = str_cut($s1, ">", "<");
$s2 = str_cut($str, "<Url", "</Url>");
$s21 = str_cut($s2, "<![CDATA[", "]]>");
$src = $s11 . $s21;
//echo $src;
$_SESSION[$session_id] = $src;
}
}
return $src;
}
开发者ID:wangyoukun,项目名称:cmp,代码行数:20,代码来源:cmp4proxy.php
示例14: autoHookHead
function autoHookHead(&$style, $isReply)
{
global $PIO, $FileIO;
if ($isReply) {
$p = $PIO->fetchPosts($isReply);
$sub = $p[0]['sub'];
$com = htmlentities(str_cut($p[0]['com'], 100), ENT_QUOTES, 'UTF-8');
$thumb = '';
if ($p[0]['ext'] != '') {
$thumb = $FileIO->resolveThumbName($p[0]['tim']);
// 檢查是否有預覽圖可以顯示
$thumb = $thumb ? $FileIO->getImageURL($thumb) : '';
}
$style .= <<<_HERE_
<meta property="og:image" content="{$thumb}" />
<meta property="og:title" content="{$sub} - {$this->site}" />
<meta property="og:description" content="{$com}" />
_HERE_;
}
}
开发者ID:Kennyl,项目名称:pixmicat_modules,代码行数:21,代码来源:mod_plusone.php
示例15: new_age
function new_age()
{
$msg = M('Message');
$limit = $_POST['limit'];
$current = I('get.page', 1);
$art = ($current - 1) * $limit;
$url = get_url();
//获取当前页面的URL地址
$fir = strpos($url, 'page');
if ($fir) {
$purl = mb_substr($url, 0, $fir - 1);
} else {
$purl = $url;
}
$count = $msg->count();
$show = list_page($current, $limit, $count, $purl);
$msg = $msg->order('msg_addtime DESC')->limit($art, $limit)->select();
foreach ($msg as $key => $val) {
$msg[$key]['msg_ctitle'] = str_cut($val['msg_content'], 0, 21);
}
$data = array('msg' => $msg, 'show' => $show);
echo json_encode($data);
}
开发者ID:994724435,项目名称:Diao,代码行数:23,代码来源:MessageController.class.php
示例16: index
/**
* 证书列表、搜索列表
* @author Martin.Cheng <[email protected]>
*/
public function index()
{
$where = array();
$field = array();
$order = 'create_time desc';
$word_form = I('post.w') ? I('post.w') : I('get.w');
//获取查询字
$word_form ? $where['full_name|description'] = array('like', "%" . $word_form . "%") : '';
//生成数据库查询条件
$where = !empty($where) ? $where : array();
$where['is_delete'] = 2;
//证书状态为未删除
$certificate_total = $this->CertificateModel->getCertificateTotal($where);
//列表总数量
$page = isset($_GET['p']) ? intval(htmlspecialchars(strip_tags($_GET['p']))) : '';
//获取url的分页参数
$page = max(1, $page);
$page = min($page, ceil($certificate_total / $this->page_number));
// 获取合法的分页数
$certificate_data = $this->CertificateModel->getCertificateList($where, $field, $order, $page, $this->page_number);
// 分页数据
$map = $word_form ? array('w' => $word_form) : array();
//生成分页连接参数
$Page = new PageAdmin($certificate_total, $this->page_number, $map);
//分页类实例化
$this->assign('page', $Page->show());
// 分页显示输出
$this->assign('word', $word_form);
// 查询关键字
foreach ($certificate_data as $key => $value) {
$certificate_data[$key]['description'] = str_cut($certificate_data[$key]['description']);
$certificate_data[$key]['certificate_type'] = self::getCertificateType($certificate_data[$key]['certificate_type']);
}
$this->assign('certificate', $certificate_data);
$this->display();
}
开发者ID:cy520win,项目名称:yunchao,代码行数:40,代码来源:CertificateController.class.php
示例17: str_cut
" class="checkitem ml10 mr10" />
<span><a href="index.php?act=goods&goods_id=<?php
echo $consult['goods_id'];
?>
" target="_blank"><?php
echo $consult['cgoods_name'];
?>
</a></span><span class="ml20"><?php
echo $lang['store_consult_list_consult_member'] . $lang['nc_colon'];
?>
</span>
<?php
if ($consult['member_id'] == "0") {
echo $lang['nc_guest'];
} else {
echo $consult['isanonymous'] == 1 ? str_cut($consult['cmember_name'], 2) . '***' : $consult['cmember_name'];
}
?>
<span class="ml20"><?php
echo $lang['store_consult_list_consult_time'] . $lang['nc_colon'];
?>
<em class="goods-time"><?php
echo date("Y-m-d H:i:s", $consult['consult_addtime']);
?>
</em></span></th>
</tr>
<tr>
<td rowspan="2"></td>
<td class="tl"><strong><?php
echo $lang['store_consult_list_consult_content'] . $lang['nc_colon'];
?>
开发者ID:Maplecms,项目名称:shopnc-yhmall,代码行数:31,代码来源:store_consult_manage.php
示例18: fapiaoOp
/**
* 查看订单
*/
public function fapiaoOp()
{
$order_id = intval($_GET['order_id']);
if ($order_id <= 0) {
showMessage(Language::get('wrong_argument'), '', 'html', 'error');
}
$order_model = Model('order');
$condition['order_id'] = $order_id;
$condition['store_id'] = $_SESSION['store_id'];
$order_info = $order_model->getOrderInfo($condition, array('order_common', 'order_goods'));
if (empty($order_info)) {
showMessage(Language::get('member_printorder_ordererror'), '', 'html', 'error');
}
Tpl::output('order_info', $order_info);
//卖家信息
$model_store = Model('store');
$store_info = $model_store->getStoreInfoByID($order_info['store_id']);
if (!empty($store_info['store_label'])) {
if (file_exists(BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $store_info['store_label'])) {
$store_info['store_label'] = UPLOAD_SITE_URL . DS . ATTACH_STORE . DS . $store_info['store_label'];
} else {
$store_info['store_label'] = '';
}
}
if (!empty($store_info['store_stamp'])) {
if (file_exists(BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $store_info['store_stamp'])) {
$store_info['store_stamp'] = UPLOAD_SITE_URL . DS . ATTACH_STORE . DS . $store_info['store_stamp'];
} else {
$store_info['store_stamp'] = '';
}
}
Tpl::output('store_info', $store_info);
//订单商品
$model_order = Model('order');
$condition = array();
$condition['order_id'] = $order_id;
$condition['store_id'] = $_SESSION['store_id'];
$goods_new_list = array();
$goods_all_num = 0;
$goods_total_price = 0;
if (!empty($order_info['extend_order_goods'])) {
$goods_count = count($order_goods_list);
$i = 1;
foreach ($order_info['extend_order_goods'] as $k => $v) {
$v['goods_name'] = str_cut($v['goods_name'], 100);
$goods_all_num += $v['goods_num'];
$v['goods_all_price'] = ncPriceFormat($v['goods_num'] * $v['goods_price']);
$goods_total_price += $v['goods_all_price'];
$goods_new_list[ceil($i / 4)][$i] = $v;
$i++;
}
}
//优惠金额
$promotion_amount = $goods_total_price - $order_info['goods_amount'];
//运费
$order_info['shipping_fee'] = $order_info['shipping_fee'];
Tpl::output('promotion_amount', $promotion_amount);
Tpl::output('goods_all_num', $goods_all_num);
Tpl::output('goods_total_price', ncPriceFormat($goods_total_price));
Tpl::output('goods_list', $goods_new_list);
Tpl::showpage('printer_fapiao', "null_layout");
}
开发者ID:noikiy,项目名称:shopnc-minion,代码行数:65,代码来源:store_order_print.php
示例19: urlShop
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="public-top-layout w">
<div class="topbar warp-all">
<div class="user-entry">
<?php
if ($_SESSION['is_login'] == '1') {
?>
<?php
echo $lang['nc_hello'];
?>
<span><a href="<?php
echo urlShop('member_snsindex');
?>
"><?php
echo str_cut($_SESSION['member_name'], 20);
?>
</a></span><?php
echo $lang['nc_comma'], $lang['welcome_to_site'];
?>
<a href="<?php
echo SHOP_SITE_URL;
?>
" title="<?php
echo $lang['homepage'];
?>
" alt="<?php
echo $lang['homepage'];
?>
"><span><?php
echo $GLOBALS['setting_config']['site_name'];
开发者ID:Maplecms,项目名称:shopnc-yhmall,代码行数:31,代码来源:top.php
示例20: str_cut
echo $val['goods_name'];
?>
" src="<?php
echo $val['goods_image'] ? UPLOAD_SITE_URL . DS . ATTACH_MALBUM . '/' . $val['member_id'] . '/' . $val['goods_image'] : SHOP_TEMPLATES_URL . '/images/member/default_image.png';
?>
" />
</a>
</span>
</div>
<h3 class="fn-right">
<a href="index.php?act=flea_goods&goods_id=<?php
echo $val['goods_id'];
?>
" >
<?php
echo str_cut($val['goods_name'], 40);
?>
</a>
</h3>
<p class="price orange fn-right"><?php
echo $lang['currency'];
echo $val['goods_store_price'];
?>
</p>
<div class="item-attrs blue2 fn-right">
<span class="item_fav fn-right" title="<?php
echo $lang['flea_goods_collect'];
?>
"><?php
echo $val['flea_collect_num'];
?>
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:31,代码来源:flea_class.php
注:本文中的str_cut函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论