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

mm
hotfix/远程访问多媒体中心
lmrwork 7 years ago
commit 5ca29a2b4b

@ -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() {

@ -85,23 +85,27 @@ class search extends CI_Controller{
$this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$search_return); $this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$search_return);
$operate_data = $search_return; $operate_data = $search_return;
}else{ }else{
$cache_train_info = $this->BIZ_train_model->get_train_info($fromStation,$toStation); if($this->seveth == 'yes'){
if(empty($cache_train_info)){ $cache_train_info = $this->BIZ_train_model->get_train_info($fromStation,$toStation);
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|缓存为空'); if(empty($cache_train_info)){
$operate_data = NULL; log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|缓存为空');
}else{
$cache_time = $cache_train_info->tpc_datetime;
$now_time = time();
$differ_time = ($now_time - strtotime($cache_time)) / 86400;
if($differ_time >= 3){
$this->BIZ_train_model->delete_traincache($fromStation,$toStation);
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|缓存超时,已经删除');
$operate_data = NULL; $operate_data = NULL;
}else{ }else{
$this->cache = 'yes'; $cache_time = $cache_train_info->tpc_datetime;
$operate_data = $cache_train_info->tpc_content; $now_time = time();
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|调用缓存号:'.$cache_train_info->tpc_sn.'|缓存生成的时间:'.$cache_train_info->tpc_datetime); $differ_time = ($now_time - strtotime($cache_time)) / 86400;
} if($differ_time >= 3){
$this->BIZ_train_model->delete_traincache($fromStation,$toStation);
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|缓存超时,已经删除');
$operate_data = NULL;
}else{
$this->cache = 'yes';
$operate_data = $cache_train_info->tpc_content;
log_message('error','TRAIN 查询为空的链接:'.$this->url.'|出错的原因:'.$this->reason.'|调用缓存号:'.$cache_train_info->tpc_sn.'|缓存生成的时间:'.$cache_train_info->tpc_datetime);
}
}
}else{
$operate_data = NULL;
} }
} }
return $operate_data; return $operate_data;

@ -6,7 +6,7 @@
<title>信息平台</title> <title>信息平台</title>
<link rel="stylesheet" href="/css/information-system3.css?v=201508112" type="text/css" /> <link rel="stylesheet" href="/css/information-system3.css?v=201508112" type="text/css" />
<script type="text/javascript" src="/min/?f=/js/information-system3.min.js,/js/common.js&v=2018022601"></script> <script type="text/javascript" src="/min/?f=/js/information-system3.min.js,/js/common.js&v=2018022601"></script>
<script type="text/javascript" src="/js/kindeditor/kindeditor.js?v=20160601"></script> <script type="text/javascript" src="/js/kindeditor/kindeditor.js?v=20180730"></script>
<link rel="shortcut icon" href="/bootstrap/img/glyphicons_290_skull.png"> <link rel="shortcut icon" href="/bootstrap/img/glyphicons_290_skull.png">
<script language="javascript"> <script language="javascript">

@ -17,7 +17,7 @@ if (!window.console) {
if (!console.log) { if (!console.log) {
console.log = function () {}; console.log = function () {};
} }
var _VERSION = '4.1.6 (2013-03-24) 20160601', var _VERSION = '4.1.6 (2013-03-24) 20180730',
_ua = navigator.userAgent.toLowerCase(), _ua = navigator.userAgent.toLowerCase(),
_IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1, _IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1,
_GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1, _GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1,
@ -3207,9 +3207,9 @@ _extend(KCmd, {
var thirdlink=false var thirdlink=false
if (arguments[3] && arguments[3]=='1') { if (arguments[3] && arguments[3]=='1') {
if(url.indexOf("www.chinahighlights.com") < 0 ){ if(url.indexOf("www.chinahighlights.com") < 0 ){
url='http://www.chinahighlights.com'+url; url='https://www.chinahighlights.com'+url;
} }
url ='http://www.chinahighlights.com/redirect.asp?url='+url+'&t=78002'; url ='https://www.chinahighlights.com/redirect.asp?url='+url+'&t=78002';
thirdlink=true; thirdlink=true;
}; };
@ -5780,7 +5780,7 @@ _plugin('core', function(K) {
html = html.replace(/class=\"MsoNormal\"/gi, ''); html = html.replace(/class=\"MsoNormal\"/gi, '');
html = html.replace(/file\:\/\/C:/gi, ''); html = html.replace(/file\:\/\/C:/gi, '');
html = html.replace(/<p class=\"MsoListParagraph\"/gi, '<li'); html = html.replace(/<p class=\"MsoListParagraph\"/gi, '<li');
self.insertHtml(html, true); self.insertHtml(html, true);
} }
K(doc.body).bind('paste', function(e){ K(doc.body).bind('paste', function(e){

@ -57,8 +57,8 @@ KindEditor.plugin('link', function(K) {
thirdlinkBox = K('select[name="thirdlink"]', div), thirdlinkBox = K('select[name="thirdlink"]', div),
typeBox = K('select[name="type"]', div); typeBox = K('select[name="type"]', div);
urlBox.val('http://'); urlBox.val('http://');
typeBox[0].options[0] = new Option(lang.newWindow, '_blank'); typeBox[0].options[0] = new Option(lang.selfWindow, '');
typeBox[0].options[1] = new Option(lang.selfWindow, ''); typeBox[0].options[1] = new Option(lang.newWindow, '_blank');
self.cmd.selection(); self.cmd.selection();
var a = self.plugin.getSelectedLink(); var a = self.plugin.getSelectedLink();
if (a) { if (a) {

Loading…
Cancel
Save