全站静态化更新功能

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

1
.gitignore vendored

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

@ -65,25 +65,14 @@ class Welcome extends CI_Controller {
$this->load->view('bootstrap/footer');
}
//获取所有信息+产品url
//获取所有信息URL,用来批量静态化更新
public function create_all_urls() {
set_time_limit(0);
$this->output->enable_profiler(false);
$this->Information_model->topNum = false;
$data['all_information'] = $this->Information_model->GetList('ic_status,ic_url,ic_sitecode');
//系列站产品连接
$site_code = strtoupper($this->config->item('site_code'));
if (!empty($site_code)) {
$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);
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/cache_url', $data);
$this->load->view('bootstrap/footer');
}
//获取某个信息节点和子节点url

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

Loading…
Cancel
Save