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


PHP member::CP方法代码示例

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


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

示例1: domanage

 function domanage()
 {
     $mid = $_GET['mid'];
     $model = model::data($mid);
     $table = $model['tbn'];
     $forum = new forum();
     $fid = (int) $_GET['fid'];
     $type = $_GET['type'];
     $sql = " where ";
     switch ($type) {
         //postype: [0:用户][1:管理员] status:[0:草稿][1:正常][2:回收]
         case 'draft':
             //草稿
             $sql .= "`status` ='0' AND `postype`='1'";
             $_ptxt = array(0 => '发布', 1 => '转成草稿');
             $position = UI::lang("menu_article_draft");
             break;
         case 'trash':
             //回收站
             $sql .= "`status` ='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");
             } elseif ($_GET['act'] == "trash") {
                 $sql .= "`status` ='2'";
                 //用户回收站
                 $position = UI::lang("menu_article_user_trash");
             } 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 = " » " . $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']}'";
                 }
             }
         }
     }
     $_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 = member::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 {
         member::$cpower && ($sql .= " AND fid IN(" . implode(',', (array) member::$cpower) . ")");
     }
     $_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@__{$table}` {$sql}") : (int) $_GET['rowNum'];
     page($total, $maxperpage, "条记录");
     $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__{$table}` {$sql} order by {$orderby} LIMIT {$this->firstcount} , {$maxperpage}");
     $_count = count($rs);
     include admincp::tpl();
 }
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:90,代码来源:content.mo.php

示例2: 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 (member::CP($F['fid'])) {
                 $t = $level == '1' ? "" : "├ ";
                 $selected = $currentid == $F['fid'] ? "selected='selected'" : "";
                 $text = str_repeat("│ ", $level - 1) . $t . $F['name'] . "[FID:{$F['fid']}][" . ($F['attr'] ? "★" : "☆") . "]" . ($F['url'] ? "[∞]" : "");
                 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.1,代码行数:33,代码来源:forum.class.php

示例3: doDel

 function doDel()
 {
     $fid = (int) $_GET['fid'];
     member::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');
     javascript::dialog($msg, 'js:parent.$("#fid-' . $fid . '").parent().remove();parent.iCMS.closeDialog();');
 }
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:22,代码来源:forums.mo.php

示例4: doarticle

 function doarticle()
 {
     $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 = member::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 {
         member::$cpower && ($sql .= " AND fid IN(" . implode(',', member::$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.1,代码行数:28,代码来源:dialog.mo.php

示例5:

<form name="cpform" method="post" action="<?php 
echo __ADMINCP__;
?>
=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" style="margin-top:0px;">
    <tbody id="tabs-base">
    <tr>
      <td class="td80">上级版块:</td>
      <td class="rowform"><?php 
if (member::CP($rootid) || empty($rootid)) {
    ?>
        <select name="rootid">
          <option value="0">======顶级版块=====</option>
          <?php 
    echo $forum->select($rootid, 0, 1, 'all', NULL, true);
    ?>
        </select>
        <?php 
} else {
    ?>
        <input name="rootid" id="rootid" type="hidden" value="<?php 
    echo $rootid;
    ?>
" />
        <input readonly="true" value="<?php 
开发者ID:idreamsoft,项目名称:iCMS5.1,代码行数:30,代码来源:forums.add.php


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