增加功能初衷:使企业用户使用更方便,添加或者更改在线客服更方便,不需要更改程序代码。
增加对象
1、skype
2、msn
3、旺旺
4、二维码
此处四个功能在前台显示地方为
1、右侧移动在线客服
2、底部联系方式
如图所示
需改动的地方
1、数据库 **_website数据表
2、网站后台
set_web.dwt 后台模板文件
<tr>
<td class=”name”>{:$lang['page']['msn']:}</td>
<td>
<input type=”text” name=”msn” class=”input rounded” value=”{:$web['all_data'][$web['lang']]['msn']:}” size=”40″ />
<img src=”../inc/templates/manage/images/operation/help.png” width=”16″ height=”16″ class=”title2div” title=”{:$lang['page']['msn_title']:}”>
</td>
<td class=”field”>{:literal:}{:$web['msn'][n]:}{:/literal:}</td>
</tr>
<tr>
<td class=”name”>{:$lang['page']['skype']:}</td>
<td>
<input type=”text” name=”skype” class=”input rounded” value=”{:$web['all_data'][$web['lang']]['skype']:}” size=”40″ />
<img src=”../inc/templates/manage/images/operation/help.png” width=”16″ height=”16″ class=”title2div” title=”{:$lang['page']['skype_title']:}”>
</td>
<td class=”field”>{:literal:}{:$web['skype'][n]:}{:/literal:}</td>
</tr>
<tr>
<td class=”name”>{:$lang['page']['wangwang']:}</td>
<td>
<input type=”text” name=”wangwang” class=”input rounded” value=”{:$web['all_data'][$web['lang']]['wangwang']:}” size=”40″ />
<img src=”../inc/templates/manage/images/operation/help.png” width=”16″ height=”16″ class=”title2div” title=”{:$lang['page']['wangwang_title']:}”>
</td>
<td class=”field”>{:literal:}{:$web['wangwang'][n]:}{:/literal:}</td>
</tr>
<tr>
<td class=”name”>{:$lang['page']['erweima']:}</td>
<td>
<div class=”logo”>
<ol><img src=”../inc/templates/manage/images/operation/picture.png” width=”16″ height=”16″ border=”0″ class=”title2div” title=”<img width=’200′ border=’0′ src=’../{:$web['erweima']:}’ />”></ol>
<ol><input type=”text” name=”erweima” id=”erweima” class=”input rounded” value=”{:$web['erweima']:}” size=”20″ /></ol>
<ol><iframe src=”upload.php?dir=other&preview=upload_preview2&return_id=erweima” width=”183″ height=”30″ border=”0″ scrolling=”no” frameborder=”0″></iframe><img src=”../inc/templates/manage/images/operation/help.png” width=”16″ height=”16″ class=”title2div” title=”{:$lang['page']['erweima_title']:}”></ol>
</div>
</td>
<td class=”field”><div id=”upload_preview2″>{:literal:}{:$web['erweima']:}{:/literal:}</div></td>
</tr>
set_web.lang.php 后台语言文件
‘msn’ => ‘MSN帐号:’,
‘msn_title’ => ‘可以填写多个MSN帐号,用逗号隔开。调用:{:$web[\'msn\'][n]:},<br />n为索引值:0调用第一个MSN帐号,1第二个,2第三个,依此类推。数<br />量不限。’,
‘skype’ => ‘Skype帐号:’,
‘skype_title’ => ‘可以填写多个Skype帐号,用逗号隔开。调用:{:$web[\'Skype\'][n]:},<br />n为索引值:0调用第一个Skype帐号,1第二个,2第三个,依此类推。数<br />量不限。’,
‘wangwang’ => ‘旺旺帐号:’,
‘wangwang_title’ => ‘可以填写多个旺旺帐号,用逗号隔开。调用:{:$web[\'wangwang\'][n]:},<br />n为索引值:0调用第一个旺旺帐号,1第二个,2第三个,依此类推。数<br />量不限。’,
‘erweima’ => ‘二维码图片:’,
‘erweima_title’ => ‘上传二维码图片,宽88像素。调用:{:$web[\'msn\'][n]:},<br />二维码图像显示,多个二维码请整合成一个,宽88像素。’,
3、前台展示
1、skype支持JS
<script type=”text/javascript” src=”http://skype.tom.com/script/skypeCheck40.js”></script>
2、lrkf.js 移动在线客服JS
显示在线状态版本(skype需要相关JS支持)
(function($){$.fn.lrkf=function(options){var opts={position:”fixed”,btntext:” “,qqs:[{name:"\u61d2\u4eba\u5efa\u7ad9",qq:"191221838"}],tel:”",more:null,kftop:”120″,z:”99999″,defshow:true,Event:”",callback:function(){}},$body=$(“body”),$url=”";$.extend(opts,options);if(!$(“#lrkfwarp”).length>0){$body.append(“<div id=’lrkfwarp’ class=’lrkf lrkfshow’ style=”+opts.position+”><a href=’#’ class=’lrkf_btn lrkf_btn_hide’ id=’lrkf_btn’ οnfοcus=’this.blur()’>”+opts.btntext+”</a><div class=’lrkf_box’><div class=’lrkf_header’><a href=’#’ title=’\u5173\u95ed’ class=’x’ id=’lrkf_x’></a></div><div class=’lrkf_con’ id=’lrkf_con’><ul class=’kflist’></ul></div><div class=’lrkf_foot’></div></div></div><style>html{overflow-x:hidden;}#lrkfwarp ul{padding-left:0; margin:0;list-style-type: none;}.lrkf{font-size:13px;position:fixed;}.lrkf a{ display:block; color:#666; text-decoration:none; font-size:13px;}#lrkfwarp img{ border:none;vertical-align:middle; margin-right:4px; margin-top:-2px;display:inline;}.lrkf_con{padding:6px 8px;}.lrkf_con li.qq{padding:5px 0;}.lrkf_con li.tel{ line-height:1.35; padding-bottom:4px;}.lrkf_con li.more{ padding:2px 0;}.lrkf_con li.tel b{ display:block; color:#C00;}.lrkf_tool a{ display:block; padding:8px 10px; text-align:center;}.lrkf_con .hr{padding:0;height:0;font-size:0;line-height:0;clear:both;margin:4px 0;border-bottom:#fff solid 1px;border-top:#CFCFCF solid 1px;border-left:none;border-right:none;}.lrkf_btn{position:absolute; top:20px;width:22px;left:-22px;display:block;text-align:center;padding:10px 0;}.lrkf .lrkf_xc{ position:absolute; bottom:-14px; right:6px;font-size:10px;display:none;}</style>”)}var $lrkfwarp=$(“#lrkfwarp”),$lrkf_con=$(“#lrkf_con”),$kflist=$lrkf_con.children(“ul”),$lrkf_x=$(“#lrkf_x”),$lrkf_btn=$(“#lrkf_btn”),$lrkfwarp_w=$lrkfwarp.outerWidth()*1+1;$lrkfwarp.css({top:opts.kftop+”px”,”z-index”:opts.z});if(!opts.defshow){$lrkfwarp.removeClass(“lrkfshow”).css({right:-$lrkfwarp_w})}var json={options:opts.qqs};json=eval(json.options);$.each(json,function(i,o){$kflist.append(“<li><a target=_blank href=http://wpa.qq.com/msgrd?v=3&uin=”+o.qq+”&site=qq&menu=yes><img src=http://wpa.qq.com/pa?p=2:”+o.qq+”:45>”+o.name+”</a></li>”)});var json_skype={options:opts.skype};json_skype=eval(json_skype.options);$.each(json_skype,function(i,o){$kflist.append(“<li><a href=’skype:”+o.skype+”?call’ οnclick=’return skypeCheck();’><img src=’http://mystatus.skype.com/bigclassic/”+o.skype+”‘ style=’border: none;’ width=’90′ alt=’Skype:”+o.skype+”‘ /></a></li>”)});var json_msn={options:opts.msn};json_msn=eval(json_msn.options);$.each(json_msn,function(i,o){$kflist.append(“<li><a href=’msnim:chat?contact=”+o.msn+”‘><img src=” style=’border: none;’ width=’90′ alt=’msn:”+o.msn+”‘ /></a></li>”)});var json_wangwang={options:opts.wangwang};json_wangwang=eval(json_wangwang.options);$.each(json_wangwang,function(i,o){$kflist.append(“<li><a target=’_blank’ href=’http://amos1.taobao.com/msg.ww?v=2&uid=”+o.wangwang+”=1′ ><img border=’0′ src=’http://amos1.taobao.com/online.ww?v=2&uid=”+o.wangwang+”=1′ alt=’点击这里给我发消息’ /></a></li>”)});if(opts.tel){$kflist.append(“<li></li>”);var json_tel={options:opts.tel};json_tel=eval(json_tel.options);$.each(json_tel,function(i,o){$kflist.append(“<li>”+o.name+”:<b>”+o.tel+”</b></li>”)})}if(opts.erweima){$kflist.append(“<li></li>”);var json_erweima={options:opts.erweima};json_erweima=eval(json_erweima.options);$.each(json_erweima,function(i,o){$kflist.append(“<li>”+o.name+”:<img src=”+o.erweima+” width=90 /></li>”)})}if(opts.more){$kflist.append(“<li></li><li><a href=’”+opts.more+”‘>>>\u66f4\u591a\u65b9\u5f0f</a></li>”)}var $lrkfwarptop=$lrkfwarp.offset().top;if($.browser.msie&&$.browser.version==6||opts.position==”absolute”){$(window).scroll(function(){var offsetTop=$lrkfwarptop+$(window).scrollTop()+”px”;$lrkfwarp.animate({top:offsetTop},{duration:600,queue:false})})}$lrkf_x.click(function(){$lrkfwarp.hide();return false});if(opts.Event==”"){$lrkfwarp.mouseenter(function(){$(this).stop().animate({right:0})}).mouseleave(function(){$(this).stop().animate({right:-$lrkfwarp_w})})}else{$lrkf_btn.on(“click”,function(){if($lrkfwarp.hasClass(“lrkfshow”)){$lrkfwarp.animate({right:-$lrkfwarp_w},function(){$lrkfwarp.removeClass(“lrkfshow”)})}else{$lrkfwarp.addClass(“lrkfshow”).animate({right:0})}return false})}}})(jQuery);
不显示在线状态版本
(function($){$.fn.lrkf=function(options){var opts={position:”fixed”,btntext:” “,qqs:[{name:"\u61d2\u4eba\u5efa\u7ad9",qq:"191221838"}],tel:”",more:null,kftop:”120″,z:”99999″,defshow:true,Event:”",callback:function(){}},$body=$(“body”),$url=”";$.extend(opts,options);if(!$(“#lrkfwarp”).length>0){$body.append(“<div id=’lrkfwarp’ class=’lrkf lrkfshow’ style=”+opts.position+”><a href=’#’ class=’lrkf_btn lrkf_btn_hide’ id=’lrkf_btn’ οnfοcus=’this.blur()’>”+opts.btntext+”</a><div class=’lrkf_box’><div class=’lrkf_header’><a href=’#’ title=’\u5173\u95ed’ class=’x’ id=’lrkf_x’></a></div><div class=’lrkf_con’ id=’lrkf_con’><ul class=’kflist’></ul></div><div class=’lrkf_foot’></div></div></div><style>html{overflow-x:hidden;}#lrkfwarp ul{padding-left:0; margin:0;list-style-type: none;}.lrkf{font-size:13px;position:fixed;}.lrkf a{ display:block; color:#666; text-decoration:none; font-size:13px;}#lrkfwarp img{ border:none;vertical-align:middle; margin-right:4px; margin-top:-2px;display:inline;}.lrkf_con{padding:6px 8px;}.lrkf_con li.qq{padding:5px 0;}.lrkf_con li.tel{ line-height:1.35; padding-bottom:4px;}.lrkf_con li.more{ padding:2px 0;}.lrkf_con li.tel b{ display:block; color:#C00;}.lrkf_tool a{ display:block; padding:8px 10px; text-align:center;}.lrkf_con .hr{padding:0;height:0;font-size:0;line-height:0;clear:both;margin:4px 0;border-bottom:#fff solid 1px;border-top:#CFCFCF solid 1px;border-left:none;border-right:none;}.lrkf_btn{position:absolute; top:20px;width:22px;left:-22px;display:block;text-align:center;padding:10px 0;}.lrkf .lrkf_xc{ position:absolute; bottom:-14px; right:6px;font-size:10px;display:none;}</style>”)}var $lrkfwarp=$(“#lrkfwarp”),$lrkf_con=$(“#lrkf_con”),$kflist=$lrkf_con.children(“ul”),$lrkf_x=$(“#lrkf_x”),$lrkf_btn=$(“#lrkf_btn”),$lrkfwarp_w=$lrkfwarp.outerWidth()*1+1;$lrkfwarp.css({top:opts.kftop+”px”,”z-index”:opts.z});if(!opts.defshow){$lrkfwarp.removeClass(“lrkfshow”).css({right:-$lrkfwarp_w})}var json={options:opts.qqs};json=eval(json.options);$.each(json,function(i,o){$kflist.append(“<li><a target=_blank href=http://wpa.qq.com/msgrd?v=3&uin=”+o.qq+”&site=qq&menu=yes class=’zxkf_qq’ ></a></li>”)});var json_skype={options:opts.skype};json_skype=eval(json_skype.options);$.each(json_skype,function(i,o){$kflist.append(“<li><a href=’skype:”+o.skype+”?call’ οnclick=’return skypeCheck();’ class=’zxkf_skype’ ></a></li>”)});var json_msn={options:opts.msn};json_msn=eval(json_msn.options);$.each(json_msn,function(i,o){$kflist.append(“<li><a href=’msnim:chat?contact=”+o.msn+”‘ class=’zxkf_msn’ ></a></li>”)});var json_wangwang={options:opts.wangwang};json_wangwang=eval(json_wangwang.options);$.each(json_wangwang,function(i,o){$kflist.append(“<li><a target=’_blank’ href=’http://amos1.taobao.com/msg.ww?v=2&uid=”+o.wangwang+”=1′ ></a></li>”)});if(opts.tel){$kflist.append(“<li></li>”);var json_tel={options:opts.tel};json_tel=eval(json_tel.options);$.each(json_tel,function(i,o){$kflist.append(“<li>”+o.name+”:<b>”+o.tel+”</b></li>”)})}if(opts.erweima){$kflist.append(“<li></li>”);var json_erweima={options:opts.erweima};json_erweima=eval(json_erweima.options);$.each(json_erweima,function(i,o){$kflist.append(“<li>”+o.name+”:<img src=”+o.erweima+” width=90 /></li>”)})}if(opts.more){$kflist.append(“<li></li><li><a href=’”+opts.more+”‘>>>\u66f4\u591a\u65b9\u5f0f</a></li>”)}var $lrkfwarptop=$lrkfwarp.offset().top;if($.browser.msie&&$.browser.version==6||opts.position==”absolute”){$(window).scroll(function(){var offsetTop=$lrkfwarptop+$(window).scrollTop()+”px”;$lrkfwarp.animate({top:offsetTop},{duration:600,queue:false})})}$lrkf_x.click(function(){$lrkfwarp.hide();return false});if(opts.Event==”"){$lrkfwarp.mouseenter(function(){$(this).stop().animate({right:0})}).mouseleave(function(){$(this).stop().animate({right:-$lrkfwarp_w})})}else{$lrkf_btn.on(“click”,function(){if($lrkfwarp.hasClass(“lrkfshow”)){$lrkfwarp.animate({right:-$lrkfwarp_w},function(){$lrkfwarp.removeClass(“lrkfshow”)})}else{$lrkfwarp.addClass(“lrkfshow”).animate({right:0})}return false})}}})(jQuery);
CSS样式支持
.lrkf .lrkf_box .zxkf_qq{ background:url(images/zxkefu.gif) no-repeat; width:83px; height:26px; display:block;}
.lrkf .lrkf_box .zxkf_msn{ background:url(images/zxkefu.gif) 0px -53px no-repeat; width:83px; height:26px; display:block;}
.lrkf .lrkf_box .zxkf_skype{ background:url(images/zxkefu.gif) 0px -27px no-repeat; width:83px; height:26px; display:block;}
.lrkf .lrkf_box .zxkf_wangwang{ background:url(images/zxkefu.gif) 0px -84px no-repeat; width:83px; height:26px; display:block;}
在线客服图片支持
全局程序支持
globals.php
$web['msn'] = explode(‘,’,$web['msn']);
$web['skype'] = explode(‘,’,$web['skype']);
$web['wangwang'] = explode(‘,’,$web['wangwang']);
最终显示结果