当前位置: 首页>>代码示例>>PHP>>正文


PHP tsTitle函数代码示例

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


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

示例1: 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');
}
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:25,代码来源:recommendtopic.php

示例2: getOneUser

 function getOneUser($userid)
 {
     $strUser = $this->find('user_info', array('userid' => $userid));
     if ($strUser) {
         $strUser['username'] = tsTitle($strUser['username']);
         $strUser['email'] = tsTitle($strUser['email']);
         $strUser['phone'] = tsTitle($strUser['phone']);
         $strUser['province'] = tsTitle($strUser['province']);
         $strUser['city'] = tsTitle($strUser['city']);
         $strUser['signed'] = tsTitle($strUser['signed']);
         $strUser['about'] = tsTitle($strUser['about']);
         $strUser['address'] = tsTitle($strUser['address']);
         if ($strUser['face'] && $strUser['path']) {
             $strUser['face'] = tsXimg($strUser['face'], 'user', 120, 120, $strUser['path'], 1);
         } elseif ($strUser['face'] && $strUser['path'] == '') {
             $strUser['face'] = SITE_URL . 'public/images/' . $strUser['face'];
         } else {
             //没有头像
             $strUser['face'] = SITE_URL . 'public/images/user_large.jpg';
         }
     } else {
         $strUser = '';
     }
     return $strUser;
 }
开发者ID:omusico,项目名称:ThinkSAAS,代码行数:25,代码来源:class.user.php

示例3: photo

function photo()
{
    $arrAlbum = aac('photo')->findAll('photo_album', array('isrecommend' => 1), 'addtime desc', null, 12);
    foreach ($arrAlbum as $key => $item) {
        $arrAlbum[$key]['albumname'] = tsTitle($item['albumname']);
    }
    include template('photo', 'photo');
}
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:8,代码来源:photo.php

示例4: 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');
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:9,代码来源:article.php

示例5: newtopic

