Beispiel #1
0
<?php

/**
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'post':
        if ($action == 'edit') {
            $sources = explode("\r\n", dhtmlspecialchars($_POST['source']));
            $authors = explode("\r\n", dhtmlspecialchars($_POST['author']));
            $editors = explode("\r\n", dhtmlspecialchars($_POST['author']));
            writefile(iPATH . 'include/default.value.php', "<?php\n\$sources=" . da_var_export($sources) . ";\n\$authors=" . da_var_export($authors) . ";\n\$editors=" . da_var_export($editors) . ";\n?>");
            _Header(__SELF__ . '?do=default');
        }
        break;
    default:
        $Admin->MP("menu_article_default");
        include_once iPATH . 'include/default.value.php';
        include iCMS_admincp_tpl('default');
}
        _Header();
        break;
    case 'post':
        if ($action == 'edit') {
            if (isset($_POST['delete'])) {
                foreach ($_POST['delete'] as $k => $id) {
                    $id && $iCMS->db->query("DELETE FROM `#iCMS@__contentype` WHERE `id` ='{$id}'");
                }
                _Header();
            }
            foreach ($_POST['name'] as $id => $value) {
                $iCMS->db->query("update `#iCMS@__contentype` set `name`='{$value}',`type`='" . $_POST['type'][$id] . "',`val`='" . $_POST['val'][$id] . "' where `id`='{$id}'");
            }
            _Header();
        }
        if ($action == 'add') {
            $name = dhtmlspecialchars($_POST['name']);
            $type = dhtmlspecialchars($_POST['type']);
            $val = intval($_POST['val']);
            $iCMS->db->query("INSERT INTO `#iCMS@__contentype` (`name`,`val`,`type`) VALUES ('{$name}','{$val}','{$type}')");
            _Header(__SELF__ . '?do=contentype');
        }
        break;
    default:
        $Admin->MP("menu_contentype");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__contentype` order by id DESC");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__contentype` order by id DESC ");
        $_count = count($rs);
        include iCMS_admincp_tpl('contentype');
}
Beispiel #3
0
        break;
    case 'status':
        $id = intval($_GET['id']);
        $act = intval($_GET['act']);
        $iCMS->db->query("UPDATE `#iCMS@__advertise` SET `status` = '{$act}' WHERE `id` ='{$id}'");
        CreateAdvJs($id);
        _Header(__SELF__ . '?do=advertise');
        break;
    default:
        $Admin->MP(array("menu_index_advertise", "menu_advertise"));
        $maxperpage = 30;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__advertise` order by id DESC");
        page($total, $maxperpage, "个广告");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__advertise` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl("advertise");
}
function getadvhtml($style, $c)
{
    switch ($style) {
        case 'code':
            $html = $c['code']['html'];
            break;
        case "image":
            $c['image']['width'] && ($width = " width=\"{$c['image']['width']}\"");
            $c['image']['height'] && ($height = " height=\"{$c['image']['height']}\"");
            $html = "<a href=\"{$c['image']['link']}\" target=\"_blank\" title=\"{$c['image']['alt']}\"><img src=\"{$c['image']['url']}\" alt=\"{$c['image']['alt']}\"{$width}{$height} alt=\"{$c['image']['alt']}\" border=\"0\"></a>";
            break;
        case "flash":
            $c['flash']['width'] && ($width = " width=\"{$c['flash']['width']}\"");
            $c['flash']['height'] && ($height = " height=\"{$c['flash']['height']}\"");
Beispiel #4
0
        $id = (int) $_GET['id'];
        $Admin->CP($id, 'Permission_Denied', __SELF__ . '?do=catalog');
        $catalog = new catalog();
        if ($id) {
            if (empty($catalog->array[$id])) {
                $iCMS->db->query("DELETE FROM `#iCMS@__catalog` WHERE `id` = '{$id}'");
                $art = $iCMS->db->getArray("SELECT id FROM `#iCMS@__article` WHERE `cid` = '{$id}'");
                if ($art) {
                    foreach ($art as $a) {
                        delArticle($a['id']);
                    }
                }
                $catalog = new catalog();
                $catalog->cache();
                alert("删除成功!", 'url:' . __SELF__ . '?do=catalog');
            } else {
                alert("请先删除本栏目下的子栏目", 'url:' . __SELF__ . '?do=catalog');
            }
        }
        break;
    case 'move':
        alert("暂无此功能!", 'url:' . __SELF__ . '?do=catalog');
        break;
    default:
        $Admin->MP("menu_catalog_manage");
        $catalog = new catalog();
        $operation && set_cookie('selectopt', $operation);
        $operation = get_cookie('selectopt');
        empty($operation) && ($operation = 'fold');
        include iCMS_admincp_tpl("catalog.manage");
}
Beispiel #5
0
     break;
 case 'catalog':
     $Admin->MP(array("menu_html_all", "menu_html_catalog"));
     include iCMS_admincp_tpl("html.catalog");
     break;
 case 'article':
     $Admin->MP(array("menu_html_all", "menu_html_article"));
     include iCMS_admincp_tpl("html.article");
     break;
 case 'tag':
     $Admin->MP(array("menu_html_all", "menu_html_tag"));
     include iCMS_admincp_tpl("html.tag");
     break;
 case 'page':
     $Admin->MP(array("menu_html_all", "menu_html_page"));
     include iCMS_admincp_tpl("html.page");
     break;
 case 'create':
     set_time_limit(0);
     $action = $_GET['action'];
     $cTime = $_GET['time'] ? $_GET['time'] : 1;
     isset($_GET['all']) && ($QUERY_STRING = '&all');
     require_once iPATH . "include/function/template.php";
     if ($action == 'all') {
         redirect("全站更新,开始生成文章.....", __SELF__ . '?do=html&operation=create&action=article&cid=all&all');
     }
     if ($action == 'index') {
         if (isset($_GET['all'])) {
             $_GET['indexTPL'] = $iCMS->config['indexTPL'];
             $_GET['indexname'] = $iCMS->config['indexname'];
         }
Beispiel #6
0
                $sql = "CREATE TABLE `" . DB_PREFIX . $table . "_content` (\r\n                 `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n                 `cid` INT(10) UNSIGNED NOT NULL DEFAULT '0',\r\n                 `order` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0',\r\n                 `title` VARCHAR(255) NOT NULL DEFAULT '',\r\n                 `customlink` VARCHAR(255) NOT NULL DEFAULT '',\r\n                 `editor` VARCHAR(200) NOT NULL DEFAULT '',\r\n                 `userid` INT(10) UNSIGNED NOT NULL DEFAULT '0',   \r\n                 `tags` VARCHAR(255) NOT NULL DEFAULT '',\r\n                 `pubdate` INT(10) UNSIGNED NOT NULL DEFAULT '0',\r\n                 `hits` INT(10) UNSIGNED NOT NULL DEFAULT '0',\r\n                 `digg` INT(10) UNSIGNED NOT NULL DEFAULT '0',\r\n                 `comments` INT(10) UNSIGNED NOT NULL DEFAULT '0',\r\n                 `type` VARCHAR(255) NOT NULL DEFAULT '',\r\n                 `vlink` VARCHAR(255) NOT NULL DEFAULT '',\r\n                 `top` SMALLINT(6) NOT NULL DEFAULT '0',\r\n                 `visible` ENUM('0','1') NOT NULL DEFAULT '1',\r\n                 `postype` TINYINT(1) NOT NULL DEFAULT '0',\r\n                 PRIMARY KEY (`id`),\r\n\t\t\t\t KEY `cid` (`visible`,`cid`),\r\n\t\t\t\t KEY `hits` (`visible`,`hits`),\r\n\t\t\t\t KEY `digg` (`visible`,`digg`),\r\n\t\t\t\t KEY `comments` (`visible`,`comments`),\r\n\t\t\t\t KEY `id` (`visible`,`id`),\r\n\t\t\t\t KEY `pubdate` (`visible`,`pubdate`),\r\n\t\t\t\t KEY `customlink` (`visible`,`customlink`)\r\n               ) ENGINE=MYISAM DEFAULT CHARSET=" . DB_CHARSET;
                $iCMS->db->query($sql);
                model_cache();
                redirect("新增模型完成!", __SELF__ . "?do=model&operation=manage", '3');
            } else {
                $oTable = $iCMS->db->getValue("SELECT `table` FROM `#iCMS@__model` where `id` ='{$id}'");
                if ($oTable != $table) {
                    $iCMS->db->query("RENAME TABLE `" . DB_PREFIX . $oTable . "_content` TO `" . DB_PREFIX . $table . "_content`");
                }
                $iCMS->db->update('model', compact('name', 'table', 'desc', 'listpage', 'showpage'), array('id' => $id));
                model_cache();
                redirect("模型编辑完成!", __SELF__ . "?do=model&operation=manage", '3');
            }
        }
        if ($action == 'order') {
            $id = (int) $_POST['id'];
            $field = implode(',', $_POST['order']);
            $iCMS->db->update('model', compact('field'), compact('id'));
            model_cache();
            redirect("字段排序完成!", __SELF__ . "?do=model&operation=field&mid=" . $id, '3');
        }
        break;
    default:
        $Admin->MP("menu_model_manage");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__model` order by id DESC");
        page($total, $maxperpage, "个模型");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__model` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl("model.manage");
}
Beispiel #7
0
     //	isset($_GET['nopic'])&&$sql.=" AND `pic` =''";
     $_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 = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__{$__TABLE__}` {$sql} order by {$orderby}");
     page($total, $maxperpage, "条记录");
     $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__{$__TABLE__}`{$sql} order by {$orderby} LIMIT {$firstcount} , {$maxperpage}");
     $_count = count($rs);
     //echo $iCMS->db->func_call;
     include iCMS_admincp_tpl("content.manage");
     break;
 case 'visible':
     $v = (int) $_GET['v'];
     if ($v == '1') {
         $iCMS->db->query("UPDATE `#iCMS@__{$__TABLE__}` SET `visible` = '0' WHERE `id` ='{$id}'");
     } else {
         $iCMS->db->query("UPDATE `#iCMS@__{$__TABLE__}` SET `visible` = '1' WHERE `id` ='{$id}'");
     }
     _Header();
     break;
 case 'delvlink':
     $cid = (int) $_GET['cid'];
     $id && ($vlink = $iCMS->db->getValue("SELECT vlink FROM `#iCMS@__{$__TABLE__}` WHERE `id`='{$id}'"));
     $vlinkArray = explode(',', $vlink);
     $key = array_search($cid, $vlinkArray);
Beispiel #8
0
<?php

/**
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
include iPATH . 'admin/table.array.php';
//数据统计
$content_datasize = 0;
$tables = $iCMS->db->getArray("SHOW TABLE STATUS");
$_count = count($tables);
for ($i = 0; $i < $_count; $i++) {
    if (in_array($tables[$i]['Name'], $tabledb)) {
        $datasize += $tables[$i]['Data_length'];
        $indexsize += $tables[$i]['Index_length'];
        if (in_array($tables[$i]['Name'], array(DB_PREFIX . "article", DB_PREFIX . "catalog", DB_PREFIX . "comment", DB_PREFIX . "articledata"))) {
            $content_datasize += $tables[$i]['Data_length'] + $tables[$i]['Index_length'];
        }
    }
}
$c = $iCMS->db->getValue("SELECT count(*) FROM #iCMS@__catalog");
$a = $iCMS->db->getValue("SELECT count(*) FROM #iCMS@__article");
include iCMS_admincp_tpl("home");
function okorno($o)
{
    return $o ? '<font color=green>支持</font>' : '<font color=red>不支持</font>';
}
Beispiel #9
0
     include iPATH . 'include/group.class.php';
     $group = new group();
     $type = $_GET['type'];
     include iCMS_admincp_tpl('group.manage');
     break;
 case 'power':
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__group` WHERE `gid`='" . intval($_GET['groupid']) . "'");
     include iCMS_admincp_tpl('group.power');
     break;
 case 'cpower':
     include_once iPATH . 'include/catalog.class.php';
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__group` WHERE `gid`='" . intval($_GET['groupid']) . "'");
     iCMS_admincp_head();
     $catalog = new catalog();
     $catalog->allArray();
     include iCMS_admincp_tpl('group.cpower');
     break;
 case 'del':
     $gid = (int) $_GET['groupid'];
     $gid && $iCMS->db->query("DELETE FROM `#iCMS@__group` WHERE `gid`='{$gid}'");
     alert('已删除!', "url:" . __SELF__ . "?do=group&operation=manage");
     break;
 case 'post':
     if ($action == 'power') {
         $gid = (int) $_POST['gid'];
         $power = @implode(",", $_POST['power']);
         $iCMS->db->query("UPDATE `#iCMS@__group` SET `power` = '{$power}' WHERE `gid` ='{$gid}' LIMIT 1");
         redirect("设置完成!", __SELF__ . '?do=group&operation=manage');
     } elseif ($action == 'cpower') {
         $gid = (int) $_POST['gid'];
         $power = @implode(",", $_POST['cpower']);
Beispiel #10
0
                $sql .= " AND ( cid ='{$cid}'";
            }
            $sql .= " OR `vlink` REGEXP '[[:<:]]" . preg_quote($cid, '/') . "[[:>:]]')";
        } else {
            $Admin->cpower && ($sql .= " AND cid IN(" . implode(',', $Admin->cpower) . ")");
        }
        isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']);
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__article` {$sql} order by id DESC");
        page($total, $maxperpage, "篇文章");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__article`{$sql} order by id DESC LIMIT {$firstcount} , {$maxperpage}");
        $_count = count($rs);
        //	echo $iCMS->db->func_call;
        include iCMS_admincp_tpl('dialog.article');
        break;
    case 'showpic':
        include iCMS_admincp_tpl('dialog.showpic');
        break;
    case 'cutpic':
        $pFile = $_GET['pic'];
        $iFile = getfilepath($pFile, iPATH, '+');
        $in = $_GET['in'];
        list($width, $height, $imagetype) = @getimagesize($iFile);
        $pw = $width > 500 ? 500 : $width;
        $tw = (int) $iCMS->config['thumbwidth'];
        $th = (int) $iCMS->config['thumbhight'];
        $rate = round($pw / $width, 2) * 100;
        $sliderMin = round($tw / $width, 2) * 100;
        include iCMS_admincp_tpl('dialog.cutpic');
        break;
}
Beispiel #11
0
                keywords_cache();
                _Header();
            }
            foreach ($_POST['name'] as $id => $value) {
                $iCMS->db->query("update `#iCMS@__keywords` set `keyword`='{$value}',`replace`='" . $_POST['replace'][$id] . "' where `id`='{$id}'");
            }
            keywords_cache();
            _Header();
        }
        if ($action == 'save') {
            $id = (int) $_POST['id'];
            $keyword = dhtmlspecialchars($_POST['keyword']);
            $replace = $_POST['replace'];
            if (empty($id)) {
                $iCMS->db->query("insert into `#iCMS@__keywords`(`keyword`,`replace`,`addtime`,`visible`) values ('{$keyword}','{$replace}','" . time() . "','0')");
            } else {
                $iCMS->db->query("update `#iCMS@__keywords` set `keyword`='{$keyword}',`replace`='{$replace}' where id='{$id}'");
            }
            keywords_cache();
            _Header(__SELF__ . '?do=keywords');
        }
        break;
    default:
        $Admin->MP("menu_keywords");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__keywords` order by id DESC");
        page($total, $maxperpage, "个关键字");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__keywords` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl('keywords');
}
Beispiel #12
0
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'manage':
        $Admin->MP("menu_user_manage");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__members` order by uid DESC");
        page($total, $maxperpage, "位会员");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__members` order by uid DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl('user.manage');
        break;
    case 'edit':
        $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__members` WHERE `uid`='" . (int) $_GET['userid'] . "'");
        $rs->info = unserialize($rs->info);
        include iCMS_admincp_tpl('user.add');
        break;
    case 'del':
        $uid = (int) $_GET['userid'];
        $uid && $iCMS->db->query("DELETE FROM `#iCMS@__members` WHERE `uid`='{$uid}'");
        alert('已删除!', "url:" . __SELF__ . "?do=user");
        break;
    case 'post':
        if ($action == 'edit') {
            $uid = (int) $_POST['uid'];
            $info = array();
            if ($_POST['pwd'] || $_POST['pwd1'] || $_POST['pwd2']) {
                $pwd = md5(trim($_POST['pwd']));
                $pwd1 = md5(trim($_POST['pwd1']));
                $pwd2 = md5(trim($_POST['pwd2']));
                if (!$_POST['pwd'] || !$_POST['pwd1'] || !$_POST['pwd2']) {
Beispiel #13
0
            $htaccess .= "RewriteBase {$iCMS->dir}\n";
            $htaccess .= "# 首页\n";
            $htaccess .= "RewriteRule ^index" . preg_quote($_POST['rewrite']['ext'], '/') . "\$ index.php\n";
            $htaccess .= "# 独立页面、栏目、文章、评论、搜索、留言、标签\n";
            if ($_POST['customlink'] == '2' && empty($_POST['rewrite']['dir'])) {
                if ($_POST['linkmode'] == 'id') {
                    $htaccess .= "RewriteRule ^(list|show){$preg_quote_split}(.*)\$ \$1.php?id{$preg_quote_split}\$2\n";
                } elseif ($_POST['linkmode'] == 'title') {
                    $htaccess .= "RewriteRule ^(list|show){$preg_quote_split}(.*)\$ \$1.php?t{$preg_quote_split}\$2\n";
                }
                $htaccess .= "RewriteRule ^index{$preg_quote_split}page{$preg_quote_split}(.*)" . preg_quote($_POST['rewrite']['ext'], '/') . "\$ index.php?page{$preg_quote_split}\$1" . preg_quote($_POST['rewrite']['ext'], '/') . "\n";
                $htaccess .= "RewriteRule ^index{$preg_quote_split}(.*)" . preg_quote($_POST['rewrite']['ext'], '/') . "\$ index.php?p{$preg_quote_split}\$1" . preg_quote($_POST['rewrite']['ext'], '/') . "\n";
                $htaccess .= "RewriteRule ^comment{$preg_quote_split}(.*)\$ comment.php?aid{$preg_quote_split}\$1\n";
                $htaccess .= "RewriteRule ^tag{$preg_quote_split}(.*)\$ tag.php?t{$preg_quote_split}\$1\n";
                $htaccess .= "RewriteRule ^search{$preg_quote_split}(.*)\$ search.php?keyword{$preg_quote_split}\$1\n";
            } else {
                $htaccess .= "RewriteRule ^(index|list|show|comment|search|message|tag)" . preg_quote($_POST['rewrite']['dir'], '/') . "(.*)\$ \$1.php?\$2\n";
            }
            writefile(iPATH . '.htaccess', $htaccess);
        }
        if ($_POST['ishtm'] == "1") {
            delfile(iPATH . '.htaccess');
            //			delfile(iPATH.$config['indexname'].'.html');
        }
        $iCMS->clear_compiled_tpl();
        redirect('配置已更新', __REF__);
    }
    exit;
}
include iCMS_admincp_tpl("setting");
Beispiel #14
0
     include iPATH . 'include/group.class.php';
     $group = new group('a');
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__admin` WHERE `uid`='" . intval($_GET['uid']) . "'");
     $info = unserialize($rs->info);
     include iCMS_admincp_tpl("account.edit");
     break;
 case 'power':
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__admin` WHERE `uid`='" . intval($_GET['uid']) . "'");
     include iCMS_admincp_tpl("account.power");
     break;
 case 'cpower':
     include_once iPATH . 'include/catalog.class.php';
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__admin` WHERE `uid`='" . intval($_GET['uid']) . "'");
     $catalog = new catalog();
     $catalog->allArray();
     include iCMS_admincp_tpl("account.cpower");
     break;
 case 'del':
     $uid = (int) $_GET['uid'];
     $uid == "1" && alert('系统管理员不允许删除!', "url:{__SELF__}?do=account&operation=manage");
     $uid && $iCMS->db->query("DELETE FROM `#iCMS@__admin` WHERE `uid`='{$uid}'");
     alert('已删除!', "url:{__SELF__}?do=account&operation=manage");
     break;
 case 'post':
     $uid = (int) $_POST['uid'];
     if ($action == 'power') {
         $power = @implode(",", $_POST['power']);
         $iCMS->db->query("UPDATE `#iCMS@__admin` SET `power` = '{$power}' WHERE `uid` ='{$uid}' LIMIT 1");
         redirect("设置完成!", __SELF__ . '?do=account&operation=power&uid=' . $uid);
     } elseif ($action == 'cpower') {
         $power = @implode(",", $_POST['cpower']);
Beispiel #15
0
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'del':
        $id = intval($_GET['id']);
        $id && $iCMS->db->query("DELETE FROM `#iCMS@__message` WHERE `id` ='{$id}'");
        _Header(__SELF__ . '?do=message');
        break;
    case 'post':
        if (isset($_POST['delete'])) {
            foreach ($_POST['delete'] as $k => $id) {
                $id && $iCMS->db->query("DELETE FROM `#iCMS@__message` WHERE `id` ='{$id}'");
            }
            _Header(__SELF__ . '?do=message');
        } else {
            alert("请选择要删除的留言!");
        }
        break;
    default:
        $Admin->MP("menu_message");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__message` order by id DESC");
        page($total, $maxperpage, "条留言");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__message` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl('message');
}
Beispiel #16
0
     include iCMS_admincp_tpl("file.reupload");
     break;
 case 'swfupload':
     $F = uploadfile("Filedata");
     echo '<div><ul><li>文件:' . $F["OriginalFileName"] . '上传成功!</li><li>路径:' . $F["FilePath"] . '</ul></div>';
     break;
 case 'upload':
     $Admin->MP("menu_file_upload");
     include iCMS_admincp_tpl("file.upload");
     break;
 case 'extract':
     $Admin->MP("menu_extract_pic");
     include iPATH . 'include/catalog.class.php';
     if (empty($_GET['o'])) {
         $catalog = new catalog();
         include iCMS_admincp_tpl("file.extract.pic");
     } else {
         set_time_limit(0);
         $action = $_GET['action'];
         $QUERY_STRING = "&o=1&action=" . $action;
         $speed = 100;
         //提取速度
         $cids = $_GET['cid'];
         $startid = (int) $_GET['startid'];
         $endid = (int) $_GET['endid'];
         $starttime = $_GET['starttime'];
         $endtime = $_GET['endtime'];
         $totle = isset($_GET['totle']) ? $_GET['totle'] : 0;
         $loop = isset($_GET['loop']) ? $_GET['loop'] : 1;
         $i = isset($_GET['i']) ? $_GET['i'] : 0;
         empty($action) && alert("请选择操作");
Beispiel #17
0
                        $fArray = explode(',', $mArray[$i]['field']);
                        if (in_array($oField['field'], $fArray)) {
                            $table = $mArray[$i]['table'] . '_content';
                            $sql = "alter table `#iCMS@__{$table}` change `{$oField['field']}` `{$field}` ";
                            $len = $type == "number" ? $_POST['rules']['number']['maxnum'] : $_POST['rules'][$type]['maxlength'];
                            $sql .= getSqlType($type, $len, $default);
                            $fKey = array_search($oField['field'], $fArray);
                            $fArray[$fKey] = $field;
                            $mField = implode(',', $fArray);
                            $sql && $iCMS->db->query($sql);
                            $iCMS->db->query("update `#iCMS@__model` SET `field`='{$mField}' where id='" . $mArray[$i]['id'] . "'");
                        }
                    }
                }
                $iCMS->db->update('field', compact('name', 'field', 'description', 'mid', 'type', 'default', 'validate', 'hidden', 'rules'), compact('id'));
                field_cache();
                redirect("字段编辑完成!", __SELF__ . "?do=field&operation=manage", '3');
            }
        }
        break;
    default:
        $id = (int) $_GET['mid'];
        $SystemField = getSystemField();
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__field` order by id DESC");
        page($total, $maxperpage, "个字段");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__field` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        $model = $iCMS->cache('model.id', 'include/syscache', 0, true);
        include iCMS_admincp_tpl("field.manage");
}
Beispiel #18
0
     }
     isset($_GET['nopic']) && ($sql .= " AND `pic` =''");
     $_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 = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__article` {$sql} order by {$orderby}");
     page($total, $maxperpage, "篇文章");
     $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__article` {$sql} order by {$orderby} LIMIT {$firstcount} , {$maxperpage}");
     $_count = count($rs);
     include iCMS_admincp_tpl("article.manage");
     //		$mtime = microtime();
     //		$mtime = explode(' ', $mtime);
     //		$time_end = $mtime[1] + $mtime[0];
     //		echo  "<h1>".($time_end - $time_start);
     break;
 case 'visible':
     $id = (int) $_GET['id'];
     $v = (int) $_GET['v'];
     if ($v == '1') {
         $iCMS->db->query("UPDATE `#iCMS@__article` SET `visible` = '0' WHERE `id` ='{$id}'");
     } else {
         $iCMS->db->query("UPDATE `#iCMS@__article` SET `visible` = '1' WHERE `id` ='{$id}'");
     }
     _Header();
     break;
Beispiel #19
0
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'post':
        if ($action == 'edit') {
            $disable = explode("\r\n", dhtmlspecialchars($_POST['disable']));
            $filter = explode("\r\n", dhtmlspecialchars($_POST['filter']));
            if (is_array($filter)) {
                foreach ($filter as $k => $val) {
                    $filterArray[$k] = explode("=", $val);
                }
            }
            $iCMS->cache(false, 'include/syscache', 0, true, false);
            $iCMS->addcache('word.disable', $disable, 0);
            $iCMS->addcache('word.filter', $filterArray, 0);
            _Header(__SELF__ . '?do=filter');
        }
        break;
    default:
        $Admin->MP("menu_filter");
        $cache = $iCMS->cache(array('word.filter', 'word.disable'), 'include/syscache', 0, true);
        if (is_array($cache['word.filter'])) {
            foreach ($cache['word.filter'] as $k => $val) {
                $filterArray[$k] = implode("=", $val);
            }
        }
        include iCMS_admincp_tpl('filter');
}
Beispiel #20
0
                    $iCMS->db->query("delete from `#iCMS@__links` where `id`='{$id}'");
                }
                _Header();
            }
            foreach ($_POST['name'] as $id => $value) {
                $iCMS->db->query("update `#iCMS@__links` set `name`='{$value}',`logo`='" . $_POST['logo'][$id] . "',`url`='" . $_POST['url'][$id] . "',`desc`='" . $_POST['description'][$id] . "',`orderid`='" . $_POST['displayorder'][$id] . "' where `id`='{$id}'");
            }
            _Header();
        }
        if ($action == 'add') {
            $name = dhtmlspecialchars($_POST['name']);
            $url = dhtmlspecialchars($_POST['url']);
            $desc = dhtmlspecialchars($_POST['description']);
            $logo = dhtmlspecialchars($_POST['logo']);
            $orderid = intval($_POST['displayorder']);
            empty($name) && alert('网站名称不能为空!');
            empty($url) && alert('网站URL不能为空!');
            strpos($url, 'http://') === false && ($url = 'http://' . $url);
            $iCMS->db->query("INSERT INTO `#iCMS@__links` (`name`,`logo`,`desc`,`url`,`orderid`) VALUES ('{$name}','{$logo}','{$desc}','{$url}','{$orderid}')");
            _Header(__SELF__ . "?do=link");
        }
        break;
    default:
        $Admin->MP(array("menu_index_link", "menu_link"));
        $maxperpage = 60;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__links` ORDER BY `logo`, `orderid` ASC");
        page($total, $maxperpage, '个链接');
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__links` ORDER BY `logo`, `orderid` ASC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl('link');
}
Beispiel #21
0
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'post':
        if ($action == 'cache') {
            if ($_POST['catalog']) {
                include_once iPATH . 'include/catalog.class.php';
                $catalog = new catalog();
                $catalog->cache();
            }
            $_POST['tpl'] && $iCMS->clear_compiled_tpl();
            $_POST['keywords'] && keywords_cache();
            $_POST['tags'] && tags_cache();
            $_POST['model'] && model_cache();
            $_POST['field'] && field_cache();
            $_POST['config'] && CreateConfigFile();
            if ($_POST['Re-Statistics']) {
                $rs = $iCMS->db->getArray("SELECT id FROM `#iCMS@__catalog` ORDER BY `id` DESC");
                $_count = count($rs);
                for ($i = 0; $i < $_count; $i++) {
                    $c = $iCMS->db->getValue("SELECT count(*) FROM #iCMS@__article where `cid`='" . $rs[$i]['id'] . "' LIMIT 1 ");
                    $iCMS->db->query("UPDATE `#iCMS@__catalog` SET `count` ='{$c}' WHERE `id` ='" . $rs[$i]['id'] . "' LIMIT 1 ");
                }
            }
            redirect("执行完毕!", __SELF__ . '?do=cache');
        }
        break;
    default:
        $Admin->MP("menu_cache");
        include iCMS_admincp_tpl("cache");
}
Beispiel #22
0
            }
            foreach ($_POST['search'] as $id => $value) {
                $value = str_replace(array('%', '_'), array('\\%', '\\_'), $value);
                $iCMS->db->query("update `#iCMS@__search` set `search`='{$value}',`times`='" . $_POST['times'][$id] . "' where `id`='{$id}'");
            }
            search_cache();
            _Header();
        }
        if ($action == 'save') {
            $id = (int) $_POST['id'];
            $search = dhtmlspecialchars($_POST['search']);
            $search = str_replace(array('%', '_'), array('\\%', '\\_'), $search);
            $times = (int) $_POST['times'];
            if (empty($id)) {
                $iCMS->db->query("insert into `#iCMS@__search`(`search`,`times`,`addtime`) values ('{$search}','{$times}','" . time() . "')");
            } else {
                $iCMS->db->query("update `#iCMS@__search` set `search`='{$search}',`times`='{$times}' where id='{$id}'");
            }
            search_cache();
            _Header(__SELF__ . '?do=search');
        }
        break;
    default:
        $Admin->MP("menu_search");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__search` order by id DESC");
        page($total, $maxperpage, "个关键字");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__search` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl('search');
}
Beispiel #23
0
                    $iCMS->db->query("update `#iCMS@__tags` set `name`='{$value}',`sortid`='" . $_POST['sortid'][$id] . "',`updatetime`='" . time() . "' where `id`='{$id}'");
                }
            }
            tags_cache();
        }
        _Header();
        break;
    case 'delsort':
        $id = (int) $_GET['id'];
        $tSort = $iCMS->cache('tag.sort', 'include/syscache', 0, true);
        unset($tSort[$id]);
        $iCMS->cache(false, 'include/syscache', 0, true, false);
        $iCMS->addcache('tag.sort', $tSort, 0);
        _Header();
        break;
    case 'sort':
        $rs = $iCMS->cache('tag.sort', 'include/syscache', 0, true);
        $_count = count($rs);
        include iCMS_admincp_tpl("tag.sort");
        break;
    case 'manage':
        $Admin->MP("menu_tag_manage");
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__tags` order by id DESC");
        page($total, $maxperpage, "个TAG");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__tags` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        $tSort = $iCMS->cache('tag.sort', 'include/syscache', 0, true);
        include iCMS_admincp_tpl("tag.manage");
        break;
}
Beispiel #24
0
    case 'del':
        $id = intval($_GET['id']);
        $aid = intval($_GET['aid']);
        $id && $iCMS->db->query("DELETE FROM `#iCMS@__comment` WHERE `id` ='{$id}'");
        $aid && $iCMS->db->query("UPDATE `#iCMS@__article` SET `comments` = comments-1  WHERE `id` ='{$aid}'");
        _Header(__SELF__ . '?do=comment');
        break;
    case 'post':
        if ($action == "del") {
            if (isset($_POST['id'])) {
                foreach ($_POST['id'] as $k => $id) {
                    $aid = $_POST['aid'][$id];
                    $iCMS->db->query("DELETE FROM `#iCMS@__comment` WHERE `id` ='{$id}'");
                    $iCMS->db->query("UPDATE `#iCMS@__article` SET `comments` = comments-1  WHERE `id` ='{$aid}'");
                }
                _Header(__SELF__ . '?do=comment');
            } else {
                alert("请选择要删除的评论!");
            }
        }
        break;
    default:
        $Admin->MP(array("menu_index_comment", "menu_comment"));
        include_once iPATH . 'include/ubb.fun.php';
        $maxperpage = 20;
        $total = $iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__comment` order by id DESC");
        page($total, $maxperpage, "条评论");
        $rs = $iCMS->db->getArray("SELECT * FROM `#iCMS@__comment` order by id DESC LIMIT {$firstcount},{$maxperpage}");
        $_count = count($rs);
        include iCMS_admincp_tpl('comment');
}
Beispiel #25
0
             $detail = explode("\n", $bakinfo);
             $bk['name'] = $file;
             $bk['version'] = substr($detail[1], 10);
             $bk['time'] = substr($detail[2], 8);
             $bk['pre'] = substr($file, 0, $strlen);
             $bk['num'] = substr($file, $strlen, strrpos($file, '.') - $strlen);
             $filedb[] = $bk;
         }
     }
     include iCMS_admincp_tpl("database.recover");
     break;
 case 'bakincheck':
     include iCMS_admincp_tpl("database.bakincheck");
     break;
 case 'replace':
     include iCMS_admincp_tpl("database.replace");
     break;
 case 'post':
     if ($action == 'repair') {
         empty($_POST['tabledb']) && alert('请选择表');
         $table = implode(',', $_POST['tabledb']);
         $rs = $iCMS->db->getArray("REPAIR TABLE {$table}");
         $_count = count($rs);
         for ($i = 0; $i < $_count; $i++) {
             $rs[$i]['Table'] = substr(strrchr($rs[$i]['Table'], '.'), 1);
         }
         foreach ($rs as $k => $v) {
             $t .= '<ul style="clear:both;width:100%;text-align:left;font-size:12px;color:#333;font-weight: normal;"><li style="float:left;width:200px;">表:' . $v['Table'] . '</li> <li style="float:left;width:120px;">操作:' . $v['Op'] . '</li> <li style="float:left;width:320px;">状态:' . $v['Msg_text'] . '</li> </ul>';
         }
         redirect("{$t}<br />修复表完成", __SELF__ . "?do=database&operation=repair");
     }
Beispiel #26
0
function redirect($msg, $url = "", $t = '3', $more = "")
{
    include iCMS_admincp_tpl('redirect');
}
Beispiel #27
0
 function LoginPage()
 {
     include iCMS_admincp_tpl('login');
 }
Beispiel #28
0
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
switch ($operation) {
    case 'manage':
        $Admin->MP("menu_template_manage");
        $dir = trim($_GET["dir"]);
        $L = GetFolderList($dir, "templates", "");
        include iCMS_admincp_tpl('template.manage');
        break;
    case 'edit':
        $path = trim($_GET["path"]);
        $FileData = openfile(iPATH . "templates" . $path);
        include iCMS_admincp_tpl('template.edit');
        break;
    case 'clear':
        $path = trim($_GET["path"]);
        $iCMS->clear_compiled_tpl($path);
        redirect('清除完成', __REF__);
        break;
    case 'post':
        if ($action == 'edit') {
            strpos($_POST['tplpath'], '..') !== false && alert("文件路径不能带有..");
            preg_match("/\\.([a-zA-Z0-9]{2,4})\$/", $_POST['tplpath'], $exts);
            $FileExt = strtolower($exts[1]);
            strstr($FileExt, 'ph') && alert("文件格式错误!");
            in_array($FileExt, array('cer', 'htr', 'cdx', 'asa', 'asp', 'jsp', 'aspx', 'cgi')) && alert("文件格式错误!");
            $FileData = stripslashes($_POST['html']);
            writefile(iPATH . 'templates' . $_POST['tplpath'], $FileData);