Skip to content

Commit

Permalink
网址块弹窗提示可设置为简介
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Jan 4, 2020
1 parent af63bc7 commit cd4609d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 46 deletions.
18 changes: 13 additions & 5 deletions inc/frame/config/framework.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,19 @@
'default' => false,
),
array(
'id' => 'is_qr',
'type' => 'switcher',
'title' => '显示二维码',
'after' => '<br><p>网址块弹窗提示替换为二维码</p>',
'default' => false,
'id' => 'po_prompt',
'type' => 'radio',
'title' => '网址块弹窗提示',
'desc' => '网址块默认的弹窗提示内容',
'default' => 'url',
'class' => 'horizontal',
'options' => array(
'null' => '',
'url' => '链接',
'summary' => '简介',
'qr' => '二维码'
),
'after' => '如果网址添加了自定义二维码,此设置无效',
),
array(
'id' => 'columns',
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Theme Name:WebStack
Theme URI:https://www.iowen.cn
Description:by 一为!官方网站:<a href="https://www.iowen.cn">一为忆</a>
Version:1.1227
Version:1.1231
Author:iowen
Author URI: https://www.iowen.cn/
*/
100 changes: 60 additions & 40 deletions templates/site-card.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,68 @@
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>

<?php
$qrurl = $link_url;
$is_html = '';
if(get_post_meta($post->ID, '_wechat_qr', true)){
$qrurl="<img src='" . get_post_meta(get_the_ID(), '_wechat_qr', true) . "' width='128'>";
$is_html = 'true';
} else if($link_url=="") {
$qrurl = '地址错误!';
} else if(io_get_option('is_qr')) {
$qrurl = "<img src='https://my.tv.sohu.com/user/a/wvideo/getQRCode.do?width=128&height=128&text=" . $link_url . "' width='128'>";
$is_html = 'true';
}

$url = '';
$blank = '_blank';
if(io_get_option('details_page')){
$url=get_permalink();
}else{
<?php
$title = $link_url;
$is_html = '';
$tooltip = 'data-toggle="tooltip" data-placement="bottom"';
if(get_post_meta($post->ID, '_wechat_qr', true)){
$title="<img src='" . get_post_meta(get_the_ID(), '_wechat_qr', true) . "' width='128'>";
$is_html = 'data-html="true"';
} else {
switch(io_get_option('po_prompt')) {
case 'null':
$title = get_the_title();
$tooltip = '';
break;
case 'url':
if($link_url=="")
$title = '地址错误!';
break;
case 'summary':
$title = get_post_meta($post->ID, '_sites_sescribe', true);
break;
case 'qr':
if($link_url=="")
$title = '地址错误!';
else{
$title = "<img src='https://my.tv.sohu.com/user/a/wvideo/getQRCode.do?width=128&height=128&text=" . $link_url . "' width='128'>";
$is_html = 'data-html="true"';
}
break;
default:
}
}
$url = '';
$blank = '_blank';
if(io_get_option('details_page')){
$url=get_permalink();
}else{
if($link_url==""){
$url = 'javascript:';
$blank = '';
$url = 'javascript:';
$blank = '';
}else{
if(io_get_option('is_go'))
$url = '/go/?url='.base64_encode($link_url) ;
else
$url = $link_url;
if(io_get_option('is_go'))
$url = '/go/?url='.base64_encode($link_url) ;
else
$url = $link_url;
}
}
?>
<a href="<?php echo $url ?>" target="<?php echo $blank ?>" class="xe-widget xe-conversations box2 label-info" data-toggle="tooltip" data-placement="bottom" title="" data-html="<?php echo $is_html ?>" data-original-title="<?php echo $qrurl ?>">
}

?>
<a href="<?php echo $url ?>" target="<?php echo $blank ?>" class="xe-widget xe-conversations box2 label-info" <?php echo $tooltip . ' ' . $is_html ?> title="<?php echo $title ?>">
<div class="xe-comment-entry">
<div class="xe-user-img">
<?php if(io_get_option('lazyload')): ?>
<img class="img-circle lazy" src="<?php echo $default_ico; ?>" data-src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): (io_get_option('ico_url') .format_url($link_url) . io_get_option('ico_png')) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" width="40">
<?php else: ?>
<img class="img-circle lazy" src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): (io_get_option('ico_url') .format_url($link_url) . io_get_option('ico_png')) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" width="40">
<?php endif ?>
</div>
<div class="xe-comment">
<div class="xe-user-name overflowClip_1">
<strong><?php the_title() ?></strong>
<div class="xe-user-img">
<?php if(io_get_option('lazyload')): ?>
<img class="img-circle lazy" src="<?php echo $default_ico; ?>" data-src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): (io_get_option('ico_url') .format_url($link_url) . io_get_option('ico_png')) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" width="40">
<?php else: ?>
<img class="img-circle lazy" src="<?php echo get_post_meta($post->ID, '_thumbnail', true)? get_post_meta($post->ID, '_thumbnail', true): (io_get_option('ico_url') .format_url($link_url) . io_get_option('ico_png')) ?>" onerror="javascript:this.src='<?php echo $default_ico; ?>'" width="40">
<?php endif ?>
</div>
<div class="xe-comment">
<div class="xe-user-name overflowClip_1">
<strong><?php the_title() ?></strong>
</div>
<p class="overflowClip_2"><?php echo get_post_meta($post->ID, '_sites_sescribe', true) ?></p>
</div>
<p class="overflowClip_2"><?php echo get_post_meta($post->ID, '_sites_sescribe', true) ?></p>
</div>
</div>
</a>
</a>

0 comments on commit cd4609d

Please sign in to comment.