本文整理汇总了PHP中iACP::fields方法的典型用法代码示例。如果您正苦于以下问题:PHP iACP::fields方法的具体用法?PHP iACP::fields怎么用?PHP iACP::fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iACP
的用法示例。
在下文中一共展示了iACP::fields方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_update
function do_update()
{
if ($this->id) {
$data = iACP::fields($_GET['iDT']);
$data && iDB::update("marker", $data, array('id' => $this->id));
$this->cache($this->id);
iPHP::success('操作成功!', 'js:1');
}
}
示例2: do_batch
function do_batch()
{
$idArray = (array) $_POST['id'];
$idArray or iPHP::alert("请选择要删除的项目");
$ids = implode(',', $idArray);
$batch = $_POST['batch'];
switch ($batch) {
case 'delurl':
iDB::query("delete from `#iCMS@__spider_url` where `id` IN({$ids});");
break;
case 'delpost':
iDB::query("delete from `#iCMS@__spider_post` where `id` IN({$ids});");
break;
case 'delproject':
iDB::query("delete from `#iCMS@__spider_project` where `id` IN({$ids});");
break;
case 'delrule':
iDB::query("delete from `#iCMS@__spider_rule` where `id` IN({$ids});");
break;
default:
if (strpos($batch, '#') !== false) {
list($table, $_batch) = explode('#', $batch);
if (in_array($table, array('url', 'post', 'project', 'rul'))) {
if (strpos($_batch, ':') !== false) {
$data = iACP::fields($_batch);
foreach ($idArray as $id) {
$data && iDB::update("spider_" . $table, $data, array('id' => $id));
}
iPHP::success('操作成功!', 'js:1');
}
}
}
iPHP::alert('参数错误!', 'js:1');
}
iPHP::success('全部删除成功!', 'js:1');
}
示例3: 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');
}
//.........这里部分代码省略.........
示例4: do_batch
//.........这里部分代码省略.........
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'];
iACP::CP($cid, 'ca', 'alert');
foreach ((array) $_POST['id'] as $id) {
$_cid = articleTable::value('cid', $id);
articleTable::update(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 'scid':
//$_POST['scid'] OR iPHP::alert("请选择目标栏目!");
iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
map::init('category', $this->appid);
$scid = implode(',', (array) $_POST['scid']);
foreach ((array) $_POST['id'] as $id) {
$_scid = articleTable::value('scid', $id);
articleTable::update(compact('scid'), compact('id'));
map::diff($scid, $_scid, $id);
}
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 = articleTable::value('pid', $id);
articleTable::update(compact('pid'), compact('id'));
map::diff($pid, $_pid, $id);
}
iPHP::success('文章属性设置完成!', 'js:1');
break;
case 'weight':
$data = array('weight' => _int($_POST['mweight']));
break;
case 'keyword':
if ($_POST['pattern'] == 'replace') {
$data = array('keywords' => iS::escapeStr($_POST['mkeyword']));
} elseif ($_POST['pattern'] == 'addto') {
foreach ($_POST['id'] as $id) {
$keywords = articleTable::value('keywords', $id);
$keywords = $keywords ? $keywords . ',' . iS::escapeStr($_POST['mkeyword']) : iS::escapeStr($_POST['mkeyword']);
articleTable::update(compact('keywords'), compact('id'));
}
iPHP::success('文章关键字更改完成!', 'js:1');
}
break;
case 'tag':
iPHP::app('tag.class', 'static');
foreach ($_POST['id'] as $id) {
$art = articleTable::row($id, 'tags,cid');
$mtag = iS::escapeStr($_POST['mtag']);
if ($_POST['pattern'] == 'replace') {
} elseif ($_POST['pattern'] == 'addto') {
$art['tags'] && ($mtag = $art['tags'] . ',' . $mtag);
}
$tags = tag::diff($mtag, $art['tags'], iMember::$userid, $id, $art['cid']);
$tags = addslashes($tags);
articleTable::update(compact('tags'), compact('id'));
}
iPHP::success('文章标签更改完成!', 'js:1');
break;
case 'thumb':
foreach ((array) $_POST['id'] as $id) {
$body = articleTable::body($id);
$picurl = $this->remotepic($body, 'autopic', $id);
$this->pic($picurl, $id);
}
iPHP::success('成功提取缩略图!', 'js:1');
break;
case 'dels':
iPHP::$break = false;
ob_implicit_flush();
$_count = count($_POST['id']);
foreach ((array) $_POST['id'] as $i => $id) {
$msg = $this->delArticle($id);
$msg .= $this->del_msg('文章删除完成!');
$updateMsg = $i ? true : false;
$timeout = $i++ == $_count ? '3' : false;
iPHP::dialog($msg, 'js:parent.$("#id' . $id . '").remove();', $timeout, 0, $updateMsg);
ob_end_flush();
}
iPHP::$break = true;
iPHP::success('文章全部删除完成!', 'js:1', 3, 0, true);
break;
default:
$data = iACP::fields($batch);
}
$data && articleTable::batch($data, $ids);
iPHP::success('操作成功!', 'js:1');
}
示例5: do_update
function do_update()
{
$data = iACP::fields($_GET['iDT']);
$data && iDB::update('user', $data, array('uid' => $this->uid));
iPHP::success('操作成功!', 'js:1');
}