Example #1
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>';
}
Example #2
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');
 }
Example #3
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>';
}
Example #4
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>';
}
Example #5
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>';
}
Example #6
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>';
}
Example #7
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>';
}
Example #8
0
    }
}
//判断用户是否上传头像,管理员除外
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) {
Example #9
0
<?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');
Example #10
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');
// 增加浏览次数
$new['group']->update('group_topic', array('topicid' => $strTopic['topicid']), array('count_view' => $strTopic['count_view'] + 1));
Example #11
0
    //必须上传头像
    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;
}
Example #12
0
<?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;
}
Example #13
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;
}
Example #14
0
<?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');
Example #15
0
<?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) {
Example #16
0
         $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');
Example #17
0
<?php

defined('IN_TS') or die('Access Denied.');
$cateid = intval($_GET['cateid']);
//小组分类
$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'];
    }
}
Example #18
0
 public function isLogin($type = '')
 {
     $userid = intval($_SESSION['tsuser']['userid']);
     if ($type && $userid == 0) {
         getJson('你还没有登录', 1);
     }
     if ($userid > 0) {
         if ($this->isUser($userid)) {
             return $userid;
         } else {
             header("Location: " . tsUrl('user', 'login', array('ts' => 'out')));
             exit;
         }
     } else {
         header("Location: " . tsUrl('user', 'login', array('ts' => 'out')));
         exit;
     }
 }
Example #19
0
<?php

defined('IN_TS') or die('Access Denied.');
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('group', 'my', array('my' => 'topic', 'page' => ''));
$lstart = $page * 20 - 20;
$arrTopic = $new['group']->findAll('group_topic', array('userid' => $strUser['userid']), 'addtime desc', null, $lstart . ',20');
$topicNum = $new['group']->findCount('group_topic', array('userid' => $strUser['userid']));
$pageUrl = pagination($topicNum, 20, $page, $url);
$title = '我的帖子';
include template('my/topic');
Example #20
0
        case "useraudit":
            $arrUserId = $new['group']->findAll('group_user_isaudit', array('groupid' => $groupid));
            foreach ($arrUserId as $key => $item) {
                $arrUser[] = aac('user')->getOneUser($item['userid']);
            }
            $title = '成员申请加入审核';
            include template('edit_useraudit');
            break;
            //成员审核执行
        //成员审核执行
        case "userauditdo":
            $userid = intval($_GET['userid']);
            $status = intval($_GET['status']);
            //0加入1删除
            if ($status == 0 && $userid) {
                $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));
                //计算小组会员数
                $count_user = $new['group']->findCount('group_user', array('groupid' => $groupid));
                //更新小组成员统计
                $new['group']->update('group', array('groupid' => $groupid), array('count_user' => $count_user));
            }
            $new['group']->delete('group_user_isaudit', array('userid' => $userid, 'groupid' => $groupid));
            header('Location: ' . tsUrl('group', 'edit', array('groupid' => $groupid, 'ts' => 'useraudit')));
            break;
    }
} else {
    tsNotice('非法操作!');
}
Example #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");
Example #22
0
            $strGroup = $new['group']->find('group', array('groupid' => $strTopic['groupid']));
            if ($strTopic['userid'] == $userid || $strGroup['userid'] == $userid || $TS_USER['isadmin'] == 1) {
                $arrGroups = $new['group']->findAll('group_user', array('userid' => $strTopic['userid']));
                foreach ($arrGroups as $item) {
                    if ($item['groupid'] != $strGroup['groupid']) {
                        $arrGroup[] = $new['group']->find('group', array('groupid' => $item['groupid']));
                    }
                }
                $title = '移动帖子';
                include template("topic_move");
            } else {
                tsNotice('非法操作!');
            }
        } else {
            tsNotice('非法操作!');
        }
        break;
        //执行移动
    //执行移动
    case "do":
        $groupid = intval($_POST['groupid']);
        $topicid = intval($_POST['topicid']);
        $strTopic = $new['group']->find('group_topic', array('topicid' => $topicid));
        if ($strTopicid['userid'] == $userid || $TS_USER['isadmin'] == 1) {
            $new['group']->update('group_topic', array('topicid' => $topicid), array('groupid' => $groupid, 'typeid' => '0'));
            header("Location: " . tsUrl('group', 'topic', array('id' => $topicid)));
        } else {
            tsNotice('非法操作!');
        }
        break;
}
Example #23
0
    case "":
        $title = '发布活动';
        include template("add");
        break;
    case "do":
        $title = trim($_POST['title']);
        $typeid = intval($_POST['typeid']);
        $starttime = trim($_POST['starttime']);
        $endtime = trim($_POST['endtime']);
        $address = trim($_POST['address']);
        $coordinate = trim($_POST['coordinate']);
        //坐标
        $content = tsClean($_POST['content']);
        if ($title == '' || $content == '') {
            tsNotice('标题和内容不能为空');
        }
        $eventid = $new['event']->create('event', array('userid' => $userid, 'title' => $title, 'typeid' => $typeid, 'starttime' => $starttime, 'endtime' => $endtime, 'address' => $address, 'coordinate' => $coordinate, 'content' => $content, 'isaudit' => 1, 'addtime' => time()));
        //上传
        $arrUpload = tsUpload($_FILES['photo'], $eventid, 'event', array('jpg', 'gif', 'png'));
        if ($arrUpload) {
            $new['event']->update('event', array('eventid' => $eventid), array('path' => $arrUpload['path'], 'photo' => $arrUpload['url']));
        }
        header("Location: " . tsUrl('event', 'show', array('id' => $eventid)));
        break;
        //地图
    //地图
    case "map":
        $dd = isset($_GET['dd']) ? $_GET['dd'] : '中国北京';
        include template('add_map');
        break;
}
Example #24
0
<?php