function newtopic()
{
    global $db;
    //最新帖子
    $arrTopics = aac('group')->findAll('group_topic', array('isaudit' => 0), 'uptime desc', null, 35);
    foreach ($arrTopics as $key => $item) {
        $arrTopic[] = $item;
        $arrTopic[$key]['title'] = tsTitle($item['title']);
        $arrTopic[$key]['user'] = aac('user')->getOneUser($item['userid']);
        $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
    }
    include template('newtopic', 'newtopic');
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:13,代码来源:newtopic.php

示例6: tag

function tag()
{
    //最新标签
    $arrTag = aac('tag')->findAll('tag', "`count_topic`>'0'", 'uptime desc', null, 30);
    foreach ($arrTag as $key => $item) {
        $arrTag[$key]['tagname'] = tsTitle($item['tagname']);
    }
    //echo '<div class="bbox">'.doAction('gobad','home_left_1').'</div>';
    echo '<div class="panel panel-default">';
    echo '<div class="panel-heading">热门标签<small><a href="' . tsUrl('group', 'tags') . '">更多</a></small></div>';
    echo '<div class="panel-body tags">';
    foreach ($arrTag as $key => $item) {
        echo '<a href="' . tsUrl('group', 'tag', array('id' => urlencode($item['tagname']))) . '">' . $item['tagname'] . '</a>';
    }
    echo '</div></div>';
    //echo '<div class="bbox">'.doAction('gobad','home_left_2').'</div>';
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:17,代码来源:tag.php

示例7: newgroup

function newgroup()
{
    $arrNewGroups = aac('group')->findAll('group', array('isaudit' => 0), 'addtime desc', null, 10);
    foreach ($arrNewGroups as $key => $item) {
        $arrNewGroup[] = $item;
        $arrNewGroup[$key]['groupname'] = tsTitle($item['groupname']);
        $arrNewGroup[$key]['user'] = aac('user')->find('user_info', array('userid' => $item['userid']), 'userid,username');
    }
    echo '<div class="panel panel-default">';
    echo '<div class="panel-heading">最新创建小组</div>';
    echo '<div class="panel-body commlist"><ul>';
    foreach ($arrNewGroup as $key => $item) {
        echo '<li><a href="' . tsUrl('group', 'show', array('id' => $item['groupid'])) . '">' . $item['groupname'] . '</a> By <a href="' . tsUrl('user', 'space', array('id' => $item['user']['userid'])) . '">' . $item['user']['username'] . '</a></li>';
    }
    echo '</ul></div>';
    echo '</div>';
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:17,代码来源:newgroup.php

示例8: getHotArticle

 /**
 * @param $day
 * @param int $cateid
 * @return mixed
 */
 public function getHotArticle($day, $cateid = 0)
 {
     $startTime = time() - $day * 3600 * 60;
     $startTime = date('Y-m-d', $startTime);
     $endTime = date('Y-m-d');
     if ($day == 30) {
         $endTime = date('Y-m-d', time() - 7 * 3600 * 60);
     }
     if ($cateid) {
         $arr = "`cateid`='{$cateid}' and `count_view`>'0' and `addtime`>'{$startTime}' and `addtime`<'{$endTime}' and `isaudit`='0'";
     } else {
         $arr = "`addtime`>'{$startTime}' and `count_view`>'0' and `addtime`<'{$endTime}' and `isaudit`='0'";
     }
     $arrArticle = $this->findAll('article', $arr, 'addtime desc', 'articleid,title', 10);
     foreach ($arrArticle as $key => $item) {
         $arrArticle[$key]['title'] = tsTitle($item['title']);
     }
     return $arrArticle;
 }
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:24,代码来源:class.article.php

示例9: defined

<?php

defined('IN_TS') or die('Access Denied.');
//资料库
$arrAlbum = $new['attach']->findAll('attach_album', array('isaudit' => 0), 'addtime desc', null, 15);
foreach ($arrAlbum as $key => $item) {
    $arrAlbum[$key]['title'] = tsTitle($item['title']);
    $arrAlbum[$key]['content'] = tsTitle($item['content']);
    $arrAlbum[$key]['user'] = aac('user')->getOneUser($item['userid']);
    $new['attach']->update('attach_album', array('albumid' => $item['albumid']), array('count_attach' => $arrAlbum[$key]['count_attach']));
}
$arrAttach = $new['attach']->findAll('attach', null, 'addtime desc', null, 20);
foreach ($arrAttachs as $key => $item) {
    $arrAttach[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
$sitekey = $TS_APP['appkey'];
$sitedesc = $TS_APP['appdesc'];
include template("index");
开发者ID:zwkuang,项目名称:ThinkSAAS,代码行数:18,代码来源:index.php

示例10: defined

<?php

defined('IN_TS') or die('Access Denied.');
//资料库
$arrAlbum = $new['attach']->findAll('attach_album', array('isaudit' => 0), 'addtime desc', null, 15);
foreach ($arrAlbum as $key => $item) {
    $arrAlbum[$key]['title'] = tsTitle($item['title']);
    $arrAlbum[$key]['content'] = tsDecode($item['content']);
    $arrAlbum[$key]['user'] = aac('user')->getOneUser($item['userid']);
    $new['attach']->update('attach_album', array('albumid' => $item['albumid']), array('count_attach' => $arrAlbum[$key]['count_attach']));
}
$arrAttach = $new['attach']->findAll('attach', null, 'addtime desc', null, 20);
foreach ($arrAttachs as $key => $item) {
    $arrAttach[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
$sitekey = $TS_APP['appkey'];
$sitedesc = $TS_APP['appdesc'];
include template("index");
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:18,代码来源:index.php

示例11: defined

<?php

defined('IN_TS') or die('Access Denied.');
$attachid = intval($_GET['id']);
$strAttach = $new['attach']->find('attach', array('attachid' => $attachid));
$strAttach['album'] = $new['attach']->find('attach_album', array('albumid' => $strAttach['albumid']));
$strAttach['album']['title'] = tsTitle($strAttach['album']['title']);
$strAttach['album']['content'] = tsDecode($strAttach['album']['content']);
$strAttach['user'] = aac('user')->getOneUser($strAttach['userid']);
$userAttach = $new['attach']->findAll('attach', array('userid' => $strAttach['userid'], 'isaudit' => 0));
$title = $strAttach['attachname'];
include template("show");
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:12,代码来源:show.php

示例12: 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']));
            //统计
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:31,代码来源:upload.php

示例13: defined

<?php

defined('IN_TS') or die('Access Denied.');
// 列表
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('article', 'index', array('page' => ''));
$lstart = $page * 10 - 10;
$arrArticles = $new['article']->findAll('article', array('isaudit' => '0'), 'addtime desc', null, $lstart . ',10');
$articleNum = $new['article']->findCount('article', array('isaudit' => '0'));
$pageUrl = pagination($articleNum, 10, $page, $url);
foreach ($arrArticles as $key => $item) {
    $arrArticle[] = $item;
    $arrArticle[$key]['title'] = tsTitle($item['title']);
    $arrArticle[$key]['content'] = cututf8(t(tsDecode($item['content'])), 0, 100);
    $arrArticle[$key]['user'] = aac('user')->getOneUser($item['userid']);
    $arrArticle[$key]['cate'] = $new['article']->find('article_cate', array('cateid' => $item['cateid']));
}
// 推荐阅读
$arrRecommend = $new['article']->getRecommendArticle();
// 一周热门
$arrHot7 = $new['article']->getHotArticle(7);
// 一月热门
$arrHot30 = $new['article']->getHotArticle(30);
$sitekey = $TS_APP['appkey'];
$sitedesc = $TS_APP['appdesc'];
$title = '文章';
include template('index');
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:27,代码来源:index.php

示例14: intval

 //某一个圖
 case "":
     $albumid = intval($_GET['id']);
     $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
     //404
     if ($strAlbum == '') {
         header("HTTP/1.1 404 Not Found");
         header("Status: 404 Not Found");
         $title = '404';
         include pubTemplate("404");
         exit;
     }
     if ($strAlbum['isaudit'] == 1) {
         tsNotice('内容审核中...');
     }
     $strAlbum['albumname'] = tsTitle($strAlbum['albumname']);
     $strAlbum['albumdesc'] = tsDecode($strAlbum['albumdesc']);
     $page = isset($_GET['page']) ? intval($_GET['page']) : '1';
     $url = tsUrl('photo', 'album', array('id' => $albumid, 'page' => ''));
     $lstart = $page * 30 - 30;
     $strUser = aac('user')->getOneUser($strAlbum['userid']);
     $arrPhoto = $new['photo']->findAll('photo', array('albumid' => $albumid), 'photoid desc', null, $lstart . ',30');
     foreach ($arrPhoto as $key => $item) {
         $arrPhoto[$key]['photodesc'] = stripslashes($item['photodesc']);
     }
     $photoNum = $new['photo']->findCount('photo', array('albumid' => $albumid));
     $pageUrl = pagination($photoNum, 30, $page, $url);
     if ($TS_USER['userid'] == $strAlbum['userid']) {
         $title = '' . $strAlbum['albumname'];
     } else {
         $title = $strAlbum['albumname'];
开发者ID:994837457,项目名称:BreakNgThinksaas,代码行数:31,代码来源:album.php

示例15: tsTitle

     }
     $strAlbum['title'] = tsTitle($strAlbum['title']);
     $strAlbum['content'] = tsTitle($strAlbum['content']);
     $strAlbum['user'] = aac('user')->getOneUser($strAlbum['userid']);
     $arrAttach = $new['attach']->findAll('attach', array('albumid' => $albumid));
     $title = $strAlbum['title'];
     include template('album');
     break;
     //修改
 //修改
 case "edit":
     $userid = aac('user')->isLogin();
     $albumid = intval($_GET['albumid']);
     $strAlbum = $new['attach']->find('attach_album', array('albumid' => $albumid));
     $strAlbum['title'] = tsTitle($strAlbum['title']);
     $strAlbum['content'] = tsTitle($strAlbum['content']);
     if ($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
         $title = '修改资料库';
         include template('album_edit');
     }
     break;
 case "editdo":
     $userid = aac('user')->isLogin();
     $albumid = intval($_POST['albumid']);
     $strAlbum = $new['attach']->find('attach_album', array('albumid' => $albumid));
     $title = trim($_POST['title']);
     $content = trim($_POST['content']);
     if ($title == '' || $content == '') {
         tsNotice('资料库标题和内容不能为空!');
     }
     if ($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
开发者ID:zwkuang,项目名称:ThinkSAAS,代码行数:31,代码来源:album.php


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