本文整理汇总了PHP中CheckLevel函数的典型用法代码示例。如果您正苦于以下问题:PHP CheckLevel函数的具体用法?PHP CheckLevel怎么用?PHP CheckLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckLevel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DelAdClass
function DelAdClass($classid, $userid, $username)
{
global $empire, $public_r, $dbtbpre;
$classid = (int) $classid;
if (!$classid) {
printerror("NotChangeAdClassid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "ad");
$c = $empire->fetch1("select classname from {$dbtbpre}enewsadclass where classid='{$classid}'");
$sql = $empire->query("delete from {$dbtbpre}enewsadclass where classid='{$classid}'");
/*
//删除广告内容
$a=$empire->query("select adid from {$dbtbpre}enewsad where classid='$classid'");
while($r=$empire->fetch($a))
{
$file="../../../d/js/acmsd/".$public_r[adfile].$r[adid].".js";
DelFiletext($file);
}
*/
if ($sql) {
//操作日志
insert_dolog("classid=" . $classid . "<br>classname=" . $c[classname]);
printerror("DelAdClassSuccess", "AdClass.php");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例2: DelSearchKey_all
function DelSearchKey_all($add, $userid, $username)
{
global $empire, $dbtbpre;
//验证权限
CheckLevel($userid, $username, $classid, "searchkey");
$searchid = $add['searchid'];
$count = count($searchid);
if (empty($count)) {
printerror("EmptySearchId", "history.go(-1)");
}
$ids = '';
for ($i = 0; $i < $count; $i++) {
$dh = ',';
if ($i == 0) {
$dh = '';
}
$ids .= $dh . intval($searchid[$i]);
}
$sql = $empire->query("delete from {$dbtbpre}enewssearch where searchid in (" . $ids . ");");
if ($sql) {
//操作日志
insert_dolog("");
printerror("DelSearchKeySuccess", "SearchKey.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例3: DelClasstemp
function DelClasstemp($add, $userid, $username)
{
global $empire, $dbtbpre, $public_r;
$tempid = (int) $add['tempid'];
if (!$tempid) {
printerror("EmptyClasstempid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "template");
$gid = (int) $add['gid'];
$r = $empire->fetch1("select tempname from " . GetDoTemptb("enewsclasstemp", $gid) . " where tempid={$tempid}");
$sql = $empire->query("delete from " . GetDoTemptb("enewsclasstemp", $gid) . " where tempid={$tempid}");
//删除备份记录
DelEbakTempAll('classtemp', $gid, $tempid);
if ($gid == $public_r['deftempid'] || !$public_r['deftempid'] && ($gid == 1 || $gid == 0)) {
//删除动态模板缓存文件
DelOneTempTmpfile('classtemp' . $tempid);
}
if ($sql) {
//操作日志
insert_dolog("tempid={$tempid}&tempname={$r['tempname']}&gid={$gid}");
printerror("DelClasstempSuccess", "ListClasstemp.php?classid={$add['cid']}&gid={$gid}");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例4: SetRewrite
function SetRewrite($add, $userid, $username)
{
global $empire, $dbtbpre;
CheckLevel($userid, $username, $classid, "public");
//验证权限
$sql = $empire->query("update {$dbtbpre}enewspublic set rewriteinfo='" . eaddslashes($add[rewriteinfo]) . "',rewriteclass='" . eaddslashes($add[rewriteclass]) . "',rewriteinfotype='" . eaddslashes($add[rewriteinfotype]) . "',rewritetags='" . eaddslashes($add[rewritetags]) . "',rewritepl='" . eaddslashes($add[rewritepl]) . "' limit 1");
if ($sql) {
GetConfig();
//操作日志
insert_dolog("");
printerror("SetRewriteSuccess", "SetRewrite.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例5: EditMenu
function EditMenu($add, $userid, $username)
{
global $empire, $dbtbpre;
$classid = (int) $add['classid'];
$menuid = $add['menuid'];
$delmenuid = $add['delmenuid'];
$menuname = $add['menuname'];
$menuurl = $add['menuurl'];
$myorder = $add['myorder'];
$addhash = $add['addhash'];
$count = count($menuid);
if (!$classid || !$count) {
printerror("EmptyMenu", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "menu");
//删除
$del = 0;
$ids = '';
$delcount = count($delmenuid);
if ($delcount) {
$dh = '';
for ($j = 0; $j < $delcount; $j++) {
$ids .= $dh . intval($delmenuid[$j]);
$dh = ',';
}
$empire->query("delete from {$dbtbpre}enewsmenu where menuid in (" . $ids . ")");
$del = 1;
}
//修改
for ($i = 0; $i < $count; $i++) {
$menuid[$i] = (int) $menuid[$i];
if (strstr(',' . $ids . ',', ',' . $menuid[$i] . ',')) {
continue;
}
$myorder[$i] = (int) $myorder[$i];
$menuname[$i] = hRepPostStr($menuname[$i], 1);
$menuurl[$i] = hRepPostStr($menuurl[$i], 1);
$addhash[$i] = (int) $addhash[$i];
$empire->query("update {$dbtbpre}enewsmenu set menuname='" . $menuname[$i] . "',menuurl='" . $menuurl[$i] . "',myorder='" . $myorder[$i] . "',addhash='" . $addhash[$i] . "' where menuid='" . $menuid[$i] . "'");
}
//操作日志
insert_dolog("classid={$classid}&del={$del}");
printerror("EditMenuSuccess", "ListMenu.php?classid={$classid}" . hReturnEcmsHashStrHref2(0));
}
示例6: DelDownurl
function DelDownurl($urlid, $userid, $username)
{
global $empire, $dbtbpre;
$urlid = (int) $urlid;
if (empty($urlid)) {
printerror("NotChangeDownurlid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "downurl");
$sql = $empire->query("delete from {$dbtbpre}enewsdownurlqz where urlid='{$urlid}'");
if ($sql) {
//操作日志
insert_dolog("urlid=" . $urlid);
printerror("DelDownurlSuccess", "url.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例7: DelDownRecord
function DelDownRecord($add, $userid, $username)
{
global $empire, $dbtbpre;
if (empty($add['downtime'])) {
printerror("EmptyDownTime", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "deldownrecord");
$truetime = to_time($add['downtime']);
$sql = $empire->query("delete from {$dbtbpre}enewsdownrecord where truetime<=" . $truetime);
if ($sql) {
//操作日志
insert_dolog("time={$add['downtime']}");
printerror("DelDownRecordSuccess", "DelDownRecord.php");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例8: SetClassInfoType
function SetClassInfoType($add, $logininid, $loginin)
{
global $empire, $dbtbpre;
CheckLevel($logininid, $loginin, $classid, "class");
//验证权限
$classid = (int) $add['classid'];
if (empty($classid)) {
printerror("ErrorUrl", "history.go(-1)");
}
$cr = $empire->fetch1("select classid,modid,classname,islast from {$dbtbpre}enewsclass where classid='{$classid}'");
if (!$cr['classid'] || !$cr['islast'] || !$cr['modid']) {
printerror("ErrorUrl", "history.go(-1)");
}
$noclassinfo = (int) $add['noclassinfo'];
if ($noclassinfo == 1) {
$ttids = '-';
} else {
$typeid = $add['typeid'];
$count = count($typeid);
$ttids = '';
if ($count) {
$dh = '';
for ($i = 0; $i < $count; $i++) {
$tid = (int) $typeid[$i];
if (empty($tid)) {
continue;
}
$ttids .= $dh . $tid;
$dh = ',';
}
if ($ttids) {
$ttids = ',' . $ttids . ',';
}
}
}
$sql = $empire->query("update {$dbtbpre}enewsclassadd set ttids='{$ttids}' where classid='{$classid}'");
if ($sql) {
insert_dolog("classid={$classid}&classname={$cr['classname']}");
//操作日志
printerror("SetClassInfoTypeSuccess", "ClassInfoType.php?classid={$classid}" . hReturnEcmsHashStrHref2(0));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例9: DelPs
function DelPs($pid, $userid, $username)
{
global $empire, $dbtbpre;
$pid = (int) $pid;
if (!$pid) {
printerror("EmptyPayfsid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "shopps");
$r = $empire->fetch1("select pname from {$dbtbpre}enewsshopps where pid='{$pid}'");
$sql = $empire->query("delete from {$dbtbpre}enewsshopps where pid='{$pid}'");
if ($sql) {
//操作日志
insert_dolog("pid=" . $pid . "<br>pname=" . $r[pname]);
printerror("DelPayfsSuccess", "ListPs.php");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例10: DelNotcj
function DelNotcj($id, $userid, $username)
{
global $empire, $dbtbpre;
//验证权限
CheckLevel($userid, $username, $classid, "notcj");
$id = (int) $id;
if (!$id) {
printerror("EmptyDelNotcjid", "history.go(-1)");
}
$sql = $empire->query("delete from {$dbtbpre}enewsnotcj where id='{$id}'");
GetNotcj();
if ($sql) {
//操作日志
insert_dolog("id={$id}");
printerror("DelNotcjSuccess", "NotCj.php");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例11: EditMenuClass
function EditMenuClass($add, $userid, $username)
{
global $empire, $dbtbpre;
$classid = $add['classid'];
$delclassid = $add['delclassid'];
$classname = $add['classname'];
$myorder = $add['myorder'];
$classtype = $add['classtype'];
$count = count($classid);
if (!$count) {
printerror("EmptyMenuClass", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "menu");
//删除
$del = 0;
$ids = '';
$delcount = count($delclassid);
if ($delcount) {
$dh = '';
for ($j = 0; $j < $delcount; $j++) {
$ids .= $dh . intval($delclassid[$j]);
$dh = ',';
}
$empire->query("delete from {$dbtbpre}enewsmenuclass where classid in (" . $ids . ")");
$empire->query("delete from {$dbtbpre}enewsmenu where classid in (" . $ids . ")");
$del = 1;
}
//修改
for ($i = 0; $i < $count; $i++) {
$classid[$i] = (int) $classid[$i];
if (strstr(',' . $ids . ',', ',' . $classid[$i] . ',')) {
continue;
}
$myorder[$i] = (int) $myorder[$i];
$classtype[$i] = (int) $classtype[$i];
$empire->query("update {$dbtbpre}enewsmenuclass set classname='" . addslashes($classname[$i]) . "',myorder='" . $myorder[$i] . "',classtype='" . $classtype[$i] . "' where classid='" . $classid[$i] . "'");
}
MenuClassToShow();
//操作日志
insert_dolog("del={$del}");
printerror("EditMenuClassSuccess", "MenuClass.php");
}
示例12: DelSpClass
function DelSpClass($classid, $userid, $username)
{
global $empire, $dbtbpre;
$classid = (int) $classid;
if (!$classid) {
printerror("NotDelSpClassid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "sp");
$r = $empire->fetch1("select classname from {$dbtbpre}enewsspclass where classid='{$classid}'");
$sql = $empire->query("delete from {$dbtbpre}enewsspclass where classid='{$classid}'");
if ($sql) {
//操作日志
insert_dolog("classid=" . $classid . "<br>classname=" . $r[classname]);
printerror("DelSpClassSuccess", "ListSpClass.php");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例13: DelKeyClass
function DelKeyClass($classid, $userid, $username)
{
global $empire, $dbtbpre;
$classid = (int) $classid;
if (!$classid) {
printerror("NotKeyClassid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "key");
$r = $empire->fetch1("select classname from {$dbtbpre}enewskeyclass where classid='{$classid}'");
$sql = $empire->query("delete from {$dbtbpre}enewskeyclass where classid='{$classid}'");
$sql1 = $empire->query("update {$dbtbpre}enewskey set cid=0 where cid='{$classid}'");
if ($sql) {
//操作日志
insert_dolog("classid=" . $classid . "<br>classname=" . $r[classname]);
printerror("DelKeyClassSuccess", "KeyClass.php" . hReturnEcmsHashStrHref2(1));
} else {
printerror("DbError", "history.go(-1)");
}
}
示例14: DelWorkflow
function DelWorkflow($add, $userid, $username)
{
global $empire, $dbtbpre;
$wfid = (int) $add[wfid];
if (!$wfid) {
printerror('NotDelWorkflowid', 'history.go(-1)');
}
//验证权限
CheckLevel($userid, $username, $classid, "workflow");
$r = $empire->fetch1("select wfname from {$dbtbpre}enewsworkflow where wfid='{$wfid}'");
$sql = $empire->query("delete from {$dbtbpre}enewsworkflow where wfid='{$wfid}'");
$sql2 = $empire->query("delete from {$dbtbpre}enewsworkflowitem where wfid='{$wfid}'");
if ($sql && $sql2) {
//操作日志
insert_dolog("wfid=" . $wfid . "<br>wfname=" . $r[wfname]);
printerror("DelWorkflowSuccess", "ListWf.php");
} else {
printerror("DbError", "history.go(-1)");
}
}
示例15: DelLink
function DelLink($lid, $cid, $userid, $username)
{
global $empire, $dbtbpre;
$lid = (int) $lid;
$cid = (int) $cid;
if (!$lid) {
printerror("EmptyLid", "history.go(-1)");
}
//验证权限
CheckLevel($userid, $username, $classid, "link");
$r = $empire->fetch1("select lname from {$dbtbpre}enewslink where lid='{$lid}'");
$sql = $empire->query("delete from {$dbtbpre}enewslink where lid='{$lid}'");
if ($sql) {
//操作日志
insert_dolog("lid=" . $lid . "<br>lname=" . $r[lname]);
printerror("DelLinkSuccess", "ListLink.php?classid={$cid}");
} else {
printerror("DbError", "history.go(-1)");
}
}