本文整理汇总了PHP中iPHP::success方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::success方法的具体用法?PHP iPHP::success怎么用?PHP iPHP::success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iPHP
的用法示例。
在下文中一共展示了iPHP::success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_check
function do_check()
{
if (empty($this->patch)) {
if ($_GET['ajax']) {
iPHP::json(array('code' => 0));
} else {
iPHP::success("您使用的 iCMS 版本,目前是最新版本<hr />当前版本:iCMS " . iCMS_VER . " [" . iCMS_RELEASE . "]", 0, "5");
}
} else {
switch (iCMS::$config['system']['patch']) {
case "1":
//自动下载,安装时询问
$this->msg = iPatch::download($this->patch[1]);
$json = array('code' => "1", 'url' => __ADMINCP__ . '=patch&do=install', 'msg' => "发现iCMS最新版本<br /><span class='label label-warning'>iCMS " . $this->patch[0] . " [" . $this->patch[1] . "]</span><br />" . $this->patch[3] . "<hr />您当前使用的版本<br /><span class='label label-info'>iCMS " . iCMS_VER . " [" . iCMS_RELEASE . "]</span><br /><br />新版本已经下载完成!! 是否现在更新?");
break;
case "2":
//不自动下载更新,有更新时提示
$json = array('code' => "2", 'url' => __ADMINCP__ . '=patch&do=update', 'msg' => "发现iCMS最新版本<br /><span class='label label-warning'>iCMS " . $this->patch[0] . " [" . $this->patch[1] . "]</span><br />" . $this->patch[3] . "<hr />您当前使用的版本<br /><span class='label label-info'>iCMS " . iCMS_VER . " [" . iCMS_RELEASE . "]</span><br /><br />请马上更新您的iCMS!!!");
break;
}
if ($_GET['ajax']) {
iPHP::json($json, true);
}
$moreBtn = array(array("text" => "马上更新", "url" => $json['url']), array("text" => "以后在说", "js" => 'return true'));
iPHP::dialog('success:#:check:#:' . $json['msg'], 0, 30, $moreBtn);
}
}
示例2: do_save
function do_save()
{
$disable = explode("\n", iS::escapeStr($_POST['disable']));
$filter = explode("\n", iS::escapeStr($_POST['filter']));
foreach ($filter as $k => $val) {
$filterArray[$k] = explode("=", $val);
}
$this->setting->set($filterArray, 'word.filter', 0, true);
$this->setting->set($disable, 'word.disable', 0, true);
iPHP::success('更新完成');
}
示例3: do_save
function do_save()
{
$filter = explode("\n", $_POST['filter']);
$disable = explode("\n", $_POST['disable']);
$disable = array_unique($disable);
foreach ($filter as $k => $val) {
$filterArray[$k] = explode("=", $val);
}
$this->setting->set($filterArray, 'word.filter', 0, true);
$this->setting->set($disable, 'word.disable', 0, true);
$this->cache();
iPHP::success('更新完成');
}
示例4: do_batch
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;
}
}
示例5: __action_profile_base
private function __action_profile_base()
{
$nickname = iS::escapeStr($_POST['nickname']);
$gender = iS::escapeStr($_POST['gender']);
$weibo = iS::escapeStr($_POST['weibo']);
$province = iS::escapeStr($_POST['province']);
$city = iS::escapeStr($_POST['city']);
$year = iS::escapeStr($_POST['year']);
$month = iS::escapeStr($_POST['month']);
$day = iS::escapeStr($_POST['day']);
$constellation = iS::escapeStr($_POST['constellation']);
$profession = iS::escapeStr($_POST['profession']);
$isSeeFigure = iS::escapeStr($_POST['isSeeFigure']);
$height = iS::escapeStr($_POST['height']);
$weight = iS::escapeStr($_POST['weight']);
$bwhB = iS::escapeStr($_POST['bwhB']);
$bwhW = iS::escapeStr($_POST['bwhW']);
$bwhH = iS::escapeStr($_POST['bwhH']);
$pskin = iS::escapeStr($_POST['pskin']);
$phair = iS::escapeStr($_POST['phair']);
$shoesize = iS::escapeStr($_POST['shoesize']);
$personstyle = iS::escapeStr($_POST['personstyle']);
$slogan = iS::escapeStr($_POST['slogan']);
$personstyle == iPHP::lang('user:profile:personstyle') && ($personstyle = "");
$slogan == iPHP::lang('user:profile:slogan') && ($slogan = "");
$pskin == iPHP::lang('user:profile:pskin') && ($pskin = "");
$phair == iPHP::lang('user:profile:phair') && ($phair = "");
// if($nickname!=user::$nickname){
// $has_nick = iDB::value("SELECT uid FROM `#iCMS@__user` where `nickname`='{$nickname}' AND `uid` <> '".user::$userid."'");
// $has_nick && iPHP::alert('user:profile:nickname');
// $userdata = user::data(user::$userid);
// if($userdata->unickEdit>1){
// iPHP::alert('user:profile:unickEdit');
// }
// if($nickname){
// iDB::update('user',array('nickname'=>$nickname),array('uid'=>user::$userid));
// $unickEdit = 1;
// }
// }
if ($gender != $this->me->gender) {
iDB::update('user', array('gender' => $gender), array('uid' => user::$userid));
}
$uid = iDB::value("SELECT `uid` FROM `#iCMS@__user_data` where `uid`='" . user::$userid . "' limit 1");
$fields = array('weibo', 'province', 'city', 'year', 'month', 'day', 'constellation', 'profession', 'isSeeFigure', 'height', 'weight', 'bwhB', 'bwhW', 'bwhH', 'pskin', 'phair', 'shoesize', 'personstyle', 'slogan', 'coverpic');
if ($uid) {
$data = compact($fields);
$unickEdit && ($data['unickEdit'] = 1);
iDB::update('user_data', $data, array('uid' => user::$userid));
} else {
$unickEdit = 0;
$uid = user::$userid;
$_fields = array('uid', 'realname', 'unickEdit', 'mobile', 'enterprise', 'address', 'zip', 'tb_nick', 'tb_buyer_credit', 'tb_seller_credit', 'tb_type', 'is_golden_seller');
$fields = array_merge($fields, $_fields);
$data = compact($fields);
iDB::insert('user_data', $data);
}
iPHP::success('user:profile:success');
}
示例6: do_logout
function do_logout()
{
iMember::logout();
iACP::destroy_seccode();
iPHP::success('注销成功!', 'url:' . __SELF__);
}
示例7: do_save
function do_save()
{
$gid = intval($_POST['gid']);
$type = intval($_POST['type']);
$name = iS::escapeStr($_POST['name']);
$power = $_POST['power'] ? json_encode($_POST['power']) : '';
$cpower = $_POST['cpower'] ? json_encode($_POST['cpower']) : '';
$name or iPHP::alert('角色名不能为空');
$fields = array('name', 'ordernum', 'power', 'cpower', 'type');
$data = compact($fields);
if ($gid) {
iDB::update('group', $data, array('gid' => $gid));
$msg = "角色修改完成!";
} else {
iDB::insert('group', $data);
$msg = "角色添加完成!";
}
iPHP::success($msg, 'url:' . APP_URI);
}
示例8: save
/**
* [save 其它应用配置保存]
* @param integer $appid [应用ID]
* @param [sting] $app [应用名]
*/
function save($appid = 0, $name = null)
{
$name === null && ($name = iACP::$app_name);
empty($appid) && iPHP::alert("配置程序出错缺少APPID!");
$config = iS::escapeStr($_POST['config']);
$this->set($config, $name, $appid, false);
$this->cache();
iPHP::success('配置更新完成', 'js:1');
}
示例9: do_createArticle
function do_createArticle($aid = null)
{
$category = $this->PG['cid'];
$startime = $this->PG['startime'];
$endtime = $this->PG['endtime'];
$startid = $this->PG['startid'];
$endid = $this->PG['endid'];
$perpage = (int) $this->PG['perpage'];
$offset = (int) $this->PG['offset'];
$orderby = $this->PG['orderby'];
$whereSQL = "WHERE `status` ='1'";
$aid === null && ($aid = $this->PG['aid']);
if ($aid) {
$title = self::Article($aid);
iPHP::success($title . '<hr />生成静态完成!');
}
$category[0] == 'all' && ($category = $this->get_category(iCMS_APP_ARTICLE));
if ($category) {
$cids = implode(',', (array) $category);
$whereSQL .= " AND `cid` IN({$cids})";
}
$startime && ($whereSQL .= " AND `pubdate`>=UNIX_TIMESTAMP('{$startime} 00:00:00')");
$endtime && ($whereSQL .= " AND `pubdate`<=UNIX_TIMESTAMP('{$endtime} 23:59:59')");
$startid && ($whereSQL .= " AND `id`>='{$startid}'");
$endid && ($whereSQL .= " AND `id`<='{$endid}'");
$perpage or $perpage = $this->CP;
$orderby or $orderby = "id DESC";
$total = iPHP::total(false, "SELECT count(*) FROM `#iCMS@__article` {$whereSQL}", "G");
$looptimes = ceil($total / $perpage);
$offset = $this->page * $perpage;
$rs = iDB::all("SELECT `id` FROM `#iCMS@__article` {$whereSQL} order by {$orderby} LIMIT {$offset},{$perpage}");
$_count = count($rs);
$msg = "共<span class='label label-info'>{$total}</span>篇文章,将分成<span class='label label-info'>{$looptimes}</span>次完成<hr />开始执行第<span class='label label-info'>" . ($this->page + 1) . "</span>次生成,共<span class='label label-info'>{$_count}</span>篇<hr />";
for ($i = 0; $i < $_count; $i++) {
self::Article($rs[$i]['id']);
$msg .= '<span class="label label-success">' . $rs[$i]['id'] . ' <i class="fa fa-check"></i></span> ';
}
$GLOBALS['page']++;
$use_time = iPHP::timer_stop();
$msg .= "<hr />用时<span class='label label-info'>{$use_time}</span>秒";
$query["total_num"] = $total;
$query["alltime"] = $this->alltime + $use_time;
$loopurl = $this->loopurl($looptimes, $query);
if ($loopurl) {
$moreBtn = array(array("id" => "btn_stop", "text" => "停止", "url" => APP_URI . "&do=article"), array("id" => "btn_next", "text" => "继续", "src" => $loopurl, "next" => true));
$dtime = 1;
$all_time = $looptimes * $use_time + $looptimes + 1;
$msg .= "<hr />预计全部生成还需要<span class='label label-info'>{$all_time}</span>秒";
} else {
$moreBtn = array(array("id" => "btn_next", "text" => "完成", "url" => APP_URI . "&do=article"));
$dtime = 5;
$msg .= "<hr />已全部生成完成<hr />总共用时<span class='label label-info'>" . $query["alltime"] . "</span>秒";
}
$updateMsg = $this->page ? true : false;
iPHP::dialog($msg, $loopurl ? "src:" . $loopurl : '', $dtime, $moreBtn, $updateMsg);
}
示例10: do_cache
function do_cache($dialog = true)
{
$this->cache(true, $this->appid);
$dialog && iPHP::success('更新完成');
}
示例11: publish
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;
}
}
示例12: do_save
function do_save()
{
$id = $_POST['id'];
$rootid = $_POST['rootid'];
$app = $_POST['app'];
$name = $_POST['name'];
$title = $_POST['title'];
$href = $_POST['href'];
$a_class = $_POST['a_class'];
$icon = $_POST['icon'];
$target = $_POST['target'];
$data_toggle = $_POST['data-toggle'];
$ordernum = $_POST['ordernum'];
$class = '';
$caret = '';
$data_meta = $_POST['data-meta'];
$data_target = '';
if ($data_toggle == "dropdown") {
$class = 'dropdown';
$a_class = 'dropdown-toggle';
$caret = '<b class="caret"></b>';
} else {
if ($data_toggle == "modal") {
$data_meta or $data_meta = '{"width":"800px","height":"600px"}';
$data_target = '#iCMS-MODAL';
}
}
$fields = array('rootid', 'ordernum', 'app', 'name', 'title', 'href', 'icon', 'class', 'a_class', 'target', 'caret', 'data-toggle', 'data-meta', 'data-target');
$data = compact($fields);
$data['data-toggle'] = $data_toggle;
$data['data-meta'] = $data_meta;
$data['data-target'] = $data_target;
if ($id) {
iDB::update('menu', $data, array('id' => $id));
$msg = "编辑完成!";
} else {
iDB::insert('menu', $data);
$msg = "添加完成!";
}
iACP::$menu->cache();
iPHP::success($msg, 'url:' . APP_URI . '&do=manage');
}
示例13: foreach
$setting['router']['tag_url'] = $router_url;
$setting['FS']['url'] = $router_url . '/res/';
$setting['template']['mobile']['domain'] = $router_url;
$setting['template']['device'][0]['domain'] = $router_url;
foreach ($setting as $n => $v) {
is_array($v) && ($v = addslashes(serialize($v)));
iDB::query("UPDATE `#iCMS@__config` SET `value` = '{$v}' WHERE `appid` ='0' AND `name` ='{$n}'");
}
$output = "<?php\ndefined('iPHP') OR exit('Access Denied');\nreturn ";
$output .= var_export($setting, true);
$output .= ';';
iFS::write(iPATH . 'conf/iCMS/config.php', $output, false);
//写入数据库配置<hr />开始安装数据库<hr />数据库安装完成<hr />设置超级管理员<hr />更新网站缓存<hr />
iFS::write($lock_file, 'iCMS.' . time(), false);
iFS::rmdir(iPATH . 'install');
iPHP::success("安装完成", 'js:top.install.step4();');
}
function run_query($sql)
{
$sql = str_replace("\r", "\n", $sql);
$resource = array();
$num = 0;
$sql_array = explode(";\n", trim($sql));
foreach ($sql_array as $query) {
$queries = explode("\n", trim($query));
foreach ($queries as $query) {
$resource[$num] .= $query[0] == '#' ? '' : $query;
}
$num++;
}
unset($sql);
示例14: do_artCount
function do_artCount($dialog = true)
{
$app = iACP::app('category');
$app->recount();
$dialog && iPHP::success('更新完成');
}
示例15: do_del
function do_del($uid = null, $dialog = true)
{
$uid === null && ($uid = $this->uid);
$uid or iPHP::alert('请选择要删除的用户');
iDB::query("DELETE FROM `#iCMS@__user` WHERE `uid` = '{$uid}'");
iDB::query("DELETE FROM `#iCMS@__prop_map` WHERE `iid` = '{$uid}' AND `appid` = '" . iCMS_APP_USER . "' ;");
$dialog && iPHP::success('用户删除完成', 'js:parent.$("#tr' . $uid . '").remove();');
}