Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

seo.htm 39KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. {include file="public/layout" /}
  2. <body class="bodystyle">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page atta">
  6. {include file="seo/bar" /}
  7. <form method="post" id="handlepost" action="{:url('Seo/handle')}" enctype="multipart/form-data" name="form1">
  8. <div class="ncap-form-default">
  9. <dl class="row">
  10. <dt class="tit">
  11. <label for="seo_pseudo">URL模式</label>
  12. </dt>
  13. <dd class="opt">
  14. {volist name="seo_pseudo_list" id="vo"}
  15. <label>
  16. <input type="radio" name="seo_pseudo" value="{$key}" {if condition='isset($config.seo_pseudo) && $config.seo_pseudo eq $key'}checked="checked"{/if}/>{$vo}&nbsp;
  17. </label>
  18. {/volist}
  19. <input type="hidden" id="seo_pseudo_old" value="{$config.seo_pseudo|default='1'}"/>
  20. <input type="hidden" name="seo_html_arcdir_limit" value="{$seo_html_arcdir_limit}"/>
  21. <input type="hidden" id="seo_inlet" value="{$config.seo_inlet}"/>
  22. <input type="hidden" id="init_html" value="{$init_html|default='1'}"/>
  23. </dd>
  24. </dl>
  25. <dl class="row {if condition='empty($config.seo_pseudo) || 1 != $config.seo_pseudo || (1 == $config.seo_pseudo && 1 == $config.seo_dynamic_format)'}none{/if}" id="dl_seo_dynamic_format">
  26. <dt class="tit">
  27. <label>动态格式</label>
  28. </dt>
  29. <dd class="opt">
  30. <label><input type="radio" name="seo_dynamic_format" value="1" {if condition="!isset($config.seo_dynamic_format) OR $config.seo_dynamic_format eq 1"}checked="checked"{/if}>完全兼容(<a href="javascript:void(0);" onclick="view_exp('view_1_1');">查看例子</a><span id="view_1_1" class="none">:__SITE_URL____ROOT_DIR__/index.php?m=home&amp;c=Lists&amp;a=index&amp;tid=1</span>)</label>&nbsp;
  31. {if condition="isset($config.seo_dynamic_format) AND $config.seo_dynamic_format eq 2"}
  32. <br/>
  33. <label><input type="radio" name="seo_dynamic_format" value="2" checked="checked">部分兼容&nbsp;<font color="red">[部分空间不支持]</font>(<a href="javascript:void(0);" onclick="view_exp('view_1_2');">查看例子</a><span id="view_1_2" class="none">:__SITE_URL____ROOT_DIR__/home/Lists/index.html?tid=1</span>)</label>&nbsp;
  34. {/if}
  35. <span class="err"></span>
  36. <p class="notic"></p>
  37. </dd>
  38. </dl>
  39. <div class="row {if condition='isset($config.seo_pseudo) && $config.seo_pseudo != 2'}none{/if}" id="dl_seo_html_format">
  40. {notempty name="$seo_pseudo_lang"}
  41. <dl class="row">
  42. <dt class="tit">
  43. <label for="seo_pseudo_lang">多语言URL</label>
  44. </dt>
  45. <dd class="opt">
  46. <label><input type="radio" name="seo_pseudo_lang" value="1" {if condition='!isset($seo_pseudo_lang) OR $seo_pseudo_lang neq 3'}checked="checked"{/if}/>动态URL</label>&nbsp;
  47. <label><input type="radio" name="seo_pseudo_lang" value="3" {if condition="isset($seo_pseudo_lang) AND $seo_pseudo_lang eq 3"}checked="checked"{/if}>伪静态化</label>&nbsp;
  48. <span class="err"></span>
  49. <p class="notic"></p>
  50. </dd>
  51. </dl>
  52. {/notempty}
  53. <dl class="row">
  54. <dt class="tit">
  55. <label for="seo_html_arcdir">页面保存目录</label>
  56. </dt>
  57. <dd class="opt">
  58. <input id="seo_html_arcdir" name="seo_html_arcdir" value="{$config.seo_html_arcdir|default=''}" placeholder="留空默认根目录" type="text" />
  59. (如:html)
  60. <p class="notic">填写需要生成静态页面的文件夹名称,不能包含特殊字符,不能和根目录系统文件夹重名</p>
  61. <p class="{empty name='$seo_html_arcdir_1'}none{/empty}" style="color: red;" id="tips_seo_html_arcdir_1">页面将保存在 __SITE_URL____ROOT_DIR__<span id="tips_seo_html_arcdir_2">{$seo_html_arcdir_1|default=''}</span>/</p>
  62. </dd>
  63. </dl>
  64. <dl class="row">
  65. <dt class="tit">
  66. <label>列表页面名称</label>
  67. </dt>
  68. <dd class="opt">
  69. <label><input type="radio" name="seo_html_listname" value="1" {if condition="isset($config.seo_html_listname) && $config.seo_html_listname eq 1"}checked="checked"{/if}>{notempty name='$root_dir'}子目录名称/{/notempty}顶级目录名称/lists_ID.html(<a href="javascript:void(0);" onclick="view_exp('lists_2_1');">查看例子</a><span id="lists_2_1" class="none">:__SITE_URL____ROOT_DIR__<span id="exp_seo_html_arcdir">{$seo_html_arcdir_1}</span>/news/lists_1.html</span>)</label>&nbsp;
  70. <br/>
  71. <label><input type="radio" name="seo_html_listname" value="2" {if condition="!isset($config.seo_html_listname) || $config.seo_html_listname neq 1"}checked="checked"{/if}>{notempty name='$root_dir'}子目录名称/{/notempty}父级目录名称/子目录名称/(<a href="javascript:void(0);" onclick="view_exp('lists_2_2');">查看例子</a><span id="lists_2_2" class="none">:__SITE_URL____ROOT_DIR__<span id="exp_seo_html_arcdir">{$seo_html_arcdir_1}</span>/news/lol/</span>)</label>&nbsp;
  72. <br/>
  73. <label><input type="radio" name="seo_html_listname" value="3" {if condition="isset($config.seo_html_listname) && $config.seo_html_listname eq 3"}checked="checked"{/if}>{notempty name='$root_dir'}子目录名称/{/notempty}子目录名称/(<a href="javascript:void(0);" onclick="view_exp('lists_2_3');">查看例子</a><span id="lists_2_3" class="none">:__SITE_URL____ROOT_DIR__<span id="exp_seo_html_arcdir">{$seo_html_arcdir_1}</span>/lol/</span>)</label>&nbsp;
  74. <span class="err"></span>
  75. <p class="notic"></p>
  76. </dd>
  77. </dl>
  78. <dl class="row">
  79. <dt class="tit">
  80. <label>文档页面名称</label>
  81. </dt>
  82. <dd class="opt">
  83. <label><input type="radio" name="seo_html_pagename" value="1" {if condition="isset($config.seo_html_pagename) && $config.seo_html_pagename eq 1"}checked="checked"{/if}>{notempty name='$root_dir'}子目录名称/{/notempty}顶级目录名称/ID.html(<a href="javascript:void(0);" onclick="view_exp('view_2_3');">查看例子</a><span id="view_2_3" class="none">:__SITE_URL____ROOT_DIR__<span id="exp_seo_html_arcdir">{$seo_html_arcdir_1}</span>/news/10.html</span>)</label>&nbsp;
  84. <br/>
  85. <label><input type="radio" name="seo_html_pagename" value="2" {if condition="!isset($config.seo_html_pagename) || $config.seo_html_pagename neq 1"}checked="checked"{/if}>{notempty name='$root_dir'}子目录名称/{/notempty}父级目录名称/子目录名称/ID.html(<a href="javascript:void(0);" onclick="view_exp('view_2_4');">查看例子</a><span id="view_2_4" class="none">:__SITE_URL____ROOT_DIR__<span id="exp_seo_html_arcdir">{$seo_html_arcdir_1}</span>/news/lol/20.html</span>)</label>&nbsp;
  86. <br/>
  87. <label><input type="radio" name="seo_html_pagename" value="3" {if condition="isset($config.seo_html_pagename) && $config.seo_html_pagename eq 3"}checked="checked"{/if}>{notempty name='$root_dir'}子目录名称/{/notempty}子目录名称/ID.html(<a href="javascript:void(0);" onclick="view_exp('view_2_5');">查看例子</a><span id="view_2_5" class="none">:__SITE_URL____ROOT_DIR__<span id="exp_seo_html_arcdir">{$seo_html_arcdir_1}</span>/lol/20.html</span>)</label>&nbsp;
  88. <span class="err"></span>
  89. <p class="notic"></p>
  90. </dd>
  91. </dl>
  92. </div>
  93. <dl class="row {if condition='isset($config.seo_pseudo) && $config.seo_pseudo != 3'}none{/if}" id="dl_seo_rewrite_format">
  94. <dt class="tit">
  95. <label>URL格式</label>
  96. </dt>
  97. <dd class="opt">
  98. <label>
  99. <input type="radio" name="seo_rewrite_format" {if condition="!isset($config.seo_rewrite_format) OR $config.seo_rewrite_format eq 1"} value="1" checked="checked" {else if condition="isset($config.seo_rewrite_format) AND $config.seo_rewrite_format eq 3" /} value="3" checked="checked" {/if}>目录名称(<a href="javascript:void(0);" onclick="view_exp('view_3_1');">示例</a><span id="view_3_1" class="none">:__SITE_URL____ROOT_DIR__/news/</span>)
  100. </label>&nbsp;
  101. <br/>
  102. <label><input type="radio" name="seo_rewrite_format" value="2" {if condition="isset($config.seo_rewrite_format) AND $config.seo_rewrite_format eq 2"}checked="checked"{/if}>模型标识(<a href="javascript:void(0);" onclick="view_exp('view_3_2');">示例</a><span id="view_3_2" class="none">:__SITE_URL____ROOT_DIR__/article/news.html</span>)</label>&nbsp;
  103. <span class="err"></span>
  104. <p class="notic"></p>
  105. </dd>
  106. </dl>
  107. <dl class="row {if condition='!isset($config.seo_pseudo) OR $config.seo_pseudo != 3 OR $config.seo_rewrite_format == 2'}none{/if}" id="dl_seo_rewrite_view_format">
  108. <dt class="tit">
  109. <label>文档隶属URL</label>
  110. </dt>
  111. <dd class="opt">
  112. <label><input type="radio" name="seo_rewrite_view_format" value="1" {if condition="(!isset($config.seo_rewrite_format) OR $config.seo_rewrite_format eq 1) OR (!isset($config.seo_rewrite_view_format) OR $config.seo_rewrite_view_format == 1)"}checked="checked"{/if}>父目录</label>&nbsp;
  113. <label><input type="radio" name="seo_rewrite_view_format" value="3" {if condition="(isset($config.seo_rewrite_format) AND $config.seo_rewrite_format eq 3) OR $config.seo_rewrite_view_format == 3"}checked="checked"{/if}>当前目录</label>&nbsp;
  114. <span class="err"></span>
  115. <p class="notic"></p>
  116. </dd>
  117. </dl>
  118. <dl class="row">
  119. <dt class="tit">
  120. <label>栏目标题格式</label>
  121. </dt>
  122. <dd class="opt">
  123. <label><input type="radio" name="seo_liststitle_format" value="1" {if condition="isset($config.seo_liststitle_format) AND $config.seo_liststitle_format eq 1"}checked="checked"{/if}>栏目名称_第N页</label>&nbsp;
  124. <br/>
  125. <label><input type="radio" name="seo_liststitle_format" value="2" {if condition="!isset($config.seo_liststitle_format) OR $config.seo_liststitle_format eq 2"}checked="checked"{/if}>栏目名称_第N页_网站名称</label>&nbsp;
  126. <span class="err"></span>
  127. <p class="notic"></p>
  128. </dd>
  129. </dl>
  130. <dl class="row">
  131. <dt class="tit">
  132. <label>文档标题格式</label>
  133. </dt>
  134. <dd class="opt">
  135. <label><input type="radio" name="seo_viewtitle_format" value="1" {if condition="isset($config.seo_viewtitle_format) AND $config.seo_viewtitle_format eq 1"}checked="checked"{/if}>内容标题</label>&nbsp;
  136. <br/>
  137. <label><input type="radio" name="seo_viewtitle_format" value="2" {if condition="!isset($config.seo_viewtitle_format) OR $config.seo_viewtitle_format eq 2"}checked="checked"{/if}>内容标题_网站名称</label>&nbsp;
  138. <br/>
  139. <label><input type="radio" name="seo_viewtitle_format" value="3" {if condition="isset($config.seo_viewtitle_format) AND $config.seo_viewtitle_format eq 3"}checked="checked"{/if}>内容标题_栏目名称_网站名称</label>&nbsp;
  140. <span class="err"></span>
  141. <p class="notic"></p>
  142. </dd>
  143. </dl>
  144. <!-- <dl class="row {if condition="empty($config['seo_inlet']) OR (1 == $config['seo_inlet'] AND 1 == $config['seo_force_inlet'])"}{else /}none{/if}" id="dl_seo_force_inlet"> -->
  145. <dl class="row none" id="dl_seo_force_inlet">
  146. <dt class="tit">
  147. <label for="site_url">强制去除index.php</label>
  148. </dt>
  149. <dd class="opt">
  150. <div class="onoff">
  151. <label for="seo_force_inlet1" class="cb-enable {if condition='isset($config.seo_force_inlet) && $config.seo_force_inlet eq 1'}selected{/if}">开启</label>
  152. <label for="seo_force_inlet0" class="cb-disable {if condition='empty($config.seo_force_inlet)'}selected{/if}">关闭</label>
  153. <input id="seo_force_inlet1" name="seo_force_inlet" value="1" type="radio" {if condition="isset($config.seo_force_inlet) && $config.seo_force_inlet eq 1"} checked="checked"{/if}>
  154. <input id="seo_force_inlet0" name="seo_force_inlet" value="0" type="radio" {if condition="empty($config.seo_force_inlet)"} checked="checked"{/if}>
  155. </div>
  156. <br/>
  157. <p class=""></p>
  158. </dd>
  159. </dl>
  160. <div class="bot">
  161. <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="adsubmit();">确认提交</a>
  162. </div>
  163. </div>
  164. </form>
  165. </div>
  166. <script type="text/javascript">
  167. $(function(){
  168. $('input[name=seo_pseudo]').click(function(){
  169. var _this = this;
  170. $('#dl_seo_dynamic_format').hide();
  171. $('#dl_seo_html_format').hide();
  172. // $('#tab_base_html').attr('style','display:none!important');
  173. $('#dl_seo_rewrite_format').hide();
  174. $('#seo_right_uphtml').hide();
  175. var seo_pseudo = $(_this).val();
  176. if (1 == seo_pseudo) {
  177. $('#dl_seo_rewrite_view_format').hide();
  178. if (1 != $('input[name=seo_dynamic_format]:checked').val()) {
  179. $('#dl_seo_dynamic_format').show();
  180. }
  181. if (1 != $('#seo_inlet').val()) {
  182. $('#dl_seo_force_inlet').show();
  183. } else {
  184. $('#dl_seo_force_inlet').hide();
  185. }
  186. } else if (2 == seo_pseudo) {
  187. $('#dl_seo_force_inlet').hide();
  188. $('#dl_seo_rewrite_view_format').hide();
  189. msg = "静态模式下注意几点:<br/>1、修改模板记得生成<br/>2、更新后台数据记得生成<br/>3、安装的插件需要更新至最新版本";
  190. layer.alert(msg, {icon: 6, closeBtn:false, title: false});
  191. $('#dl_seo_html_format').show();
  192. // $('#tab_base_html').show();
  193. $('#seo_right_uphtml').show();
  194. } else {
  195. $('#dl_seo_rewrite_format').show();
  196. var seo_rewrite_format = $('input[name=seo_rewrite_format]:checked').val();
  197. if (seo_rewrite_format == 1) {
  198. $('#dl_seo_rewrite_view_format').show();
  199. } else {
  200. $('#dl_seo_rewrite_view_format').hide();
  201. }
  202. if (1 != $('#seo_inlet').val()) {
  203. $('#dl_seo_force_inlet').show();
  204. } else {
  205. $('#dl_seo_force_inlet').hide();
  206. }
  207. }
  208. var seo_pseudo_old = $('#seo_pseudo_old').val();
  209. if (3 == seo_pseudo) {
  210. layer_loading('正在检测');
  211. $.ajax({
  212. url: "{:url('Seo/ajax_checkHtmlDirpath')}",
  213. type: "POST",
  214. dataType: "json",
  215. data: {seo_pseudo_new:seo_pseudo, _ajax:1},
  216. // async: true,
  217. success: function(res){
  218. layer.closeAll();
  219. if (res.code == 0) {
  220. layer.msg(res.msg, {icon: 5, time: 1500});
  221. } else {
  222. if (res.data.msg != '') {
  223. $('input[name=seo_pseudo]').each(function(i,o){
  224. if($(o).val() == seo_pseudo_old){
  225. $(o).attr('checked',true);
  226. } else {
  227. $(o).attr('checked',false);
  228. }
  229. })
  230. $('#dl_seo_html_format').show();
  231. $('#seo_right_uphtml').show();
  232. // $('#tab_base_html').show();
  233. var seo_pseudo = $(_this).val();
  234. //询问框
  235. var height = res.data.height + 116;
  236. if (350 <= height) height = 350;
  237. var confirm1 = layer.confirm(res.data.msg, {
  238. title: false
  239. ,area: ['320px', height+'px']
  240. ,btn: ['手工删除','自动删除'] //按钮
  241. }, function(){
  242. layer.close(confirm1);
  243. }, function(){
  244. layer_loading('正在处理');
  245. $.ajax({
  246. url: "{:url('Seo/ajax_delHtmlDirpath')}",
  247. type: "POST",
  248. dataType: "json",
  249. data: {_ajax:1},
  250. success: function(res){
  251. layer.closeAll();
  252. if (1 == res.code) {
  253. $('input[name=seo_pseudo]').each(function(i,o){
  254. if($(o).val() == seo_pseudo){
  255. $(o).attr('checked',true);
  256. } else {
  257. $(o).attr('checked',false);
  258. }
  259. })
  260. $('#dl_seo_html_format').hide();
  261. $('#seo_right_uphtml').hide();
  262. // $('#tab_base_html').attr('style','display:none!important');
  263. layer.msg(res.msg, {icon: 1, time: 1500});
  264. } else {
  265. layer.alert(res.data.msg, {icon: 5, title: false});
  266. }
  267. },
  268. error: function(e){
  269. layer.closeAll();
  270. layer.alert(e.responseText, {icon: 5, title:false});
  271. }
  272. })
  273. }
  274. );
  275. }
  276. }
  277. },
  278. error: function(e){
  279. layer.closeAll();
  280. layer.alert(e.responseText, {icon: 5, title:false});
  281. }
  282. });
  283. }
  284. });
  285. $('input[name=seo_rewrite_format]').click(function(){
  286. var seo_rewrite_format = $(this).val();
  287. if (1 == seo_rewrite_format || 3 == seo_rewrite_format) {
  288. $('#dl_seo_rewrite_view_format').show();
  289. } else {
  290. $('#dl_seo_rewrite_view_format').hide();
  291. }
  292. });
  293. $('#seo_html_arcdir').keyup(function(){
  294. var seo_html_arcdir = $(this).val();
  295. if (seo_html_arcdir != '') {
  296. if (seo_html_arcdir.substr(0,1) == '/') seo_html_arcdir = seo_html_arcdir.substr(1);
  297. seo_html_arcdir = '/' + seo_html_arcdir;
  298. $('#tips_seo_html_arcdir_1').show();
  299. $('#tips_seo_html_arcdir_2').html(seo_html_arcdir);
  300. } else {
  301. $('#tips_seo_html_arcdir_1').hide();
  302. }
  303. $('#exp_seo_html_arcdir').html(seo_html_arcdir);
  304. });
  305. $('input[name="seo_force_inlet"]').click(function(){
  306. if (1 == $(this).val()) {
  307. layer.open({
  308. type: 2,
  309. title: false,
  310. area: ['0px', '0px'],
  311. shade: 0.0,
  312. closeBtn: 0,
  313. shadeClose: true,
  314. content: '//{$Request.host}__ROOT_DIR__/api/Rewrite/testing.html',
  315. success: function(layero, index){
  316. layer.close(index);
  317. var body = layer.getChildFrame('body', index);
  318. var content = body.html();
  319. if (content.indexOf("Congratulations on passing") == -1)
  320. {
  321. $('label[for=seo_force_inlet1]').removeClass('selected');
  322. $('#seo_force_inlet1').attr('checked','');
  323. $('label[for=seo_force_inlet0]').addClass('selected');
  324. $('#seo_force_inlet0').attr('checked','checked');
  325. layer.alert('不支持去除index.php,请<a href="javascript:void(0);" onclick="layer.closeAll();click_to_eyou_1575506523(\'https://www.eyoucms.com/plus/view.php?aid=7874\',\'去掉URL中的index.php教程\');">点击查看教程</a>', {icon: 2, title:false});
  326. }
  327. }
  328. });
  329. }
  330. });
  331. checkInlet();
  332. // 自动检测隐藏index.php
  333. function checkInlet() {
  334. if (2 == $('input[name=seo_pseudo]:checked').val()) {
  335. $('#dl_seo_force_inlet').hide();
  336. }
  337. layer.open({
  338. type: 2,
  339. title: false,
  340. area: ['0px', '0px'],
  341. shade: 0.0,
  342. closeBtn: 0,
  343. shadeClose: true,
  344. content: '//{$Request.host}__ROOT_DIR__/api/Rewrite/setInlet.html',
  345. success: function(layero, index){
  346. layer.close(index);
  347. var body = layer.getChildFrame('body', index);
  348. var content = body.html();
  349. if (content.indexOf("Congratulations on passing") == -1)
  350. {
  351. $('#seo_inlet').val(0);
  352. $('label[for=seo_force_inlet1]').removeClass('selected');
  353. $('#seo_force_inlet1').attr('checked','');
  354. $('label[for=seo_force_inlet0]').addClass('selected');
  355. $('#seo_force_inlet0').attr('checked','checked');
  356. if (2 != $('input[name=seo_pseudo]:checked').val()) {
  357. $('#dl_seo_force_inlet').show();
  358. }
  359. $.ajax({
  360. type : "POST",
  361. url : "__ROOT_DIR__/index.php?m=api&c=Rewrite&a=setInlet",
  362. data : {seo_inlet:0,_ajax:1},
  363. dataType : "JSON",
  364. success: function(res) {
  365. }
  366. });
  367. } else {
  368. $('#seo_inlet').val(1);
  369. $('#dl_seo_force_inlet').hide();
  370. $('label[for=seo_force_inlet0]').removeClass('selected');
  371. $('#seo_force_inlet0').attr('checked','');
  372. $('label[for=seo_force_inlet1]').addClass('selected');
  373. $('#seo_force_inlet1').attr('checked','checked');
  374. }
  375. }
  376. });
  377. }
  378. });
  379. function adsubmit(){
  380. if($("input[name='seo_pseudo']:checked").val() == '2'){
  381. var seo_html_arcdir = $('input[name="seo_html_arcdir"]').val();
  382. if (seo_html_arcdir != '') {
  383. seo_html_arcdir = seo_html_arcdir_new = seo_html_arcdir.replace('\\', '/');
  384. var reg = /^([0-9a-zA-Z\_\-\/]+)$/;
  385. if (seo_html_arcdir != '/' && reg.test(seo_html_arcdir)) {
  386. // 去掉最前面的斜杆
  387. if (seo_html_arcdir_new.substr(0,1) == '/') seo_html_arcdir_new = seo_html_arcdir_new.substr(1);
  388. var html_arcdir_arr = seo_html_arcdir_new.split("/");
  389. var html_arcdir_one = html_arcdir_arr[0]; // 一级路径名
  390. var seo_html_arcdir_limit = $('input[name="seo_html_arcdir_limit"]').val();
  391. var seo_html_arcdir_limit_arr = seo_html_arcdir_limit.split(",");
  392. if (seo_html_arcdir_limit_arr.indexOf(html_arcdir_one) >= 0){
  393. layer.msg('页面保存路径的目录名 '+html_arcdir_one+' 与内置禁用的重复!', {icon: 2,time: 3000});
  394. $('input[name="seo_html_arcdir"]').focus();
  395. return false;
  396. }
  397. }else{
  398. showErrorMsg('页面保存路径的格式错误!');
  399. $('input[name="seo_html_arcdir"]').focus();
  400. return false;
  401. }
  402. }
  403. }
  404. layer_loading("正在处理");
  405. var init_html = $('#init_html').val();
  406. $.ajax({
  407. url: "{:url('Seo/handle', ['_ajax'=>1])}",
  408. type: 'POST',
  409. dataType: 'json',
  410. data: $('#handlepost').serialize(),
  411. success: function(res){
  412. if (1 == res.code) {
  413. if (2 == init_html || 2 != $("input[name='seo_pseudo']:checked").val()) {
  414. // layer.closeAll();
  415. layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  416. window.location.href = res.url;
  417. });
  418. } else {
  419. layer.closeAll();
  420. var confirm1 = layer.confirm('配置成功,是否要生成整站页面?', {
  421. title: false
  422. ,closeBtn: false
  423. ,btn: ['是','否'] //按钮
  424. }, function(){
  425. var url = eyou_basefile+"?m=admin&c=Seo&a=site&lang="+__lang__;
  426. var index = layer.open({
  427. type: 2,
  428. title: '开始生成',
  429. area: ['500px', '300px'],
  430. fix: false,
  431. maxmin: false,
  432. content: url,
  433. end: function(layero, index){
  434. layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  435. window.location.href = res.url;
  436. });
  437. }
  438. });
  439. }, function(){
  440. layer.msg(res.msg, {icon: 1, time: 1000}, function(){
  441. window.location.href = res.url;
  442. });
  443. }
  444. );
  445. }
  446. } else {
  447. layer.closeAll();
  448. layer.alert(res.msg, {icon: 5, title:false});
  449. }
  450. },
  451. error: function(e){
  452. layer.closeAll();
  453. layer.alert(e.responseText, {icon: 5, title:false});
  454. }
  455. });
  456. }
  457. function view_exp(id)
  458. {
  459. $('#'+id).toggle();
  460. }
  461. </script>
  462. <div class="seo-right {if condition='2 != $config.seo_pseudo'}none{/if}" id="seo_right_uphtml">
  463. <style>
  464. .seo-right{
  465. position: fixed;
  466. top: 70px;
  467. margin-top: 0px;
  468. /* top: 50%;
  469. margin-top: -185px;*/
  470. right: 30px;
  471. width: 350px;
  472. height: 270px;
  473. background-color:#fff;
  474. z-index:666666;
  475. border: 1px solid #ddd;
  476. box-shadow: 0 0 8px rgba(0,0,0,0.1);
  477. border-radius: 4px;
  478. overflow: hidden;
  479. }
  480. .seo-html dt.tit {
  481. width: 60px;
  482. padding-left:20px;
  483. }
  484. </style>
  485. <div class="page">
  486. <form method="get" id="html_handlepost" name="form2">
  487. <div class="ncap-form-default seo-html">
  488. <dl class="row">
  489. <dt class="tit">
  490. <label>整站页面</label>
  491. </dt>
  492. <dd class="opt w0">
  493. <a href="javascript:void(0);" id="up_site" class="ncap-btn ncap-btn-green">一键生成</a>
  494. <span class="err"></span>
  495. <p class="notic"></p>
  496. </dd>
  497. </dl>
  498. <dl class="row">
  499. <dt class="tit">
  500. <label>首页</label>
  501. </dt>
  502. <dd class="opt w0">
  503. <a href="javascript:void(0);" id="up_index" class="ncap-btn ncap-btn-green">一键生成</a>
  504. <span class="err"></span>
  505. <p class="notic"></p>
  506. </dd>
  507. </dl>
  508. <dl class="row">
  509. <dt class="tit">栏目页</dt>
  510. <dd class="opt w0">
  511. <select name="html_typeid" id="html_typeid" style="width: 150px;">
  512. <option value="0">所有栏目…</option>
  513. {$select_html}
  514. </select>
  515. &nbsp;<a href="javascript:void(0);" id="up_channel" class="ncap-btn ncap-btn-green">一键生成</a>
  516. <p class="notic"></p>
  517. </dd>
  518. </dl>
  519. <dl class="row">
  520. <dt class="tit">文档页</dt>
  521. <dd class="opt w0">
  522. <select name="html_arc_typeid" id="html_arc_typeid" style="width: 150px;">
  523. <option value="0">所有文档…</option>
  524. {$arc_select_html}
  525. </select>
  526. &nbsp;<a href="javascript:void(0);" id="up_article" class="ncap-btn ncap-btn-green">一键生成</a>
  527. <p class="notic"></p>
  528. </dd>
  529. </dl>
  530. </div>
  531. </form>
  532. </div>
  533. <script type="text/javascript">
  534. $(function(){
  535. //生成整站
  536. // $("#up_site").click(function(){
  537. // $.ajax({
  538. // url: "{:url('Seo/handle', ['is_Buildmhtml'=>1,'_ajax'=>1])}",
  539. // type: 'POST',
  540. // dataType: 'json',
  541. // data: $('#handlepost').serialize(),
  542. // beforeSend:function(){
  543. // layer_loading('正在处理');
  544. // },
  545. // success: function(res){
  546. // layer.closeAll();
  547. // if (0 == res.code) {
  548. // showErrorAlert(res.msg);
  549. // } else {
  550. // var url = eyou_basefile+"?m=admin&c=Seo&a=site&lang="+__lang__;
  551. // var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  552. // }
  553. // },
  554. // error: function(e){
  555. // layer.closeAll();
  556. // layer.alert(e.responseText, {icon: 5, title:false});
  557. // }
  558. // });
  559. // })
  560. //生成整站
  561. $("#up_site").click(function(){
  562. $.ajax({
  563. url: "{:url('Seom/handle', ['is_buildhtml'=>1,'_ajax'=>1])}",
  564. type: 'POST',
  565. dataType: 'json',
  566. data: $('#handlepost').serialize(),
  567. beforeSend:function(){
  568. layer_loading('正在处理');
  569. },
  570. success: function(res){
  571. layer.closeAll();
  572. if (0 == res.code) {
  573. showErrorAlert(res.msg);
  574. } else {
  575. var url = eyou_basefile+"?m=admin&c=Seom&a=site&uphtmltype=0&lang="+__lang__;
  576. var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  577. }
  578. },
  579. error: function(e){
  580. layer.closeAll();
  581. layer.alert(e.responseText, {icon: 5, title:false});
  582. }
  583. });
  584. })
  585. //生成首页
  586. $("#up_index").click(function(){
  587. $.ajax({
  588. url: "{:url('Seom/handle', ['is_Buildmhtml'=>1,'_ajax'=>1])}",
  589. type: 'POST',
  590. dataType: 'json',
  591. data: $('#handlepost').serialize(),
  592. beforeSend:function(){
  593. layer_loading('正在处理');
  594. },
  595. success: function(res){
  596. if (0 == res.code) {
  597. layer.closeAll();
  598. showErrorAlert(res.msg);
  599. } else {
  600. var timestamp1 = Date.parse(new Date());
  601. $.ajax({
  602. url:__root_dir__+"/index.php?m=home&c=Buildmhtml&a=buildIndex&lang="+__lang__,
  603. type:'POST',
  604. dataType:'json',
  605. data: {_ajax:1},
  606. beforeSend:function(){
  607. // layer_loading('正在处理');
  608. // var index = layer.load(0, {shade: false});
  609. },
  610. success:function(data){
  611. if(data.msg !== ""){
  612. layer.alert(data.msg, {icon: 5, title:false,closeBtn: 0 },function () {
  613. layer.closeAll();
  614. } );
  615. }else{
  616. layer.closeAll();
  617. var timestamp2 = Date.parse(new Date());
  618. var timestamp3 = (timestamp2 - timestamp1) / 1000;
  619. if (timestamp3 < 1) timestamp3 = 1;
  620. layer.msg("生成完毕,共耗时:<font color='red'>"+timestamp3+"</font> 秒",{icon:1,time:2000});
  621. }
  622. },
  623. complete:function(){
  624. // layer.alert(1, {icon: 5, title:false});
  625. },
  626. error: function(e){
  627. layer.closeAll();
  628. showErrorAlert(e.responseText);
  629. }
  630. });
  631. }
  632. },
  633. error: function(e){
  634. layer.closeAll();
  635. showErrorAlert(e.responseText);
  636. }
  637. });
  638. })
  639. //生成栏目页
  640. $("#up_channel").click(function(){
  641. $.ajax({
  642. url: "{:url('Seom/handle', ['is_Buildmhtml'=>1,'_ajax'=>1])}",
  643. type: 'POST',
  644. dataType: 'json',
  645. data: $('#handlepost').serialize(),
  646. beforeSend:function(){
  647. layer_loading('正在处理');
  648. },
  649. success: function(res){
  650. layer.closeAll();
  651. if (0 == res.code) {
  652. showErrorAlert(res.msg);
  653. } else {
  654. var typeid = $("#html_typeid").val(); //栏目id
  655. var url = eyou_basefile+"?m=admin&c=Seom&a=channel&typeid="+typeid+"&lang="+__lang__;
  656. var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  657. }
  658. },
  659. error: function(e){
  660. layer.closeAll();
  661. showErrorAlert(e.responseText);
  662. }
  663. });
  664. })
  665. //生成文章页
  666. $("#up_article").click(function(){
  667. $.ajax({
  668. url: "{:url('Seom/handle', ['is_Buildmhtml'=>1,'_ajax'=>1])}",
  669. type: 'POST',
  670. dataType: 'json',
  671. data: $('#handlepost').serialize(),
  672. beforeSend:function(){
  673. layer_loading('正在处理');
  674. },
  675. success: function(res){
  676. layer.closeAll();
  677. if (0 == res.code) {
  678. showErrorAlert(res.msg);
  679. } else {
  680. var typeid = $("#html_arc_typeid").val(); //栏目id
  681. var url = eyou_basefile+"?m=admin&c=Seom&a=article&typeid="+typeid+"&lang="+__lang__;
  682. var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  683. }
  684. },
  685. error: function(e){
  686. layer.closeAll();
  687. showErrorAlert(e.responseText);
  688. }
  689. });
  690. })
  691. })
  692. </script>
  693. </div>
  694. {include file="public/footer" /}