增加自定义的og:title

hotfix/远程访问多媒体中心
lyt 7 years ago
parent cdf235d04f
commit f132ea17e3

@ -435,6 +435,7 @@
change_seo_count('ic_seo_title'); change_seo_count('ic_seo_title');
change_seo_count('ic_seo_description'); change_seo_count('ic_seo_description');
change_seo_count('meta_note'); change_seo_count('meta_note');
change_seo_count('meta_note_ogtitle');
init_recommend_popover("#meta_recommend_info", ".meta_recommend_info_box"); init_recommend_popover("#meta_recommend_info", ".meta_recommend_info_box");
init_recommend_popover("#meta_related_info", ".meta_related_info_box"); init_recommend_popover("#meta_related_info", ".meta_related_info_box");
@ -548,9 +549,9 @@
?> ?>
<style type="text/css">#PcAmp{color:#069;cursor: pointer;}#PcAmp input{position: relative;top: 2px;}</style> <style type="text/css">#PcAmp{color:#069;cursor: pointer;}#PcAmp input{position: relative;top: 2px;}</style>
<label id="PcAmp"> <label id="PcAmp">
<input type="checkbox" <?php echo($PcAmpChecked); ?>> <input type="checkbox" <?php echo($PcAmpChecked); ?>>
PC端页面也使用构建工具发布 PC端页面也使用构建工具发布
</label> | </label> |
<label title="AMP页面编辑"> <label title="AMP页面编辑">
<a href="<?php echo($amp_build_url); ?>" target="_blank"> HTML构建工具 </a> <a href="<?php echo($amp_build_url); ?>" target="_blank"> HTML构建工具 </a>
</label> | </label> |
@ -872,13 +873,23 @@
</div> </div>
<?php } ?> <?php } ?>
<label>og:title
<a href="javascript:void(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_note_ogtitle', $('#meta_note_ogtitle').val())"><i class="text-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);"
onclick="if(count_valid('meta_note_ogtitle', 'og:title', 20, 60) == true) { meta('save', '<?php echo $information->ic_id; ?>', 'meta_note_ogtitle', $('#meta_note_ogtitle').val()) }">
<i class="text-muted glyphicon glyphicon-hdd"></i>
</a>
<a href="javascript:void(0);" title="为信息添加og:title."><i class="text-muted glyphicon glyphicon-question-sign"></i></a>
<em class="pull-right muted" id="meta_note_ogtitle_count"></em>
</label>
<input name="meta_note_ogtitle" id="meta_note_ogtitle" onkeyup="change_seo_count(this.id);" type="text" class="form-control" value="<?php echo get_meta($information->ic_id, 'meta_note_ogtitle'); ?>" />
<label>og:description <label>og:description
<a href="javascript:void(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val())"><i class="text-muted glyphicon glyphicon-remove"></i></a> <a href="javascript:void(0);" onclick="meta('delete', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val())"><i class="text-muted glyphicon glyphicon-remove"></i></a>
<a href="javascript:void(0);" onclick="meta('save', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val())"><i class="text-muted glyphicon glyphicon-hdd"></i></a> <a href="javascript:void(0);" onclick="if(count_valid('meta_note', 'og:description', 80, 160) == true) { meta('save', '<?php echo $information->ic_id; ?>', 'meta_note', $('#meta_note').val()) }"><i class="text-muted glyphicon glyphicon-hdd"></i></a>
<a href="javascript:void(0);" title="为信息添加备注功能."><i class="text-muted glyphicon glyphicon-question-sign"></i></a> <a href="javascript:void(0);" title="为信息添加备注功能."><i class="text-muted glyphicon glyphicon-question-sign"></i></a>
<em class="pull-right muted" id="meta_note_count"></em> <em class="pull-right muted" id="meta_note_count"></em>
</label> </label>
@ -1271,7 +1282,7 @@
<input type="checkbox" name="auto_update_cache_checkbox" id="auto_update_cache_checkbox" onclick="get_update_cache_url();" value="<?php echo $information->ic_url; ?>" />静态更新 <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> </label>
<?php } ?> <?php } ?>
<?php if (in_array($this->config->item('site_code'),array('cht','ah','gm'))) { ?> <?php if (in_array($this->config->item('site_code'),array('cht','ah','gm'))) { ?>
<label class="checkbox col-xs-24" style="font-weight: normal;margin-top:0;padding-left: 21px;"> <label class="checkbox col-xs-24" style="font-weight: normal;margin-top:0;padding-left: 21px;">
<input type="checkbox" name="auto_update_amp" id="auto_update_amp" <?php if($information->amp_status==='2'){echo 'disabled';} ?> value="true" />AMP更新 <?php if($information->amp_status==='2'){echo '<i class="glyphicon glyphicon-hand-up" title="手动管理,不会自动更新"></i>'; } ?> <input type="checkbox" name="auto_update_amp" id="auto_update_amp" <?php if($information->amp_status==='2'){echo 'disabled';} ?> value="true" />AMP更新 <?php if($information->amp_status==='2'){echo '<i class="glyphicon glyphicon-hand-up" title="手动管理,不会自动更新"></i>'; } ?>
@ -1300,7 +1311,7 @@
<?php if (get_meta($information->ic_id, 'AMP_JSON') && get_meta($information->ic_id, 'AMP_STATUS') && get_meta($information->ic_id, 'AMP_BODY_PC_STATUS') === 'yes') { ?> <?php if (get_meta($information->ic_id, 'AMP_JSON') && get_meta($information->ic_id, 'AMP_STATUS') && get_meta($information->ic_id, 'AMP_BODY_PC_STATUS') === 'yes') { ?>
if (editor && editor.text() == '') { if (editor && editor.text() == '') {
editor.html('From HTML-Generator'); editor.html('From HTML-Generator');
editor.sync(); editor.sync();
} }
<?php } ?> <?php } ?>
if (information_check() != false) { if (information_check() != false) {

@ -509,6 +509,14 @@ function get_string_length(str) {
} }
return realLength return realLength
} }
function get_string_length_site(element) {
var length = get_string_length($("#" + element).val());
var sitecode = $("#is_sitecode").val();
if (sitecode == "jp" || sitecode == "ru") {
length = parseInt(length / 2)
}
return length;
}
function change_seo_count(element) { function change_seo_count(element) {
var length = get_string_length($("#" + element).val()); var length = get_string_length($("#" + element).val());
var sitecode = $("#is_sitecode").val(); var sitecode = $("#is_sitecode").val();
@ -528,6 +536,18 @@ function get_ajax_reviewed_list(formid, container, flag) {
} }
$("#" + container).load(url + " #" + container, data) $("#" + container).load(url + " #" + container, data)
}; };
function count_valid(element, element_text, from, to) {
if (from <= 0) { return true;}
var element_value_cnt = get_string_length_site(element) ;
if (to > 0 && (element_value_cnt < from || element_value_cnt > to) ) {
$.modaldialog.error(element_text + "长度必须在" + from + "~" + to + "个字符之间")
return false
} else if (to <= 0 && element_value_cnt < from) {
$.modaldialog.error(element_text + "长度必须大于" + from + "个字符")
return false
}
return true;
}
/* basic end*/ /* basic end*/
function mobile_friendly(refresh){ function mobile_friendly(refresh){
var ic_url = $("#ic_url").val(); var ic_url = $("#ic_url").val();

Loading…
Cancel
Save