广告联盟网
标题:
百度主题推广可以放到JS里调用吗
[打印本页]
作者:
悄然
时间:
2006-4-20
标题:
百度主题推广可以放到JS里调用吗
否则,那么多数据老是生成好麻烦。
作者:
vvvaaa
时间:
2006-4-20
不是不可以,是他哪个代码写在JS会出错。你可以用JS来调一个页面,哪个页面只放百度主题
广告就行了。
百度主题
终于开始也同站长交流了,现在有百度公司的人主动来联系站长放百度主题 ,有什么问题还可直接同他说。
作者:
yuwei
时间:
2006-4-22
看见有人这样做过的效果不错的说。
作者:
悄然
时间:
2006-4-22
原帖由
BingQ
于 2006-4-22 11:06 发表
主题推广代码分两部分,可以将第一部分的内容全放在js文件中,只在网页中写入第2段代码即可
此方法未经官方确认大家有使用的可以向百度咨询一下
哪两部分呢?我用下面的方法可以吗?
QUOTE:
var arrBaiduCproConfig=new Array();
arrBaiduCproConfig['uid'] =我的ID;
arrBaiduCproConfig['n'] ='ID';
arrBaiduCproConfig['tm'] = 16;
arrBaiduCproConfig['cm'] = 0;
arrBaiduCproConfig['um'] = 0;
arrBaiduCproConfig['rad'] = 1;
arrBaiduCproConfig['w'] = 400;
arrBaiduCproConfig['h'] = 15;
arrBaiduCproConfig['bd'] = '#FFFFFF';
arrBaiduCproConfig['bg'] = '#FFFFFF';
arrBaiduCproConfig['tt'] = '#ff0000';
arrBaiduCproConfig['ct'] = '#000000';
arrBaiduCproConfig['url'] = '#666666';
arrBaiduCproConfig['bdl'] = '#FFFFFF';
arrBaiduCproConfig['wn'] = 3;
arrBaiduCproConfig['hn'] = 1;
arrBaiduCproConfig['ta'] = 'right';
arrBaiduCproConfig['tl'] = 'bottom';
arrBaiduCproConfig['bu'] = 0;
var intBaiduCproDebug = 0;
var strBaiduCproUiUrl = 'http://cpro.baidu.com/cpro/ui/uijs.php?';
function baiduCproWriteStyle()
{
strBaiduCproStyle = '<style type="text/css">'
strBaiduCproStyle += '<!--';
strBaiduCproStyle += 'table.baidu_cpro_table td,table.baidu_cpro_table a,table.baidu_cpro_table div{font-size:12px;font-family:"宋体","楷体_gb2312","楷体";table-layout:fixed; word-break:break-all;vertical-align: middle; overflow:hidden;}';
strBaiduCproStyle += 'table.baidu_cpro_table a:link.baidu_cpro_title,table.baidu_cpro_table a:visited.baidu_cpro_title{text-decoration:none;}';
strBaiduCproStyle += 'table.baidu_cpro_table a:active.baidu_cpro_title,table.baidu_cpro_table a:hover.baidu_cpro_title{text-decoration:underline;}';
strBaiduCproStyle += '//-->';
strBaiduCproStyle += '</style>';
return strBaiduCproStyle;
}
function baiduCproTableBuild(strBaiduCproData, bolDebug){
//参数定义
intBaiduCproRow=arrBaiduCproConfig['hn'];
intBaiduCproCol=arrBaiduCproConfig['wn'];
intBaiduCproTdWidth = Math.ceil(100/intBaiduCproCol)+'%';
intBaiduCproTdHeight = Math.ceil((arrBaiduCproConfig['h']-16)/intBaiduCproRow)-4;
strBaiduCproTitleText = '服务';
strBaiduCproTitleUrl = 'http://union.baidu.com/';
//数据分割
arrBaiduCproData = strBaiduCproData.split('\n');
for(i=0;i<arrBaiduCproData.length;i++){
arrBaiduCproData<i> = arrBaiduCproData<i>.split('\t');
}
//table头
strBaiduCproOut = '<table align=center width='+arrBaiduCproConfig['w']+' height='+arrBaiduCproConfig['h']+' cellpadding=1 cellspacing=0 bgcolor='+arrBaiduCproConfig['bd']+' style="border:1px solid '+arrBaiduCproConfig['bd']+';" class="baidu_cpro_table">';
//百度title
strBaiduCproTitle = '<tr>';
strBaiduCproTitle += '<td height=12 colspan='+arrBaiduCproConfig['wn']+' align='+arrBaiduCproConfig['ta']+' bgcolor='+arrBaiduCproConfig['bd']+' style="border:0px; border-top:1px solid '+arrBaiduCproConfig['bd']+'; background-color:'+arrBaiduCproConfig['bd']+';color:'+arrBaiduCproConfig['bdl']+';">';
strBaiduCproTitle += strBaiduCproTitleText;
strBaiduCproTitle += '</td></tr>';
//百度title位置为top
if(arrBaiduCproConfig['tl'] != 'bottom'){
strBaiduCproOut+=strBaiduCproTitle;
}
index =0;
for(i=0;i<intBaiduCproRow;i++){
strBaiduCproOut +='<tr bgcolor=white>';
for(j=0;j<intBaiduCproCol;j++){
strBaiduCproOut +='<td style="border:0px;'+(i!=0?' border-top:1px solid '+arrBaiduCproConfig['bd']+';':'')+' background-color:'+arrBaiduCproConfig['bg']+';width:'+intBaiduCproTdWidth+'; height:'+intBaiduCproTdHeight+'px;" bgcolor="'+arrBaiduCproConfig['bg']+'" height="'+intBaiduCproTdHeight+'"width="'+intBaiduCproTdWidth+'" valign="middle">';
if (index>=arrBaiduCproData.length)
{
break;
}else{
if(arrBaiduCproData[index][3].match(/^http:\/\/sf\.baidu\.com\/cpro\.php/ig)){
arrBaiduCproData[index][3]+='&referer='+location.href.replace(/^.*&word=([^&]+).*$/ig,'$1');
}
strBaiduCproOut +='<div><a href="'+arrBaiduCproData[index][3]+'" target="_blank" class="baidu_cpro_title" style="color:'+arrBaiduCproConfig['tt']+';font-weight:bold;"><b>';
strBaiduCproOut +=arrBaiduCproData[index][0]+'</b></a></div>';
strBaiduCproOut +='<a href="'+arrBaiduCproData[index][3]+'" target="_blank" style="text-decoration:none;">';
if (arrBaiduCproData[index][1] != '...'){
strBaiduCproOut +='<div style=" color:'+arrBaiduCproConfig['ct']+';text-decoration:none;">'+arrBaiduCproData[index][1]+'</div>';
}
if(arrBaiduCproConfig['bu']=='1' || arrBaiduCproConfig['bu']==1){
strBaiduCproOut +='<div style="color:'+arrBaiduCproConfig['url']+';text-decoration:none;">'+arrBaiduCproData[index][2].replace(/^(\w+:\/\/)?([^\/]+).*$/ig,'$2')+'</div>';
}
strBaiduCproOut +='</a>';
index++;
}
strBaiduCproOut +='</td>';
}
strBaiduCproOut +='</tr>';
if (index>=arrBaiduCproData.length)
{
break;
}
}
//百度title位置为top
if(arrBaiduCproConfig['tl'] == 'bottom'){
strBaiduCproOut+=strBaiduCproTitle;
}
strBaiduCproOut += '</table>';
strBaiduCproOut = baiduCproWriteStyle()+strBaiduCproOut;
if (intBaiduCproDebug==1){
return strBaiduCproOut;
}else{
document.write(strBaiduCproOut);
}
}
function baiduCproGetUri(strBaiduCproUrl)
{
strBaiduCproGetParamMap = ',w|rsi0,h|rsi1,bu|rsi2,bd|rss0,bg|rss1,tt|rss2,ct|rss3,url|rss4,bdl|rss5,ta|rssl0,tl|rssl1,';
strBaiduCproUiUri = strBaiduCproUiUrl;
for (key in arrBaiduCproConfig){
if(key!='word'){
strBaiduCproUiUrlRegExp = '/^.*,'+key+'\\|([^,]+),.*$/ig';
strBaiduCproUiUrlParamName = eval('strBaiduCproGetParamMap.match(' + strBaiduCproUiUrlRegExp + ')?strBaiduCproGetParamMap.replace(' + strBaiduCproUiUrlRegExp + ',"$1"
:"' + key + '"');
strBaiduCproUiUri += '&'+strBaiduCproUiUrlParamName+'='+escape(arrBaiduCproConfig[key]);
}
}
if (strBaiduCproUrl==''){
strBaiduCproUrl=location.href
}
strBaiduCproUiUri += '&word=';
strBaiduCproUiUri += typeof(encodeURIComponent)=='function' ? encodeURIComponent(strBaiduCproUrl) : escape(strBaiduCproUrl);
return strBaiduCproUiUri;
}
function baiduCproIFrame()
{
return '<iframe marginWidth=0 marginHeight=0 scrolling=no frameBorder=0 width='+arrBaiduCproConfig['w']+' height='+arrBaiduCproConfig['h']+' allowTransparency src="'+baiduCproGetUri('')+'"></iframe>';
}
document.write(baiduCproIFrame());
欢迎光临 广告联盟网 (https://bbs.ggads.com/)
Powered by Discuz! X3.2