defined('IN_TS') or die('Access Denied.');
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('my', 'score', array('page' => ''));
$lstart = $page * 50 - 50;
$arrScore = $new['my']->findAll('user_score_log', array('userid' => $strUser['userid']), 'addtime desc', null, $lstart . ',50');
$scoreNum = $new['my']->findCount('user_score_log', array('userid' => $strUser['userid']));
$pageUrl = pagination($scoreNum, 50, $page, $url);
$title = '我的积分';
include template('score');
    if ($item['appkey'] != 'group' && $item['appkey'] != '') {
        ?>
<a target="_blank" style="color:#999999;font-size: 12px;margin-right: 5px;" class="titles-type" href="<?php 
        echo SITE_URL;
        echo tsUrl($item['appkey']);
        ?>
">[<?php 
        echo $item['appname'];
        ?>
]</a>
<a title="<?php 
        echo $item['title'];
        ?>
" href="<?php 
        echo SITE_URL;
        echo tsUrl($item['appkey'], $item['appaction'], array('id' => $item['appid']));
        ?>
"><?php 
        echo $item['title'];
        ?>
</a>
<?php 
    } else {
        ?>
<a href="<?php 
        echo tsurl('group', 'topic', array('id' => $item['topicid']));
        ?>
"><?php 
        echo htmlspecialchars($item['title']);
        ?>
</a> <i><?php 
Example #26
0
<?php

defined('IN_TS') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
switch ($ts) {
    //发送消息页面
    case "add":
        $touserid = intval($_GET['touserid']);
        if ($userid == $touserid || !$touserid) {
            tsNotice("Sorry!自己不能给自己发送消息的!& 对方为空!");
        }
        $strUser = $new['user']->getOneUser($userid);
        $strTouser = $new['user']->getOneUser($touserid);
        if (!$strTouser) {
            tsNotice("Sorry!对方不存在!");
        }
        $title = "发送短消息";
        include template("message_add");
        break;
    case "do":
        $msg_userid = $userid;
        $msg_touserid = intval($_POST['touserid']);
        $msg_content = tsFilter($_POST['content']);
        aac('system')->antiWord($msg_content);
        aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content);
        header("Location: " . tsUrl('message', 'my'));
        break;
}
Example #27
0
     $pageUrl = pagination($groupNum, 20, $page, $url);
     $title = $strCate['catename'];
     include template('cate2');
     break;
     //三级分类
 //三级分类
 case "3":
     $cateid = intval($_GET['cateid']);
     $strCate = $new['group']->find('group_cate', array('cateid' => $cateid));
     //上级分类
     $oneCate = $new['group']->find('group_cate', array('cateid' => $strCate['referid']));
     //下级分类
     $arrCate = $new['group']->findAll('group_cate', array('referid' => $cateid));
     //分类下小组
     $page = isset($_GET['page']) ? intval($_GET['page']) : '1';
     $url = tsUrl('group', 'cate', array('ts' => '3', 'page' => ''));
     $lstart = $page * 20 - 20;
     $arrGroup = $new['group']->findAll('group', array('cateid2' => $cateid), null, null, $lstart . ',20');
     $groupNum = $new['group']->findCount('group', array('cateid' => $cateid));
     $pageUrl = pagination($groupNum, 20, $page, $url);
     $title = $strCate['catename'];
     include template('cate3');
     break;
     //展示小组
 //展示小组
 case "group":
     $cateid = intval($_GET['cateid']);
     $strCate = $new['group']->find('group_cate', array('cateid' => $cateid));
     $twoCate = $new['group']->find('group_cate', array('cateid' => $strCate['referid']));
     $oneCate = $new['group']->find('group_cate', array('cateid' => $twoCate['referid']));
     //分类下小组
