Ejemplo n.º 1
0
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');
}
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public function index()
 {
     $page = isset($_GET['page']) ? intval($_GET['page']) : '1';
     $url = tsurl('feed', 'index', array('page' => ''));
     $lstart = $page * 20 - 20;
     $arrFeeds = $this->findAll('feed', null, 'addtime desc', null, $lstart . ',20');
     $feedNum = $this->findCount("feed");
     $pageUrl = pagination($feedNum, 20, $page, $url);
     if ($page > 1) {
         $title = '社区动态 - 第' . $page . '页';
     } else {
         $title = '社区动态';
     }
     foreach ($arrFeeds as $key => $item) {
         $data = json_decode($item['data'], true);
         if (is_array($data)) {
             foreach ($data as $key => $itemTmp) {
                 $tmpkey = '{' . $key . '}';
                 $tmpdata[$tmpkey] = stripslashes(urldecode($itemTmp));
             }
         }
         $arrFeed[] = array('user' => aac('user')->getOneUser($item['userid']), 'content' => strtr($item['template'], $tmpdata), 'addtime' => $item['addtime']);
     }
     include template('index');
 }
Ejemplo n.º 4
0
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');
}
Ejemplo n.º 5
0
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');
}
Ejemplo n.º 6
0
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');
}
Ejemplo n.º 7
0
function login()
{
    global $TS_USER;
    if ($TS_USER['userid']) {
        $strUser = aac('user')->getOneUser($TS_USER['userid']);
        $strUser['rolename'] = aac('user')->getRole($strUser['count_score']);
    }
    include template('login', 'login');
}
Ejemplo n.º 8
0
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>';
}
Ejemplo n.º 9
0
 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');
 }
Ejemplo n.º 10
0
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');
}
Ejemplo n.º 11
0
function hottopic()
{
    $arrHotTopics = aac('group')->getHotTopic(7);
    echo '<div class="bs"><div class="bbox">';
    echo '<div class="btitle">热分享</div>';
    echo '<div class="bc 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></div>';
}
Ejemplo n.º 12
0
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>';
}
Ejemplo n.º 13
0
 function getEventComment($page = 1, $prePageNum, $eventid)
 {
     $start_limit = !empty($page) ? ($page - 1) * $prePageNum : 0;
     $limit = $prePageNum ? "LIMIT {$start_limit}, {$prePageNum}" : '';
     $arrGroupContentComment = $this->db->fetch_all_assoc("select * from " . dbprefix . "event_comment where eventid='{$eventid}' order by addtime desc {$limit}");
     if (is_array($arrGroupContentComment)) {
         foreach ($arrGroupContentComment as $key => $item) {
             //$arrGroupContentComment[$key]['user'] = $this->getUserData($item['userid']);
             $arrGroupContentComment[$key]['user'] = aac('user')->getOneUser($item['userid']);
             $arrGroupContentComment[$key]['content'] = hview($item['content']);
         }
     }
     return $arrGroupContentComment;
 }
Ejemplo n.º 14
0
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>';
}
Ejemplo n.º 15
0
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>';
}
Ejemplo n.º 16
0
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>';
}
Ejemplo n.º 17
0
    if (intval($verifyUser['isverify']) == 0 && $TS_URL['app'] != 'user' && $TS_USER['isadmin'] != 1) {
        tsHeaderUrl(tsUrl('user', 'verify'));
    }
}
//判断用户是否上传头像,管理员除外
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');
    }
Ejemplo n.º 18
0
<?php

defined('IN_TS') or die('Access Denied.');
/* 
 * 系统消息盒子
 */
$userid = '0';
$touserid = aac('user')->isLogin();
$arrMessages = $new['message']->findAll('message', array('userid' => 0, 'touserid' => $touserid), 'addtime desc', null, 10);
$pattern = '/(http:\\/\\/|https:\\/\\/|ftp:\\/\\/)([\\w:\\/\\.\\?=&-_]+)/is';
if (is_array($arrMessages)) {
    foreach ($arrMessages as $key => $item) {
        $arrMessage[] = $item;
        $arrMessage[$key]['content'] = nl2br(@preg_replace($pattern, '<a href="\\1\\2">\\1\\2</a>', $item['content']));
        $arrMessage[$key]['content'] = stripslashes(str_replace('[SITE_URL]', SITE_URL, $arrMessage[$key]['content']));
    }
}
//isread设为已读
$new['message']->update('message', array('userid' => 0, 'touserid' => $touserid, 'isread' => 0), array('isread' => 1));
$title = '系统消息';
include template("system");
Ejemplo n.º 19
0
<?php

