diff --git a/application/config/config.php b/application/config/config.php index d783cabd..3ee3101d 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -363,12 +363,12 @@ $config['proxy_ips'] = ''; //各站信息组和人员权限分配 $config['site'] = array( - 'cht' => array('site_code' => 'cht', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'http://www.chinahighlights.com', 'site_image_url' => '//images.chinahighlights.com', 'site_authors' => array('zzy', 'spt', 'yl', 'gavin', 'sw', 'zl', 'wbl', 'yqw', 'lf', 'zhm', 'pkl'), 'site_user' => ',ycc,lmr, zyh,J,shw,B,zzy,WJJ,Tony,pcf,zxy,wst,wz,v,S,yyg,yxd,wj,sw,yl,hx,spt,wmr,zl,syt,gavin,zm,htc,yqw,bhn,lmj,wbl,yqw,LYY,zhm,'), + 'cht' => array('site_code' => 'cht', 'site_id' => 14, 'site_lgc' => '1', 'site_url' => 'https://www.chinahighlights.com', 'site_image_url' => '//images.chinahighlights.com', 'site_authors' => array('zzy', 'spt', 'yl', 'gavin', 'sw', 'zl', 'wbl', 'yqw', 'lf', 'zhm', 'pkl'), 'site_user' => ',ycc,lmr, zyh,J,shw,B,zzy,WJJ,Tony,pcf,zxy,wst,wz,v,S,yyg,yxd,wj,sw,yl,hx,spt,wmr,zl,syt,gavin,zm,htc,yqw,bhn,lmj,wbl,yqw,LYY,zhm,'), 'gm' => array('site_code' => 'gm', 'site_id' => 22, 'site_lgc' => '4', 'site_url' => 'http://www.chinarundreisen.com', 'site_image_url' => '//bilder.chinarundreisen.com', 'site_authors' => array('DX', 'X', 'K', 'Lan', 'lmr', 'zyh', 'ZYHL', 'TDJ'), 'site_user' => ',ycc,lmr,B,zyh,DX,X,K,htc,zm,bhn,Lan,Tony,zyh,J,v,ZYHL,TDJ,LYY,shw,'), 'vc' => array('site_code' => 'vc', 'site_id' => 30, 'site_lgc' => '5', 'site_url' => 'http://www.voyageschine.com', 'site_image_url' => '//images.voyageschine.com', 'site_authors' => array('JE', 'kq', 'lya', 'lyz', 'zyh'), 'site_user' => ',ycc,lmr, zyh,JE,htc,kq,lya,bhn,Tony,zyh,B,J,lyz,LYY,'), 'jp' => array('site_code' => 'jp', 'site_id' => 88, 'site_lgc' => '3', 'site_url' => 'http://www.arachina.com', 'site_image_url' => '//images.arachina.com', 'site_authors' => array('hql', 'LLM', 'SHX', 'lmr', 'zyh', 'zb'), 'site_user' => ',ycc,lmr, zyh,hql,LLM,SHX,htc,zpl,Tony,zyh,J,B,zb,LYY,'), 'vac' => array('site_code' => 'vac', 'site_id' => 95, 'site_lgc' => '6', 'site_url' => 'http://www.viaje-a-china.com', 'site_image_url' => '//imagenes.viaje-a-china.com', 'site_authors' => array('I', 'cyt', 'lmr', 'zyh', 'LLM'), 'site_user' => ',ycc,lmr, zyh,I,cyt,htc,bhn,Tony,zyh,B,J,LLM,LYY,'), - 'it' => array('site_code' => 'it', 'site_id' => 168, 'site_lgc' => '8', 'site_url' => 'http://www.viaggio-in-cina.it', 'site_image_url' => '//images.viaggio-in-cina.it', 'site_authors' => array('LZY', 'ZQQ', 'lmr', 'zyh'), 'site_user' => ',ycc,lmr, zyh,LZY,htc,ZQQ,Tony,zyh,B,J,LYY,'), + 'it' => array('site_code' => 'it', 'site_id' => 168, 'site_lgc' => '8', 'site_url' => 'https://www.viaggio-in-cina.it', 'site_image_url' => '//images.viaggio-in-cina.it', 'site_authors' => array('LZY', 'ZQQ', 'lmr', 'zyh'), 'site_user' => ',ycc,lmr, zyh,LZY,htc,ZQQ,Tony,zyh,B,J,LYY,'), 'ru' => array('site_code' => 'ru', 'site_id' => 102, 'site_lgc' => '7', 'site_url' => 'http://www.chinahighlights.ru', 'site_image_url' => '//images.chinahighlights.ru', 'site_authors' => array('xjj', 'zyy'), 'site_user' => ',ycc,lmr, zyh,xjj,htc,DX,zyy,bhn,Tony,zyh,B,J,LYY,'), 'wt' => array('site_code' => 'wt', 'site_id' => 172, 'site_lgc' => '2', 'site_url' => 'http://www.iiiyooo.com', 'site_image_url' => '', 'site_authors' => array('ylh', 'lfj', 'wx', 'lzh', 'shw', 'lx'), 'site_user' => ',ycc,lmr, zyh,ylh,lfj,wx,lzh,shw,lx,bhn,B,J,'), 'tbt' => array('site_code' => 'tbt', 'site_id' => 169, 'site_lgc' => '1', 'site_url' => 'http://www.tibettravel.info', 'site_image_url' => '/images', 'site_authors' => array('wj', 'sfx'), 'site_user' => ',ycc,wj,bhn,wx,lzh,lfj,hwt,thf,sfx,J,ZP,'), @@ -691,7 +691,7 @@ $config['media_image_url_remote2'] = 'http://116.251.217.48:3581/upload'; //是否开启权限控制 $config['check_access'] = TRUE; //权限管理超级管理 -$config['access_super_manage'] = array('ycc', 'lyy', 'lmr'); +$config['access_super_manage'] = array('ycc', 'lmr'); //编辑器预览样式路径 $config['css_source_cht'] = ''; @@ -1019,11 +1019,6 @@ $config['media_image_url_org'] = 'http://202.103.68.35/image'; $config['media_image_url_remote'] = 'http://photo.chtcdn.com/upload'; $config['media_image_url_remote2'] = 'http://116.251.217.48:3581/upload'; -//是否开启权限控制 -$config['check_access'] = TRUE; -//权限管理超级管理 -$config['access_super_manage'] = array('ycc'); - //编辑器预览样式路径 $config['css_source_cht'] = ''; $config['css_source_ah'] = ''; diff --git a/application/controllers/cache.php b/application/controllers/cache.php index bee3b61a..1d9a0e20 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -1,137 +1,194 @@ -permission->is_admin(); - $this->load->model('Area_model'); - $this->load->model('InfoStructures_model'); - $this->load->model('Information_model'); - $this->site_code = $this->config->item('site_code'); - } - - /** - * - * 公有函数:扫描已有缓存文件并更新。 - * - * 必要参数: - * @param String $site_code - * - */ - public function update() - { - //设置缓存文件文件夹 - $cache_config = $this->config->item('cache'); - $current_cache_config = $cache_config[$this->site_code]; - $this->dir = $current_cache_config['cache_path']; - - //设置当前站点 - $this->current_domain = $this->config->item('site_url'); - //设置缓存更新接口及POST参数 - $this->cache_api = $current_cache_config['cache_api']; - $this->post_para = $current_cache_config['cache_api_para']; - //遍历缓存文件夹 - $this->tree($this->dir, $this->file, $this->path, $this->file_time); - //按目录筛选结果 - $this->filter($this->file, $this->path); - - //整理需要传递到视图的数据 - $data['file'] = $this->file; - $data['path'] = $this->path; - $data['file_time'] = $this->file_time; - $data['cache_api'] = $this->cache_api; - $data['post_para'] = $this->post_para; - - //视图 - $this->load->view('cache/update', $data); - } - - /** - * - * 私有函数:递归遍历缓存文件夹,将目录存放到$path,文件存放到$file。 - * - * 必要参数: - * @param String $dir - 需要遍历的目录 - * @param Array $file - 存放文件结果的数组引用 - * @param Array $path - 存放路径结果的数组引用 - * @param Array $file_time - 存放文件更新日期的数组引用 - * - */ - private function tree($dir, &$file, &$path, &$file_time) - { - $mydir = dir($dir); - while($f = $mydir->read()) - { - if(is_dir("$dir/$f") && $f!="." && $f!=".." && (strpos($dir, '/cn/')==false)) - { - $path[] = "$dir/$f"; - $this->tree("$dir/$f", $file, $path, $file_time); - } - else - { - if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')==false)) - { - $file_temp = str_ireplace('index.htm###', '', $f.'###'); - $file_temp = str_ireplace('###', '', $file_temp); - $path_temp = str_ireplace($this->dir, '', $dir); - $url_temp = $this->current_domain.$path_temp.'/'.$file_temp; - $file_time[$url_temp] = date("F d Y H:i:s", filemtime("$dir/$f")); - $file[] = $url_temp; - } - } - } - $mydir->close(); - } - - - /** - * - * 私有函数:筛选目录和文件。 - * - * 必要参数: - * @param Array $file - 存放文件结果的数组引用 - * @param Array $path - 存放路径结果的数组引用 - * - * 可选参数:POST参数 - $_POST['p'] - * - */ - private function filter(&$file, &$path) - { - if (isset($_POST['p']) && !empty($_POST['p'])) - { - //删选文件 - foreach ($file as &$f) - { - (stripos($f, $_POST['p'])!==false) or $f = false; - } - $file = array_filter($file); - //删选目录 - foreach ($path as &$p) - { - (stripos($p, $_POST['p'])!==false) or $p = false; - } - $path = array_filter($path); - } - } - -} -//end of Cache +permission->is_admin(); + $this->load->model('Area_model'); + $this->load->model('InfoStructures_model'); + $this->load->model('Information_model'); + $this->site_code = $this->config->item('site_code'); + } + + /** + * + * 公有函数:扫描已有缓存文件并更新。 + * + * 必要参数: + * @param String $site_code + * + */ + public function update() + { + //设置缓存文件文件夹 + $cache_config = $this->config->item('cache'); + $current_cache_config = $cache_config[$this->site_code]; + $this->dir = $current_cache_config['cache_path']; + + //设置当前站点 + $this->current_domain = $this->config->item('site_url'); + //echo $this->config->item('site_url'); + //设置缓存更新接口及POST参数 + $this->cache_api = $current_cache_config['cache_api']; + $this->post_para = $current_cache_config['cache_api_para']; + //遍历缓存文件夹 + $this->tree($this->dir, $this->file, $this->path, $this->file_time); + //按目录筛选结果 + $this->filter($this->file, $this->path); + + //整理需要传递到视图的数据 + $data['file'] = $this->file; + $data['path'] = $this->path; + $data['file_time'] = $this->file_time; + $data['cache_api'] = $this->cache_api; + $data['post_para'] = $this->post_para; + + //视图 + $this->load->view('cache/update', $data); + } + + /** + * + * 公有函数:扫描已有缓存文件并更新。 + * + * 必要参数: + * @param String $site_code + * + */ + public function sitemap() + { + header("Content-type:text/xml"); + //设置缓存文件文件夹 + $cache_config = $this->config->item('cache'); + $current_cache_config = $cache_config[$this->site_code]; + $this->dir = $current_cache_config['cache_path']; + + //设置当前站点 + $this->current_domain = $this->config->item('site_url'); + //设置缓存更新接口及POST参数 + $this->cache_api = $current_cache_config['cache_api']; + $this->post_para = $current_cache_config['cache_api_para']; + //遍历缓存文件夹 + $this->tree($this->dir, $this->file, $this->path, $this->file_time); + //按目录筛选结果 + $this->filter($this->file, $this->path); + + //整理需要传递到视图的数据 + $data['file'] = $this->file; + $data['path'] = $this->path; + $data['file_time'] = $this->file_time; + $data['cache_api'] = $this->cache_api; + $data['post_para'] = $this->post_para; + + //排序file数组 + sort ($data['file']); + + //生成sitemap + $dom = new DomDocument('1.0', 'utf-8'); + $urlset = $dom->createElement('urlset'); + $urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9'); + $dom->appendchild($urlset); + foreach ($data['file'] as $f) + { + $url = $dom->createElement('url'); + $loc = $dom->createElement('loc'); + $text = $dom->createTextNode($f); + $loc->appendchild($text); + $url->appendchild($loc); + $urlset->appendchild($url); + } + + echo($dom->saveXML()); + + } + + + /** + * + * 私有函数:递归遍历缓存文件夹,将目录存放到$path,文件存放到$file。 + * + * 必要参数: + * @param String $dir - 需要遍历的目录 + * @param Array $file - 存放文件结果的数组引用 + * @param Array $path - 存放路径结果的数组引用 + * @param Array $file_time - 存放文件更新日期的数组引用 + * + */ + private function tree($dir, &$file, &$path, &$file_time) + { + $mydir = dir($dir); + while($f = $mydir->read()) + { + if(is_dir("$dir/$f") && $f!="." && $f!=".." && (strpos($dir, '/cn/')==false)) + { + $path[] = "$dir/$f"; + $this->tree("$dir/$f", $file, $path, $file_time); + } + else + { + if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')==false) && (strpos($f, '.pdf')===false)) + { + $file_temp = str_ireplace('index.htm###', '', $f.'###'); + $file_temp = str_ireplace('###', '', $file_temp); + $path_temp = str_ireplace($this->dir, '', $dir); + $url_temp = $this->current_domain.$path_temp.'/'.$file_temp; + $file_time[$url_temp] = date("F d Y H:i:s", filemtime("$dir/$f")); + $file[] = $url_temp; + } + } + } + $mydir->close(); + } + + + /** + * + * 私有函数:筛选目录和文件。 + * + * 必要参数: + * @param Array $file - 存放文件结果的数组引用 + * @param Array $path - 存放路径结果的数组引用 + * + * 可选参数:POST参数 - $_POST['p'] + * + */ + private function filter(&$file, &$path) + { + if (isset($_POST['p']) && !empty($_POST['p'])) + { + //删选文件 + foreach ($file as &$f) + { + (stripos($f, $_POST['p'])!==false) or $f = false; + } + $file = array_filter($file); + //删选目录 + foreach ($path as &$p) + { + (stripos($p, $_POST['p'])!==false) or $p = false; + } + $path = array_filter($path); + } + } + +} +//end of Cache diff --git a/application/controllers/sendmail.php b/application/controllers/sendmail.php index 7325bc27..f63debf8 100644 --- a/application/controllers/sendmail.php +++ b/application/controllers/sendmail.php @@ -92,7 +92,7 @@ class Sendmail extends CI_Controller } } - $this->InfoSMS_model->set_mail_status($m->M_SN,1,$order_condition); + $this->InfoSMS_model->set_mail_status($m->M_SN,1); $this->email->clear(TRUE); } } diff --git a/application/controllers/tools.php b/application/controllers/tools.php new file mode 100644 index 00000000..77f1f33b --- /dev/null +++ b/application/controllers/tools.php @@ -0,0 +1,40 @@ +permission->is_admin(); + $this->load->model('Area_model'); + $this->load->model('InfoStructures_model'); + $this->load->model('Information_model'); + $this->site_code = $this->config->item('site_code'); + } + + /** + * + * 公有函数:扫描已有缓存文件并更新。 + * + * 必要参数: + * @param String $site_code + * + */ + public function old() + { + $data['yeardiff'] = $this->input->get_post('yeardiff'); + $data['nopub'] = $this->input->get_post('nopub'); + $data['emptyinfo'] = $this->input->get_post('emptyinfo'); + //参数 + if (!$data['yeardiff']) $data['yeardiff'] = 3; + //老旧信息 + $data['info'] = $this->Information_model->get_oldest_info($data['yeardiff'], $data['nopub'], $data['emptyinfo']); + + //视图 + $this->load->view('tools/old', $data); + } + +} +//end of Cache diff --git a/application/models/information_model.php b/application/models/information_model.php index b850059f..f926ae0d 100644 --- a/application/models/information_model.php +++ b/application/models/information_model.php @@ -328,4 +328,33 @@ class Information_model extends CI_Model { return $this->GetList(); } + //获取3年未更新的信息 + function get_oldest_info($yeardiff = 3, $has_no_pub = true, $empty_info = true) { + $has_no_pub ? $sql_no_pub = '' : $sql_no_pub = "AND ic_status = 1"; + $empty_info ? $sql_empty_info = '' : $sql_empty_info = "AND datalength(ic_content) > 0"; + //sql + $sql = "SELECT + ic_id, + ic_url, + ic_sitecode, + ic_title, + ic_url_title, + ic_datetime, + ic_type, + ic_author, + ic_status, + ic_view, + is_id + FROM infoContents + LEFT JOIN infoStructures ON ic_id = is_ic_id + WHERE YEAR(GETDATE()) - YEAR(ic_datetime) >= ? + AND ic_sitecode = ? + ".$sql_no_pub." + ".$sql_empty_info." + AND ic_url <> '' + ORDER BY ic_datetime desc"; + $query = $this->HT->query($sql, array($yeardiff, $this->config->item('site_code'))); + return $query->result(); + } + } diff --git a/application/third_party/pagespeed/models/PageSpeedData_model.php b/application/third_party/pagespeed/models/PageSpeedData_model.php index 377a8082..420aebed 100644 --- a/application/third_party/pagespeed/models/PageSpeedData_model.php +++ b/application/third_party/pagespeed/models/PageSpeedData_model.php @@ -136,6 +136,7 @@ class PageSpeedData_model extends CI_Model { $this->where .= " AND psd.psd_DesktopScore BETWEEN $start_score AND $end_score "; $this->orderby = ' ORDER BY psd_DesktopScore ASC '; } + $this->where .= " AND psd.psd_ErrorCount<=3 "; return $this->get_list(); } diff --git a/application/third_party/train/models/sendmail_model.php b/application/third_party/train/models/sendmail_model.php new file mode 100644 index 00000000..824f98ee --- /dev/null +++ b/application/third_party/train/models/sendmail_model.php @@ -0,0 +1,80 @@ +HT = $this->load->database('HT', TRUE); + } + + function SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body) + { + if($this->validEmail($toEmail)) + { + $data = array( + "M_ReplyToName" => $fromName, //回复人 + "M_ReplyToEmail" => $fromEmail, //回复地址 + "M_ToName" => $toName, //收件人名 + "M_ToEmail" => $toEmail, //收件邮件地址 + "M_Title" => $subject, //主题 + "M_Body" => $body, //邮件正文 + "M_Web" => "CHT", //所属站点 + "M_FromName" => "Chinahighlights.com", //站点名称 + "M_State" => 0, + ); + $this->HT->insert('Email_AutomaticSend',$data); + return TRUE; + }else{ + return FALSE; + } + } + + + public function validEmail($email){ + $isValid = true; + $atIndex = strrpos($email, "@"); + if (is_bool($atIndex) && !$atIndex){ + $isValid = false; + }else{ + $domain = substr($email, $atIndex+1); + $local = substr($email, 0, $atIndex); + $localLen = strlen($local); + $domainLen = strlen($domain); + if ($localLen < 1 || $localLen > 64){ + // local part length exceeded + $isValid = false; + }else if ($domainLen < 1 || $domainLen > 255){ + // domain part length exceeded + $isValid = false; + }else if ($local[0] == '.' || $local[$localLen-1] == '.'){ + // local part starts or ends with '.' + $isValid = false; + }else if (preg_match('/\\.\\./', $local)){ + // local part has two consecutive dots + $isValid = false; + }else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)){ + // character not valid in domain part + $isValid = false; + }else if (preg_match('/\\.\\./', $domain)){ + // domain part has two consecutive dots + $isValid = false; + }else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',str_replace("\\\\","",$local))){ + // character not valid in local part unless + // local part is quoted + if (!preg_match('/^"(\\\\"|[^"])+"$/',str_replace("\\\\","",$local))){ + $isValid = false; + } + } + /* + 不检查是否有DNS解析 + if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))){ + // domain not found in DNS + $isValid = false; + } + */ + } + return $isValid; + } + +} \ No newline at end of file diff --git a/application/third_party/train/views/email.php b/application/third_party/train/views/email.php new file mode 100644 index 00000000..66184036 --- /dev/null +++ b/application/third_party/train/views/email.php @@ -0,0 +1,70 @@ + + +
+ +Dear GUT_LastName?>,
+Thanks for payment US$145 . The train tickets have already been issued.
+You can collect the paper ticket(s) from now at any train station in mainland China.
+Please present all passenger(s) original passport(s) and Ticket Pick Up No.E601014106 at any ticket collecting counters (in Chinese 取票窗口)of any railway stations in mainland China. They will then issue your paper train ticket(s).
+Passenger(s) | +2 adult(s) + + 1. ALEXANDER JAMES JOHNSON , passport number 503406354 |
+
---|
Train 1:
+Ticket Pick Up No. | +E601014106 | +
---|---|
Train No. | +Z19 | +
Departure | +20:40 Jun.06 Beijing Xi (West) Station(in Chinese 北京西火车站) | +
Arrival | +08:31AM Jun.07 Xi'an Station(in Chinese 西安火车站) | +
Class | +Soft Sleeper | +
Kindly note below:
+1. The same passport that was used for booking should also be used for ticket collection. A renewed passport won't be acceptable even if the holder is the same person. The system does not allow us to change passport number or passenger name after issue ticket. Have to issue new ticket if wrong passport number or name.
+2. There is no further fee if collect train ticket(s) at the DEPARTURE station shown on your ticket(s). RMB 5 per ticket will be charged at a ticket counter at other stations. E.g. if you have booked Beijing-Shanghai and Shanghai-Beijing ticket(s), and you collect them all at Beijing, you will be charged RMB 5 per ticket for the Shanghai-Beijing ticket(s), but if you pick up the return leg ticket(s) separately in Shanghai you will avoid the charge.
+ 3. On departure day, please time your arrival wisely. If you are going to collect your tickets on departure day, we suggest you be at the station at least 1.5 hours ahead of the stated departure time to allow for waiting in queue at the ticket-counter, for security checks and for ticket checks.
+If you’ve already collected before the departure day, it is also wise to be at the station at least 40 minutes ahead.
4. Download railway station instructions, maps and tips at http://www.chinahighlights.com/china-trains/station-map.htm
+
+5.Terms & Conditions. http://www.chinahighlights.com/china-trains/booking-policy.htm
Best Regards!
+ Iris Wang, Travel Advisor
+ Tel: +86-773-2801368 Mobile:+86-18775900313
+ Fax: 86-773-2827424, 86-773-2885308
+ E-mail: iris@chinahighlights.me
+ www.chinahighlights.com
+ Address: Building 6, Chuangyi Business Park, 70 Qilidian Road, Guilin, Guangxi, 541004, China
+If you wish to share anything with my supervisor (Ms. Alex Yang), please feel free to send your email to alex@chinahighlights.net.