defined('IN_TS') or die('Access Denied.'); $userid = aac('user')->isLogin(); switch ($ts) { 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'] : '中国北京';
} if ($TS_APP['iscreate'] == 0 || $TS_USER['isadmin'] == 1) { //小组分类 $arrCate = $new['group']->findAll('group_cate', array('referid' => 0)); $title = '创建小组'; include template("create"); } else { tsNotice('系统不允许会员创建小组!'); } break; //执行创建小组 //执行创建小组 case "do": if ($TS_APP['iscreate'] == 0 || $TS_USER['isadmin'] == 1) { $groupname = trim($_POST['groupname']); $groupdesc = tsClean($_POST['groupdesc']); if ($groupname == '' || $groupdesc == '') { tsNotice('小组名称和介绍不能为空!'); } //过滤内容开始 if ($TS_USER['isadmin'] != 1) { aac('system')->antiWord($groupname); aac('system')->antiWord($groupdesc); } //过滤内容结束 //配置文件是否需要审核 $isaudit = intval($TS_APP['isaudit']); if ($TS_USER['isadmin'] == 1) { $isaudit = 0; } $isGroup = $new['group']->findCount('group', array('groupname' => $groupname));
<?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; }
defined('IN_TS') or die('Access Denied.'); //用户是否登录 $userid = aac('user')->isLogin(); switch ($ts) { 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); //过滤内容结束 }
$userid = aac('user')->isLogin(); $albumid = intval($_POST['albumid']); $albumface = trim($_POST['albumface']); $arrPhotoId = $_POST['photoid']; $arrPhotoDesc = $_POST['photodesc']; if ($TS_USER['isadmin'] == 0) { foreach ($arrPhotoDesc as $key => $item) { //过滤内容开始 aac('system')->antiWord($item); //过滤内容结束 } } foreach ($arrPhotoDesc as $key => $item) { if ($item) { $photoid = intval($arrPhotoId[$key]); $new['photo']->update('photo', array('photoid' => $photoid), array('photodesc' => tsClean($item))); } } //更新圖封面 if ($albumface) { $new['photo']->update('photo_album', array('userid' => $userid, 'albumid' => $albumid), array('albumface' => $albumface)); } header("Location: " . tsUrl('photo', 'album', array('id' => $albumid))); break; //删除圖 //删除圖 case "del": //用户是否登录 $userid = aac('user')->isLogin(); $albumid = intval($_GET['albumid']); $strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
} //回到文化管理首页 header("Location: " . SITE_URL . "index.php?app=group&ac=admin&mg=group&ts=list"); break; //文化编辑 //文化编辑 case "edit": $groupid = intval($_GET['groupid']); $arrGroup = $db->once_fetch_assoc("select * from " . dbprefix . "group where groupid='{$groupid}'"); include template("admin/group_edit"); break; //文化编辑执行 //文化编辑执行 case "edit_do": $groupid = intval($_POST['groupid']); $new['group']->update('group', array('groupid' => $groupid), array('groupname' => t($_POST['groupname']), 'groupdesc' => tsClean($_POST['groupdesc']), 'userid' => intval($_POST['userid']), 'ispost' => intval($_POST['ispost']))); qiMsg("文化信息修改成功!"); break; //文化删除 //文化删除 case "del": $groupid = intval($_GET['groupid']); if ($groupid == 1) { qiMsg("默认文化不能删除!"); } $topicNum = $db->once_fetch_assoc("select count(*) from " . dbprefix . "group_topic where `groupid`='{$groupid}'"); if ($topicNum['count(*)'] > 0) { qiMsg("本文化还有帖子,不允许删除。"); } $db->query("DELETE FROM " . dbprefix . "group WHERE groupid = '{$groupid}'"); $db->query("DELETE FROM " . dbprefix . "group_user WHERE groupid = '{$groupid}'");
public function addcomment() { if ($_POST['token'] != $_SESSION['token']) { tsNotice('非法操作!'); } //用户是否登录 $userid = aac('user')->isLogin(); $weiboid = intval($_POST['weiboid']); $touserid = intval($_POST['touserid']); $content = tsClean($_POST['content']); if ($content == '') { tsNotice('内容不能为空'); } if ($GLOBALS['TS_USER']['isadmin'] == 0) { //过滤内容开始 aac('system')->antiWord($content); //过滤内容结束 } $commentid = $this->create('weibo_comment', array('userid' => $userid, 'touserid' => $touserid, 'weiboid' => $weiboid, 'content' => $content, 'addtime' => date('Y-m-d H:i:s'))); //计算评论总数 $commentNum = $this->findCount('weibo_comment', array('weiboid' => $weiboid)); $this->update('weibo', array('weiboid' => $weiboid), array('count_comment' => $commentNum)); $strWeibo = $this->find('weibo', array('weiboid' => $weiboid)); if ($strWeibo['userid'] != $userid) { $msg_userid = '0'; $msg_touserid = $strWeibo['userid']; $msg_content = '你的微博新增一条回复,快去看看给个回复吧^_^ <br />' . tsUrl('weibo', 'show', array('id' => $weiboid)); aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content); } tsHeaderUrl(tsUrl('weibo', 'show', array('id' => $weiboid))); }
case "": if ($TS_APP['allowpost'] == 0 && $TS_USER['isadmin'] == 0) { tsNotice('系统设置不允许会员发文章!'); } $cateid = intval($_GET['cateid']); $title = '发布文章'; include template('add'); break; case "do": if ($_POST['token'] != $_SESSION['token']) { tsNotice('非法操作!'); } $cateid = intval($_POST['cateid']); $title = trim($_POST['title']); $content = tsClean($_POST['content']); $tag = tsClean($_POST['tag']); $addtime = date('Y-m-d H:i:s'); if (intval($TS_USER['isadmin']) == 0) { // 过滤内容开始 aac('system')->antiWord($title); aac('system')->antiWord($content); aac('system')->antiWord($tag); // 过滤内容结束 } if ($title == '' || $content == '') { tsNotice("标题和内容都不能为空!"); } //1审核后显示0不审核 if ($TS_APP['isaudit'] == 1) { $isaudit = 1; } else {