defined('IN_TS') or die('Access Denied.');
include 'userinfo.php';
$arrGroupsList = $new['user']->findAll('group_user', array('userid' => $strUser['userid']), null, 'groupid');
foreach ($arrGroupsList as $key => $item) {
    $arrGroupList[] = aac('group')->getOneGroup($item['groupid']);
}
$title = $strUser['username'] . '的小组';
include template('group');
Ejemplo n.º 20
0
    }
    $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');
// 增加浏览次数
Ejemplo n.º 21
0
<?php

defined('IN_TS') or die('Access Denied.');
//活动类型
$typeid = intval($_GET['id']);
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$lstart = $page * 10 - 10;
if ($typeid == 0) {
    $url = tsUrl('event', 'type', array('page' => ''));
    $arr = null;
    $eventNum = $new['event']->findCount('event', array('isaudit' => 0));
    $title = '全部活动';
} else {
    $strType = $new['event']->find('event_type', array('typeid' => $typeid));
    $url = tsUrl('event', 'type', array('id' => $typeid, 'page' => ''));
    $arr = array('typeid' => $typeid, 'isaudit' => 0);
    $eventNum = $new['event']->findCount('event', $arr);
    $title = $strType['typename'];
}
$pageUrl = pagination($eventNum, 10, $page, $url);
$arrEvents = $new['event']->findAll('event', $arr, 'addtime desc', null, $lstart . ',10');
foreach ($arrEvents as $key => $item) {
    $arrEvent[] = $item;
    $arrEvent[$key]['title'] = htmlspecialchars($item['title']);
    $arrEvent[$key]['address'] = htmlspecialchars($item['address']);
    $arrEvent[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
include template("type");
Ejemplo n.º 22
0
        $scoreid = intval($_POST['scoreid']);
        $score = intval($_POST['score']);
        $app = trim($_POST['app']);
        $action = trim($_POST['action']);
        $ts = trim($_POST['ts']);
        $status = intval($_POST['status']);
        $new['user']->update('user_score', array('scoreid' => $scoreid), array('score' => $score, 'app' => $app, 'action' => $action, 'ts' => $ts, 'status' => $status));
        header('Location: ' . SITE_URL . 'index.php?app=user&ac=admin&mg=score&ts=list');
        break;
        //加积分
    //加积分
    case "send":
        include template('admin/score_send');
        break;
    case "senddo":
        $userid = intval($_POST['userid']);
        $score = intval($_POST['score']);
        $scorename = trim($_POST['scorename']);
        if ($userid && $score && $scorename) {
            aac('user')->addScore($userid, $scorename, $score);
            qiMsg('操作成功!');
        } else {
            qiMsg('操作失败!');
        }
        break;
    case "delete":
        $scoreid = intval($_GET['scoreid']);
        $new['user']->delete('user_score', array('scoreid' => $scoreid));
        qiMsg('删除成功!');
        break;
}
Ejemplo n.º 23
0
        $albumid = intval($_GET['albumid']);
        $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
        $strAlbum['albumname'] = stripslashes($strAlbum['albumname']);
        $strAlbum['albumdesc'] = stripslashes($strAlbum['albumdesc']);
        if ($userid != $strAlbum['userid']) {
            tsNotice('非法操作!');
        }
        $addtime = time();
        $title = '上传照片';
        include template("upload");
        break;
    case "do":
        $addtime = intval($_POST['addtime']);
        $albumid = intval($_POST['albumid']);
        $verifyToken = md5('unique_salt' . $addtime);
        $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
        if ($albumid == 0 || $addtime == 0 || $_POST['tokens'] != $verifyToken || $strAlbum == '') {
            echo 00;
            exit;
        }
        $photoid = $new['photo']->create('photo', array('albumid' => $strAlbum['albumid'], 'userid' => $strAlbum['userid'], 'locationid' => aac('user')->getLocationId($strAlbum['userid']), 'addtime' => date('Y-m-d H:i:s', $addtime)));
        //上传
        $arrUpload = tsUpload($_FILES['Filedata'], $photoid, 'photo', array('jpg', 'gif', 'png'));
        if ($arrUpload) {
            $new['photo']->update('photo', array('photoid' => $photoid), array('photoname' => $arrUpload['name'], 'phototype' => $arrUpload['type'], 'path' => $arrUpload['path'], 'photourl' => $arrUpload['url'], 'photosize' => $arrUpload['size']));
            //对积分进行出来
            aac('user')->doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'], $strAlbum['userid']);
        }
        echo $photoid;
        break;
}
Ejemplo n.º 24
0
$strArticle['user'] = aac('user')->getOneUser($strArticle['userid']);
$strArticle['cate'] = $new['article']->find('article_cate', array('cateid' => $strArticle['cateid']));
// 获取评论
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('article', 'show', array('id' => $articleid, 'page' => ''));
$lstart = $page * 10 - 10;
$arrComments = $new['article']->findAll('article_comment', array('articleid' => $articleid), 'addtime desc', null, $lstart . ',10');
foreach ($arrComments as $key => $item) {
    $arrComment[] = $item;
    $arrComment[$key]['content'] = tsDecode($item['content']);
    $arrComment[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
$commentNum = $new['article']->findCount('article_comment', array('articleid' => $articleid));
$pageUrl = pagination($commentNum, 10, $page, $url);
// 标签
$strArticle['tags'] = aac('tag')->getObjTagByObjid('article', 'articleid', $strArticle['articleid']);
// 推荐阅读
$arrArticle = $new['article']->findAll('article', null, 'addtime desc', null, 10);
// 推荐阅读
$arrRecommend = $new['article']->getRecommendArticle();
// 一周热门
$arrHot7 = $new['article']->getHotArticle(7);
// 一月热门
$arrHot30 = $new['article']->getHotArticle(30);
//把标签作为关键词
if ($strArticle['tags']) {
    foreach ($strArticle['tags'] as $key => $item) {
        $arrTag[] = $item['tagname'];
    }
    $sitekey = arr2str($arrTag);
} else {
Ejemplo n.º 25
0
<?php

defined('IN_TS') or die('Access Denied.');
//消息盒子
$userid = aac('user')->isLogin();
$touserid = intval($_GET['userid']);
if ($userid == 0 || $touserid == 0) {
    exit;
}
$msgCount = $new['message']->findCount('message', "(userid='{$userid}' and touserid='{$touserid}') or (userid='{$touserid}' and touserid='{$userid}')");
if ($msgCount == 0) {
    exit;
}
$arrMessage = $new['message']->findAll('message', "(userid='{$userid}' and touserid='{$touserid}') or (userid='{$touserid}' and touserid='{$userid}')", 'addtime desc', null, 10);
foreach ($arrMessage as $key => $item) {
    $arrMessage[$key]['user'] = aac('user')->getOneUser($item['userid']);
    $arrMessage[$key]['content'] = tsTitle($item['content']);
}
$arrMessage = array_reverse($arrMessage);
//isread设为已读
$new['message']->update('message', array('userid' => $touserid, 'touserid' => $userid, 'isread' => 0), array('isread' => 1));
$title = '消息盒子';
include template("msgbox");
Ejemplo n.º 26
0
                $isaudit = 0;
            }
            $isGroup = $new['group']->findCount('group', array('groupname' => $groupname));
            if ($isGroup > 0) {
                tsNotice("小组名称已经存在,请更换其他小组名称!");
            }
            $groupid = $new['group']->create('group', array('userid' => $userid, 'groupname' => $groupname, 'groupdesc' => $groupdesc, 'isaudit' => $isaudit, 'addtime' => time()));
            //上传
            $arrUpload = tsUpload($_FILES['photo'], $groupid, 'group', array('jpg', 'gif', 'png', 'jpeg'));
            if ($arrUpload) {
                $new['group']->update('group', array('groupid' => $groupid), array('path' => $arrUpload['path'], 'photo' => $arrUpload['url']));
            }
            //绑定成员
            $new['group']->create('group_user', array('userid' => $userid, 'groupid' => $groupid, 'addtime' => time()));
            //更新
            $count_group = $new['group']->findCount('group_user', array('userid' => $userid));
            $new['group']->update('user_info', array('userid' => $userid), array('count_group' => $count_group));
            //更新小组人数
            $new['group']->update('group', array('groupid' => $groupid), array('count_user' => 1));
            //更新分类统计
            $cateid = intval($_POST['cateid']);
            if ($cateid > 0) {
                $count_group = $new['group']->findCount('group', array('cateid' => $cateid));
                $new['group']->update('group_cate', array('cateid' => $cateid), array('count_group' => $count_group));
            }
            // 处理标签
            aac('tag')->addTag('group', 'groupid', $groupid, $_POST['tag']);
            header("Location: " . tsUrl('group', 'show', array('id' => $groupid)));
        }
        break;
}
Ejemplo n.º 27
0
        //插入ts_user_open
        $new['pubs']->create('user_open', array('userid' => $userid, 'sitename' => 'weibo', 'openid' => $openid, 'access_token' => $access_token, 'uptime' => time()));
        //更新用户头像
        if ($arrUserInfo['avatar_large']) {
            //1000个图片一个目录
            $menu2 = intval($userid / 1000);
            $menu1 = intval($menu2 / 1000);
            $menu = $menu1 . '/' . $menu2;
            $photo = $userid . '.jpg';
            $photos = $menu . '/' . $photo;
            $dir = 'uploadfile/user/' . $menu;
            $dfile = $dir . '/' . $photo;
            createFolders($dir);
            if (!is_file($dfile)) {
                $img = file_get_contents($arrUserInfo['avatar_large']);
                file_put_contents($dfile, $img);
            }
            $new['pubs']->update('user_info', array('userid' => $userid), array('path' => $menu, 'face' => $photos));
        }
        //获取用户信息
        $userData = $new['pubs']->find('user_info', array('userid' => $userid), 'userid,username,path,face,isadmin,signin,uptime');
        //发送系统消息(恭喜注册成功)
        $msg_userid = '0';
        $msg_touserid = $userid;
        $msg_content = '亲爱的微博用户 ' . $username . ' :<br />您成功加入了 ' . $TS_SITE['site_title'] . '<br />在遵守本站的规定的同时,享受您的愉快之旅吧!';
        aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
        $_SESSION['tsuser'] = $userData;
        header("Location: " . SITE_URL);
        exit;
    }
}
Ejemplo n.º 28
0
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');
        break;
}
Ejemplo n.º 29
0
         foreach ($strAdmin as $key => $item) {
             $arrAdmin[] = aac('user')->getOneUser($item['userid']);
             $arrAdmin[$key]['isadmin'] = $item['isadmin'];
         }
     }
     //小组会员分页
     $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     $url = tsUrl('group', 'user', array('id' => $groupid, 'page' => ''));
     $lstart = $page * 40 - 40;
     //普通用户
     $groupUserNum = $new['group']->findCount('group_user', array('groupid' => $groupid, 'isadmin' => 0, 'isfounder' => 0));
     $groupUser = $new['group']->findAll('group_user', array('groupid' => $strGroup['groupid'], 'isadmin' => '0', 'isfounder' => '0'), 'userid desc', null, $lstart . ',40');
     //print_r($groupUser);
     if (is_array($groupUser)) {
         foreach ($groupUser as $key => $item) {
             $arrGroupUser[] = aac('user')->getOneUser($item['userid']);
             $arrGroupUser[$key]['isadmin'] = $item['isadmin'];
         }
     }
     $pageUrl = pagination($groupUserNum, 40, $page, $url, $TS_URL['suffix']);
     if ($page > '1') {
         $titlepage = " - 第" . $page . "页";
     } else {
         $titlepage = '';
     }
     $title = $strGroup['groupname'] . '成员' . $titlepage;
     include template("user");
     break;
     //设为管理员
 //设为管理员
 case "manager":
Ejemplo n.º 30
0
    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;
}