美化说明:
本模块启用后需要普通用户才能展示,站长一般都给自己VIP权限;所以VIP权限是不会展示的,不要说启用后没有效果,下面看教程
代码部署:
1.打开”ripro-v2-child/inc/options/widget-options.php”文件添加如下代码:
/*
* RI-首页底部广告
*/
CSF::createWidget('ripro_v2_footer_vip', array(
'title' => 'RI-首页模块:底部漂浮广告',
'classname' => 'widget-adss',
'description' => '底部漂浮广告',
'fields' => array(
array(
'id' => 'sao_img',
'type' => 'upload',
'title' => '上传图片',
'library' => 'image',
'placeholder' => 'http://',
'button_title' => '上传',
'remove_title' => '删除',
'default' => 'https://cdn.wpon.cn/ripro-v2/card/images/sao-footer.gif',
),
array(
'id' => 'sao_url',
'type' => 'text',
'title' => 'VIP链接地址',
'default' => '/vip',
),
),
));
function ripro_v2_footer_vip($args, $instance){
echo $args['before_widget'];
$vip_type = _get_user_vip_type($current_user->ID);
$sao_img = $instance['sao_img'];
$sao_url = $instance['sao_url'];
if($vip_type != 'vip' && $vip_type != 'boosvip'){
?>
<div class="showpc"><div class="sao_footer_vip"style="width: 191px;height: 204px;left: 0px;bottom: 0px;"><a href="<?php echo $sao_url ?>"><img src="<?php echo $sao_img ?>"></a>
</div></div>
<?php echo ob_get_clean();
echo $args['after_widget'];}}
2.在”ripro-v2-child/child-style.css”添加如下CSS样式:
/*底部漂浮广告*/
.showpc{display:none}
@media (min-width:960px){.showpc{display:inline}
}
.sao_footer_vip{position:fixed;z-index:9999}
.sao_footer_vip img{float:right}
© 版权声明
THE END
暂无评论内容