本文整理汇总了PHP中adminmsg函数的典型用法代码示例。如果您正苦于以下问题:PHP adminmsg函数的具体用法?PHP adminmsg怎么用?PHP adminmsg使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了adminmsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_sqlfile_info
function get_sqlfile_info($file)
{
$file_info = array('74cms_ver' => '', 'mysql_ver' => '', 'add_time' => '');
if (!($fp = @fopen($file, 'rb'))) {
adminmsg("打开文件{$file}失败", 0);
}
$str = fread($fp, 200);
@fclose($fp);
$arr = explode("\n", $str);
foreach ($arr as $val) {
$pos = strpos($val, ':');
if ($pos > 0) {
$type = trim(substr($val, 0, $pos), "-\n\r\t ");
$value = trim(substr($val, $pos + 1), "/\n\r\t ");
if ($type == '74CMS VERSION') {
$file_info['74cms_ver'] = $value;
} elseif ($type == 'Mysql VERSION') {
$file_info['mysql_ver'] = substr($value, 0, 3);
} elseif ($type == 'Create time') {
$file_info['add_time'] = $value;
}
}
}
return $file_info;
}
示例2: checkTags
function checkTags($tags)
{
$tmpTags = explode(',', $tags);
foreach ($tmpTags as $value) {
$tagLength = strlen(trim($value));
($tagLength > 15 || $tagLength < 3) && adminmsg('标签的长度请控制在 3-15 个字节之间', $basename);
}
return $tmpTags;
}
示例3: _checkData
function _checkData()
{
$title = trim($this->_rateconfig['title']);
$icon = trim($this->_rateconfig['icon']);
$typeid = in_array($this->_rateconfig['typeid'], array(1, 2, 3)) ? $this->_rateconfig['typeid'] : 1;
$isopen = in_array($this->_rateconfig['isopen'], array(1, 0)) ? $this->_rateconfig['isopen'] : 1;
$jumpUrl = $this->_getDefaultUrl() . "&typeid=" . $typeid;
if ($title == "" || $icon == "") {
adminmsg("对不起,标题或图标不能为空不能为空", $jumpUrl);
}
if (strlen($title) > 6) {
adminmsg("对不起,标题长度不能大于6个字节", $jumpUrl);
}
$iconExt = substr($icon, strrpos($icon, ".") + 1);
if (!in_array($iconExt, array("gif", "png", "jpg", "jpeg"))) {
adminmsg("对不起,图标格式不正确,请确定后缀是gif,png,jpg或jpeg", $jumpUrl);
}
return array($title, $icon, $typeid, $isopen, $jumpUrl);
}
示例4: _asUpFiles
function _asUpFiles($dir, $file_var, $max_size = '', $type = '', $name = false)
{
if (!file_exists($dir)) {
adminmsg("上传图片失败:上传目录 " . $dir . " 不存在!", 0);
}
if (!is_writable($dir)) {
adminmsg("上传图片失败:上传目录 " . $dir . " 无法写入!", 0);
exit;
}
$upfile =& $_FILES["{$file_var}"];
$upfilename = $upfile['name'];
if (!($upfilename === '')) {
if (!is_uploaded_file($upfile['tmp_name'])) {
adminmsg('上传图片失败:你选择的文件无法上传', 0);
exit;
}
if ($max_size > 0 && $upfile['size'] / 1024 > $max_size) {
adminmsg("上传图片失败:文件大小不能超过 " . $max_size . "KB", 0);
exit;
}
$ext_name = strtolower(str_replace(".", "", strrchr($upfilename, ".")));
if (!($type === '') && strpos($type, $ext_name) === false) {
adminmsg("上传图片失败:只允许上传 " . $type . " 的文件!", 0);
exit;
}
$name == true ? $uploadname = time() . mt_rand(100, 999) . "." . $ext_name : '';
$name == false ? $uploadname = $upfilename : '';
!is_bool($name) ? $uploadname = $name . "." . $ext_name : '';
//$uploadname = $name ? md5(uniqid(rand())).".".$ext_name : $upfilename;
if (!move_uploaded_file($upfile['tmp_name'], $dir . $uploadname)) {
adminmsg('上传图片失败:文件上传出错!', 0);
exit;
}
return $uploadname;
} else {
return '';
}
}
示例5: write_log
}
if ($num = report_audit($id, $audit, $type, $rid)) {
write_log("设置举报信息审核状态,共影响{$num}行 ", $_SESSION['admin_name'], 3);
adminmsg("设置成功!共影响 {$num}行 ", 2);
} else {
adminmsg("设置失败!", 0);
}
}
} elseif ($act == 'del_report') {
check_token();
check_permissions($_SESSION['admin_purview'], "report_del");
$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : adminmsg("你没有选择项目!", 1);
$id = $_REQUEST['id'];
if ($num = del_report($id)) {
write_log("删除举报信息,共删除{$num}行 ", $_SESSION['admin_name'], 3);
adminmsg("删除成功!共删除" . $num . "行", 2);
} else {
adminmsg("删除失败!", 0);
}
} elseif ($act == 'del_report_resume') {
check_token();
check_permissions($_SESSION['admin_purview'], "report_del");
$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : adminmsg("你没有选择项目!", 1);
$id = $_REQUEST['id'];
if ($num = del_report_resume($id)) {
write_log("删除举报简历信息,共删除{$num}行 ", $_SESSION['admin_name'], 3);
adminmsg("删除成功!共删除" . $num . "行", 2);
} else {
adminmsg("删除失败!", 0);
}
}
示例6: elseif
} elseif ($act == 'title_field') {
//数据库字段管理
get_token();
$list = get_title_field();
$smarty->assign('pageheader', "字段标题");
$smarty->assign('list', $list);
$smarty->display('replace/admin_title_field.htm');
} elseif ($act == 'title_field_save') {
//审核列表审核
get_token();
$setsqlarr['key'] = !empty($_POST['key']) ? trim($_POST['key']) : adminmsg('字段名不能为空!', 1);
$setsqlarr['value'] = !empty($_POST['value']) ? trim($_POST['value']) : adminmsg('中文名不能为空!', 1);
if (get_title_key($setsqlarr["key"])) {
adminmsg('已存在!', 1);
}
$insert_id = $db->inserttable(table('resume_field'), $setsqlarr, true);
write_log("添加替换标题字段" . $setsqlarr['name'], $_SESSION['admin_name'], 3);
$link[0]['text'] = "返回列表";
$link[0]['href'] = "?act=title_field";
adminmsg('添加成功!', 2, $link);
$smarty->display('company/admin_company_points.htm');
} elseif ($act == 'title_field_del') {
//审核列表审核
get_token();
$id = !empty($_REQUEST['id']) ? trim($_REQUEST['id']) : adminmsg('id不能为空!', 1);
if (!$db->query("Delete from " . table('resume_field') . " WHERE id IN (" . $id . ")")) {
adminmsg("删除失败!", 0);
} else {
adminmsg("删除成功!", 0);
}
}
示例7: pw_searchforum
//用于delect
if (S::inArray($key, $fids)) {
!$fidcommend[$key] && ($delSQL[$key] = $key);
}
}
$addSQL && $db->update("REPLACE INTO pw_searchforum (fid,vieworder) VALUES " . pwSqlMulti($addSQL));
if ($updateArr) {
foreach ($updateArr as $key => $value) {
$value && $db->update("UPDATE pw_searchforum SET " . pwSqlSingle($value) . " WHERE fid=" . pwEscape($key, false));
}
}
$delSQL && $db->update("DELETE FROM pw_searchforum WHERE fid IN(" . pwImplode($delSQL) . ")");
//if ($addSQL || $updateArr || $delSQL) {
updatecache_search();
//}
adminmsg('operate_success', "{$basename}&action=forum");
} elseif ($action == 'statistic') {
s::gp(array('keyword', 'createtime_s', 'createtime_e'));
$createtime_s = $createtime_s ? $createtime_s : get_date($timestamp - 7 * 24 * 3600, 'Y-m-d');
$createtime_e = $createtime_e ? $createtime_e : get_date($timestamp, 'Y-m-d');
$addsql = '';
if ($keyword) {
$keyword = trim($keyword);
$keywordarray = explode(",", $keyword);
foreach ($keywordarray as $value) {
$value = str_replace('*', '%', $value);
$keywhere .= " OR keyword LIKE " . S::sqlEscape("%{$value}%");
}
$keywhere = substr_replace($keywhere, "", 0, 3);
$addsql .= " AND ({$keywhere}) ";
}
示例8: empty
if (empty($_POST['step'])) {
$direct = 1;
empty($smstype) && adminmsg('类型不能为空');
list($searchCount, $searchList) = $messageServer->manageMessageWithCategory($smstype, $keepunread, $direct, $page, $db_perpage);
$pages = numofpage($searchCount, $page, ceil($searchCount / $db_perpage), "{$url}");
if ($direct) {
adminmsg('operate_success');
} else {
include PrintEot('superdel');
exit;
}
} elseif ($_POST['step'] == 2) {
S::gp(array('delid'), 'P');
empty($delid) && adminmsg("请选择要删除的消息");
$messageServer->manageMessageWithMessageIds($delid);
adminmsg('operate_success', "{$url}");
}
}
}
function _delModelTopic($modeldb)
{
global $db;
foreach ($modeldb as $key => $value) {
$modelids = S::sqlImplode($value);
$pw_topicvalue = GetTopcitable($key);
$db->update("DELETE FROM {$pw_topicvalue} WHERE tid IN({$modelids})");
}
}
function _delPcTopic($pcdb)
{
global $db;
示例9: adminmsg
$setsqlarr['m_type'] = 2;
!$db->updatetable(table('mailqueue'), $setsqlarr, $wheresql);
adminmsg('发送失败', 0);
}
} elseif ($act == 'del') {
$id = $_POST['id'];
if (empty($id)) {
adminmsg("请选择项目!", 1);
}
if (!is_array($id)) {
$id = array($id);
}
$sqlin = implode(",", $id);
if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
$db->query("Delete from " . table('mailqueue') . " WHERE m_id IN ({$sqlin}) ");
adminmsg("删除成功", 2);
}
} elseif ($act == "log") {
get_token();
require_once QISHI_ROOT_PATH . 'include/page.class.php';
$key = isset($_GET['key']) ? trim($_GET['key']) : "";
$key_type = isset($_GET['key_type']) ? intval($_GET['key_type']) : "";
if (!empty($key) && $key_type > 0) {
if ($key_type === 1) {
$wheresql = " WHERE subject like '%{$key}%'";
}
if ($key_type === 2) {
$wheresql = " WHERE send_to = '{$key}'";
}
if ($key_type === 3) {
$wheresql = " WHERE send_from = '{$key}'";
示例10: strpos
$checked = strpos($postcate['viewright'], ',' . $key . ',') !== false ? 'checked' : '';
$htm_tr = '';
$num++;
$num % 5 == 0 ? $htm_tr = '</tr><tr>' : '';
$viewrighthtml .= "<td><input class='input' type='checkbox' name='viewright[]' value='" . $key . "' " . $checked . ">" . $value['grouptitle'] . "</td>" . $htm_tr;
}
$viewrighthtml .= "</tr></table>";
include PrintEot('postcate');
exit;
} else {
InitGP(array('viewright', 'adminright'));
$viewrights = ',' . implode(',', $viewright) . ',';
$adminrights = ',' . implode(',', $adminright) . ',';
$db->update("UPDATE pw_postcate" . " SET " . pwSqlSingle(array('viewright' => $viewrights, 'adminright' => $adminrights)) . " WHERE pcid=" . pwEscape($pcid));
updatecache_postcate();
adminmsg('operate_success', $basename . "&action=rightset&pcid={$pcid}");
}
}
function getFieldSqlByType($type)
{
if (in_array($type, array('number', 'calendar'))) {
$sql = "INT(10) UNSIGNED NOT NULL default '0'";
} elseif (in_array($type, array('radio', 'select'))) {
$sql = "TINYINT(3) UNSIGNED NOT NULL default '0'";
} elseif ($type == 'textarea') {
$sql = "TEXT NOT NULL";
} else {
$sql = "VARCHAR(255) NOT NULL";
}
return $sql;
}
示例11: elseif
}
} elseif ($action == 'showfield') {
define('AJAX', 1);
S::gp(array('currentmodelid'));
$query = $db->query("SELECT fieldid,name FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid));
while ($rt = $db->fetch_array($query)) {
$fielddb[$rt['fieldid']] = $rt['name'];
}
$fielddb = pwJsonEncode($fielddb);
echo "success\t{$fielddb}";
ajax_footer();
} elseif ($action == 'copyfield') {
define('AJAX', 1);
S::gp(array('copyfield'));
if (empty($copyfield) || !is_array($copyfield)) {
adminmsg('topiccate_copyfield_none');
}
$query = $db->query("SELECT name,type,rules,descrip FROM pw_topicfield WHERE fieldid IN (" . S::sqlImplode($copyfield) . ")");
while ($rt = $db->fetch_array($query)) {
$name = $db->get_value("SELECT name FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid));
$db->update("INSERT INTO pw_topicfield SET " . S::sqlSingle(array('name' => $rt['name'], 'fieldname' => $rt['fieldname'], 'modelid' => $modelid, 'type' => $rt['type'], 'rules' => $rt['rules'], 'descrip' => $rt['descrip'])), false);
$fieldid = $db->insert_id();
$fieldname = 'field' . $fieldid;
$tablename = GetTopcitable($modelid);
$db->update("UPDATE pw_topicfield SET fieldname=" . S::sqlEscape($fieldname) . " WHERE fieldid=" . S::sqlEscape($fieldid));
$ckfieldname = $db->get_one("SHOW COLUMNS FROM {$tablename} LIKE '{$fieldname}'");
if ($ckfieldname) {
$db->update("DELETE FROM pw_topicfield WHERE fieldid=" . S::sqlEscape($fieldid));
Showmsg('field_have_exists');
} else {
$sql = getFieldSqlByType($rt['type']);
示例12: InitGP
$db->query("TRUNCATE TABLE pw_draft");
} else {
InitGP(array('username', 'keyword', 'num'));
$num < 1 && ($num = 200);
$sql = '';
if ($username) {
$rt = $db->get_one("SELECT uid FROM pw_members WHERE username=" . pwEscape($username));
if (!$rt) {
$errorname = $username;
adminmsg('user_not_exists');
}
$sql .= " AND uid=" . pwEscape($rt['uid']);
}
if ($keyword) {
$sql .= " AND content LIKE " . pwEscape("%{$keyword}%");
}
$db->update("DELETE FROM pw_draft WHERE 1 {$sql} LIMIT {$num}");
}
adminmsg('operate_success');
}
} elseif ($_POST['action'] == 'draft') {
InitGP(array('selid'));
if (!($selid = checkselid($selid))) {
adminmsg('operate_error');
}
$db->update("DELETE FROM pw_draft WHERE did IN({$selid})");
adminmsg("operate_success");
} elseif ($_POST['action'] == 'empty') {
$db->query("TRUNCATE TABLE pw_draft");
adminmsg("operate_success");
}
示例13: countPosts
countPosts("-{$affected_rows}");
}
$uids[] = $rt['uid'];
$dids[] = $rt['did'];
}
$uids = array_unique($uids);
updateUserAppNum($uids, 'diary', 'recount');
//删除日志时,删除微博
$weiboService = L::loadClass('weibo', 'sns');
/* @var $weiboService PW_Weibo */
$weiboArr = $weiboService->getWeibosByObjectIdsAndType($dids, 'diary');
foreach ($weiboArr as $weibo) {
$mids[] = $weibo['mid'];
}
$mids && $weiboService->deleteWeibos($mids);
adminmsg('operate_success', "{$basename}&action=cp&step=list&groupid={$groupid}&author={$author}&keyword={$keyword}&postdate_s={$postdate_s}&postdate_e={$postdate_e}&hits={$hits}&replies={$replies}&tcounts={$tcounts}&counts={$counts}&orderby={$orderby}&sc={$sc}&perpage={$perpage}&&page={$page}&");
} else {
$sc = $sc ? $sc : 'desc';
$diarydb = array();
!$perpage && ($perpage = $db_perpage);
null === $searchDisplay && ($searchDisplay = 'none');
if (empty($groupid) && empty($groups) && empty($author) && empty($keyword) && empty($postdate_s) && empty($postdate_s) && empty($postdate_e)) {
$noticeMessage = getLangInfo('cpmsg', 'noenough_condition');
} else {
$sql = " WHERE 1";
if ($groupid) {
$groups = explode(",", $groupid);
}
if ($groups) {
$groupid = implode(",", $groups);
$sql .= " AND m.groupid IN(" . S::sqlImplode($groups) . ")";
示例14: adminmsg
$link[1]['href'] = '?act=exhibitors';
adminmsg("添加成功!", 2, $link);
} else {
adminmsg("添加失败!", 0);
}
} elseif ($act == 'exhibitors_edit') {
check_permissions($_SESSION['admin_purview'], "jobfair_exhibitors");
get_token();
$id = intval($_GET['id']);
$sql = "select * from " . table('jobfair_exhibitors') . " where id='{$id}' LIMIT 1";
$info = $db->getone($sql);
if ($info['uid'] > 0) {
$info['company_url'] = url_rewrite('QS_companyshow', array('id' => $info['company_id']));
}
$smarty->assign('info', $info);
$smarty->assign('jobfair', get_jobfair_audit());
$smarty->assign('pageheader', "招聘会");
$smarty->display('jobfair/admin_jobfair_exhibitors_edit.htm');
} elseif ($act == 'exhibitors_edit_save') {
check_permissions($_SESSION['admin_purview'], "jobfair_exhibitors");
check_token();
$id = intval($_POST['id']);
$setsqlarr['companyname'] = !empty($_POST['companyname']) ? trim($_POST['companyname']) : adminmsg('您没有企业名称!', 1);
$setsqlarr['audit'] = intval($_POST['audit']);
$setsqlarr['etypr'] = intval($_POST['etypr']);
$setsqlarr['note'] = trim($_POST['note']);
$link[0]['text'] = "返回列表";
$link[0]['href'] = '?act=exhibitors';
write_log("修改id为:" . $id . "的参会企业信息", $_SESSION['admin_name'], 3);
!$db->updatetable(table('jobfair_exhibitors'), $setsqlarr, " id=" . $id . "") ? adminmsg("修改失败!", 0) : adminmsg("修改成功!", 2, $link);
}
示例15: PostCheck
function PostCheck($verify)
{
global $db_hash, $admin_name, $admin_gid;
$source = '';
foreach ($_GET as $key => $val) {
if (!in_array($key, array('verify', 'nowtime'))) {
$source .= $key . $val;
}
}
if ($verify != substr(md5($source . $admin_name . $admin_gid . $db_hash), 0, 8)) {
adminmsg('illegal_request');
}
return true;
}