Example #28
0
    header("Status: 404 Not Found");
    $title = '404';
    include pubTemplate("404");
    exit;
}
$strTag = $new['group']->find('tag', array('tagid' => $tagid));
$strTag['tagname'] = htmlspecialchars($strTag['tagname']);
//文化
$arrGroupTagId = $new['group']->findAll('tag_group_index', array('tagid' => $tagid));
if ($arrGroupTagId) {
    foreach ($arrGroupTagId as $key => $item) {
        $arrGroup[] = aac('group')->getOneGroup($item['groupid']);
    }
}
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = tsUrl('group', 'tag', array('id' => urlencode($name), 'page' => ''));
$lstart = $page * 30 - 30;
$arrTagId = $new['group']->findAll('tag_topic_index', array('tagid' => $tagid), null, null, $lstart . ',30');
foreach ($arrTagId as $item) {
    $strTopic = $new['group']->find('group_topic', array('topicid' => $item['topicid']));
    if ($strTopic == '') {
        $new['group']->delete('tag_topic_index', array('topicid' => $item['topicid'], 'tagid' => $item['tagid']));
    }
    if ($strTopic) {
        $arrTopics[] = $strTopic;
    }
}
$arrTagIds = $new['group']->findAll('tag_topic_index', array('tagid' => $tagid));
foreach ($arrTagIds as $item) {
    $strTopic = $new['group']->find('group_topic', array('topicid' => $item['topicid']));
    if ($strTopic == '') {
Example #29
0
     exit;
 }
 //小组组长信息
 $leaderId = $strGroup['userid'];
 $strLeader = aac('user')->getOneUser($leaderId);
 //管理员信息
 $strAdmin = $new['group']->findAll('group_user', array('groupid' => $strGroup['groupid'], 'isadmin' => '1', 'isfounder' => '0'));
 if (is_array($strAdmin)) {
     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 {
Example #30
0
    $title = '404';
    include pubTemplate("404");
    exit;
}
// 是否审核
if ($strArticle['isaudit'] == 1) {
    tsNotice('内容审核中...');
}
$strArticle['title'] = tsTitle($strArticle['title']);
$strArticle['content'] = tsDecode($strArticle['content']);
$strArticle['tags'] = aac('tag')->getObjTagByObjid('article', 'articleid', $articleid);
$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();