全站静态化更新功能

hotfix/远程访问多媒体中心
尹诚诚 8 years ago
parent f6ccbafe34
commit f5d379f96b

1
.gitignore vendored

@ -1,3 +1,4 @@
.idea
.svn/* .svn/*
*/logs/log* */logs/log*
/web.config /web.config

@ -65,25 +65,14 @@ class Welcome extends CI_Controller {
$this->load->view('bootstrap/footer'); $this->load->view('bootstrap/footer');
} }
//获取所有信息+产品url //获取所有信息URL,用来批量静态化更新
public function create_all_urls() { public function create_all_urls() {
set_time_limit(0); set_time_limit(0);
$this->output->enable_profiler(false); $this->output->enable_profiler(false);
$this->Information_model->topNum = false;
$data['all_information'] = $this->Information_model->GetList('ic_status,ic_url,ic_sitecode'); $data['all_information'] = $this->Information_model->GetList('ic_status,ic_url,ic_sitecode');
//系列站产品连接 $this->load->view('bootstrap/header', $data);
$site_code = strtoupper($this->config->item('site_code')); $this->load->view('bootstrap/cache_url', $data);
if (!empty($site_code)) { $this->load->view('bootstrap/footer');
$this->load->helper('file');
$path = APPPATH . '/views/product_urls/updateCache' . $site_code . '.txt';
if (file_exists($path)) {
$data['product_urls'] = read_file($path);
$domain = $this->config->item('site_url');
$data['product_urls'] = str_replace("\n", '<br/>', $data['product_urls']);
$data['product_urls'] = str_replace($domain, $domain . '/index.php/welcome/update_cache/?static_html_url=', $data['product_urls']);
}
}
$this->load->view('none_urls', $data);
} }
//获取某个信息节点和子节点url //获取某个信息节点和子节点url

@ -36,9 +36,9 @@ function batch_update_cache(url, index) {
} }
} }
} }
$(document).ready(function() { //$(document).ready(function() {
batch_update_cache($('#cache_url1').html(),1); //batch_update_cache($('#cache_url1').html(),1);
}); //});
</script> </script>
@ -77,7 +77,7 @@ function batch_update_cache(url, index) {
</div> </div>
<div class="span1"> <div class="span1">
<a href="javascript:void(0);" class="btn btn-danger" onclick="batch_update_cache($('#cache_url1').html(),1);">开始更新</a>
</div> </div>

@ -40,6 +40,7 @@
<li><a href="<?php echo site_url('keyworlds/update_cdn') ?>" target="_blank">CDN定时更新</a> </li> <li><a href="<?php echo site_url('keyworlds/update_cdn') ?>" target="_blank">CDN定时更新</a> </li>
<li><a href="<?php echo site_url('sendmail') ?>" >订单邮件管理</a> </li> <li><a href="<?php echo site_url('sendmail') ?>" >订单邮件管理</a> </li>
<li><a href="http://share.chtcdn.com/info.php/infoshare/" target="_blank" >信息分享平台</a> </li> <li><a href="http://share.chtcdn.com/info.php/infoshare/" target="_blank" >信息分享平台</a> </li>
<li><a href="<?php echo site_url('welcome/create_all_urls') ?>" target="_blank" >全站静态化更新</a> </li>
<li class="divider"></li> <li class="divider"></li>

Loading…
Cancel
Save