本文整理汇总了PHP中qiMsg函数的典型用法代码示例。如果您正苦于以下问题:PHP qiMsg函数的具体用法?PHP qiMsg怎么用?PHP qiMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qiMsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteweibo
public function deleteweibo()
{
$weiboid = intval($_GET['weiboid']);
$this->delete('weibo', array('weiboid' => $weiboid));
$this->delete('weibo_comment', array('weiboid' => $weiboid));
qiMsg('删除成功!');
}
示例2: deleteweibo
public function deleteweibo()
{
$weiboid = intval($_GET['weiboid']);
$strWeibo = $this->find('weibo', array('weiboid' => $weiboid));
unlink('uploadfile/weibo/' . $strWeibo['photo']);
$this->delete('weibo', array('weiboid' => $weiboid));
$this->delete('weibo_comment', array('weiboid' => $weiboid));
qiMsg('删除成功!');
}
示例3: __construct
/**
* @param unknown $DB 数据库链接参数
*/
function __construct($DB)
{
if (!function_exists('mysqli_connect')) {
qiMsg('服务器PHP不支持MySQLi数据库');
}
$this->conn = mysqli_connect($DB['host'], $DB['user'], $DB['pwd'], $DB['name'], $DB['port']);
if (mysqli_connect_errno()) {
qiMsg('数据库链接错误/无法找到数据库 : ' . mysqli_connect_error());
}
$this->query("SET NAMES UTF8");
}
示例4: replace
/**
* 替换数据,根据条件替换存在的记录,如记录不存在,则将条件与替换数据相加并新增一条记录。
*
* @param table 数据表
* @param conditions 数组形式,查找条件,请注意,仅能使用数组作为该条件!
* @param row 数组形式,修改的数据
*/
public function replace($table, $conditions, $row)
{
if ($this->find($table, $conditions)) {
return $this->update($table, $conditions, $row);
} else {
if (!is_array($conditions)) {
qiMsg('replace方法的条件务必是数组形式!');
}
return $this->create($table, $row);
}
}
示例5: __construct
/**
* @param unknown $DB 数据库链接参数
*/
function __construct($DB)
{
if (!function_exists('mysql_connect')) {
qiMsg('服务器PHP不支持MySql数据库');
}
if ($DB['host'] && $DB['user']) {
if (!($this->conn = mysql_connect($DB['host'] . ':' . $DB['port'], $DB['user'], $DB['pwd']))) {
qiMsg("连接数据库失败,可能是数据库用户名或密码错误");
}
}
$this->query("SET NAMES 'utf8'");
if ($DB['name']) {
mysql_select_db($DB['name'], $this->conn) or qiMsg("未找到指定数据库");
}
}
示例6: foreach
<?php
//更新统计活动分类缓存
$arrTypess = $db->fetch_all_assoc("select * from " . dbprefix . "event_type");
foreach ($arrTypess as $key => $item) {
$event = $db->once_fetch_assoc("select count(eventid) from " . dbprefix . "event where typeid='" . $item['typeid'] . "'");
$arrTypes['list'][] = array('typeid' => $item['typeid'], 'typename' => $item['typename'], 'count_event' => $event['count(eventid)']);
}
$eventNum = $db->once_fetch_assoc("select count(eventid) from " . dbprefix . "event");
$arrTypes['count'] = $eventNum['count(eventid)'];
//生成缓存文件
fileWrite('event_types.php', 'data', $arrTypes);
qiMsg("更新成功!");
示例7: tsNotice
} else {
tsNotice('非法操作!');
}
break;
case "edit_do":
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');
}
//用户是否登录
$userid = aac('user')->isLogin();
$albumid = intval($_POST['albumid']);
$strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
if ($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
$albumname = trim($_POST['albumname']);
if ($albumname == '') {
qiMsg("相册名称不能为空!");
}
$albumdesc = trim($_POST['albumdesc']);
if ($TS_USER['isadmin'] == 0) {
//过滤内容开始
aac('system')->antiWord($albumname);
aac('system')->antiWord($albumdesc);
//过滤内容结束
}
$new['photo']->update('photo_album', array('userid' => $strAlbum['userid'], 'albumid' => $strAlbum['albumid']), array('albumname' => $albumname, 'albumdesc' => $albumdesc));
header("Location: " . tsUrl('photo', 'album', array('id' => $albumid)));
} else {
tsNotice('非法操作!');
}
break;
//批量修改
示例8: array
}
if ($strEvent['isaudit'] == 1) {
$new['event']->update('event', array('eventid' => $eventid), array('isaudit' => 0));
}
qiMsg('操作成功');
break;
//推荐
//推荐
case "isrecommend":
$eventid = intval($_GET['eventid']);
$strEvent = $new['event']->find('event', array('eventid' => $eventid));
if ($strEvent['isrecommend'] == 0) {
$new['event']->update('event', array('eventid' => $eventid), array('isrecommend' => 1));
}
if ($strEvent['isrecommend'] == 1) {
$new['event']->update('event', array('eventid' => $eventid), array('isrecommend' => 0));
}
qiMsg('操作成功');
break;
case "delete":
$eventid = intval($_GET['eventid']);
$strEvent = $new['event']->find('event', array('eventid' => $eventid));
if ($strEvent['photo']) {
unlink('uploadfile/event/' . $strEvent['photo']);
}
$new['event']->delete('event', array('eventid' => $eventid));
$new['event']->delete('event_comment', array('eventid' => $eventid));
$new['event']->delete('event_users', array('eventid' => $eventid));
qiMsg('删除成功');
break;
}
示例9: intval
$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;
}
示例10: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
//基本配置
case "":
$arrOptions = $new['group']->findAll('group_options');
foreach ($arrOptions as $item) {
$strOption[$item['optionname']] = stripslashes($item['optionvalue']);
}
include template("admin/options");
break;
case "do":
//先清空数据
$db->query("TRUNCATE TABLE `" . dbprefix . "group_options`");
foreach ($_POST['option'] as $key => $item) {
$optionname = $key;
$optionvalue = trim($item);
$new['group']->create('group_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
}
$arrOptions = $new['group']->findAll('group_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite('group_options.php', 'data', $arrOption);
$tsMySqlCache->set('group_options', $arrOption);
qiMsg('修改成功!');
break;
}
示例11: intval
$articleid = intval($_POST['articleid']);
$strArticle = $new['article']->find('article', array('articleid' => $articleid));
if ($strArticle['userid'] != $userid && $TS_USER['isadmin'] == 0) {
tsNotice('非法操作!');
}
$cateid = intval($_POST['cateid']);
$title = trim($_POST['title']);
$content = tsClean($_POST['content']);
if ($TS_USER['isadmin'] == 0) {
// 过滤内容开始
aac('system')->antiWord($title);
aac('system')->antiWord($content);
// 过滤内容结束
}
if ($title == '' || $content == '') {
qiMsg("标题和内容都不能为空!");
}
$new['article']->update('article', array('articleid' => $articleid), array('cateid' => $cateid, 'title' => $title, 'content' => $content));
// 处理标签
$tag = trim($_POST['tag']);
if ($tag) {
aac('tag')->delIndextag('article', 'articleid', $articleid);
aac('tag')->addTag('article', 'articleid', $articleid, $tag);
}
// 上传帖子图片开始
$arrUpload = tsUpload($_FILES['photo'], $articleid, 'article', array('jpg', 'gif', 'png', 'jpeg'));
if ($arrUpload) {
$new['article']->update('article', array('articleid' => $articleid), array('path' => $arrUpload['path'], 'photo' => $arrUpload['url']));
tsDimg($arrUpload['url'], 'article', '180', '140', $arrUpload['path']);
}
// 上传帖子图片结束
示例12: t
$albumname = t($_POST['albumname']);
if ($albumname == '') {
qiMsg("圖名称不能为空!");
}
$albumdesc = h($_POST['albumdesc']);
$addtime = time();
$uptime = time();
$albumid = $new['photo']->create('photo_album', array('userid' => $userid, 'albumname' => $albumname, 'albumdesc' => $albumdesc, 'addtime' => time(), 'uptime' => time()));
header("Location: " . SITE_URL . "index.php?app=photo&ac=ajax&ts=flash&albumid=" . $albumid);
break;
//
//
case "info":
$albumid = intval($_GET['albumid']);
$addtime = intval($_GET['addtime']);
$strAlbum = $new['photo']->find('photo_album', array('albumid' => $albumid));
if ($strAlbum['userid'] != $userid) {
qiMsg("非法操作!");
}
//统计
$count_photo = $new['photo']->findCount('photo', array('albumid' => $albumid));
$new['photo']->update('photo_album', array('albumid' => $albumid), array('count_photo' => $count_photo));
//添加圖封面
if ($strAlbum['albumface'] == '') {
$strPhoto = $new['photo']->find('photo', "`albumid`='{$albumid}' and `userid`='{$userid}' and `addtime`>'{$addtime}'");
$new['photo']->update('photo_album', array('albumid' => $albumid), array('albumface' => $strPhoto['photourl']));
}
$arrPhoto = $new['photo']->findAll('photo', "`albumid`='{$albumid}' and `userid`='{$userid}' and `addtime`>'{$addtime}'");
include template("ajax/info");
break;
}
示例13: defined
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts) {
//APP配置选项
case "options":
$arrData = array('appname' => trim($_POST['appname']), 'appdesc' => trim($_POST['appdesc']), 'isenable' => trim($_POST['isenable']), 'mailhost' => trim($_POST['mailhost']), 'ssl' => intval($_POST['ssl']), 'mailport' => trim($_POST['mailport']), 'mailuser' => trim($_POST['mailuser']), 'mailpwd' => trim($_POST['mailpwd']));
//先清空数据
$db->query("TRUNCATE TABLE `" . dbprefix . "mail_options`");
foreach ($arrData as $key => $item) {
$optionname = $key;
$optionvalue = $item;
$new['mail']->create('mail_options', array('optionname' => $optionname, 'optionvalue' => $optionvalue));
}
//更新缓存
$arrOptions = $new['mail']->findAll('mail_options', null, null, 'optionname,optionvalue');
foreach ($arrOptions as $item) {
$arrOption[$item['optionname']] = $item['optionvalue'];
}
fileWrite('mail_options.php', 'data', $arrOption);
$tsMySqlCache->set('mail_options', $arrOption);
qiMsg("邮件配置更新成功,并重置了缓存文件^_^");
break;
}
示例14: array
$new['tag']->delete('tag_topic_index', array('tagid' => $tagid));
$new['tag']->delete('tag_user_index', array('tagid' => $tagid));
header('Location: ' . SITE_URL . 'index.php?app=tag&ac=admin&mg=list&page=' . $page);
break;
//优化标签
//优化标签
case "opt":
$tagid = intval($_GET['tagid']);
$strTag = $new['tag']->getOneTag($tagid);
$tagname = t($strTag['tagname']);
$tagNum = $db->once_fetch_assoc("select count(*) from " . dbprefix . "tag where `tagname`='{$tagname}'");
if ($tagNum['count(*)'] == 0) {
$db->query("update " . dbprefix . "tag set `tagname`='{$tagname}' where `tagid`='{$tagid}'");
} elseif ($tagNum['count(*)'] == 1) {
} else {
$arrTags = $db->fetch_all_assoc("select * from " . dbprefix . "tag where `tagname`='{$tagname}'");
foreach ($arrTags as $item) {
$tagids = $item['tagid'];
//先更新索引
$db->query("update " . dbpreifx . "tag_topic_index set `tagid`='{$tagid}' where `tagid`='{$tagids}'");
$db->query("update " . dbpreifx . "tag_article_index set `tagid`='{$tagid}' where `tagid`='{$tagids}'");
$db->query("update " . dbpreifx . "tag_user_index set `tagid`='{$tagid}' where `tagid`='{$tagids}'");
//再进行删除
$db->query("delete from " . dbprefix . "tag where `tagid`='{$tagids}'");
//最后更新tag
$db->query("update " . dbprefix . "tag set `tagname`='{$tagname}' where `tagid`='{$tagid}'");
}
}
qiMsg("优化成功!");
break;
}
示例15: pagination
$pageUrl = pagination($topicNum, 10, $page, $url);
include template("admin/topic_delete");
break;
//编辑的帖子
//编辑的帖子
case "edittopic":
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = SITE_URL . 'index.php?app=group&ac=admin&mg=topic&ts=edittopic&page=';
$lstart = $page * 10 - 10;
$arrTopic = $new['group']->findAll('group_topic_edit', null, 'addtime desc', null, $lstart . ',10');
$topicNum = $new['group']->findCount('group_topic_edit');
$pageUrl = pagination($topicNum, 10, $page, $url);
include template("admin/topic_edit");
break;
//执行更新帖子
//执行更新帖子
case "update":
$topicid = intval($_GET['topicid']);
$strTopic = $new['group']->find('group_topic_edit', array('topicid' => $topicid));
$new['group']->update('group_topic', array('topicid' => $topicid), array('title' => $strTopic['title'], 'content' => $strTopic['content']));
$new['group']->update('group_topic_edit', array('topicid' => $topicid), array('isupdate' => 1));
qiMsg('更新成功!');
break;
//查看单独某个修改的帖子
//查看单独某个修改的帖子
case "editview":
$topicid = intval($_GET['topicid']);
$strTopic = $new['group']->find('group_topic_edit', array('topicid' => $topicid));
include template('admin/topic_edit_view');
break;
}