diff --git a/application/controllers/import.php b/application/controllers/import.php
index cbe82353..f73a1930 100644
--- a/application/controllers/import.php
+++ b/application/controllers/import.php
@@ -183,6 +183,38 @@ where ic_sitecode=? and ic_url like \'%'.trim($item_url).'%\' order by ic_id asc
}
}
+
+ public function clear_css_html(){
+ $this->HT = $this->load->database('HT', true);
+ $html_string='';
+ $sql= " select top 500 ic_id,ic_url,ic_content from infoContents where ic_sitecode='ch' and (ic_content like '%tourPublishers%' or ic_content like '%class=\"monthWeather\"%') ";
+ $query=$this->HT->query($sql);
+ if($query->num_rows() > 0){
+ foreach ($query->result() as $item) {
+ $html_string=str_replace('class="monthWeather"','class="infotable"' ,$item->ic_content);
+ $html_object=str_get_html( $html_string);
+ if (empty($html_object)) {
+ echo '文件加载失败:'.$item->ic_url.'
';
+ continue;
+ }else{
+ foreach ($html_object->find('.tourPublishers') as $hidden_item) {
+ $hidden_item->outertext = '';
+ }
+ $html_string=$html_object->save();
+ $sql_update='update infoContents set ic_content = N? where ic_id=?';
+ $this->HT->query($sql_update,array($html_string,$item->ic_id));
+ //print_r($this->HT->queries);
+ echo $item->ic_url;echo '
';
+ //echo $html_string;
+ }
+
+ }
+ }else{
+ echo 'done';
+ }
+ }
+
+
public function clear_site()
{
$this->Import_model->import_clear_site();
diff --git a/application/controllers/information.php b/application/controllers/information.php
index 9e5c1811..d7946fea 100644
--- a/application/controllers/information.php
+++ b/application/controllers/information.php
@@ -329,7 +329,9 @@ class Information extends CI_Controller
//获取移动优先的模板,如果有的话
$mobile_first_template_path='mobile_first/'.$this->config->item('site_code');
if(is_file(APPPATH.'views/'.$mobile_first_template_path.EXT)){
- $data['mobile_first_template']=$this->load->view($mobile_first_template_path, '', TRUE);
+ $mobile_template_H1=$this->load->view($mobile_first_template_path.'-h1', '', TRUE);
+ $data['mobile_first_template']=$this->load->view($mobile_first_template_path, '', TRUE);
+ $data['mobile_first_template']=str_replace('', $mobile_template_H1, $data['mobile_first_template']);
}else{
$data['mobile_first_template']='没有找到移动模板';
}
@@ -556,6 +558,7 @@ class Information extends CI_Controller
}
function make_mobile_html(){
+ $data=array();
//获取移动优先的模板,如果有的话
$mobile_first_template_path='mobile_first/'.$this->config->item('site_code');
if(is_file(APPPATH.'views/'.$mobile_first_template_path.EXT)){
@@ -567,7 +570,12 @@ class Information extends CI_Controller
$mobile_template=str_replace('', $this->input->post('ic_seo_description'), $mobile_template);
$mobile_template=str_replace('', $this->input->post('ic_seo_keywords'), $mobile_template);
$mobile_template=str_replace('', $this->input->post('site_url').$this->input->post('ic_url'), $mobile_template);
- $mobile_template=str_replace('', $this->input->post('ic_title'), $mobile_template);
+ //H1模板替换
+ $data['infocategory']=$this->Information_model->Detail($this->input->post('is_parent_id'));//信息所属分类,获取信息父级节点url title
+ $data['author']=$this->Operator_model->get_author_nikename($this->input->post('ic_author'));//获取作者信息
+ $data['ic_title']=$this->input->post('ic_title');
+ $mobile_template_H1=$this->load->view($mobile_first_template_path.'-h1', $data, TRUE);
+ $mobile_template=str_replace('', $mobile_template_H1, $mobile_template);
$mobile_template=str_replace('', $this->input->post('ic_content'), $mobile_template);
// /travelguide/chinese-zodiac/monthly-fortune-for-dog.htm
diff --git a/application/models/operator_model.php b/application/models/operator_model.php
index d86ddfb4..524f933f 100644
--- a/application/models/operator_model.php
+++ b/application/models/operator_model.php
@@ -125,6 +125,25 @@ class Operator_model extends CI_Model
//print_r($this->HT->queries);
return $query->result();
}
+
+ //获取作者的昵称
+ function get_author_nikename($user_code){
+ $sql="
+ SELECT top 1 isnull(UserInfo.NickName,'') as NickName,UserInfo.customPic, UserInfo.userid, UserInfo.sex, UserInfo.Email,Userinfo.intro
+ ,OPI_SN,OPI_Name,OPI_Email,OPI_FirstName,OPI_Code
+ FROM OperatorInfo left JOIN
+ UserInfo ON UserInfo.Email = OperatorInfo.OPI_Email
+ WHERE OperatorInfo.OPI_Code = '{$user_code}'
+
+ ";
+ $query = $this->HT->query($sql);
+ if ($query->num_rows() > 0) {
+ $row = $query->row();
+ return $row;
+ } else {
+ return FALSE;
+ }
+ }
//HT中所有账号
function all()
diff --git a/application/views/mobile_first/ch-h1.php b/application/views/mobile_first/ch-h1.php
new file mode 100644
index 00000000..f9932f9a
--- /dev/null
+++ b/application/views/mobile_first/ch-h1.php
@@ -0,0 +1,23 @@
+