當前位置: 首頁>>代碼示例>>PHP>>正文


PHP iACP::fields方法代碼示例

本文整理匯總了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');
     }
 }
開發者ID:sunhk25,項目名稱:iCMS,代碼行數:9,代碼來源:marker.app.php

示例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');
 }
開發者ID:sunhk25,項目名稱:iCMS,代碼行數:36,代碼來源:spider.app.php

示例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');
             }
//.........這裏部分代碼省略.........
開發者ID:sunhk25,項目名稱:iCMS,代碼行數:101,代碼來源:tags.app.php

示例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');
 }
開發者ID:World3D,項目名稱:iCMS,代碼行數:101,代碼來源:article.app.php

示例5: do_update

 function do_update()
 {
     $data = iACP::fields($_GET['iDT']);
     $data && iDB::update('user', $data, array('uid' => $this->uid));
     iPHP::success('操作成功!', 'js:1');
 }
開發者ID:sunhk25,項目名稱:iCMS,代碼行數:6,代碼來源:user.app.php


注:本文中的iACP::fields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。