|
|
@ -146,38 +146,108 @@ class Welcome extends CI_Controller {
|
|
|
|
$img->setAttribute('src', $img_src);
|
|
|
|
$img->setAttribute('src', $img_src);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$information->ic_content = $htm_doc->saveHTML();
|
|
|
|
$anchor_list = $htm_doc->getElementsByTagName('a');
|
|
|
|
$this->InfoContents_model->Update(
|
|
|
|
foreach ($anchor_list as $anchor) {
|
|
|
|
$information->ic_id,
|
|
|
|
$a_href = $anchor->getAttribute('href');
|
|
|
|
$information->ic_url,
|
|
|
|
echo 'a.href: '.$a_href.'<br>';
|
|
|
|
$information->ic_url_title,
|
|
|
|
|
|
|
|
$information->ic_type,
|
|
|
|
|
|
|
|
$information->ic_title,
|
|
|
|
|
|
|
|
$information->ic_content,
|
|
|
|
|
|
|
|
$information->ic_summary,
|
|
|
|
|
|
|
|
$information->ic_seo_title,
|
|
|
|
|
|
|
|
$information->ic_seo_description,
|
|
|
|
|
|
|
|
$information->ic_seo_keywords,
|
|
|
|
|
|
|
|
$information->ic_show_bread_crumbs,
|
|
|
|
|
|
|
|
$information->ic_status,
|
|
|
|
|
|
|
|
$information->ic_template,
|
|
|
|
|
|
|
|
$information->ic_photo,
|
|
|
|
|
|
|
|
$information->ic_photo_width,
|
|
|
|
|
|
|
|
$information->ic_photo_height,
|
|
|
|
|
|
|
|
$information->ic_recommend_tours,
|
|
|
|
|
|
|
|
$information->ic_recommend_packages,
|
|
|
|
|
|
|
|
$information->ic_ht_area_id,
|
|
|
|
|
|
|
|
$information->ic_ht_area_type,
|
|
|
|
|
|
|
|
$information->ic_ht_product_id,
|
|
|
|
|
|
|
|
$information->ic_ht_product_type,
|
|
|
|
|
|
|
|
$information->ic_author);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->echo_json(array(
|
|
|
|
$match_result = array();
|
|
|
|
'status' => 'ok',
|
|
|
|
preg_match('/^http:\/\/www.chinahighlights.com(.*)/', $a_href, $match_result);
|
|
|
|
'infoId' => $info_id,
|
|
|
|
$result_count = count($match_result);
|
|
|
|
'message' => 'success',
|
|
|
|
if ($result_count == 2) {
|
|
|
|
'date' => date('Y-m-d h:i:s')
|
|
|
|
$result = '//www.chinahighlights.com'.$match_result[1];
|
|
|
|
));
|
|
|
|
$anchor->setAttribute('href', $result);
|
|
|
|
|
|
|
|
echo $result.'<br>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $information->ic_content = $htm_doc->saveHTML();
|
|
|
|
|
|
|
|
// $this->InfoContents_model->Update(
|
|
|
|
|
|
|
|
// $information->ic_id,
|
|
|
|
|
|
|
|
// $information->ic_url,
|
|
|
|
|
|
|
|
// $information->ic_url_title,
|
|
|
|
|
|
|
|
// $information->ic_type,
|
|
|
|
|
|
|
|
// $information->ic_title,
|
|
|
|
|
|
|
|
// $information->ic_content,
|
|
|
|
|
|
|
|
// $information->ic_summary,
|
|
|
|
|
|
|
|
// $information->ic_seo_title,
|
|
|
|
|
|
|
|
// $information->ic_seo_description,
|
|
|
|
|
|
|
|
// $information->ic_seo_keywords,
|
|
|
|
|
|
|
|
// $information->ic_show_bread_crumbs,
|
|
|
|
|
|
|
|
// $information->ic_status,
|
|
|
|
|
|
|
|
// $information->ic_template,
|
|
|
|
|
|
|
|
// $information->ic_photo,
|
|
|
|
|
|
|
|
// $information->ic_photo_width,
|
|
|
|
|
|
|
|
// $information->ic_photo_height,
|
|
|
|
|
|
|
|
// $information->ic_recommend_tours,
|
|
|
|
|
|
|
|
// $information->ic_recommend_packages,
|
|
|
|
|
|
|
|
// $information->ic_ht_area_id,
|
|
|
|
|
|
|
|
// $information->ic_ht_area_type,
|
|
|
|
|
|
|
|
// $information->ic_ht_product_id,
|
|
|
|
|
|
|
|
// $information->ic_ht_product_type,
|
|
|
|
|
|
|
|
// $information->ic_author);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $this->echo_json(array(
|
|
|
|
|
|
|
|
// 'status' => 'ok',
|
|
|
|
|
|
|
|
// 'infoId' => $info_id,
|
|
|
|
|
|
|
|
// 'message' => 'success',
|
|
|
|
|
|
|
|
// 'date' => date('Y-m-d h:i:s')
|
|
|
|
|
|
|
|
// ));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function count_http_of_href() {
|
|
|
|
|
|
|
|
$data['all_information'] =
|
|
|
|
|
|
|
|
$this->Information_model->search_all_text($http_host, 2000);
|
|
|
|
|
|
|
|
echo 'count: '.count($data['all_information']).'<br/>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function transform_href_to_https() {
|
|
|
|
|
|
|
|
$http_host = 'http://www.chinahighlights.com/';
|
|
|
|
|
|
|
|
$https_host = 'https://www.chinahighlights.com/';
|
|
|
|
|
|
|
|
$data['all_information'] =
|
|
|
|
|
|
|
|
$this->Information_model->search_all_text($http_host, 50);
|
|
|
|
|
|
|
|
echo 'count: '.count($data['all_information']).'<br/>';
|
|
|
|
|
|
|
|
if (empty($data['all_information'])) {
|
|
|
|
|
|
|
|
echo 'nothing transform to https';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
foreach ($data['all_information'] as $item) {
|
|
|
|
|
|
|
|
echo $item->ic_url.' | '.$item->ic_title.'<br/>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($item->ic_url) || empty($item->ic_type) ||
|
|
|
|
|
|
|
|
empty($item->ic_seo_keywords) || empty($item->ic_seo_title) || empty($item->ic_seo_description)) {
|
|
|
|
|
|
|
|
echo $item->ic_title.' <span style="color: red;">has null value too many.</span> <br/>';
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->Logs_model->backup($item->is_id, $item->ic_content);
|
|
|
|
|
|
|
|
$item->ic_content=str_replace($http_host, $https_host, $item->ic_content);
|
|
|
|
|
|
|
|
$this->InfoContents_model->Update(
|
|
|
|
|
|
|
|
$item->ic_id,
|
|
|
|
|
|
|
|
$item->ic_url,
|
|
|
|
|
|
|
|
$item->ic_url_title,
|
|
|
|
|
|
|
|
$item->ic_type,
|
|
|
|
|
|
|
|
$item->ic_title,
|
|
|
|
|
|
|
|
$item->ic_content,
|
|
|
|
|
|
|
|
$item->ic_summary,
|
|
|
|
|
|
|
|
$item->ic_seo_title,
|
|
|
|
|
|
|
|
$item->ic_seo_description,
|
|
|
|
|
|
|
|
$item->ic_seo_keywords,
|
|
|
|
|
|
|
|
$item->ic_show_bread_crumbs,
|
|
|
|
|
|
|
|
$item->ic_status,
|
|
|
|
|
|
|
|
$item->ic_template,
|
|
|
|
|
|
|
|
$item->ic_photo,
|
|
|
|
|
|
|
|
$item->ic_photo_width,
|
|
|
|
|
|
|
|
$item->ic_photo_height,
|
|
|
|
|
|
|
|
$item->ic_recommend_tours,
|
|
|
|
|
|
|
|
$item->ic_recommend_packages,
|
|
|
|
|
|
|
|
$item->ic_ht_area_id,
|
|
|
|
|
|
|
|
$item->ic_ht_area_type,
|
|
|
|
|
|
|
|
$item->ic_ht_product_id,
|
|
|
|
|
|
|
|
$item->ic_ht_product_type,
|
|
|
|
|
|
|
|
$item->ic_author
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function echo_json($obj) {
|
|
|
|
private function echo_json($obj) {
|
|
|
|