No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.htm 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. {include file="public/layout" /}
  2. <body class="bodystyle">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page style2021">
  6. <div class="fixed-bar">
  7. <div class="item-title">
  8. <a class="back_xin" href="javascript:history.back();" title="返回"><i class="iconfont e-fanhui"></i></a>
  9. <div class="subject">
  10. <h3>html生成</h3>
  11. <h5></h5>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="flexigrid">
  16. <form class="form-horizontal" name="handlepost" id="handlepost" method="post">
  17. <!-- 一键生成 -->
  18. <div class="hDiv htitx">
  19. <div class="hDivBox">
  20. <table cellspacing="0" cellpadding="0" style="width: 100%">
  21. <thead>
  22. <tr>
  23. <th class="sign w10" axis="col0">
  24. <div class="tc"></div>
  25. </th>
  26. <th abbr="article_title" axis="col3" class="w10">
  27. <div class="tc">一键生成</div>
  28. </th>
  29. <th abbr="ac_id" axis="col4">
  30. <div class=""></div>
  31. </th>
  32. </tr>
  33. </thead>
  34. </table>
  35. </div>
  36. </div>
  37. <div class="ncap-form-default tab_div_1">
  38. <dl class="row">
  39. <dt class="tit">
  40. <label>更新模式</label>
  41. </dt>
  42. <dd class="opt">
  43. <label class="radio-label">
  44. <span> &nbsp; </span>
  45. <input type="radio" class="radio" name="seo_uphtmltype" value="0" checked='checked'>全部页面生成
  46. <span class="check-mark"></span>
  47. </label>&nbsp;
  48. <label class="radio-label">
  49. <span> &nbsp; </span>
  50. <input type="radio" class="radio" name="seo_uphtmltype" value="1">指定时间更新
  51. <span class="check-mark"></span>
  52. </label>&nbsp;
  53. <label class="radio-label">
  54. <span> &nbsp; </span>
  55. <input type="radio" class="radio" name="seo_uphtmltype" value="2">指定ID更新
  56. <span class="check-mark"></span>
  57. </label>&nbsp;
  58. </dd>
  59. </dl>
  60. <dl class="row none" id="dl_seo_start_time_1">
  61. <dt class="tit">
  62. <label for="">起始时间 <p class="notic">即是文档的发布时间</p></label>
  63. </dt>
  64. <dd class="opt">
  65. <input type="text" id="seo_start_time" name="seo_start_time" value="{php}echo date('Y-m-d'){/php}" class="input-txt w300" autocomplete="off">
  66. <span class="add-on input-group-addon">
  67. <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
  68. </span>
  69. <span class="err"></span>
  70. </dd>
  71. </dl>
  72. <dl class="row none" id="dl_seo_start_time_2">
  73. <dt class="tit">
  74. <label for="">起始ID <p class="notic">即是起始的文档ID</p></label>
  75. </dt>
  76. <dd class="opt">
  77. <input type="text" id="seo_startid2" name="seo_startid2" value="0" placeholder="起始的文档ID" title="空或0表示从头开始" class="input-txt w300" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')">
  78. <span class="err"></span>
  79. </dd>
  80. </dl>
  81. <dl class="row">
  82. <dt class="tit">
  83. <label></label>
  84. </dt>
  85. <dd class="opt">
  86. <a class="ncap-btn-big ncap-btn-green mr10" href="javascript:void(0);" id="up_site" >开始生成HTML</a>
  87. </dd>
  88. </dl>
  89. </div>
  90. <!-- 一键生成 -->
  91. <!-- 首页生成 -->
  92. <div class="hDiv htitx">
  93. <div class="hDivBox">
  94. <table cellspacing="0" cellpadding="0" style="width: 100%">
  95. <thead>
  96. <tr>
  97. <th class="sign w10" axis="col0">
  98. <div class="tc"></div>
  99. </th>
  100. <th abbr="article_title" axis="col3" class="w10">
  101. <div class="tc">首页生成</div>
  102. </th>
  103. <th abbr="ac_id" axis="col4">
  104. <div class=""></div>
  105. </th>
  106. </tr>
  107. </thead>
  108. </table>
  109. </div>
  110. </div>
  111. <div class="ncap-form-default tab_div_1">
  112. <dl class="row">
  113. <dt class="tit">
  114. <label for="">首页模板</label>
  115. </dt>
  116. <dd class="opt">
  117. <input type="text" id="seo_html_templet" name="seo_html_templet" value="{$config.seo_html_templet|default='index.htm'}" placeholder="index.htm" class="input-txt w300" maxlength="200" autocomplete="off" readonly="readonly" onkeyup="this.value=this.value.replace(/\\/g,'/');" onpaste="this.value=this.value.replace(/\\/g,'/')"> &nbsp;&nbsp;
  118. <a href="javascript:void(0);" onClick="SelectTemplets('handlepost.seo_html_templet');" class="a-link"><i class="iconfont e-wenjianjia mr3"></i>模板选择</a>
  119. <span class="err"></span>
  120. </dd>
  121. </dl>
  122. <dl class="row">
  123. <dt class="tit">
  124. <label for="">首页位置</label>
  125. </dt>
  126. <dd class="opt">
  127. <input type="text" id="seo_html_position" name="seo_html_position" value="{$config.seo_html_position|default='../index.html'}" placeholder="留空默认根目录" class="input-txt w300" maxlength="200" autocomplete="off" onkeyup="this.value=this.value.replace(/\\/g,'/');" onpaste="this.value=this.value.replace(/\\/g,'/')">
  128. <span class="err"></span>
  129. </dd>
  130. </dl>
  131. <dl class="row">
  132. <dt class="tit">
  133. <label>首页模式</label>
  134. </dt>
  135. <dd class="opt">
  136. <label class="radio-label">
  137. <span> &nbsp; </span>
  138. <input type="radio" class="radio" name="seo_showmod" value="0" {if condition="empty($config.seo_showmod)"}checked='checked'{/if}>动态浏览
  139. <span class="check-mark"></span>
  140. </label>&nbsp;
  141. <label class="radio-label">
  142. <span> &nbsp; </span>
  143. <input type="radio" class="radio" name="seo_showmod" value="1" {if condition="!empty($config.seo_showmod)"}checked='checked'{/if}>生成静态
  144. <span class="check-mark"></span>
  145. </label>&nbsp;
  146. </dd>
  147. </dl>
  148. <dl class="row">
  149. <dt class="tit">
  150. <label></label>
  151. </dt>
  152. <dd class="opt">
  153. <a class="ncap-btn-big ncap-btn-green mr10" href="javascript:void(0);" id="up_index" >更新首页HTML</a>
  154. <a class="a-txt" id="preview_home" target="_blank" href="__ROOT_DIR__/index.php?clear=1&templet=index.htm"><i class="fa fa-home"></i>预览首页</a>
  155. </dd>
  156. </dl>
  157. </div>
  158. <!-- 首页生成 -->
  159. <!-- 栏目生成 -->
  160. <div class="hDiv htitx">
  161. <div class="hDivBox">
  162. <table cellspacing="0" cellpadding="0" style="width: 100%">
  163. <thead>
  164. <tr>
  165. <th class="sign w10" axis="col0">
  166. <div class="tc"></div>
  167. </th>
  168. <th abbr="article_title" axis="col3" class="w10">
  169. <div class="tc">栏目生成</div>
  170. </th>
  171. <th abbr="ac_id" axis="col4">
  172. <div class=""></div>
  173. </th>
  174. </tr>
  175. </thead>
  176. </table>
  177. </div>
  178. </div>
  179. <div class="ncap-form-default tab_div_2" >
  180. <dl class="row">
  181. <dt class="tit">
  182. <label >选择栏目</label>
  183. </dt>
  184. <dd class="opt">
  185. <div class="select w200">
  186. <select name="html_typeid" id="html_typeid" class="w300">
  187. <option value="0">所有栏目…</option>
  188. {$select_html}
  189. </select>
  190. </div>
  191. </dd>
  192. </dl>
  193. <dl class="row">
  194. <dt class="tit">
  195. <label>每页生成</label>
  196. </dt>
  197. <dd class="opt">
  198. <input type="text" id="seo_maxpagesize" name="seo_maxpagesize" value="50" class="input-txt w100" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')"> &nbsp;&nbsp; 个文件
  199. </dd>
  200. </dl>
  201. <dl class="row">
  202. <dt class="tit">
  203. <label>更新子栏目</label>
  204. </dt>
  205. <dd class="opt">
  206. <label class="radio-label">
  207. <span> &nbsp; </span>
  208. <input type="radio" class="radio" checked="checked" name="seo_upnext" value="1" checked='checked'>是
  209. <span class="check-mark"></span>
  210. </label>&nbsp;
  211. <label class="radio-label">
  212. <span> &nbsp; </span>
  213. <input type="radio" class="radio" name="seo_upnext" value="0">否
  214. <span class="check-mark"></span>
  215. </label>&nbsp;
  216. </dd>
  217. </dl>
  218. <dl class="row">
  219. <dt class="tit">
  220. <label></label>
  221. </dt>
  222. <dd class="opt">
  223. <a class="ncap-btn-big ncap-btn-green mr10" href="javascript:void(0);" id="up_channel">开始生成HTML</a>
  224. </dd>
  225. </dl>
  226. </div>
  227. <!-- 栏目生成 -->
  228. <!-- 文档生成 -->
  229. <div class="hDiv htitx">
  230. <div class="hDivBox">
  231. <table cellspacing="0" cellpadding="0" style="width: 100%">
  232. <thead>
  233. <tr>
  234. <th class="sign w10" axis="col0">
  235. <div class="tc"></div>
  236. </th>
  237. <th abbr="article_title" axis="col3" class="w10">
  238. <div class="tc">文档生成</div>
  239. </th>
  240. <th abbr="ac_id" axis="col4">
  241. <div class=""></div>
  242. </th>
  243. </tr>
  244. </thead>
  245. </table>
  246. </div>
  247. </div>
  248. <div class="ncap-form-default tab_div_3" >
  249. <dl class="row">
  250. <dt class="tit">
  251. <label >选择栏目</label>
  252. </dt>
  253. <dd class="opt">
  254. <div class="select w200">
  255. <select name="html_arc_typeid" id="html_arc_typeid" class="w300">
  256. <option value="0">所有文档…</option>
  257. {$select_html}
  258. </select>
  259. </div>
  260. </dd>
  261. </dl>
  262. <dl class="row">
  263. <dt class="tit">
  264. <label>生成ID段 <p class="notic">空或0表示从头开始或结束</p></label>
  265. </dt>
  266. <dd class="opt">
  267. <input type="text" id="seo_startid" value="" name="seo_startid" class="input-txt w100" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')" placeholder="起始ID" title="空或0表示从头开始"> &nbsp;&nbsp;<span style="color: #999;font-weight: bold;font-size:26px;">-</span> &nbsp;&nbsp;
  268. <input type="text" id="seo_endid" value="" name="seo_endid" class="input-txt w100" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')" placeholder="结束ID" title="空或0表示直到结束ID">
  269. <span class="err"></span>
  270. </dd>
  271. </dl>
  272. <dl class="row">
  273. <dt class="tit">
  274. <label>每页生成</label>
  275. </dt>
  276. <dd class="opt">
  277. <input type="text" name="seo_pagesize" id="seo_pagesize" value="20" class="input-txt w100" autocomplete="off" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')"> &nbsp;&nbsp; 个文件
  278. </dd>
  279. </dl>
  280. <dl class="row">
  281. <dt class="tit">
  282. <label></label>
  283. </dt>
  284. <dd class="opt">
  285. <a class="ncap-btn-big ncap-btn-green mr10" href="javascript:void(0);" id="up_article">开始生成HTML</a>
  286. </dd>
  287. </dl>
  288. </div>
  289. </form>
  290. </div>
  291. </div>
  292. <div class="floatNav">
  293. <div class="floatNav-tit">
  294. 快捷导航
  295. </div>
  296. <div class="floatNav-con">
  297. <ul>
  298. <li>
  299. <div class="dot"></div>
  300. <div class="event"><a href="{:url('Seo/seo')}">URL配置</a></div>
  301. </li>
  302. <li>
  303. <div class="dot"></div>
  304. <div class="event"><a href="{:url('Sitemap/index')}">Sitemap</a></div>
  305. </li>
  306. <li>
  307. <div class="dot"></div>
  308. <div class="event"><a href="{:url('Links/index')}">友情链接</a></div>
  309. </li>
  310. </ul>
  311. </div>
  312. </div>
  313. <script>
  314. layui.use('laydate', function() {
  315. var laydate = layui.laydate;
  316. laydate.render({
  317. elem: '#seo_start_time'
  318. ,type: 'date'
  319. });
  320. })
  321. $(function(){
  322. $('input[name=seo_uphtmltype]').click(function(){
  323. var seo_uphtmltype = $(this).val();
  324. $('#dl_seo_start_time_1').hide();
  325. $('#dl_seo_start_time_2').hide();
  326. if (1 == seo_uphtmltype) {
  327. $('#dl_seo_start_time_1').show();
  328. $('#dl_seo_start_time_2').hide();
  329. } else if (2 == seo_uphtmltype) {
  330. $('#dl_seo_start_time_1').hide();
  331. $('#dl_seo_start_time_2').show();
  332. }
  333. });
  334. /**
  335. * 初始化数据缓存
  336. * @return {[type]} [description]
  337. */
  338. function init_data_cache() {
  339. $.ajax({
  340. url : "{:url('Seo/init_data_cache')}",
  341. type: 'post',
  342. data: {'_ajax': 1},
  343. dataType: 'JSON',
  344. success: function(res) {
  345. }
  346. });
  347. }
  348. init_data_cache();
  349. });
  350. //选择首页静态文件
  351. function SelectTemplets(fname)
  352. {
  353. var url = "{:url('Seo/filemanager')}";
  354. //iframe窗
  355. layer.open({
  356. type: 2,
  357. title: '选择主页模板',
  358. fixed: true, //不固定
  359. shadeClose: false,
  360. shade: layer_shade,
  361. maxmin: false, //开启最大化最小化按钮
  362. area: ['80%', '80%'],
  363. content: url
  364. });
  365. }
  366. function check_index_file()
  367. {
  368. var is_index_file = {$is_index_file|default=0};
  369. if (0 == is_index_file) {
  370. showErrorAlert('网站根目录缺少 index.php 文件,请拷贝该文件上传到空间里!');
  371. return false;
  372. }
  373. return true;
  374. }
  375. //生成整站
  376. $("#up_site").click(function(){
  377. if (!check_index_file()) {return false;}
  378. var seo_uphtmltype = $('input[name=seo_uphtmltype]:checked').val();
  379. var seo_maxpagesize = $('input[name=seo_maxpagesize]').val(); // 栏目每页生成文件
  380. var seo_pagesize = $('input[name=seo_pagesize]').val(); // 文档每页生成文件
  381. var seo_start_time = $('input[name=seo_start_time]').val(); //起始时间
  382. var seo_startid2 = $('input[name=seo_startid2]').val(); //起始id
  383. var url = eyou_basefile+"?m=admin&c=Seo&a=site&is_buildhtml=1&uphtmltype="+seo_uphtmltype+"&seo_maxpagesize="+seo_maxpagesize+"&seo_pagesize="+seo_pagesize+"&seo_start_time="+seo_start_time+"&seo_startid2="+seo_startid2+"&lang="+__lang__;
  384. var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  385. })
  386. //生成首页
  387. $("#up_index").click(function(){
  388. if (!check_index_file()) {return false;}
  389. if($('input[name=seo_html_templet]').val() == ''){
  390. showErrorMsg('主页模板不能为空!');
  391. $('input[name=seo_html_templet]').focus();
  392. return false;
  393. }
  394. var seo_showmod = $('input[name=seo_showmod]:checked').val();
  395. var timestamp1 = Date.parse(new Date());
  396. $.ajax({
  397. url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=buildIndex&lang="+__lang__+"&seo_showmod="+seo_showmod+"&_ajax=1",
  398. type:'GET',
  399. dataType:'json',
  400. data: {},
  401. beforeSend:function(){
  402. layer.load(3, {shade: [0.1,'#000']});
  403. },
  404. success:function(res){
  405. layer.closeAll();
  406. if(res.msg !== ""){
  407. if (-1 != res.msg.indexOf('浏览')) {
  408. showErrorAlert(res.msg, 6);
  409. } else {
  410. showErrorAlert(res.msg);
  411. }
  412. }else{
  413. var timestamp2 = Date.parse(new Date());
  414. var timestamp3 = (timestamp2 - timestamp1) / 1000;
  415. if (timestamp3 < 1) timestamp3 = 1;
  416. layer.msg("生成完毕,共耗时:<font color='red'>"+timestamp3+"</font> 秒",{icon:1,time:2000});
  417. }
  418. },
  419. complete:function(){
  420. },
  421. error: function(e){
  422. layer.closeAll();
  423. showErrorAlert(e.responseText);
  424. }
  425. });
  426. });
  427. //生成栏目页
  428. $("#up_channel").click(function(){
  429. if (!check_index_file()) {return false;}
  430. var typeid = $("#html_typeid").val(); //栏目id
  431. var seo_maxpagesize = $('input[name=seo_maxpagesize]').val(); // 每页生成文件
  432. var seo_upnext = $('input[name=seo_upnext]:checked').val(); // 是否更新子栏目
  433. var url = eyou_basefile+"?m=admin&c=Seo&a=channel&typeid="+typeid+"&is_buildhtml=1&seo_maxpagesize="+seo_maxpagesize+"&seo_upnext="+seo_upnext+"&lang="+__lang__;
  434. var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  435. });
  436. //生成文章页
  437. $("#up_article").click(function(){
  438. if (!check_index_file()) {return false;}
  439. var typeid = $("#html_arc_typeid").val(); //栏目id
  440. var seo_startid = $('input[name=seo_startid]').val(); // 文档ID开始
  441. var seo_endid = $('input[name=seo_endid]').val(); // 文档ID结束
  442. var seo_pagesize = $('input[name=seo_pagesize]').val(); // 每页生成文件
  443. var url = eyou_basefile+"?m=admin&c=Seo&a=article&uphtmltype=1&typeid="+typeid+"&is_buildhtml=1&seo_startid="+seo_startid+"&seo_endid="+seo_endid+"seo_pagesize="+seo_pagesize+"&lang="+__lang__;
  444. var index = layer.open({type: 2,title: '开始生成',area: ['500px', '300px'],fix: false, maxmin: false,content: url});
  445. });
  446. </script>
  447. {include file="public/footer" /}