广告联盟网

标题: 发现GG代码已做了小改进 增加渠道名称注释行 [打印本页]

作者: gogo    时间: 2006-9-25
标题: 发现GG代码已做了小改进 增加渠道名称注释行
GG代码做了小改进,已加上注释行,标明生成日期及渠道名称,例如:
//2006-09-25: 渠道名称

虽然改进了,但还是不满足,最好能公开一下渠道代码的算法.知道算法的请说一下.
作者: sssccc    时间: 2006-9-25
知道算法有什么用?
作者: gogo    时间: 2006-9-25
我的渠道名一般以文件所在目录名或不含扩展名的文件名取名,GG代码用函数生成,这样在asp页中可比较灵活控制 广告大小\颜色\是否显示等等,生成静态HTML页时也可根据字段控制并随时根据标识符用代码修改.渠道一多,老是得到后台查看代码.只能自己一个个渠道收集到本地文件,用的时候再查找,增加出错的机会.如果知道算法,便可直接传入文件名或目录名生成渠道代码.代码参考一下,有需要用的拿去用用呵.

function getGGAds(nwidth,nheight,adtype,adchannel,cborder,cbg,clink,curl,ctext)
if not isnumeric(nwidth) or not isnumeric(nheight) then
  getGGAds = ""
  exit function
end if
if adtype="" then adtype="text_image"
if adchannel="" then adchannel="xxxxxxxxxx"
if cborder="" then cborder="FFFFFF"
if cbg="" then cbg="FFFFFF"
if clink="" then clink="0000FF"
if curl="" then curl="000000"
if ctext="" then ctext="000000"
getGGAds=""
&quot;<script type=&quot;&quot;text/javascript&quot;&quot;><!--&quot;&vbcrlf&_
&quot;google_ad_client = &quot;&quot;pub-XXXXXXXXXXXXXX&quot;&quot;;&quot;&vbcrlf&_
&quot;google_ad_width = &quot;&nwidth&&quot;;&quot;&vbcrlf&_
&quot;google_ad_height = &quot;&nheight&&quot;;&quot;&vbcrlf&_
&quot;google_ad_format = &quot;&quot;&quot;&nwidth&&quot;x&quot;&nheight&&quot;_as&quot;&quot;;&quot;&vbcrlf&_
&quot;google_ad_type = &quot;&quot;&quot;&adtype&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;google_ad_channel =&quot;&quot;&quot;&adchannel&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;google_color_border = &quot;&quot;&quot;&cborder&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;google_color_bg = &quot;&quot;&quot;&cbg&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;google_color_link = &quot;&quot;&quot;&clink&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;google_color_url = &quot;&quot;&quot;&curl&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;google_color_text = &quot;&quot;&quot;&ctext&&quot;&quot;&quot;;&quot;&vbcrlf&_
&quot;//--></script>&quot;&vbcrlf&_
&quot;<script type=&quot;&quot;text/javascript&quot;&quot;&quot;&vbcrlf&_
&quot;  src=&quot;&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&quot;>&quot;&vbcrlf&_
&quot;</script>&quot;
end function




欢迎光临 广告联盟网 (https://ggads.com/) Powered by Discuz! X3.2