本文整理匯總了PHP中tsNotice函數的典型用法代碼示例。如果您正苦於以下問題:PHP tsNotice函數的具體用法?PHP tsNotice怎麽用?PHP tsNotice使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了tsNotice函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: antiWord
public function antiWord($text)
{
//先幹掉所有空格,不管你是所有空格+全角空格
$text = preg_replace("/\\s| /", "", $text);
$arrWords = $this->findAll('anti_word');
foreach ($arrWords as $key => $item) {
$arrWord[] = $item['word'];
}
$strWord = '';
$count = 1;
if (is_array($arrWord)) {
foreach ($arrWord as $item) {
if ($count == 1) {
$strWord .= $item;
} else {
$strWord .= '|' . $item;
}
$count++;
}
//第一過濾層,大致的掃一下
if ($text) {
preg_match("/{$strWord}/i", $text, $matche1);
if (!empty($matche1[0])) {
//tsNotice('提示:內容中存在被禁止使用的詞匯:'.$matche1[0]);
tsNotice('非法操作');
}
}
//第二過濾層
preg_match("/{$strWord}/i", t($text), $matche2);
if (!empty($matche2[0])) {
//tsNotice('內容中存在被禁止使用的詞匯:'.$matche2[0]);
tsNotice('非法操作');
}
//第三過濾層,濾中文中的特殊字符
$text3 = @preg_replace("/[^\\x{4e00}-\\x{9fa5}]/iu", '', $text);
preg_match("/{$strWord}/i", t($text3), $matche3);
if (!empty($matche3[0])) {
//tsNotice('內容中存在被禁止使用的詞匯:'.$matche3[0]);
tsNotice('非法操作');
}
//第四過濾層,過濾QQ號,電話,媽的,老子就不信搞不死你
$text4 = @preg_replace("/[^\\d]/iu", '', $text);
preg_match("/{$strWord}/i", t($text4), $matche4);
if (!empty($matche4[0])) {
//tsNotice('內容中存在被禁止使用的詞匯:'.$matche4[0]);
tsNotice('非法操作');
}
}
return true;
}
示例2: defined
<?php
//插件條件入口
defined('IN_TS') or die('Access Denied.');
if (is_file('plugins/' . $app . '/' . $plugin . '/' . $in . '.php')) {
require_once 'plugins/' . $app . '/' . $plugin . '/' . $in . '.php';
} else {
tsNotice('sorry:no plugin!');
}
//形如這樣
//index.php?app=group&ac=plugin&plugin=qq&in=do
示例3: fileRead
$TS_SITE = fileRead('data/system_options.php');
if ($TS_SITE == '') {
$TS_SITE = $tsMySqlCache->get('system_options');
}
//加載APP導航
$TS_SITE['appnav'] = fileRead('data/system_appnav.php');
if ($TS_SITE['appnav'] == '') {
$TS_SITE['appnav'] = $tsMySqlCache->get('system_appnav');
}
if (is_file('data/' . $TS_URL['app'] . '_options.php')) {
$TS_APP = fileRead('data/' . $TS_URL['app'] . '_options.php');
if ($TS_APP == '') {
$TS_APP = $tsMySqlCache->get($TS_URL['app'] . '_options');
}
if ($TS_APP['isenable'] == '1' && $TS_URL['ac'] != 'admin') {
tsNotice($TS_URL['app'] . "應用關閉,請開啟後訪問!");
}
}
//定義網站URL
define('SITE_URL', $TS_SITE['site_url']);
//設置時區
date_default_timezone_set($TS_SITE['timezone']);
//接管SESSION,前台用戶基本數據,$TS_USER數組
$TS_USER = isset($_SESSION['tsuser']) ? $_SESSION['tsuser'] : '';
//記錄日誌
if ($TS_CF['logs']) {
//打印用戶日誌記錄
userlog($_POST, intval($TS_USER['userid']));
userlog($_GET, intval($TS_USER['userid']));
}
//控製前台ADMIN訪問權限
示例4: switch
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'] : '中國北京';
include template('add_map');
break;
示例5: 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;
}
示例6: tsNotice
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');
}
echo $data;
示例7: defined
<?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;
}
示例8: aac
$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);
//過濾內容結束
}
$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)));
示例9: switch
}
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 = trim($_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)));
示例10: aac
//添加評論
//添加評論
case "comment_do":
//用戶是否登錄
$userid = aac('user')->isLogin();
$photoid = intval($_POST['photoid']);
$content = tsClean($_POST['content']);
if ($TS_USER['isadmin'] == 0) {
//過濾內容開始
aac('system')->antiWord($content);
//過濾內容結束
}
$commentid = $new['photo']->create('photo_comment', array('photoid' => $photoid, 'userid' => $userid, 'content' => $content, 'addtime' => time()));
header("Location: " . tsUrl('photo', 'show', array('id' => $photoid)));
break;
//刪除評論
//刪除評論
case "delcomment":
//用戶是否登錄
$userid = aac('user')->isLogin();
$commentid = intval($_GET['commentid']);
$strComment = $new['photo']->find('photo_comment', array('commentid' => $commentid));
$strTopic = $new['photo']->find('photo', array('photoid' => $strComment['photoid']));
if ($userid == $strPhoto['userid'] || $TS_USER['isadmin'] == '1') {
$new['photo']->delete('photo_comment', array('commentid' => $commentid));
tsNotice("刪除評論成功!");
} else {
tsNotice("非法操作!");
}
break;
}
示例11: intval
$userid = $new['user']->isLogin();
$touserid = intval($_POST['touserid']);
$reid = intval($_POST['reid']);
$content = tsClean($_POST['content']);
$arrContent = explode('#', $content);
$content = $arrContent['1'];
if ($content == '') {
tsNotice('留言不能為空!');
}
aac('system')->antiWord($content);
$new['user']->create('user_gb', array('userid' => $userid, 'reid' => $reid, 'touserid' => $touserid, 'content' => $content, 'addtime' => date('Y-m-d H:i:s')));
//發送係統消息
$msg_userid = '0';
$msg_touserid = $touserid;
$msg_content = '有人在你的留言板上留言了哦,快去看看吧!';
$msg_tourl = tsUrl('user', 'space', array('id' => $touserid));
aac('message')->sendmsg($msg_userid, $msg_touserid, $msg_content, $msg_tourl);
tsNotice('回複成功!');
break;
//刪除留言
//刪除留言
case "delete":
$userid = $new['user']->isLogin();
$gbid = intval($_GET['gbid']);
$strGuest = $new['user']->find('user_gb', array('id' => $gbid));
if ($strGuest['touserid'] == $userid) {
$new['user']->delete('user_gb', array('id' => $gbid));
}
tsNotice('留言刪除成功');
break;
}
示例12: unset
unset($_GET);
$res = $new['group']->find('user_topic_declare', array('commentid' => $id, 'userid' => $userid));
if ($res) {
tsNotice('不要重複評價,請保持良好的心態,有益身體健康!');
}
// 增加支持數
$comment_data = $new['group']->find('group_topic_comment', array('commentid' => $id));
$support_nums = $comment_data['support'] + 1;
$new['group']->update('group_topic_comment', array('commentid' => $id), array('support' => $support_nums));
// 增加評價記錄
$new['group']->create('user_topic_declare', array('commentid' => $id, 'userid' => $userid));
tsNotice('表態成功!', '點擊返回>>', $_SERVER['HTTP_REFERER'], true);
break;
// 評論支持
// 評論支持
case "oppose":
$id = isset($_GET['commentid']) && intval($_GET['commentid']) ? intval($_GET['commentid']) : tsNotice('請指定要支持的評論!');
unset($_GET);
$res = $new['group']->find('user_topic_declare', array('commentid' => $id, 'userid' => $userid));
if ($res) {
tsNotice('不要重複評價,請保持良好的心態,有益身體健康!');
}
// 增加支持數
$comment_data = $new['group']->find('group_topic_comment', array('commentid' => $id));
$oppose_nums = $comment_data['oppose'] + 1;
$new['group']->update('group_topic_comment', array('commentid' => $id), array('oppose' => $oppose_nums));
// 增加評價記錄
$new['group']->create('user_topic_declare', array('commentid' => $id, 'userid' => $userid));
tsNotice('表態成功!', '點擊返回>>', $_SERVER['HTTP_REFERER'], true);
break;
}
示例13: tsNotice
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');
}
$email = trim($_POST['email']);
$pwd = trim($_POST['pwd']);
$cktime = $_POST['cktime'];
if ($email == '' || $pwd == '') {
qiMsg("所有輸入項都不能為空^_^");
}
$countAdmin = $new['system']->findCount('user', array('email' => $email));
if ($countAdmin == 0) {
qiMsg('用戶Email不存在!');
}
$strAdmin = $new['system']->find('user', array('email' => $email));
if (md5($strAdmin['salt'] . $pwd) !== $strAdmin['pwd']) {
tsNotice('用戶密碼錯誤!');
}
$strAdminInfo = $new['system']->find('user_info', array('email' => $email), 'userid,username,isadmin');
if ($strAdminInfo['isadmin'] != 1) {
qiMsg("你無權登錄後台管理!");
}
$_SESSION['tsadmin'] = $strAdminInfo;
header("Location: " . SITE_URL . "index.php?app=system");
break;
//退出
//退出
case "out":
unset($_SESSION['tsadmin']);
header("Location: " . SITE_URL . "index.php?app=system&ac=login");
break;
}
示例14: tsNotice
break;
//編輯帖子執行
//編輯帖子執行
case "do":
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');
}
$topicid = intval($_POST['topicid']);
$typeid = intval($_POST['typeid']);
$title = trim($_POST['title']);
//echo br2nl($_POST['content']);exit;
$content = tsClean($_POST['content']);
$iscomment = intval($_POST['iscomment']);
$iscommentshow = intval($_POST['iscommentshow']);
if ($topicid == '' || $title == '' || $content == '') {
tsNotice("都不能為空的哦!");
}
if ($TS_USER['isadmin'] == 0) {
//過濾內容開始
aac('system')->antiWord($title);
aac('system')->antiWord($content);
//過濾內容結束
}
$strTopic = $new['group']->find('group_topic', array('topicid' => $topicid));
$strGroup = $new['group']->find('group', array('groupid' => $strTopic['groupid']));
$strGroupUser = $new['group']->find('group_user', array('userid' => $userid, 'groupid' => $strTopic['groupid']));
if ($strTopic['userid'] == $userid || $strGroup['userid'] == $userid || $TS_USER['isadmin'] == 1 || $strGroupUser['isadmin'] == 1) {
$new['group']->update('group_topic', array('topicid' => $topicid), array('typeid' => $typeid, 'title' => $title, 'content' => $content, 'iscomment' => $iscomment, 'iscommentshow' => $iscommentshow));
//處理標簽
$tag = trim($_POST['tag']);
if ($tag) {
示例15: tsNotice
if (aac('user')->isPublisher() == false) {
tsNotice('不好意思,你還沒有權限發布內容!');
}
switch ($ts) {
case "":
$title = '創建資料庫';
include template('create');
break;
case "do":
$title = trim($_POST['title']);
$content = tsClean($_POST['content']);
if (intval($TS_USER['isadmin']) == 0) {
// 過濾內容開始
aac('system')->antiWord($title);
aac('system')->antiWord($content);
// 過濾內容結束
}
//1審核後顯示0不審核
if ($TS_APP['isaudit'] == 1) {
$isaudit = 1;
} else {
$isaudit = 0;
}
if ($title && $content) {
$albumid = $new['attach']->create('attach_album', array('userid' => $userid, 'title' => $title, 'content' => $content, 'isaudit' => $isaudit, 'addtime' => date('Y-m-d H:i:s'), 'uptime' => date('Y-m-d H:i:s')));
header('Location: ' . tsUrl('attach', 'upload', array('albumid' => $albumid)));
} else {
tsNotice('資料庫信息填寫不完整');
}
break;
}