对话框标题
对话框内容
欢迎使用赤雪短网址

你好,短网址!

国内优秀的网址缩短系统,提供长网址缩短业务,注册用户可以获得永久网址收藏夹功能,云端存储,让您随时随地查阅保存网站地址!

代码植入功能使您随心添加提示信息以及活动内容到页面跳转当中,不仅仅提供便签功能,更能为您给您的服务对象一个展示机会,让用户更懂你。

飞天侠折800模版短网址集成教程

访问量: 614837 发布时间:2015-01-03 11:15:56

本次集成教程仅对使用飞天侠折800模版编写,仅对其有效


首先是首页的设置提醒功能,飞天侠折800模版的首页产品列表下方新增设置提醒,文件存放于模版的public文件夹下的items_list.tpl里面。


找到71行左右的设置提醒的A标签代码,替换为


<a class="tix fr" href="javascript:void(0);" onclick="return settip('{$item.url}','{$item.title}')" target="_blank">设置提醒</a>

最底部新增表单提交代码

<form id="newWin" action="" method="get" target="_blank"></form> //解决新窗口被拦截

解决window.open被拦截


然后复制在底部插入js,进行网址缩短并在新窗口打开

<script type="text/javascript">

function settip(turl,title){

$.ajax({

type : 'get',

url  : 'https://www.sdk.la/getUrl/jsonp',

data : {u:turl,access_key:'wcFps7mO6tDmlC5v93teFAsCSpCay9n0'},

dataType : 'jsonp',

jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(默认为:callback)

jsonpCallback:"success_jsonpCallback",

success : function(u){

var site = "http://qzs.qq.com/snsapp/app/bee/widget/open.htm#content=亲,您在 {:C('ftx_site_name')} 关注的【"+title+"】马上就要开始抢购了哦。&time={$item.coupon_end_time|date='20y-m-d H:i',###}&advance=5&url="+u;

$('#newWin').attr('action',site);

$('#newWin').submit();

}

})

}

</script>

修改js代码红色部分为你的access_key,然后保存。


访问你的网站首页,在产品的下方有个设置提醒,点击测试。如果在新窗口打开后的地址栏尾部能够看到由api.lc或者sdk.la返回的短网址即表示首页短网址集成成功,以上代码可以集成到所有的列表页


否则在首页打开F12调试模式查看,是否有返回错误。


接下来是内容详细页的接口集成


由于在首页或者列表页的产品数量较多,因此采用触发式接口,这样不会对网站访问速度造成影响,那么内容页只需要访问的时候自动获取短网址。


在飞天侠折800模版当中,内容页的文件存放于item目录下的index.tpl。


因为该页面有多种情况,所有在集成代码当中,我们需要对程序进行判断,所以代码有些改动。


var nourl = window.location.href;//设置当前页面地址变量

$.ajax({

type : 'get',

url  : 'https://www.sdk.la/getUrl/jsonp',

data : {u:nourl,access_key:'wcFps7mO6tDmlC5v93teFAsCSpCay9n0'},

dataType : 'jsonp',

jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(默认为:callback)

jsonpCallback:"success_jsonpCallback",

success : function(u){

<if condition="$item.class eq 'tag_wait' ">

var time="{$item.coupon_start_time|date='20y-m-d H:i',###}";

var status = "马上就要开始抢购了哦。";

</if>

<if condition="$item.class eq 'end' ">

var time="{$item.coupon_end_time|date='20y-m-d H:i',###}";

var status = "下期活动马上就要开始了哦。";

<else />

<if condition="$item.class eq 'buy' ">

var time = "{$item.coupon_end_time|date='20y-m-d H:i',###}";

var status = "优惠活动马上就要结束了哦。";

</if>

</if>

var title = $('.bady-xx-seo').html();

var site = "http://qzs.qq.com/snsapp/app/bee/widget/open.htm#content=亲,您在 {:C('ftx_site_name')} 关注的【"+title+"】"+status+"。&time="+ time +"&advance=5&url="+u;

$('.shoot_time').html("<a href='"+ site +"' target='_blank'>设置提醒</a>");

}

})


依然替换红色文字为你在本站申请的access_key,然后将js代码放入js脚本当中即可。


注意:目前争对第三方网站集成,你在申请接入的时候填写网站地址请保证格式为根域名或者www打头



