當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。