• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP op_t函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中op_t函数的典型用法代码示例。如果您正苦于以下问题:PHP op_t函数的具体用法?PHP op_t怎么用?PHP op_t使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了op_t函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: render

 public function render($data)
 {
     $tpl_section = $data['tpl'];
     $info = $data['info'];
     $tpl_section = $this->handle($tpl_section, '{$[title]}', op_t($info['title']));
     $tpl_section = $this->handle($tpl_section, '{$[cTime]}', friendlyDate($info['create_time']));
     $tpl_section = $this->handle($tpl_section, '{$[cTimeD]}', date('n j', $info['create_time']));
     $tpl_section = $this->handle($tpl_section, '{$[url]}', U('Cat/Index/info', array('info_id' => $info['id'])));
     /*用户标签*/
     $user = query_user(array('nickname', 'avatar32', 'avatar64', 'avatar128', 'avatar256', 'space_url'), $info['uid']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar32]}', $user['avatar32']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar64]}', $user['avatar64']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar128]}', $user['avatar128']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar256]}', $user['avatar256']);
     $tpl_section = $this->handle($tpl_section, '{$[user_nickname]}', $user['nickname']);
     $tpl_section = $this->handle($tpl_section, '{$[user_space_url]}', $user['space_url']);
     $tpl_section = $this->handle($tpl_section, '{$[user_uid]}', $user['uid']);
     /*用户标签end*/
     $tpl_section = $this->handle($tpl_section, '{$[fav_btn]}', R('FavBtn/render', array(array('info' => $info)), 'Widget'));
     $entity = D('cat_entity')->find($info['entity_id']);
     if ($entity['can_over']) {
         $tpl_section = $this->handle($tpl_section, '{$[over_time]}', date('Y-m-d', $info['over_time']));
     } else {
         $tpl_section = $this->handle($tpl_section, '{$[over_time]}', '');
     }
     return $tpl_section;
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:27,代码来源:SysTagRenderWidget.class.php


示例2: render

 public function render($is_following = 0, $uid = 0)
 {
     $uid = op_t($uid);
     $this->assign('is_following', $is_following);
     $this->assign('uid', $uid);
     $this->display(T('Application://Common@Widget/ufollow'));
 }
开发者ID:admpub,项目名称:OpenCenter,代码行数:7,代码来源:UfollowWidget.class.php


