Exemple #1
0
 function MP($p = NULL, $T = "Permission_Denied", $url = __REF__)
 {
     if (self::$Rs->groupid == "1") {
         return TRUE;
     }
     if (is_array($p) ? array_intersect($p, self::$power) : in_array($p, self::$power)) {
         return TRUE;
     } else {
         if ($T == 'F') {
             return FALSE;
         } else {
             echo UI::lang($T);
             exit;
         }
     }
 }
Exemple #2
0
    </tr>
    <tr class="nobg">
      <td class="td80">模块说明:</td>
      <td class="rowform"><textarea  rows="6" onkeyup="textareasize(this)" name="desc" id="desc" cols="50" class="tarea"><?php 
echo $rs['desc'];
?>
</textarea></td>
      <td class="tips2" colspan="2">100字以内</td>
    </tr>
    <tr class="nobg">
      <td class="td80">菜单位置:</td>
      <td class="rowform"><?php 
foreach (menu::load() as $H => $value) {
    if ($rs['table'] != $H) {
        $rs['position'] == $H && ($checked = ' checked="checked" ');
        echo '<span id="pos' . $H . '" class="pos"></span><input type="radio" name="position" class="radio" value="' . $H . '"' . $checked . '/> ' . UI::lang('header_' . $H) . '<br /><br />';
    }
}
?>
</td>
      <td class="tips2" colspan="2">选择菜单所在位置</td>
    </tr>
    <thead>
      <tr>
        <th colspan="4">快捷链接</th>
      </tr>
    </thead>
    <tr class="nobg">
      <td class="td80">链接名:</td>
      <td class="rowform"><input name="table" type="text" id="table" value="<?php 
echo $rs['table'];
Exemple #3
0
 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 = "&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']}'";
                 }
             }
         }
     }
     $_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();
 }
Exemple #4
0
                ?>
 </dd>
            <?php 
            }
        } else {
            ?>
            <dd style="float:left; width:20%">
              <input name="power[]" type="checkbox" class="checkbox" value="<?php 
            echo $key;
            ?>
" parent="header_<?php 
            echo $H;
            ?>
"/>
              <?php 
            echo UI::lang($key);
            ?>
 </dd> 
            <?php 
        }
    }
    ?>
          </dl></td>
      </tr>
    </tbody>
    <?php 
}
?>
    <tr>
      <td><input type="submit" class="submit" name="forumlinksubmit" value="提交"  /></td>
    </tr>
Exemple #5
0
 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);
 }
Exemple #6
0
 function li($T, $A)
 {
     if (is_array($A)) {
         $i = 0;
         foreach ($A as $k => $v) {
             if (member::MP($k, 'F')) {
                 $href = strstr($v, 'http://') === false ? __SELF__ . '?mo=' . $v : $v;
                 $onClick = 'main_frame_src(\'' . $href . '\')';
                 if ($i % 2) {
                     echo '<li class="menu_title sub_right" onclick="' . $onClick . '"><b class="border"></b><span><a href="' . $href . '" target="main" hidefocus=true>' . UI::lang($k) . '</a></span></li>';
                 } else {
                     echo '<li class="menu_title sub_left" onclick="' . $onClick . '"><span><a href="' . $href . '" target="main" hidefocus=true>' . UI::lang($k) . '</a></span></li>';
                 }
                 $i++;
             }
         }
     } else {
         if (member::MP($T, 'F')) {
             list($type, $url) = explode(':', $A);
             if ($type == "javascript") {
                 $onClick = $url;
                 $href = 'javascript:' . $onClick;
                 echo '<li class="menu_title" onclick="' . $onClick . '"><span>' . UI::lang($T) . '</span></li>';
             } else {
                 $href = strstr($A, 'http://') === false ? __SELF__ . '?mo=' . $A : $A;
                 $onClick = 'main_frame_src(\'' . $href . '\')';
                 echo '<li class="menu_title" onclick="' . $onClick . '"><span><a href="' . $href . '" target="main" hidefocus=true>' . UI::lang($T) . '</a></span></li>';
             }
         }
     }
 }
Exemple #7
0
<?php

/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.com iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
?>

<div class="sidebarmenu">
  <div class="sidebarmenu-inner">
    <div class="sidebarmenu-list">
      <ul>
<?php 
$mid = (int) $_GET['mid'];
$model = $this->iCMS->getCache('system/models.cache', $mid);
if ($model['show']) {
    $aText = UI::lang('header_' . $model['table']);
    $aUrl = './index.php?mo=content&mid=' . $model['id'] . '&table=' . $model['table'];
    echo '<li><a style="background-image:url(./images/icons/article_write.gif);"  href="' . $aUrl . '&do=add">我要投稿</a></li>';
    echo '<li><a style="background-image:url(./images/icons/default.gif);" href="' . $aUrl . '">我的' . $aText . '</a></li>';
    echo '<li><a style="background-image:url(./images/icons/doing.gif);"  href="./index.php?mo=comment&mid=' . $model['id'] . '">' . $aText . '评论</a></li>';
}
?>
      </ul>
    </div>
  </div>
</div>
Exemple #8
0
}
$siteportalnav .= '<li class="usercenter"><a' . $aClass . ' href="./index.php"><span><strong>用户中心</strong></span></a></li>';
if ($this->module == 'article') {
    $bClass = ' class="current"';
    $navText = '资讯中心';
}
$siteportalnav .= '<li><a' . $bClass . ' href="./index.php?mo=article"><span><strong>资讯中心</strong></span></a></li>';
$table = $_GET['table'];
$menuArray = self::load();
foreach ($menuArray as $key => $menus) {
    $mKey = 'header_' . $key;
    if ($this->module == $key || $table == $key) {
        $cClass = ' class="current"';
        $navText = UI::lang($mKey) . '中心';
    }
    $siteportalnav .= '<li><a' . $cClass . ' href="./index.php?mo=' . $menus['href'] . '"><span><strong>' . UI::lang($mKey) . '中心</strong></span></a></li>';
}
$siteportalnav .= '</ul>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo iCMS_CHARSET;
?>
">
<title><?php 
echo $navText;
?>
 - <?php 
echo $this->iCMS->config['name'];