本文整理匯總了PHP中tsUrl函數的典型用法代碼示例。如果您正苦於以下問題:PHP tsUrl函數的具體用法?PHP tsUrl怎麽用?PHP tsUrl使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了tsUrl函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: signuser
function signuser()
{
$arrUser = aac('user')->getHotUser(20);
echo '<div class="panel panel-default">';
echo '<div class="panel-heading">最新簽到用戶</div>';
echo '<div class="panel-body facelist"><ul>';
foreach ($arrUser as $key => $item) {
echo '<li><a href="' . tsUrl('user', 'space', array('id' => $item['userid'])) . '"><img class="img-circle" src="' . $item['face'] . '" alt="' . $item['username'] . '" width="48" height="48" /></a><div><a href="' . tsUrl('user', 'space', array('id' => $item['userid'])) . '">' . cututf8(t($item['username']), 0, 5, false) . '</a></div></li>';
}
echo '</ul></div><div class="clear"></div></div>';
}
示例2: index
public function index()
{
$strUser = aac('user')->getOneUser($GLOBALS['TS_USER']['userid']);
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('weibo', 'my', array('my' => 'index', 'page' => ''));
$lstart = $page * 20 - 20;
$arrWeibo = $this->findAll('weibo', array('userid' => $strUser['userid']), 'uptime desc', null, $lstart . ',20');
$weiboNum = $this->findCount('weibo', array('userid' => $strUser['userid']));
$pageUrl = pagination($weiboNum, 20, $page, $url);
$title = '我的嘮叨';
include template('my/index');
}
示例3: hottopic
function hottopic()
{
$arrHotTopics = aac('group')->getHotTopic(7);
echo '<div class="panel panel-default">';
echo '<div class="panel-heading">熱門話題</div>';
echo '<div class="panel-body commlist">';
echo '<ul>';
foreach ($arrHotTopics as $key => $item) {
echo '<li><a href="' . tsUrl('group', 'topic', array('id' => $item['topicid'])) . '">' . cututf8(stripslashes($item['title']), 0, 20, false) . '</a> (' . $item['count_view'] . ')</li>';
}
echo '</ul>';
echo '</div>';
echo '</div>';
}
示例4: 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>';
}
示例5: 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>';
}
示例6: recommendgroup
function recommendgroup()
{
$arrRecommendGroup = aac('group')->getRecommendGroup('12');
echo '<div class="panel panel-default">';
echo '<div class="panel-heading">推薦小組</div>';
echo '<div class="panel-body">';
foreach ($arrRecommendGroup as $key => $item) {
$count_user = $item['count_user'];
echo '<div class="sub-item">
<div class="pic">
<a href="' . tsUrl('group', 'show', array('id' => $item[groupid])) . '">
<img src="' . $item['photo'] . '" alt="' . $item['groupname'] . '" title="' . $item['groupname'] . '" />
</a>
</div>
<div class="info">
<a href="' . tsUrl('group', 'show', array('id' => $item[groupid])) . '">' . $item['groupname'] . '</a> (' . $count_user . ')
<p>' . cututf8(t($item['groupdesc']), 0, 50) . '</p>
</div>
</div>';
}
echo '</div>';
echo '<div class="clear"></div>';
echo '</div>';
}
示例7: aac
}
}
//判斷用戶是否上傳頭像,管理員除外
if ($TS_SITE['isface'] == 1 && intval($TS_USER['userid']) > 0 && $TS_URL['app'] != 'system' && $TS_URL['ac'] != 'admin') {
$faceUser = aac('user')->find('user_info', array('userid' => intval($TS_USER['userid'])));
if ($faceUser['face'] == '' && $TS_URL['app'] != 'user' && $TS_USER['isadmin'] != 1) {
tsHeaderUrl(tsUrl('user', 'verify', array('ts' => 'face')));
}
}
//用戶自動登錄
if (intval($TS_USER['userid']) == 0 && $_COOKIE['ts_email'] && $_COOKIE['ts_autologin']) {
$loginUserNum = aac('user')->findCount('user_info', array('email' => $_COOKIE['ts_email'], 'autologin' => $_COOKIE['ts_autologin']));
if ($loginUserNum > 0) {
$loginUserData = aac('user')->find('user_info', array('email' => $_COOKIE['ts_email']), 'userid,username,path,face,ip,isadmin,signin,uptime');
if ($loginUserData['ip'] != getIp() && $TS_URL['app'] != 'user' && $TS_URL['ac'] != 'login') {
tsHeaderUrl(tsUrl('user', 'login', array('ts' => 'out')));
}
//用戶session信息
$_SESSION['tsuser'] = array('userid' => $loginUserData['userid'], 'username' => $loginUserData['username'], 'path' => $loginUserData['path'], 'face' => $loginUserData['face'], 'isadmin' => $loginUserData['isadmin'], 'signin' => $loginUserData['signin'], 'uptime' => $loginUserData['uptime']);
$TS_USER = $_SESSION['tsuser'];
}
}
$tsHooks = array();
if ($TS_URL['app'] != 'system' && $TS_URL['app'] != 'pubs') {
//加載公用插件
$public_plugins = fileRead('data/pubs_plugins.php');
if ($public_plugins == '') {
$public_plugins = $tsMySqlCache->get('pubs_plugins');
}
if ($public_plugins && is_array($public_plugins)) {
foreach ($public_plugins as $item) {
示例8: defined
<?php
defined('IN_TS') or die('Access Denied.');
include 'userinfo.php';
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('user', 'topic', array('id' => $strUser['userid'], 'page' => ''));
$lstart = $page * 30 - 30;
$arrTopic = $new['user']->findAll('group_topic', array('userid' => $strUser['userid']), 'addtime desc', null, $lstart . ',30');
$topicNum = $new['user']->findCount('group_topic', array('userid' => $strUser['userid']));
$pageUrl = pagination($topicNum, 30, $page, $url);
$title = $strUser['username'] . '的帖子';
include template('topic');
示例9: arr2str
$sitekey = arr2str($arrTag);
} else {
$sitekey = $strTopic['title'];
}
//標題
$title = $strTopic['title'];
// 評論列表開始
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('group', 'topic', array('id' => $topicid, 'page' => ''));
$lstart = $page * 15 - 15;
$arrComment = $new['group']->findAll('group_topic_comment', array('topicid' => $topicid), 'addtime asc', null, $lstart . ',15');
foreach ($arrComment as $key => $item) {
$arrTopicComment[] = $item;
$arrTopicComment[$key]['l'] = ($page - 1) * 15 + $key + 1;
$arrTopicComment[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrTopicComment[$key]['content'] = @preg_replace("/\\[@(.*)\\:(.*)]/U", "<a href='" . tsUrl('user', 'space', array('id' => '$2')) . " ' rel=\"face\" uid=\"\$2\"'>@\$1</a>", tsDecode($item['content']));
$arrTopicComment[$key]['recomment'] = $new['group']->recomment($item['referid']);
}
$commentNum = $new['group']->findCount('group_topic_comment', array('topicid' => $strTopic['topicid']));
$pageUrl = pagination($commentNum, 15, $page, $url);
// 評論列表結束
//7天內的熱門帖子
$arrHotTopic = $new['group']->getHotTopic(7);
//推薦帖子
$arrRecommendTopic = $new['group']->getRecommendTopic();
//本組熱門帖子
$arrGroupHotTopic = $new['group']->findAll('group_topic', array('groupid' => $strGroup['groupid'], 'isaudit' => 0), 'count_view desc', null, 10);
$sitedesc = cututf8(t($strTopic['content']), 0, 100);
include template('topic');
// 增加瀏覽次數
$new['group']->update('group_topic', array('topicid' => $strTopic['topicid']), array('count_view' => $strTopic['count_view'] + 1));
示例10: aac
//必須上傳頭像
case "face":
$userid = aac('user')->isLogin();
$strUser = $new['user']->getOneUser($userid);
$title = '上傳頭像';
include template('verify_face');
break;
case "facedo":
$userid = aac('user')->isLogin();
if ($_FILES['picfile']) {
//上傳
$arrUpload = tsUpload($_FILES['picfile'], $userid, 'user', array('jpg', 'gif', 'png'));
if ($arrUpload) {
$new['user']->update('user_info', array('userid' => $userid), array('path' => $arrUpload['path'], 'face' => $arrUpload['url']));
$filesize = abs(filesize('uploadfile/user/' . $arrUpload['url']));
if ($filesize <= 0) {
$new['user']->update('user_info', array('userid' => $userid), array('path' => '', 'face' => ''));
tsNotice('上傳頭像失敗!');
} else {
//更新緩存頭像
$_SESSION['tsuser']['face'] = $arrUpload['url'];
$_SESSION['tsuser']['path'] = $arrUpload['path'];
tsDimg($arrUpload['url'], 'user', '120', '120', $arrUpload['path']);
header('Location: ' . tsUrl('user', 'verify', array('ts' => 'face')));
}
} else {
tsNotice('頭像修改失敗');
}
}
break;
}
示例11: defined
<?php
defined('IN_TS') or die('Access Denied.');
//修改單個圖片信息
$userid = aac('user')->isLogin();
switch ($ts) {
case "":
$photoid = intval($_GET['photoid']);
$strPhoto = $new['photo']->find('photo', array('photoid' => $photoid));
$strPhoto['photoname'] = stripslashes($strPhoto['photoname']);
$strPhoto['photodesc'] = stripslashes($strPhoto['photodesc']);
if ($strPhoto['userid'] == $userid || $TS_USER['isadmin'] == 1) {
$title = '修改圖片信息';
include template('photo_edit');
} else {
tsNotice('非法操作!');
}
break;
case "do":
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');
}
$photoid = intval($_POST['photoid']);
$photoname = tsClean($_POST['photoname']);
$photodesc = tsClean($_POST['photodesc']);
$new['photo']->update('photo', array('photoid' => $photoid), array('photoname' => $photoname, 'photodesc' => $photodesc));
header('Location: ' . tsUrl('photo', 'show', array('id' => $photoid)));
break;
}
示例12: template
case "":
$title = '創建圖';
include template("create");
break;
case "do":
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');
}
//用戶是否登錄
$userid = aac('user')->isLogin();
$albumname = trim($_POST['albumname']);
$albumdesc = tsClean($_POST['albumdesc']);
if ($albumname == '') {
tsNotice("圖名稱不能為空!");
}
//1審核後顯示0不審核
if ($TS_APP['isaudit'] == 1) {
$isaudit = 1;
} else {
$isaudit = 0;
}
if ($TS_USER['isadmin'] == 0) {
//過濾內容開始
aac('system')->antiWord($albumname);
aac('system')->antiWord($albumdesc);
//過濾內容結束
}
$albumid = $new['photo']->create('photo_album', array('userid' => $userid, 'albumname' => $albumname, 'albumdesc' => $albumdesc, 'isaudit' => $isaudit, 'addtime' => date('Y-m-d H:i:s'), 'uptime' => date('Y-m-d H:i:s')));
header("Location: " . tsUrl('photo', 'upload', array('albumid' => $albumid)));
break;
}
示例13: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
case "":
$cateid = intval($_GET['id']);
$strCate = $new['article']->find('article_cate', array('cateid' => $cateid));
// 列表
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('article', 'cate', array('id' => $cateid, 'page' => ''));
$lstart = $page * 10 - 10;
$arrArticles = $new['article']->findAll('article', array('cateid' => $cateid, 'isaudit' => 0), 'addtime desc', null, $lstart . ',10');
$articleNum = $new['article']->findCount('article', array('cateid' => $cateid, 'isaudit' => 0));
$pageUrl = pagination($articleNum, 10, $page, $url);
foreach ($arrArticles as $key => $item) {
$arrArticle[] = $item;
$arrArticle[$key]['title'] = stripslashes($item['title']);
$arrArticle[$key]['content'] = cututf8(t(tsDecode($item['content'])), 0, 150);
$arrArticle[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
// 推薦閱讀
$arrRecommend = $new['article']->getRecommendArticle();
// 一周熱門
$arrHot7 = $new['article']->getHotArticle(7);
// 一月熱門
$arrHot30 = $new['article']->getHotArticle(30);
$title = $strCate['catename'];
// SEO優化
$sitekey = $strCate['catename'];
$sitedesc = $strCate['catename'] . ' - 文章';
include template('cate');
示例14: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
case "":
include 'userinfo.php';
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('user', 'follow', array('id' => $strUser['userid'], 'page' => ''));
$lstart = $page * 80 - 80;
//關注的用戶
$arrUsers = $new['user']->findAll('user_follow', array('userid' => $strUser['userid']), 'addtime desc', null, $lstart . ',80');
$userNum = $new['user']->findCount('user_follow', array('userid' => $strUser['userid']));
$pageUrl = pagination($userNum, 80, $page, $url);
if (is_array($arrUsers)) {
foreach ($arrUsers as $item) {
$arrUser[] = $new['user']->getOneUser($item['userid_follow']);
}
}
$title = $strUser['username'] . '關注的人';
include template("follow");
break;
//關注執行
//關注執行
case "do":
$userid = intval($TS_USER['userid']);
$userid_follow = intval($_GET['userid']);
if ($_GET['token'] != $_SESSION['token']) {
echo json_encode(array('status' => 0, 'msg' => '非法操作!'));
exit;
}
if ($userid == 0) {
示例15: array
$groupUserNum = $new['group']->findCount('group_user', array('userid' => $iuserid, 'groupid' => $groupid));
if ($groupUserNum > 0) {
tsNotice('用戶已經加入小組!');
}
$new['group']->create('group_user', array('userid' => $iuserid, 'groupid' => $groupid, 'addtime' => time()));
//計算小組會員數
$count_user = $new['group']->findCount('group_user', array('groupid' => $groupid));
//更新小組成員統計
$new['group']->update('group', array('groupid' => $groupid), array('count_user' => $count_user));
//發送係統消息開始
$msg_userid = '0';
$msg_touserid = $iuserid;
$msg_content = '你被邀請加入一個小組,快去看看吧<br />' . tsUrl('group', 'show', array('id' => $groupid));
aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
//發送係統消息end
header('Location: ' . tsUrl('group', 'show', array('id' => $groupid)));
} else {
tsNotice('倒黴了吧?');
}
break;
//usertips
//usertips
case "usertips":
$data = fileRead('data/user_tips.php');
if ($data == '') {
$query = $db->fetch_all_assoc("select * from " . dbprefix . "user_info");
foreach ($query as $user) {
$usertip[] = array('user' => $user['username'], 'name' => $user['userid']);
}
fileWrite('user_tips.php', 'data', json_encode($usertip));
$data = fileRead('data/user_tips.php');