当前位置: 首页>>代码示例>>PHP>>正文


PHP Admin::CP方法代码示例

本文整理汇总了PHP中Admin::CP方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::CP方法的具体用法?PHP Admin::CP怎么用?PHP Admin::CP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Admin的用法示例。


在下文中一共展示了Admin::CP方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: select

 function select($currentid = "0", $fid = "0", $level = 1, $attr = NULL, $mid = NULL, $url = NULL)
 {
     foreach ((array) $this->_array[$fid] as $root => $F) {
         if ($F['modelid'] == $mid || $mid === NULL) {
             if (Admin::CP($F['fid'])) {
                 $t = $level == '1' ? "" : "├ ";
                 $selected = $currentid == $F['fid'] ? "selected='selected'" : "";
                 $text = str_repeat("│ ", $level - 1) . $t . $F['name'] . "[FID:{$F['fid']}]";
                 if (empty($F['url'])) {
                     if ($attr === NULL) {
                         if ($F['attr']) {
                             $option .= "<option value='{$F['fid']}' {$selected}>{$text}</option>";
                         } else {
                             $option .= "<optgroup label=\"{$text}\"></optgroup>";
                         }
                     } elseif ($attr == 'all') {
                         $option .= "<option value='{$F['fid']}' {$selected}>{$text}</option>";
                     } else {
                         $attr == $F['attr'] && ($option .= "<option value='{$F['fid']}' {$selected}>{$text}</option>");
                     }
                 } else {
                     if ($url) {
                         $option .= "<option value='{$F['fid']}' {$selected}>{$text}</option>";
                     } else {
                         $option .= "<optgroup label=\"{$text}\"></optgroup>";
                     }
                 }
             }
             $option .= $this->select($currentid, $F['fid'], $level + 1, $attr, $mid);
         }
     }
     return $option;
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:33,代码来源:forum.class.php

示例2:

=forums" id="cpform" target="iCMS_FRAME">
  <input name="do" type="hidden" id="do" value="save" />
  <input name="fid" type="hidden" value="<?php 
echo $rs['fid'];
?>
" />
  <table class="adminlist" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
        <th colspan="3">基本设置</th>
      </tr>
    </thead>
    <tr>
      <td class="td80">上级版块:</td>
      <td class="vtop rowform"><?php 
if (Admin::CP($rootid) || empty($rootid)) {
    ?>
        <select name="rootid">
          <option value="0">======顶级版块=====</option>
          <?php 
    echo $forum->select($rootid, 0, 1, NULL, NULL, true);
    ?>
        </select>
        <?php 
} else {
    ?>
        <input name="rootid" id="rootid" type="hidden" value="<?php 
    echo $rootid;
    ?>
" />
        <input readonly="true" value="<?php 
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:31,代码来源:forums.add.php

示例3: dolist

 function dolist()
 {
     $id = (int) $_GET['id'];
     $fid = (int) $_GET['fid'];
     $tagName = iCMS_DB::getValue("SELECT name FROM #iCMS@__tags WHERE id='{$id}'");
     $forum = new forum();
     $sql = '#iCMS@__article.id = `indexId`';
     $_GET['keywords'] && ($sql .= " AND `title` REGEXP '{$_GET['keywords']}'");
     isset($_GET['nopic']) && ($sql .= " AND `isPic` ='0'");
     $_GET['starttime'] && ($sql .= " and `pubdate`>='" . strtotime($_GET['starttime']) . "'");
     $_GET['endtime'] && ($sql .= " and `pubdate`<='" . strtotime($_GET['endtime']) . "'");
     isset($_GET['at']) && $_GET['at'] != '-1' && ($sql .= " AND `type` ='" . $_GET['at'] . "'");
     isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
     $fid = Admin::CP($fid) ? $fid : "0";
     if ($fid) {
         $cidIN = $forum->fid($fid) . $fid;
         if (isset($_GET['sub']) && strstr($cidIN, ',')) {
             $sql .= " AND fid IN(" . $cidIN . ")";
         } else {
             $sql .= " AND fid ='{$fid}'";
         }
     } else {
         Admin::$cpower && ($sql .= " AND fid IN(" . implode(',', (array) Admin::$cpower) . ")");
     }
     $maxperpage = (int) $_GET['perpage'] > 0 ? $_GET['perpage'] : 20;
     $total = $page == 1 || empty($_GET['rowNum']) ? iCMS_DB::getValue("SELECT count(#iCMS@__article.id) FROM `#iCMS@__article`,`#iCMS@__taglist` WHERE `tid`='" . $id . "' AND {$sql}") : (int) $_GET['rowNum'];
     page($total, $maxperpage, "篇文章");
     $rs = iCMS_DB::getArray("SELECT #iCMS@__article.* FROM `#iCMS@__article`,`#iCMS@__taglist` WHERE `tid`='" . $id . "' AND {$sql} ORDER BY #iCMS@__taglist.indexId DESC LIMIT {$this->firstcount} , {$maxperpage}");
     $_count = count($rs);
     include admincp::tpl('tag.list');
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:31,代码来源:tag.mo.php

示例4: doManage

 function doManage()
 {
     $mtime = microtime();
     $mtime = explode(' ', $mtime);
     $time_start = $mtime[1] + $mtime[0];
     Admin::MP(array("menu_article_manage", "menu_article_draft", "menu_article_user_manage", "menu_article_user_draft"));
     $forum = new forum();
     $fid = (int) $_GET['fid'];
     $type = $_GET['type'];
     $sql = " where ";
     switch ($type) {
         //postype: [0:用户][1:管理员][2:回收] status:[0:隐藏][1:正常]
         case 'draft':
             //草稿
             $sql .= "`status` ='0' AND `postype`='1'";
             $_ptxt = array(0 => '发布', 1 => '转成草稿');
             $position = UI::lang("menu_article_draft");
             break;
         case 'trash':
             //回收站
             $sql .= "`status` ='0' AND `postype`='2'";
             $_ptxt = array(0 => '还原', 1 => '放入回收站');
             $position = UI::lang("menu_article_trash");
             break;
         case 'user':
             //用户
             if ($_GET['act'] == "draft") {
                 $sql .= "`status` ='0'";
                 //用户审核
                 $position = UI::lang("menu_article_user_draft");
             } else {
                 $sql .= "`status` ='1'";
                 $position = UI::lang("menu_article_user_manage");
             }
             $sql .= " AND `postype`='0'";
             $_ptxt = array(0 => '通过审核', 1 => '取消审核');
             break;
         default:
             $sql .= " `status` ='1' AND `postype`='1'";
             $position = '';
             $fid && ($position = $forum->forum[$fid]['name']);
     }
     $position && ($position = "&nbsp;&raquo;&nbsp;" . $position);
     if ($_GET['keywords']) {
         if ($_GET['st'] == "title") {
             $sql .= " AND `title` REGEXP '{$_GET['keywords']}'";
         } else {
             if ($_GET['st'] == "top") {
                 $sql .= " AND `top`='{$_GET['keywords']}'";
             } else {
                 if ($_GET['st'] == "id") {
                     $sql .= " AND `id` REGEXP '{$_GET['keywords']}'";
                 } else {
                     if ($_GET['st'] == "tkd") {
                         $sql .= " AND CONCAT(title,keywords,description) REGEXP '{$_GET['keywords']}'";
                     }
                 }
             }
         }
     }
     $_GET['title'] && ($sql .= " AND `title` like '%{$_GET['title']}%'");
     $_GET['tag'] && ($sql .= " AND `tags` REGEXP '[[:<:]]" . preg_quote(rawurldecode($_GET['tag']), '/') . "[[:>:]]'");
     isset($_GET['at']) && $_GET['at'] != '-1' && ($sql .= " AND `type` ='" . $_GET['at'] . "'");
     isset($_GET['userid']) && ($sql .= " AND `userid`='" . (int) $_GET['userid'] . "'");
     $fid = Admin::CP($fid) ? $fid : "0";
     if ($fid) {
         $fidIN = $forum->fid($fid) . $fid;
         if (isset($_GET['sub']) && strstr($fidIN, ',')) {
             $sql .= " AND fid IN(" . $fidIN . ")";
         } else {
             $sql .= " AND fid ='{$fid}'";
         }
         //$sql.=" OR `vlink` REGEXP '[[:<:]]".preg_quote($fid, '/')."[[:>:]]')";
     } else {
         Admin::$cpower && ($sql .= " AND fid IN(" . implode(',', (array) Admin::$cpower) . ")");
     }
     isset($_GET['nopic']) && ($sql .= " AND `isPic` ='0'");
     $_GET['starttime'] && ($sql .= " and `pubdate`>='" . strtotime($_GET['starttime']) . "'");
     $_GET['endtime'] && ($sql .= " and `pubdate`<='" . strtotime($_GET['endtime']) . "'");
     $act == 'user' && ($uri .= '&act=user');
     $_GET['type'] == 'draft' && ($uri .= '&type=draft');
     isset($_GET['userid']) && ($uri .= '&userid=' . (int) $_GET['userid']);
     isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
     isset($_GET['tag']) && ($uri .= '&tag=' . $_GET['tag']);
     $orderby = $_GET['orderby'] ? $_GET['orderby'] : "id DESC";
     $maxperpage = (int) $_GET['perpage'] > 0 ? $_GET['perpage'] : 20;
     $total = $page == 1 || empty($_GET['rowNum']) ? iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__article` {$sql}") : (int) $_GET['rowNum'];
     page($total, $maxperpage, "篇文章");
     $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__article` {$sql} order by {$orderby} LIMIT {$this->firstcount} , {$maxperpage}");
     //echo iCMS_DB::$last_query;
     //iCMS_DB::last_query='explain '.iCMS_DB::$last_query;
     //$explain=iCMS_DB::getRow(iCMS_DB::last_query);
     //var_dump($explain);
     $_count = count($rs);
     include admincp::tpl("article.manage");
     //		$mtime = microtime();
     //		$mtime = explode(' ', $mtime);
     //		$time_end = $mtime[1] + $mtime[0];
     //		echo  "<h1>".($time_end - $time_start);
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:100,代码来源:article.mo.php

示例5: doarticle

 function doarticle()
 {
     include iPATH . 'include/forum.class.php';
     $forum = new forum();
     $callback = $_GET['callback'];
     $fid = (int) $_GET['fid'];
     $sql = " where ";
     $sql .= $_GET['type'] == 'draft' ? "`status` ='0'" : "`status` ='1'";
     $sql .= $act == 'user' ? " AND `postype`='0'" : " AND `postype`='1'";
     $_GET['keywords'] && ($sql .= " AND CONCAT(title,keywords,description) REGEXP '{$_GET['keywords']}'");
     $fid = Admin::CP($fid) ? $fid : "0";
     if ($fid) {
         if (isset($_GET['sub'])) {
             $sql .= " AND ( fid IN(" . $forum->fid($fid) . $fid . ")";
         } else {
             $sql .= " AND ( fid ='{$fid}'";
         }
         $sql .= " OR `vlink` REGEXP '[[:<:]]" . preg_quote($fid, '/') . "[[:>:]]')";
     } else {
         Admin::$cpower && ($sql .= " AND fid IN(" . implode(',', Admin::$cpower) . ")");
     }
     isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
     $maxperpage = 8;
     $total = $page == 1 || empty($_GET['rowNum']) ? iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__article` {$sql}") : (int) $_GET['rowNum'];
     page($total, $maxperpage, "篇文章");
     $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__article`{$sql} order by id DESC LIMIT {$this->firstcount} , {$maxperpage}");
     $_count = count($rs);
     include admincp::tpl();
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:29,代码来源:dialog.mo.php

示例6: doDel

 function doDel()
 {
     $fid = (int) $_GET['fid'];
     Admin::CP($fid, 'Permission_Denied', __SELF__ . '?mo=forums');
     $forum = new forum();
     $msg = '请选择要删除的栏目!';
     if (empty($forum->_array[$id])) {
         iCMS_DB::query("DELETE FROM `#iCMS@__forum` WHERE `fid` = '{$fid}'");
         $this->iCMS->iCache->delete('system/forum/' . $fid);
         $art = iCMS_DB::getArray("SELECT id FROM `#iCMS@__article` WHERE `fid` = '{$fid}'");
         foreach ((array) $art as $a) {
             delArticle($a['fid']);
         }
         $forum = new forum();
         $forum->cache();
         $msg = '删除成功!';
     } else {
         $msg = '请先删除本栏目下的子栏目!';
     }
     javascript::dialog($msg, 'url:' . __SELF__ . '?mo=forums');
 }
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:21,代码来源:forums.mo.php


注:本文中的Admin::CP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。