本文整理汇总了PHP中iACP类的典型用法代码示例。如果您正苦于以下问题:PHP iACP类的具体用法?PHP iACP怎么用?PHP iACP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了iACP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_iCMS
function do_iCMS()
{
$filter = $this->setting->get(0, 'word.filter');
$disable = $this->setting->get(0, 'word.disable');
foreach ((array) $filter as $k => $val) {
$filterArray[$k] = implode("=", (array) $val);
}
include iACP::view("filter");
}
示例2: do_iCMS
function do_iCMS()
{
$res = iFS::folder('template', array('htm', 'css', 'js', 'png', 'jpg', 'gif'));
$dirRs = $res['DirArray'];
$fileRs = $res['FileArray'];
$pwd = $res['pwd'];
$parent = $res['parent'];
$URI = $res['URI'];
$navbar = true;
$file_edit = true;
include iACP::view("files.explorer");
}
示例3: do_iCMS
function do_iCMS()
{
if ($_GET['keywords']) {
$sql = " WHERE `keyword` REGEXP '{$_GET['keywords']}'";
}
$orderby = $_GET['orderby'] ? $_GET['orderby'] : "id DESC";
$maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20;
$total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__keywords` {$sql}", "G");
iPHP::pagenav($total, $maxperpage, "个关键词");
$rs = iDB::all("SELECT * FROM `#iCMS@__keywords` {$sql} order by {$orderby} LIMIT " . iPHP::$offset . " , {$maxperpage}");
$_count = count($rs);
include iACP::view("keywords.manage");
}
示例4: do_save
function do_save()
{
$uid = (int) $_POST['uid'];
$gender = (int) $_POST['gender'];
$type = $_POST['type'];
$username = iS::escapeStr($_POST['uname']);
$nickname = iS::escapeStr($_POST['nickname']);
$realname = iS::escapeStr($_POST['realname']);
$power = $_POST['power'] ? json_encode($_POST['power']) : '';
$cpower = $_POST['cpower'] ? json_encode($_POST['cpower']) : '';
$gid = 0;
$info = array();
$info['icq'] = iS::escapeStr($_POST['icq']);
$info['home'] = iS::escapeStr($_POST['home']);
$info['year'] = intval($_POST['year']);
$info['month'] = intval($_POST['month']);
$info['day'] = intval($_POST['day']);
$info['from'] = iS::escapeStr($_POST['from']);
$info['signature'] = iS::escapeStr($_POST['signature']);
$info = addslashes(serialize($info));
$_POST['pwd'] && ($password = md5($_POST['pwd']));
$username or iPHP::alert('账号不能为空');
if (iACP::is_superadmin()) {
$gid = (int) $_POST['gid'];
} else {
isset($_POST['gid']) && iPHP::alert('您没有权限更改角色');
}
$fields = array('gid', 'gender', 'username', 'nickname', 'realname', 'power', 'cpower', 'info');
$data = compact($fields);
if (empty($uid)) {
iDB::value("SELECT `uid` FROM `#iCMS@__members` where `username` ='{$username}' LIMIT 1") && iPHP::alert('该账号已经存在');
$_data = compact(array('password', 'regtime', 'lastip', 'lastlogintime', 'logintimes', 'post', 'type', 'status'));
$_data['regtime'] = time();
$_data['lastip'] = iPHP::getIp();
$_data['lastlogintime'] = time();
$_data['status'] = '1';
$data = array_merge($data, $_data);
iDB::insert('members', $data);
$msg = "账号添加完成!";
} else {
iDB::value("SELECT `uid` FROM `#iCMS@__members` where `username` ='{$username}' AND `uid` !='{$uid}' LIMIT 1") && iPHP::alert('该账号已经存在');
iDB::update('members', $data, array('uid' => $uid));
$password && iDB::query("UPDATE `#iCMS@__members` SET `password`='{$password}' WHERE `uid` ='" . $uid . "'");
$msg = "账号修改完成!";
}
iPHP::success($msg, 'url:' . APP_URI);
}
示例5: do_iCMS
function do_iCMS()
{
//数据统计
$rs = iDB::all("SHOW FULL TABLES FROM `" . iPHP_DB_NAME . "` WHERE table_type = 'BASE TABLE';");
foreach ($rs as $k => $val) {
if (strstr(iPHP_DB_PREFIX, $val['Tables_in_' . iPHP_DB_NAME]) === false) {
$iTable[] = strtoupper($val['Tables_in_' . iPHP_DB_NAME]);
} else {
$oTable[] = $val['Tables_in_' . iPHP_DB_NAME];
}
}
$content_datasize = 0;
$tables = iDB::all("SHOW TABLE STATUS");
$_count = count($tables);
for ($i = 0; $i < $_count; $i++) {
$tableName = strtoupper($tables[$i]['Name']);
if (in_array($tableName, $iTable)) {
$datasize += $tables[$i]['Data_length'];
$indexsize += $tables[$i]['Index_length'];
if (stristr(strtoupper(iPHP_DB_PREFIX . "article," . iPHP_DB_PREFIX . "category," . iPHP_DB_PREFIX . "comment," . iPHP_DB_PREFIX . "article_data"), $tableName)) {
$content_datasize += $tables[$i]['Data_length'] + $tables[$i]['Index_length'];
}
}
}
$acc = iDB::value("SELECT count(*) FROM `#iCMS@__category` WHERE `appid`='" . iCMS_APP_ARTICLE . "'");
$tac = iDB::value("SELECT count(*) FROM `#iCMS@__category` WHERE `appid`='" . iCMS_APP_TAG . "'");
$pac = iDB::value("SELECT count(*) FROM `#iCMS@__category` WHERE `appid`='" . iCMS_APP_PUSH . "'");
$ac = iDB::value("SELECT count(*) FROM `#iCMS@__article`");
$ac0 = iDB::value("SELECT count(*) FROM `#iCMS@__article` WHERE `status`='0'");
$ac2 = iDB::value("SELECT count(*) FROM `#iCMS@__article` WHERE `status`='2'");
$ctc = iDB::value("SELECT count(*) FROM `#iCMS@__comment`");
$tc = iDB::value("SELECT count(*) FROM `#iCMS@__tags`");
$kc = iDB::value("SELECT count(*) FROM `#iCMS@__keywords`");
$pc = iDB::value("SELECT count(*) FROM `#iCMS@__push`");
$uc = iDB::value("SELECT count(*) FROM `#iCMS@__user`");
$fdc = iDB::value("SELECT count(*) FROM `#iCMS@__filedata`");
$lc = iDB::value("SELECT count(*) FROM `#iCMS@__links`");
include iACP::view("home");
}
示例6:
</ul>
</div>
<div id="<?php
echo iACP::$app_name;
?>
-cpower" class="tab-pane hide">
<div class="input-prepend input-append"><span class="add-on">全选</span><span class="add-on">
<input type="checkbox" class="checkAll checkbox" data-target="#<?php
echo iACP::$app_name;
?>
-cpower"/>
</span><button class="btn btn-primary" type="submit"><i class="fa fa-check"></i> 提交</button>
</div>
<div class="clearfloat mb10"></div>
<div class="input-prepend input-append">
<span class="add-on"><i class="fa fa-cog"></i> 全局权限</span>
<span class="add-on">::</span>
<span class="add-on">允许添加顶级栏目</span>
<span class="add-on"><input type="checkbox" name="cpower[]" value="0:a" /></span>
</div>
<div class="clearfloat mb10"></div>
<span class="label label-important">注:只有文章类型的栏目才有内容权限</span>
<div id="cpower_treecontrol"> <a style="display:none;"></a> <a style="display:none;"></a> <a class="btn btn-mini btn-info" href="javascript:;">展开/收缩</a></div>
<ul id="cpower_tree">
<?php
echo iACP::app('category', 'all')->power_tree();
?>
</ul>
</div>
示例7: do_save
function do_save()
{
$id = (int) $_POST['id'];
$cid = (int) $_POST['cid'];
$_cid = (int) $_POST['_cid'];
$userid = (int) $_POST['userid'];
$pid = (int) $_POST['pid'];
$editor = iS::escapeStr($_POST['editor']);
$ordernum = _int($_POST['ordernum']);
$addtime = iPHP::str2time($_POST['addtime']);
$title = iS::escapeStr($_POST['title']);
$pic = $this->getpic($_POST['pic']);
$description = iS::escapeStr($_POST['description']);
$url = iS::escapeStr($_POST['url']);
$title2 = iS::escapeStr($_POST['title2']);
$pic2 = $this->getpic($_POST['pic2']);
$description2 = iS::escapeStr($_POST['description2']);
$url2 = iS::escapeStr($_POST['url2']);
$title3 = iS::escapeStr($_POST['title3']);
$pic3 = $this->getpic($_POST['pic3']);
$description3 = iS::escapeStr($_POST['description3']);
$url3 = iS::escapeStr($_POST['url3']);
$metadata = iS::escapeStr($_POST['metadata']);
$metadata = $metadata ? addslashes(serialize($metadata)) : '';
empty($userid) && ($userid = iMember::$userid);
empty($title) && iPHP::alert('1.标题必填');
empty($cid) && iPHP::alert('请选择所属栏目');
$haspic = empty($pic) ? 0 : 1;
$status = 1;
$fields = array('cid', 'rootid', 'pid', 'haspic', 'editor', 'userid', 'title', 'pic', 'url', 'description', 'title2', 'pic2', 'url2', 'description2', 'title3', 'pic3', 'url3', 'description3', 'ordernum', 'metadata', 'addtime', 'hits', 'status');
$data = compact($fields);
if (empty($id)) {
iDB::insert('push', $data);
iDB::query("UPDATE `#iCMS@__category` SET `count` = count+1 WHERE `cid` ='{$cid}' LIMIT 1 ");
$msg = '推送完成';
} else {
iDB::update('push', $data, array('id' => $id));
if ($_cid != $cid) {
iDB::query("UPDATE `#iCMS@__category` SET `count` = count-1 WHERE `cid` ='{$_cid}' and `count`>0 LIMIT 1 ");
iDB::query("UPDATE `#iCMS@__category` SET `count` = count+1 WHERE `cid` ='{$cid}' LIMIT 1 ");
}
$msg = '编辑完成!';
}
iACP::callback($id, $this);
if ($this->callback['code']) {
return array("code" => $this->callback['code'], 'indexid' => $id);
}
iPHP::success($msg, 'url:' . APP_URI);
}
示例8: do_batch
function do_batch()
{
$idArray = (array) $_POST['id'];
$idArray or iPHP::alert("请选择要操作的标签");
$ids = implode(',', $idArray);
$batch = $_POST['batch'];
switch ($batch) {
case 'dels':
iPHP::$break = false;
foreach ($idArray as $id) {
$this->do_del($id, false);
}
iPHP::$break = true;
iPHP::success('标签全部删除完成!', 'js:1');
break;
case 'move':
$_POST['cid'] or iPHP::alert("请选择目标栏目!");
iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
map::init('category', $this->appid);
$cid = (int) $_POST['cid'];
foreach ($idArray as $id) {
$_cid = iDB::value("SELECT `cid` FROM `#iCMS@__tags` where `id` ='{$id}'");
iDB::update("tags", compact('cid'), compact('id'));
if ($_cid != $cid) {
map::diff($cid, $_cid, $id);
$this->categoryApp->update_count_one($_cid, '-');
$this->categoryApp->update_count_one($cid);
}
}
iPHP::success('成功移动到目标栏目!', 'js:1');
break;
case 'mvtcid':
$_POST['tcid'] or iPHP::alert("请选择目标分类!");
iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
map::init('category', $this->appid);
$tcid = (int) $_POST['tcid'];
foreach ($idArray as $id) {
$_tcid = iDB::value("SELECT `tcid` FROM `#iCMS@__tags` where `id` ='{$id}'");
iDB::update("tags", compact('tcid'), compact('id'));
if ($_tcid != $tcid) {
map::diff($tcid, $_tcid, $id);
$this->categoryApp->update_count_one($_tcid, '-');
$this->categoryApp->update_count_one($tcid);
}
}
iPHP::success('成功移动到目标分类!', 'js:1');
break;
case 'prop':
iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
map::init('prop', $this->appid);
$pid = implode(',', (array) $_POST['pid']);
foreach ((array) $_POST['id'] as $id) {
$_pid = iDB::value("SELECT pid FROM `#iCMS@__tags` WHERE `id`='{$id}'");
iDB::update("tags", compact('pid'), compact('id'));
map::diff($pid, $_pid, $id);
}
iPHP::success('属性设置完成!', 'js:1');
break;
case 'weight':
$weight = _int($_POST['mweight']);
$sql = "`weight` = '{$weight}'";
break;
case 'tpl':
$tpl = iS::escapeStr($_POST['mtpl']);
$sql = "`tpl` = '{$tpl}'";
break;
case 'keyword':
if ($_POST['pattern'] == 'replace') {
$sql = "`keywords` = '" . iS::escapeStr($_POST['mkeyword']) . "'";
} elseif ($_POST['pattern'] == 'addto') {
foreach ($idArray as $id) {
$keywords = iDB::value("SELECT keywords FROM `#iCMS@__tags` WHERE `id`='{$id}'");
$sql = "`keywords` = '" . ($keywords ? $keywords . ',' . iS::escapeStr($_POST['mkeyword']) : iS::escapeStr($_POST['mkeyword'])) . "'";
iDB::query("UPDATE `#iCMS@__tags` SET {$sql} WHERE `id`='{$id}'");
}
iPHP::success('关键字更改完成!', 'js:1');
}
break;
case 'tag':
if ($_POST['pattern'] == 'replace') {
$sql = "`related` = '" . iS::escapeStr($_POST['mtag']) . "'";
} elseif ($_POST['pattern'] == 'addto') {
foreach ($idArray as $id) {
$keywords = iDB::value("SELECT related FROM `#iCMS@__tags` WHERE `id`='{$id}'");
$sql = "`related` = '" . ($keywords ? $keywords . ',' . iS::escapeStr($_POST['mtag']) : iS::escapeStr($_POST['mtag'])) . "'";
iDB::query("UPDATE `#iCMS@__tags` SET {$sql} WHERE `id`='{$id}'");
}
iPHP::success('相关标签更改完成!', 'js:1');
}
break;
default:
if (strpos($batch, ':')) {
$data = iACP::fields($batch);
foreach ($idArray as $id) {
$data && iDB::update("tags", $data, array('id' => $id));
}
iPHP::success('操作成功!', 'js:1');
} else {
iPHP::alert('请选择要操作项!', 'js:1');
}
//.........这里部分代码省略.........
示例9: do_addproject
function do_addproject()
{
$rs = array();
$this->pid && ($rs = spider::project($this->pid));
$cid = empty($rs['cid']) ? $this->cid : $rs['cid'];
$categoryApp = iACP::app('category', iCMS_APP_ARTICLE);
$cata_option = $categoryApp->select(false, $cid);
$rule_option = $this->rule_opt($rs['rid']);
$post_option = $this->post_opt($rs['poid']);
//$rs['sleep'] OR $rs['sleep'] = 30;
include iACP::view("spider.addproject");
}
示例10: article_data
function article_data($bodyArray, $aid = 0, $haspic = 0)
{
if (isset($_POST['ischapter']) || is_array($_POST['adid'])) {
$adidArray = $_POST['adid'];
$chaptertitle = $_POST['chaptertitle'];
$chapter = count($bodyArray);
foreach ($bodyArray as $key => $body) {
$adid = (int) $adidArray[$key];
$subtitle = iS::escapeStr($chaptertitle[$key]);
$this->body($body, $subtitle, $aid, $adid, $haspic);
}
articleTable::update(compact('chapter'), array('id' => $aid));
} else {
$adid = (int) $_POST['adid'];
$subtitle = iS::escapeStr($_POST['subtitle']);
$body = implode('#--iCMS.PageBreak--#', $bodyArray);
$this->body($body, $subtitle, $aid, $adid, $haspic);
}
iACP::callback($aid, $this, 'data');
}
示例11: do_manage
function do_manage($doType = null)
{
$cid = (int) $_GET['cid'];
$sql = " where ";
switch ($doType) {
//status:[0:草稿][1:正常][2:回收][3:审核][4:不合格]
case 'inbox':
//草稿
$sql .= "`status` ='0'";
// if(iMember::$data->gid!=1){
// $sql.=" AND `userid`='".iMember::$userid."'";
// }
$position = "草稿";
break;
case 'trash':
//回收站
$sql .= "`status` ='2'";
$position = "回收站";
break;
case 'examine':
//审核
$sql .= "`status` ='3'";
$position = "已审核";
break;
case 'off':
//未通过
$sql .= "`status` ='4'";
$position = "未通过";
break;
default:
$sql .= " `status` ='1'";
$cid && ($position = $this->category[$cid]['name']);
}
if ($_GET['keywords']) {
$sql .= " AND CONCAT(title,title2,title3) REGEXP '{$_GET['keywords']}'";
}
$sql .= $this->categoryApp->search_sql($cid);
isset($_GET['nopic']) && ($sql .= " AND `haspic` ='0'");
$_GET['starttime'] && ($sql .= " and `addtime`>=UNIX_TIMESTAMP('" . $_GET['starttime'] . " 00:00:00')");
$_GET['endtime'] && ($sql .= " and `addtime`<=UNIX_TIMESTAMP('" . $_GET['endtime'] . " 23:59:59')");
isset($_GET['userid']) && ($uri .= '&userid=' . (int) $_GET['userid']);
isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
isset($_GET['pid']) && ($uri .= '&pid=' . $_GET['pid']);
isset($_GET['cid']) && ($uri .= '&cid=' . $_GET['cid']);
isset($_GET['pid']) && $_GET['pid'] != '-1' && ($uri .= '&pid=' . $_GET['at']);
$orderby = $_GET['orderby'] ? $_GET['orderby'] : "id DESC";
$maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20;
$total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__push` {$sql}", "G");
iPHP::pagenav($total, $maxperpage, "条记录");
$rs = iDB::all("SELECT * FROM `#iCMS@__push` {$sql} order by {$orderby} LIMIT " . iPHP::$offset . " , {$maxperpage}");
$_count = count($rs);
include iACP::view("push.manage");
}
示例12: do_replace
function do_replace()
{
include iACP::view("database.replace");
}
示例13: do_delfile
function do_delfile()
{
iACP::MP('FILE.DELETE', 'alert');
$_GET['path'] or iPHP::alert("请选择要删除的文件");
strpos($_GET['path'], '..') !== false && iPHP::alert("文件路径中带有..");
$hash = md5($_GET['path']);
$FileRootPath = iFS::fp($_GET['path'], '+iPATH');
if (iFS::del($FileRootPath)) {
$msg = 'success:#:check:#:文件删除完成!';
$_GET['ajax'] && iPHP::json(array('code' => 1, 'msg' => $msg));
} else {
$msg = 'warning:#:warning:#:找不到相关文件,文件删除失败!';
$_GET['ajax'] && iPHP::json(array('code' => 0, 'msg' => $msg));
}
iPHP::dialog($msg, 'js:parent.$("#' . $hash . '").remove();');
}
示例14:
<?php
if (iACP::MP('FILE.BROWSE')) {
?>
<li><a href="<?php
echo __ADMINCP__;
?>
=files&do=browse&from=modal&click=file&callback=<?php
echo $callback;
?>
" data-toggle="modal" title="从网站选择"><i class="fa fa-search"></i> 从网站选择</a></li>
<li class="divider"></li>
<?php
}
?>
<?php
if (iACP::MP('FILE.EDIT')) {
?>
<li><a href="<?php
echo __ADMINCP__;
?>
=files&do=editpic&from=modal&callback=<?php
echo $callback;
?>
" data-toggle="modal" title="使用美图秀秀编辑图片" class="modal_photo_<?php
echo $unid;
?>
tip"><i class="fa fa-edit"></i> 编辑</a></li>
<li class="divider"></li>
<?php
if ($indexid) {
?>
示例15: publish
public static function publish($work = null)
{
$_POST = spiderData::crawl();
if (spider::$work == 'shell') {
if (empty($_POST['title'])) {
echo "标题不能为空\n";
return false;
}
if (empty($_POST['body'])) {
echo "内容不能为空\n";
return false;
}
}
$checker = spider::checker($work, spider::$pid, $_POST['reurl'], $_POST['title']);
if ($checker !== true) {
return $checker;
}
$project = spider::project(spider::$pid);
if (!isset($_POST['cid'])) {
$_POST['cid'] = $project['cid'];
}
$postArgs = spider::postArgs($project['poid']);
if ($_GET['indexid']) {
$aid = (int) $_GET['indexid'];
$_POST['aid'] = $aid;
$_POST['adid'] = iDB::value("SELECT `id` FROM `#iCMS@__article_data` WHERE aid='{$aid}'");
}
$title = iS::escapeStr($_POST['title']);
$url = iS::escapeStr($_POST['reurl']);
$hash = md5($url);
if (empty(spider::$sid)) {
$spider_url = iDB::row("SELECT `id`,`publish`,`indexid` FROM `#iCMS@__spider_url` where `url`='{$url}'", ARRAY_A);
if (empty($spider_url)) {
$spider_url_data = array('cid' => $project['cid'], 'rid' => spider::$rid, 'pid' => spider::$pid, 'title' => addslashes($title), 'url' => $url, 'hash' => $hash, 'status' => '1', 'addtime' => time(), 'publish' => '0', 'indexid' => '0', 'pubdate' => '');
$suid = iDB::insert('spider_url', $spider_url_data);
} else {
if ($spider_url['indexid']) {
$_POST['aid'] = $spider_url['indexid'];
$_POST['adid'] = iDB::value("SELECT `id` FROM `#iCMS@__article_data` WHERE aid='" . $spider_url['indexid'] . "'");
}
$suid = $spider_url['id'];
}
} else {
$suid = spider::$sid;
}
if (spider::$callback['post'] && is_callable(spider::$callback['post'])) {
$_POST = call_user_func_array(spider::$callback['post'], array($_POST));
}
iS::slashes($_POST);
$app = iACP::app($postArgs->app);
$fun = $postArgs->fun;
$app->callback['code'] = '1001';
/**
* 主表 回调 更新关联ID
*/
$app->callback['primary'] = array(array('spider', 'update_spider_url_indexid'), array('suid' => $suid));
/**
* 数据表 回调 成功发布
*/
$app->callback['data'] = array(array('spider', 'update_spider_url_publish'), array('suid' => $suid));
$callback = $app->{$fun}();
if ($callback['code'] == $app->callback['code']) {
if (spider::$sid) {
$work === NULL && iPHP::success("发布成功!", 'js:1');
} else {
$work === NULL && iPHP::success("发布成功!", 'js:parent.$("#' . $hash . '").remove();');
}
}
if ($work == "shell" || $work == "WEB@AUTO") {
$callback['work'] = $work;
return $callback;
}
}