123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- {__NOLAYOUT__}<!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=utf-8" />
- <title>跳转提示</title>
- <link href="__SKIN__/font/css/iconfont.css?v={$version}" rel="stylesheet" />
- <style type="text/css">
- *{ padding: 0; margin: 0; }
- body{ background: #fff; font-family: '微软雅黑'; color: #CCC; font-size: 16px; }
- .system-message{ padding: 24px 30px; margin:auto; border: #e8e8e8 1px solid; top:50%; width:540px; background-color: #fff;box-shadow: 0 0 8px rgba(0,0,0,0.1);border-radius: 4px;overflow: hidden; }
- .system-message h1{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 5px; }
- .system-message .jump{ padding-top: 10px; color: #999;}
- .system-message .success,.system-message .error{ line-height: 1.8em; color: #999; font-size: 36px; font-family: '黑体'; }
- .system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
-
- .system-message .tit{position: relative;height: 50px;line-height: 50px;width: 100%;border-bottom: 1px solid #eee;}
- .system-message .tit i{position: absolute;font-size: 26px;color: #53bb4c;}
- .system-message .tit b{margin: 0 15px 0 25px;font-weight: normal;font-size: 18px;color: #53bb4c;}
- .system-message .tit span{font-size: 14px;margin: 0 10px;color: #999;}
- .system-message ul{margin: 10px auto; overflow: hidden;}
- .system-message ul li{float: left;list-style: none;margin:5px 18px 5px 0;}
- .system-message .buttom{margin: 10px auto; width: 100%; text-align: center; line-height: 40px; color: red;}
- </style>
- <script type="text/javascript">
- var __root_dir__ = "__ROOT_DIR__";
- var __lang__ = "{$admin_lang}";
- </script>
- <script type="text/javascript" src="__STATIC__/common/js/jquery.min.js?v={$version|default='v1.6.4'}"></script>
- <script type="text/javascript">
- $(function(){
- var height2=$('.system-message').height();
- var height1=$(window).height();
- $('.system-message').css('margin-top',((height1-height2)/3)-30);
- });
- </script>
- <script src="__SKIN__/js/global.js?v={$version}"></script>
- <!-- Bootstrap core CSS -->
- <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js"></script>
- <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
- </head>
- <body>
- <div style="display: block;height: 10px;background: #f4f4f4;clear: both;"></div>
- {switch name="$code"}
- {case value="1"}
- {php}
- $post = $_POST;
- isset($post['typeid']) && $post['tid'] = $post['typeid'];
- if (!empty($data) && is_array($data)) {
- $post = array_merge($post, $data);
- }
- $data = $post;
- $row = \think\Db::name('archives')
- ->field("b.*, a.*, a.aid as aid, c.ifsystem")
- ->alias('a')
- ->join('__ARCTYPE__ b', 'a.typeid = b.id', 'LEFT')
- ->join('__CHANNELTYPE__ c', 'c.id = a.channel', 'LEFT')
- ->where('a.aid', 'eq', $data['aid'])
- ->find();
- $arcurl = get_arcurl($row);
- $arcurl_home = get_arcurl($row, false);
- $channel = $row['channel'];
- $arcrank = $row['arcrank'];
- $seo_pseudo = tpCache('seo.seo_pseudo');
- $lang = input('param.lang/s', 'cn');
- $gourl = cookie('ENV_GOBACK_URL');
- $gourl = preg_replace('/<script([^\>]*)>([\s\S]+)<\/script>/i', '', urldecode($gourl));
- $addurl = request()->baseFile()."?m=admin&c=Archives&a=add&typeid=".$data['tid']."&lang=".$lang;
- $env_list_url = cookie('ENV_LIST_URL');
- $env_list_url = preg_replace('/<script([^\>]*)>([\s\S]+)<\/script>/i', '', urldecode($env_list_url));
- $listurl = $env_list_url."&typeid=".$data['tid'];
- if (empty($row['ifsystem'])) {
- $listurl .= "&channel=".$data['channel'];
- $addurl .= "&channel=".$data['channel'];
- }
- $env_is_uphtml = cookie('ENV_IS_UPHTML');
- $action_name = $push_zzbaidu_type = request()->action();
- $ctl_name = request()->controller();
- if ('add' == $action_name) {
- $msg = '发布';
- $msg1 = '继续发布';
- } else {
- $msg = '编辑';
- $msg1 = '发布';
- }
- if (0 > $row['click'] && -1 < $arcrank) {
- $push_zzbaidu_type = 'add';
- \think\Db::name('archives')
- ->where('aid', 'eq', $data['aid'])
- ->update(['click'=>mt_rand(500, 1000), 'update_time'=>getTime()]);
- }
- $zzbaidutoken = config('tpcache.sitemap_zzbaidutoken');//不为空则实时推送Url的token
- $bdminipro = \think\Db::name('weapp')->where(['code'=>'BdDiyminipro','status'=>1])->count();//是否安装百度小程序
-
- $seo_uphtml_after = cookie('ENV_UPHTML_AFTER');
- if (!empty($seo_uphtml_after)) {
- $seo_uphtml_after = json_decode($seo_uphtml_after, true);
- $alltypeid = getalltype($data['tid'],'id');
- }
- {/php}
- <div class="system-message">
- <div class="tit">
- <i class="iconfont e-complete"></i><span><b>成功{$msg}文档</b>请选择你的后续操作:</span>
- </div>
- <ul>
- <li><span>{$msg1}文档</span><a href="{$addurl|default=''}" style="display: none;">{$msg1}文档</a></li>
- <li><span>预览文档</span><a href="{$arcurl|default=''}" target="_blank" style="display: none;">预览文档</a></li>
- <li><span>更改文档</span><a href="{$Request.baseFile}?m=admin&c=Archives&a=edit&id={$data['aid']}&typeid={$data['tid']}&lang={$Request.param.lang|default='cn'}" style="display: none;">更改文档</a></li>
- <li><span>文档栏目列表</span><a href="{$listurl|default=''}" style="display: none;">文档栏目列表</a></li>
- {notempty name='$gourl'}
- <li><span>[返回原列表]</span><a href="{$gourl|default=''}" style="display: none;">[返回原列表]</a></li>
- {/notempty}
- </ul>
- {if condition="2 == $seo_pseudo && 1 != $env_is_uphtml"}
- <div class="buttom" id="tips">正在生成当前文档……请勿刷新!</div>
- <input type="hidden" id="is_uphtml" value="1">
- {else /}
- <input type="hidden" id="is_uphtml" value="0">
- {/if}
- </div>
- <script type="text/javascript">
- $(function(){
- var is_uphtml = $('#is_uphtml').val();
- if (0 == is_uphtml) {
- $('.system-message ul li').each(function(i,o){
- $(o).find('span').hide();
- $(o).find('a').show();
- })
- }
- });
- </script>
- {php}
- if (2 == $seo_pseudo && 1 != $env_is_uphtml) {
- cookie('ENV_IS_UPHTML', 1);
- {/php}
- <script type="text/javascript">
- /* 生成静态页面代码 */
- var aid = {$data['aid']|default=0};
- var arcrank = {$arcrank|default=0};
- var typeid = {$data['tid']|default=0};
- var method = "{$data['method']|default=''}";
- var ctl_name = "{$ctl_name}";
- var seo_uphtml_after_home = {$seo_uphtml_after['seo_uphtml_after_home']|default=0};
- var seo_uphtml_after_channel = {$seo_uphtml_after['seo_uphtml_after_channel']|default=0};
- var seo_uphtml_after_pernext = {$seo_uphtml_after['seo_uphtml_after_pernext']|default=0};
- if(aid > 0 && arcrank >= 0){
- $.ajax({
- url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=upHtml&lang="+__lang__+"&id="+aid+"&t_id="+typeid+"&type=view&ctl_name="+ctl_name+"&_ajax=1",
- type:'POST',
- dataType:'json',
- data:{seo_uphtml_after_pernext:seo_uphtml_after_pernext},
- success:function(res){
- layer.closeAll();
- if (arcrank >= 0) {
- // 百度自动推送
- var zzbaidutoken = "{$zzbaidutoken|default=''}";
- if (zzbaidutoken != '') {
- push_zzbaidu('{$arcurl_home}', '{$push_zzbaidu_type}');
- }
- // 更新sitemap.xml地图
- update_sitemap('{$ctl_name}', '{$push_zzbaidu_type}');
- //百度小程序 API 提交 (自动推送)
- var bdminipro = {$bdminipro|default=0};
- if (bdminipro != 0) {
- push_bdminipro(aid, 1);
- }
- }
- uphtml_channel();
- },
- error: function(e){
- layer.closeAll();
- layer.alert('生成文档失败,请手工生成静态!', {icon: 5, title: false});
- },
- complete:function(){
-
- }
- });
- }else{
- $('#tips').html('');
- $('.system-message ul li').each(function(i,o){
- $(o).find('span').hide();
- $(o).find('a').show();
- });
- }
- /* end */
- </script>
- {php}
- } else if (in_array($seo_pseudo, [1,3])) {
- {/php}
- <script type="text/javascript">
- var aid = {$data['aid']|default=0};
- var arcrank = {$arcrank|default=0};
- if(aid > 0 && arcrank >= 0){
- // 百度自动推送
- var zzbaidutoken = "{$zzbaidutoken|default=''}";
- if (zzbaidutoken != '') {
- push_zzbaidu('{$arcurl_home}', '{$push_zzbaidu_type}');
- }
- // 更新sitemap.xml地图
- update_sitemap('{$ctl_name}', '{$push_zzbaidu_type}');
- //百度小程序 API 提交 (自动推送)
- var bdminipro = {$bdminipro|default=0};
- if (bdminipro != 0) {
- push_bdminipro(aid, 1);
- }
- }
- </script>
- {php}
- }
- {/php}
- {/case}
- {case value="0"}
- <div class="system-message">
- <h1 class="glyphicon glyphicon-exclamation-sign" style="color:#F33"></h1>
- <p class="error">
- {if condition="stristr($msg, '__html__')"}
- {$msg|str_replace='__html__','',###}
- {else /}
- {$msg|strip_tags=###}
- {/if}
- </p>
- <p class="detail"></p>
- <p class="jump">页面自动 <a id="href" href="{$url}" target="{empty name='$target'}_self{else /}{$target}{/empty}">跳转</a> 等待时间:<b id="wait">{$wait}</b>
- <script type="text/javascript">
- (function(){
- var wait = document.getElementById('wait'),
- href = document.getElementById('href').href,
- target = document.getElementById('href').target;
- var interval = setInterval(function(){
- var time = --wait.innerHTML;
- if(time <= 0) {
- if ('_parent' == target) {
- parent.location.href = href;
- } else {
- location.href = href;
- }
- clearInterval(interval);
- };
- }, 1000);
- })();
- </script>
- </p>
- </div>
- {/case}
- {/switch}
-
- <script type="text/javascript">
- // 发布/编辑文档后,生成相关栏目
- function uphtml_channel()
- {
- if(method === 'edit'){
- $('#tips').html('');
- $('.system-message ul li').each(function(i,o){
- $(o).find('span').hide();
- $(o).find('a').show();
- })
- return false;
- }
-
- if (0 == seo_uphtml_after_channel) {
- uphtml_index();
- return false;
- }
-
- $('#tips').html('生成文档成功,正在生成栏目……');
-
- setTimeout(function (){
- var alltypeid = {$alltypeid|json_encode};
- for (var i = 0; i < alltypeid.length; i++) {
- $.ajax({
- url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=upHtml&lang="+__lang__+"&id="+aid+"&t_id="+alltypeid[i]+"&type=lists&ctl_name="+ctl_name+"&_ajax=1",
- type:'GET',
- dataType:'json',
- async: false,
- data:{},
- beforeSend:function(){
-
- },
- success:function(res){
-
- },
- error: function(e){
- layer.alert('生成当前栏目失败,请手工生成静态!', {icon: 5, title: false});
- }
- });
- }
- uphtml_index();
- }, 10);
- }
-
- // 发布/编辑文档后,生成首页
- function uphtml_index()
- {
- if (0 == seo_uphtml_after_home) {
- $('#tips').html('');
- $('.system-message ul li').each(function(i,o){
- $(o).find('span').hide();
- $(o).find('a').show();
- })
- return false;
- }
-
- var tips = '';
- if (1 == seo_uphtml_after_channel) {
- tips = '生成相关栏目成功,正在生成首页……';
- } else {
- tips = '生成文档成功,正在生成首页……';
- }
- $('#tips').html(tips);
-
- setTimeout(function (){
- $.ajax({
- url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=upHtml&lang="+__lang__+"&type=index&_ajax=1",
- type:'GET',
- dataType:'json',
- data:{},
- beforeSend:function(){
-
- },
- success:function(res){
- $('#tips').html('');
- $('.system-message ul li').each(function(i,o){
- $(o).find('span').hide();
- $(o).find('a').show();
- })
- },
- error: function(e){
- layer.alert('生成网站首页失败,请手工生成网站首页!', {icon: 5, title: false});
- }
- });
- }, 10);
- }
- </script>
-
- </body>
- </html>
|