Merge branch 'master' of git.mycht.cn:developers/information-system

hotfix/远程访问多媒体中心
尹诚诚 8 years ago
commit 8dab12832e

@ -46,6 +46,7 @@ class Cache extends CI_Controller
//设置当前站点
$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'];
@ -65,6 +66,62 @@ class Cache extends CI_Controller
$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。
@ -88,7 +145,7 @@ class Cache extends CI_Controller
}
else
{
if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')==false))
if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')==false) && (strpos($f, '.pdf')===false))
{
$file_temp = str_ireplace('index.htm###', '', $f.'###');
$file_temp = str_ireplace('###', '', $file_temp);

@ -0,0 +1,80 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Sendmail_model extends CI_Model {
function __construct()
{
parent::__construct();
$this->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;
}
}

@ -0,0 +1,70 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{ font-family:Verdana, Geneva, sans-serif;}
h1{ font-size:18px; text-align:center; color:#545454; margin:0 0 10px 0!important;}
p{ font-size:14px; color:#545454; line-height:22px; margin-bottom:12px!important;}
table.table{ width:90%; border-width:1px 1px 0 1px; border-color:#d1d1d1; border-style: solid; margin-bottom:15px;}
table.table th{ background:#f1f1f1; color:#666; border-bottom:1px solid #d1d1d1; width:180px; font-size:14px; text-align:left; padding:8px 10px 8px 10px;}
table.table td{ padding:8px 0 8px 10px; border-bottom:1px solid #d1d1d1; font-size:14px; color:#545454;}
</style>
</head>
<body>
<h1>China Highlights Booking Confirmation</h1>
<p>Dear <?php echo $user[0]->GUT_LastName?>,</p>
<p>Thanks for payment US$145 . The train tickets have already been issued. </p>
<p> You can collect the paper ticket(s) from now at any train station in mainland China. </p>
<p> Please present all passenger(s) original passport(s) and Ticket Pick Up No.E601014106 &nbsp;at any ticket collecting counters (in Chinese 取票窗口)of any railway stations in mainland China. They will then issue your paper train ticket(s). </p>
<table border="0" cellpadding="0" cellspacing="0" class="table">
<tr>
<th>Passenger(s)</th>
<td><p>2 adult(s)
</p>
<p> 1. ALEXANDER JAMES JOHNSON , passport number 503406354<br />
2. SIAN MARIE JOHNSON , passport number 528876517</p></td>
</tr>
</table>
<p>Train 1:</p>
<table border="0" cellpadding="0" cellspacing="0" class="table">
<tr>
<th><strong>Ticket Pick Up No.</strong></th>
<td>E601014106&nbsp; </td>
</tr>
<tr>
<th><strong>Train No.</strong></th>
<td>Z19</td>
</tr>
<tr>
<th><strong>Departure</strong></th>
<td>20:40 Jun.06 Beijing Xi (West) Station(in Chinese 北京西火车站)</td>
</tr>
<tr>
<th><strong>Arrival</strong></th>
<td>08:31AM Jun.07 Xi'an Station(in Chinese 西安火车站) </td>
</tr>
<tr>
<th><strong>Class</strong></th>
<td>Soft Sleeper </td>
</tr>
</table>
<p>Kindly note below:</p>
<p> 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.</p>
<p> 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.</p>
<p> 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.<br />
If you&rsquo;ve already collected before the departure day, it is also wise to be at the station at least 40 minutes ahead. </p>
<p> 4. Download railway station instructions, maps and tips at <a href="http://www.chinahighlights.com/china-trains/station-map.htm">http://www.chinahighlights.com/china-trains/station-map.htm</a> <br />
<br />
5.Terms &amp; Conditions. <a href="http://www.chinahighlights.com/china-trains/booking-policy.htm">http://www.chinahighlights.com/china-trains/booking-policy.htm</a></p>
<p> Best Regards!<br />
Iris Wang, Travel Advisor<br />
Tel: +86-773-2801368 &nbsp;Mobile:+86-18775900313 <br />
Fax: 86-773-2827424, 86-773-2885308 <br />
E-mail: <a href="mailto:iris@chinahighlights.me">iris@chinahighlights.me</a><br />
<a href="http://www.chinahighlights.com">www.chinahighlights.com</a> <br />
Address: Building 6, Chuangyi Business Park, 70 Qilidian Road, Guilin, Guangxi, 541004, China<br />
If you wish to share anything with my supervisor (Ms. Alex Yang), please feel free to send your email to <a href="mailto:alex@chinahighlights.net">alex@chinahighlights.net</a>. </p>
</body>
</html>

@ -149,30 +149,6 @@
}
}
//移动到任意节点下
function move_by_is_id(is_id) {
is_parent_id = prompt("请输入移动到的节点ID:", "");
if (is_parent_id != null) {
if (confirm('请确认是否要移动到:' + is_parent_id)) {
var urlReQuery = "<?php echo site_url('information/move_by_is_id'); ?>";
$.ajax({
type: "post",
url: urlReQuery,
data: {'is_id': is_id, 'is_parent_id': is_parent_id},
success: function(data, textStatus) {
window.location.href = "<?php echo site_url('information/edit'); ?>/" + is_id;
return true;
},
error: function() {
$.modaldialog.error('发生错误请联系YCC');
return false;
}
});
}
}
}
//删除结构和信息
function deleteInfo(is_id) {
if (confirm('是否删除?')) {
@ -341,20 +317,6 @@
return true;
}
//跳转到测试页面
function goto_test_page() {
var site_url = 'http://192.155.224.195:8080/guide-use.php/travelguide/guide/?static_html_url=';
$('#goto_test_page_button').attr("href", site_url + $('#ic_url').val());
return true;
}
//跳转到HTML验证页面
function goto_validator() {
var site_url = '<?php echo $this->config->item('site_url') ?>';
$('#goto_validator_button').attr("href", 'https://validator.w3.org/nu/?doc=' + site_url + $('#ic_url').val());
return true;
}
//更新缓存
function get_update_cache_url() {
$('#auto_update_cache_checkbox').val($('#ic_url').val());
@ -446,11 +408,6 @@
init_recommend_popover("#meta_recommend_info", ".meta_recommend_info_box");
init_recommend_popover("#meta_related_info", ".meta_related_info_box");
init_recommend_popover("#meta_bread_info", ".meta_bread_info_box");
//自动读取google网页性能评分
setTimeout(function() {
mobile_friendly(), 1000
});
});
var editor;
@ -532,7 +489,7 @@
<div class="row">
<div class="col-xs-24 btn-sm"></div>
<div class="col-xs-7">
<label>信息标题</label>
<label>信息标题 & ID: <?php echo $information->ic_id; ?></label>
</div>
<div class="col-xs-24">
<input class="form-control" type="text" id="ic_title" style="<?php if ($embody == 1) echo 'border-color:green;'; ?>" name="ic_title" value="<?php echo $information->ic_title; ?>" >
@ -549,9 +506,6 @@
<div class="col-xs-24 nopadding">链接地址
<a href="javascript:void(0);" onclick="format_url()" title="格式化URL"><i class="glyphicon glyphtext-muted glyphicon glyphicon-flag text-muted"></i></a>
<a href="javascript:void(0);" onclick="goto_page();" id="goto_page_button" name="goto_page_button" target="_blank" title="查看" ><i class="glyphicon glyphtext-muted glyphicon glyphicon-eye-open text-muted"></i></a>
<?php if ($information->ic_sitecode == 'cht') { ?>
<a href="javascript:void(0);" onclick="goto_test_page();" id="goto_test_page_button" name="goto_test_page_button" target="_blank" title="查看测试页面" ><i class="glyphicon glyphtext-muted glyphicon glyphicon-random text-muted"></i></a>
<?php } ?>
</div>
<input class="form-control col-xs-24" type="text" id="ic_url" name="ic_url" value="<?php echo $information->ic_url; ?>" >
</div>
@ -564,7 +518,7 @@
</div>
<textarea id="ic_content" name="ic_content" ><?php echo str_replace('textarea', '#textarea#', $information->ic_content); ?></textarea>
<textarea id="ic_content" name="ic_content" ><?php echo str_replace($this->config->item('site_image_url'), $this->config->item('media_image_url'), $information->ic_content); ?></textarea>
<textarea name="ic_summary" id="ic_summary" class="col-xs-24" rows="5" placeholder="信息简介" style="border:none;border-bottom:1px solid #bbb;"><?php echo $information->ic_summary; ?></textarea>
@ -708,7 +662,7 @@
</div>
<?php if ($information->ic_sitecode == 'cht') { ?>
<?php if ($information->ic_sitecode == 'cht') { ?>
<div class="row">
<div class="col-sm-5">
@ -791,7 +745,7 @@
</div>
<?php } ?>
<?php } ?>
<label>信息备注
@ -884,7 +838,7 @@
</div>
<?php if (is_series_site()) { ?>
<?php if (is_series_site()) { ?>
<div class="row">
<div class="col-sm-8">
<label>机票目的地
@ -908,9 +862,11 @@
'info' => '信息',
'deal' => '促销',
'2015' => '2015',
'tour2017' => '2017',
'op' => 'OP',
'best' => '实用信息',
'culture' => '文化'
'culture' => '文化',
'top10' => 'TOP10'
);
?>
<label>匹配到一级导航
@ -934,10 +890,12 @@
<option value="flight"><?php echo($meta_subnavi_arr['flight']); ?></option>
<option value="info"><?php echo($meta_subnavi_arr['info']); ?></option>
<option value="deal"><?php echo($meta_subnavi_arr['deal']); ?></option>
<option value="tour2017"><?php echo($meta_subnavi_arr['tour2017']); ?></option>
<option value="2015"><?php echo($meta_subnavi_arr['2015']); ?></option>
<option value="op"><?php echo($meta_subnavi_arr['op']); ?></option>
<option value="best"><?php echo($meta_subnavi_arr['best']); ?></option>
<option value="culture"><?php echo($meta_subnavi_arr['culture']); ?></option>
<option value="top10"><?php echo($meta_subnavi_arr['top10']); ?></option>
</select>
</div>
<div class="col-sm-8">
@ -990,7 +948,7 @@
</div>
<?php } ?>
<?php if ($information->ic_ht_area_type == 'g') { ?>
<?php if ($information->ic_ht_area_type == 'g') { ?>
<div class="row">
@ -1031,7 +989,7 @@
</div>
</div>
<?php } ?>
<?php } ?>
<div class="row">
<div class="col-sm-5">
<label>展示打赏功能
@ -1064,18 +1022,6 @@
<input type="text" name="meta_facts_city" class="form-control" value="<?php echo get_meta($information->ic_id, 'meta_facts_city'); ?>" id="meta_facts_city"/>
</div>
<div class="col-sm-4">
<label>隐藏社媒按钮
<a href="javascript:void(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_media_button', $('#meta_media_button').val())"><i class="text-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);" onclick="meta('save', '<?php echo $information->ic_id; ?>', 'meta_media_button', $('#meta_media_button').val())"><i class="text-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" title="城市facets"><i class="text-muted glyphicon glyphicon-question-sign"></i></a>
</label>
<select name="meta_media_button" id="meta_media_button" class="form-control" >
<option value="no">不隐藏</option>
<option value="yes" <?php echo get_meta($information->ic_id, 'meta_media_button') === 'yes' ? 'selected' : FALSE; ?>>隐藏</option>
</select>
</div>
</div>
<!-- 自定义选项 -->
</div>
@ -1107,7 +1053,7 @@
<option <?php echo $select_str; ?> value="<?php echo $value; ?>" ><?php echo $key; ?></option>
<?php } ?>
</select>
<?php if ($rootInformation->ic_ht_area_type == 'pd') { ?>
<?php if ($rootInformation->ic_ht_area_type == 'pd') { ?>
<div id="bind_product_code">
<br/>
<div class="input-group">
@ -1124,7 +1070,7 @@
$value == $information->ic_template ? $select_str = 'selected' : $select_str = '';
?>
<option <?php echo $select_str; ?> value="<?php echo $value; ?>" ><?php echo $key; ?></option>
<?php } ?>
<?php } ?>
</select>
<label>是否作为面包屑显示</label>
@ -1159,7 +1105,7 @@
($author_item->a_id == $information->ic_author) ? $select_str = 'selected' : $select_str = '';
?>
<option <?php echo $select_str; ?> value="<?php echo $author_item->a_id; ?>" ><?php echo $author_item->a_name; ?></option>
<?php } ?>
<?php } ?>
</select>
<label>是否发布</label>
@ -1178,22 +1124,22 @@
<label class="checkbox col-xs-24" style="font-weight: normal;margin-top:0;padding-left: 21px;">
<input type="checkbox" name="ignore_url_check" id="ignore_url_check" />忽略URL重复
</label>
<div class="clearfix"></div>
<?php if (is_series_site() || ($this->config->item('site_code') == 'ah')) { ?>
<label class="col-xs-24">站会自动更新静态页面</label>
<?php } else { ?>
<?php if (is_series_site()) { ?>
<label class="col-xs-24">国际站会自动更新静态页面</label>
<?php } else { ?>
<label class="checkbox col-xs-24" style="font-weight: normal;margin-top:0;padding-left: 21px;">
<input type="checkbox" name="auto_update_cache_checkbox" id="auto_update_cache_checkbox" onclick="get_update_cache_url();" value="<?php echo $information->ic_url; ?>" />静态更新
</label>
<?php } ?>
<?php } ?>
<div class="clearfix"></div>
<p class="col-xs-24 nopadding">
<button type="button" id="btn-mobile-friendly" class="btn btn-sm" onclick="$('#btn-mobile-friendly').button('loading');
$('#mobile_friendly_status').html('');
mobile_friendly(true);">网页性能检测: </button>
mobile_friendly();">自适应检测</button>
<span id="mobile_friendly_status"></span>
<!-- <a href="javascript:void();" class="btn btn-sm" id="goto_validator_button" target="_blank" onclick="goto_validator();" >HTML规范验证</a> -->
</p>
<div class="btn-group col-xs-24 nopadding pull-right <?php if ($is_writeable == 0) echo 'hide'; ?>">
@ -1213,7 +1159,7 @@
<ul class="dropdown-menu">
<li><a href="<?php echo site_url('author/create_task/' . $information->is_id) ?>" target="_blank">发布任务</a></li>
<li class="divider"></li>
<li><a href="javascript:void(0);" onclick="move_by_is_id('<?php echo $information->is_id; ?>');">搬迁信息</a></li>
<li><a href="javascript:void(0);" onclick="deleteInfo('<?php echo $information->is_id; ?>');">删除信息</a></li>
<li class="divider"></li>
@ -1223,7 +1169,7 @@
<ul class="dropdown-menu history_log" style="right: 157px;left: inherit;top: 83px;">
<?php foreach ($content_backup_list as $item) { ?>
<li><a href="<?php echo site_url('information/backup_content/' . $item->log_id); ?>" target="_blank"><?php echo $item->log_datetime ?>, <?php echo $item->log_ht_username ?></a></li>
<?php } ?>
<?php } ?>
</ul>
</li>
</ul>

@ -23,7 +23,7 @@
$(function() {
//更新静态页,异步请求队列(setp_set个)
var setp_set = 20;
var setp_set = 6;
$('#update').on('click', function() {
var $data = $('.data');
for(var i=0; i<setp_set; i++) {

Loading…
Cancel
Save