Merge branch 'master' of gitee.com:hainatravel/information-system

hotfix/远程访问多媒体中心
lyt 7 years ago
commit 40c6e67710

@ -22,7 +22,7 @@ class Information extends CI_Controller {
$this->load->model('InfoSMS_model'); $this->load->model('InfoSMS_model');
if (is_series_site()) { if (is_series_site()) {
$this->load->model('InfoTags_model'); //$this->load->model('InfoTags_model');
} }
$this->load->library('Accesscheck'); $this->load->library('Accesscheck');
@ -271,10 +271,10 @@ class Information extends CI_Controller {
$data['all_tags'] = array(); $data['all_tags'] = array();
if (is_series_site()) { if (is_series_site()) {
//信息标签 //信息标签
$this->InfoTags_model->ic_id = null; //$this->InfoTags_model->ic_id = null;
$data['all_tags'] = $this->InfoTags_model->list_tag(); //$data['all_tags'] = $this->InfoTags_model->list_tag();
$this->InfoTags_model->ic_id = $data['information']->ic_id; //$this->InfoTags_model->ic_id = $data['information']->ic_id;
$data['my_tags'] = $this->InfoTags_model->list_tag(); //$data['my_tags'] = $this->InfoTags_model->list_tag();
//差集 //差集
foreach ($data['all_tags'] as &$it) foreach ($data['all_tags'] as &$it)
{ {

@ -195,10 +195,90 @@ class Welcome extends CI_Controller {
// )); // ));
} }
public function count_redirect_nofollow() {
$include_redirece_info =
$this->Information_model->search_all_text('&t=78002', 2000);
echo 'redirect count: '.count($include_redirece_info).'<br/>';
$redirect_nofollow_list = array();
$htm_doc = new DOMDocument();
$htm_doc->encoding='UTF-8';
libxml_use_internal_errors(true);
$htm_doc->strictErrorChecking = false;
foreach ($include_redirece_info as $info) {
$htm_doc->loadHTML(
mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
$htm_doc->normalizeDocument();
$anchor_list = $htm_doc->getElementsByTagName('a');
foreach ($anchor_list as $anchor) {
$a_href = $anchor->getAttribute('href');
$a_rel = $anchor->getAttribute('rel');
$match_result = array();
preg_match('/.*&t=78002$/', $a_href, $match_result);
$result_count = count($match_result);
if ($result_count > 0 && $a_rel != 'nofollow') {
echo $info->ic_url.' | '.'('.$info->ic_id.','.$info->is_id.')'.'<br/>';
echo 'a.href: '.$a_href.'; rel: '.$a_rel.'<br>';
$redirect_nofollow_list[] = $info;
}
}
}
echo 'nofollow_count: '.count($redirect_nofollow_list).'<br/>';
return $redirect_nofollow_list;
}
public function transform_redirect_nofollow() {
$redirect_nofollow_list = $this->count_redirect_nofollow();
$htm_doc = new DOMDocument();
$htm_doc->encoding='UTF-8';
libxml_use_internal_errors(true);
$htm_doc->strictErrorChecking = false;
foreach ($redirect_nofollow_list as $info) {
$htm_doc->loadHTML(
mb_convert_encoding($info->ic_content, 'HTML-ENTITIES', 'UTF-8'));
$htm_doc->normalizeDocument();
$anchor_list = $htm_doc->getElementsByTagName('a');
foreach ($anchor_list as $anchor) {
$a_rel = $anchor->getAttribute('rel');
$anchor->setAttribute('rel', 'nofollow');
$this->Logs_model->backup($info->is_id, $info->ic_content);
$info->ic_content = $htm_doc->saveHTML();
$this->InfoContents_model->Update(
$info->ic_id,
$info->ic_url,
$info->ic_url_title,
$info->ic_type,
$info->ic_title,
$info->ic_content,
$info->ic_summary,
$info->ic_seo_title,
$info->ic_seo_description,
$info->ic_seo_keywords,
$info->ic_show_bread_crumbs,
$info->ic_status,
$info->ic_template,
$info->ic_photo,
$info->ic_photo_width,
$info->ic_photo_height,
$info->ic_recommend_tours,
$info->ic_recommend_packages,
$info->ic_ht_area_id,
$info->ic_ht_area_type,
$info->ic_ht_product_id,
$info->ic_ht_product_type,
$info->ic_author);
}
}
echo 'update_nofollow_count: '.count($redirect_nofollow_list).'<br/>';
}
public function count_http_of_href() { public function count_http_of_href() {
$data['all_information'] = $data['all_information'] =
$this->Information_model->search_all_text('http://www.chinahighlights.com/', 2000); $this->Information_model->search_all_text('http://www.chinahighlights.com/', 2000);
echo 'count: '.count($data['all_information']).'<br/>'; echo 'count: '.count($data['all_information']).'<br/>';
var_dump($data['all_information']);
} }
public function transform_href_to_https() { public function transform_href_to_https() {

Loading…
Cancel
Save