本文整理匯總了PHP中tsClean函數的典型用法代碼示例。如果您正苦於以下問題:PHP tsClean函數的具體用法?PHP tsClean怎麽用?PHP tsClean使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了tsClean函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: defined
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'] : '中國北京';
示例2: array
}
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));
示例3: 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;
}
示例4: defined
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);
//過濾內容結束
}
示例5: aac
$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));
示例6: header
}
//回到文化管理首頁
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}'");
示例7: addcomment
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)));
}
示例8: tsNotice
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 {