优化amp转化程序

hotfix/远程访问多媒体中心
cyc 6 years ago
parent 2b66a65123
commit 1ef23a171b

@ -16,17 +16,11 @@ class Index_gm extends CI_Controller
//选择处理方式
public function choose_way(){
/*$this->htmlsource = $this->input->post('htmlsource');
$this->htmlsource = $this->input->post('htmlsource');
$this->websitehost = $this->input->post('websitehost');
$this->template_name = $this->input->post('template_name');
$this->create_amp = $this->input->post('create_amp');
$this->debug = $this->input->post('debug');*/
$this->htmlsource = file_get_contents('amp.htm');
$this->websitehost = 'https://data.chinarundreisen.com';
$this->template_name = 'gm';
$this->create_amp = 'true';
$this->debug = 'false';
$this->debug = $this->input->post('debug');
if (empty($this->htmlsource) || empty($this->websitehost)) {
$this->output->set_status_header(500);
@ -325,13 +319,12 @@ class Index_gm extends CI_Controller
return FALSE;
}
$style_content = str_replace('!important', '', $optimize_css);
$style_content = str_replace('@charset "utf-8";', '', $optimize_css);
$optimize_css = str_replace('!important', '', $optimize_css);
$optimize_css = str_replace('@charset "utf-8";', '', $optimize_css);
$amp_template = str_replace('/*@CUSTOM-CSS@*/', $optimize_css, $amp_template);
//替换掉写在组件上的样式
$amp_template = preg_replace('/style=.+?[\'|"]/i', '', $amp_template);
echo $amp_template;die();
echo json_encode(array('result' => 'ok', 'data' => array('amp' => $amp_template)));
}

Loading…
Cancel
Save