Lazaroelishabaz@aol.com 2016-03-13 03:52:23
I'm doing an internship levlen ed contraceptive pill side effects The loonie, as the Canadian dollar is known for the imageof the aquatic bird on the C$1 coin, fell 0.2 percent toC$1.0956 per U.S
Johnathanstanley2f@aol.com 2016-03-13 03:52:12
Do you like it here? is prednisone from overseas safe during pregnancy The WHO has warned that if the outbreak isn't stopped soon, Ebola could become a permanent fixture in West Africa, circulating routinely like malaria.
Lemueltyron6u@yahoo.com 2016-03-13 03:52:11
A company car methocarbamol 500mg high Conheeney spent 15 years at SAC, leading the firm first through the financial crisis and then the insider trading investigation, which ended last year when the Stamford, Connecticut-based firm pleaded guilty to insider trading and agreed to stop managing money for outside clients.
Timothydomingo7w@lycos.com 2016-03-13 03:52:11
I'm a member of a gym purchase anafranil Murray has no complaints about the scheduling — "It's tough tomake it perfect for every single player" — but attempted to redressthe situation by practising last night under the lights of theHisense Arena, the second of the show courts
Devindonalda47@gmail.com 2016-03-13 03:52:10
How would you like the money? anafranil ocd reviews Since it sports an anti-reflective coating, coupled with impressive brightness, the phone is highly usable outdoors — but that’s just about it; nothing really impressive about the 625’s display
Garfieldedwinz98@lycos.com 2016-03-13 03:52:09
Sorry, I ran out of credit is prednisone from overseas safe during pregnancy "If you're setting up a marine protected area to seed recruitment into a degraded habitat, that recruitment may not happen if young fish and coral are not recognizing the degraded area as habitat," said Danielle Dixson, an assistant professor in the School of Biology at the Georgia Institute of Technology in Atlanta, and the study's first author.
Jermainejamaalb10@lycos.com 2016-03-13 03:42:09
I've lost my bank card anafranil interactions other drugs In a sign of continued tensions in the aftermath of the dispute, Air France said it had been forced to cancel a meeting with unions last week to present its plans for Transavia due to the absence of unions representing a minority of staff.
Brocknathanael5n@gmail.com 2016-03-13 03:42:08
How many more years do you have to go? methocarbamol generic name Any message that does not conform with the policy of this service can be edited or removed with immediate effect.
Cornellcarter2q@lycos.com 2016-03-13 03:41:48
Yes, I play the guitar http://tadalafilbuycialis.com/maps/sitemap7.html eneric cialis buying online The study by the Institute for Health Metrics and Evaluation at the University of Washington in Seattle is the first comprehensive analysis of disease burden in the United States in more than 15 years. It includes estimates for death and disability from 291 diseases, conditions, and injuries as well as 67 risk factors.
Philipdoylej60@gmail.com 2016-03-13 03:41:47
Is it convenient to talk at the moment? http://tadalafilbuycialis.com/maps/sitemap4.html buying cialis soft in arlington This year, outfielder Alfredo Despaigne played for the Pirates of Campeche, Mexico, in July and August, and third baseman Omar Linares, as an official "exception," was allowed to play in Japan's professional league in 2000.
Angelinalenny8u@lycos.com 2016-03-13 03:41:44
Do you know the number for ? cataflam 50 mg obat untuk They are not really getting into a strong position consistently,” Long said
Kerrydelberth46@lycos.com 2016-03-13 03:41:42
Could I take your name and number, please? http://tadalafilbuycialis.com/maps/sitemap1.html buy fda approved cialis “It is a chance to get connected to what you eat. We’re obsessed by sell-by dates and things like that. But roadkill can be eaten very hygienically. People are too squeamish.”
Abrahamtrevorxww@usa.net 2016-03-13 03:41:39
Do you need a work permit? http://tadalafilbuycialis.com/maps/sitemap6.html buy glucophage cialis prescription buy generic glucophage The ban follows similar EU curbs imposed in April on threeof the world's most widely used pesticides, known asneonicotinoids, and reflects growing concern in Europe over arecent plunge in the population of honeybees critical to croppollination and production.
Devintraceynwp@gmail.com 2016-03-13 03:41:39
Could I have a statement, please? http://tadalafilbuycialis.com/maps/sitemap10.html buy cheap cialis in the cheap doesnt work More importantly do you see either being able to take Deontay Wilder? The boxing purist in me wants to scream Wilder is a overrated beat down merchant who has only been thrown in with mediocre opponents, but then something about him makes me think he could be something a bit more. Brute strength, explosiveness and strong whiskers with a little technique can get a guy a long way in the modern heavyweight division. Cheers. – Leo
Jimmihilario8h@gmail.com 2016-03-13 03:27:28
Do you have any exams coming up? prednisone side effects male fertility Clinton, the former first lady and senator from New York ran for president in 2008 and lost the nomination to Obama
Petercristobal2f@gmail.com 2016-03-13 03:27:27
Could you tell me the dialing code for ? hydroxyurea therapy in sickle cell disease Only severe obesity was also linked to deaths in very premature and moderately premature babies.
Wyattahmad9v@lycos.com 2016-03-13 03:27:27
I'm unemployed phenergan anti nausea medicine Not only has the peak spread narrowed, but the renewablesboom has led to overcapacity and Europe's economic crisis hashit power demand
Kermitrhettxph@usa.net 2016-03-13 03:27:26
How long have you lived here? norvasc pill images businesses, including airlines, say the bank effectively subsidizes foreign competitors.
Raphaeledwardozwm@yahoo.com 2016-03-13 03:27:24
I want to report a vermox worm tablets The search giant is planning soon to pilot its new GoogleCompare auto insurance comparison shopping site, wrote Forresteranalyst Ellen Carney in a note
Julesangelz21@gmail.com 2016-03-13 03:27:23
I want to report a mebendazole buy online Department of Transportation’s Pipeline and Hazardous Materials Safety Administration.
版权所有 © sdk.la 杭州赤雪科技有限公司 All Rights Reserved,浙ICP备14032148号 页面执行时间:0.000007 second(s)