示例3: addData

 public function addData($name, $value, $info_id, $entity_id)
 {
     $map['name'] = $name;
     $map['entity_id'] = $entity_id;
     $profile = M('cat_field')->where($map)->find();
     $content_data['id'] = $profile;
     $content_data['field_id'] = $profile['id'];
     if (!$this->validateField($profile, $value)) {
         return false;
     }
     if (!is_array($value)) {
         //如果值不是数组
         if ($profile['input_type'] == IT_DATE) {
             $content_data['value'] = strtotime($value);
         } else {
             $content_data['value'] = $value;
         }
         $content_data['info_id'] = $info_id;
         return $this->add($content_data);
     } else {
         $rs = 1;
         foreach ($value as $v) {
             //如果是数组
             $content_data['value'] = op_t($v);
             $content_data['info_id'] = $info_id;
             $rs = $rs && $this->add($content_data);
         }
         return $rs;
     }
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:30,代码来源:DataModel.class.php


示例4: getLastMessage

 public function getLastMessage($talk_id)
 {
     $last_message = D('TalkMessage')->where('talk_id=' . $talk_id)->order('create_time desc')->find();
     $last_message['user'] = query_user(array('nickname', 'space_url', 'id'), $last_message['uid']);
     $last_message['content'] = op_t($last_message['content']);
     return $last_message;
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:7,代码来源:TalkModel.class.php


示例5: getLinkContent

 public function getLinkContent()
 {
     require_once './ThinkPHP/Library/Vendor/Collection/phpQuery.php';
     $link = op_t(I('post.url'));
     $content = get_content_by_url($link);
     $charset = preg_match("/<meta.+?charset=[^\\w]?([-\\w]+)/i", $content, $temp) ? strtolower($temp[1]) : "utf-8";
     \phpQuery::$defaultCharset = $charset;
     \phpQuery::newDocument($content);
     $title = pq("meta[name='title']")->attr('content');
     if (empty($title)) {
         $title = pq("title")->html();
     }
     $title = iconv($charset, "UTF-8", $title);
     $keywords = pq("meta[name='keywords'],meta[name='Keywords']")->attr('content');
     $description = pq("meta[name='description'],meta[name='Description']")->attr('content');
     $url = parse_url($link);
     $img = pq("img")->eq(0)->attr('src');
     if (is_bool(strpos($img, 'http://'))) {
         $img = 'http://' . $url['host'] . $img;
     }
     $title = text($title);
     $description = text($description);
     $keywords = text($keywords);
     $return['title'] = $title;
     $return['img'] = $img;
     $return['description'] = empty($description) ? $title : $description;
     $return['keywords'] = empty($keywords) ? $title : $keywords;
     exit(json_encode($return));
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:29,代码来源:LinkController.class.php


示例6: search

 public function search($uid = 0, $page = 1, $lastId = 0)
 {
     $keywords = op_t($_REQUEST['keywords']);
     if (!isset($keywords)) {
         $keywords = '';
     }
     //载入第一页微博
     if ($uid != 0) {
         $result = $this->weiboApi->listAllWeibo($page, null, array('uid' => $uid), 1, $lastId, $keywords);
     } else {
         $result = $this->weiboApi->listAllWeibo($page, 0, '', 1, $lastId, $keywords);
     }
     //显示页面
     $this->assign('list', $result['list']);
     $this->assign('lastId', $result['lastId']);
     $this->assign('page', $page);
     $this->assign('tab', 'all');
     $this->assign('loadMoreUrl', U('loadWeibo', array('uid' => $uid, 'keywords' => $keywords)));
     if (isset($keywords) && $keywords != '') {
         $map['content'] = array('like', "%{$keywords}%");
     }
     $total_count = $this->weiboApi->listAllWeiboCount($map);
     $this->assign('key_words', $keywords);
     $this->assign('total_count', $total_count['total_count']);
     $this->assign('tox_money_name', getToxMoneyName());
     $this->assign('tox_money', getMyToxMoney());
     $this->setTitle('全站搜索微博');
     $this->assign('filter_tab', '全站动态');
     $this->assignSelf();
     $this->display();
 }
开发者ID:yaomoo,项目名称:bbs,代码行数:31,代码来源:IndexController.class.php


示例7: user

 public function user()
 {
     $Channel = D('UserNav');
     if (IS_POST) {
         $one = $_POST['nav'][1];
         if (count($one) > 0) {
             M()->execute('TRUNCATE TABLE ' . C('DB_PREFIX') . 'user_nav');
             for ($i = 0; $i < count(reset($one)); $i++) {
                 $data[$i] = array('title' => op_t($one['title'][$i]), 'url' => op_t($one['url'][$i]), 'sort' => intval($one['sort'][$i]), 'target' => intval($one['target'][$i]), 'color' => op_t($one['color'][$i]), 'band_text' => op_t($one['band_text'][$i]), 'band_color' => op_t($one['band_color'][$i]), 'icon' => op_t(str_replace('icon-', '', $one['icon'][$i])), 'status' => 1);
                 $pid[$i] = $Channel->add($data[$i]);
             }
             S('common_user_nav', null);
             $this->success(L('_CHANGE_'));
         }
         $this->error(L('_NAVIGATION_AT_LEAST_ONE_'));
     } else {
         /* 获取频道列表 */
         $map = array('status' => array('gt', -1));
         $list = $Channel->where($map)->order('sort asc,id asc')->select();
         foreach ($list as $k => &$v) {
             $module = D('Module')->where(array('entry' => $v['url']))->find();
             $v['module_name'] = $module['name'];
             unset($key, $val);
         }
         unset($k, $v);
         $this->assign('module', $this->getModules());
         $this->assign('list', $list);
         $this->meta_title = L('_NAVIGATION_MANAGEMENT_');
         $this->display();
     }
 }
开发者ID:nanhuacrab,项目名称:jhysns,代码行数:31,代码来源:ChannelController.class.php


示例8: navigation

 public function navigation()
 {
     if (IS_POST) {
         $one = $_POST['nav'][1];
         if (count($one) > 0) {
             D()->execute('TRUNCATE TABLE ' . C('DB_PREFIX') . 'mob_channel');
             for ($i = 0; $i < count(reset($one)); $i++) {
                 $data[$i] = array('pid' => 0, 'title' => op_t($one['title'][$i]), 'url' => op_t($one['url'][$i]), 'sort' => intval($one['sort'][$i]), 'target' => intval($one['target'][$i]), 'color' => op_t($one['color'][$i]), 'band_text' => op_t($one['band_text'][$i]), 'band_color' => op_t($one['band_color'][$i]), 'icon' => op_t($one['icon'][$i]), 'status' => 1);
                 $pid[$i] = M('MobChannel')->add($data[$i]);
             }
             $two = $_POST['nav'][2];
             for ($j = 0; $j < count(reset($two)); $j++) {
                 $data_two[$j] = array('pid' => $pid[$two['pid'][$j]], 'title' => op_t($two['title'][$j]), 'url' => op_t($two['url'][$j]), 'sort' => intval($two['sort'][$j]), 'target' => intval($two['target'][$j]), 'color' => op_t($two['color'][$j]), 'band_text' => op_t($two['band_text'][$j]), 'band_color' => op_t($two['band_color'][$j]), 'icon' => op_t($two['icon'][$j]), 'status' => 1);
                 $res[$j] = M('MobChannel')->add($data_two[$j]);
             }
             S('common_nav', null);
             $this->success('修改成功');
         }
         $this->error('导航至少存在一个。');
     } else {
         /* 获取频道列表 */
         $map = array('status' => array('gt', -1), 'pid' => 0);
         $list = M('MobChannel')->where($map)->order('sort asc,id asc')->select();
         foreach ($list as $k => &$v) {
             $v['module_name'] = explode('/', $v['url']);
             $v['module_name'] = $v['module_name'][1];
         }
         unset($k, $v);
         //  dump($list);exit;
         $this->assign('module', $this->getMobModules());
         $this->assign('list', $list);
         $this->meta_title = '导航管理';
         $this->display(T('Application://Mob@Mob/navigation'));
     }
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:35,代码来源:MobController.class.php


示例9: parse_weibo_mob_content

function parse_weibo_mob_content($content)
{
    $content = shorten_white_space($content);
    $content = op_t($content, false);
    $content = parse_url_link($content);
    $content = parseWeiboContent($content);
    return $content;
}
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:8,代码来源:ext_parse.php


示例10: parseComment

 public function parseComment($content)
 {
     $content = shorten_white_space($content);
     $content = op_t($content, false);
     $content = parse_url_link($content);
     $content = parse_expression($content);
     //        $content = parseWeiboContent($content);
     return $content;
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:9,代码来源:WeiboCommentModel.class.php


示例11: text_part

function text_part($aContent)
{
    $arr = array();
    preg_match_all("/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/", $aContent, $arr);
    //匹配所有的图片
    $data['image'] = $arr[1];
    $data['content'] = op_t($aContent);
    return $data;
}
开发者ID:chenyongze,项目名称:bighaha,代码行数:9,代码来源:function.php


示例12: parse_weibo_content

function parse_weibo_content($content)
{
    $content = shorten_white_space($content);
    $content = op_t($content, false);
    $content = parse_url_link($content);
    $content = parse_expression($content);
    $content = parse_at_users($content);
    $content = parseWeiboContent($content);
    return $content;
}
开发者ID:chenyongze,项目名称:bighaha,代码行数:10,代码来源:ext_parse.php


示例13: 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


示例14: register

 public function register($username = '', $nickname = '', $password = '', $repassword = '', $email = '', $verify = '', $type = 'start')
 {
     $type = op_t($type);
     if (!C('USER_ALLOW_REGISTER')) {
         $this->error('注册已关闭');
     }
     $verifyarr = explode(',', C('VERIFY_OPEN'));
     if (in_array('1', $verifyarr)) {
         $this->assign('isverify', 1);
     } else {
         $this->assign('isverify', 0);
     }
     if (IS_POST) {
         //注册用户
         /* 检测验证码 TODO: */
         if (in_array('1', $verifyarr)) {
             if (!$this->check_verify($verify)) {
                 $this->error('验证码输入错误!');
             }
         }
         if ($password != $repassword) {
             $this->error('两次密码输入不一致');
         }
         /* 调用注册接口注册用户 */
         $User = new UserApi();
         $uid = $User->register($username, $nickname, $password, $email);
         if (0 < $uid) {
             //注册成功
             sendMessage($uid, 0, '注册成功', '恭喜您!您已经注册成功,请尽快<a href="' . U('Ucenter/yzmail') . '">验证邮箱地址</a>,第一时间获取网站动态!', 0);
             $uid = $User->login($username, $password);
             //通过账号密码取到uid
             D('Member')->login($uid, false);
             //登陆
             asyn_sendmail($email, 2);
             setuserscore($uid, C('REGSCORE'));
             $this->success('注册成功并登陆!', cookie('referurl'));
         } else {
             //注册失败,显示错误信息
             $this->error($this->showRegError($uid));
         }
     } else {
         //显示注册表单
         if (is_login()) {
             redirect(cookie('referurl'));
         }
         if (cookie('referurl') == '') {
             cookie('referurl', $_SERVER['HTTP_REFERER']);
         }
         $this->display();
     }
 }
开发者ID:Willshon,项目名称:OLCS,代码行数:51,代码来源:UserController.class.php


示例15: index

 public function index($type = 'forum', $page = 1)
 {
     $this->requireLogin();
     $type = op_t($type);
     $totalCount = 0;
     $list = $this->_getList($type, $totalCount, $page);
     $this->assign('totalCount', $totalCount);
     $this->assign('list', $list);
     //设置Tab
     $this->defaultTabHash('collection');
     $this->assign('type', $type);
     $this->setTitle(L('_MY_FAVORITES_'));
     $this->display($type);
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:14,代码来源:CollectionController.class.php


示例16: render

 public function render($data)
 {
     $content = '<span class="bld">' . $data['field']['alias'] . '</span>:';
     //检测是否过期隐藏
     if ($data['overed'] && $data['field']['over_hidden']) {
         $content .= '<span class="cred" id="' . $data['data']['field']['name'] . '">过期隐藏</span>';
         return $content;
     }
     $content .= '<span  id="' . $data['data']['field']['name'] . '">';
     switch ($data['field']['input_type']) {
         case IT_SINGLE_TEXT:
             //单行文本
         //单行文本
         case IT_MULTI_TEXT:
             //多行文本
             $content .= op_h($data['data']['data'][0]);
             break;
         case IT_EDITOR:
             //编辑器
             $content .= "<br/>" . op_h($data['data']['data'][0]);
             break;
         case IT_DATE:
             //日期
             $content .= date('Y-m-d', $data['data']['data'][0]);
             //dump($data['data']['data'][0]);exit;
             break;
             //选择框
         //选择框
         case IT_SELECT:
             //下拉框
             $content .= op_t($data['data']['data'][0]);
             break;
         case IT_RADIO:
             //单选框
             $content .= op_t($data['data']['data'][0]);
             break;
         case IT_PIC:
             //单图片
             if (intval($data['data']['data'][0]) == 0) {
                 return '';
             }
             $content .= '<a class="pic_field" target="_blank" href="' . get_cover($data['data']['data'][0], 'path') . '"><img title="点击查看大图"  class="pic_size" src="' . getThumbImageById($data['data']['data'][0], 100, 100) . '"></a>';
             break;
         case IT_CHECKBOX:
             $content .= $data['data']['data'][0] . '&nbsp;&nbsp;';
             break;
     }
     $content .= '</span>';
     echo $content;
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:50,代码来源:DisplayRenderWidget.class.php


示例17: index

 function index($page = 1)
 {
     $this->requireLogin();
     $uid = isset($_GET['uid']) ? op_t($_GET['uid']) : is_login();
     $map['status'] = 1;
     $map['uid'] = $uid;
     $page = intval($page);
     $atlas_list = $this->atlasModel->where($map)->page($page, 10)->order('addtime desc, id desc')->select();
     $totalCount = $this->atlasModel->where($map)->count();
     $list_ids = getSubByKey($atlas_list, 'id');
     $atlas_list = $this->getAtlasByIds($list_ids);
     $this->assign('atlas_list', $atlas_list);
     $this->assign('totalCount', $totalCount);
     $this->assign('current', 'user');
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:15,代码来源:UserController.class.php


示例18: getLZLReplyList

 public function getLZLReplyList($to_f_reply_id, $order, $page = 1, $limit)
 {
     $list = S('post_replylzllist_' . $to_f_reply_id);
     if ($list == null) {
         $list = D('forum_lzl_reply')->where('is_del=0 and to_f_reply_id=' . $to_f_reply_id)->order($order)->select();
         foreach ($list as $k => &$v) {
             $v['userInfo'] = query_user(array('avatar', 'username', 'uid', 'space_url', 'icons_html'), $v['uid']);
             $v['content'] = op_t($v['content']);
         }
         unset($v);
         S('post_replylzllist_' . $to_f_reply_id, $list, 60);
     }
     $list = getPage($list, $limit, $page);
     return $list;
 }
开发者ID:nullog,项目名称:zhanglubao,代码行数:15,代码来源:ForumLzlReplyModel.class.php


示例19: sendReplyMessage

 /**
  * @param $uid
  * @param $post_id
  * @param $content
  * @param $reply_id
  * @return string
  * @auth 陈一枭
  */
 private function sendReplyMessage($uid, $post_id, $content, $reply_id)
 {
     $limit = 10;
     $map['status'] = 1;
     $map['post_id'] = $post_id;
     $count = M('ForumPostReply')->where($map)->count();
     $pageCount = ceil($count / $limit);
     //增加轻博客的评论数量
     $user = query_user(array('nickname', 'space_url'), $uid);
     $post = M('ForumPost')->find($post_id);
     $title = $user['nickname'] . '回复了您的帖子。';
     $content = '回复内容:' . mb_substr(op_t($content), 0, 20);
     M('Message')->sendMessage($post['uid'], $title, $content, 'Forum/Index/detail#' . $reply_id, array('id' => $post_id, 'page' => $pageCount), $uid, 2);
     return $pageCount;
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:23,代码来源:ForumPostReplyModel.class.php


示例20: find

 public function find($page = 1, $keywords = '')
 {
     $nickname = op_t($keywords);
     if ($nickname != '') {
         $map['nickname'] = array('like', '%' . $nickname . '%');
     }
     $list = D('Member')->where($map)->findPage(18);
     foreach ($list['data'] as &$v) {
         $v['user'] = query_user(array('avatar128', 'space_url', 'username', 'fans', 'following', 'signature', 'nickname'), $v['uid']);
     }
     unset($v);
     $this->assign('lists', $list);
     $this->assign('nickname', $nickname);
     $this->display();
 }
开发者ID:yaomoo,项目名称:bbs,代码行数:15,代码来源:IndexController.class.php



注:本文中的op_t函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP op_text_field函数代码示例发布时间:2022-05-15
下一篇:
PHP op_post函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap