广告常用

ADMIN / 2018-05-22 / / kelvinvt.com / Print / Attention / Share:

广告模块的使用帮助

KCMS的广告模块采用开放式自动载入的方法,可自己写任意效果的广告


广告模板位置: /plugins/ad/

站长可以将自己常用的广告特效代码放入到这个目录下,命名为:/广告名称/index.html

在后台添加广告时就可以看到自己创建的广告,设置好高宽图片和内容后就可以在页面中调用了。

使用方法

1.创建模板(如果用系统默认的则略过)。

2.后台进入广告管理,创建广告。

3.选择广告模板,上传图片,修改高宽等标签。

4.保存,ID为?数字。

5.前台插入标签cms:ad? }。


创建广告模板用的标签:

[ width] 宽度
[ height]    高度
[ pic]   图片
[ link]  链接
[ content]   内容


模板中调用

{ cms:ad? }


事例:

创建一个最简单的图片广告模板,就是插入一张图片。

在plugins\ad,文件夹里创建一个【一张图片】文件夹,创建index.html,代码如下,保存。

后台:广告管理-新建广告-就可以看到这个【一张图片】这个广告模板了。

< div class='thisad' >
< img width="[ width]" height="[ height]" alt="[ title]" src="[ pic]" / >
< /div >


事例二(图片从页面上方弹出**)

{ cms:ad2 }
< style type="text/css" >
*html .advbox { position: absolute;top:expression(eval(document.documentElement.scrollTop)); }
.advbox { width: 650px; position: fixed; display: none; left: 50%; top: 0; margin: -215px 0 0 -325px; }
.advbox .advpic { position: relative; height: 400px; overflow: hidden; }
.advbox .advpic .closebtn { display: block; width: 60px; height: 22px; line-height: 26px; font-size: 12px; color: #333; text-indent: 12px; overflow: hidden; position: absolute; right: 12px; top: 5px; z-index: 99; }
< /style >
< div class="advbox" >< div class="advpic" >
< img width="[ width]" height="[ height]" alt="[ content]" src="[ pic]" / >< a href="javascript:void(0);" class="closebtn" >关闭< /a >
< /div >< /div >
< script >$(document).ready(function(){ 
    $(".advbox").show(); $(".advbox").animate({top:"50%" },1000); 
    $(".closebtn").click(function(){ $(".advbox").fadeOut(500);  })
 })
< /script >


 
Contact Us
  • 13800000000
  • Powered by KCMS