Home  >  Article  >  Backend Development  >  Shenzhen website construction system: display different customer service information according to the website language, Shenzhen website construction_PHP tutorial

Shenzhen website construction system: display different customer service information according to the website language, Shenzhen website construction_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:23:021044browse

Shenzhen website construction system: displays different customer service information according to the website language. Shenzhen website construction

The original program defaults to a dynamic language program, although it can generate static files, such as English websites is generated in the /en/ directory, but the generated customer service information will change frequently. I don’t want the entire site to generate it every time I change the customer service information, so I made it a dynamic call. The PHP processing of the language needs to be as follows

case 'kefu' : ($_GET['i'] > $config['lang_total'] || $_GET['i'] < 1) && die('Parameter Error.'); if(isset($_COOKIE['mlecms_global_language'])){ setcookie('mlecms_global_language',$_GET['i'],$gmt_time + 2592000,'/'); } if($_COOKIE['mlecms_global_language'] <> $_GET['i']){ echo('window.location.reload();'); } echo('$(function(){'); echo(' $("#lrkfwarp").lrkf({'); echo(" kftop:'140',"); echo(' defshow:false,'); //echo(" position:'absolute',"); echo(' qqs:['); foreach($web['qq'] as $i => $qq){ if($i) echo ","; echo "{'name':'Pre-sales".($i+1)."号','qq':'".$qq."'}"; } echo(' ],'); echo(' skype:['); foreach($web['skype'] as $i => $skype){ if($i) echo ","; echo "{'name':'".$skype."','skype':'".$skype."'}"; } echo(' ],'); echo(' msn:['); foreach($web['msn'] as $i => $msn){ if($i) echo ","; echo "{'name':'".$msn."','msn':'".$msn."'}"; } echo(' ],'); echo(' wangwang:['); foreach($web['wangwang'] as $i => $wangwang){ if($i) echo ","; echo "{'name':'".$wangwang."','wangwang':'".$wangwang."'}"; } echo(' ],'); if($_GET['i'] == 1){ echo("erweima:[ {'name':'QR code attention','erweima':'".$web["erweima"]."'} ],"); echo("tel:[ {'name':'24-hour hotline','tel':'".$web["phone"][0]."'}, {'name':'Fax','tel ':'".$web["fax"][0]."'} ],"); }else{ echo("erweima:[ {'name':'wechat','erweima':'".$web["erweima"]."'} ],"); echo("tel:[ {'name':'24 hour Hotline','tel':'".$web["phone"][0]."'}, {'name':'FAX','tel ':'".$web["fax"][0]."'} ],"); } if($_GET['i'] == 1){ echo("more:'".$config['url']."contact.html',more_title:'>>More ways'});});"); }else{ echo("more:'".$config['url']."contact.html',more_title:'>>Contact Us'});});"); } /*echo ("var goumai = document.getElementById('goumai');"); echo ("if (goumai){"); if($_GET['i'] == 1){ echo("document.getElementById('goumai').innerHTML ='Consult NowConsult now';"); }else{ echo("document.getElementById('goumai').innerHTML ='ConsultConsult';"); } echo ("};");*/ break; ​ JS call