本文整理汇总了PHP中tsDecode函数的典型用法代码示例。如果您正苦于以下问题:PHP tsDecode函数的具体用法?PHP tsDecode怎么用?PHP tsDecode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tsDecode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOneComment
public function getOneComment($commentid)
{
$strComment = $this->find('weibo_comment', array('commentid' => $commentid));
$strComment['content'] = tsDecode($strComment['content']);
$strComment['user'] = aac('user')->getOneUser($strComment['userid']);
return $strComment;
}
示例2: recommendtopic
function recommendtopic()
{
$arrTopics = aac('group')->findAll('group_topic', array('isaudit' => 0, 'isrecommend' => 1), 'uptime desc', null, 10);
foreach ($arrTopics as $key => $item) {
$arrTopic[$key] = $item;
$arrTopic[$key]['title'] = tsTitle($item['title']);
// 标题过滤
$arrTopic[$key]['desc'] = tsCutContent(strip_tags($item['content']), 50);
// 简介
$arrTopic[$key]['user'] = aac('user')->getOneUser($item['userid']);
// 用户信息
$arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
// 群组信息
/* 匹配标题图片 */
$pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/";
preg_match($pattern, tsDecode($item['content']), $match);
if (!$match[1]) {
// 内容里面没有图片
$match[0] = '<img src="/plugins/home/recommendtopic/images/default.png" />';
$match[1] = '/plugins/home/recommendtopic/images/default.png';
}
$arrTopic[$key]['thumb'] = $match;
}
include template('recommendtopic', 'recommendtopic');
}
示例3: article
function article()
{
$arrArticle = aac('article')->findAll('article', array('isaudit' => 0), 'addtime desc', null, 10);
foreach ($arrArticle as $key => $item) {
$arrArticle[$key]['title'] = tsTitle($item['title']);
$arrArticle[$key]['content'] = tsDecode($item['content']);
}
include template('article', 'article');
}
示例4: weibo
function weibo()
{
$arrWeibo = aac('weibo')->findAll('weibo', null, 'addtime desc', null, 10);
foreach ($arrWeibo as $key => $item) {
$arrWeibo[$key]['content'] = tsDecode($item['content']);
$arrWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
include template('weibo', 'weibo');
}
示例5: index
public function index()
{
//dump($GLOBALS);
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('weibo', 'index', array('page' => ''));
$lstart = $page * 20 - 20;
$arrWeibo = $this->findAll('weibo', array('isaudit' => 0), 'uptime desc', null, $lstart . ',20');
foreach ($arrWeibo as $key => $item) {
$arrWeibo[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrWeibo[$key]['content'] = tsDecode($item['content']);
}
$weiboNum = $this->findCount('weibo', array('isaudit' => 0));
$pageUrl = pagination($weiboNum, 20, $page, $url);
$title = '唠叨';
include template('index');
}
示例6: show
public function show()
{
$weiboid = intval($_GET['id']);
$strWeibo = $this->getOneWeibo($weiboid);
if ($weiboid == 0 || $strWeibo == '') {
ts404();
}
if ($strWeibo['isaudit'] == 1) {
tsNotice('内容审核中...');
}
//comment
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('weibo', 'show', array('id' => $weiboid, 'page' => ''));
$lstart = $page * 20 - 20;
$arrComments = $this->findAll('weibo_comment', array('weiboid' => $weiboid), 'addtime desc', 'commentid', $lstart . ',20');
foreach ($arrComments as $key => $item) {
$arrComment[] = $this->getOneComment($item['commentid']);
}
$commentNum = $this->findCount('weibo_comment', array('weiboid' => $weiboid));
$pageUrl = pagination($commentNum, 20, $page, $url);
$title = cututf8(t(tsDecode($strWeibo['content'])), 0, 100, false);
include template('show');
}
示例7: foreach
foreach ($arrFeeds as $key => $item) {
$data = json_decode($item['data'], true);
if (is_array($data)) {
foreach ($data as $key => $itemTmp) {
$tmpkey = '{' . $key . '}';
$tmpdata[$tmpkey] = tsTitle(urldecode($itemTmp));
}
}
}
$arrFeeds = aac('group')->findAll('group_topic', array('userid' => $strUser['userid']), 'addtime desc', null, 25);
foreach ($arrFeeds as $key => $item) {
$arrFeed[$key] = $item;
$arrFeed[$key]['title'] = tsTitle($item['title']);
// 标题过滤
$arrFeed[$key]['desc'] = tsCutContent(strip_tags($item['content']), 90);
// 简介
$arrFeed[$key]['user'] = aac('user')->getOneUser($item['userid']);
// 用户信息
$arrFeed[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
// 群组信息
/* 匹配标题图片 */
$pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/";
preg_match($pattern, tsDecode($item['content']), $match);
if (!$match[1]) {
// 内容里面没有图片
$match[0] = '<img src="/plugins/home/newtopics/images/default.png" />';
$match[1] = '/plugins/home/newtopics/images/default.png';
}
$arrFeed[$key]['thumb'] = $match;
}
include template("space");
示例8: defined
<?php
defined('IN_TS') or die('Access Denied.');
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('photo', 'my', array('my' => 'index', 'page' => ''));
$lstart = $page * 6 - 6;
$arrAlbum = $new['photo']->findAll('photo_album', array('userid' => $strUser['userid']), 'albumid desc', null, $lstart . ',6');
foreach ($arrAlbum as $key => $item) {
$arrAlbum[$key]['albumname'] = tsDecode($item['albumname']);
$arrAlbum[$key]['albumdesc'] = tsDecode($item['albumdesc']);
}
$albumNum = $new['photo']->findCount('photo_album', array('userid' => $strUser['userid']));
$pageUrl = pagination($albumNum, 6, $page, $url);
$title = '我的圖';
include template('my/index');
示例9: array
$topicTypeNum = $new['group']->findCount('group_topic', array('typeid' => $typeid));
$new['group']->update('group_topic_type', array('typeid' => $typeid), array('count_topic' => $topicTypeNum));
}
// 处理标签
aac('tag')->addTag('topic', 'topicid', $topicid, $tag);
// 统计需要审核的帖子
$count_topic_audit = $new['group']->findCount('group_topic', array('groupid' => $groupid, 'isaudit' => '1'));
// 统计小组下帖子数并更新
$count_topic = $new['group']->findCount('group_topic', array('groupid' => $groupid));
// 统计今天发布帖子数
$today_start = strtotime(date('Y-m-d 00:00:00'));
$today_end = strtotime(date('Y-m-d 23:59:59'));
$count_topic_today = $new['group']->findCount('group_topic', "`groupid`='{$groupid}' and `addtime`='{$today_start}'");
$new['group']->update('group', array('groupid' => $groupid), array('count_topic' => $count_topic, 'count_topic_audit' => $count_topic_audit, 'count_topic_today' => $count_topic_today, 'uptime' => time()));
// 对积分进行处理
aac('user')->doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts']);
// feed开始
if ($strGroup['joinway'] == 0) {
$feed_template = '<span class="pl">发布了帖子:<a href="{link}">{title}</a></span><div class="quote"><span class="inq">{content}</span> <span><a class="j a_saying_reply" href="{link}" rev="unfold">回应</a></span></div>';
$feed_data = array('link' => tsurl('group', 'topic', array('id' => $topicid)), 'title' => $title, 'content' => cututf8(t(tsDecode($content)), '0', '50'));
aac('feed')->add($userid, $feed_template, $feed_data);
// feed结束
}
// QQ分享
$arrShare = array('content' => $title . '[ThinkSAAS社区]' . tsUrl('group', 'topic', array('id' => $topicid)));
doAction('qq_share', $arrShare);
// 微博分享
doAction('weibo_share', $title . '[ThinkSAAS社区]' . tsUrl('group', 'topic', array('id' => $topicid)));
header("Location: " . tsUrl('group', 'topic', array('id' => $topicid)));
break;
}
示例10: tsXimg
<div class="content">
<?php
if ($item['photo']) {
?>
<a target="_blank" href="<?php
echo SITE_URL;
?>
uploadfile/weibo/<?php
echo $item['photo'];
?>
"><img src="<?php
echo tsXimg($item['photo'], 'weibo', 240, '', $item['path']);
?>
" /></a><?php
}
echo tsDecode($item['content']);
?>
</div>
<p style="text-align:right;">
<a href="<?php
echo tsurl('weibo', 'show', array('id' => $item['weiboid']));
?>
"><?php
if ($item['count_comment'] > '0') {
?>
(<?php
echo $item['count_comment'];
?>
)<?php
}
示例11: array
//小组分类
$arrGroupCate = $new['group']->findAll('group_cate', array('referid' => 0));
// 所有小组
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$lstart = $page * 24 - 24;
$url = tsUrl('group', 'index', array('page' => ''));
$arr = array('isaudit' => 0);
if ($cateid) {
$strCate = $new['group']->find('group_cate', array('cateid' => $cateid));
$url = tsUrl('group', 'index', array('cateid' => $cateid, 'page' => ''));
$arr = array('cateid' => $cateid, 'isaudit' => 0);
}
$arrGroup = $new['group']->findAll('group', $arr, 'isrecommend desc,addtime asc', null, $lstart . ',24');
foreach ($arrGroup as $key => $item) {
$arrGroup[$key]['groupname'] = tsTitle($item['groupname']);
$arrGroup[$key]['groupdesc'] = cututf8(t(tsDecode($item['groupdesc'])), 0, 35);
}
$groupNum = $new['group']->findCount('group', $arr);
$pageUrl = pagination($groupNum, 24, $page, $url);
// 我加入的小组
$myGroup = array();
if ($TS_USER['userid']) {
$myGroups = $new['group']->findAll('group_user', array('userid' => $TS_USER['userid']), null, 'groupid');
foreach ($myGroups as $item) {
$myGroup[] = $item['groupid'];
}
}
// 最新10个小组
$arrNewGroup = $new['group']->getNewGroup('10');
// 热门帖子
$arrTopics = $new['group']->findAll('group_topic', null, 'count_comment desc', 'groupid,topicid,title,count_comment', 10);
示例12: tsNotice
tsNotice('留言内容不能为空!');
}
aac('system')->antiWord($content);
$new['user']->create('user_gb', array('userid' => $userid, 'touserid' => $touserid, 'content' => $content, 'addtime' => date('Y-m-d H:i:s')));
//发送系统消息
$msg_userid = '0';
$msg_touserid = $touserid;
$msg_content = '有人在你的留言板上留言了哦,快去看看吧!<br />' . tsUrl('user', 'space', array('id' => $touserid));
aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
tsNotice('留言成功!');
break;
case "redo":
$userid = $new['user']->isLogin();
$touserid = intval($_POST['touserid']);
$reid = intval($_POST['reid']);
$content = tsDecode($_POST['content']);
$arrContent = explode('#', $content);
$content = $arrContent['1'];
if ($content == '') {
tsNotice('留言不能为空!');
}
aac('system')->antiWord($content);
$new['user']->create('user_gb', array('userid' => $userid, 'reid' => $reid, 'touserid' => $touserid, 'content' => $content, 'addtime' => date('Y-m-d H:i:s')));
//发送系统消息
$msg_userid = '0';
$msg_touserid = $touserid;
$msg_content = '有人在你的留言板上留言了哦,快去看看吧!<br />' . tsUrl('user', 'space', array('id' => $touserid));
aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
tsNotice('回复成功!');
break;
//删除留言
示例13: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
case "":
$userid = aac('user')->isLogin();
$albumid = intval($_GET['albumid']);
$strAlbum = $new['attach']->find('attach_album', array('albumid' => $albumid));
$strAlbum['title'] = tsTitle($strAlbum['title']);
$strAlbum['content'] = tsDecode($strAlbum['content']);
if ($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
$title = '上传资料';
include template('upload');
} else {
tsNotice('非法操作!');
}
break;
case "do":
$albumid = intval($_POST['albumid']);
$verifyToken = md5('unique_salt' . $addtime);
$strAlbum = $new['attach']->find('attach_album', array('albumid' => $albumid));
if ($albumid == 0 || $_POST['tokens'] != $verifyToken || $strAlbum == '') {
echo 00;
exit;
}
$attachid = $new['attach']->create('attach', array('albumid' => $strAlbum['albumid'], 'userid' => $strAlbum['userid'], 'addtime' => date('Y-m-d H:i:s')));
//上传
$arrUpload = tsUpload($_FILES['Filedata'], $attachid, 'attach', array('xls', 'xlsx', 'pptx', 'docx', 'pdf', 'jpg', 'gif', 'png', 'rar', 'zip', 'doc', 'ppt', 'txt'));
if ($arrUpload) {
$new['attach']->update('attach', array('attachid' => $attachid), array('attachname' => $arrUpload['name'], 'attachtype' => $arrUpload['type'], 'attachurl' => $arrUpload['url'], 'attachsize' => $arrUpload['size']));
//统计
示例14: tsCutContent
function tsCutContent($text, $length = 50)
{
$text = cututf8(t(tsDecode($text)), 0, $length);
return $text;
}
示例15: defined
defined('IN_TS') or die('Access Denied.');
// 用户是否登录
$userid = aac('user')->isLogin();
//普通不用不允许编辑内容
if ($TS_SITE['isallowedit'] && $TS_USER['isadmin'] == 0) {
tsNotice('系统不允许用户编辑内容,请联系管理员编辑!');
}
switch ($ts) {
case "":
$articleid = intval($_GET['articleid']);
$cateid = intval($_GET['cateid']);
$strArticle = $new['article']->find('article', array('articleid' => $articleid));
if ($strArticle['userid'] == $userid || $TS_USER['isadmin'] == 1) {
$strArticle['title'] = stripslashes($strArticle['title']);
$strArticle['content'] = tsDecode($strArticle['content']);
// 找出TAG
$arrTags = aac('tag')->getObjTagByObjid('article', 'articleid', $articleid);
foreach ($arrTags as $key => $item) {
$arrTag[] = $item['tagname'];
}
$strArticle['tag'] = arr2str($arrTag);
$title = '修改文章';
include template('edit');
} else {
tsNotice('非法操作!');
}
break;
case "do":
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');