function do_iCMS() { $filter = $this->setting->get(0, 'word.filter'); $disable = $this->setting->get(0, 'word.disable'); foreach ((array) $filter as $k => $val) { $filterArray[$k] = implode("=", (array) $val); } include iACP::view("filter"); }
function do_iCMS() { $res = iFS::folder('template', array('htm', 'css', 'js', 'png', 'jpg', 'gif')); $dirRs = $res['DirArray']; $fileRs = $res['FileArray']; $pwd = $res['pwd']; $parent = $res['parent']; $URI = $res['URI']; $navbar = true; $file_edit = true; include iACP::view("files.explorer"); }
function do_iCMS() { if ($_GET['keywords']) { $sql = " WHERE `keyword` REGEXP '{$_GET['keywords']}'"; } $orderby = $_GET['orderby'] ? $_GET['orderby'] : "id DESC"; $maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20; $total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__keywords` {$sql}", "G"); iPHP::pagenav($total, $maxperpage, "个关键词"); $rs = iDB::all("SELECT * FROM `#iCMS@__keywords` {$sql} order by {$orderby} LIMIT " . iPHP::$offset . " , {$maxperpage}"); $_count = count($rs); include iACP::view("keywords.manage"); }
function do_save() { $uid = (int) $_POST['uid']; $gender = (int) $_POST['gender']; $type = $_POST['type']; $username = iS::escapeStr($_POST['uname']); $nickname = iS::escapeStr($_POST['nickname']); $realname = iS::escapeStr($_POST['realname']); $power = $_POST['power'] ? json_encode($_POST['power']) : ''; $cpower = $_POST['cpower'] ? json_encode($_POST['cpower']) : ''; $gid = 0; $info = array(); $info['icq'] = iS::escapeStr($_POST['icq']); $info['home'] = iS::escapeStr($_POST['home']); $info['year'] = intval($_POST['year']); $info['month'] = intval($_POST['month']); $info['day'] = intval($_POST['day']); $info['from'] = iS::escapeStr($_POST['from']); $info['signature'] = iS::escapeStr($_POST['signature']); $info = addslashes(serialize($info)); $_POST['pwd'] && ($password = md5($_POST['pwd'])); $username or iPHP::alert('账号不能为空'); if (iACP::is_superadmin()) { $gid = (int) $_POST['gid']; } else { isset($_POST['gid']) && iPHP::alert('您没有权限更改角色'); } $fields = array('gid', 'gender', 'username', 'nickname', 'realname', 'power', 'cpower', 'info'); $data = compact($fields); if (empty($uid)) { iDB::value("SELECT `uid` FROM `#iCMS@__members` where `username` ='{$username}' LIMIT 1") && iPHP::alert('该账号已经存在'); $_data = compact(array('password', 'regtime', 'lastip', 'lastlogintime', 'logintimes', 'post', 'type', 'status')); $_data['regtime'] = time(); $_data['lastip'] = iPHP::getIp(); $_data['lastlogintime'] = time(); $_data['status'] = '1'; $data = array_merge($data, $_data); iDB::insert('members', $data); $msg = "账号添加完成!"; } else { iDB::value("SELECT `uid` FROM `#iCMS@__members` where `username` ='{$username}' AND `uid` !='{$uid}' LIMIT 1") && iPHP::alert('该账号已经存在'); iDB::update('members', $data, array('uid' => $uid)); $password && iDB::query("UPDATE `#iCMS@__members` SET `password`='{$password}' WHERE `uid` ='" . $uid . "'"); $msg = "账号修改完成!"; } iPHP::success($msg, 'url:' . APP_URI); }
function do_iCMS() { //数据统计 $rs = iDB::all("SHOW FULL TABLES FROM `" . iPHP_DB_NAME . "` WHERE table_type = 'BASE TABLE';"); foreach ($rs as $k => $val) { if (strstr(iPHP_DB_PREFIX, $val['Tables_in_' . iPHP_DB_NAME]) === false) { $iTable[] = strtoupper($val['Tables_in_' . iPHP_DB_NAME]); } else { $oTable[] = $val['Tables_in_' . iPHP_DB_NAME]; } } $content_datasize = 0; $tables = iDB::all("SHOW TABLE STATUS"); $_count = count($tables); for ($i = 0; $i < $_count; $i++) { $tableName = strtoupper($tables[$i]['Name']); if (in_array($tableName, $iTable)) { $datasize += $tables[$i]['Data_length']; $indexsize += $tables[$i]['Index_length']; if (stristr(strtoupper(iPHP_DB_PREFIX . "article," . iPHP_DB_PREFIX . "category," . iPHP_DB_PREFIX . "comment," . iPHP_DB_PREFIX . "article_data"), $tableName)) { $content_datasize += $tables[$i]['Data_length'] + $tables[$i]['Index_length']; } } } $acc = iDB::value("SELECT count(*) FROM `#iCMS@__category` WHERE `appid`='" . iCMS_APP_ARTICLE . "'"); $tac = iDB::value("SELECT count(*) FROM `#iCMS@__category` WHERE `appid`='" . iCMS_APP_TAG . "'"); $pac = iDB::value("SELECT count(*) FROM `#iCMS@__category` WHERE `appid`='" . iCMS_APP_PUSH . "'"); $ac = iDB::value("SELECT count(*) FROM `#iCMS@__article`"); $ac0 = iDB::value("SELECT count(*) FROM `#iCMS@__article` WHERE `status`='0'"); $ac2 = iDB::value("SELECT count(*) FROM `#iCMS@__article` WHERE `status`='2'"); $ctc = iDB::value("SELECT count(*) FROM `#iCMS@__comment`"); $tc = iDB::value("SELECT count(*) FROM `#iCMS@__tags`"); $kc = iDB::value("SELECT count(*) FROM `#iCMS@__keywords`"); $pc = iDB::value("SELECT count(*) FROM `#iCMS@__push`"); $uc = iDB::value("SELECT count(*) FROM `#iCMS@__user`"); $fdc = iDB::value("SELECT count(*) FROM `#iCMS@__filedata`"); $lc = iDB::value("SELECT count(*) FROM `#iCMS@__links`"); include iACP::view("home"); }
</ul> </div> <div id="<?php echo iACP::$app_name; ?> -cpower" class="tab-pane hide"> <div class="input-prepend input-append"><span class="add-on">全选</span><span class="add-on"> <input type="checkbox" class="checkAll checkbox" data-target="#<?php echo iACP::$app_name; ?> -cpower"/> </span><button class="btn btn-primary" type="submit"><i class="fa fa-check"></i> 提交</button> </div> <div class="clearfloat mb10"></div> <div class="input-prepend input-append"> <span class="add-on"><i class="fa fa-cog"></i> 全局权限</span> <span class="add-on">::</span> <span class="add-on">允许添加顶级栏目</span> <span class="add-on"><input type="checkbox" name="cpower[]" value="0:a" /></span> </div> <div class="clearfloat mb10"></div> <span class="label label-important">注:只有文章类型的栏目才有内容权限</span> <div id="cpower_treecontrol"> <a style="display:none;"></a> <a style="display:none;"></a> <a class="btn btn-mini btn-info" href="javascript:;">展开/收缩</a></div> <ul id="cpower_tree"> <?php echo iACP::app('category', 'all')->power_tree(); ?> </ul> </div>
function do_save() { $id = (int) $_POST['id']; $cid = (int) $_POST['cid']; $_cid = (int) $_POST['_cid']; $userid = (int) $_POST['userid']; $pid = (int) $_POST['pid']; $editor = iS::escapeStr($_POST['editor']); $ordernum = _int($_POST['ordernum']); $addtime = iPHP::str2time($_POST['addtime']); $title = iS::escapeStr($_POST['title']); $pic = $this->getpic($_POST['pic']); $description = iS::escapeStr($_POST['description']); $url = iS::escapeStr($_POST['url']); $title2 = iS::escapeStr($_POST['title2']); $pic2 = $this->getpic($_POST['pic2']); $description2 = iS::escapeStr($_POST['description2']); $url2 = iS::escapeStr($_POST['url2']); $title3 = iS::escapeStr($_POST['title3']); $pic3 = $this->getpic($_POST['pic3']); $description3 = iS::escapeStr($_POST['description3']); $url3 = iS::escapeStr($_POST['url3']); $metadata = iS::escapeStr($_POST['metadata']); $metadata = $metadata ? addslashes(serialize($metadata)) : ''; empty($userid) && ($userid = iMember::$userid); empty($title) && iPHP::alert('1.标题必填'); empty($cid) && iPHP::alert('请选择所属栏目'); $haspic = empty($pic) ? 0 : 1; $status = 1; $fields = array('cid', 'rootid', 'pid', 'haspic', 'editor', 'userid', 'title', 'pic', 'url', 'description', 'title2', 'pic2', 'url2', 'description2', 'title3', 'pic3', 'url3', 'description3', 'ordernum', 'metadata', 'addtime', 'hits', 'status'); $data = compact($fields); if (empty($id)) { iDB::insert('push', $data); iDB::query("UPDATE `#iCMS@__category` SET `count` = count+1 WHERE `cid` ='{$cid}' LIMIT 1 "); $msg = '推送完成'; } else { iDB::update('push', $data, array('id' => $id)); if ($_cid != $cid) { iDB::query("UPDATE `#iCMS@__category` SET `count` = count-1 WHERE `cid` ='{$_cid}' and `count`>0 LIMIT 1 "); iDB::query("UPDATE `#iCMS@__category` SET `count` = count+1 WHERE `cid` ='{$cid}' LIMIT 1 "); } $msg = '编辑完成!'; } iACP::callback($id, $this); if ($this->callback['code']) { return array("code" => $this->callback['code'], 'indexid' => $id); } iPHP::success($msg, 'url:' . APP_URI); }
function do_batch() { $idArray = (array) $_POST['id']; $idArray or iPHP::alert("请选择要操作的标签"); $ids = implode(',', $idArray); $batch = $_POST['batch']; switch ($batch) { case 'dels': iPHP::$break = false; foreach ($idArray as $id) { $this->do_del($id, false); } iPHP::$break = true; iPHP::success('标签全部删除完成!', 'js:1'); break; case 'move': $_POST['cid'] or iPHP::alert("请选择目标栏目!"); iPHP::import(iPHP_APP_CORE . '/iMAP.class.php'); map::init('category', $this->appid); $cid = (int) $_POST['cid']; foreach ($idArray as $id) { $_cid = iDB::value("SELECT `cid` FROM `#iCMS@__tags` where `id` ='{$id}'"); iDB::update("tags", compact('cid'), compact('id')); if ($_cid != $cid) { map::diff($cid, $_cid, $id); $this->categoryApp->update_count_one($_cid, '-'); $this->categoryApp->update_count_one($cid); } } iPHP::success('成功移动到目标栏目!', 'js:1'); break; case 'mvtcid': $_POST['tcid'] or iPHP::alert("请选择目标分类!"); iPHP::import(iPHP_APP_CORE . '/iMAP.class.php'); map::init('category', $this->appid); $tcid = (int) $_POST['tcid']; foreach ($idArray as $id) { $_tcid = iDB::value("SELECT `tcid` FROM `#iCMS@__tags` where `id` ='{$id}'"); iDB::update("tags", compact('tcid'), compact('id')); if ($_tcid != $tcid) { map::diff($tcid, $_tcid, $id); $this->categoryApp->update_count_one($_tcid, '-'); $this->categoryApp->update_count_one($tcid); } } iPHP::success('成功移动到目标分类!', 'js:1'); break; case 'prop': iPHP::import(iPHP_APP_CORE . '/iMAP.class.php'); map::init('prop', $this->appid); $pid = implode(',', (array) $_POST['pid']); foreach ((array) $_POST['id'] as $id) { $_pid = iDB::value("SELECT pid FROM `#iCMS@__tags` WHERE `id`='{$id}'"); iDB::update("tags", compact('pid'), compact('id')); map::diff($pid, $_pid, $id); } iPHP::success('属性设置完成!', 'js:1'); break; case 'weight': $weight = _int($_POST['mweight']); $sql = "`weight` = '{$weight}'"; break; case 'tpl': $tpl = iS::escapeStr($_POST['mtpl']); $sql = "`tpl` = '{$tpl}'"; break; case 'keyword': if ($_POST['pattern'] == 'replace') { $sql = "`keywords` = '" . iS::escapeStr($_POST['mkeyword']) . "'"; } elseif ($_POST['pattern'] == 'addto') { foreach ($idArray as $id) { $keywords = iDB::value("SELECT keywords FROM `#iCMS@__tags` WHERE `id`='{$id}'"); $sql = "`keywords` = '" . ($keywords ? $keywords . ',' . iS::escapeStr($_POST['mkeyword']) : iS::escapeStr($_POST['mkeyword'])) . "'"; iDB::query("UPDATE `#iCMS@__tags` SET {$sql} WHERE `id`='{$id}'"); } iPHP::success('关键字更改完成!', 'js:1'); } break; case 'tag': if ($_POST['pattern'] == 'replace') { $sql = "`related` = '" . iS::escapeStr($_POST['mtag']) . "'"; } elseif ($_POST['pattern'] == 'addto') { foreach ($idArray as $id) { $keywords = iDB::value("SELECT related FROM `#iCMS@__tags` WHERE `id`='{$id}'"); $sql = "`related` = '" . ($keywords ? $keywords . ',' . iS::escapeStr($_POST['mtag']) : iS::escapeStr($_POST['mtag'])) . "'"; iDB::query("UPDATE `#iCMS@__tags` SET {$sql} WHERE `id`='{$id}'"); } iPHP::success('相关标签更改完成!', 'js:1'); } break; default: if (strpos($batch, ':')) { $data = iACP::fields($batch); foreach ($idArray as $id) { $data && iDB::update("tags", $data, array('id' => $id)); } iPHP::success('操作成功!', 'js:1'); } else { iPHP::alert('请选择要操作项!', 'js:1'); } } $sql && iDB::query("UPDATE `#iCMS@__tags` SET {$sql} WHERE `id` IN ({$ids})"); iPHP::success('操作成功!', 'js:1'); }
function do_addproject() { $rs = array(); $this->pid && ($rs = spider::project($this->pid)); $cid = empty($rs['cid']) ? $this->cid : $rs['cid']; $categoryApp = iACP::app('category', iCMS_APP_ARTICLE); $cata_option = $categoryApp->select(false, $cid); $rule_option = $this->rule_opt($rs['rid']); $post_option = $this->post_opt($rs['poid']); //$rs['sleep'] OR $rs['sleep'] = 30; include iACP::view("spider.addproject"); }
function article_data($bodyArray, $aid = 0, $haspic = 0) { if (isset($_POST['ischapter']) || is_array($_POST['adid'])) { $adidArray = $_POST['adid']; $chaptertitle = $_POST['chaptertitle']; $chapter = count($bodyArray); foreach ($bodyArray as $key => $body) { $adid = (int) $adidArray[$key]; $subtitle = iS::escapeStr($chaptertitle[$key]); $this->body($body, $subtitle, $aid, $adid, $haspic); } articleTable::update(compact('chapter'), array('id' => $aid)); } else { $adid = (int) $_POST['adid']; $subtitle = iS::escapeStr($_POST['subtitle']); $body = implode('#--iCMS.PageBreak--#', $bodyArray); $this->body($body, $subtitle, $aid, $adid, $haspic); } iACP::callback($aid, $this, 'data'); }
function do_manage($doType = null) { $cid = (int) $_GET['cid']; $sql = " where "; switch ($doType) { //status:[0:草稿][1:正常][2:回收][3:审核][4:不合格] case 'inbox': //草稿 $sql .= "`status` ='0'"; // if(iMember::$data->gid!=1){ // $sql.=" AND `userid`='".iMember::$userid."'"; // } $position = "草稿"; break; case 'trash': //回收站 $sql .= "`status` ='2'"; $position = "回收站"; break; case 'examine': //审核 $sql .= "`status` ='3'"; $position = "已审核"; break; case 'off': //未通过 $sql .= "`status` ='4'"; $position = "未通过"; break; default: $sql .= " `status` ='1'"; $cid && ($position = $this->category[$cid]['name']); } if ($_GET['keywords']) { $sql .= " AND CONCAT(title,title2,title3) REGEXP '{$_GET['keywords']}'"; } $sql .= $this->categoryApp->search_sql($cid); isset($_GET['nopic']) && ($sql .= " AND `haspic` ='0'"); $_GET['starttime'] && ($sql .= " and `addtime`>=UNIX_TIMESTAMP('" . $_GET['starttime'] . " 00:00:00')"); $_GET['endtime'] && ($sql .= " and `addtime`<=UNIX_TIMESTAMP('" . $_GET['endtime'] . " 23:59:59')"); isset($_GET['userid']) && ($uri .= '&userid=' . (int) $_GET['userid']); isset($_GET['keyword']) && ($uri .= '&keyword=' . $_GET['keyword']); isset($_GET['pid']) && ($uri .= '&pid=' . $_GET['pid']); isset($_GET['cid']) && ($uri .= '&cid=' . $_GET['cid']); isset($_GET['pid']) && $_GET['pid'] != '-1' && ($uri .= '&pid=' . $_GET['at']); $orderby = $_GET['orderby'] ? $_GET['orderby'] : "id DESC"; $maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20; $total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__push` {$sql}", "G"); iPHP::pagenav($total, $maxperpage, "条记录"); $rs = iDB::all("SELECT * FROM `#iCMS@__push` {$sql} order by {$orderby} LIMIT " . iPHP::$offset . " , {$maxperpage}"); $_count = count($rs); include iACP::view("push.manage"); }
function do_replace() { include iACP::view("database.replace"); }
function do_delfile() { iACP::MP('FILE.DELETE', 'alert'); $_GET['path'] or iPHP::alert("请选择要删除的文件"); strpos($_GET['path'], '..') !== false && iPHP::alert("文件路径中带有.."); $hash = md5($_GET['path']); $FileRootPath = iFS::fp($_GET['path'], '+iPATH'); if (iFS::del($FileRootPath)) { $msg = 'success:#:check:#:文件删除完成!'; $_GET['ajax'] && iPHP::json(array('code' => 1, 'msg' => $msg)); } else { $msg = 'warning:#:warning:#:找不到相关文件,文件删除失败!'; $_GET['ajax'] && iPHP::json(array('code' => 0, 'msg' => $msg)); } iPHP::dialog($msg, 'js:parent.$("#' . $hash . '").remove();'); }
<?php if (iACP::MP('FILE.BROWSE')) { ?> <li><a href="<?php echo __ADMINCP__; ?> =files&do=browse&from=modal&click=file&callback=<?php echo $callback; ?> " data-toggle="modal" title="从网站选择"><i class="fa fa-search"></i> 从网站选择</a></li> <li class="divider"></li> <?php } ?> <?php if (iACP::MP('FILE.EDIT')) { ?> <li><a href="<?php echo __ADMINCP__; ?> =files&do=editpic&from=modal&callback=<?php echo $callback; ?> " data-toggle="modal" title="使用美图秀秀编辑图片" class="modal_photo_<?php echo $unid; ?> tip"><i class="fa fa-edit"></i> 编辑</a></li> <li class="divider"></li> <?php if ($indexid) { ?>
public static function publish($work = null) { $_POST = spiderData::crawl(); if (spider::$work == 'shell') { if (empty($_POST['title'])) { echo "标题不能为空\n"; return false; } if (empty($_POST['body'])) { echo "内容不能为空\n"; return false; } } $checker = spider::checker($work, spider::$pid, $_POST['reurl'], $_POST['title']); if ($checker !== true) { return $checker; } $project = spider::project(spider::$pid); if (!isset($_POST['cid'])) { $_POST['cid'] = $project['cid']; } $postArgs = spider::postArgs($project['poid']); if ($_GET['indexid']) { $aid = (int) $_GET['indexid']; $_POST['aid'] = $aid; $_POST['adid'] = iDB::value("SELECT `id` FROM `#iCMS@__article_data` WHERE aid='{$aid}'"); } $title = iS::escapeStr($_POST['title']); $url = iS::escapeStr($_POST['reurl']); $hash = md5($url); if (empty(spider::$sid)) { $spider_url = iDB::row("SELECT `id`,`publish`,`indexid` FROM `#iCMS@__spider_url` where `url`='{$url}'", ARRAY_A); if (empty($spider_url)) { $spider_url_data = array('cid' => $project['cid'], 'rid' => spider::$rid, 'pid' => spider::$pid, 'title' => addslashes($title), 'url' => $url, 'hash' => $hash, 'status' => '1', 'addtime' => time(), 'publish' => '0', 'indexid' => '0', 'pubdate' => ''); $suid = iDB::insert('spider_url', $spider_url_data); } else { if ($spider_url['indexid']) { $_POST['aid'] = $spider_url['indexid']; $_POST['adid'] = iDB::value("SELECT `id` FROM `#iCMS@__article_data` WHERE aid='" . $spider_url['indexid'] . "'"); } $suid = $spider_url['id']; } } else { $suid = spider::$sid; } if (spider::$callback['post'] && is_callable(spider::$callback['post'])) { $_POST = call_user_func_array(spider::$callback['post'], array($_POST)); } iS::slashes($_POST); $app = iACP::app($postArgs->app); $fun = $postArgs->fun; $app->callback['code'] = '1001'; /** * 主表 回调 更新关联ID */ $app->callback['primary'] = array(array('spider', 'update_spider_url_indexid'), array('suid' => $suid)); /** * 数据表 回调 成功发布 */ $app->callback['data'] = array(array('spider', 'update_spider_url_publish'), array('suid' => $suid)); $callback = $app->{$fun}(); if ($callback['code'] == $app->callback['code']) { if (spider::$sid) { $work === NULL && iPHP::success("发布成功!", 'js:1'); } else { $work === NULL && iPHP::success("发布成功!", 'js:parent.$("#' . $hash . '").remove();'); } } if ($work == "shell" || $work == "WEB@AUTO") { $callback['work'] = $work; return $callback; } }
function do_manage($doType = null) { include iACP::view("menu.manage"); }
function li($mType, $id, $level = 1) { if (!iACP::MP($id)) { return false; } $a = $this->menu_array[$id]; if ($a['app'] == "separator") { return '<li class="' . $a['class'] . '"></li>'; } $a['href'] && ($href = __ADMINCP__ . '=' . $a['href']); $a['target'] == 'iPHP_FRAME' && ($href .= '&frame=iPHP'); if (strstr($a['href'], 'http://') || strstr($a['href'], '#')) { $href = $a['href']; } $a['href'] == '__SELF__' && ($href = __SELF__); $a['href'] == '#' && ($href = 'javascript:;'); $isSM = count($this->root_array[$id]); if ($isSM && $level && $mType == 'nav') { $a['class'] = 'dropdown-submenu'; } if ($mType == 'sidebar' && $isSM && $level == 1) { $href = 'javascript:;'; $a['class'] = 'submenu'; $label = '<span class="label">' . $this->subcount($id) . '</span>'; } if ($mType == 'tab') { $href = "#" . $a['href']; } $li = '<li class="' . $a['class'] . '" title="' . $a['name'] . '" data-level="' . $level . '" data-menu="m' . $id . '">'; $link = '<a href="' . $href . '"'; $a['title'] && ($link .= ' title="' . $a['title'] . '"'); $a['a_class'] && ($link .= ' class="' . $a['a_class'] . '"'); $a['target'] && ($link .= ' target="' . $a['target'] . '"'); if ($mType == 'sidebar' && $a['data-toggle'] == 'modal') { $link .= ' data-toggle="' . $a['data-toggle'] . '"'; } elseif ($mType == 'nav') { $a['data-toggle'] && ($link .= ' data-toggle="' . $a['data-toggle'] . '"'); } elseif ($mType == 'tab') { $link .= ' data-toggle="tab"'; } $a['data-target'] && ($link .= ' data-target="' . $a['data-target'] . '"'); $a['data-meta'] && ($link .= " data-meta='" . $a['data-meta'] . "'"); $link .= ">"; $li .= $link; $a['icon'] && ($li .= '<i class="' . $a['icon'] . '"></i> '); $li .= '<span>' . $a['name'] . '</span>' . $label; $a['caret'] && ($li .= $a['caret']); $li .= '</a>'; if ($isSM) { $SMli = ''; foreach ((array) $this->root_array[$id] as $rootid => $M) { $SMli .= $this->li($mType, $M['id'], $level + 1); } $mType == 'nav' && ($SMul = '<ul class="dropdown-menu">' . $SMli . '</ul>'); if ($mType == 'sidebar') { $SMul = $level > 1 ? $SMli : '<ul style="display: none;">' . $SMli . '</ul>'; } } $li .= $SMul . '</li>'; return $li; }
<?php /** * iCMS - i Content Management System * Copyright (c) 2007-2012 idreamsoft.com iiimon Inc. All rights reserved. * * @author coolmoo <*****@*****.**> * @site http://www.idreamsoft.com * @licence http://www.idreamsoft.com/license.php * @version 6.0.0 * @$Id: admincp.php 2365 2014-02-23 16:26:27Z coolmoo $ */ define('iPHP_DEBUG', true); define('iPHP_SESSION', 'SESSION'); require dirname(__FILE__) . '/iCMS.php'; require iPHP_APP_CORE . '/iACP.class.php'; iACP::run();
function do_iCMS() { $sql = " where 1=1"; // $cid = (int)$_GET['cid']; // // if($cid) { // $cids = $_GET['sub']?iCMS::get_category_ids($cid,true):$cid; // $cids OR $cids = $vars['cid']; // $sql.= iPHP::where($cids,'cid'); // } $_GET['field'] && ($sql .= " AND `field`='" . $_GET['field'] . "'"); $_GET['field'] && ($uri .= '&field=' . $_GET['field']); $_GET['type'] && ($sql .= " AND `type`='" . $_GET['type'] . "'"); $_GET['type'] && ($uri .= '&type=' . $_GET['type']); $_GET['cid'] && ($sql .= " AND `cid`='" . $_GET['cid'] . "'"); $_GET['cid'] && ($uri .= '&cid=' . $_GET['cid']); $maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20; $total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__prop` {$sql}", "G"); iPHP::pagenav($total, $maxperpage, "个属性"); $rs = iDB::all("SELECT * FROM `#iCMS@__prop` {$sql} order by pid DESC LIMIT " . iPHP::$offset . " , {$maxperpage}"); $_count = count($rs); include iACP::view("prop.manage"); }
function article_data($bodyArray, $aid = 0, $haspic = 0) { $id = (int) $_POST['adid']; $subtitle = iS::escapeStr($_POST['subtitle']); $body = implode('#--iCMS.PageBreak--#', $bodyArray); $body = preg_replace(array('/<script.+?<\\/script>/is', '/<form.+?<\\/form>/is'), '', $body); isset($_POST['dellink']) && ($body = preg_replace("/<a[^>].*?>(.*?)<\\/a>/si", "\\1", $body)); if (isset($_POST['markdown'])) { $body = '#--iCMS.Markdown--#' . $body; } else { iCMS::$config['publish']['autoformat'] && ($body = addslashes(autoformat($body))); } articleTable::$ID = $aid; $fields = articleTable::data_fields($id); $data = compact($fields); if ($id) { articleTable::data_update($data, compact('id')); } else { $id = articleTable::data_insert($data); } iACP::callback($aid, $this, 'data'); $_POST['isredirect'] && (iFS::$redirect = true); $_POST['iswatermark'] && (iFS::$watermark = false); if (isset($_POST['remote'])) { $body = $this->remotepic($body, true, $aid); $body = $this->remotepic($body, true, $aid); $body = $this->remotepic($body, true, $aid); if ($body && $id) { articleTable::data_update(array('body' => $body), compact('id')); } } if (isset($_POST['autopic']) && empty($haspic)) { $picurl = $this->remotepic($body, 'autopic', $aid); $this->pic($picurl, $aid); } $this->pic_indexid($body, $aid); }
<?php /** * iCMS - i Content Management System * Copyright (c) 2007-2012 idreamsoft.com iiimon Inc. All rights reserved. * * @author coolmoo <*****@*****.**> * @site http://www.idreamsoft.com * @licence http://www.idreamsoft.com/license.php * @version 6.0.0 * @$Id: pushcategory.app.php 2374 2014-03-17 11:46:13Z coolmoo $ */ defined('iPHP') or exit('What are you doing?'); iACP::app('category', 'import'); class pushcategoryApp extends categoryApp { function __construct() { parent::__construct(iCMS_APP_PUSH); $this->category_name = "版块"; $this->_app = 'push'; $this->_app_name = '推送'; $this->_app_table = 'push'; $this->_app_cid = 'cid'; // $this->_app_indexTPL = ''; // $this->_app_listTPL = ''; // $this->_app_contentTPL = ''; } }
function do_update() { $this->msg = iPatch::download(); //下载文件包 include iACP::view("patch"); }
public static function files_modal_btn($title = '', $click = 'file', $target = 'template_index', $callback = '', $do = 'seltpl', $from = 'modal') { $filesApp = iACP::app('files'); $filesApp->modal_btn($title, $click, $target, $callback, $do, $from); }
function delArticle($id, $uid = '0', $postype = '1') { $id = (int) $id; $id or iPHP::alert("请选择要删除的文章"); $uid && ($sql = "and `userid`='{$uid}' and `postype`='{$postype}'"); $art = articleTable::row($id, 'cid,pic,tags', $sql); iACP::CP($art['cid'], 'cd', 'alert'); $frs = articleTable::select_filedata_indexid($id); for ($i = 0; $i < count($frs); $i++) { if ($frs[$i]) { $path = $frs[$i]['path'] . '/' . $frs[$i]['filename'] . '.' . $frs[$i]['ext']; iFS::del(iFS::fp($frs[$i]['path'], '+iPATH')); $msg .= $this->del_msg($path . ' 文件删除'); } } if ($art['tags']) { iPHP::app('tag.class', 'static'); $msg .= tag::del($art['tags']); } iDB::query("DELETE FROM `#iCMS@__category_map` WHERE `iid` = '{$id}' AND `appid` = '" . $this->appid . "';"); iDB::query("DELETE FROM `#iCMS@__prop_map` WHERE `iid` = '{$id}' AND `appid` = '" . $this->appid . "' ;"); articleTable::del_filedata($id, 'indexid'); $msg .= $this->del_msg('相关文件数据删除'); articleTable::del_comment($id); $msg .= $this->del_msg('评论数据删除'); articleTable::del($id); articleTable::del_data($id); $msg .= $this->del_msg('文章数据删除'); $this->categoryApp->update_count_one($art['cid'], '-'); $msg .= $this->del_msg('栏目数据更新'); $msg .= $this->del_msg('删除完成'); return $msg; }
function listbtn($rs) { $a = '<a href="' . iURL::get('category', $rs)->href . '" class="btn btn-small"><i class="fa fa-link"></i> 访问</a> '; iACP::CP($rs['cid'], 'ca') && ($a .= '<a href="' . __ADMINCP__ . '=' . $this->_app . '&do=add&' . $this->_app_cid . '=' . $rs['cid'] . '" class="btn btn-small"><i class="fa fa-edit"></i> 添加' . $this->_app_name . '</a> '); iACP::CP($rs['cid'], 'cs') && ($a .= '<a href="' . __ADMINCP__ . '=' . $this->_app . '&' . $this->_app_cid . '=' . $rs['cid'] . '&sub=on" class="btn btn-small"><i class="fa fa-list-alt"></i> ' . $this->_app_name . '管理</a> '); return $a; }
function do_iCMS() { $sql = " where 1=1"; $_GET['pid'] && ($sql .= " AND `pid`='" . $_GET['pid'] . "'"); $_GET['pid'] && ($uri .= '&pid=' . $_GET['pid']); $_GET['cid'] && ($sql .= " AND `cid`='" . $_GET['cid'] . "'"); $_GET['cid'] && ($uri .= '&cid=' . $_GET['cid']); $maxperpage = $_GET['perpage'] > 0 ? (int) $_GET['perpage'] : 20; $total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__marker` {$sql}", "G"); iPHP::pagenav($total, $maxperpage, "个标记"); $rs = iDB::all("SELECT * FROM `#iCMS@__marker` {$sql} order by id DESC LIMIT " . iPHP::$offset . " , {$maxperpage}"); $_count = count($rs); include iACP::view("marker.manage"); }
function do_article() { $this->categoryApp = iACP::app('category', iCMS_APP_ARTICLE); include iACP::view("html.article"); }
function do_iCMS() { $rs = iDB::all("SELECT * FROM `#iCMS@__group` ORDER BY `type` , `gid` ASC"); $_count = count($rs); include iACP::view("groups.manage"); }
} ?> </tbody> <tfoot> <tr> <td colspan="6"><div class="pagination pagination-right" style="float:right;"><?php echo iPHP::$pagenav; ?> </div> <div class="input-prepend input-append mt20"> <span class="add-on">全选 <input type="checkbox" class="checkAll checkbox" data-target="#<?php echo APP_BOXID; ?> " /> </span> <div class="btn-group dropup" id="iCMS-batch"> <a class="btn dropdown-toggle" data-toggle="dropdown" tabindex="-1"><i class="fa fa-wrench"></i> 批 量 操 作 </a><a class="btn dropdown-toggle" data-toggle="dropdown" tabindex="-1"> <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a data-toggle="batch" data-action="dels"><i class="fa fa-trash-o"></i> 删除</a></li> </ul> </div> </div></td> </tr> </tfoot> </table> </form> </div> </div> </div> <?php iACP::foot();
function do_artCount($dialog = true) { $app = iACP::app('category'); $app->recount(); $dialog && iPHP::success('更新完成'); }