本文整理汇总了PHP中msubstr函数的典型用法代码示例。如果您正苦于以下问题:PHP msubstr函数的具体用法?PHP msubstr怎么用?PHP msubstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了msubstr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($responseinfo)
{
//Api配置参数
$res = unserialize($responseinfo['response_compos']);
$config = '';
foreach ($res['replace'] as $key => $value) {
if (!empty($value)) {
$config .= $key . ':' . $value . "\n";
}
}
$res['config'] = $config;
//Api插件模块 第三方接口
if ($res['type'] == 'cloud') {
$cloudlist = M('webuntil')->where(array('status' => 1))->field('id,webuntil_type,webuntil_name,webuntil_backtype,webuntil_title')->select();
$locallist = array();
foreach ($cloudlist as $key => $value) {
$locallist[$key] = array('id' => $value['id'], 'title' => $value['webuntil_name'], 'name' => " 请求" . $value['webuntil_type'], 'description' => "回复" . $value['webuntil_backtype']);
}
} else {
$locallist = M('Addons')->where(array('status' => 1, 'weixin' => 1))->field('id,title,name,description,config')->select();
foreach ($locallist as $key => $value) {
$locallist[$key]['description'] = msubstr($value['description'], 0, 25, $charset = "utf-8", $suffix = true);
}
}
$res['localapi'] = $locallist;
return $res;
}
开发者ID:fedkey,项目名称:amango,代码行数:27,代码来源:ApiFactory.class.php
示例2: get_payment_code
public function get_payment_code($payment_notice_id)
{
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$money = round($payment_notice['money'], 2);
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
$sql = "select name " . "from " . DB_PREFIX . "deal_order_item " . "where order_id =" . intval($payment_notice['order_id']);
$title_name = $GLOBALS['db']->getOne($sql);
$subject = msubstr($title_name, 0, 40);
$data_return_url = SITE_DOMAIN . APP_ROOT . '/index.php.php?ctl=payment&act=response&class_name=Wtenpay';
$notify_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Wtenpay';
$pay = array();
$pay['subject'] = $subject;
$pay['body'] = $title_name;
$pay['total_fee'] = $money;
$pay['total_fee_format'] = format_price($money);
$pay['out_trade_no'] = $payment_notice['notice_sn'];
$pay['notify_url'] = $notify_url;
$pay['partner'] = $payment_info['config']['tenpay_partner'];
//合作商户ID
$pay['key'] = $payment_info['config']['tenpay_key'];
//支付宝(RSA)公钥
$pay['pay_code'] = 'wtenpay';
//,支付宝;mtenpay,财付通;mcod,货到付款
return $pay;
}
开发者ID:macall,项目名称:jsd,代码行数:26,代码来源:Wtenpay_payment.php
示例3: update
public function update()
{
$id = $_REQUEST['id'];
$title = $_REQUEST['title'];
if (!empty($id)) {
$data = $_POST;
if (!empty($title)) {
$data['title'] = $title;
}
if (empty($_POST['brief'])) {
// import("@.ORG.Validation");
// $v = new Validation();
// $description = $v->kill_html($_POST['description']);
$description = strip_tags($_POST['description']);
$data['brief'] = msubstr(trim($description), 0, 120);
}
$data['id'] = $id;
$model = $this->getActionName();
$case = M($model);
// 更新数据
$list = $case->save($data);
if (false !== $list) {
$this->assign('jumpUrl', U("News/"));
$this->success('编辑成功!');
} else {
//错误提示
$this->error('编辑失败!');
}
} else {
//错误提示
$this->error('编辑失败!');
}
}
开发者ID:ycltpe,项目名称:sig,代码行数:33,代码来源:NewsAction.class.php
示例4: load_msg
/**
* 加载相应的类型消息
* @param unknown_type $msg 数据集(即数据库中的对应消息行)
*
* 返回:array("id"=>"当前消息ID",title="标题",is_read=>"是否已读","icon"=>"相关数据的图片(可为空)","content"=>"内容","create_time"=>"时间","link"=>"(可为空)相关数据的跳转链接");
*/
public function load_msg($msg)
{
if (!$msg['data']) {
require_once APP_ROOT_PATH . "system/model/topic.php";
$data = get_topic_item($msg['data_id']);
$msg['data'] = serialize($data);
$GLOBALS['db']->autoExecute(DB_PREFIX . "msg_box", $msg, "UPDATE", "id=" . $msg['id'], "SILENT");
}
$data = unserialize($msg['data']);
//图标,取分享的第一张
if ($data['id'] != $data['origin_id'] && $data['origin']) {
$msg['title'] = $data['origin']['forum_title'];
$msg['icon'] = $data['origin']['images'][0]['o_path'];
$msg['link'] = $data['origin']['url'];
} else {
$msg['title'] = $data['forum_title'];
$msg['icon'] = $data['images'][0]['o_path'];
$msg['link'] = $data['url'];
}
if ($msg['title'] == "") {
$msg['title'] = "会员分享";
}
$msg['short_title'] = msubstr($msg['title']);
return $msg;
}
开发者ID:macall,项目名称:jsd,代码行数:31,代码来源:topic_msg.php
示例5: dailyList
/**
* @author Knight
* @cnname 我的文章列表
*/
public function dailyList()
{
$where = "status=1 and permission=1";
$typeId = I("id");
//日子类别Id
if (!empty($typeId)) {
$where .= " and type=" . $typeId;
}
$count = M("daily")->where($where)->count();
$page = new \Think\Page($count, 5);
$show = $page->show();
$dailyList = M("daily")->where($where)->order("c_time desc")->limit($Page->firstRow . ',' . $page->listRows)->select();
foreach ($dailyList as $k => $v) {
$where = "id=" . $v['type'];
$typeName = $this->getInfo("daily_type", array("type_name"), $where);
$dailyList[$k]['typeName'] = $typeName[0]['type_name'];
$dailyList[$k]['c_time'] = date("Y-m-d", $v['c_time']);
$dailyList[$k]['content'] = msubstr(filterHtml($v['content']), 0, 100, "utf-8");
}
$pageList = $page->show();
$this->assign('type', 1);
$this->assign("pageList", $pageList);
//分页数据
$this->assign("pageTotal", $page->totalPages);
//分页总数
$this->assign("dailyList", $dailyList);
$this->display("Index/newList");
}
开发者ID:knight-chen,项目名称:myblog,代码行数:32,代码来源:IndexController.class.php
示例6: add
public function add()
{
if (!$GLOBALS['islogin']) {
exit;
}
if (!checkpost()) {
exit;
}
$diary = M('diary');
$uid = $GLOBALS['i']['uid'];
$data['uid'] = $GLOBALS['i']['uid'];
$content = postvar('content');
$data['original_cont'] = exp_content($content);
$content = msubstr($content, 0, 100, 'utf-8', false);
$data['content'] = exp_content($content);
$data['mood'] = postvar('mood');
$data['read_type'] = postvar('read_type', 1);
$data['add_time'] = time();
$data['set_time'] = strtotime(postvar('set_time'));
$did = $diary->add($data);
//echo $diary->getLastSql();
$member_field = M('member_field');
$data1['diary_num'] = array('exp', 'diary_num+1');
$member_field->where("uid={$uid}")->save($data1);
$body = array('did' => $did, 'content' => $data['content']);
//feed_publish(1, $body, $did);
$feedModel = D('Feed');
$feedModel->feed_publish(1, $body, $did);
echo '{"errno":200}';
}
开发者ID:laiello,项目名称:qinhan,代码行数:30,代码来源:DiaryAction.class.php
示例7: get_user_withdraw
function get_user_withdraw($limit, $user_id)
{
$user_id = intval($user_id);
$list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "withdraw where user_id = " . $user_id . " and is_delete = 0 order by create_time desc limit " . $limit);
foreach ($list as $k => $v) {
$bank_account_end = substr($v['bank_account'], -4, 4);
$bank_account_show_length = strlen($v['bank_account']) - 4;
$bank_account = "";
for ($i = 0; $i < $bank_account_show_length; $i++) {
$bank_account .= "*";
}
$bank_account .= $bank_account_end;
$list[$k]['bank_account'] = $bank_account;
$bank_user_end = msubstr($v['bank_user'], -1, 1, "utf-8", false);
$bank_user_show_length = mb_strlen($v['bank_user'], "utf-8") - 1;
$bank_user = "";
for ($i = 0; $i < $bank_user_show_length; $i++) {
$bank_user .= "*";
}
$bank_user .= $bank_user_end;
$list[$k]['bank_user'] = $bank_user;
}
$count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "withdraw where user_id = " . $user_id . " and is_delete = 0");
return array("list" => $list, 'count' => $count);
}
开发者ID:macall,项目名称:jsd,代码行数:25,代码来源:user_center.php
示例8: get_payment_code
public function get_payment_code($payment_notice_id)
{
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$money = round($payment_notice['money'], 2);
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
$sql = "select name " . "from " . DB_PREFIX . "deal_order_item " . "where order_id =" . intval($payment_notice['order_id']);
$title_name = $GLOBALS['db']->getOne($sql);
$subject = msubstr($title_name, 0, 40);
//$data_return_url = get_domain().APP_ROOT.'/../payment.php?act=return&class_name=Malipay';
$notify_url = get_domain() . APP_ROOT . '/../shop.php?ctl=payment&act=response&class_name=Malipay';
$pay = array();
$pay['subject'] = $subject;
$pay['body'] = $title_name;
$pay['total_fee'] = $money;
$pay['total_fee_format'] = format_price($money);
$pay['out_trade_no'] = $payment_notice['notice_sn'];
$pay['notify_url'] = $notify_url;
$pay['partner'] = $payment_info['config']['alipay_partner'];
//合作商户ID
$pay['seller'] = $payment_info['config']['alipay_account'];
//账户ID
$pay['rsa_alipay_public'] = $payment_info['config']['alipay_rsa_public'];
//支付宝(RSA)公钥
$pay['pay_code'] = 'malipay';
//,支付宝;mtenpay,财付通;mcod,货到付款
$order_spec = '';
$order_spec .= 'partner="' . $pay['partner'] . '"';
//合作商户ID
$order_spec .= '&seller="' . $pay['seller'] . '"';
//账户ID
$order_spec .= '&out_trade_no="' . $pay['out_trade_no'] . '"';
$order_spec .= '&subject="' . $pay['subject'] . '"';
$order_spec .= '&body="' . $pay['body'] . '"';
$order_spec .= '&total_fee="' . $pay['total_fee'] . '"';
$order_spec .= '¬ify_url="' . $pay['notify_url'] . '"';
$pay['order_spec'] = $order_spec;
$sign = $this->sign($order_spec);
$pay['sign'] = urlencode($sign);
$pay['sign_type'] = 'RSA';
/*
$pubkey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6IQ/HH06GbTIhKNN/YSQXxllnP7cNERMuN16GgZDfuf9NrY/Bw2ZINkq1RMNlbP66Vu5y0gwYPC/7PbO5l6pbnl3N4rw5VY3U6rtIC0f8ADDLrIZwShYUitaFq+Ao7rhk/GbpfSD7vgnugQz74fVewi17S3Apujq4U4LAxFmVowIDAQAB';
$pubkey = $this->getPublicKeyFromX509($pubkey);
$res = openssl_pkey_get_public($pubkey);
$sign = base64_decode($sign);
$verify = openssl_verify($order_spec, $sign, $res);
if ($verify == 1)
{
$pay['openssl_verify'] = 'ok';
}else{
$pay['openssl_verify'] = 'error';
}
*/
//
// print_r($payment_info['config']);
// print_r($pay);exit;
return $pay;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:59,代码来源:Malipay_payment.php
示例9: content
public function content()
{
$id = I('id');
$map['id'] = $id;
$info = D('Material')->_get($map);
$this->assign('vo', $info);
$this->assign('header_title', msubstr($info['title'], 0, 19));
$this->display();
}
开发者ID:a3147972,项目名称:micro_business,代码行数:9,代码来源:MaterialController.class.php
示例10: auto_desc
protected function auto_desc()
{
$desc = I('post.desc', '');
if (!empty($desc)) {
return $desc;
}
$content = strip_tags(I('post.content'));
$desc = msubstr($content, 0, 200);
return $desc;
}
开发者ID:a3147972,项目名称:blog,代码行数:10,代码来源:ArticleModel.class.php
示例11: index
public function index($type = 'inbox')
{
$dao = model('Message');
$list = $type == 'inbox' ? $dao->getInboxByUid($this->mid) : $dao->getOutboxByUid($this->mid);
foreach ($list['data'] as $k => $v) {
$list['data'][$k]['summary'] = msubstr($v['content'], 0, 100);
}
$this->assign($list);
$session_count = $dao->getSessionCount($this->mid, getSubByKey($list['data'], 'source_message_id'));
$this->assign('session_count', $session_count);
$this->assign('type', $type);
$this->display('list');
}
开发者ID:laiello,项目名称:thinksns-2,代码行数:13,代码来源:MessageAction.class.php
示例12: category
public function category($category_id = 0)
{
$map['category'] = $category_id;
$map['status'] = 1;
$questionModel = new QuestionModel();
$hot_list = $questionModel->getList($map, '*', 5, 'answer_num desc');
foreach ($hot_list as &$val) {
$val['info'] = msubstr(op_t($val['description']), 0, 50);
}
unset($val);
$this->assign('hot_list', $hot_list);
$this->display(T('Application://Question@Widget/category'));
}
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:13,代码来源:RightBlockWidget.class.php
示例13: getLists
/**
* 获取收藏列表
* @param int $uid 用户uid
*/
public function getLists($uid)
{
$map = array('user_id' => $uid);
$lists = $this->where($map)->select();
$product = array();
foreach ($lists as $key => $value) {
$product = M('FxProduct')->field('product_name, thumb')->where(array('product_id' => $value['product']))->find();
$lists[$key]['title'] = msubstr($product['product_name'], 0, 15);
$lists[$key]['thumb'] = thumb($product['thumb']);
$lists[$key]['url'] = U('Index/product', array('id' => $value['product']));
$lists[$key]['del_url'] = U('collect', array('type' => 2, 'product_id' => $value['product']));
}
return $lists;
}
开发者ID:wuwenbao,项目名称:paimai,代码行数:18,代码来源:FxProductCollectModel.class.php
示例14: load_msg
/**
* 加载相应的类型消息
* @param unknown_type $msg 数据集(即数据库中的对应消息行)
*
* 返回:array("id"=>"当前消息ID",title="标题",is_read=>"是否已读","icon"=>"相关数据的图片(可为空)","content"=>"内容","create_time"=>"时间","link"=>"(可为空)相关数据的跳转链接");
*/
public function load_msg($msg)
{
if (!$msg['data']) {
$data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order_item where id = " . $msg['data_id']);
$msg['data'] = serialize($data);
$GLOBALS['db']->autoExecute(DB_PREFIX . "msg_box", $msg, "UPDATE", "id=" . $msg['id'], "SILENT");
}
$data = unserialize($msg['data']);
$msg['title'] = $data['name'];
$msg['icon'] = $data['deal_icon'];
$msg['link'] = url("index", "uc_order#view", array("id" => $data['order_id']));
$msg['short_title'] = msubstr($msg['title']);
return $msg;
}
开发者ID:macall,项目名称:jsd,代码行数:20,代码来源:orderitem_msg.php
示例15: newslist
/**
* 页面列表
*/
public function newslist()
{
$_REQUEST['tabHash'] = 'newslist';
//按钮
//$this->pageButton[] = array('uid','title'=>'搜索', 'onclick'=>"admin.fold('search_form')");
$this->pageButton[] = array('uid', 'title' => '删除', 'onclick' => "admin.deleteInfo();");
$this->pageButton[] = array('uid', 'title' => '添加资讯', 'onclick' => "location.href='" . U('news/admin/setinfo', array('tabHash' => 'newslist')) . "';");
//处理分类HASH
$cs = model('CategoryTree')->setTable('news_category')->getCategoryList();
$categorys = array();
foreach ($cs as $ct) {
$categorys[$ct['news_category_id']] = $ct;
}
//构造搜索条件
//列表key值 DOACTION表示操作
$this->pageKeyList = array('image', 'news_title', 'news_content', 'state', 'is_top', 'hits', 'date', 'DOACTION');
$listData = M('News')->order('news_id desc')->findPage(15);
foreach ($listData['data'] as $key => $val) {
$listData['data'][$key]['id'] = $val['news_id'];
$thumb = APPS_URL . '/' . APP_NAME . '/_static/nopic.jpg';
if ($val['image']) {
$attach = model('Attach')->getAttachById($val['image']);
if ($attach) {
$thumb = getImageUrl($attach['save_path'] . $attach['save_name'], 100, 100, true);
}
}
//获取分类
$type_str = '';
if ($val['type_id']) {
if (isset($categorys[$val['type_id']])) {
$type_str .= $categorys[$val['type_id']]['title'];
if (isset($categorys[$categorys[$val['type_id']]['pid']])) {
$type_str = $categorys[$categorys[$val['type_id']]['pid']]['title'] . '--' . $type_str;
}
}
}
$listData['data'][$key]['image'] = '<img src="' . $thumb . '">';
$listData['data'][$key]['news_title'] = msubstr($val['news_title'], 0, 20) . "<BR><BR><font style='color:#7d7d7d;'>分类: " . $type_str . "</font>";
$listData['data'][$key]['news_content'] = msubstr(strip_tags($val['news_content']), 0, 20);
$listData['data'][$key]['state'] = D('News')->getState($val['state']);
$listData['data'][$key]['date'] = '创建:' . date('m/d G:i', $val['created']);
if ($val['updated']) {
$listData['data'][$key]['date'] .= '<br>更新:' . date('m/d G:i', $val['updated']);
}
$listData['data'][$key]['is_top'] = $val['is_top'] ? '<font color="red">置顶</font>' : '否';
$listData['data'][$key]['DOACTION'] = '<a href="' . U('news/admin/setinfo', array('news_id' => $val['news_id'], 'tabHash' => 'setinfo')) . '">编辑</a>';
}
$this->displayList($listData);
}
开发者ID:lyhiving,项目名称:icampus,代码行数:52,代码来源:AdminAction.class.php
示例16: head
public function head()
{
//读取数据库和缓存
$type = M('type');
$article = M('article');
$config = F('basic', '', './Web/Conf/');
//封装网站配置
$this->assign('config', $config);
//滚动公告
$data['status'] = 1;
$data['typeid'] = $config['noticeid'];
$roll = $article->where($data)->field('aid,title')->order('addtime desc')->limit($config['rollnum'])->select();
//处理标题:防止标题过长撑乱页面
foreach ($roll as $k => $v) {
$roll[$k]['title'] = msubstr($v['title'], 0, 20, 'gb2312');
}
$this->assign('roll', $roll);
//网站导航
$menu = $type->where('ismenu=1')->order('drank asc')->select();
foreach ($menu as $k => $v) {
$menuson[$k] = $type->where('fid=' . $v['typeid'] . ' AND drank <> 0')->order('drank asc')->select();
}
$this->assign('menuson', $menuson);
$this->assign('menu', $menu);
//位置导航
$nav = '<a href="__APP__">首页</a>';
if (isset($_GET['aid'])) {
$typeid = $article->where('aid=' . $_GET['aid'])->getField('typeid');
} else {
$typeid = $_GET['typeid'];
}
$typename = $type->where('typeid=' . $typeid)->getField('typename');
$path = $type->where('typeid=' . $typeid)->getField('path');
$typelist = explode('-', $path);
//拼装导航栏字符串
foreach ($typelist as $v) {
if ($v == 0) {
continue;
}
$s = $type->where('typeid=' . $v)->getField('typename');
$nav .= " > <a href=\"" . U('lists/' . $v) . "\">{$s}</a>";
}
$nav .= " > <a href=\"" . U('lists/' . $typeid) . "\">{$typename}</a>";
$this->assign('nav', $nav);
//释放内存
unset($type, $article);
$this->assign('head', TMPL_PATH . $config['sitetpl'] . '/head.html');
$this->assign('footer', TMPL_PATH . $config['sitetpl'] . '/footer.html');
}
开发者ID:yunsite,项目名称:waikucms,代码行数:49,代码来源:PublicAction.class.php
示例17: smarty_modifier_truncate
function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false)
{
if ($length == 0) {
return '';
}
if (strlen($string) > $length) {
$length -= strlen($etc);
if (!$break_words) {
$string = preg_replace('/s+?(S+)?$/', '', msubstr($string, 0, $length + 1));
}
return msubstr($string, 0, $length) . $etc;
} else {
return $string;
}
}
开发者ID:vuong93st,项目名称:w-game,代码行数:15,代码来源:modifier.truncate.php
示例18: kuaidi
protected function kuaidi($param)
{
global $_W;
$content = str_replace('+', '', $_W['content']);
$content = str_replace(' ', '', $content);
if (strstr($_W['content'], '快递')) {
wx_success("【快递名字+单号】查询快递\n圆通 中通 申通 顺丰 韵达 邮政 EMS\n例查圆通发送:圆通2728435536\n例查中通发送:中通778044381976");
}
$kuaidic = array();
$kuaidil = array();
//单号长度
$kuaidic["圆通"] = 10;
$kuaidic["申通"] = 12;
$kuaidic["中通"] = 12;
$kuaidic["顺丰"] = 12;
$kuaidic["邮政"] = 13;
$kuaidic["韵达"] = 13;
//快递标识
$kuaidil["圆通"] = "yuantong";
$kuaidil["中通"] = "zhongtong";
$kuaidil["申通"] = "shentong";
$kuaidil["顺丰"] = "shunfeng";
$kuaidil["邮政"] = "ems";
$kuaidil["韵达"] = "yunda";
//提取单号
$kuaiditype = msubstr($_W['content'], "0", "2", $charset = "utf-8", $suffix = false);
$danhao = str_replace($kuaiditype, '', $content);
if (strlen($danhao) != $kuaidic[$kuaiditype]) {
wx_error("【快递名字+单号】查询快递\n圆通 中通 申通 顺丰 韵达 邮政 EMS\n检查快递单号长度是否填写正确");
} else {
//获取该插件配置参数
$config = Amango_Addons_Config();
$config['kuaidiak'] || wx_error('请联系站长先填写快递API的密匙');
$url = 'http://api.ickd.cn/?com=' . $kuaidil[$kuaiditype] . '&nu=' . $danhao . '&id=82CD8E8282C652F91CAEE36225FD2373&type=text&encode=utf8&ord=asc';
$json = file_get_contents($url);
if (!empty($json)) {
$str = str_replace(date("Y"), "\n" . date("Y"), $json);
$str = "快递:" . $kuaiditype . "\n单号:" . $danhao . "\n--------------\n" . $str;
$replycontext['Content'] = $str;
$this->assign('Text', $replycontext);
$this->display();
} else {
wx_error("您输入单号查询不到相关信息!");
}
}
}
开发者ID:fedkey,项目名称:amango,代码行数:46,代码来源:WeixinController.class.php
示例19: index
public function index()
{
$rss = new UniversalFeedCreator();
$rss->useCached();
// use cached version if age<1 hour
$rss->title = app_conf("SHOP_TITLE") . " - " . app_conf("SHOP_SEO_TITLE");
$rss->description = app_conf("SHOP_SEO_TITLE");
//optional
$rss->descriptionTruncSize = 500;
$rss->descriptionHtmlSyndicated = true;
$rss->link = get_domain() . APP_ROOT;
$rss->syndicationURL = get_domain() . APP_ROOT;
//optional
$image->descriptionTruncSize = 500;
$image->descriptionHtmlSyndicated = true;
$domain = app_conf("PUBLIC_DOMAIN_ROOT") == '' ? get_domain() . $GLOBALS['IMG_APP_ROOT'] : app_conf("PUBLIC_DOMAIN_ROOT");
$city = get_current_deal_city();
$city_id = $city['id'];
$deal_list = get_deal_list(app_conf("DEAL_PAGE_SIZE"), 0, 0, array(DEAL_ONLINE), " buy_type <> 1 or ( is_shop = 1 and is_effect =1 and is_delete = 0 and buy_type <> 1)");
$deal_list = $deal_list['list'];
foreach ($deal_list as $data) {
$item = new FeedItem();
if ($data['uname'] != '') {
$gurl = url("shop", "goods", array("id" => $data['uname']));
} else {
$gurl = url("shop", "goods", array("id" => $data['id']));
}
$data['url'] = $gurl;
$item->title = msubstr($data['name'], 0, 30);
$item->link = get_domain() . $data['url'];
$data['description'] = str_replace($GLOBALS['IMG_APP_ROOT'] . "./public/", $domain . "/public/", $data['description']);
$data['description'] = str_replace("./public/", $domain . "/public/", $data['description']);
$data['img'] = str_replace("./public/", $domain . "/public/", $data['img']);
$item->description = "<img src='" . $data['img'] . "' /><br />" . $data['brief'] . "<br /> <a href='" . get_domain() . $data['url'] . "' target='_blank' >" . $GLOBALS['lang']['VIEW_DETAIL'] . "</a>";
//optional
$item->descriptionTruncSize = 500;
$item->descriptionHtmlSyndicated = true;
if ($data['end_time'] != 0) {
$item->date = date('r', $data['end_time']);
}
$item->source = $data['url'];
$item->author = app_conf("SHOP_TITLE");
$rss->addItem($item);
}
$rss->saveFeed($format = "RSS0.91", $filename = APP_ROOT_PATH . "public/runtime/app/tpl_caches/rss.xml");
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:46,代码来源:rssModule.class.php
示例20: info
public function info()
{
$tag = urldecode($_GET['tag']);
if (!is_utf8($tag)) {
$tag = auto_charset($tag, 'gbk', 'utf-8');
}
$tag = msubstr(in($tag), 0, 20);
//查找tag信息
if (!empty($tag)) {
$info = model('tags')->tag_info($tag);
} else {
$this->error404();
}
if (empty($info)) {
$this->error404();
}
//更新点击计数
model('tags')->views_content($info['id'], $info['click']);
/*hook*/
$this->plus_hook('tags', 'index', $info);
/*hook end*/
//分页处理
$url = __INDEX__ . '/tags-' . $tag . '/pages-{page}.html';
$listrows = $this->config['TPL_TAGS_PAGE'];
if (empty($listrows)) {
$listrows = 20;
}
$limit = $this->pagelimit($url, $listrows);
$nav = array(0 => array('name' => 'TAG', 'url' => __INDEX__ . '/tags/index'), 1 => array('name' => $tag, 'url' => __INDEX__ . '/tags-' . $tag . '/'));
//MEDIA信息
$this->common = model('pageinfo')->media($info['name'] . ' - TAGS', $tag);
//内容列表
$loop = model('tags')->tag_list($info['id'], $limit);
//统计总内容数量
$count = model('tags')->tag_count($info['id']);
//分页处理
$this->page = $this->page($url, $count, $listrows);
//获取上一页代码
$this->prepage = $this->page($url, $count, $listrows, '', 1);
//获取下一页代码
$this->nextpage = $this->page($url, $count, $listrows, '', 2);
$this->assign('loop', $loop);
$this->assign('nav', $nav);
$this->assign('info', $info);
$this->display($this->config['TPL_TAGS']);
}
开发者ID:JamesKid,项目名称:teach,代码行数:46,代码来源:tagsMod.class.php
注:本文中的msubstr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论